結果
問題 |
No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
|
ユーザー |
![]() |
提出日時 | 2019-08-29 17:17:18 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 122 ms |
コンパイル使用メモリ | 30,208 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-17 16:56:28 |
合計ジャッジ時間 | 892 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #include <math.h> int main(void) { int numofbox,trap; scanf("%d %d",&numofbox,&trap); if(trap==0||trap>numofbox) { printf("0"); } else { if(numofbox%2==0) { printf("%d",numofbox-2); } else { if(trap==(numofbox+1)/2) { printf("%d",numofbox-1); } else { printf("%d",numofbox-2); } } } }