結果

問題 No.2684 折々の色
ユーザー Nzt3Nzt3
提出日時 2024-04-11 19:06:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 239 ms / 2,000 ms
コード長 1,204 bytes
コンパイル時間 3,127 ms
コンパイル使用メモリ 208,124 KB
実行使用メモリ 13,408 KB
最終ジャッジ日時 2024-04-11 19:06:15
合計ジャッジ時間 13,156 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 98 ms
9,116 KB
testcase_12 AC 61 ms
8,064 KB
testcase_13 AC 115 ms
11,724 KB
testcase_14 AC 62 ms
6,992 KB
testcase_15 AC 62 ms
8,880 KB
testcase_16 AC 14 ms
6,940 KB
testcase_17 AC 60 ms
7,680 KB
testcase_18 AC 93 ms
12,664 KB
testcase_19 AC 129 ms
10,844 KB
testcase_20 AC 93 ms
7,388 KB
testcase_21 AC 25 ms
6,940 KB
testcase_22 AC 99 ms
12,896 KB
testcase_23 AC 90 ms
8,096 KB
testcase_24 AC 37 ms
7,040 KB
testcase_25 AC 58 ms
7,668 KB
testcase_26 AC 119 ms
9,372 KB
testcase_27 AC 73 ms
7,792 KB
testcase_28 AC 88 ms
7,892 KB
testcase_29 AC 205 ms
13,204 KB
testcase_30 AC 199 ms
13,164 KB
testcase_31 AC 194 ms
13,252 KB
testcase_32 AC 214 ms
13,124 KB
testcase_33 AC 211 ms
13,200 KB
testcase_34 AC 199 ms
13,276 KB
testcase_35 AC 200 ms
13,336 KB
testcase_36 AC 197 ms
13,160 KB
testcase_37 AC 210 ms
13,376 KB
testcase_38 AC 232 ms
13,276 KB
testcase_39 AC 232 ms
13,408 KB
testcase_40 AC 231 ms
13,276 KB
testcase_41 AC 233 ms
13,276 KB
testcase_42 AC 236 ms
13,276 KB
testcase_43 AC 239 ms
13,276 KB
testcase_44 AC 231 ms
13,272 KB
testcase_45 AC 231 ms
13,276 KB
testcase_46 AC 234 ms
13,272 KB
testcase_47 AC 2 ms
6,940 KB
testcase_48 AC 2 ms
6,940 KB
testcase_49 AC 2 ms
6,940 KB
testcase_50 AC 2 ms
6,940 KB
testcase_51 AC 2 ms
6,940 KB
testcase_52 AC 2 ms
6,944 KB
testcase_53 AC 2 ms
6,940 KB
testcase_54 AC 2 ms
6,940 KB
testcase_55 AC 2 ms
6,944 KB
testcase_56 AC 2 ms
6,940 KB
testcase_57 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr int MOD=998244353;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N,M;
  cin>>N>>M;
  array<int,10>X;
  for(int i=0;i<10;i++)X[i]=0;
  for(int i=0;i<M;i++)cin>>X[i];
  vector<array<int,10>> V(N);
  vector T(N,0);
  vector<pair<array<int,10>,int>> vs;
  for(int i=0;i<N;i++){
    for(int j=0;j<10;j++)V[i][j]=0;
    for(int j=0;j<M;j++)cin>>V[i][j];
    if(V[i]==X){
      cout<<"Yes\n";
      return 0;
    }
    cin>>T[i];
    for(auto &j:V[i])j*=T[i];
    if(T[i]==100)continue;
    array<int,10> need;
    bool ok=1;
    for(int j=0;j<10;j++){
      int x=10000*X[j]-100*V[i][j];
      if(x%(100-T[i])!=0)ok=0;
      need[j]=x/(100-T[i]);
    }
    if(ok)vs.push_back(make_pair(need,i));
  }
  sort(vs.begin(),vs.end());
  for(int i=0;i<N;i++){
    auto it=lower_bound(vs.begin(),vs.end(),make_pair(V[i],0));
    if(it!=vs.end()){
      if((*it).second!=i&&(*it).first==V[i]){
        cout<<"Yes\n";
        return 0;
      }
      it++;
      if(it!=vs.end()){
        if((*it).second!=i&&(*it).first==V[i]){
          cout<<"Yes\n";
          return 0;
        }
      }
    }
  }
  cout<<"No\n";



}
0