結果

問題 No.1120 Strange Teacher
コンテスト
ユーザー e869120
提出日時 2020-07-04 00:54:44
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 401 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 364 ms
コンパイル使用メモリ 73,484 KB
実行使用メモリ 9,796 KB
最終ジャッジ日時 2026-10-13 15:33:51
合計ジャッジ時間 2,057 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
using namespace std;

long long A, B, C, D;

int sgn(long long x) {
	if (x > 0) return 1;
	if (x == 0) return 0;
	return -1;
}

int main() {
	cin >> A >> B >> C >> D;
	if (sgn(B) == sgn(D)) {
		if (A * D < B * C) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	if (sgn(B) != sgn(D)) {
		if (A * D > B * C) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}
0