結果

問題 No.63 ポッキーゲーム
ユーザー popopopepepe1
提出日時 2019-09-29 08:35:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 445 bytes
コンパイル時間 1,896 ms
コンパイル使用メモリ 74,512 KB
実行使用メモリ 54,104 KB
最終ジャッジ日時 2024-10-03 04:23:55
合計ジャッジ時間 5,308 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args ) throws Exception {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int x = sc.nextInt();
    
    if(N/x/2==1 && N%(x*2)==0){
        System.out.println(0);
    }else if(N%(x*2)==0){
        int j=N/(x*2);
        int y=(j-1)*x;
        System.out.println(y);
    }else{
        int y=(N/x/2)*x;
        System.out.println(y);
    }

  }
}
0