結果

問題 No.2355 Unhappy Back Dance
ユーザー shobonvipshobonvip
提出日時 2023-06-16 22:53:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,837 ms / 6,000 ms
コード長 723 bytes
コンパイル時間 3,789 ms
コンパイル使用メモリ 267,800 KB
実行使用メモリ 144,140 KB
最終ジャッジ日時 2023-09-06 21:32:17
合計ジャッジ時間 25,121 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 185 ms
38,668 KB
testcase_11 AC 182 ms
38,744 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 177 ms
38,780 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1,837 ms
144,068 KB
testcase_17 AC 1,813 ms
143,992 KB
testcase_18 AC 1,797 ms
144,140 KB
testcase_19 AC 1,782 ms
144,060 KB
testcase_20 AC 1,793 ms
143,992 KB
testcase_21 AC 713 ms
62,068 KB
testcase_22 AC 128 ms
14,256 KB
testcase_23 AC 137 ms
15,004 KB
testcase_24 AC 1,654 ms
130,484 KB
testcase_25 AC 871 ms
71,824 KB
testcase_26 AC 886 ms
72,080 KB
testcase_27 AC 730 ms
63,248 KB
testcase_28 AC 15 ms
4,636 KB
testcase_29 AC 37 ms
6,564 KB
testcase_30 AC 1,522 ms
121,172 KB
testcase_31 AC 1,111 ms
88,996 KB
testcase_32 AC 103 ms
11,816 KB
testcase_33 AC 585 ms
51,992 KB
testcase_34 AC 7 ms
4,376 KB
testcase_35 AC 17 ms
4,912 KB
testcase_36 AC 736 ms
63,424 KB
testcase_37 AC 377 ms
35,544 KB
testcase_38 AC 476 ms
42,636 KB
testcase_39 AC 374 ms
34,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;

typedef modint998244353 mint;
typedef long long ll;

int main(){
	int n; cin >> n;
	vector<ll> x(n), y(n);
	for (int i=0; i<n; i++){
		cin >> x[i] >> y[i];
	}
	vector<set<pair<ll,ll>>> r;
	r.resize(n);
	vector<bool> mode(n);
	for (int i=0; i<n; i++){
		for (int j=0; j<n; j++){
			if (i == j) continue;
			ll xx = x[i] - x[j];
			ll yy = y[i] - y[j];
			ll g = __gcd(abs(xx), abs(yy));
			xx /= g;
			yy /= g;
			if (r[i].find(pair(xx, yy)) == r[i].end()){
				r[i].insert(pair(xx,yy));
			}else{
				mode[i] = true;
				break;
			}
		}
	}
	int ans = 0;
	for (int i=0; i<n; i++){
		if (mode[i]) ans++;
	}
	cout << ans << endl;	
}
0