結果
| 問題 |
No.904 サメトロ
|
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2019-10-24 20:14:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 446 bytes |
| コンパイル時間 | 1,322 ms |
| コンパイル使用メモリ | 166,364 KB |
| 実行使用メモリ | 16,960 KB |
| 最終ジャッジ日時 | 2024-07-18 03:24:52 |
| 合計ジャッジ時間 | 5,933 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 32 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
int main(){
int n;
cin >> n;
int sum_a = 0, sum_b = 0;
rep(i,n-1){
int a, b;
cin >> a >> b;
sum_a += a;
sum_b += b;
}
int res = 0;
rep(i,sum_a){
rep(j,sum_b) if (abs(i - j) == abs(sum_a - sum_b)) res++;
}
cout << ++res << endl;
return 0;
}
iqueue02