Submission #20526182


Source Code Expand

#include <bits/stdc++.h>
#define REP(i, N) for(int i = 0; i < (int)N; i++)
#define CREP(i, l, r) for(int i = l; i <= r; i++)
using namespace std;
typedef long long ll;
typedef tuple<int,int,int> T; 
typedef pair<int,int> P;
typedef vector<int> V;
typedef vector<ll> VLL;
const int INF = 1000000001;      //10^9, 2*INF
const ll LLINF = (1LL << 60);   // > 10^18 ll  2*LLINF


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

    int res = INF;
    REP(i,n){
        int a, p, x;
        cin >> a >> p >> x;
        if(x-a > 0){
            res = min(res,p);
        }
    }

    //VLL a(n); rep(i, n) scanf("%lld", &a[i]);
    
    int ans = 0;

    if(res < INF) printf("%d\n", res);
    else puts("-1");
}

Submission Info

Submission Time
Task B - Play Snuke
User samari06
Language C++ (GCC 9.2.1)
Score 200
Code Size 730 Byte
Status AC
Exec Time 96 ms
Memory 3752 KiB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:29:9: warning: unused variable ‘ans’ [-Wunused-variable]
   29 |     int ans = 0;
      |         ^~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 18
Set Name Test Cases
Sample 01_sample.txt, 02_sample.txt, 03_sample.txt
All 01_sample.txt, 02_sample.txt, 03_sample.txt, 04_small.txt, 05_small.txt, 06_small.txt, 07_small.txt, 08_small.txt, 09_large.txt, 10_large.txt, 11_large.txt, 12_large.txt, 13_large.txt, 14_ng.txt, 15_ng.txt, 16_max.txt, 17_max.txt, 18_max.txt
Case Name Status Exec Time Memory
01_sample.txt AC 8 ms 3748 KiB
02_sample.txt AC 2 ms 3584 KiB
03_sample.txt AC 2 ms 3652 KiB
04_small.txt AC 2 ms 3524 KiB
05_small.txt AC 2 ms 3552 KiB
06_small.txt AC 2 ms 3696 KiB
07_small.txt AC 2 ms 3752 KiB
08_small.txt AC 4 ms 3616 KiB
09_large.txt AC 33 ms 3460 KiB
10_large.txt AC 53 ms 3652 KiB
11_large.txt AC 49 ms 3692 KiB
12_large.txt AC 48 ms 3464 KiB
13_large.txt AC 24 ms 3560 KiB
14_ng.txt AC 7 ms 3520 KiB
15_ng.txt AC 43 ms 3528 KiB
16_max.txt AC 92 ms 3652 KiB
17_max.txt AC 92 ms 3560 KiB
18_max.txt AC 96 ms 3568 KiB