結果

問題 No.3090 Knapsack Function
ユーザー silv723silv723
提出日時 2022-04-01 21:53:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 2,247 ms
コンパイル使用メモリ 208,552 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-30 13:50:01
合計ジャッジ時間 3,125 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
6,940 KB
testcase_03 WA -
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 WA -
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 WA -
testcase_11 AC 2 ms
6,944 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 80 ms
6,940 KB
testcase_17 WA -
testcase_18 AC 79 ms
6,944 KB
testcase_19 AC 81 ms
6,944 KB
testcase_20 AC 82 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
	ll n;
	cin>>n;
	bool ans=0;
	vector<pair<ll,ll>> v;
	v.push_back({0,0});
	for(int i=0;i<n;i++){
		ll a,b;
		cin>>a>>b;
		v.push_back({a,b});
	}
	sort(v.begin(),v.end());
	for(int i=0;i<n-1;i++){
		if(v[i].first+1==v[i+1].first&&v[i].second<v[i+1].second){
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	cout<<"No"<<endl;
}
0