結果
問題 | No.2845 Birthday Pattern in Two Different Calendars |
ユーザー |
|
提出日時 | 2024-08-23 22:07:45 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 745 bytes |
コンパイル時間 | 2,258 ms |
コンパイル使用メモリ | 204,984 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-08-23 22:07:51 |
合計ジャッジ時間 | 5,241 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 WA * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ int k, m, n; cin >> k >> m >> n; m--; vector<int> a; vector<bool> used(k); for(int i = 0; i < k; i++){ int j = (i + m) % k; if(i == j) continue; if(used[i] || used[j]) continue; used[i] = used[j] = true; a.emplace_back(i); } if(a.size() >= n){ cout << "Yes\n"; for(int i = 0; i < n; i++){ cout << a[i] + 1 << (i + 1 == n ? '\n' : ' '); } }else{ cout << "No\n"; } } }