Submission #53595822


Source Code Expand

#include <iostream>
#include <map>
using namespace std;
using ll = long long;
#define REP_(i, a_, b_, a, b, ...) \
  for (int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(v) v.begin(), v.end()

int main() {
  int N;
  cin >> N;
  map<string, int> m;

  ll T = 0;
  REP(i, N) {
    string s;
    int c;
    cin >> s >> c;
    T += c;
    m[s] = c;
  }

  auto itr = m.begin();
  advance(itr, T % N);

  cout << (itr->first) << endl;
}

Submission Info

Submission Time
Task B - AtCoder Janken 2
User noyan
Language C++ 23 (gcc 12.2)
Score 200
Code Size 511 Byte
Status AC
Exec Time 1 ms
Memory 3564 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 14
Set Name Test Cases
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
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3528 KiB
00_sample_01.txt AC 1 ms 3456 KiB
01_hand_00.txt AC 1 ms 3524 KiB
01_hand_01.txt AC 1 ms 3500 KiB
02_random_00.txt AC 1 ms 3564 KiB
02_random_01.txt AC 1 ms 3444 KiB
02_random_02.txt AC 1 ms 3444 KiB
02_random_03.txt AC 1 ms 3496 KiB
02_random_04.txt AC 1 ms 3488 KiB
02_random_05.txt AC 1 ms 3472 KiB
02_random_06.txt AC 1 ms 3432 KiB
02_random_07.txt AC 1 ms 3528 KiB
02_random_08.txt AC 1 ms 3504 KiB
02_random_09.txt AC 1 ms 3496 KiB