結果

問題 No.2684 折々の色
ユーザー 👑 binapbinap
提出日時 2024-03-20 22:07:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,037 bytes
コンパイル時間 5,727 ms
コンパイル使用メモリ 270,184 KB
実行使用メモリ 40,188 KB
最終ジャッジ日時 2024-03-20 22:08:28
合計ジャッジ時間 29,780 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 381 ms
25,344 KB
testcase_12 AC 238 ms
18,176 KB
testcase_13 AC 425 ms
28,424 KB
testcase_14 AC 210 ms
16,384 KB
testcase_15 AC 260 ms
20,864 KB
testcase_16 AC 49 ms
8,576 KB
testcase_17 AC 205 ms
16,640 KB
testcase_18 AC 383 ms
31,792 KB
testcase_19 AC 461 ms
30,080 KB
testcase_20 AC 307 ms
18,304 KB
testcase_21 AC 78 ms
11,264 KB
testcase_22 AC 402 ms
32,596 KB
testcase_23 AC 315 ms
20,480 KB
testcase_24 AC 125 ms
13,824 KB
testcase_25 AC 204 ms
16,000 KB
testcase_26 AC 427 ms
25,984 KB
testcase_27 AC 246 ms
17,152 KB
testcase_28 AC 313 ms
20,352 KB
testcase_29 AC 823 ms
39,352 KB
testcase_30 AC 761 ms
39,752 KB
testcase_31 AC 791 ms
40,164 KB
testcase_32 AC 827 ms
39,564 KB
testcase_33 AC 829 ms
39,952 KB
testcase_34 AC 764 ms
39,600 KB
testcase_35 AC 797 ms
39,964 KB
testcase_36 AC 755 ms
39,752 KB
testcase_37 AC 805 ms
40,152 KB
testcase_38 AC 876 ms
40,188 KB
testcase_39 AC 855 ms
40,188 KB
testcase_40 AC 873 ms
40,188 KB
testcase_41 AC 872 ms
40,188 KB
testcase_42 AC 871 ms
40,188 KB
testcase_43 AC 849 ms
40,188 KB
testcase_44 AC 876 ms
40,188 KB
testcase_45 AC 858 ms
40,188 KB
testcase_46 AC 848 ms
40,188 KB
testcase_47 AC 2 ms
6,676 KB
testcase_48 AC 2 ms
6,676 KB
testcase_49 AC 2 ms
6,676 KB
testcase_50 AC 2 ms
6,676 KB
testcase_51 AC 2 ms
6,676 KB
testcase_52 AC 2 ms
6,676 KB
testcase_53 AC 2 ms
6,676 KB
testcase_54 AC 2 ms
6,676 KB
testcase_55 AC 2 ms
6,676 KB
testcase_56 WA -
testcase_57 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvl;
typedef long double ld;
typedef pair<int, int> P;

ostream& operator<<(ostream& os, const modint& a) {os << a.val(); return os;}
template <int m> ostream& operator<<(ostream& os, const static_modint<m>& a) {os << a.val(); return os;}
template <int m> ostream& operator<<(ostream& os, const dynamic_modint<m>& a) {os << a.val(); return os;}
template<typename T> istream& operator>>(istream& is, vector<T>& v){int n = v.size(); assert(n > 0); rep(i, n) is >> v[i]; return is;}
template<typename U, typename T> ostream& operator<<(ostream& os, const pair<U, T>& p){os << p.first << ' ' << p.second; return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : " "); return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : ""); return os;}

template<typename T> void chmin(T& a, T b){a = min(a, b);}
template<typename T> void chmax(T& a, T b){a = max(a, b);}

int main(){
	int n, m;
	cin >> n >> m;
	vector<int> x(m);
	cin >> x;
	vector<vector<int>> c(n, vector<int>(m));
	vector<int> t(n);
	rep(i, n){
		cin >> c[i] >> t[i];
	}
	set<vector<int>> se;
	rep(i, n){
		vector<int> tmp(m);
		rep(j, m) tmp[j] = c[i][j] * t[i];
		se.insert(tmp);
	}
	rep(i, n){
		if(t[i] == 100){
			if(c[i] == x){
				cout << "Yes\n";
				return 0;
			}
		}else{
			bool fail = false;
			vector<int> tmp(m);
			rep(j, m) tmp[j] = 10000 * x[j] - 100 * t[i] * c[i][j];
			rep(j, m){
				if(tmp[j] % (100 - t[i]) != 0) fail = true;
				else tmp[j] /= 100 - t[i];
			}
			if(fail) continue;
			if(se.find(tmp) != se.end()){
				cout << "Yes\n";
				return 0;
			}
		}
	}
	cout << "No\n";
	return 0;
}
0