結果

問題 No.2684 折々の色
ユーザー nononnonon
提出日時 2024-03-20 23:24:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 848 ms / 2,000 ms
コード長 1,287 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 211,584 KB
実行使用メモリ 48,240 KB
最終ジャッジ日時 2024-03-20 23:25:12
合計ジャッジ時間 27,634 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,548 KB
testcase_01 AC 3 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 3 ms
6,548 KB
testcase_06 AC 3 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 AC 2 ms
6,548 KB
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 3 ms
6,548 KB
testcase_11 AC 425 ms
30,096 KB
testcase_12 AC 316 ms
26,380 KB
testcase_13 AC 606 ms
39,548 KB
testcase_14 AC 242 ms
21,008 KB
testcase_15 AC 363 ms
29,072 KB
testcase_16 AC 94 ms
12,388 KB
testcase_17 AC 275 ms
25,100 KB
testcase_18 AC 638 ms
44,156 KB
testcase_19 AC 527 ms
36,992 KB
testcase_20 AC 322 ms
22,284 KB
testcase_21 AC 152 ms
15,844 KB
testcase_22 AC 639 ms
47,076 KB
testcase_23 AC 342 ms
25,996 KB
testcase_24 AC 215 ms
20,624 KB
testcase_25 AC 277 ms
22,544 KB
testcase_26 AC 473 ms
30,864 KB
testcase_27 AC 332 ms
25,608 KB
testcase_28 AC 340 ms
25,868 KB
testcase_29 AC 750 ms
47,592 KB
testcase_30 AC 750 ms
47,852 KB
testcase_31 AC 774 ms
48,228 KB
testcase_32 AC 754 ms
47,848 KB
testcase_33 AC 778 ms
47,992 KB
testcase_34 AC 742 ms
47,844 KB
testcase_35 AC 770 ms
48,100 KB
testcase_36 AC 765 ms
47,852 KB
testcase_37 AC 772 ms
48,112 KB
testcase_38 AC 841 ms
48,240 KB
testcase_39 AC 825 ms
48,232 KB
testcase_40 AC 805 ms
48,240 KB
testcase_41 AC 843 ms
48,236 KB
testcase_42 AC 828 ms
48,236 KB
testcase_43 AC 815 ms
48,236 KB
testcase_44 AC 848 ms
48,240 KB
testcase_45 AC 813 ms
48,236 KB
testcase_46 AC 842 ms
48,236 KB
testcase_47 AC 3 ms
6,548 KB
testcase_48 AC 3 ms
6,548 KB
testcase_49 AC 2 ms
6,548 KB
testcase_50 AC 2 ms
6,548 KB
testcase_51 AC 2 ms
6,548 KB
testcase_52 AC 3 ms
6,548 KB
testcase_53 AC 3 ms
6,548 KB
testcase_54 AC 2 ms
6,548 KB
testcase_55 AC 3 ms
6,548 KB
testcase_56 AC 2 ms
6,548 KB
testcase_57 AC 3 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/math>
using namespace std;
int N,M;
long T[2<<17];
array<long,10>X,C[2<<17];
multiset<array<long,10>>S;
bool fn[2<<17];
const long mod=998244259;
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];
        if(T[i]==100)
        {
            if([&]
            {
                for(int j=0;j<M;j++)if(100*X[j]!=T[i]*C[i][j])return 0;
                return 1;
            }())
            {
                cout<<"Yes\n";
                return 0;
            }
            continue;
        }
        array<long,10>ar;
        for(int j=0;j<10;j++)
        {
            ar[j]=(10000*X[j]-100*T[i]*C[i][j])%mod;
            ar[j]*=atcoder::pow_mod(100-T[i],mod-2,mod);
            ar[j]%=mod;
        }
        S.insert(ar);
        array<long,10>ar2;
        for(int j=0;j<10;j++)ar2[j]=T[i]*C[i][j]%mod;
        if(ar==ar2)fn[i]=1;
    }
    for(int i=0;i<N;i++)if(!fn[i])
    {
        array<long,10>ar;
        for(int j=0;j<10;j++)ar[j]=T[i]*C[i][j]%mod;
        if(S.find(ar)!=S.end())
        {
            cout<<"Yes\n";
            return 0;
        }
    }
    cout<<"No\n";
}
0