QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#148687 | #3531. Prime or number | OneWan | AC ✓ | 1ms | 3832kb | C++20 | 566b | 2023-08-23 17:29:59 | 2023-08-23 20:26:18 |
Judging History
answer
// Problem: C - Prime or number
// Contest: Virtual Judge - Namomo Summer Camp 23 Day 3
// URL: https://vjudge.net/contest/577185#problem/C
// Memory Limit: 254 MB
// Time Limit: 1000 ms
#include <bits/stdc++.h>
using namespace std;
// 2023 OneWan
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
set<long long> st;
long long res = 1;
for (int i = 1 ; i < 63 ; i++) {
st.emplace(res);
st.emplace(res + 1);
res <<= 1;
}
st.erase(1);
long long n;
cin >> n;
cout << (st.count(n) ? "Yes" : "No");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3524kb
input:
2
output:
Yes
result:
ok answer is YES
Test #2:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
42
output:
No
result:
ok answer is NO
Test #3:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
16
output:
Yes
result:
ok answer is YES
Test #4:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
65
output:
Yes
result:
ok answer is YES
Test #5:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
32
output:
Yes
result:
ok answer is YES
Test #6:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
79
output:
No
result:
ok answer is NO
Test #7:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
128
output:
Yes
result:
ok answer is YES
Test #8:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
64
output:
Yes
result:
ok answer is YES
Test #9:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
576460752303423488
output:
Yes
result:
ok answer is YES
Test #10:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
288230376151711744
output:
Yes
result:
ok answer is YES
Test #11:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
1125899906842626
output:
No
result:
ok answer is NO
Test #12:
score: 0
Accepted
time: 1ms
memory: 3832kb
input:
2147483652
output:
No
result:
ok answer is NO
Test #13:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
4294967304
output:
No
result:
ok answer is NO
Test #14:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
2147483648
output:
Yes
result:
ok answer is YES
Test #15:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
4294967296
output:
Yes
result:
ok answer is YES
Test #16:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
8589934592
output:
Yes
result:
ok answer is YES
Test #17:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
1073741824
output:
Yes
result:
ok answer is YES
Test #18:
score: 0
Accepted
time: 1ms
memory: 3772kb
input:
1
output:
No
result:
ok answer is NO
Test #19:
score: 0
Accepted
time: 1ms
memory: 3768kb
input:
1000000000000000000
output:
No
result:
ok answer is NO
Test #20:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
999999999999999999
output:
No
result:
ok answer is NO
Test #21:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
5
output:
Yes
result:
ok answer is YES
Test #22:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
7
output:
No
result:
ok answer is NO
Test #23:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
999999999999999998
output:
No
result:
ok answer is NO
Test #24:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
88005553535
output:
No
result:
ok answer is NO
Test #25:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
228
output:
No
result:
ok answer is NO
Test #26:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
1024
output:
Yes
result:
ok answer is YES
Test #27:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
1023
output:
No
result:
ok answer is NO
Test #28:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
1025
output:
Yes
result:
ok answer is YES