QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#518519 | #7606. Digital Nim | krishnnnna | WA | 4ms | 3736kb | C++17 | 611b | 2024-08-13 21:18:20 | 2024-08-13 21:18:20 |
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;
if(s%sum==0){
y=s/sum;
if(y%2==0)cout<<"Bajtek"<<"\n";
else cout<<"Algosia"<<"\n";
}
else{
n=s;
n=n%sum;
y=s-n;
y=(y/sum)+1;
if(y%2==0)cout<<"Bajtek"<<"\n";
else cout<<"Algosia"<<"\n";
}
}
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: 3716kb
input:
1 1
output:
Algosia
result:
ok single line: 'Algosia'
Test #3:
score: -100
Wrong Answer
time: 4ms
memory: 3736kb
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 Bajtek Bajtek Bajtek Algosia Algosia Algosia Algosia Bajtek Bajtek Bajtek Algosia Bajtek Algosia Bajtek Bajtek Bajtek Algosia Algosia Algosia Bajtek Bajtek Algosia Bajtek Algosia Algosia Bajtek Bajtek Bajtek Bajtek Bajtek...
result:
wrong answer 11th lines differ - expected: 'Algosia', found: 'Bajtek'