結果
| 問題 |
No.415 ぴょん
|
| ユーザー |
algon_320
|
| 提出日時 | 2016-08-26 22:47:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 932 bytes |
| コンパイル時間 | 1,554 ms |
| コンパイル使用メモリ | 164,952 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 09:38:44 |
| 合計ジャッジ時間 | 2,853 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 9 RE * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define ITR(v,c) for(auto v=begin(c);v!=end(c);v++)
#define FOR(v,a,n) for(int v=a;v<(int)(n);v++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(v,n) FOR(v,0,n)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
const int INF = 1e9;
const ll INFLL = 1e18;
template<class T,class U>ostream&operator<<(ostream &os,const pair<T,U> &p){
os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T>ostream&operator<<(ostream &os,const vector<T> &v){
ITR(i,v)os<<*i<<(i==end(v)-1?"":" ");return os;}
//------------------------------------------------------------------------------
int main(int argc, char const *argv[]) {
ll N,D;
cin>>N>>D;
ll m=min(D,N-D);
if(N%m==0) {
cout<<(N/m)-1<<endl;
return 0;
}
else {
cout<<N-1<<endl;
}
return 0;
}
algon_320