QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#870248 | #9680. 数字变换 | staring# | 0 | 0ms | 5588kb | C++14 | 2.0kb | 2025-01-25 15:32:08 | 2025-01-25 15:32:08 |
answer
#include<bits/stdc++.h>
using namespace std;
namespace staring
{
typedef long long LL;
typedef vector<int> VEC;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
#define fir first
#define sec second
#define FOR(i,a,b) for(int i=(a),__i=(b);i<=__i;i++)
#define ROF(i,a,b) for(int i=(a),__i=(b);i>=__i;i--)
template<typename TYPE>
TYPE gmax(TYPE &x,const TYPE y){return x<y?x=y:x;}
template<typename TYPE>
TYPE gmin(TYPE &x,const TYPE y){return y<x?x=y:x;}
static constexpr int SIZE=1<<20;
static char buffin[SIZE]{},*pin1{},*pin2{};
static char buffout[SIZE]{},*pout{buffout};
#define GETC() (pin1==pin2&&(pin2=(pin1=buffin)+fread(buffin,1,SIZE,stdin),pin1==pin2)?EOF:*pin1++)
#define PUTC(c) (pout-buffout==SIZE&&(fwrite(buffout,1,SIZE,stdout),pout=buffout),*pout++=c)
template<typename TYPE>
void read(TYPE &x)
{
static int signf{0},chin{0};
x=signf=0,chin=GETC();
while(chin<'0'||chin>'9')signf|=chin=='-',chin=GETC();
while(chin>='0'&&chin<='9')x=(x<<3)+(x<<1)+(chin^48),chin=GETC();
if(signf)x=-x;
}
template<typename TYPE>
void write(TYPE x,char ch=' ',bool f=0)
{
static char stack[64]{},top{0};
!x&&PUTC('0'),x<0&&(x=-x,PUTC('-'));
while(x)stack[top++]=x%10|48,x/=10;
while(top)PUTC(stack[--top]);
if(ch)PUTC(ch);
}
}using namespace staring;
constexpr int N=5e6+5,M=45;
constexpr int MOD=998244353;
int f[M][N];
int res[N];
void add(int& a,int b)
{
a+=b,(a>=MOD)&&(a-=MOD);
}
int main()
{
int l,r,b;
read(l),read(r),read(b);
f[0][1]=1;
FOR(i,0,b-1)FOR(j,1,r)
{
add(f[i+1][j+1],f[i][j]);
if(j>1)add(f[i+1][j-1],f[i][j]);
for(int k=2;k<=r/j;k++)add(f[i+1][k*j],f[i][j]);
}
FOR(i,0,b-1)FOR(j,l,r)add(res[j],f[i][j]);
FOR(i,l,r)write(res[i]);
fwrite(buffout,1,pout-buffout,stdout);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 5588kb
input:
1 10 3
output:
3 3 4 5 3 6 3 6 4 5
result:
wrong answer 1st numbers differ - expected: '4', found: '3'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Runtime Error
Test #11:
score: 0
Runtime Error
input:
3000000000 3000000000 4
output:
result:
Subtask #5:
score: 0
Skipped
Dependency #3:
0%
Subtask #6:
score: 0
Skipped
Dependency #5:
0%
Subtask #7:
score: 0
Skipped
Dependency #1:
0%