結果
| 問題 |
No.63 ポッキーゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-13 15:33:32 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 183 bytes |
| コンパイル時間 | 445 ms |
| コンパイル使用メモリ | 19,968 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-29 18:44:25 |
| 合計ジャッジ時間 | 1,943 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 22 |
コンパイルメッセージ
main.c:5:1: warning: data definition has no type or storage class
5 | S = 0;
| ^
main.c:5:1: warning: type defaults to ‘int’ in declaration of ‘S’ [-Wimplicit-int]
main.c: In function ‘main’:
main.c:8:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d%d", &L, &K);
| ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int S, L, K;
S = 0;
int main(int argc){
scanf("%d%d", &L, &K);
while(L > 2 * K){
if(L <= 2 * K){
printf("%d", S/2);
break;
}
L -= 2 * K;
S += 2 * K;
}
return 0;
}