Submission #00007
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include<iostream> #include<vector> #include<algorithm> using namespace std; int main (){ int n,m,i,p,q,k=0; cin>>n>>m; int a[n]; for (i=0;i<n;i++){ a[i]=0; } for (i=0;i<m;i++){ cin>>p>>q; a[p-1]+=1; a[q-1]+=1; } for (i=0;i<n;i++){ if (a[i]%2==1){ k++; } } if (k==0||k==2){ cout<< "OK" << "\n" ; } else { cout<< "NA" << "\n" ; } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0019 - 橋の一筆書き |
ユーザー名 | r2222 |
投稿日時 | 2022-08-11 08:11:04 |
言語 | C++ |
状態 | Accepted |
得点 | 180 |
ソースコード長 | 388 Byte |
最大実行時間 | 298 ms |
最大メモリ使用量 | 9180 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 180 / 180 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in01.txt | AC | 53 ms | 476 KB |
1
|
in02.txt | AC | 22 ms | 572 KB |
1
|
in03.txt | AC | 25 ms | 548 KB |
1
|
in04.txt | AC | 28 ms | 648 KB |
1
|
in05.txt | AC | 24 ms | 624 KB |
1
|
in06.txt | AC | 20 ms | 600 KB |
1
|
in07.txt | AC | 23 ms | 576 KB |
1
|
in08.txt | AC | 19 ms | 548 KB |
1
|
in09.txt | AC | 23 ms | 516 KB |
1
|
in10.txt | AC | 29 ms | 612 KB |
1
|
in11.txt | AC | 24 ms | 588 KB |
1
|
in12.txt | AC | 61 ms | 684 KB |
1
|
in13.txt | AC | 31 ms | 912 KB |
1
|
in14.txt | AC | 55 ms | 1900 KB |
1
|
in15.txt | AC | 298 ms | 8784 KB |
1
|
in16.txt | AC | 22 ms | 8880 KB |
1
|
in17.txt | AC | 31 ms | 8836 KB |
1
|
in18.txt | AC | 26 ms | 8932 KB |
1
|
in19.txt | AC | 26 ms | 8888 KB |
1
|
in20.txt | AC | 21 ms | 8844 KB |
1
|
in21.txt | AC | 23 ms | 8808 KB |
1
|
in22.txt | AC | 25 ms | 9040 KB |
1
|
in23.txt | AC | 25 ms | 8996 KB |
1
|
in24.txt | AC | 20 ms | 8948 KB |
1
|
in25.txt | AC | 21 ms | 9180 KB |
1
|