Submission #1151524


Source Code Expand

#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const int INF = 2000000000;
using namespace std;

int main(){
    int n;
    cin >> n;

    string s;
    rep(i,n){
        string a,b,c;
        cin >> a >> b >> c;
        if(a == "MIDDLE") s+=c[c.size() / 2];
        else if(a == "BEGINNING") s+=c[0];
        else s+=c[c.size() - 1];
    }
    cout << s <<  endl;
}

Submission Info

Submission Time
Task A - エンド・オブ・ビギニング
User noy72
Language C++14 (GCC 5.4.1)
Score 100
Code Size 656 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 19
Set Name Test Cases
All 00_sample_00.txt, 00_sample_01.txt, 10_min_00.txt, 10_min_01.txt, 10_min_02.txt, 20_max_00.txt, 20_max_01.txt, 20_max_02.txt, 90_random_00.txt, 90_random_01.txt, 90_random_02.txt, 90_random_03.txt, 90_random_04.txt, 90_random_05.txt, 90_random_06.txt, 90_random_07.txt, 90_random_08.txt, 90_random_09.txt, 99_medium_00.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 256 KB
00_sample_01.txt AC 1 ms 256 KB
10_min_00.txt AC 1 ms 256 KB
10_min_01.txt AC 1 ms 256 KB
10_min_02.txt AC 1 ms 256 KB
20_max_00.txt AC 1 ms 256 KB
20_max_01.txt AC 1 ms 256 KB
20_max_02.txt AC 1 ms 256 KB
90_random_00.txt AC 1 ms 256 KB
90_random_01.txt AC 1 ms 256 KB
90_random_02.txt AC 1 ms 256 KB
90_random_03.txt AC 1 ms 256 KB
90_random_04.txt AC 1 ms 256 KB
90_random_05.txt AC 1 ms 256 KB
90_random_06.txt AC 1 ms 256 KB
90_random_07.txt AC 1 ms 256 KB
90_random_08.txt AC 1 ms 256 KB
90_random_09.txt AC 1 ms 256 KB
99_medium_00.txt AC 1 ms 256 KB