Submission #19723644


Source Code Expand

Copy
/*
    /\ In The Name Of Allah /\
    Author : Jawahiir Nabhan
*/
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;

int main()
{
    int N; cin>> N;
    vector <ll> a(N),b(N);
    ll Aoki = 0,Taka = 0;
    for(int i = 0;i < N;i++){
        ll x,y; cin>> x >> y;
        Taka -= x;
        b[i] = 2*x + y;
    }
    sort(b.rbegin(),b.rend());
    int cnt = 0;
    for(int i = 0;i < N;i++){
        cnt++;
        Taka += b[i];
        if(Taka > 0) break;
    }
    cout<< cnt << endl;
}

Submission Info

Submission Time
Task D - Choose Me
User Jawa
Language C++ (GCC 9.2.1)
Score 400
Code Size 556 Byte
Status AC
Exec Time 132 ms
Memory 6368 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:14:8: warning: unused variable ‘Aoki’ [-Wunused-variable]
   14 |     ll Aoki = 0,Taka = 0;
      |        ^~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 31
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01_small.txt, 02_small.txt, 03_small.txt, 04_small.txt, 05_small.txt, 06_small.txt, 07_small.txt, 08_small.txt, 09_small.txt, 10_small.txt, 11_small.txt, 12_small.txt, 13_small.txt, 14_small.txt, 15_small.txt, 16_large.txt, 17_large.txt, 18_large.txt, 19_large.txt, 20_large.txt, 21_large.txt, 22_large.txt, 23_large.txt, 24_large.txt, 25_large.txt, 26_max.txt, 27_max.txt, 28_max.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01_small.txt AC 6 ms 3388 KB
02_small.txt AC 3 ms 3436 KB
03_small.txt AC 3 ms 3572 KB
04_small.txt AC 4 ms 3436 KB
05_small.txt AC 2 ms 3384 KB
06_small.txt AC 7 ms 3536 KB
07_small.txt AC 2 ms 3412 KB
08_small.txt AC 2 ms 3516 KB
09_small.txt AC 3 ms 3516 KB
10_small.txt AC 2 ms 3528 KB
11_small.txt AC 2 ms 3436 KB
12_small.txt AC 2 ms 3436 KB
13_small.txt AC 2 ms 3452 KB
14_small.txt AC 2 ms 3452 KB
15_small.txt AC 2 ms 3584 KB
16_large.txt AC 71 ms 4568 KB
17_large.txt AC 125 ms 6100 KB
18_large.txt AC 45 ms 3776 KB
19_large.txt AC 45 ms 3880 KB
20_large.txt AC 53 ms 4120 KB
21_large.txt AC 45 ms 3780 KB
22_large.txt AC 35 ms 3664 KB
23_large.txt AC 6 ms 3512 KB
24_large.txt AC 108 ms 5440 KB
25_large.txt AC 132 ms 6368 KB
26_max.txt AC 99 ms 6188 KB
27_max.txt AC 97 ms 6176 KB
28_max.txt AC 132 ms 6188 KB
sample_01.txt AC 2 ms 3596 KB
sample_02.txt AC 2 ms 3588 KB
sample_03.txt AC 2 ms 3452 KB