結果

問題 No.396 クラス替え
ユーザー lonly
提出日時 2016-08-06 17:12:32
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 20,096 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-07 04:02:29
合計ジャッジ時間 1,005 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
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("%d %d",&N,&M);
      |         ^~~~~~~~~~~~~~~~~~~~
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d %d",&x,&y);
      |         ^~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(){
	int N, M, x, y, a, b, HanakoRank, TarouRank;
	scanf("%d %d",&N,&M);
	scanf("%d %d",&x,&y);
	x--;
	y--;
	
	x = (x-1)%(2*M);
	y = (y-1)%(2*M);
	
	if(x >= M) x = 2*M-x-1;
	if(y >= M) y = 2*M-y-1;
	
	
	TarouRank = x;
	HanakoRank = y;
	
	if(HanakoRank == TarouRank){
		printf("YES\n");
	}else{
		printf("NO\n");
	}
	
	  
	return 0;
}
0