提出 #34380768


ソースコード 拡げる

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

#define pb push_back
#define all(x) begin(x),end(x)
#define sz(x) int(size(x))
#define INF 0x3f3f3f3f

using ll = long long;

const ll MOD = 998244353;

void solve() {
	int p[4][2];
	for (int i = 0; i < 4; i++) cin >> p[i][0] >> p[i][1];
	int ans = 1;
	for (int i = 0; i < 4; i++) {
		int a = p[(i+1)%4][0]-p[i][0];
		int b = p[(i+1)%4][1]-p[i][1];
		int c = p[(i+2)%4][0]-p[i][0];
		int d = p[(i+2)%4][1]-p[i][1];
		ans *= ((a*d-b*c > 0) ? 1 : -1);
	}
	if (ans < 0) cout << "No\n";
	else cout << "Yes\n";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	int _t = 1;
	// cin >> _t;
	while (_t--) solve();
	
	return 0;
}

提出情報

提出日時
問題 C - Convex Quadrilateral
ユーザ dav1dw
言語 C++ (GCC 9.2.1)
得点 300
コード長 784 Byte
結果 AC
実行時間 6 ms
メモリ 3592 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 34
セット名 テストケース
Sample sample_01.txt, sample_02.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt, random_30.txt, random_31.txt, random_32.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
random_01.txt AC 6 ms 3556 KiB
random_02.txt AC 2 ms 3592 KiB
random_03.txt AC 2 ms 3524 KiB
random_04.txt AC 3 ms 3584 KiB
random_05.txt AC 2 ms 3520 KiB
random_06.txt AC 1 ms 3500 KiB
random_07.txt AC 2 ms 3520 KiB
random_08.txt AC 2 ms 3560 KiB
random_09.txt AC 2 ms 3584 KiB
random_10.txt AC 2 ms 3524 KiB
random_11.txt AC 2 ms 3520 KiB
random_12.txt AC 2 ms 3448 KiB
random_13.txt AC 2 ms 3580 KiB
random_14.txt AC 2 ms 3524 KiB
random_15.txt AC 2 ms 3496 KiB
random_16.txt AC 2 ms 3504 KiB
random_17.txt AC 2 ms 3500 KiB
random_18.txt AC 2 ms 3560 KiB
random_19.txt AC 2 ms 3448 KiB
random_20.txt AC 2 ms 3520 KiB
random_21.txt AC 2 ms 3504 KiB
random_22.txt AC 2 ms 3520 KiB
random_23.txt AC 2 ms 3588 KiB
random_24.txt AC 2 ms 3552 KiB
random_25.txt AC 2 ms 3552 KiB
random_26.txt AC 2 ms 3472 KiB
random_27.txt AC 2 ms 3496 KiB
random_28.txt AC 2 ms 3472 KiB
random_29.txt AC 1 ms 3556 KiB
random_30.txt AC 2 ms 3556 KiB
random_31.txt AC 2 ms 3584 KiB
random_32.txt AC 2 ms 3520 KiB
sample_01.txt AC 5 ms 3496 KiB
sample_02.txt AC 3 ms 3560 KiB