結果

問題 No.396 クラス替え
ユーザー moyashi_senpaimoyashi_senpai
提出日時 2016-07-15 22:50:02
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 70,420 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-23 04:58:48
合計ジャッジ時間 1,052 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 WA -
testcase_04 AC 1 ms
6,940 KB
testcase_05 WA -
testcase_06 AC 1 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 1 ms
6,940 KB
testcase_09 WA -
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 WA -
testcase_19 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |         scanf("%d %d %d %d", &n, &m, &x, &y);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
using namespace std;

#define Getsign(n) ((n > 0) - (n < 0))

typedef vector<int> Ivec;
typedef pair<int, int> Pos;

int main() {
	int n, m, x, y, a,b;
	scanf("%d %d %d %d", &n, &m, &x, &y);
	x %= 2 * m;
	y %= 2 * m;
	if ((x - m) >= 1) {
		a = x-m*2;
	}
	else a = x;

	if ((y - m) >= 1) {
		b = m - (y-m)+1;
	}
	else b = y;
	printf("%s\n", a == b ? "YES" : "NO");
	return 0;
}
0