結果
| 問題 |
No.1563 Same Degree
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-29 20:04:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 90 ms / 2,000 ms |
| コード長 | 374 bytes |
| コンパイル時間 | 592 ms |
| コンパイル使用メモリ | 69,376 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-25 22:28:15 |
| 合計ジャッジ時間 | 2,566 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 15 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main()
| ^~~~
ソースコード
#include<iostream>
#include<vector>
using namespace std;
int T,N,M;
main()
{
cin>>T;
for(;T--;)
{
cin>>N>>M;
vector<int>deg(N);
for(int i=0;i<M;i++)
{
int a,b;cin>>a>>b;
a--,b--;
deg[a]++,deg[b]++;
}
vector<int>ex(M+1);
bool ok=false;
for(int i=0;i<N;i++)
{
if(ex[deg[i]])ok=true;
ex[deg[i]]=true;
}
cout<<(ok?"Yes":"No")<<endl;
}
}