結果

問題 No.415 ぴょん
ユーザー itezpace
提出日時 2016-08-26 23:24:58
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 1,713 ms
コンパイル使用メモリ 157,428 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 09:52:23
合計ジャッジ時間 2,371 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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-y>y){
    z=d-y;
  }
  z*=x;
  cout<<z<<endl;
  return 0;
}
0