#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
int n,m,vis[18];
vector<vector<int>>alln;
vector<int>tof;
void aval(int now=0,int mina=0){
if(now==4){
alln.push_back(tof);
return ;
}
for(int i=mina+1;i<=16;i++){
tof.push_back(i);
aval(now+1,i);
tof.pop_back();
}
}
void Solve(int N, int M) {
n=N;
m=M;
if(n!=4||m!=4){
assert(0);
}
aval();
vector<int>now;
for(int i=1;i<=n*m;i++){
now.push_back(i);
}
for(int i=0;i<4;i++){
for(int j=0;j<(int)alln.size();j++){
int f=0;
for(auto x:alln[j]){
if(vis[x]==1){
f=1;
}
}
if(f==0){
int z=Query(alln[j]);
if(z==1){
Answer(alln[j]);
// cout<<"wtf: ";
for(auto x:alln[j]){
// cout<<x<<" ";
vis[x]=1;
}
// cout<<"\n";
}
}
}
}
}
# |
결과 |
실행 시간 |
메모리 |
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 |
1 ms |
348 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 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |