Submission #793961

#TimeUsernameProblemLanguageResultExecution timeMemory
793961MetalPowerSuper Dango Maker (JOI22_dango3)C++17
100 / 100
2021 ms612 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; bool ans[10005]; vector<int> pos[30]; void Solve(int N, int M) { for(int i = 1; i <= N * M; i++){ int l = 1, r = M; while(l < r){ int mid = l + r >> 1; memset(ans, 0, sizeof ans); for(int j = 1; j <= mid; j++){ for(int x : pos[j]) ans[x] = true; } ans[i] = true; vector<int> vec; for(int i = 1; i <= N * M; i++){ if(!ans[i]) vec.push_back(i); } int curr = Query(vec); if(curr >= M - mid) r = mid; else l = mid + 1; } pos[l].push_back(i); } for(int i = 1; i <= M; i++) Answer(pos[i]); }

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:13:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   13 |      int mid = l + r >> 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...