# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
785425 | 2023-07-17T09:04:54 Z | JooDdae | Super Dango Maker (JOI22_dango3) | C++17 | 884 ms | 620 KB |
#include "dango3.h" #include <bits/stdc++.h> using namespace std; using ll = long long; int cnt; vector<int> type[400]; int query(vector<int> v) { for(int i=0;i<cnt;i++) for(int j=1;j<type[i].size();j++) v.push_back(type[i][j]); return Query(v); } void Solve(int N, int M) { vector<int> v(N*M); iota(v.begin(), v.end(), 1); random_device rd; shuffle(v.begin(), v.end(), mt19937(rd())); for(int i=0;i<N*M;i++) { int u = v.back(); v.pop_back(); int re = query(v); if(re == M-1) { type[cnt++].push_back(u); continue; } int l = 0, r = cnt-1; while(l < r) { int mid = (l+r)/2; for(int i=l;i<=mid;i++) v.push_back(type[i][0]); int re = query(v); for(int i=l;i<=mid;i++) v.pop_back(); if(re == M-1) r = mid; else l = mid+1; } type[l].push_back(u); } type[N-1] = v; for(int i=0;i<M;i++) { vector<int> re; for(int j=0;j<N;j++) { re.push_back(type[j][i]); } Answer(re); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 0 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 376 KB | Output is correct |
4 | Correct | 0 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 15 ms | 420 KB | Output is correct |
2 | Correct | 15 ms | 340 KB | Output is correct |
3 | Correct | 15 ms | 384 KB | Output is correct |
4 | Correct | 15 ms | 340 KB | Output is correct |
5 | Correct | 15 ms | 392 KB | Output is correct |
6 | Correct | 15 ms | 396 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 449 ms | 452 KB | Output is correct |
2 | Correct | 454 ms | 520 KB | Output is correct |
3 | Correct | 443 ms | 500 KB | Output is correct |
4 | Correct | 777 ms | 528 KB | Output is correct |
5 | Correct | 450 ms | 552 KB | Output is correct |
6 | Correct | 466 ms | 620 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 884 ms | 576 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |