結果
| 問題 | No.2845 Birthday Pattern in Two Different Calendars |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-23 22:38:07 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,902 bytes |
| 記録 | |
| コンパイル時間 | 3,738 ms |
| コンパイル使用メモリ | 231,836 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-08-23 22:38:15 |
| 合計ジャッジ時間 | 7,407 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 WA * 15 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, p, n) for (ll i = p; i < (ll)(n); i++)
#define rep2(i, p, n) for (ll i = p; i >= (ll)(n); i--)
using namespace std;
using ll = long long;
using ld = long double;
const double pi = 3.141592653589793;
const long long inf = 2 * 1e9;
const long long linf = 4 * 1e18;
const ll mod1 = 1000000007;
const ll mod2 = 998244353;
template <class T>
inline bool chmax(T &a, T b)
{ if (a < b) { a = b; return 1; } return 0;}
template <class T>
inline bool chmin(T &a, T b)
{
if (a > b)
{
a = b;
return 1;
}
return 0;
}
//atcoder
#include <atcoder/all>
using namespace atcoder;
using mint1 = modint1000000007;
using mint2 = modint998244353;
vector<pair<ll, ll>> base={{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
int main() {
//////////////////
ios::sync_with_stdio(false);
cin.tie(nullptr);
//////////////////
ll T;
cin >> T;
while(T--) {
ll K, M, N;
cin >> K >> M >> N;
M--;
if (M==0) {
cout << "No" << endl;
continue;
}
//cout << K << M << N << endl;
bool ch = false;
if (K < M * 2)
{
ch = true;
M = K - M;
}
vector<ll> ans(0);
ll now = 0;
while (now<K)
{
rep(i, 0, M) {
if (now+i+M<K) {
if (!ch) {
ans.push_back(now + i);
}
else {
ans.push_back(now + i + M);
}
}
}
now += (2 * M);
}
if (ans.size()>=N) {
cout << "Yes" << endl;
rep(i, 0, N) {
cout << ans.at(i)+1 << " ";
}
cout << endl;
}
else {
cout << "No" << endl;
}
}
}