# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
382008 |
2021-03-26T09:25:38 Z |
VEGAnn |
Hop (COCI21_hop) |
C++14 |
|
41 ms |
1388 KB |
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define PB push_back
#define i2 array<int,2>
using namespace std;
typedef long long ll;
const int MX = int(1e7) + 10;
const int oo = 2e9;
const int N = 1010;
ll x[N];
int n;
int dp[N][3];
void BAD(){
cout << "BAD" << endl;
while (1) {}
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL
freopen("in.txt","r",stdin);
#endif // _LOCAL
cin >> n;
/// хотя бы один должен быть доступен, иначе ban
for (int i = 1; i <= n; i++)
cin >> x[i];
// for (int t1 = 0; t1 < 4; t1++)
// for (int t2 = 0; t2 < 4; t2++)
// for (int t3 = 0; t3 < 4; t3++)
// dp[1][t1][t2][t3] =
dp[1][0] = dp[1][1] = dp[1][2] = 0;
int now = 0;
for (int i = 1; i <= n; i++){
for (int j = 1; j < i; j++)
cout << ((++now) % 3) + 1 << " ";
cout << '\n';
}
// for (int i = 2; i <= n; i++){
// dp[i][0] = dp[i][1] = dp[i][2] = 0;
//
// for (int j = 1; j < i; j++){
// if (x[i] % x[j] == 0) {
// if (dp[i][0] == 2 && dp[i][1] == 2 && dp[i][2] == 2)
// BAD();
//
// int mn = oo, id = -1;
//
// for (int z = 0; z < 3; z++)
// if (mn > dp[j][z] + 1){
// mn = dp[j][z] + 1;
// id = z;
// }
//
// dp[i][id] = max(dp[i][id], mn);
//
// cout << id + 1 << " ";
// } else cout << "1 ";
// }
//
// cout << '\n';
// }
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
40 ms |
1388 KB |
Output is correct |
9 |
Correct |
2 ms |
384 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
34 ms |
1388 KB |
Output is correct |
12 |
Correct |
41 ms |
1388 KB |
Output is correct |
13 |
Correct |
38 ms |
1260 KB |
Output is correct |
14 |
Correct |
3 ms |
364 KB |
Output is correct |
15 |
Correct |
35 ms |
1388 KB |
Output is correct |
16 |
Correct |
35 ms |
1260 KB |
Output is correct |
17 |
Correct |
37 ms |
1296 KB |
Output is correct |
18 |
Correct |
35 ms |
1260 KB |
Output is correct |
19 |
Correct |
35 ms |
1260 KB |
Output is correct |
20 |
Correct |
35 ms |
1260 KB |
Output is correct |
21 |
Correct |
35 ms |
1260 KB |
Output is correct |
22 |
Correct |
35 ms |
1260 KB |
Output is correct |
23 |
Correct |
40 ms |
1388 KB |
Output is correct |