結果

問題 No.2684 折々の色
ユーザー 👑 kmjpkmjp
提出日時 2024-03-20 23:00:13
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 806 ms / 2,000 ms
コード長 1,566 bytes
コンパイル時間 2,351 ms
コンパイル使用メモリ 216,120 KB
実行使用メモリ 57,028 KB
最終ジャッジ日時 2024-03-20 23:00:41
合計ジャッジ時間 23,987 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 3 ms
6,676 KB
testcase_07 AC 3 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 348 ms
32,172 KB
testcase_12 AC 219 ms
24,748 KB
testcase_13 AC 350 ms
39,364 KB
testcase_14 AC 136 ms
19,984 KB
testcase_15 AC 270 ms
29,408 KB
testcase_16 AC 47 ms
11,588 KB
testcase_17 AC 190 ms
23,340 KB
testcase_18 AC 369 ms
39,748 KB
testcase_19 AC 365 ms
37,368 KB
testcase_20 AC 194 ms
26,052 KB
testcase_21 AC 95 ms
13,892 KB
testcase_22 AC 533 ms
41,924 KB
testcase_23 AC 319 ms
27,792 KB
testcase_24 AC 144 ms
18,012 KB
testcase_25 AC 214 ms
23,212 KB
testcase_26 AC 398 ms
34,936 KB
testcase_27 AC 285 ms
25,696 KB
testcase_28 AC 299 ms
27,536 KB
testcase_29 AC 629 ms
54,724 KB
testcase_30 AC 638 ms
51,908 KB
testcase_31 AC 493 ms
51,268 KB
testcase_32 AC 747 ms
55,876 KB
testcase_33 AC 570 ms
54,852 KB
testcase_34 AC 656 ms
52,292 KB
testcase_35 AC 695 ms
52,548 KB
testcase_36 AC 520 ms
51,012 KB
testcase_37 AC 565 ms
51,908 KB
testcase_38 AC 789 ms
57,028 KB
testcase_39 AC 768 ms
57,028 KB
testcase_40 AC 767 ms
57,028 KB
testcase_41 AC 792 ms
57,028 KB
testcase_42 AC 792 ms
57,028 KB
testcase_43 AC 806 ms
57,028 KB
testcase_44 AC 763 ms
57,028 KB
testcase_45 AC 766 ms
57,028 KB
testcase_46 AC 793 ms
57,028 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 <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------


int N,M;
ll X[10];
ll C[202020][10];
int T[202020];
map<vector<ll>,int> D;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>M;
	FOR(i,M) {
		cin>>X[i];
		X[i]*=100;
	}
	FOR(i,N) {
		FOR(j,M) {
			cin>>C[i][j];
		}
		cin>>T[i];
		vector<ll> V;
		int same=0;
		FOR(j,M) {
			C[i][j]*=T[i];
			V.push_back(C[i][j]);
			if(T[i]==100&&X[j]==C[i][j]) same++;
		}
		if(same==M) {
			cout<<"Yes"<<endl;
			return;
		}
		
		D[V]++;
	}
	FOR(i,N) if(T[i]!=100) {
		vector<ll> V;
		FOR(j,M) V.push_back(C[i][j]);
		D[V]--;
		vector<ll> L;
		FOR(j,M) {
			ll di=X[j]-C[i][j];
			if(di%(100-T[i])) break;
			di/=(100-T[i]);
			di*=100;
			L.push_back(di);
		}
		if(j==M) {
			if(D[L]>0) {
				cout<<"Yes"<<endl;
				return;
			}
		}
		
		D[V]++;
	}
	cout<<"No"<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0