結果
| 問題 | No.3475 Many Hello Substrings |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-03-23 01:06:18 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,731 bytes |
| 記録 | |
| コンパイル時間 | 4,140 ms |
| コンパイル使用メモリ | 374,484 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-23 01:06:29 |
| 合計ジャッジ時間 | 9,627 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
ソースコード
#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(k == 0) {
cout<<"Yes"<<endl;
continue;
}
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;
n -= 5;
if (k % p == 0 && n >= 5)
{
ll d = k / p;
if (1 <= d && d <= n / 5)
ok = true;
}
}
cout<<(ok?"Yes":"No")<<endl;
}
return 0;
}