結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
mits58
|
| 提出日時 | 2016-07-02 21:53:24 |
| 言語 | Java (openjdk 27 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 113 ms / 1,000 ms |
| + 352µs | |
| コード長 | 416 bytes |
| 記録 | |
| コンパイル時間 | 1,323 ms |
| コンパイル使用メモリ | 85,212 KB |
| 実行使用メモリ | 49,656 KB |
| 最終ジャッジ日時 | 2026-10-11 07:45:42 |
| 合計ジャッジ時間 | 3,297 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
int n=sc.nextInt();
int ans=sc.nextInt()-sc.nextInt(); ans=-ans;
for(int i=1;i<n;i++){
int x=sc.nextInt();
int y=sc.nextInt();
int temp=y-x;
if(ans==-1) continue;
if(ans!=temp) ans=-1;
}
System.out.println(ans<=0 ? -1 : ans);
}
}
}
mits58