結果

問題 No.2684 折々の色
ユーザー 沙耶花沙耶花
提出日時 2024-03-20 21:38:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,102 ms / 2,000 ms
コード長 1,089 bytes
コンパイル時間 4,785 ms
コンパイル使用メモリ 271,880 KB
実行使用メモリ 52,580 KB
最終ジャッジ日時 2024-03-20 21:39:25
合計ジャッジ時間 32,116 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 3 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 3 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 3 ms
6,676 KB
testcase_11 AC 505 ms
25,600 KB
testcase_12 AC 111 ms
17,792 KB
testcase_13 AC 732 ms
28,336 KB
testcase_14 AC 314 ms
16,640 KB
testcase_15 AC 334 ms
21,376 KB
testcase_16 AC 64 ms
7,808 KB
testcase_17 AC 203 ms
16,512 KB
testcase_18 AC 692 ms
25,544 KB
testcase_19 AC 681 ms
30,208 KB
testcase_20 AC 377 ms
23,424 KB
testcase_21 AC 212 ms
9,728 KB
testcase_22 AC 816 ms
26,092 KB
testcase_23 AC 468 ms
23,168 KB
testcase_24 AC 289 ms
11,904 KB
testcase_25 AC 380 ms
16,128 KB
testcase_26 AC 618 ms
29,952 KB
testcase_27 AC 426 ms
19,840 KB
testcase_28 AC 460 ms
23,040 KB
testcase_29 AC 442 ms
50,888 KB
testcase_30 AC 362 ms
45,340 KB
testcase_31 AC 527 ms
45,948 KB
testcase_32 AC 666 ms
51,156 KB
testcase_33 AC 446 ms
51,632 KB
testcase_34 AC 722 ms
45,176 KB
testcase_35 AC 755 ms
45,588 KB
testcase_36 AC 474 ms
45,340 KB
testcase_37 AC 815 ms
45,932 KB
testcase_38 AC 1,101 ms
52,452 KB
testcase_39 AC 1,092 ms
52,068 KB
testcase_40 AC 1,092 ms
52,324 KB
testcase_41 AC 1,082 ms
52,324 KB
testcase_42 AC 1,074 ms
52,324 KB
testcase_43 AC 1,078 ms
52,580 KB
testcase_44 AC 1,097 ms
52,196 KB
testcase_45 AC 1,099 ms
52,324 KB
testcase_46 AC 1,102 ms
52,196 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 AC 2 ms
6,676 KB
testcase_57 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001


int main(){
	
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	
	int n,m;
	cin>>n>>m;
	vector<long long> x(m);
	rep(i,m){
		cin>>x[i];
		x[i] *= 10000;
	}
	
	vector c(n,vector<long long>(m));
	vector<long long> t(n);
	vector<vector<vector<long long>>> S(101);
	rep(i,n){
		rep(j,m)cin>>c[i][j];
		cin>>t[i];
		S[t[i]].push_back(c[i]);
	}
	rep(i,101)sort(S[i].begin(),S[i].end());
	
	rep(i,n){
		for(int j=1;j<=100;j++){
			vector<long long> goal(m,-1);
			rep(k,m){
				long long cur = x[k];
				cur += c[i][k] * t[i] * j;
				cur -= c[i][k] * t[i] * 100;
				if(cur % (100 * j) != 0)break;
				cur /= 100 * j;
				goal[k] = cur;
				
			}
			if(goal[m-1]==-1)continue;
			if(goal == c[i])continue;
			if(binary_search(S[j].begin(),S[j].end(),goal)){
				cout<<"Yes"<<endl;
				return 0;
			}
		}
	}
	cout<<"No"<<endl;
	return 0;
}
0