結果
問題 | No.396 クラス替え |
ユーザー |
![]() |
提出日時 | 2016-07-22 14:23:45 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 314 bytes |
コンパイル時間 | 808 ms |
コンパイル使用メモリ | 19,968 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 11:10:08 |
合計ジャッジ時間 | 827 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }