結果

問題 No.531 エヌスクミ島の平和協定
ユーザー kyabaria
提出日時 2018-09-11 22:01:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 367 bytes
コンパイル時間 1,280 ms
コンパイル使用メモリ 159,196 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-24 00:55:27
合計ジャッジ時間 2,553 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
typedef long long ll;
#define INF 1000000000
#define MOD 1000000007
using namespace std;
int main(void){
    int n,m,ans;
    cin>>n>>m;
    if(n<=m){
        ans=1;
    }else if(m==2){
        if(n==3){
            ans=-1;
        }else{
            ans=(n+1)/2;
        }
    }else{
        ans=n/m+(n-n/m*m)/m;
    }
    cout<<ans<<endl;
}
0