結果
| 問題 | No.185 和風 |
| コンテスト | |
| ユーザー |
Bantako
|
| 提出日時 | 2017-06-27 15:22:47 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 299 bytes |
| 記録 | |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 37,760 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-20 07:45:47 |
| 合計ジャッジ時間 | 837 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 1 |
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
ソースコード
#include<stdio.h>
main(){
int N;
scanf("%d",&N);
int x,y;
scanf("%d %d",&x,&y);
int ans = y - x;
for(int i = 1;i < N;i++){
scanf("%d %d",&x,&y);
if(ans < 0 || ans != y-x){
printf("-1");
return 0;
}
}
printf("%d",ans);
}
Bantako