# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
904928 | 2024-01-12T11:27:51 Z | nguyentunglam | Super Dango Maker (JOI22_dango3) | C++17 | 361 ms | 684 KB |
#include "dango3.h" #include<bits/stdc++.h> #include <vector> using namespace std; mt19937 rng(1); void Solve(int n, int m) { vector<int> p; for(int i = 1; i <= n * m; i++) p.push_back(i); for(int group = 1; group <= m; group++) { // shuffle(p.begin(), p.end(), rng); int l = n, r = p.size(), last = 0; while (l <= r) { int mid = l + r >> 1; vector<int> tmp; for(int i = 0; i < mid; i++) tmp.push_back(p[i]); if (Query(tmp)) { r = mid - 1; last = mid; } else l = mid + 1; } assert(last); vector<int> _p, ans; for(int i = last; i < p.size(); i++) _p.push_back(p[i]); for(int i = 0; i < last; i++) ans.push_back(p[i]); for(int i = 0; i < last; i++) { vector<int> _ans; for(int &j : ans) if (j != p[i]) _ans.push_back(j); if (Query(_ans)) { ans = _ans; _p.push_back(p[i]); } } p = _p; Answer(ans); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 348 KB | Output is correct |
2 | Correct | 4 ms | 348 KB | Output is correct |
3 | Correct | 9 ms | 344 KB | Output is correct |
4 | Correct | 8 ms | 348 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 56 ms | 572 KB | Output is correct |
2 | Correct | 64 ms | 592 KB | Output is correct |
3 | Incorrect | 361 ms | 624 KB | Wrong Answer [3] |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 216 ms | 684 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |