# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1067144 | 2024-08-20T12:01:43 Z | 0npata | Tiles (BOI24_tiles) | C++17 | 105 ms | 5628 KB |
#include<bits/stdc++.h> using namespace std; #define int long long #define vec vector const int INF = 1e17; int32_t main() { int n, m; cin >> n >> m; vec<pair<int, int>> ps(n); for(int i = 0; i<n; i++) { cin >> ps[i].first >> ps[i].second; } vec<pair<int, int>> ps_filt{ps[0]}; for(int i = 1; i<n-1; i++) { if(ps_filt.back().first == ps[i].first) { ps_filt.pop_back(); ps_filt.push_back(ps[i]); } else { if(ps[i].second != ps[i+1].second) { ps_filt.push_back(ps[i]); } } } if(ps_filt[0].second % 2) { cout << ps_filt[0].first << '\n'; return 0; } int ans = 0; for(int i = 1; i<ps_filt.size(); i+=2) { if(ps_filt[i].second % 2 || (ps_filt[i].first-ps_filt[i-1].first)%2) { cout << ps_filt[i].first << '\n'; return 0 ; } } cout << ps_filt.back().first << '\n'; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 105 ms | 5628 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |