結果

問題 No.1570 Blocks
ユーザー ytftytft
提出日時 2021-12-30 16:46:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 2,159 ms
コンパイル使用メモリ 173,956 KB
実行使用メモリ 8,832 KB
最終ジャッジ日時 2024-04-16 01:29:11
合計ジャッジ時間 9,577 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 137 ms
7,040 KB
testcase_03 WA -
testcase_04 AC 118 ms
6,400 KB
testcase_05 AC 128 ms
6,528 KB
testcase_06 WA -
testcase_07 AC 17 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 152 ms
7,424 KB
testcase_11 AC 178 ms
7,680 KB
testcase_12 WA -
testcase_13 AC 210 ms
8,448 KB
testcase_14 AC 210 ms
8,576 KB
testcase_15 AC 89 ms
5,760 KB
testcase_16 AC 206 ms
8,576 KB
testcase_17 WA -
testcase_18 AC 169 ms
7,808 KB
testcase_19 WA -
testcase_20 AC 86 ms
5,760 KB
testcase_21 WA -
testcase_22 AC 2 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 WA -
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 190 ms
8,448 KB
testcase_33 WA -
testcase_34 AC 195 ms
8,192 KB
testcase_35 WA -
testcase_36 AC 206 ms
8,448 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 221 ms
8,704 KB
testcase_40 AC 201 ms
8,448 KB
testcase_41 WA -
testcase_42 AC 221 ms
8,832 KB
testcase_43 AC 216 ms
8,704 KB
testcase_44 AC 223 ms
8,704 KB
testcase_45 AC 216 ms
8,704 KB
testcase_46 AC 199 ms
8,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int N,cur=0;
    cin>>N;
    string ans="Yes";
    vector<vector<int>> block(N,vector<int>(2));
    for(int i=0;i<N;++i){
        for(int j=0;j<2;++j){
            cin>>block[i][j];
        }
    }
    sort(block.begin(),block.end(),[](vector<int> a,vector<int> b){
        return a[0]+a[1]<b[0]+b[1];
    });
    for(vector<int> v:block){
        if(v[0]<cur){
            ans="No";
        }
        cur+=v[1];
    }
    cout<<ans<<endl;
}
0