結果
問題 | No.2684 折々の色 |
ユーザー |
|
提出日時 | 2024-04-11 19:02:09 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,178 bytes |
コンパイル時間 | 8,173 ms |
コンパイル使用メモリ | 268,608 KB |
最終ジャッジ日時 | 2025-02-20 23:55:02 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 RE * 45 |
ソースコード
#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];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+=1;if(it!=vs.end()){if((*it).second!=i&&(*it).first==V[i]){cout<<"Yes\n";return 0;}}}}cout<<"No\n";}