Submission #544703

#TimeUsernameProblemLanguageResultExecution timeMemory
544703kevinxiehkSuper Dango Maker (JOI22_dango3)C++17
100 / 100
3890 ms780 KiB
#include "dango3.h" #include <bits/stdc++.h> #define mp make_pair #define pb emplace_back #define fi first #define se second // #define int long long #define inf 1e18 #define ick cout<<"ickbmi32.9\n" using namespace std; namespace { int variable_example = 1; } // namespace vector<int> dk; vector<int> pre; int n, m; vector<int> sure[35]; bool har[10005]; int ask(int k, int l, int r) { // cerr << k << ' ' << l << ' ' << r << '\n'; vector<int> t; for(int i = 1; i <= n * m; i++) har[i] = true; for(int x = l; x <= r; x++) { for(auto y: sure[x]) har[y] = false; } har[k] = false; for(int i = 1; i <= n * m; i++) if(har[i]) t.pb(i); return Query(t); } void Solve(int N, int M) { n = N, m = M; for(int i = 1; i <= n * m; i++) { int l = 0, r = m - 1; while(l < r) { int mid = ((l + r) >> 1); if(ask(i, l, mid) < m - (mid - l + 1)) l = mid + 1; else r = mid; } sure[l].pb(i); } for(int i = 0; i < m; i++) Answer(sure[i]); // return; // sure[n - 1] = dk; // vector<int> ans; // for(int i = 0; i < m; i++) { // ans.clear(); // for(int j = 0; j < n; j++) { // ans.pb(sure[j][i]); // } // Answer(ans); // } return; }

Compilation message (stderr)

dango3.cpp:14:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   14 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...