結果
問題 | No.531 エヌスクミ島の平和協定 |
ユーザー |
![]() |
提出日時 | 2021-05-10 12:38:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 74 ms / 2,000 ms |
コード長 | 335 bytes |
コンパイル時間 | 1,994 ms |
コンパイル使用メモリ | 192,408 KB |
最終ジャッジ日時 | 2025-01-21 09:48:08 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 37 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i,n) for(int i=0;i<n;i++)typedef long long ll;#define int long longsigned main(){int n,m;cin>>n>>m;int ans=0;if(n<=m) ans=1;if(n>m && n%2==1) ans=-1;if(n>m && n%2==0 && n<=2*m) ans=2;if(n>m && n%2==0 && n>2*m) ans=-1;cout<<ans<<endl;return 0;}