#include "dango3.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int n, m;
const int N = 401;
bool bad[N * 26];
int B = -1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
unordered_map<ll, int> mem;
int qr(vector<int> &f) {
set<int> s;
for(int i = 1; i <= n * m; i++) {
s.insert(i);
}
for(int i:f) {
s.erase(i);
}
vector<int> t;
for(int j:s) {
t.push_back(j);
}
return m - Query(t);
}
vector<int> res[26];
void Solve(int _n, int _m) {
n = _n, m = _m;
vector<int> f, bf;
for(int i = 1; i <= n * m; i++) {
f.push_back(i);
}
for(int i:f) {
vector<int> o(m);
iota(o.begin(), o.end(), 1);
for(int j:o) {
if((int)res[j].size() == n) continue;
res[j].push_back(i);
if(qr(res[j]) <= 1) {
break;
}
res[j].pop_back();
}
}
for(int i = 1; i <= m; i++) {
Answer(res[i]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
202 ms |
596 KB |
Output is correct |
2 |
Correct |
177 ms |
348 KB |
Output is correct |
3 |
Correct |
299 ms |
348 KB |
Output is correct |
4 |
Correct |
300 ms |
444 KB |
Output is correct |
5 |
Correct |
72 ms |
540 KB |
Output is correct |
6 |
Correct |
81 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10063 ms |
844 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
10064 ms |
1192 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |