結果

問題 No.51 やる気の問題
ユーザー srup٩(๑`н´๑)۶
提出日時 2016-09-16 16:37:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 353 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 61,676 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 07:18:31
合計ジャッジ時間 1,616 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
const int INF = 1e9;

int main(void){
	int w, d; cin >> w >> d;
	int tmp;
	for (int i = d; i >= 2; --i){
		tmp = floor(w / ((double)i * (double)i));
		w -= tmp;
	}

	printf("%d\n", w);
	return 0;
}
0