結果

問題 No.51 やる気の問題
ユーザー scache
提出日時 2014-11-13 07:23:00
言語 Java
(openjdk 23)
結果
AC  
実行時間 142 ms / 5,000 ms
コード長 393 bytes
コンパイル時間 3,535 ms
コンパイル使用メモリ 77,536 KB
実行使用メモリ 54,296 KB
最終ジャッジ日時 2024-12-31 10:11:38
合計ジャッジ時間 7,219 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #


import java.util.Scanner;

public class Main51 {
	public static void main(String[] args) {
		Main51 p = new Main51();
	}

	public Main51() {
		Scanner sc = new Scanner(System.in);
		long w = sc.nextLong();
		long d = sc.nextLong();
		solve(w, d);
	}

	public void solve(long w, long d) {
		for(long i=d;i>1;i--){
			w -= w/i/i;
		}
		
		System.out.println(w);
	}

}
0