# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
783074 | 2023-07-14T14:59:21 Z | JooDdae | Super Dango Maker (JOI22_dango3) | C++17 | 216 ms | 1124 KB |
#include "dango3.h" #include <bits/stdc++.h> using namespace std; using ll = long long; vector<int> done; int query(vector<int> q) { for(auto x : done) q.push_back(x); return Query(q); } 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())); vector<vector<int>> type(N, vector<int>()); for(int i=0;i<N-1;i++) { int l = 1, r = (int)v.size()-1; while(l <= r) { int mid = (l+r) >> 1; auto re = query(vector<int>(v.begin(), v.begin()+mid+1)); if(re) r = mid-1; else l = mid+1; } vector<int> x = vector<int>(v.begin(), v.begin()+l); for(int u=l;u<v.size();u++) { x.push_back(v[u]); if(query(x)) { done.push_back(v[u]), type[i].push_back(v[u]); v.erase(v.begin()+u), u--; } x.pop_back(); } } 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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 468 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 596 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 39 ms | 784 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 216 ms | 1124 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |