隔壁OJ直接AC,为什么洛谷这全WA?
查看原帖
隔壁OJ直接AC,为什么洛谷这全WA?
465018
飞龙project楼主2022/2/28 12:10

隔壁HydroOJ能AC(链接),但是这里全WA......

code:

#include <bits/stdc++.h>
#define mian main
using namespace std;

int k;

__int128 cnt;

void exe(int s) {
    char c = getchar();
    switch (c) {
        case '0':
            cnt += ((__int128)1 << s) * ((__int128)1 << s);
            return;
        case '1':
            return;
        case '2':
            exe(s - 1);
            exe(s - 1);
            exe(s - 1);
            exe(s - 1);
        default:
            return;
    }
    return;
}

void qp(__int128 x) {
    if (x >= 10)
        qp(x / 10);
    putchar((x % 10) + '0');
}

int mian() {
    cin >> k;
    getchar();

    exe(k);

    qp(cnt);

    return 0;
}
2022/2/28 12:10
加载中...