結果

問題 No.2684 折々の色
ユーザー shobonvipshobonvip
提出日時 2024-03-20 22:41:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,762 bytes
コンパイル時間 4,929 ms
コンパイル使用メモリ 273,828 KB
実行使用メモリ 401,044 KB
最終ジャッジ日時 2024-03-20 22:41:54
合計ジャッジ時間 11,139 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,480 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 9 ms
6,676 KB
testcase_03 AC 5 ms
6,676 KB
testcase_04 AC 10 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 7 ms
6,676 KB
testcase_07 AC 3 ms
6,676 KB
testcase_08 AC 7 ms
6,676 KB
testcase_09 AC 6 ms
6,676 KB
testcase_10 AC 6 ms
6,676 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

//* ATCODER
#include<atcoder/all>
using namespace atcoder;
typedef modint998244353 mint;
//*/

/* BOOST MULTIPRECISION
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
//*/

typedef long long ll;

#define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
#define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--)

template <typename T> bool chmin(T &a, const T &b) {
	if (a <= b) return false;
	a = b;
	return true;
}

template <typename T> bool chmax(T &a, const T &b) {
	if (a >= b) return false;
	a = b;
	return true;
}

template <typename T> T max(vector<T> &a){
	assert(!a.empty());
	T ret = a[0];
	for (int i=0; i<(int)a.size(); i++) chmax(ret, a[i]);
	return ret;
}

template <typename T> T min(vector<T> &a){
	assert(!a.empty());
	T ret = a[0];
	for (int i=0; i<(int)a.size(); i++) chmin(ret, a[i]);
	return ret;
}

template <typename T> T sum(vector<T> &a){
	T ret = 0;
	for (int i=0; i<(int)a.size(); i++) ret += a[i];
	return ret;
}

int main(){
	int n, m; cin >> n >> m;
	vector<int> x(m);
	rep(i,0,m) cin >> x[i];

	vector<vector<int>> c(n, vector<int>(m));
	vector<int> t(n);
	rep(i,0,n){
		rep(j,0,m) cin >> c[i][j];
		cin >> t[i];
	}

	vector<map<vector<int>,vector<int>>> mp(101);
	rep(g,1,101){	
		rep(i,0,n){
			vector<int> dr(m);
			rep(j,0,m){
				dr[j] = (100-g) * t[i] * c[i][j];
			}
			if (mp[g][dr].size() >= 2) continue;
			mp[g][dr].push_back(i);
		}
	}

	rep(i,0,n){
		vector<int> tar(m);
		rep(j,0,m){
			tar[j] = 10000*x[j] - 100*t[i]*c[i][j];			
		}
		vector<int> lst = mp[t[i]][tar];
		bool mode = 0;
		for (int x: lst){
			if (x == i) continue;
			mode = 1;
		}
		if (mode){
			cout << "Yes\n";
			return 0;
		}
	}
	cout << "No\n";
}

0