結果

問題 No.51 やる気の問題
ユーザー 練習生
提出日時 2015-08-19 15:10:56
言語 Java
(openjdk 23)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 290 bytes
コンパイル時間 2,703 ms
コンパイル使用メモリ 74,108 KB
実行使用メモリ 41,796 KB
最終ジャッジ日時 2024-07-18 10:30:06
合計ジャッジ時間 5,929 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No51 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int d = sc.nextInt();
		sc.close();
		for(int i = d; i > 1; i--){
			w = w - (int)(w / Math.pow(i, 2));
		}
		System.out.println(w);
	}
}
0