結果

問題 No.1570 Blocks
ユーザー kotatsugamekotatsugame
提出日時 2021-06-29 20:55:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 740 ms
コンパイル使用メモリ 69,884 KB
実行使用メモリ 4,820 KB
最終ジャッジ日時 2023-09-08 06:04:00
合計ジャッジ時間 5,085 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 57 ms
4,384 KB
testcase_03 WA -
testcase_04 AC 50 ms
4,380 KB
testcase_05 AC 53 ms
4,380 KB
testcase_06 WA -
testcase_07 AC 9 ms
4,384 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 65 ms
4,384 KB
testcase_11 AC 72 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 81 ms
4,448 KB
testcase_14 AC 84 ms
4,544 KB
testcase_15 AC 38 ms
4,380 KB
testcase_16 AC 83 ms
4,500 KB
testcase_17 WA -
testcase_18 AC 68 ms
4,384 KB
testcase_19 WA -
testcase_20 AC 37 ms
4,384 KB
testcase_21 WA -
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,384 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,384 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 1 ms
4,384 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 70 ms
4,568 KB
testcase_33 WA -
testcase_34 AC 77 ms
4,748 KB
testcase_35 WA -
testcase_36 AC 80 ms
4,620 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 84 ms
4,820 KB
testcase_40 AC 80 ms
4,436 KB
testcase_41 WA -
testcase_42 AC 86 ms
4,504 KB
testcase_43 AC 86 ms
4,592 KB
testcase_44 AC 85 ms
4,700 KB
testcase_45 AC 86 ms
4,492 KB
testcase_46 AC 72 ms
4,532 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
int N;
int A[1<<17],B[1<<17],id[1<<17];
main()
{
	cin>>N;
	for(int i=0;i<N;i++)
	{
		cin>>A[i]>>B[i];
		id[i]=i;
	}
	sort(id,id+N,[](int i,int j){return A[i]+B[i]<A[j]+B[j];});
	int S=0;
	for(int i=0;i<N;i++)
	{
		if(S>B[i])
		{
			cout<<"No"<<endl;
			return 0;
		}
		S+=A[i];
	}
	cout<<"Yes"<<endl;
}
0