結果
問題 |
No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
|
ユーザー |
![]() |
提出日時 | 2019-08-29 17:15:35 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 629 bytes |
コンパイル時間 | 123 ms |
コンパイル使用メモリ | 30,336 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-17 16:56:25 |
合計ジャッジ時間 | 953 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 WA * 1 |
ソースコード
#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||trap==numofbox) { printf("0"); return 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); } } } }