結果

問題 No.634 硬貨の枚数1
ユーザー autumn-eel
提出日時 2018-01-19 21:43:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 213 bytes
コンパイル時間 1,569 ms
コンパイル使用メモリ 167,048 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-25 18:40:37
合計ジャッジ時間 3,300 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 66
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;

int main(){
	int n;cin>>n;
	int cnt=0;
	for(int k=5000;k>=1;k--){
		int a=(k+1)*k/2;
		cnt+=n/a;
		n%=a;
	}
	cout<<cnt<<endl;
}
0