提出 #53601731


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

#define FOR(i, a, n) for (int i = a; i < (int)n; i++)
#define REP(i, n) FOR(i, 0, n)
using lli = long long int;

struct P{ string S; int C; bool operator<(P& p) { return S < p.S; }};

int N;
P p[101];

int main() {
  cin >> N;
  REP(i, N) { cin >> p[i].S >> p[i].C; }

  int T = 0;
  REP(i, N) { T += p[i].C; }
  T %= N;
  sort(p, p+N);
  cout << p[T].S << endl;

  return 0;
}

提出情報

提出日時
問題 B - AtCoder Janken 2
ユーザ ryo_ryo66
言語 C++ 20 (gcc 12.2)
得点 200
コード長 447 Byte
結果 AC
実行時間 1 ms
メモリ 3528 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 14
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_hand_00.txt, 01_hand_01.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3464 KiB
00_sample_01.txt AC 1 ms 3512 KiB
01_hand_00.txt AC 1 ms 3516 KiB
01_hand_01.txt AC 1 ms 3524 KiB
02_random_00.txt AC 1 ms 3448 KiB
02_random_01.txt AC 1 ms 3404 KiB
02_random_02.txt AC 1 ms 3472 KiB
02_random_03.txt AC 1 ms 3516 KiB
02_random_04.txt AC 1 ms 3476 KiB
02_random_05.txt AC 1 ms 3456 KiB
02_random_06.txt AC 1 ms 3400 KiB
02_random_07.txt AC 1 ms 3528 KiB
02_random_08.txt AC 1 ms 3400 KiB
02_random_09.txt AC 1 ms 3452 KiB