結果
問題 | No.63 ポッキーゲーム |
ユーザー |
|
提出日時 | 2016-04-09 16:35:42 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 402 bytes |
コンパイル時間 | 2,381 ms |
コンパイル使用メモリ | 73,884 KB |
実行使用メモリ | 54,080 KB |
最終ジャッジ日時 | 2024-10-04 05:06:25 |
合計ジャッジ時間 | 7,244 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 3 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int K = sc.nextInt(); int nokori=L-K*2; int yuu=0; if(nokori<=K*2){ yuu=K; }else{ while(nokori>K*2){ nokori = L-K*2; yuu += K; L=nokori; } } System.out.println(yuu); } }