QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#419231 | #4184. Amusement Arcade | zezoo050# | WA | 1ms | 3836kb | C++20 | 610b | 2024-05-23 19:15:52 | 2024-05-23 19:15:56 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e2 + 5, M = 15;
void tc() {
ll n;
cin >> n;
if (n == 1) {
cout << 1 << '\n';
return;
}
if (__builtin_popcountll(n - 1) == 1 or __builtin_popcountll(n - 3) == 1) {
ll pos = n / 2;
if (pos % 2 == 0)
pos++;
cout << pos << '\n';
} else cout << "impossible\n";
}
signed main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t = 1;
// cin >> t;
while (t--) {
tc();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3544kb
input:
7
output:
3
result:
ok
Test #2:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
15
output:
impossible
result:
ok
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3636kb
input:
19
output:
9
result:
wrong answer WA: not all guests will get a seat