結果
| 問題 |
No.396 クラス替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-06 17:24:36 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 322 bytes |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 20,224 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 11:11:06 |
| 合計ジャッジ時間 | 817 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d%d", &n, &m);
| ^~~~~~~~~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d%d", &x, &y);
| ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void) {
int n, m;
int x, y;
int xm, ym;
scanf("%d%d", &n, &m);
scanf("%d%d", &x, &y);
xm = (x - 1) % (2 * m);
if(xm >= m)xm = 2 * m - xm - 1;
ym = (y - 1) % (2 * m);
if(ym >= m)ym = 2 * m - ym - 1;
if(xm == ym){
printf("YES\n");
}
else{
printf("NO\n");
}
return 0;
}