結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
bdqp ☪️
|
| 提出日時 | 2020-03-31 02:24:21 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 555µs | |
| コード長 | 458 bytes |
| 記録 | |
| コンパイル時間 | 922 ms |
| コンパイル使用メモリ | 186,128 KB |
| 実行使用メモリ | 9,868 KB |
| 最終ジャッジ日時 | 2026-10-11 08:16:39 |
| 合計ジャッジ時間 | 1,890 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// 条件を見落としていませんか?
int main () {
set<int> s;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int x, y;
cin >> x >> y;
if (y-x <= 0) {
puts("-1");
return 0;
}
s.insert(y-x);
}
if (s.size() == 1) {
cout << *s.begin() << endl;
}
else {
puts("-1");
}
}
bdqp ☪️