QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#136481 | #4184. Amusement Arcade | RetiredButNotTired# | AC ✓ | 1ms | 3728kb | C++17 | 747b | 2023-08-08 20:33:40 | 2023-08-08 20:33:43 |
Judging History
answer
// Hey there.. I love you <3
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 rnd(time(nullptr));
const int N = 1e5 + 5, mod = 1e9 + 7;
const double pi = acos(-1), eps = 1e-10;
void work() {
ll x;
cin >> x;
--x;
int b = __builtin_popcountll(x);
if (b > 2)
cout << "impossible" << endl;
else
cout << (x & -x) + 1 << endl;
}
void init() {
cin.tie(nullptr);
istream::sync_with_stdio(false);
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
}
int main() {
init();
int testCases = 1;
// cin >> testCases;
while (testCases--) work();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3468kb
input:
7
output:
3
result:
ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
15
output:
impossible
result:
ok
Test #3:
score: 0
Accepted
time: 1ms
memory: 3704kb
input:
19
output:
3
result:
ok
Test #4:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
2049
output:
2049
result:
ok
Test #5:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
32769
output:
32769
result:
ok
Test #6:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
536870913
output:
536870913
result:
ok
Test #7:
score: 0
Accepted
time: 1ms
memory: 3724kb
input:
35184372088833
output:
35184372088833
result:
ok
Test #8:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
2251799813685249
output:
2251799813685249
result:
ok
Test #9:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
576460752303423489
output:
576460752303423489
result:
ok
Test #10:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
1027
output:
3
result:
ok
Test #11:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
2081
output:
33
result:
ok
Test #12:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
34393292801
output:
33554433
result:
ok
Test #13:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
1
output:
1
result:
ok
Test #14:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
281543696187393
output:
68719476737
result:
ok
Test #15:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
576460752303423491
output:
3
result:
ok
Test #16:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
576460752336977921
output:
33554433
result:
ok
Test #17:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
576461851815051265
output:
1099511627777
result:
ok
Test #18:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
864691128455135233
output:
288230376151711745
result:
ok
Test #19:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
635
output:
impossible
result:
ok
Test #20:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
4537995
output:
impossible
result:
ok
Test #21:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
4795018843
output:
impossible
result:
ok
Test #22:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
5268828738869
output:
impossible
result:
ok
Test #23:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
3859135424551273
output:
impossible
result:
ok
Test #24:
score: 0
Accepted
time: 1ms
memory: 3464kb
input:
3
output:
3
result:
ok
Test #25:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
63913510461995523
output:
impossible
result:
ok
Test #26:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
341683697045680425
output:
impossible
result:
ok
Test #27:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
999999999999999999
output:
impossible
result:
ok
Test #28:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
5
output:
5
result:
ok
Test #29:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
9
output:
9
result:
ok
Test #30:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
11
output:
3
result:
ok
Test #31:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
13
output:
5
result:
ok
Test #32:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
17
output:
17
result:
ok