結果
| 問題 |
No.2845 Birthday Pattern in Two Different Calendars
|
| コンテスト | |
| ユーザー |
yamada
|
| 提出日時 | 2024-08-23 22:19:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 574 ms / 2,000 ms |
| コード長 | 2,134 bytes |
| コンパイル時間 | 3,149 ms |
| コンパイル使用メモリ | 162,896 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-08-23 22:19:20 |
| 合計ジャッジ時間 | 5,396 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 22 |
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <map>
#include <stack>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <bitset>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define rrep(i,a,b) for(ll i=a;i>=b;--i)
#define fore(i, a) for(auto& i : a)
#define pi 3.141592653589793238
typedef long long ll;
typedef pair<ll,ll> pp;
typedef vector<ll> vl;
typedef vector<ulong> vu;
typedef vector<vl> vvl;
typedef vector<pp> vp;
typedef vector<vp> vvp;
typedef priority_queue<pp, vp, greater<pp> > pq;
vl kaijou;
void kaijou_set(ll m) {kaijou.push_back(1); rep(i, 1, 1000009)kaijou.push_back((kaijou[i-1] * i) % m); return;}
ll C(ll a, ll b, ll m) {if(a < b) return 0; return (kaijou[a] * pow_mod(kaijou[a-b] * kaijou[b], m-2, m)) % m;}
template <typename T, typename F>
T bisect(T ok, T bad, F pred) {while (bad - ok > 1) {T mid = ok + (bad - ok) / 2; (pred(mid) ? ok : bad) = mid;} return bad;}
bool chmin(ll &a, ll b) {if (a > b) {a = b;return true;} return false;}
bool chmax(ll &a, ll b) {if (a < b) {a = b;return true;} return false;}
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
ll gcd(ll x, ll y) {if(y == 0)return x; return gcd(y, x % y); }
ll RU(ll a, ll b) {return a / b + (a % b && (a ^ b) >= 0); }
ll mod=998244353; ll mof=1000000007;
int main()
{
ll T;cin>>T;
rep(XXX,0,T){
ll n,m,k;
cin>>k>>m>>n;
m--;
if(m==0){
cout<<"No"<<endl;
continue;
}
ll kosuu=gcd(m,k);
ll syuuki=k/kosuu;
if(syuuki/2*kosuu<n){
cout<<"No"<<endl;
continue;
}
cout<<"Yes"<<endl;
ll outcnt=0;
rep(i,1,kosuu+1){
for(ll j=0;j+1<syuuki;j+=2){
if(i!=1||j!=0)cout<<" ";
cout<<(i+j*m-1)%k+1;
outcnt++;
if(outcnt==n)break;
}
if(outcnt==n)break;
}
cout<<endl;
}
}
yamada