QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#408407 | #7648. 网格图最大流计数 | qwqwf | 100 ✓ | 1454ms | 21252kb | C++14 | 5.6kb | 2024-05-10 10:04:42 | 2024-05-10 10:04:44 |
Judging History
answer
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
#pragma GCC optimize("Ofast","unroll-loops","inline")
#include<bits/stdc++.h>
#define ll long long
//#define int ll
#define pb push_back
using namespace std;
const int N=1e3+10,mod=1e9+7;
const int inv2=(mod+1)/2;
inline void Add(int &x,int y){x+=y;if(x>=mod) x-=mod;}
inline void Del(int &x,int y){x-=y;if(x<0) x+=mod;}
inline int del(int x,int y){x-=y;return x<0?x+mod:x;}
inline int add(int x,int y){x+=y;return x>=mod?x-mod:x;}
inline int iep(int x){return x&1?mod-1:1;}
int qpow(int a,int b){
int res=1;
while(b){
if(b&1) res=1ll*res*a%mod;
a=1ll*a*a%mod;b>>=1;
}return res;
}
struct Faction{
int len;vector<int> v;
inline void init(int l){len=l;v.resize(l+1);}
};
namespace Poly{
inline Faction operator >>(Faction f,int k){
int len=f.len;f.init(len+k);
for(int i=len;~i;i--) f.v[i+k]=f.v[i];
for(int i=0;i<k;i++) f.v[i]=0;
return f;
}
inline Faction operator <<(Faction f,int k){
int len=f.len;
for(int i=k;i<=len;i++) f.v[i-k]=f.v[i];
for(int i=max(0,len-k+1);i<=len;i++) f.v[i]=0;
f.init(max(0,len-k));
return f;
}
inline Faction operator *(Faction a,int k){
Faction c;c.init(a.len);
for(int i=0;i<=a.len;i++) c.v[i]=1ll*a.v[i]*k%mod;
return c;
}
inline Faction operator +(Faction a,Faction b){
Faction c;int len=max(a.len,b.len);c.init(len);a.init(len);b.init(len);
for(int i=0;i<=len;i++) c.v[i]=add(a.v[i],b.v[i]);
return c;
}
inline Faction operator -(Faction a,Faction b){
Faction c;int len=max(a.len,b.len);c.init(len);a.init(len);b.init(len);
for(int i=0;i<=len;i++) c.v[i]=del(a.v[i],b.v[i]);
return c;
}
void print(Faction x){
for(int i=0;i<=x.len;i++) cout<<x.v[i]<<' ';cout<<'\n';
}
inline Faction rev(Faction &f){
for(int i=0;i<=f.len;i++) f.v[i]=del(0,f.v[i]);
return f;
}
}
using namespace Poly;
void Print(int a[N][N],int n){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++) cout<<a[i][j]<<' ';cout<<'\n';
}
}
Faction f[N];
Faction det(int a[N][N],int n){
for(int i=2;i<=n;i++){
if(!a[i][i-1]) for(int j=i+1;j<=n;j++) if(a[j][i-1]){swap(a[i],a[j]);for(int k=1;k<=n;k++) swap(a[k][i],a[k][j]);break;}
if(a[i][i-1]){
int inv=qpow(a[i][i-1],mod-2);
for(int j=i+1;j<=n;j++){
int res=1ll*a[j][i-1]*inv%mod;
for(int k=i-1;k<=n;k++) Del(a[j][k],1ll*a[i][k]*res%mod);
for(int k=1;k<=n;k++) Add(a[k][i],1ll*a[k][j]*res%mod);
}
}
}
f[0].init(0);f[0].v[0]=1;
for(int i=1;i<=n;i++){
f[i]=f[i-1]>>1;
for(int j=i,w=1;j;w=1ll*w*a[j][j-1]%mod,j--){
int res=1ll*a[j][i]*w%mod;f[i]=f[i]-(f[j-1]*res);
}
}
return f[n];
}
Faction F;int cnt,D[N][N],E[N];
void solve(int a[N][N],int b[N][N],int c[N][N],int n){
bool fl=0;
for(int i=1;i<=n;i++){
while(!a[i][i]){
for(int j=i+1;j<=n;j++)if(a[i][j]){for(int k=1;k<=n;k++) swap(a[k][i],a[k][j]),swap(b[k][i],b[k][j]),swap(c[k][i],c[k][j]);fl^=1;break;}
if(a[i][i]) break;
for(int k=1;k<=n;k++) a[i][k]=b[i][k],b[i][k]=c[i][k],c[i][k]=0;
cnt++;
if(cnt>2*n) return ;
for(int j=1;j<i;j++){
int inv=qpow(a[j][j],mod-2),res=1ll*inv*a[i][j]%mod;
for(int k=1;k<=n;k++) Del(a[i][k],1ll*res*a[j][k]%mod),Del(b[i][k],1ll*res*b[j][k]%mod),Del(c[i][k],1ll*res*c[j][k]%mod);
}
}
int inv=qpow(a[i][i],mod-2);
for(int j=1;j<=n;j++) if(j!=i){
int res=1ll*inv*a[j][i]%mod;
for(int k=1;k<=n;k++) Del(a[j][k],1ll*res*a[i][k]%mod),Del(b[j][k],1ll*res*b[i][k]%mod),Del(c[j][k],1ll*res*c[i][k]%mod);
}
}
for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) b[i][j]=del(mod,b[i][j]);
for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) c[i][j]=del(mod,c[i][j]);
int res=1;
for(int i=1;i<=n;i++){
res=1ll*res*a[i][i]%mod;
int inv=qpow(a[i][i],mod-2);
for(int j=1;j<=n;j++) b[i][j]=1ll*b[i][j]*inv%mod,c[i][j]=1ll*c[i][j]*inv%mod;
a[i][i]=1;
}
for(int i=1;i<=n;i++) for(int j=n+1;j<=n+n;j++) D[i][j]=(i==j-n);
for(int i=n+1;i<=n+n;i++) for(int j=1;j<=n;j++) D[i][j]=c[i-n][j];
for(int i=n+1;i<=n+n;i++) for(int j=n+1;j<=n+n;j++) D[i][j]=b[i-n][j-n];
F=det(D,2*n);F=F*res;F=F<<cnt,F.init(min(F.len,2*n));
if(fl) rev(F);
}
int n,m,k,a[N],b[N],dp[N][N],d[N][N],A[N][N],B[N][N],C[N][N],t[N][N],si[N],sj[N];
char ch[N][N];
signed main(){
// freopen("a.in","r",stdin);
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
cin>>n>>m>>k;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=m;i++) cin>>b[i];
for(int i=1;i<=k;i++) cin>>(ch[i]+1);
for(int i=1;i<=n;i++){
for(int j=1;j<=k;j++) for(int p=1;p<=k;p++) dp[j][p]=0;
if(ch[1][a[i]]=='1') dp[1][a[i]]=1;
for(int j=1;j<=k;j++) for(int p=1;p<=k;p++) if(dp[j][p]){
if(ch[j+1][p]=='1') Add(dp[j+1][p],dp[j][p]);
if(ch[j][p+1]=='1') Add(dp[j][p+1],dp[j][p]);
}
for(int j=1;j<=m;j++) d[i][j]=dp[k][b[j]];
}
// for(int i=1;i<=n;i++){
// for(int j=1;j<=m;j++) cout<<d[i][j]<<' ';cout<<'\n';
// }
d[++n][++m]=1;
for(int i=1;i<n;i++) for(int j=i+1;j<=n;j++){
for(int p=1;p<=m;p++) si[p]=d[i][p],sj[p]=d[j][p];
int x=0,y=0,z=0;
for(int p=m;p;p--){
Add(z,del(1ll*si[p]*y%mod,1ll*sj[p]*x%mod));
Add(x,si[p]),Add(y,sj[p]);
}
t[i][j]=z,t[j][i]=del(0,z);
}
int nn=n;if(n&1) n++;
for(int i=1;i<n;i++) for(int j=i+1;j<=n;j++){
C[i][j]=iep(i+j+1);
if(j<nn) A[i][j]=t[i][j];
else if(j==nn) B[i][j]=t[i][j];
C[j][i]=del(0,C[i][j]);B[j][i]=del(0,B[i][j]);A[j][i]=del(0,A[i][j]);
}
solve(A,B,C,n);
int s=F.len;
E[0]=1;
for(int i=1;i<=s/2;i++){
E[i]=F.v[i];
for(int j=1;j<i;j++) Del(E[i],1ll*E[j]*E[i-j]%mod);
E[i]=1ll*E[i]*inv2%mod;
}
cout<<s/2<<' '<<E[s/2]<<'\n';
return 0;
}
詳細信息
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 2ms
memory: 8012kb
input:
7 7 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1111111 1111111 1111111 1111111 1111111 1111111 1111111
output:
7 1
result:
ok 2 number(s): "7 1"
Test #2:
score: 5
Accepted
time: 0ms
memory: 5880kb
input:
7 7 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1111111 1111111 1111111 1111111 1111111 1111111 1111111
output:
7 1
result:
ok 2 number(s): "7 1"
Test #3:
score: 5
Accepted
time: 1ms
memory: 5884kb
input:
7 7 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1111111 1111111 1111111 1111111 1111111 1111111 1111111
output:
7 1
result:
ok 2 number(s): "7 1"
Test #4:
score: 5
Accepted
time: 1ms
memory: 7904kb
input:
7 7 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1111111 1111111 1111111 1111111 1111111 1110111 1111111
output:
6 52
result:
ok 2 number(s): "6 52"
Test #5:
score: 5
Accepted
time: 1ms
memory: 6076kb
input:
7 7 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1111111 1111111 1111111 1111111 1111111 1110111 1111111
output:
6 52
result:
ok 2 number(s): "6 52"
Subtask #2:
score: 5
Accepted
Dependency #1:
100%
Accepted
Test #6:
score: 5
Accepted
time: 0ms
memory: 8068kb
input:
16 17 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 111111111111111111 111111111111111111 111011111111111111 111111111111111111 111111111111111111 111011110111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 1...
output:
14 328354990
result:
ok 2 number(s): "14 328354990"
Test #7:
score: 5
Accepted
time: 1ms
memory: 8104kb
input:
17 16 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111101111111111 111111111111111111 111111111111011111 ...
output:
15 449998848
result:
ok 2 number(s): "15 449998848"
Test #8:
score: 5
Accepted
time: 1ms
memory: 6140kb
input:
16 18 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 111111111111110111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111110111111 111111111111111111 11111111111111111...
output:
15 844316215
result:
ok 2 number(s): "15 844316215"
Test #9:
score: 5
Accepted
time: 2ms
memory: 8296kb
input:
16 17 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 111111111111111111 111111111111111111 111011111111110111 111111111111111111 111111111111111111 111011111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 1...
output:
15 133840
result:
ok 2 number(s): "15 133840"
Test #10:
score: 5
Accepted
time: 2ms
memory: 8152kb
input:
18 18 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111111111111 111111111011111111 111111111111111111 111101111111111111 111111111111111111 11111111111...
output:
16 27330297
result:
ok 2 number(s): "16 27330297"
Subtask #3:
score: 10
Accepted
Dependency #2:
100%
Accepted
Test #11:
score: 10
Accepted
time: 6ms
memory: 9464kb
input:
10 377 400 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
10 843273461
result:
ok 2 number(s): "10 843273461"
Test #12:
score: 10
Accepted
time: 3ms
memory: 8388kb
input:
10 367 400 1 2 3 4 5 6 7 8 9 10 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104...
output:
10 273577493
result:
ok 2 number(s): "10 273577493"
Test #13:
score: 10
Accepted
time: 6ms
memory: 9596kb
input:
10 350 400 1 2 3 4 5 6 7 8 9 10 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 11...
output:
9 605707862
result:
ok 2 number(s): "9 605707862"
Test #14:
score: 10
Accepted
time: 6ms
memory: 8812kb
input:
10 375 400 1 2 3 4 5 6 7 8 9 10 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
10 213051017
result:
ok 2 number(s): "10 213051017"
Test #15:
score: 10
Accepted
time: 6ms
memory: 9232kb
input:
10 330 400 1 2 3 4 5 6 7 8 9 10 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 ...
output:
9 320097125
result:
ok 2 number(s): "9 320097125"
Test #16:
score: 10
Accepted
time: 6ms
memory: 7852kb
input:
10 360 400 1 2 3 4 5 6 7 8 9 10 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107...
output:
10 195548453
result:
ok 2 number(s): "10 195548453"
Test #17:
score: 10
Accepted
time: 6ms
memory: 7896kb
input:
10 365 400 1 2 3 4 5 6 7 8 9 10 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 10...
output:
10 20617593
result:
ok 2 number(s): "10 20617593"
Test #18:
score: 10
Accepted
time: 3ms
memory: 7928kb
input:
10 334 400 1 2 3 4 5 6 7 8 9 10 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 11...
output:
10 602177426
result:
ok 2 number(s): "10 602177426"
Test #19:
score: 10
Accepted
time: 6ms
memory: 7852kb
input:
10 323 400 1 2 3 4 5 6 7 8 9 10 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 1...
output:
9 619229914
result:
ok 2 number(s): "9 619229914"
Test #20:
score: 10
Accepted
time: 3ms
memory: 7900kb
input:
10 379 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1...
output:
10 409116219
result:
ok 2 number(s): "10 409116219"
Subtask #4:
score: 25
Accepted
Dependency #3:
100%
Accepted
Test #21:
score: 25
Accepted
time: 63ms
memory: 11212kb
input:
100 322 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
85 207066474
result:
ok 2 number(s): "85 207066474"
Test #22:
score: 25
Accepted
time: 68ms
memory: 9904kb
input:
100 334 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
84 608992198
result:
ok 2 number(s): "84 608992198"
Test #23:
score: 25
Accepted
time: 63ms
memory: 10952kb
input:
100 373 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
87 22076236
result:
ok 2 number(s): "87 22076236"
Test #24:
score: 25
Accepted
time: 68ms
memory: 12212kb
input:
100 327 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
87 819624712
result:
ok 2 number(s): "87 819624712"
Test #25:
score: 25
Accepted
time: 68ms
memory: 10660kb
input:
100 326 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
89 339092727
result:
ok 2 number(s): "89 339092727"
Test #26:
score: 25
Accepted
time: 69ms
memory: 10656kb
input:
100 366 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
87 577188664
result:
ok 2 number(s): "87 577188664"
Test #27:
score: 25
Accepted
time: 65ms
memory: 10140kb
input:
100 394 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
86 909840591
result:
ok 2 number(s): "86 909840591"
Test #28:
score: 25
Accepted
time: 68ms
memory: 10728kb
input:
100 389 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
87 793712350
result:
ok 2 number(s): "87 793712350"
Test #29:
score: 25
Accepted
time: 64ms
memory: 10444kb
input:
100 334 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
89 8486281
result:
ok 2 number(s): "89 8486281"
Test #30:
score: 25
Accepted
time: 64ms
memory: 11268kb
input:
100 367 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
87 419573333
result:
ok 2 number(s): "87 419573333"
Subtask #5:
score: 10
Accepted
Test #31:
score: 10
Accepted
time: 41ms
memory: 10936kb
input:
73 73 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 ...
output:
73 849796347
result:
ok 2 number(s): "73 849796347"
Test #32:
score: 10
Accepted
time: 34ms
memory: 9704kb
input:
68 68 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152...
output:
68 334069950
result:
ok 2 number(s): "68 334069950"
Test #33:
score: 10
Accepted
time: 36ms
memory: 10424kb
input:
72 72 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133...
output:
72 180096245
result:
ok 2 number(s): "72 180096245"
Test #34:
score: 10
Accepted
time: 32ms
memory: 11200kb
input:
71 71 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 13...
output:
71 234343448
result:
ok 2 number(s): "71 234343448"
Test #35:
score: 10
Accepted
time: 44ms
memory: 9160kb
input:
68 68 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152...
output:
68 371509898
result:
ok 2 number(s): "68 371509898"
Test #36:
score: 10
Accepted
time: 244ms
memory: 15312kb
input:
200 200 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
200 852372194
result:
ok 2 number(s): "200 852372194"
Test #37:
score: 10
Accepted
time: 328ms
memory: 12676kb
input:
230 230 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
230 65874836
result:
ok 2 number(s): "230 65874836"
Test #38:
score: 10
Accepted
time: 467ms
memory: 17276kb
input:
260 260 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
260 272563656
result:
ok 2 number(s): "260 272563656"
Test #39:
score: 10
Accepted
time: 611ms
memory: 15720kb
input:
290 290 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
290 95450701
result:
ok 2 number(s): "290 95450701"
Test #40:
score: 10
Accepted
time: 778ms
memory: 16256kb
input:
320 320 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
320 266455174
result:
ok 2 number(s): "320 266455174"
Subtask #6:
score: 25
Accepted
Dependency #5:
100%
Accepted
Test #41:
score: 25
Accepted
time: 75ms
memory: 10200kb
input:
107 371 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
107 3979643
result:
ok 2 number(s): "107 3979643"
Test #42:
score: 25
Accepted
time: 65ms
memory: 11788kb
input:
101 351 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
101 372994325
result:
ok 2 number(s): "101 372994325"
Test #43:
score: 25
Accepted
time: 69ms
memory: 9892kb
input:
101 369 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
101 46156842
result:
ok 2 number(s): "101 46156842"
Test #44:
score: 25
Accepted
time: 69ms
memory: 10840kb
input:
101 386 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
101 634357614
result:
ok 2 number(s): "101 634357614"
Test #45:
score: 25
Accepted
time: 79ms
memory: 10088kb
input:
109 388 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
109 24613754
result:
ok 2 number(s): "109 24613754"
Test #46:
score: 25
Accepted
time: 257ms
memory: 14692kb
input:
200 399 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
200 342259639
result:
ok 2 number(s): "200 342259639"
Test #47:
score: 25
Accepted
time: 361ms
memory: 14524kb
input:
230 393 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
230 596706635
result:
ok 2 number(s): "230 596706635"
Test #48:
score: 25
Accepted
time: 492ms
memory: 14784kb
input:
260 393 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
260 569883617
result:
ok 2 number(s): "260 569883617"
Test #49:
score: 25
Accepted
time: 636ms
memory: 17944kb
input:
290 395 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
290 473037952
result:
ok 2 number(s): "290 473037952"
Test #50:
score: 25
Accepted
time: 824ms
memory: 17060kb
input:
320 397 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
320 375576485
result:
ok 2 number(s): "320 375576485"
Subtask #7:
score: 20
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Dependency #6:
100%
Accepted
Test #51:
score: 20
Accepted
time: 915ms
memory: 21252kb
input:
400 375 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
0 1
result:
ok 2 number(s): "0 1"
Test #52:
score: 20
Accepted
time: 1163ms
memory: 20440kb
input:
400 346 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
44 259349435
result:
ok 2 number(s): "44 259349435"
Test #53:
score: 20
Accepted
time: 1318ms
memory: 18812kb
input:
400 368 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
92 934744081
result:
ok 2 number(s): "92 934744081"
Test #54:
score: 20
Accepted
time: 1340ms
memory: 19392kb
input:
400 331 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
118 819815069
result:
ok 2 number(s): "118 819815069"
Test #55:
score: 20
Accepted
time: 1033ms
memory: 17000kb
input:
355 385 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
154 827736761
result:
ok 2 number(s): "154 827736761"
Test #56:
score: 20
Accepted
time: 1438ms
memory: 19432kb
input:
400 380 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
165 936566720
result:
ok 2 number(s): "165 936566720"
Test #57:
score: 20
Accepted
time: 1286ms
memory: 19796kb
input:
382 335 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
164 615816056
result:
ok 2 number(s): "164 615816056"
Test #58:
score: 20
Accepted
time: 1420ms
memory: 18820kb
input:
400 324 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
180 258747176
result:
ok 2 number(s): "180 258747176"
Test #59:
score: 20
Accepted
time: 1454ms
memory: 19972kb
input:
400 326 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
191 245039016
result:
ok 2 number(s): "191 245039016"
Test #60:
score: 20
Accepted
time: 882ms
memory: 16292kb
input:
333 388 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
212 219763298
result:
ok 2 number(s): "212 219763298"
Extra Test:
score: 0
Extra Test Passed