結果

問題 No.3475 Many Hello Substrings
コンテスト
ユーザー Dipanshu
提出日時 2026-03-20 22:50:55
言語 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
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 570 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,997 ms
コンパイル使用メモリ 334,196 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-20 22:51:02
合計ジャッジ時間 2,424 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;


int binpow(int a,int p)
{
  if (p==0) return 1;
  if (p%2) return binpow(a,p-1)*a;
  int t = binpow(a,p/2);
  return t*t;
}


bool solve()
{
  int n,p,k;
  cin>>n>>p>>k;
  
  if (k%p==0)
  {
    if (n>= (k/p)*5) return true;
  }
  if ((k-(p-1))%p==0)
  {
    if (n>= ((k-(p-1))/p)*5+5) return true;
  }
  return false;
}

signed main() 
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  
  int t;cin>>t;while(t--)
  if (solve()) cout << "Yes" << endl;
  else cout << "No" << endl;
}
0