結果
| 問題 |
No.904 サメトロ
|
| コンテスト | |
| ユーザー |
🍮かんプリン
|
| 提出日時 | 2019-10-11 22:04:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 604 bytes |
| コンパイル時間 | 1,232 ms |
| コンパイル使用メモリ | 160,760 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-25 07:31:27 |
| 合計ジャッジ時間 | 2,223 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
20 | int a, b; scanf("%d %d", &a, &b);
| ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
/*
*
* 解説見てないお
*
*/
#include "bits/stdc++.h"
#define REP(i, n) for(int i = 0; i < int(n); i++)
#define FOR(i,n,m) for(int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;
int main() {
int n; cin >> n;
vector<pair<int, int>> p(n - 1);
int sum_a = 0, sum_b = 0;
REP(i, n - 1) {
int a, b; scanf("%d %d", &a, &b);
p[i].first = a;
sum_a += a;
p[i].second = b;
sum_b += b;
}
cout << min(sum_a, sum_b) + 1 << endl;
return 0;
}
🍮かんプリン