結果
問題 |
No.2684 折々の色
|
ユーザー |
|
提出日時 | 2024-03-20 23:01:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,229 bytes |
コンパイル時間 | 2,461 ms |
コンパイル使用メモリ | 205,624 KB |
最終ジャッジ日時 | 2025-02-20 09:58:49 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 39 RE * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin >> N >> M; vector<int> X(M),T(N); vector<vector<int>> C(N); for(auto &x : X) cin >> x,x *= 10000; multiset<vector<int>> S; for(int i=0; i<N; i++){ vector<int> now(M); for(auto &n : now) cin >> n; int t; cin >> t; for(auto &n : now) n *= t; S.insert(now); C.at(i) = now; T.at(i) = t; } bool yes = false; for(int i=0; i<N; i++){ vector<int> goal = X; bool ok = true; int t = T.at(i); if(t == 100){ for(int k=0; k<M; k++) goal.at(k) /= 100; if(goal == C.at(i)){yes = true; break;} } t = 100-t; for(int k=0; k<M; k++){ goal.at(k) -= 100*C.at(i).at(k); if(goal.at(k) >= 0){ if(goal.at(k)%(t)){ok = false; break;} goal.at(k) /= t; } else{ok = false; break;} } S.erase(S.find(C.at(i))); if(S.count(goal) && ok){yes = true; break;} S.insert(C.at(i)); } if(yes) cout << "Yes" << endl; else cout << "No" << endl; }