結果
問題 | No.2860 Heal Slimes |
ユーザー |
|
提出日時 | 2024-08-25 15:35:40 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,293 bytes |
コンパイル時間 | 4,389 ms |
コンパイル使用メモリ | 263,460 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-08-25 15:35:49 |
合計ジャッジ時間 | 8,792 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 WA * 30 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>using namespace std;using ll = long long;template<class T> istream& operator >> (istream& is, vector<T>& vec) {for(T& x : vec) is >> x;return is;}template<class T> ostream& operator << (ostream& os, const vector<T>& vec) {if(vec.empty()) return os;os << vec[0];for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it;return os;}int main(){ios::sync_with_stdio(false);cin.tie(0);int T;cin >> T;while(T--){int n, k, x;cin >> n >> k >> x;vector<ll> a(n), sv(k), cnt(k);cin >> a;for(int i = 0; i < k; i++){for(int j = i; j < n; j += k){sv[i] += a[j];cnt[i]++;}}bool ans = true;pair<ll,ll> pa2 = {0, 1};for(int i = 0; i < k; i++){auto pa = atcoder::crt({sv[i], 0}, {x, cnt[i]});if(pa.second == 0){ans = false;break;}/*pa2 = atcoder::crt({pa2.first, pa.first}, {pa2.second, pa.second});if(pa2.second == 0){ans = false;break;}*/}cout << (ans ? "Yes" : "No") << '\n';}}