# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
554611 | 2022-04-28T23:41:44 Z | Arvin | Super Dango Maker (JOI22_dango3) | C++17 | 390 ms | 504 KB |
#include "dango3.h" #include <bits/stdc++.h> using namespace std; //namespace { // int variable_example = 1; //} // namespace void Solve(int n, int m) { int len = n*m; vector<int> v; for(int x=0;x<len;x++){ v.push_back(x+1); } int lst = len-1; for(int x=len-1;x>=0;x--){ int res = Query(v); if(res >= 1){ lst = x; } v.pop_back(); } bool valid[len]; fill(valid, valid+len, false); for(int x=0;x<=lst;x++) valid[x] = true; for(int x=0;x<=lst;x++){ valid[x] ^= 1; vector<int> w; for(int y=0;y<=lst;y++){ if(valid[y]){ w.push_back(y+1); } } int res = Query(w); if(res >= 1){ continue; } valid[x] ^= 1; } int c[len]; fill(c, c+len, -1); v.clear(); for(int x=0;x<=lst;x++){ if(valid[x]){ v.push_back(x+1); } } for(int x=0;x<v.size();x++){ c[v[x]-1] = x; } for(int x=0;x<v.size();x++){ vector<int> w; for(int y=0;y<x;y++){ w.push_back(v[y]); } for(int y=x+1;y<v.size();y++){ w.push_back(v[y]); } for(int y=0;y<len;y++){ if(c[y] == -1){ w.push_back(y+1); if(Query(w) >= 1){ c[y] = c[v[x]-1]; } w.pop_back(); } } } vector<int> ans[n]; for(int x=0;x<len;x++){ ans[c[x]].push_back(x); } for(int x=0;x<m;x++){ vector<int> w; for(int y=0;y<n;y++){ w.push_back(ans[y][x]+1); } Answer(w); } // vector<int> x(3); // x[0] = 1; // x[1] = 2; // x[2] = 3; // variable_example = Query(x); // for (int i = 0; i < M; i++) { // std::vector<int> a(N); // for (int j = 0; j < N; j++) { // a[j] = N * i + j + 1; // } // Answer(a); // } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 308 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 1 ms | 340 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 39 ms | 304 KB | Output is correct |
2 | Correct | 36 ms | 356 KB | Output is correct |
3 | Correct | 42 ms | 304 KB | Output is correct |
4 | Correct | 41 ms | 340 KB | Output is correct |
5 | Correct | 35 ms | 340 KB | Output is correct |
6 | Correct | 37 ms | 352 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 128 ms | 452 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 390 ms | 504 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |