Submission #10183580


Source Code Expand

#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<math.h>
#include<tuple>
#include<string.h>
#include <numeric> 
using namespace std; 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define pp(...) "\033[94m [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "]\033[0m"
#define dg1(x) debug() << pp(x)
#define dg2(x,y) debug() << pp(x) pp(y)
#define dg3(x,y,z) debug() << pp(x) pp(y) pp(z)
#define dg4(w,x,y,z) debug() << pp(w) pp(x) pp(y) pp(z)
#define print(x) cerr <<"\033[1;33m" << x << "\033[0m" << '\n'
#define int long long
#define LL __int128_t
const int xx = 2e5;
const int MOD = 1e9 + 7;

signed main(){
  ios::sync_with_stdio(false);cin.tie(0);

  int n;
  cin >> n;
  vector<string>vs(n);
  vector<int>T(n);
  for(int i=0;i<n;i++){
	  cin >> vs[i] >> T[i];
  }
  string X;
  cin >> X;
  
  bool sleep = false;
  int sum = 0;
  for(int i=0;i<n;i++){
	  if(sleep) {
		  sum += T[i];
	  }
	  if(vs[i] == X){
		  sleep = true;
	  }
  }

  cout << sum << '\n';

}

Submission Info

Submission Time
Task A - Falling Asleep
User wajiul1
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1850 Byte
Status AC
Exec Time 2 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 12
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All max_01, max_02, max_03, max_04, random_01, random_02, random_03, random_04, random_05, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
max_01 AC 1 ms 256 KB
max_02 AC 1 ms 256 KB
max_03 AC 1 ms 256 KB
max_04 AC 1 ms 256 KB
random_01 AC 1 ms 256 KB
random_02 AC 1 ms 256 KB
random_03 AC 2 ms 256 KB
random_04 AC 1 ms 256 KB
random_05 AC 1 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB