#include <bits/stdc++.h>
using namespace std;
#define ar array
#define int long long
#define ld long double
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
const int N = 200;
const int X = N * N;
const int K = 500;
const int MOD = 1e9 + 7;
const int LOG = 21;
const int INF = 1e17;
signed main(){ios::sync_with_stdio(false);cin.tie(0);
int n;
cin>>n;
cout<<n - 1<<endl;
for(int i = 0;i + 1< n;i++){
for(int j = 0;j < n;j++){
if(j == i + 1)cout<< j - 1<<" ";
else cout<<j<<" ";
}
cout<<endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
If people start at 1 and 2, then they can avoid each other |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
If people start at 1 and 2, then they can avoid each other |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 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 |
- |