結果

問題 No.531 エヌスクミ島の平和協定
ユーザー Bantako
提出日時 2017-07-22 15:18:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 22,272 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 16:28:59
合計ジャッジ時間 1,177 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |     scanf("%d%d",&N,&M);
      |     ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
main(){
    int N,M;
    scanf("%d%d",&N,&M);
    if(N <= M){
        printf("1\n");
        
    }else if(N%2==0 && N/2<=M){
        printf("2\n");
    }else{
        printf("-1\n");
    }
}
0