#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n, m; cin >> n >> m;
for (int i = 0; i < m; i++){
int a, b; cin >> a >> b;
}
cout << (n - 1) * (n - 1) << endl;
for (int k = 0; k < n - 1; k++){
for (int i = 0; i < n - 1; i++){
if (i == n - 1){
cout << n - 2 << ' ';
}
for (int j = 0; j < n; j++){
if (i == j){
if (i == n - 1) break;
else cout << j << ' ' << j << ' ';
j++;
}else cout << j << ' ';
}
cout << endl;
}
cout << endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
If people start at 0 and 2, then they can avoid each other |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
360 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Partially correct |
2 ms |
348 KB |
Partially correct |
7 |
Partially correct |
5 ms |
604 KB |
Partially correct |
8 |
Partially correct |
9 ms |
600 KB |
Partially correct |
9 |
Partially correct |
60 ms |
3152 KB |
Partially correct |
# |
Verdict |
Execution time |
Memory |
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 |
Partially correct |
8 ms |
704 KB |
Partially correct |
5 |
Partially correct |
57 ms |
3152 KB |
Partially correct |
6 |
Partially correct |
59 ms |
3156 KB |
Partially correct |
7 |
Partially correct |
17 ms |
1112 KB |
Partially correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
If people start at 0 and 2, then they can avoid each other |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
If people start at 0 and 2, then they can avoid each other |
3 |
Halted |
0 ms |
0 KB |
- |