結果

問題 No.3475 Many Hello Substrings
コンテスト
ユーザー ルビサファせだい
提出日時 2026-03-23 00:58:04
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,617 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,344 ms
コンパイル使用メモリ 374,672 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2026-03-23 00:58:16
合計ジャッジ時間 5,075 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using i128 = __int128;
using pll = pair<ll, ll>;
using vll = vector<ll>;
template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<>>;

constexpr ll INF = (1LL << 60);
ll ALPHABET_N = 26;
#define rep(i, n) for (ll i = (ll)0; i < (ll)n; i++)
#define rep_(i, k, n) for (ll i = (ll)k; i < (ll)n; i++)
#define rrep(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define all(a) a.begin(), a.end()

template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
bool chmin(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll t;
    cin >> t;
    rep(_, t)
    {
        ll n, p, k;
        cin >> n >> p >> k;
        bool ok = false;
        if (n < 5)
        {
            cout << "No" << endl;
            continue;
        }
        if (p - 1 == k)
            ok = true;
        if (k % p == 0)
        {
            ll d = k / p;
            if (1 <= d && d <= n / 5)
                ok = true;
        }
        if (k > p - 1)
        {
            k -= p - 1;
            if (k % p == 0)
            {
                ll d = k / p;
                if (1 <= d && d <= n / 5)
                    ok = true;
            }
        }
        cout<<(ok?"Yes":"No")<<endl;
    }
    return 0;
}
0