# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
940434 | 2024-03-07T09:13:46 Z | borisAngelov | Super Dango Maker (JOI22_dango3) | C++17 | 905 ms | 748 KB |
#include "dango3.h" #include <bits/stdc++.h> using namespace std; const int maxn = 10005; const int maxm = 30; int n, m; bool taken[maxn]; vector<int> ans[maxm]; void Solve(int N, int M) { n = N; m = M; for (int i = 1; i <= n * m; ++i) { taken[i] = false; } int currm = m; for (int i = 1; i <= m; ++i) { vector<int> active; bool first = true; for (int j = 1; j <= n * m; ++j) { if (taken[j] == false) { if (first == true) { first = false; ans[i].push_back(j); //cout << "set " << j << " taken " << endl; taken[j] = true; } else { //cout << "add " << j << endl; active.push_back(j); } } } if (active.size() == n - 1) { for (int j = 0; j < active.size(); ++j) { ans[i].push_back(active[j]); } break; } /*cout << "now active are " << endl; for (int j = 0; j < active.size(); ++j) { cout << active[j] << ' '; } cout << endl;*/ for (int j = 0; j < active.size(); ++j) { vector<int> currQuery; for (int k = 0; k < active.size(); ++k) { if (j != k && taken[active[k]] == false) { currQuery.push_back(active[k]); } } if (Query(currQuery) == currm - 1) { //cout << "set " << active[j] << " taken " << endl; taken[active[j]] = true; ans[i].push_back(active[j]); if (ans[i].size() == n) { break; } } } /*for (int j = 0; j < n; ++j) { cout << ans[i][j] << ' '; } cout << endl;*/ --currm; } for (int i = 1; i <= m; ++i) { Answer(ans[i]); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 436 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 436 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 348 KB | Output is correct |
2 | Correct | 7 ms | 348 KB | Output is correct |
3 | Correct | 14 ms | 412 KB | Output is correct |
4 | Correct | 13 ms | 348 KB | Output is correct |
5 | Correct | 4 ms | 516 KB | Output is correct |
6 | Correct | 4 ms | 500 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 257 ms | 608 KB | Output is correct |
2 | Correct | 334 ms | 604 KB | Output is correct |
3 | Incorrect | 641 ms | 628 KB | Wrong Answer [3] |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 905 ms | 748 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |