# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
382250 |
2021-03-26T20:24:43 Z |
Vimmer |
Hop (COCI21_hop) |
C++14 |
|
60 ms |
1408 KB |
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("Ofast")
#define N 200501
#define NN 10000010
#define PB push_back
#define M ll(1e9 + 7)
#define all(x) x.begin(), x.end()
#define sz(x) int(x.size())
#define _ << " " <<
#define pri(x) cout << x << endl
#define endl '\n'
#define F first
#define S second
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef short int si;
typedef long double ld;
//typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
int main()
{
ios_base::sync_with_stdio(0); istream::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// freopen("1.in", "r", stdin);
int n;
cin >> n;
ll x[n];
for (int i = 0; i < n; i++)
cin >> x[i];
for (int i = 1; i < n; i++, cout << endl)
for (int j = 0; j < i; j++)
{
if (x[i] % x[j] != 0)
{
cout << 1 << " ";
continue;
}
ll l, r;
for (int u = 0; u < 60; u++)
{
if (x[i] % (1ll << u) == 0)
l = u;
if (x[j] % (1ll << u) == 0)
r = u;
}
l = (1ll << l);
r = (1ll << r);
if (l / 4 == r / 4)
{
cout << 1 << " ";
}
else if (l / 16 == r / 16)
{
cout << 2 << " ";
}
else cout << 3 << " ";
}
}
Compilation message
Main.cpp: In function 'int main()':
Main.cpp:69:22: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
69 | r = (1ll << r);
| ~~~~~^~~~~
Main.cpp:67:22: warning: 'l' may be used uninitialized in this function [-Wmaybe-uninitialized]
67 | l = (1ll << l);
| ~~~~~^~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
1 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 |
3 ms |
364 KB |
Output is correct |
8 |
Correct |
46 ms |
1388 KB |
Output is correct |
9 |
Correct |
4 ms |
364 KB |
Output is correct |
10 |
Correct |
3 ms |
364 KB |
Output is correct |
11 |
Correct |
46 ms |
1132 KB |
Output is correct |
12 |
Correct |
45 ms |
1388 KB |
Output is correct |
13 |
Correct |
60 ms |
1260 KB |
Output is correct |
14 |
Correct |
5 ms |
364 KB |
Output is correct |
15 |
Correct |
42 ms |
1260 KB |
Output is correct |
16 |
Correct |
47 ms |
1408 KB |
Output is correct |
17 |
Correct |
42 ms |
1260 KB |
Output is correct |
18 |
Correct |
46 ms |
1260 KB |
Output is correct |
19 |
Correct |
44 ms |
1260 KB |
Output is correct |
20 |
Correct |
41 ms |
1260 KB |
Output is correct |
21 |
Correct |
40 ms |
1260 KB |
Output is correct |
22 |
Correct |
41 ms |
1260 KB |
Output is correct |
23 |
Correct |
44 ms |
1388 KB |
Output is correct |