QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#518407#7606. Digital NimkrishnnnnaWA 9ms3676kbC++17619b2024-08-13 20:14:012024-08-13 20:14:02

Judging History

你现在查看的是最新测评结果

  • [2024-08-13 20:14:02]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:3676kb
  • [2024-08-13 20:14:01]
  • 提交

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<<"Bajtek"<<endl;
        }
        else { cout << "Algosia" << 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: 3676kb

input:

4
1
10
42
190

output:

Algosia
Bajtek
Algosia
Algosia

result:

ok 4 lines

Test #2:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

1
1

output:

Algosia

result:

ok single line: 'Algosia'

Test #3:

score: -100
Wrong Answer
time: 9ms
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
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'