QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#43721 | #4543. Sumire | _whb | Compile Error | / | / | C++ | 1.0kb | 2022-08-10 12:31:43 | 2022-08-10 12:31:44 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-08-10 12:31:44]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2022-08-10 12:31:43]
- 提交
answer
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
const ll mod = 1000000007 ;
ll T ;
ll k,b,d ;
ll l,r ;
ll f[70][70][2] ;
ll a[70] ;
ll qsm(ll a,ll b)
{
ll ans=1 ; a%=mod ;
while(b)
{
if(b&1) ans=ans*a%mod ;
a=a*a%mod ; b>>=1 ;
}
return ans ;
}
ll dp(ll pos,ll num,bool flag,bool iszero)
{
if(num<0) return 0 ;
if(pos==0&&num==0) return 1 ;
if(flag&&f[pos][num][iszero]!=-1) return f[pos][num][iszero] ;
ll x=flag?(b-1):a[pos] ;
ll ans=0 ;
if(x<4)
{
for(ll i=0;i<=x;++i)
ans+=dp(pos-1,num-( (d!=0&&i==d) || (d==0&&i==d&&!iszero) ),flag||(i<x),iszero&&(i==0)),ans%=mod ;
}
else
{
if(iszero)
{
if(!flag)
{
if(d==0) ans+=(x-1)*dp(pos-1,num,1,0)%mod+dp(pos-1,num,0,0)+dp(pos-1,num,1,1) ;
else
{
if(d>x) ans+=(x-1)*dp(pos-1,num,1,0)%mod+dp(pos-1,num,0,0)+dp(pos-1,num,1,1) ;
Details
answer.code: In function ‘long long int dp(long long int, long long int, bool, bool)’: answer.code:41:99: error: expected ‘}’ at end of input 41 | if(d>x) ans+=(x-1)*dp(pos-1,num,1,0)%mod+dp(pos-1,num,0,0)+dp(pos-1,num,1,1) ; | ^ answer.code:40:17: note: to match this ‘{’ 40 | { | ^ answer.code:41:99: error: expected ‘}’ at end of input 41 | if(d>x) ans+=(x-1)*dp(pos-1,num,1,0)%mod+dp(pos-1,num,0,0)+dp(pos-1,num,1,1) ; | ^ answer.code:37:13: note: to match this ‘{’ 37 | { | ^ answer.code:41:99: error: expected ‘}’ at end of input 41 | if(d>x) ans+=(x-1)*dp(pos-1,num,1,0)%mod+dp(pos-1,num,0,0)+dp(pos-1,num,1,1) ; | ^ answer.code:35:9: note: to match this ‘{’ 35 | { | ^ answer.code:41:99: error: expected ‘}’ at end of input 41 | if(d>x) ans+=(x-1)*dp(pos-1,num,1,0)%mod+dp(pos-1,num,0,0)+dp(pos-1,num,1,1) ; | ^ answer.code:33:5: note: to match this ‘{’ 33 | { | ^ answer.code:41:99: error: expected ‘}’ at end of input 41 | if(d>x) ans+=(x-1)*dp(pos-1,num,1,0)%mod+dp(pos-1,num,0,0)+dp(pos-1,num,1,1) ; | ^ answer.code:21:1: note: to match this ‘{’ 21 | { | ^ answer.code:41:99: warning: control reaches end of non-void function [-Wreturn-type] 41 | if(d>x) ans+=(x-1)*dp(pos-1,num,1,0)%mod+dp(pos-1,num,0,0)+dp(pos-1,num,1,1) ; | ^