結果
問題 |
No.8090 Knapsack Function
|
ユーザー |
|
提出日時 | 2022-04-01 21:53:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 2,083 ms |
コンパイル使用メモリ | 199,836 KB |
最終ジャッジ日時 | 2025-01-28 13:59:22 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 7 |
ソースコード
#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; }