結果
| 問題 | No.178 美しいWhitespace (1) |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2015-08-06 20:54:56 |
| 言語 | C90(gcc12) (gcc 12.4.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 202 bytes |
| 記録 | |
| コンパイル時間 | 227 ms |
| コンパイル使用メモリ | 30,020 KB |
| 最終ジャッジ日時 | 2026-02-23 18:59:12 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 WA * 14 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:3:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
3 | scanf("%d",&s);t=s;
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | int main(){
main.c:6:1: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
6 | printf("%d",p&1?-1:p/2);
| ^~~~~~
main.c:6:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
int main(){
int a[1000],p,s,t,m=0;
scanf("%d",&s);t=s;
for(;s--;a[s]+=p*4,m=a[s]>m?a[s]:m)scanf("%d%d",a+s,&p);
for(s=p=0;s<t;s++)p+=m-a[s],(a[s]&1)!=(*a&1)&&(p|=1);
printf("%d",p&1?-1:p/2);
return 0;
}
testestest