結果

問題 No.2684 折々の色
ユーザー kotatsugamekotatsugame
提出日時 2024-03-20 21:23:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 743 ms / 2,000 ms
コード長 853 bytes
コンパイル時間 828 ms
コンパイル使用メモリ 72,892 KB
実行使用メモリ 28,004 KB
最終ジャッジ日時 2024-03-20 21:23:39
合計ジャッジ時間 21,513 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 3 ms
6,548 KB
testcase_03 AC 3 ms
6,548 KB
testcase_04 AC 3 ms
6,548 KB
testcase_05 AC 2 ms
6,548 KB
testcase_06 AC 3 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 AC 3 ms
6,548 KB
testcase_09 AC 3 ms
6,548 KB
testcase_10 AC 4 ms
6,548 KB
testcase_11 AC 348 ms
19,352 KB
testcase_12 AC 129 ms
17,560 KB
testcase_13 AC 460 ms
25,188 KB
testcase_14 AC 171 ms
13,388 KB
testcase_15 AC 227 ms
18,968 KB
testcase_16 AC 35 ms
8,292 KB
testcase_17 AC 178 ms
14,668 KB
testcase_18 AC 469 ms
26,852 KB
testcase_19 AC 406 ms
21,528 KB
testcase_20 AC 220 ms
14,156 KB
testcase_21 AC 103 ms
9,956 KB
testcase_22 AC 519 ms
27,236 KB
testcase_23 AC 263 ms
15,180 KB
testcase_24 AC 150 ms
12,132 KB
testcase_25 AC 199 ms
14,412 KB
testcase_26 AC 393 ms
19,736 KB
testcase_27 AC 231 ms
14,924 KB
testcase_28 AC 264 ms
15,180 KB
testcase_29 AC 419 ms
27,620 KB
testcase_30 AC 419 ms
27,748 KB
testcase_31 AC 454 ms
28,004 KB
testcase_32 AC 511 ms
27,748 KB
testcase_33 AC 423 ms
27,876 KB
testcase_34 AC 567 ms
27,748 KB
testcase_35 AC 532 ms
27,876 KB
testcase_36 AC 428 ms
27,748 KB
testcase_37 AC 571 ms
27,876 KB
testcase_38 AC 677 ms
28,004 KB
testcase_39 AC 711 ms
28,004 KB
testcase_40 AC 689 ms
28,004 KB
testcase_41 AC 712 ms
28,004 KB
testcase_42 AC 673 ms
28,004 KB
testcase_43 AC 734 ms
28,004 KB
testcase_44 AC 674 ms
28,004 KB
testcase_45 AC 707 ms
28,004 KB
testcase_46 AC 743 ms
28,004 KB
testcase_47 AC 2 ms
6,548 KB
testcase_48 AC 2 ms
6,548 KB
testcase_49 AC 2 ms
6,548 KB
testcase_50 AC 2 ms
6,548 KB
testcase_51 AC 3 ms
6,548 KB
testcase_52 AC 3 ms
6,548 KB
testcase_53 AC 2 ms
6,548 KB
testcase_54 AC 3 ms
6,548 KB
testcase_55 AC 2 ms
6,548 KB
testcase_56 AC 3 ms
6,548 KB
testcase_57 AC 2 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<array>
#include<set>
#include<cassert>
using namespace std;
using T=array<int,10>;
int N,M;
int X[10];
multiset<T>V[101];
T C[2<<17];
int t[2<<17];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>N>>M;
	for(int i=0;i<M;i++)cin>>X[i];
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<M;j++)cin>>C[i][j];
		cin>>t[i];
		V[t[i]].insert(C[i]);
	}
	for(int i=0;i<N;i++)
	{
		V[t[i]].erase(V[t[i]].find(C[i]));
		for(int tj=1;tj<=100;tj++)
		{
			bool ok=true;
			T nxt;
			for(int j=0;j<10;j++)
			{
				nxt[j]=10000*X[j];
				nxt[j]-=100*t[i]*C[i][j];
				nxt[j]+=tj*t[i]*C[i][j];
				int v=100*tj;
				if(nxt[j]%v!=0)
				{
					ok=false;
					break;
				}
				nxt[j]/=v;
			}
			if(ok&&V[tj].find(nxt)!=V[tj].end())
			{
				cout<<"Yes"<<endl;
				return 0;
			}
		}
		V[t[i]].insert(C[i]);
	}
	cout<<"No"<<endl;
}
0