結果
| 問題 |
No.63 ポッキーゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-04-09 16:38:44 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 450 ms / 5,000 ms |
| コード長 | 435 bytes |
| コンパイル時間 | 2,458 ms |
| コンパイル使用メモリ | 74,068 KB |
| 実行使用メモリ | 41,652 KB |
| 最終ジャッジ日時 | 2024-12-24 05:05:23 |
| 合計ジャッジ時間 | 7,611 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
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(L<=K || L==K*2) yuu=0;
else if(nokori<=K*2){
yuu=K;
}else{
while(nokori>K*2){
nokori = L-K*2;
yuu += K;
L=nokori;
}
}
System.out.println(yuu);
}
}