結果

問題 No.415 ぴょん
ユーザー ikd
提出日時 2016-08-26 22:42:23
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 305 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 53,852 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-08 09:37:36
合計ジャッジ時間 3,122 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 TLE * 1 -- * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

using namespace std;
#define int long long

signed main(){

   int N, D;
   cin>> N>> D;

   int ans=0;
   int n=N;
   while(1){
      ans+=(n/D);
      int mod=n%D;
      if(mod==0){
         break;
      }else{
         n=N+mod;
      }
   }

   cout<< ans-1<< endl;

   return 0;
}
0