QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#152464 | #6623. Perfect Matchings | do_while_true# | AC ✓ | 42ms | 129500kb | C++14 | 3.0kb | 2023-08-28 09:33:30 | 2023-08-28 09:33:30 |
Judging History
answer
#include<cstdio>
#include<vector>
#include<queue>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<ctime>
#include<random>
#include<assert.h>
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define dbg(x) cerr<<"In Line "<< __LINE__<<" the "<<#x<<" = "<<x<<'\n'
#define dpi(x,y) cerr<<"In Line "<<__LINE__<<" the "<<#x<<" = "<<x<<" ; "<<"the "<<#y<<" = "<<y<<'\n'
#define DE(fmt,...) fprintf(stderr, "Line %d : " fmt "\n",__LINE__,##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int>pii;
typedef pair<ll,int>pli;
typedef pair<ll,ll>pll;
typedef pair<int,ll>pil;
typedef vector<int>vi;
typedef vector<ll>vll;
typedef vector<pii>vpii;
typedef vector<pll>vpll;
template<typename T>T cmax(T &x, T y){return x=x>y?x:y;}
template<typename T>T cmin(T &x, T y){return x=x<y?x:y;}
template<typename T>
T &read(T &r){
r=0;bool w=0;char ch=getchar();
while(ch<'0'||ch>'9')w=ch=='-'?1:0,ch=getchar();
while(ch>='0'&&ch<='9')r=r*10+(ch^48),ch=getchar();
return r=w?-r:r;
}
template<typename T1,typename... T2>
void read(T1 &x,T2& ...y){read(x);read(y...);}
const int mod=998244353;
inline void cadd(int &x,int y){x=(x+y>=mod)?(x+y-mod):(x+y);}
inline void cdel(int &x,int y){x=(x-y<0)?(x-y+mod):(x-y);}
inline int add(int x,int y){return (x+y>=mod)?(x+y-mod):(x+y);}
inline int del(int x,int y){return (x-y<0)?(x-y+mod):(x-y);}
int qpow(int x,int y){
int s=1;
while(y){
if(y&1)s=1ll*s*x%mod;
x=1ll*x*x%mod;
y>>=1;
}
return s;
}
const int N=4010;
int n;
vi eg[N];
int f[N][N][2],g[N][2],siz[N];
void dfs(int x,int fa){
f[x][0][0]=1;siz[x]=1;
for(auto v:eg[x])if(v!=fa){
dfs(v,x);
for(int i=0;i<=siz[x]/2;i++)
if(f[x][i][0]||f[x][i][1])
for(int j=0;j<=siz[v]/2;j++){
//link(x,v)
cadd(g[i+j+1][1],1ll*f[x][i][0]*f[v][j][0]%mod);
//not link
cadd(g[i+j][0],1ll*f[x][i][0]*f[v][j][0]%mod);
cadd(g[i+j][0],1ll*f[x][i][0]*f[v][j][1]%mod);
cadd(g[i+j][1],1ll*f[x][i][1]*f[v][j][0]%mod);
cadd(g[i+j][1],1ll*f[x][i][1]*f[v][j][1]%mod);
}
siz[x]+=siz[v];
for(int i=0;i<=siz[x]/2;i++){
f[x][i][0]=g[i][0];
f[x][i][1]=g[i][1];
g[i][0]=g[i][1]=0;
}
}
}
int h[N],t[N],ct[N];
signed main(){
#ifdef do_while_true
// assert(freopen("data.in","r",stdin));
// assert(freopen("data.out","w",stdout));
#endif
read(n);
h[0]=1;ct[0]=1;
for(int i=1;i<=2*n;i++){
for(int j=0;j<i;j++)cadd(t[j+1],h[j]);
for(int j=1;j<i;j++)cadd(t[j-1],1ll*h[j]*j%mod);
for(int j=0;j<=i;j++)h[j]=t[j],t[j]=0;
if(i%2==0)ct[i/2]=h[0];
}
for(int i=1;i<2*n;i++){
int u,v;read(u,v);
eg[u].pb(v);eg[v].pb(u);
}
dfs(1,0);
int ans=0;
for(int i=0;i<=n;i++){
int s=1ll*add(f[1][i][0],f[1][i][1])*ct[n-i]%mod;
if(i&1)cdel(ans,s);
else cadd(ans,s);
}
cout<<ans<<'\n';
#ifdef do_while_true
// cerr<<'\n'<<"Time:"<<1.0*clock()/CLOCKS_PER_SEC*1000<<" ms"<<'\n';
#endif
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3724kb
input:
2 1 2 1 3 3 4
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3764kb
input:
3 1 2 2 3 3 4 4 5 5 6
output:
5
result:
ok 1 number(s): "5"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
10 2 1 3 2 4 2 5 3 6 3 7 5 8 4 9 3 10 5 11 3 12 9 13 11 14 8 15 5 16 1 17 4 18 1 19 11 20 19
output:
223263378
result:
ok 1 number(s): "223263378"
Test #4:
score: 0
Accepted
time: 0ms
memory: 5896kb
input:
10 2 1 3 1 4 1 5 1 6 5 7 3 8 7 9 3 10 2 11 3 12 5 13 12 14 10 15 11 16 10 17 4 18 14 19 4 20 4
output:
225215244
result:
ok 1 number(s): "225215244"
Test #5:
score: 0
Accepted
time: 1ms
memory: 5864kb
input:
10 2 1 3 1 4 3 5 3 6 5 7 3 8 5 9 3 10 8 11 2 12 1 13 11 14 2 15 3 16 3 17 2 18 11 19 10 20 3
output:
210104685
result:
ok 1 number(s): "210104685"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
10 2 1 3 2 4 3 5 1 6 2 7 5 8 2 9 3 10 2 11 10 12 7 13 12 14 2 15 2 16 15 17 2 18 6 19 15 20 8
output:
211263144
result:
ok 1 number(s): "211263144"
Test #7:
score: 0
Accepted
time: 1ms
memory: 3900kb
input:
10 2 1 3 2 4 3 5 2 6 2 7 1 8 7 9 3 10 8 11 5 12 6 13 11 14 8 15 1 16 13 17 2 18 14 19 11 20 12
output:
226024809
result:
ok 1 number(s): "226024809"
Test #8:
score: 0
Accepted
time: 25ms
memory: 127100kb
input:
1977 2 1 3 1 4 1 5 4 6 4 7 1 8 3 9 5 10 2 11 3 12 2 13 3 14 2 15 9 16 9 17 2 18 17 19 5 20 16 21 2 22 2 23 15 24 16 25 22 26 14 27 6 28 4 29 24 30 25 31 28 32 15 33 27 34 32 35 24 36 10 37 18 38 15 39 33 40 3 41 27 42 3 43 35 44 15 45 11 46 19 47 21 48 4 49 28 50 6 51 3 52 14 53 14 54 14 55 25 56 18...
output:
337494603
result:
ok 1 number(s): "337494603"
Test #9:
score: 0
Accepted
time: 20ms
memory: 124764kb
input:
1921 2 1 3 2 4 2 5 2 6 1 7 4 8 6 9 3 10 5 11 10 12 5 13 8 14 13 15 9 16 11 17 10 18 10 19 7 20 19 21 14 22 1 23 4 24 6 25 7 26 9 27 15 28 6 29 28 30 10 31 17 32 9 33 21 34 1 35 20 36 5 37 5 38 5 39 10 40 17 41 25 42 24 43 39 44 12 45 34 46 16 47 4 48 8 49 47 50 38 51 29 52 4 53 43 54 10 55 15 56 26 ...
output:
850212664
result:
ok 1 number(s): "850212664"
Test #10:
score: 0
Accepted
time: 18ms
memory: 124996kb
input:
1946 2 1 3 1 4 2 5 2 6 5 7 1 8 2 9 1 10 8 11 4 12 9 13 6 14 9 15 11 16 15 17 3 18 4 19 18 20 16 21 9 22 16 23 10 24 6 25 18 26 15 27 17 28 18 29 24 30 27 31 5 32 5 33 14 34 4 35 28 36 27 37 27 38 26 39 15 40 28 41 17 42 39 43 1 44 9 45 28 46 32 47 38 48 10 49 16 50 6 51 8 52 7 53 15 54 16 55 10 56 9...
output:
148051811
result:
ok 1 number(s): "148051811"
Test #11:
score: 0
Accepted
time: 20ms
memory: 125008kb
input:
1921 2 1 3 2 4 1 5 3 6 4 7 6 8 6 9 6 10 2 11 2 12 9 13 7 14 7 15 4 16 10 17 12 18 3 19 8 20 7 21 9 22 17 23 17 24 1 25 12 26 25 27 24 28 7 29 8 30 18 31 2 32 30 33 9 34 7 35 15 36 22 37 22 38 1 39 22 40 37 41 31 42 21 43 18 44 5 45 12 46 11 47 43 48 25 49 2 50 37 51 3 52 38 53 29 54 6 55 50 56 23 57...
output:
280704181
result:
ok 1 number(s): "280704181"
Test #12:
score: 0
Accepted
time: 21ms
memory: 128932kb
input:
1976 2 1 3 2 4 2 5 1 6 2 7 5 8 1 9 3 10 6 11 2 12 1 13 4 14 7 15 13 16 2 17 4 18 10 19 16 20 12 21 1 22 2 23 2 24 1 25 5 26 22 27 9 28 21 29 5 30 24 31 12 32 26 33 2 34 14 35 13 36 2 37 9 38 5 39 35 40 39 41 22 42 20 43 8 44 4 45 11 46 42 47 36 48 37 49 6 50 6 51 17 52 28 53 5 54 41 55 3 56 19 57 36...
output:
627986542
result:
ok 1 number(s): "627986542"
Test #13:
score: 0
Accepted
time: 27ms
memory: 128984kb
input:
1999 2 1 3 2 4 3 5 2 6 4 7 2 8 4 9 1 10 9 11 8 12 9 13 10 14 1 15 7 16 3 17 12 18 17 19 14 20 16 21 5 22 3 23 13 24 2 25 23 26 21 27 23 28 22 29 16 30 7 31 15 32 20 33 27 34 9 35 20 36 25 37 31 38 3 39 13 40 39 41 29 42 25 43 19 44 41 45 5 46 23 47 14 48 25 49 38 50 10 51 1 52 50 53 38 54 37 55 21 5...
output:
927794050
result:
ok 1 number(s): "927794050"
Test #14:
score: 0
Accepted
time: 25ms
memory: 128872kb
input:
1976 2 1 3 1 4 2 5 3 6 2 7 6 8 1 9 7 10 8 11 8 12 4 13 3 14 12 15 8 16 13 17 5 18 8 19 4 20 7 21 5 22 11 23 8 24 4 25 3 26 18 27 26 28 22 29 13 30 18 31 20 32 16 33 20 34 19 35 18 36 20 37 10 38 29 39 17 40 17 41 35 42 19 43 30 44 40 45 40 46 10 47 14 48 28 49 9 50 27 51 45 52 24 53 12 54 27 55 18 5...
output:
685071441
result:
ok 1 number(s): "685071441"
Test #15:
score: 0
Accepted
time: 22ms
memory: 124836kb
input:
1921 2 1 3 1 4 1 5 4 6 5 7 1 8 4 9 4 10 6 11 3 12 5 13 1 14 7 15 3 16 5 17 14 18 3 19 10 20 10 21 5 22 17 23 20 24 15 25 20 26 22 27 1 28 23 29 17 30 4 31 20 32 10 33 13 34 20 35 5 36 35 37 13 38 28 39 33 40 11 41 35 42 40 43 33 44 35 45 22 46 34 47 17 48 22 49 11 50 45 51 23 52 7 53 9 54 9 55 25 56...
output:
632229124
result:
ok 1 number(s): "632229124"
Test #16:
score: 0
Accepted
time: 24ms
memory: 126900kb
input:
1943 2 1 3 2 4 1 5 1 6 5 7 3 8 6 9 2 10 9 11 9 12 11 13 2 14 6 15 11 16 9 17 7 18 3 19 4 20 2 21 1 22 18 23 13 24 14 25 14 26 18 27 13 28 9 29 21 30 10 31 19 32 6 33 6 34 18 35 18 36 30 37 26 38 26 39 19 40 36 41 1 42 33 43 9 44 34 45 13 46 14 47 46 48 1 49 28 50 27 51 18 52 16 53 29 54 35 55 30 56 ...
output:
175426091
result:
ok 1 number(s): "175426091"
Test #17:
score: 0
Accepted
time: 20ms
memory: 126896kb
input:
1951 2 1 3 2 4 3 5 3 6 1 7 3 8 3 9 7 10 8 11 7 12 3 13 7 14 1 15 5 16 14 17 1 18 5 19 12 20 6 21 8 22 4 23 12 24 5 25 1 26 1 27 14 28 24 29 25 30 1 31 1 32 31 33 1 34 19 35 26 36 17 37 13 38 10 39 7 40 28 41 32 42 21 43 34 44 32 45 44 46 1 47 46 48 2 49 15 50 44 51 34 52 19 53 6 54 25 55 18 56 35 57...
output:
620932394
result:
ok 1 number(s): "620932394"
Test #18:
score: 0
Accepted
time: 23ms
memory: 125020kb
input:
1943 2 1 3 2 4 1 5 4 6 4 7 4 8 6 9 5 10 2 11 4 12 6 13 9 14 13 15 6 16 15 17 9 18 4 19 7 20 10 21 12 22 5 23 16 24 5 25 3 26 25 27 5 28 26 29 8 30 18 31 28 32 27 33 26 34 23 35 4 36 5 37 4 38 22 39 8 40 30 41 39 42 15 43 9 44 29 45 43 46 33 47 8 48 42 49 1 50 13 51 12 52 12 53 3 54 7 55 25 56 46 57 ...
output:
990615942
result:
ok 1 number(s): "990615942"
Test #19:
score: 0
Accepted
time: 23ms
memory: 128924kb
input:
1998 2 1 3 2 4 1 5 4 6 4 7 5 8 1 9 3 10 7 11 1 12 6 13 11 14 1 15 8 16 7 17 2 18 12 19 14 20 14 21 4 22 19 23 8 24 13 25 14 26 22 27 26 28 27 29 5 30 2 31 7 32 21 33 19 34 32 35 28 36 6 37 26 38 12 39 27 40 29 41 13 42 36 43 6 44 28 45 28 46 40 47 1 48 20 49 35 50 31 51 5 52 40 53 24 54 2 55 44 56 5...
output:
814855336
result:
ok 1 number(s): "814855336"
Test #20:
score: 0
Accepted
time: 24ms
memory: 127100kb
input:
1962 2 1 3 2 4 2 5 2 6 5 7 6 8 5 9 1 10 5 11 6 12 8 13 4 14 6 15 1 16 13 17 11 18 14 19 2 20 6 21 16 22 19 23 3 24 2 25 8 26 1 27 8 28 5 29 9 30 12 31 3 32 17 33 13 34 30 35 30 36 1 37 23 38 10 39 16 40 17 41 13 42 29 43 10 44 25 45 27 46 45 47 22 48 13 49 5 50 48 51 50 52 37 53 42 54 32 55 18 56 40...
output:
935127715
result:
ok 1 number(s): "935127715"
Test #21:
score: 0
Accepted
time: 27ms
memory: 127136kb
input:
1994 2 1 3 1 4 3 5 3 6 5 7 1 8 1 9 7 10 4 11 1 12 10 13 6 14 8 15 10 16 5 17 4 18 15 19 10 20 14 21 11 22 6 23 19 24 23 25 17 26 24 27 21 28 20 29 13 30 27 31 6 32 11 33 7 34 3 35 30 36 24 37 2 38 28 39 9 40 33 41 11 42 24 43 21 44 24 45 1 46 20 47 40 48 38 49 23 50 30 51 16 52 37 53 42 54 44 55 47 ...
output:
610654989
result:
ok 1 number(s): "610654989"
Test #22:
score: 0
Accepted
time: 22ms
memory: 125084kb
input:
1942 2 1 3 1 4 2 5 4 6 5 7 2 8 5 9 4 10 7 11 3 12 10 13 4 14 8 15 4 16 12 17 12 18 7 19 11 20 13 21 8 22 13 23 6 24 1 25 11 26 10 27 11 28 5 29 17 30 2 31 3 32 6 33 32 34 33 35 15 36 12 37 4 38 26 39 29 40 19 41 10 42 11 43 10 44 18 45 5 46 32 47 23 48 31 49 26 50 48 51 11 52 46 53 46 54 24 55 37 56...
output:
329465487
result:
ok 1 number(s): "329465487"
Test #23:
score: 0
Accepted
time: 24ms
memory: 127008kb
input:
1961 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1 60 1 61 1 62 ...
output:
866759945
result:
ok 1 number(s): "866759945"
Test #24:
score: 0
Accepted
time: 30ms
memory: 129104kb
input:
1973 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1 60 1 61 1 62 ...
output:
392535484
result:
ok 1 number(s): "392535484"
Test #25:
score: 0
Accepted
time: 24ms
memory: 127196kb
input:
1960 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1 60 1 61 1 62 ...
output:
301636689
result:
ok 1 number(s): "301636689"
Test #26:
score: 0
Accepted
time: 28ms
memory: 127132kb
input:
1972 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1 60 1 61 1 62 ...
output:
318078958
result:
ok 1 number(s): "318078958"
Test #27:
score: 0
Accepted
time: 24ms
memory: 124996kb
input:
1917 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1 60 1 61 1 62 ...
output:
965554124
result:
ok 1 number(s): "965554124"
Test #28:
score: 0
Accepted
time: 25ms
memory: 129064kb
input:
1983 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 ...
output:
883574023
result:
ok 1 number(s): "883574023"
Test #29:
score: 0
Accepted
time: 22ms
memory: 127188kb
input:
1916 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 6 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 5...
output:
551865782
result:
ok 1 number(s): "551865782"
Test #30:
score: 0
Accepted
time: 25ms
memory: 127668kb
input:
1972 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 ...
output:
927692142
result:
ok 1 number(s): "927692142"
Test #31:
score: 0
Accepted
time: 29ms
memory: 129200kb
input:
1995 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 ...
output:
594503734
result:
ok 1 number(s): "594503734"
Test #32:
score: 0
Accepted
time: 24ms
memory: 126900kb
input:
1935 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 11 47 46 48 17 49 48 50 49 51 50 52 51 53 52 ...
output:
365362230
result:
ok 1 number(s): "365362230"
Test #33:
score: 0
Accepted
time: 39ms
memory: 126048kb
input:
1927 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 9 12 10 13 12 14 12 15 14 16 15 17 15 18 17 19 18 20 19 21 19 22 21 23 21 24 22 25 24 26 24 27 26 28 26 29 28 30 29 31 30 32 31 33 31 34 32 35 34 36 34 37 36 38 36 39 37 40 38 41 40 42 41 43 42 44 42 45 43 46 45 47 46 48 47 49 48 50 48 51 50 52 50 53 52 5...
output:
499548808
result:
ok 1 number(s): "499548808"
Test #34:
score: 0
Accepted
time: 42ms
memory: 129500kb
input:
1983 2 1 3 1 4 2 5 3 6 5 7 5 8 6 9 7 10 9 11 10 12 10 13 12 14 13 15 13 16 15 17 15 18 17 19 18 20 18 21 20 22 20 23 21 24 23 25 24 26 25 27 25 28 27 29 27 30 28 31 30 32 30 33 31 34 33 35 34 36 34 37 36 38 37 39 38 40 38 41 40 42 41 43 42 44 42 45 44 46 45 47 46 48 46 49 48 50 48 51 49 52 51 53 51 ...
output:
375212163
result:
ok 1 number(s): "375212163"
Test #35:
score: 0
Accepted
time: 34ms
memory: 127208kb
input:
1946 2 1 3 1 4 3 5 3 6 5 7 6 8 6 9 7 10 8 11 10 12 11 13 11 14 13 15 14 16 14 17 15 18 16 19 17 20 19 21 19 22 20 23 21 24 22 25 23 26 25 27 25 28 26 29 27 30 28 31 30 32 30 33 31 34 32 35 33 36 34 37 35 38 37 39 38 40 38 41 40 42 40 43 41 44 42 45 43 46 44 47 46 48 46 49 48 50 48 51 49 52 50 53 51 ...
output:
457744121
result:
ok 1 number(s): "457744121"
Test #36:
score: 0
Accepted
time: 40ms
memory: 125884kb
input:
1945 2 1 3 2 4 2 5 4 6 4 7 6 8 6 9 7 10 8 11 9 12 11 13 12 14 12 15 13 16 15 17 16 18 17 19 17 20 19 21 19 22 21 23 22 24 23 25 24 26 24 27 26 28 26 29 27 30 28 31 29 32 30 33 32 34 32 35 33 36 34 37 36 38 36 39 38 40 38 41 39 42 41 43 41 44 42 45 44 46 45 47 45 48 47 49 48 50 48 51 50 52 51 53 52 5...
output:
602988658
result:
ok 1 number(s): "602988658"
Test #37:
score: 0
Accepted
time: 41ms
memory: 127816kb
input:
1994 2 1 3 2 4 2 5 3 6 5 7 5 8 6 9 7 10 9 11 9 12 11 13 12 14 13 15 14 16 14 17 15 18 17 19 17 20 18 21 19 22 20 23 22 24 22 25 23 26 24 27 25 28 26 29 27 30 29 31 29 32 31 33 32 34 32 35 34 36 34 37 35 38 36 39 38 40 38 41 39 42 40 43 42 44 43 45 43 46 45 47 45 48 47 49 48 50 48 51 49 52 51 53 51 5...
output:
676531640
result:
ok 1 number(s): "676531640"
Test #38:
score: 0
Accepted
time: 40ms
memory: 124020kb
input:
1901 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 17 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 32 31 33 32 34 33 35 34 36 35 37 36 38 37 39 38 40 39 41 40 42 41 43 42 44 43 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 52 ...
output:
129759647
result:
ok 1 number(s): "129759647"
Test #39:
score: 0
Accepted
time: 30ms
memory: 127112kb
input:
1957 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1 60 1 61 1 62 ...
output:
0
result:
ok 1 number(s): "0"
Test #40:
score: 0
Accepted
time: 20ms
memory: 122900kb
input:
1912 2 1 3 1 4 2 5 2 6 3 7 3 8 4 9 4 10 5 11 5 12 6 13 6 14 7 15 7 16 8 17 8 18 9 19 9 20 10 21 10 22 11 23 11 24 12 25 12 26 13 27 13 28 14 29 14 30 15 31 15 32 16 33 16 34 17 35 17 36 18 37 18 38 19 39 19 40 20 41 20 42 21 43 21 44 22 45 22 46 23 47 23 48 24 49 24 50 25 51 25 52 26 53 26 54 27 55 ...
output:
681873059
result:
ok 1 number(s): "681873059"
Test #41:
score: 0
Accepted
time: 24ms
memory: 126892kb
input:
1956 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 11 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 5 55 1 56 1 57 1 58 1 59 1 60 1 61 1 62...
output:
790096995
result:
ok 1 number(s): "790096995"
Test #42:
score: 0
Accepted
time: 20ms
memory: 127048kb
input:
1968 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1 60 1 61 1 62 ...
output:
635342408
result:
ok 1 number(s): "635342408"