結果
| 問題 | No.2845 Birthday Pattern in Two Different Calendars |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-23 22:07:45 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 745 bytes |
| 記録 | |
| コンパイル時間 | 1,982 ms |
| コンパイル使用メモリ | 196,728 KB |
| 最終ジャッジ日時 | 2025-02-23 23:48:51 |
|
ジャッジサーバー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";
}
}
}