QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#518526 | #7606. Digital Nim | krishnnnna | WA | 0ms | 3700kb | C++17 | 647b | 2024-08-13 21:27:34 | 2024-08-13 21:27:34 |
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;
cout<<y<<endl;
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();
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3700kb
input:
4 1 10 42 190
output:
1 Algosia 10 Bajtek 7 Algosia 19 Algosia
result:
wrong answer 1st lines differ - expected: 'Algosia', found: '1'