#include "prison.h"
#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > devise_strategy(int n) {
vector<vector<int> > ans(n);
for(int i = 0; i < n; i++) {
if(i == 0)
ans[i].push_back(0);
else
ans[i].push_back(1);
for(int j = 1; j <= n; j++) {
if(i == 0) {
if(j == 1)
ans[i].push_back(-1);
else if(j == n)
ans[i].push_back(-2);
else
ans[i].push_back(j);
} else if(i == 1) {
if(j == 1)
ans[i].push_back(-2);
else if(j == n)
ans[i].push_back(-1);
else
ans[i].push_back(0);
} else {
if(i > j)
ans[i].push_back(-2);
else if(i == j)
ans[i].push_back(0);
else
ans[i].push_back(-1);
}
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
7 ms |
724 KB |
Output is correct |
4 |
Correct |
7 ms |
992 KB |
Output is correct |
5 |
Correct |
24 ms |
2028 KB |
Output is correct |
6 |
Correct |
24 ms |
2004 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
15 ms |
1492 KB |
Output is correct |
9 |
Correct |
16 ms |
1620 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
1 ms |
468 KB |
Wrong answer detected in grader |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
29 ms |
27724 KB |
Wrong answer detected in grader |
5 |
Halted |
0 ms |
0 KB |
- |