Submission #24299577
Source Code Expand
Copy
#include <bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(false);string s;int n, ans;cin >> n;cin >> s;for(int i = 0; i < n; i++){if(s[i] == '1'){ans = i;break;}}if(ans % 2 == 0) cout<<"Takahashi\n";else cout<<"Aoki\n";return 0;}
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); string s; int n, ans; cin >> n; cin >> s; for(int i = 0; i < n; i++){ if(s[i] == '1'){ ans = i; break; } } if(ans % 2 == 0) cout<<"Takahashi\n"; else cout<<"Aoki\n"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Bouzu Mekuri |
User | Vliberty |
Language | C++ (GCC 9.2.1) |
Score | 200 |
Code Size | 306 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 3776 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:16:13: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized] 16 | if(ans % 2 == 0) cout<<"Takahashi\n"; | ~~~~~~~~^~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, example0.txt, example1.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 6 ms | 3612 KB |
001.txt | AC | 2 ms | 3564 KB |
002.txt | AC | 3 ms | 3736 KB |
003.txt | AC | 3 ms | 3736 KB |
004.txt | AC | 3 ms | 3692 KB |
005.txt | AC | 2 ms | 3776 KB |
006.txt | AC | 2 ms | 3628 KB |
007.txt | AC | 2 ms | 3580 KB |
008.txt | AC | 3 ms | 3500 KB |
009.txt | AC | 2 ms | 3736 KB |
010.txt | AC | 2 ms | 3708 KB |
example0.txt | AC | 2 ms | 3572 KB |
example1.txt | AC | 2 ms | 3644 KB |