結果
問題 |
No.583 鉄道同好会
|
ユーザー |
![]() |
提出日時 | 2017-11-10 06:42:50 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 256 bytes |
コンパイル時間 | 99 ms |
コンパイル使用メモリ | 23,168 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 10:44:08 |
合計ジャッジ時間 | 792 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:4:6: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 4 | scanf("%d%d",&n,&m); | ~~~~~^~~~~~~~~~~~~~ main.cpp:7:6: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d%d",&l,&r); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ int n,m,a[1000],l,r,ans=0; scanf("%d%d",&n,&m); for(int i=0;i<n;i++)a[i]=0; for(int i=0;i<m;i++){ scanf("%d%d",&l,&r); a[l]++; a[r]++; } for(int i=0;i<n;i++)if(a[i]%2==1)ans++; if(ans>2)printf("NO\n"); else printf("YES\n"); }