QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#419231#4184. Amusement Arcadezezoo050#WA 1ms3836kbC++20610b2024-05-23 19:15:522024-05-23 19:15:56

Judging History

你现在查看的是最新测评结果

  • [2024-05-23 19:15:56]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3836kb
  • [2024-05-23 19:15:52]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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