結果
問題 | No.63 ポッキーゲーム |
ユーザー |
![]() |
提出日時 | 2023-06-23 11:44:00 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 382 ms / 5,000 ms |
コード長 | 360 bytes |
コンパイル時間 | 1,654 ms |
コンパイル使用メモリ | 28,032 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 16:46:59 |
合計ジャッジ時間 | 2,465 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
#include <stdio.h>#include <stdlib.h>#include <stdbool.h>int main(){int length = 0;int eatLength = 0;int eatCnt = 0;scanf("%d", &length);scanf("%d", &eatLength);while (true){double len = (double)length / 2.0f;if (eatCnt + eatLength < len){eatCnt += eatLength;}else{printf("%d\n", eatCnt);return 0;}}}