結果
問題 |
No.415 ぴょん
|
ユーザー |
![]() |
提出日時 | 2016-08-26 22:41:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 453 bytes |
コンパイル時間 | 775 ms |
コンパイル使用メモリ | 75,792 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 09:36:36 |
合計ジャッジ時間 | 1,666 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 17 |
ソースコード
#include <iostream> #include <fstream> #include <vector> #include <cstring> #include <string> #include <algorithm> #include <iomanip> using namespace std; typedef long long ll; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N, D; cin >> N >> D; if(N % D == 0) { cout << N / D - 1 << endl; return 0; } ll skip = (N + D) % D; ll ans = 0; ans += N / D * D / skip; ll rem = N % D; ans += rem / skip; cout << ans - 1 << endl; }