QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#426197 | #7606. Digital Nim | real_sigma_team# | WA | 1ms | 3664kb | C++20 | 854b | 2024-05-30 22:28:14 | 2024-05-30 22:28:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
bool dp[N];
signed main() {
cin.tie(nullptr)->sync_with_stdio(false);
int tests;
cin >> tests;
while (tests--) {
long long n;
cin >> n;
if (n % 10 != 0) cout << "Algosia\n";
else {
n /= 10;
int sm = 0;
int len = 0;
while (n) sm += n % 10, n /= 10, len++;
if (sm >= 10 & sm % 2 == len % 2) cout << "Algosia\n";
else cout << "Bajtek\n";
}
}
return 0;
for (int i = 0; i < N; ++i) {
int sm = 0;
for (int x = i; x; sm += x % 10, x /= 10);
for (int j = i - sm / 10; j < i; ++j) if (!dp[j]) dp[i] = true;
}
for (int i = 0; i < 200; ++i) {
if (dp[i]) cout << i << endl;
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3664kb
input:
4 1 10 42 190
output:
Algosia Bajtek Algosia Algosia
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1 1
output:
Algosia
result:
ok single line: 'Algosia'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3656kb
input:
10000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...
output:
Algosia Algosia Algosia Algosia Algosia Algosia Algosia Algosia Algosia Bajtek Algosia Algosia Algosia Algosia Algosia Algosia Algosia Algosia Algosia Bajtek Algosia Algosia Algosia Algosia Algosia Algosia Algosia Algosia Algosia Bajtek Algosia Algosia Algosia Algosia Algosia Algosia Algosia Algosia...
result:
wrong answer 1090th lines differ - expected: 'Algosia', found: 'Bajtek'