結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
@abcde
|
| 提出日時 | 2019-02-09 08:24:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 440 bytes |
| コンパイル時間 | 1,352 ms |
| コンパイル使用メモリ | 165,644 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 11:52:53 |
| 合計ジャッジ時間 | 1,827 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
// 1. 入力情報取得.
int N;
cin >> N;
map<int, int> m;
for(int i = 0; i < N; i++){
int x, y;
cin >> x >> y;
m[(y - x)]++;
}
// 2. 新規性は?
int ans = -1;
for(auto &p : m) ans = p.first;
if(m.size() > 1 || ans < 0) ans = -1;
// 3. 後処理.
cout << ans << endl;
return 0;
}
@abcde