結果

問題 No.2684 折々の色
ユーザー umezoumezo
提出日時 2024-03-21 07:22:08
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 514 ms / 2,000 ms
コード長 1,045 bytes
コンパイル時間 6,342 ms
コンパイル使用メモリ 261,228 KB
実行使用メモリ 66,916 KB
最終ジャッジ日時 2024-03-21 07:22:40
合計ジャッジ時間 19,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 AC 5 ms
6,548 KB
testcase_05 AC 2 ms
6,548 KB
testcase_06 AC 2 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 2 ms
6,548 KB
testcase_11 AC 259 ms
33,152 KB
testcase_12 AC 148 ms
23,936 KB
testcase_13 AC 273 ms
37,168 KB
testcase_14 AC 115 ms
20,096 KB
testcase_15 AC 177 ms
28,032 KB
testcase_16 AC 33 ms
9,472 KB
testcase_17 AC 138 ms
21,632 KB
testcase_18 AC 309 ms
36,168 KB
testcase_19 AC 272 ms
38,272 KB
testcase_20 AC 159 ms
27,648 KB
testcase_21 AC 57 ms
12,800 KB
testcase_22 AC 297 ms
38,764 KB
testcase_23 AC 181 ms
29,824 KB
testcase_24 AC 87 ms
16,000 KB
testcase_25 AC 159 ms
21,376 KB
testcase_26 AC 245 ms
38,272 KB
testcase_27 AC 154 ms
25,984 KB
testcase_28 AC 191 ms
29,568 KB
testcase_29 AC 451 ms
63,816 KB
testcase_30 AC 409 ms
57,756 KB
testcase_31 AC 415 ms
56,828 KB
testcase_32 AC 500 ms
65,492 KB
testcase_33 AC 446 ms
63,664 KB
testcase_34 AC 415 ms
58,360 KB
testcase_35 AC 471 ms
58,772 KB
testcase_36 AC 419 ms
56,348 KB
testcase_37 AC 429 ms
57,580 KB
testcase_38 AC 514 ms
66,788 KB
testcase_39 AC 487 ms
66,916 KB
testcase_40 AC 514 ms
66,916 KB
testcase_41 AC 477 ms
66,916 KB
testcase_42 AC 482 ms
66,788 KB
testcase_43 AC 500 ms
66,788 KB
testcase_44 AC 464 ms
66,916 KB
testcase_45 AC 484 ms
66,788 KB
testcase_46 AC 473 ms
66,916 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 2 ms
6,548 KB
testcase_53 AC 2 ms
6,548 KB
testcase_54 AC 2 ms
6,548 KB
testcase_55 AC 2 ms
6,548 KB
testcase_56 AC 2 ms
6,548 KB
testcase_57 AC 2 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n,m;
  cin>>n>>m;
  vector<ll> X(m);
  rep(i,m) cin>>X[i];
  vector<vector<ll>> C(n,vector<ll>(m));
  vector<ll> T(n);
  rep(i,n){
    rep(j,m) cin>>C[i][j];
    cin>>T[i];
  }
  
  rep(i,m) X[i]*=100;
  rep(i,n) rep(j,m) C[i][j]*=T[i];
  
  map<vector<ll>,ll> mp;
  rep(i,n) mp[C[i]]++;
  
  rep(i,n){
    if(T[i]==100){
      if(C[i]==X){
        cout<<"Yes"<<endl;
        return 0;
      }
      continue;
    }
    vector<ll> Y(m);
    bool b=true;
    rep(j,m){
      if((100*(X[j]-C[i][j]))%(100-T[i])!=0){
        b=false;
        break;
      }
      Y[j]=(100*(X[j]-C[i][j]))/(100-T[i]);
    }
    if(b){
      if(mp[Y]>=2){
        cout<<"Yes"<<endl;
        return 0;
      }
      if(mp[Y]==1 && Y!=C[i]){
        cout<<"Yes"<<endl;
        return 0;
      }
    }
  }
  cout<<"No"<<endl;
    
  return 0;
}
0