結果
問題 | No.185 和風 |
ユーザー | koba-e964 |
提出日時 | 2015-05-04 21:49:07 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 244 bytes |
コンパイル時間 | 479 ms |
コンパイル使用メモリ | 51,016 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-19 06:53:32 |
合計ジャッジ時間 | 1,281 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,384 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,376 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | AC | 2 ms
4,380 KB |
ソースコード
#include <iostream> using namespace std; int main(){ int n; int q=-1; cin>>n; for(int i=0;i<n;++i){ int x,y; cin>>x>>y; if(x >= y) { cout<<-1<<endl;return 0; } if(i==0){ q=y-x; }else{ if(q!=y-x) { cout<<-1<<endl;return 0; } }} cout<<q<<endl; }