結果
問題 | No.583 鉄道同好会 |
ユーザー |
![]() |
提出日時 | 2017-10-27 23:07:11 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 497 bytes |
コンパイル時間 | 725 ms |
コンパイル使用メモリ | 100,156 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 22:12:17 |
合計ジャッジ時間 | 1,660 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 1 |
ソースコード
void main(){import std.stdio, std.string, std.conv, std.algorithm;int n, m; rd(n, m);auto deg=new int[](n);foreach(_; 0..m){int a, b; rd(a, b);deg[a]++; deg[b]++;}auto ev=reduce!((res, e)=>res+(e%2==0))(0, deg);auto od=reduce!((res, e)=>res+(e&1))(0, deg);if(ev==n || od==2) writeln("YES");else writeln("NO");}void rd(T...)(ref T x){import std.stdio, std.string, std.conv;auto l=readln.split;foreach(i, ref e; x){e=l[i].to!(typeof(e));}}