Submission #3777653
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; const double EPS = 1e-9; typedef vector<int> vint; typedef pair<int, int> pint; #define rep(i, n) REP(i, 0, n) #define ALL(v) v.begin() , v.end() #define REP(i, x, n) for(int i = x; i < n; i++) int main(){ int N, M, i, j; cin >> N >> M; pint zahyo[N], point[M]; rep(i, N) cin >> zahyo[i].first >> zahyo[i].second; rep(i, M) cin >> point[i].first >> point[i].second; rep(i, N){ int minj = 1; int mini = 10000000000; rep(j, M){ int temp = abs(zahyo[i].first - point[j].first) + abs(zahyo[i].second - point[j].second); if(mini > temp){ mini = temp; minj = j+1; } } cout << minj << endl; } }
Submission Info
Submission Time | |
---|---|
Task | B - Checkpoints |
User | cowgirl |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 751 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:19:16: warning: overflow in implicit constant conversion [-Woverflow] int mini = 10000000000; ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |
subtask_1_1.txt | AC | 1 ms | 256 KB |
subtask_1_2.txt | AC | 1 ms | 256 KB |
subtask_1_3.txt | AC | 1 ms | 256 KB |
subtask_1_4.txt | AC | 1 ms | 256 KB |
subtask_1_5.txt | AC | 1 ms | 256 KB |
subtask_1_6.txt | AC | 1 ms | 256 KB |
subtask_1_7.txt | AC | 1 ms | 256 KB |