結果
問題 |
No.634 硬貨の枚数1
|
ユーザー |
![]() |
提出日時 | 2018-01-20 00:21:57 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 302 bytes |
コンパイル時間 | 2,008 ms |
コンパイル使用メモリ | 168,136 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-25 20:33:33 |
合計ジャッジ時間 | 4,343 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 66 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { vector<int> v(10000); for (int i = 1; i <= 10000; i++) { v[i - 1] = i * (i + 1) / 2; } reverse(v.begin(), v.end()); int n, ans = 0; cin >> n; for (auto &i : v) { ans += n / i; n -= n / i * i; } cout << ans << endl; return 0; }