Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
48369 MattL 【AB-1】函数 C++ 解答错误 0 2 MS 268 KB 576 2022-04-12 13:06:07

Tests(0/10):


#include<bits/stdc++.h> using namespace std; inline long long read() { int x=0,f=1; char t=getchar(); while(t<'0'||t>'9'){if(t=='-')f=0;t=getchar();} while(t>='0'&&t<='9')x=(x<<1)+(x<<3)+(t^48),t=getchar(); return f?x:-x; } long long n,K,k1,k2,f[55][30]; int main() { n=read(),K=read(),k1=read(),k2=read(); f[1][k1%11]=1; f[2][(k1+k2)%11]=1; for(int i=1;i<=n+1;i++) for(long long k=-K;k<=K;k++) for(long long o=0;o<=k2;o++) { if(o>pow(k1,n-i+1))f[i][o%11]+=f[i-1][int(o-pow(k1,n-i+1)*k)%11]; } cout<<f[n+1][k2%11]; return 0; }


测评信息: