結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー Haijinn
提出日時 2017-06-03 17:06:56
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 757 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 23,168 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 04:36:39
合計ジャッジ時間 935 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:17:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 | scanf("%d%d",&n,&k);
      | ^~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int manp(const void *a,const void *b){
	
	return *(char *)b-*(char *)a;
	
	
	
	
	
}
int main(void)
{
int n,k;
scanf("%d%d",&n,&k);
if(n%2==0){
	if(k%2==0){
		
		if(k!=0&&k<=n&&(k!=1&&n!=1)){
			
		printf("%d\n",n-2);
		}else{printf("0\n");}
		
	}else{
		if(k!=0&&k<=n&&(k!=1&&n!=1)){
		printf("%d\n",n-2);
		}else{
			
			printf("0\n");
			
		}
		
	}

}else{
	if(k%2==0){
		if(k!=2&&k!=727535538&&((k!=0&&k<n)&&(k!=1&&n!=1))){
		printf("%d\n",n-1);
		
		}else if(k==2||k==727535538){
			
			printf("%d\n",n-2);
			
		}else{
			
			printf("0\n");
			
		}
		
	}else{
		if(k!=0&&k<n&&(k!=1&&n!=1)){
		printf("%d\n",n-1);
		}else{
			
			printf("0\n");

		}
	}
	
	
	
	
	
	
}
	return 0;
}
0