結果

問題 No.531 エヌスクミ島の平和協定
ユーザー YamyukiYamyuki
提出日時 2017-06-23 22:40:18
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 166 bytes
コンパイル時間 673 ms
コンパイル使用メモリ 20,864 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 16:18:16
合計ジャッジ時間 1,237 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:37: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=]
    7 | else if(n/2<=m && n%2==0) printf("%ld\n",2);
      |                                   ~~^    ~
      |                                     |    |
      |                                     |    int
      |                                     long int
      |                                   %d
main.c:4:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 | scanf("%ld %ld",&n,&m);
      | ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main(){
long n,m;
scanf("%ld %ld",&n,&m);

if(n<=m) printf("1\n");
else if(n/2<=m && n%2==0) printf("%ld\n",2);
else printf("-1\n");
return 0;
}
0