QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#518483 | #7606. Digital Nim | krishnnnna | WA | 6ms | 3700kb | C++17 | 620b | 2024-08-13 21:01:46 | 2024-08-13 21:01:47 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve() {
int n ; cin>>n; ll sum=0;
int s = n;
while(n>0){
int x = n%10;
sum+=x;
n/=10;
}
int y = s/sum;
if((s%sum)==0){
if((y%2)==0){
cout<<"Bajtek"<<endl;
}
else { cout << "Algosia" << endl;}
}
else{
y = y+1;
if((y%2)==0){
cout<<"Algosia"<<endl;
}
else { cout << "Bajtek" << endl;}
}
}
int main() {
ll t ; cin>>t;
for(int i = 0; i < t;i++){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3660kb
input:
4 1 10 42 190
output:
Algosia Bajtek Algosia Algosia
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
1 1
output:
Algosia
result:
ok single line: 'Algosia'
Test #3:
score: -100
Wrong Answer
time: 6ms
memory: 3652kb
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 Bajtek Algosia Bajtek Bajtek Bajtek Bajtek Bajtek Algosia Bajtek Algosia Algosia Bajtek Bajtek Algosia Algosia Algosia Bajtek Bajtek Bajtek Algosia Bajtek Algosia Bajtek Bajtek Bajtek Algosia Algosia Algosia Bajte...
result:
wrong answer 12th lines differ - expected: 'Algosia', found: 'Bajtek'