結果
問題 |
No.904 サメトロ
|
ユーザー |
![]() |
提出日時 | 2020-01-11 20:41:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 383 bytes |
コンパイル時間 | 1,818 ms |
コンパイル使用メモリ | 191,488 KB |
最終ジャッジ日時 | 2025-01-08 17:08:51 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; if (n == 2) { cout << 1 << endl; return 0; } int sum_a = 0, sum_b = 0; for (int i = 0; i < n - 1; i++) { int a, b; cin >> a >> b; sum_a += a; sum_b += b; } cout << min(sum_a, sum_b) + 1 << endl; }