# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
704925 | 2023-03-03T06:51:31 Z | piOOE | Super Dango Maker (JOI22_dango3) | C++17 | 1719 ms | 1024 KB |
#include "dango3.h" #include <bits/stdc++.h> using namespace std; mt19937 rnd(228); void Solve(int n, int m) { const int N = n * m; vector<int> ord(N); iota(ord.begin(), ord.end(), 1); shuffle(ord.begin(), ord.end(), rnd); set<int> st; set<int> left; for (int x : ord) { left.insert(x); } for (int x : ord) { if (left.size() == n) { Answer(vector(left.begin(), left.end())); break; } st.insert(x); if (Query(vector(st.begin(), st.end())) == 1) { vector<int> stick{x}; vector<int> consider(st.begin(), st.end()); consider.erase(find(consider.begin(), consider.end(), x)); set<int> save; for (int y : consider) { st.erase(y); if (stick.size() < n && Query(vector(st.begin(), st.end())) == 0) { stick.push_back(y); st.insert(y); } else { save.insert(y); } } Answer(stick); for (int y : stick) { left.erase(y); } swap(st, save); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 340 KB | Output is correct |
2 | Correct | 0 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 0 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 0 ms | 340 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 18 ms | 468 KB | Output is correct |
2 | Correct | 17 ms | 340 KB | Output is correct |
3 | Correct | 16 ms | 464 KB | Output is correct |
4 | Correct | 19 ms | 468 KB | Output is correct |
5 | Correct | 22 ms | 476 KB | Output is correct |
6 | Correct | 22 ms | 472 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 497 ms | 692 KB | Output is correct |
2 | Correct | 562 ms | 848 KB | Output is correct |
3 | Correct | 485 ms | 828 KB | Output is correct |
4 | Correct | 488 ms | 708 KB | Output is correct |
5 | Correct | 459 ms | 716 KB | Output is correct |
6 | Correct | 454 ms | 696 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1719 ms | 1024 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |