結果
問題 |
No.531 エヌスクミ島の平和協定
|
ユーザー |
![]() |
提出日時 | 2018-10-06 17:12:56 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 398 bytes |
コンパイル時間 | 249 ms |
コンパイル使用メモリ | 28,544 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 13:51:16 |
合計ジャッジ時間 | 1,246 ms |
ジャッジサーバーID (参考情報) |
judge / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 35 WA * 2 |
ソースコード
#include <stdio.h> int main(void){ int n; // number of animals int m; // number of ships scanf("%d %d",&n,&m); if(n <= m){ printf("1\n"); }else{ if(m % 2 != 0 && m >= n/2 + n%2){ printf("2\n"); }else if(m % 2 == 0 && m >= n/2 + n%2){ printf("2\n"); }else{ printf("-1\n"); } } return 0; }