QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#785737 | #4953. Displacing Particles | WeaRD276# | AC ✓ | 0ms | 3704kb | C++20 | 1.1kb | 2024-11-26 18:59:48 | 2024-11-26 18:59:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define x first
#define y second
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
typedef long long ll;
typedef double db;
typedef long double LD;
typedef pair<int, int> pii;
typedef pair<db, db> pdd;
typedef pair<ll, ll> pll;
int solve()
{
int n, x, y;
if (!(cin >> n >> x >> y))
return 1;
int ans = 47;
FOR (i, 0, 21)
{
if ((x & 1 << i) || (y & 1 << i))
{
ans = n - i - 1;
break;
}
}
cout << ans << '\n';
return 0;
}
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int TET = 1e9;
//cin >> TET;
for (int i = 1; i <= TET; i++)
{
if (solve())
{
break;
}
#ifdef ONPC
cerr << "_____________________________\n";
#endif
}
#ifdef ONPC
cerr << "\nfinished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec\n";
#endif
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
1 1 1
output:
0
result:
ok single line: '0'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
4 12 4
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
4 3 1
output:
3
result:
ok single line: '3'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
2 2 2
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
2 3 3
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1 1 1
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1 1 1
output:
0
result:
ok single line: '0'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
5 6 18
output:
3
result:
ok single line: '3'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
7 100 44
output:
4
result:
ok single line: '4'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
7 60 4
output:
4
result:
ok single line: '4'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
5 14 2
output:
3
result:
ok single line: '3'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
8 99 117
output:
7
result:
ok single line: '7'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
6 16 16
output:
1
result:
ok single line: '1'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
8 104 152
output:
4
result:
ok single line: '4'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
9 154 374
output:
7
result:
ok single line: '7'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
10 448 960
output:
3
result:
ok single line: '3'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
8 92 68
output:
5
result:
ok single line: '5'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
8 64 192
output:
1
result:
ok single line: '1'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
11 1536 512
output:
1
result:
ok single line: '1'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
11 1792 768
output:
2
result:
ok single line: '2'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
11 128 384
output:
3
result:
ok single line: '3'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
11 1856 1344
output:
4
result:
ok single line: '4'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
10 35 937
output:
9
result:
ok single line: '9'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
12 2411 3263
output:
11
result:
ok single line: '11'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
12 3164 2980
output:
9
result:
ok single line: '9'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
12 3072 3072
output:
1
result:
ok single line: '1'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
14 3200 1408
output:
6
result:
ok single line: '6'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
12 3776 704
output:
5
result:
ok single line: '5'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
16 57344 8192
output:
2
result:
ok single line: '2'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
19 311296 311296
output:
4
result:
ok single line: '4'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
20 98304 98304
output:
4
result:
ok single line: '4'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
15 26300 12788
output:
12
result:
ok single line: '12'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
17 72081 8561
output:
16
result:
ok single line: '16'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
16 16384 49152
output:
1
result:
ok single line: '1'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
20 524288 524288
output:
0
result:
ok single line: '0'
Test #36:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
20 739328 940032
output:
8
result:
ok single line: '8'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
20 133072 326960
output:
15
result:
ok single line: '15'
Test #38:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
20 802816 442368
output:
5
result:
ok single line: '5'
Test #39:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
20 262144 262144
output:
1
result:
ok single line: '1'
Test #40:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
20 262144 786432
output:
1
result:
ok single line: '1'