Submission #1027926

#TimeUsernameProblemLanguageResultExecution timeMemory
1027926mansurTiles (BOI24_tiles)C++17
4 / 100
25 ms3536 KiB
#include<bits/stdc++.h> using namespace std; #define rall(s) s.rbegin(), s.rend() #define all(s) s.begin(), s.end() #define sz(s) (int)s.size() #define s second #define f first using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int N = 1e6; const int inf = 1e9; void solve() { int n, m; cin >> n >> m; int x[n + 1], y[n + 1]; for (int i = 1; i <= n; i++) cin >> x[i] >> y[i]; if (n & 1) cout << 5 / 0; if (n <= 4) { sort(y + 1, y + n + 1); if ((y[n] - y[1]) & 1) cout << 0 << ' '; else cout << m - (m & 1); return; } for (int i = 1; i <= n; i++) { if ((y[i] & 1) || (x[i] & 1)) { cout << x[i] - (x[i] & 1); return; } } cout << m - (m & 1); } int main() { ios_base::sync_with_stdio(0); cin.tie(0); solve(); }

Compilation message (stderr)

Main.cpp: In function 'void solve()':
Main.cpp:23:23: warning: division by zero [-Wdiv-by-zero]
   23 |  if (n & 1) cout << 5 / 0;
      |                     ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...