Submission #41349657
Source Code Expand
Copy
#pragma GCC optimize(2)#include<bits/stdc++.h>#define endl '\n'using namespace std;using ll=long long;signed main() {ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int n;cin>>n;string s;cin>>s;int c0=count(s.begin(),s.end(),'T'),c1=n-c0;if(c0>c1)cout<<"T";else if(c0<c1)cout<<"A";else if(s.back()=='T')cout<<"A";else cout<<"T";}// init?// var->0?// infinite dfs?// out of bound?// max_element / min_element?
#pragma GCC optimize(2) #include<bits/stdc++.h> #define endl '\n' using namespace std; using ll=long long; signed main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n;cin>>n; string s;cin>>s; int c0=count(s.begin(),s.end(),'T'),c1=n-c0; if(c0>c1)cout<<"T"; else if(c0<c1)cout<<"A"; else if(s.back()=='T')cout<<"A"; else cout<<"T"; } // init? // var->0? // infinite dfs? // out of bound? // max_element / min_element?
Submission Info
Submission Time | |
---|---|
Task | A - Overall Winner |
User | wa_wa_vegetable |
Language | C++ (GCC 9.2.1) |
Score | 100 |
Code Size | 476 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 3584 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_00.txt | AC | 8 ms | 3504 KB |
00_sample_01.txt | AC | 4 ms | 3556 KB |
00_sample_02.txt | AC | 2 ms | 3572 KB |
01_random_00.txt | AC | 3 ms | 3448 KB |
01_random_01.txt | AC | 2 ms | 3584 KB |
01_random_02.txt | AC | 2 ms | 3576 KB |
01_random_03.txt | AC | 2 ms | 3516 KB |
01_random_04.txt | AC | 2 ms | 3548 KB |
01_random_05.txt | AC | 2 ms | 3548 KB |
01_random_06.txt | AC | 2 ms | 3448 KB |
01_random_07.txt | AC | 2 ms | 3512 KB |
01_random_08.txt | AC | 2 ms | 3568 KB |
01_random_09.txt | AC | 2 ms | 3568 KB |
01_random_10.txt | AC | 2 ms | 3428 KB |
01_random_11.txt | AC | 2 ms | 3580 KB |