結果
問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
ユーザー |
![]() |
提出日時 | 2025-03-19 16:21:50 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 217 bytes |
コンパイル時間 | 338 ms |
コンパイル使用メモリ | 24,704 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-19 16:21:51 |
合計ジャッジ時間 | 1,380 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 4 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%ld %ld",&n,&k); | ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> void main(void) { long int n , k ; scanf("%ld %ld",&n,&k); if(k == 0 || k > n){ printf("0"); }else if(n%2 == 0 || n%2 != 0 && k%2 == 0){ printf("%ld",n-2); }else{ printf("%ld",n-1); } }