提出 #461154


ソースコード 拡げる

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

#define FOR(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define first F
#define second S

const int INF = 1 << 29;
const double EPS = 1e-9;
template<class T> ostream& operator<<(ostream &os, const vector<T> &v){ FOR(i, v.size()) { if(v[i] == INF) os << "INF"; else os << v[i]; if(i != v.size() - 1) os << ' '; } return os; }

const int MAX = INF;

int main() {
    std::ios_base::sync_with_stdio(0);
    int n;
    string ans = "", s, p, q;
    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> s;
        cin >> p >> q;
        if(s == "BEGINNING") {
            ans += q[0];
        } else if(s == "MIDDLE") {
            ans += q[q.size() / 2];
        } else {
            ans += q[q.size() - 1];
        }
    }
    cout << ans << endl;
}

提出情報

提出日時
問題 A - エンド・オブ・ビギニング
ユーザ rif_rif
言語 C++ (GCC 4.9.2)
得点 100
コード長 949 Byte
結果 AC
実行時間 27 ms
メモリ 928 KiB

ジャッジ結果

セット名 All
得点 / 配点 100 / 100
結果
AC × 19
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 24 ms 792 KiB
00_sample_01.txt AC 26 ms 728 KiB
10_min_00.txt AC 25 ms 916 KiB
10_min_01.txt AC 25 ms 920 KiB
10_min_02.txt AC 26 ms 800 KiB
20_max_00.txt AC 27 ms 768 KiB
20_max_01.txt AC 24 ms 924 KiB
20_max_02.txt AC 26 ms 796 KiB
90_random_00.txt AC 25 ms 800 KiB
90_random_01.txt AC 25 ms 928 KiB
90_random_02.txt AC 24 ms 924 KiB
90_random_03.txt AC 25 ms 920 KiB
90_random_04.txt AC 25 ms 928 KiB
90_random_05.txt AC 25 ms 924 KiB
90_random_06.txt AC 25 ms 924 KiB
90_random_07.txt AC 25 ms 928 KiB
90_random_08.txt AC 23 ms 924 KiB
90_random_09.txt AC 25 ms 920 KiB
99_medium_00.txt AC 26 ms 800 KiB