結果

問題 No.408 五輪ピック
ユーザー beetbeet
提出日時 2018-11-12 16:41:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 850 bytes
コンパイル時間 5,070 ms
コンパイル使用メモリ 208,988 KB
実行使用メモリ 8,468 KB
最終ジャッジ日時 2023-08-24 23:57:30
合計ジャッジ時間 7,095 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 23 ms
4,380 KB
testcase_06 AC 18 ms
5,128 KB
testcase_07 AC 23 ms
5,120 KB
testcase_08 AC 18 ms
4,384 KB
testcase_09 AC 19 ms
4,504 KB
testcase_10 AC 16 ms
4,376 KB
testcase_11 AC 16 ms
4,384 KB
testcase_12 AC 27 ms
5,172 KB
testcase_13 AC 23 ms
4,380 KB
testcase_14 AC 7 ms
4,376 KB
testcase_15 AC 24 ms
4,376 KB
testcase_16 AC 24 ms
4,376 KB
testcase_17 AC 27 ms
4,484 KB
testcase_18 AC 29 ms
4,636 KB
testcase_19 AC 31 ms
5,044 KB
testcase_20 AC 9 ms
4,380 KB
testcase_21 AC 6 ms
4,376 KB
testcase_22 AC 15 ms
5,228 KB
testcase_23 AC 40 ms
8,468 KB
testcase_24 WA -
testcase_25 AC 24 ms
4,380 KB
testcase_26 AC 33 ms
5,660 KB
testcase_27 AC 26 ms
4,380 KB
testcase_28 AC 18 ms
4,772 KB
testcase_29 AC 18 ms
4,548 KB
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  int n,m;
  cin>>n>>m;
  vector<vector<int> > G(n);
  for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;
    a--;b--;
    G[a].emplace_back(b);
    G[b].emplace_back(a);
  }
  vector<set<int> > vs(n);
  for(int v:G[0]){
    for(int u:G[v]){
      if(u!=0) vs[u].emplace(v);
      if(vs[u].size()>10u) vs[u].erase(vs[u].begin());      
    }
  }
  auto YES=[](){cout<<"YES"<<endl;exit(0);};
  for(int v=0;v<n;v++){
    for(int u:G[v]){
      if(v==0||u==0) continue;
      for(int x:vs[v])
        for(int y:vs[u])
          if(x!=y) YES();      
    }
  }
  cout<<"NO"<<endl;
  return 0;
}
0