結果
問題 |
No.2403 "Eight" Bridges of Königsberg
|
ユーザー |
![]() |
提出日時 | 2025-02-04 13:00:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 341 bytes |
コンパイル時間 | 3,254 ms |
コンパイル使用メモリ | 193,276 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-02-04 13:00:38 |
合計ジャッジ時間 | 5,746 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 31 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | freopen("sakura.in","r",stdin); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ main.cpp:8:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | freopen("sakura.out","w",stdout); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; const int N=1e5+1; int a[N]; int main() { freopen("sakura.in","r",stdin); freopen("sakura.out","w",stdout); int n,m; cin>>n>>m; for(int i=1;i<=m;i++) { int x,y; cin>>x>>y; a[x]++; a[y]++; } int cnt=0; for(int i=1;i<=n;i++) { if(a[i]%2==1) cnt++; } cout<<cnt/2; return 0; }