結果
| 問題 |
No.185 和風
|
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-10-12 22:31:50 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 302 bytes |
| コンパイル時間 | 183 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 01:56:07 |
| 合計ジャッジ時間 | 623 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%d%d%d", &n, &x, &y);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:11:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d%d", &x, &y);
| ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(){
int n, x, y, a, i;
scanf("%d%d%d", &n, &x, &y);
a = y - x;
if(a < 0){
printf("-1\n");
return 0;
}
while(--n){
scanf("%d%d", &x, &y);
i = y - x;
if(a != i){
printf("-1\n");
return 0;
}
}
printf("%d\n", a);
return 0;
}
mosmos_21