結果
問題 |
No.415 ぴょん
|
ユーザー |
![]() |
提出日時 | 2016-08-26 23:15:55 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 381 bytes |
コンパイル時間 | 1,578 ms |
コンパイル使用メモリ | 157,412 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 09:47:59 |
合計ジャッジ時間 | 2,960 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 WA * 10 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) //#define int long long using namespace std; int N, D; signed main() { cin >> N >> D; int now = 1, cnt = 0; while (now <= N) { now += D; cnt++; } if (now > N + 1) { if ((now % N - 1) % D == 0) { cout << --cnt << endl; } else { cout << N - 1 << endl; } } else { cout << --cnt << endl; } }