結果

問題 No.2845 Birthday Pattern in Two Different Calendars
ユーザー Spica08
提出日時 2024-08-23 23:18:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,197 bytes
コンパイル時間 1,198 ms
コンパイル使用メモリ 104,648 KB
最終ジャッジ日時 2025-02-24 00:18:13
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <bitset>
#include <cctype>
#include <functional>
#include <cassert>
using namespace std;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)

using ll = long long;
using ull = unsigned long long;
using Matrix = std::vector<std::vector<ll>>;
const int inf = 1000000000;
const ll INF = 1000000000000000000;
const ll mod = 998244353;
const ull mod_hash = (1UL << 61) - 1;
const std::vector<int> dx = {0, 1, 0, -1, 1, 1, -1, -1};
const std::vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};

int main(){
  int T; cin >> T;
  while(T--){
    int K, M, N; cin >> K >> M >> N;
    set<int> day;
    vector<int> ans;
    REP(i, K){
      int a = i + 1;
      int b = ((a + M - 2) % K) + 1;
      if(a != b && !day.count(a) && !day.count(b)){
        day.insert(a);
        day.insert(b);
        ans.push_back(a);
      }
    }
    if(ans.size() >= N){
      cout << "Yes" << endl;
      REP(i, N) cout << ans[i] << " ";
      cout << endl;
    }else{
      cout << "No" << endl;
    }
  }
  return 0;
}
0