結果
問題 |
No.415 ぴょん
|
ユーザー |
![]() |
提出日時 | 2016-08-26 23:20:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 385 bytes |
コンパイル時間 | 1,358 ms |
コンパイル使用メモリ | 158,256 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-08 09:51:15 |
合計ジャッジ時間 | 3,070 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 WA * 16 |
ソースコード
#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 + 1) { 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; } }