提出 #41344309


ソースコード 拡げる

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define test int T; cin >> T; while(T--)
using namespace std;
using lnt = long long;

int main(){
    cin.tie(nullptr), ios::sync_with_stdio(false);

    int n;
    string s;
    cin >> n >> s;
    int a = 0, b = 0;
    for(int i=0; s[i]; i++){
        if(s[i] == 'T') a++;
        else b++;
        if(a*2 >= n){
            cout << "T";
            return 0;
        }
        if(b*2 >= n){
            cout << "A";
            return 0;
        }
    }
}

提出情報

提出日時
問題 A - Overall Winner
ユーザ pluie
言語 C++ (GCC 9.2.1)
得点 100
コード長 547 Byte
結果 AC
実行時間 13 ms
メモリ 3576 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 15
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 13 ms 3560 KiB
00_sample_01.txt AC 2 ms 3496 KiB
00_sample_02.txt AC 1 ms 3412 KiB
01_random_00.txt AC 2 ms 3496 KiB
01_random_01.txt AC 2 ms 3576 KiB
01_random_02.txt AC 2 ms 3516 KiB
01_random_03.txt AC 2 ms 3508 KiB
01_random_04.txt AC 2 ms 3408 KiB
01_random_05.txt AC 2 ms 3560 KiB
01_random_06.txt AC 1 ms 3496 KiB
01_random_07.txt AC 2 ms 3444 KiB
01_random_08.txt AC 2 ms 3468 KiB
01_random_09.txt AC 2 ms 3536 KiB
01_random_10.txt AC 2 ms 3564 KiB
01_random_11.txt AC 2 ms 3468 KiB