結果

問題 No.415 ぴょん
ユーザー itezpace
提出日時 2016-08-26 23:15:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 1,283 ms
コンパイル使用メモリ 159,184 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-08 09:47:53
合計ジャッジ時間 2,206 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
  int n,d;
  cin>>n>>d;
  if(n<=d){
    cout<<0<<endl;
    return 0;
  }
  int x=(n-1)/d;
  int y=(n-1)%d;
  int z=1;
  if(d-1>y){
    z+=d-1;
  }
  z*=x;
  cout<<z<<endl;
  return 0;
}
0