結果

問題 No.1570 Blocks
ユーザー もなもな
提出日時 2021-06-27 13:24:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,031 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 205,740 KB
実行使用メモリ 5,388 KB
最終ジャッジ日時 2023-09-07 17:35:37
合計ジャッジ時間 5,140 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 23 ms
5,148 KB
testcase_03 AC 26 ms
5,224 KB
testcase_04 AC 20 ms
4,384 KB
testcase_05 AC 21 ms
4,384 KB
testcase_06 AC 20 ms
4,380 KB
testcase_07 AC 4 ms
4,384 KB
testcase_08 AC 25 ms
5,220 KB
testcase_09 AC 28 ms
5,160 KB
testcase_10 AC 26 ms
5,220 KB
testcase_11 AC 29 ms
5,228 KB
testcase_12 AC 29 ms
5,148 KB
testcase_13 AC 33 ms
5,100 KB
testcase_14 AC 33 ms
5,100 KB
testcase_15 AC 16 ms
4,384 KB
testcase_16 AC 33 ms
5,228 KB
testcase_17 AC 13 ms
4,384 KB
testcase_18 AC 27 ms
5,144 KB
testcase_19 AC 13 ms
4,380 KB
testcase_20 AC 16 ms
4,384 KB
testcase_21 AC 23 ms
5,328 KB
testcase_22 AC 1 ms
4,384 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,384 KB
testcase_27 AC 1 ms
4,384 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 1 ms
4,384 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 29 ms
5,388 KB
testcase_33 AC 29 ms
5,096 KB
testcase_34 AC 31 ms
5,164 KB
testcase_35 AC 29 ms
5,160 KB
testcase_36 AC 32 ms
5,216 KB
testcase_37 AC 29 ms
5,212 KB
testcase_38 WA -
testcase_39 AC 34 ms
5,104 KB
testcase_40 AC 32 ms
5,108 KB
testcase_41 AC 30 ms
5,152 KB
testcase_42 AC 34 ms
5,172 KB
testcase_43 AC 34 ms
5,148 KB
testcase_44 AC 34 ms
5,168 KB
testcase_45 AC 33 ms
5,220 KB
testcase_46 AC 30 ms
5,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define reps(i,s,n) for (int i = (int)(s); i < (int)(n); i++)
#define repit(i,C) for (auto i = (C).begin(); i != (C).end(); i++)
#define pr(a) cout << a
#define prl(a) cout << (a) << endl
#define prld(a) cout << setprecision(15)<< (a) << endl 
#define allrange(a) a.begin(),a.end()

int solve(){
    return 0;
}

int main(){
    std::cin.tie(0); // cinとcoutの同期を解除
    std::ios::sync_with_stdio(false);
    int N;cin >> N;
//  int N,M;cin >> N>>M;
//  int N,M,K;cin >> N>>M>>K;

    vector<pair<int64_t,int64_t>> B;
    rep(i,N) {
        int64_t a;int64_t b;
        cin >> a>> b;
        B.push_back(make_pair(b,a));
    }
    sort(allrange(B));
    int64_t tot = 0;
    bool flg=true;
    repit(itr,B){
        if(tot>itr->first) {flg=false; break;} 
        tot += itr->second;
    }
    

//    if(flg) prl(ans); else prl(-1);
    if(flg) prl("Yes"); else prl("No");
}
0