Submission #102395

#TimeUsernameProblemLanguageResultExecution timeMemory
102395MilkiTreasure (different grader from official contest) (CEOI13_treasure2)C++14
0 / 100
3 ms512 KiB
#include <bits/stdc++.h> #include "treasure.h" using namespace std; #define FOR(i, a, b) for(int i = a; i < b; ++i) #define REP(i, n) FOR(i, 0, n) #define _ << " " << #define sz(x) ((int) x.size()) #define pb(x) push_back(x) #define TRACE(x) cerr << #x << " = " << x << endl typedef long long ll; typedef pair<ll, ll> point; const int MAXN = 105; int pref[MAXN][MAXN]; int sum; void findTreasure(int n){ int mid = (n + 1) / 2; for(int i = n; i > 0; --i) for(int j = n; j > 0; --j) { if(i >= mid && j >= mid) pref[i][j] = countTreasure(1, 1, i, j); else if(i >= mid && j <= mid) pref[i][j] = pref[i][n] - countTreasure(1, j + 1, i, n); else if(i <= mid && j >= mid) pref[i][j] = pref[n][j] - countTreasure(i + 1, 1, n, j); else pref[i][j] = pref[n][n] - countTreasure(i + 1, j + 1, n, n) - pref[i][n] - pref[n][j]; } FOR(i, 1, n + 1) FOR(j, 1, n + 1) if(pref[i][j] - pref[i - 1][j] - pref[i][j - 1] + pref[i - 1][j - 1]) Report(i, j); }
#Verdict Execution timeMemoryGrader output
Fetching results...