QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#874052#8615. Equal StringsCrysflyAC ✓8ms7748kbC++113.2kb2025-01-27 12:42:322025-01-27 12:42:33

Judging History

你现在查看的是最新测评结果

  • [2025-01-27 12:42:33]
  • 评测
  • 测评结果:AC
  • 用时:8ms
  • 内存:7748kb
  • [2025-01-27 12:42:32]
  • 提交

answer

// what is matter? never mind. 
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2") 
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define int long long
#define ull unsigned long long
using namespace std;
inline int read()
{
    char c=getchar();int x=0;bool f=0;
    for(;!isdigit(c);c=getchar())f^=!(c^45);
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    if(f)x=-x;return x;
}

#define mod 998244353
struct modint{
  int x;
  modint(int o=0){x=o;}
  modint &operator = (int o){return x=o,*this;}
  modint &operator +=(modint o){return x=x+o.x>=mod?x+o.x-mod:x+o.x,*this;}
  modint &operator -=(modint o){return x=x-o.x<0?x-o.x+mod:x-o.x,*this;}
  modint &operator *=(modint o){return x=1ll*x*o.x%mod,*this;}
  modint &operator ^=(int b){
    modint a=*this,c=1;
    for(;b;b>>=1,a*=a)if(b&1)c*=a;
    return x=c.x,*this;
  }
  modint &operator /=(modint o){return *this *=o^=mod-2;}
  friend modint operator +(modint a,modint b){return a+=b;}
  friend modint operator -(modint a,modint b){return a-=b;}
  friend modint operator *(modint a,modint b){return a*=b;}
  friend modint operator /(modint a,modint b){return a/=b;}
  friend modint operator ^(modint a,int b){return a^=b;}
  friend bool operator ==(modint a,modint b){return a.x==b.x;}
  friend bool operator !=(modint a,modint b){return a.x!=b.x;}
  bool operator ! () {return !x;}
  modint operator - () {return x?mod-x:0;}
  bool operator <(const modint&b)const{return x<b.x;}
};
inline modint qpow(modint x,int y){return x^y;}

vector<modint> fac,ifac,iv;
inline void initC(int n)
{
  if(iv.empty())fac=ifac=iv=vector<modint>(2,1);
  int m=iv.size(); ++n;
  if(m>=n)return;
  iv.resize(n),fac.resize(n),ifac.resize(n);
  For(i,m,n-1){
    iv[i]=iv[mod%i]*(mod-mod/i);
    fac[i]=fac[i-1]*i,ifac[i]=ifac[i-1]*iv[i];
  }
}
inline modint C(int n,int m){
  if(m<0||n<m)return 0;
  return initC(n),fac[n]*ifac[m]*ifac[n-m];
}
inline modint sign(int n){return (n&1)?(mod-1):(1);}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 400005
#define inf 0x3f3f3f3f

int n;
int dis[1005][1005];
string str[1005];

int qs;

int D(int i,int j){
  
//  int res=0;
//  For(k,0,49)res+=(str[i][k]!=str[j][k]);
//  if(res==0)cout<<"found "<<i<<" "<<j<<"\n",exit(0);
//  return res;
  
  if(i==j){
    dis[i][j]=0;
    return 0;
  }
  if(dis[i][j]!=-1)return dis[i][j];
  cout<<i<<" "<<j<<endl;
  int x;cin>>x;
  dis[i][j]=dis[j][i]=x;
  if(!x)exit(0);
  return x;
}

mt19937_64 rnd(time(0));

void solve(vi o){
  shuffle(o.begin(),o.end(),rnd);
  int x=o[0];
  vi vec[55];
  For(i,1,(int)o.size()-1){
    int y=o[i];
    int d=D(x,y);
    vec[d].pb(y);
  }
  For(i,1,50) if(vec[i].size()>=2) solve(vec[i]);
}

signed main()
{
  cin>>n;
  
//  For(i,1,n)For(j,1,50)str[i]+=((char)(rnd()%2+'a'));
//  str[rnd()%(n-1)+2]=str[1];
//  shuffle(str+1,str+n+1,rnd);
  
  memset(dis,-1,sizeof dis);
  vi o;
  For(i,1,n)o.pb(i);
  solve(o);
  return 0;
}
/*

*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 7420kb

input:

4
23
23
24
0

output:

3 4
3 2
3 1
4 2

result:

ok Found equal strings: 4, 2

Test #2:

score: 0
Accepted
time: 1ms
memory: 7540kb

input:

4
23
28
0

output:

3 4
3 2
3 1

result:

ok Found equal strings: 3, 1

Test #3:

score: 0
Accepted
time: 1ms
memory: 7404kb

input:

10
29
27
25
27
26
26
29
0

output:

3 6
3 8
3 5
3 7
3 4
3 10
3 2
3 9

result:

ok Found equal strings: 3, 9

Test #4:

score: 0
Accepted
time: 2ms
memory: 7572kb

input:

100
24
24
28
26
27
28
28
26
27
25
23
26
25
29
25
25
21
19
23
27
23
28
23
22
28
26
31
20
27
24
28
26
25
27
26
27
23
26
25
25
22
25
32
32
19
24
26
28
24
23
28
28
29
23
27
26
23
21
25
24
20
28
21
25
22
27
17
24
22
21
23
24
30
23
22
21
31
24
20
29
24
28
30
29
27
34
24
23
26
19
27
26
26
26
24
22
29
24
30...

output:

71 6
71 27
71 59
71 95
71 4
71 37
71 2
71 55
71 70
71 86
71 56
71 77
71 68
71 21
71 50
71 52
71 40
71 90
71 28
71 96
71 83
71 85
71 61
71 67
71 12
71 48
71 80
71 43
71 53
71 46
71 64
71 58
71 24
71 16
71 42
71 13
71 31
71 30
71 20
71 87
71 38
71 88
71 84
71 93
71 72
71 100
71 99
71 69
71 17
71 82
71...

result:

ok Found equal strings: 100, 62

Test #5:

score: 0
Accepted
time: 1ms
memory: 7728kb

input:

500
24
23
23
29
25
25
26
16
34
21
26
22
25
24
25
28
22
25
30
22
19
23
28
31
27
29
31
20
25
25
26
25
27
27
24
25
30
27
20
28
30
27
25
20
28
29
31
30
30
25
18
24
21
26
30
25
28
32
23
24
27
21
24
18
23
28
24
23
29
28
24
23
23
25
32
25
26
29
30
31
26
25
25
22
24
28
24
20
28
26
21
30
27
23
28
29
25
23
25...

output:

147 193
147 493
147 234
147 375
147 179
147 456
147 205
147 55
147 184
147 288
147 56
147 405
147 134
147 21
147 305
147 52
147 466
147 351
147 433
147 316
147 110
147 85
147 308
147 67
147 12
147 107
147 345
147 131
147 53
147 401
147 346
147 388
147 432
147 109
147 203
147 379
147 323
147 383
147 ...

result:

ok Found equal strings: 100, 334

Test #6:

score: 0
Accepted
time: 5ms
memory: 7488kb

input:

750
16
21
24
27
29
18
24
23
35
26
24
29
19
24
26
22
26
25
28
28
31
26
24
19
23
30
25
32
25
26
29
26
23
32
23
25
26
26
25
24
28
21
31
26
28
23
24
24
27
16
22
24
23
29
25
25
24
29
24
27
27
26
26
25
30
25
23
23
26
26
29
22
21
24
24
25
28
25
25
31
21
20
28
20
26
22
20
21
23
21
23
26
24
26
26
28
27
24
24...

output:

147 586
147 493
147 234
147 375
147 179
147 516
147 205
147 55
147 184
147 514
147 56
147 405
147 589
147 21
147 305
147 52
147 466
147 746
147 433
147 316
147 110
147 85
147 308
147 67
147 12
147 107
147 345
147 131
147 655
147 401
147 346
147 388
147 432
147 607
147 625
147 379
147 749
147 383
147...

result:

ok Found equal strings: 698, 130

Test #7:

score: 0
Accepted
time: 3ms
memory: 7632kb

input:

999
26
26
31
26
25
31
27
24
24
27
29
25
20
30
30
24
28
25
28
27
21
24
28
30
24
21
22
33
29
18
24
21
21
24
26
27
22
19
24
28
28
29
25
18
27
17
21
23
25
29
22
29
19
27
24
23
23
28
24
19
25
30
29
24
25
20
20
26
28
24
26
22
14
25
23
24
22
27
31
31
21
22
26
30
19
28
27
24
21
29
24
24
30
23
24
27
26
26
27...

output:

759 862
759 494
759 95
759 376
759 180
759 514
759 579
759 56
759 601
759 315
759 81
759 762
759 876
759 179
759 581
759 515
759 439
759 893
759 831
759 973
759 947
759 86
759 63
759 523
759 381
759 665
759 346
759 739
759 656
759 402
759 312
759 935
759 839
759 754
759 626
759 19
759 750
759 384
75...

result:

ok Found equal strings: 281, 205

Test #8:

score: 0
Accepted
time: 2ms
memory: 7568kb

input:

1000
26
21
22
27
28
27
27
24
25
25
23
23
18
24
30
21
21
23
20
31
30
27
18
22
26
23
26
26
28
23
27
24
22
29
23
22
28
23
23
22
26
16
30
27
27
21
23
23
25
26
33
22
22
25
36
24
22
22
20
29
29
26
27
30
24
27
16
24
19
22
22
25
22
26
22
27
30
20
22
18
21
29
21
30
22
21
31
27
16
27
30
27
31
28
30
25
26
19
2...

output:

147 861
147 493
147 234
147 375
147 960
147 516
147 205
147 790
147 938
147 896
147 56
147 761
147 875
147 21
147 305
147 52
147 466
147 746
147 760
147 316
147 803
147 85
147 308
147 67
147 12
147 107
147 345
147 966
147 655
147 401
147 346
147 388
147 432
147 753
147 625
147 379
147 749
147 383
14...

result:

ok Found equal strings: 327, 211

Test #9:

score: 0
Accepted
time: 7ms
memory: 7624kb

input:

1000
21
25
35
22
23
22
23
36
30
27
26
24
26
25
21
24
27
21
27
22
20
31
28
26
27
22
24
29
31
29
23
23
25
29
22
28
24
27
19
27
28
26
30
27
23
20
23
20
22
23
30
21
27
22
30
21
25
23
23
28
24
24
25
26
28
26
21
27
28
27
26
26
24
26
28
24
21
24
26
23
20
25
31
23
20
25
25
30
25
20
26
20
24
27
25
29
33
28
2...

output:

147 861
147 493
147 234
147 375
147 960
147 516
147 205
147 790
147 938
147 896
147 56
147 761
147 875
147 21
147 305
147 52
147 466
147 746
147 760
147 316
147 803
147 85
147 308
147 67
147 12
147 107
147 345
147 966
147 655
147 401
147 346
147 388
147 432
147 753
147 625
147 379
147 749
147 383
14...

result:

ok Found equal strings: 448, 220

Test #10:

score: 0
Accepted
time: 2ms
memory: 7584kb

input:

1000
28
24
29
28
25
23
21
30
29
24
29
28
28
24
24
27
25
25
24
23
25
25
27
21
23
21
23
27
24
23
26
20
23
29
28
27
25
21
28
22
25
26
17
27
25
25
34
24
20
33
23
31
27
18
23
29
27
22
29
29
25
27
26
24
26
22
22
22
30
27
23
18
22
19
24
29
29
28
27
21
20
25
23
33
25
25
22
24
23
21
28
23
22
26
23
23
17
27
2...

output:

147 861
147 493
147 234
147 375
147 960
147 516
147 205
147 790
147 938
147 896
147 56
147 761
147 875
147 21
147 305
147 52
147 466
147 746
147 760
147 316
147 803
147 85
147 308
147 67
147 12
147 107
147 345
147 966
147 655
147 401
147 346
147 388
147 432
147 753
147 625
147 379
147 749
147 383
14...

result:

ok Found equal strings: 970, 279

Test #11:

score: 0
Accepted
time: 7ms
memory: 7440kb

input:

1000
22
27
22
27
20
23
25
26
24
30
28
32
25
32
18
31
22
20
26
30
30
24
24
28
23
24
24
19
23
27
20
30
25
24
30
30
23
19
27
26
23
24
21
28
18
21
26
25
23
22
24
23
25
23
21
23
31
25
22
23
23
25
26
20
26
20
22
32
24
30
26
26
27
26
22
25
22
27
31
19
20
20
25
26
21
23
28
28
23
24
27
24
26
28
27
23
27
27
3...

output:

147 861
147 493
147 234
147 375
147 960
147 516
147 205
147 790
147 938
147 896
147 56
147 761
147 875
147 21
147 305
147 52
147 466
147 746
147 760
147 316
147 803
147 85
147 308
147 67
147 12
147 107
147 345
147 966
147 655
147 401
147 346
147 388
147 432
147 753
147 625
147 379
147 749
147 383
14...

result:

ok Found equal strings: 619, 843

Test #12:

score: 0
Accepted
time: 1ms
memory: 7520kb

input:

1000
21
20
26
22
21
27
25
24
21
27
25
30
34
33
29
27
22
33
19
29
24
20
22
25
32
29
26
26
26
29
28
27
25
29
30
25
24
20
25
25
27
20
24
27
25
28
24
27
22
28
24
28
28
25
22
28
27
31
22
25
27
24
24
31
21
32
28
23
29
16
28
29
27
26
24
20
26
29
27
23
22
24
29
24
27
25
21
25
28
27
27
25
23
26
22
17
26
24
3...

output:

147 861
147 493
147 234
147 375
147 960
147 516
147 205
147 790
147 938
147 896
147 56
147 761
147 875
147 21
147 305
147 52
147 466
147 746
147 760
147 316
147 803
147 85
147 308
147 67
147 12
147 107
147 345
147 966
147 655
147 401
147 346
147 388
147 432
147 753
147 625
147 379
147 749
147 383
14...

result:

ok Found equal strings: 678, 717

Test #13:

score: 0
Accepted
time: 5ms
memory: 7748kb

input:

1000
21
16
21
22
25
29
26
20
28
31
28
23
23
20
19
22
29
27
20
29
27
27
24
26
27
19
23
26
24
30
24
21
28
22
23
18
28
23
25
23
28
29
17
30
29
25
25
20
30
24
28
26
26
30
28
21
30
21
25
25
21
24
27
21
29
21
31
24
22
23
19
25
29
26
26
19
29
22
24
28
22
26
31
19
26
30
19
22
20
30
25
29
29
24
22
27
25
31
2...

output:

147 861
147 493
147 234
147 375
147 960
147 516
147 205
147 790
147 938
147 896
147 56
147 761
147 875
147 21
147 305
147 52
147 466
147 746
147 760
147 316
147 803
147 85
147 308
147 67
147 12
147 107
147 345
147 966
147 655
147 401
147 346
147 388
147 432
147 753
147 625
147 379
147 749
147 383
14...

result:

ok Found equal strings: 737, 239

Test #14:

score: 0
Accepted
time: 4ms
memory: 7468kb

input:

1000
27
23
22
21
22
26
28
32
30
23
27
26
23
26
23
28
21
22
27
26
20
17
27
25
24
23
26
24
25
25
29
29
22
26
21
24
28
23
22
22
25
29
28
20
24
20
28
26
24
26
17
22
31
25
28
29
17
28
22
29
28
22
24
25
28
22
29
29
19
19
24
31
24
22
23
25
29
28
28
27
25
25
33
27
28
23
24
26
21
24
19
24
17
26
22
30
29
26
2...

output:

147 861
147 493
147 234
147 375
147 960
147 516
147 205
147 790
147 938
147 896
147 56
147 761
147 875
147 21
147 305
147 52
147 466
147 746
147 760
147 316
147 803
147 85
147 308
147 67
147 12
147 107
147 345
147 966
147 655
147 401
147 346
147 388
147 432
147 753
147 625
147 379
147 749
147 383
14...

result:

ok Found equal strings: 112, 796

Test #15:

score: 0
Accepted
time: 4ms
memory: 7720kb

input:

1000
27
21
22
23
24
25
22
30
30
22
24
24
21
26
26
22
24
24
26
19
27
24
33
24
28
25
21
27
26
32
23
21
25
25
25
29
25
22
27
33
27
25
28
22
26
25
31
28
28
26
29
24
21
25
25
25
27
28
28
24
24
16
24
26
22
28
26
22
26
21
32
27
26
24
22
23
26
17
26
27
25
24
31
25
28
27
26
19
31
22
26
20
21
24
25
23
22
21
2...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 855, 634

Test #16:

score: 0
Accepted
time: 3ms
memory: 7500kb

input:

1000
30
28
21
27
25
25
27
20
25
23
24
23
22
26
23
26
22
24
25
26
26
23
25
30
18
24
27
31
23
21
29
28
25
24
22
27
24
27
28
27
26
27
24
21
24
30
25
23
21
20
26
19
24
29
18
30
28
27
27
22
21
24
30
25
24
26
24
23
28
29
27
30
32
20
28
22
23
29
27
27
29
24
29
29
21
24
24
28
26
27
28
29
28
24
28
20
23
23
2...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 508, 196

Test #17:

score: 0
Accepted
time: 3ms
memory: 7552kb

input:

1000
27
20
19
22
22
23
29
25
24
26
26
21
22
26
19
23
23
27
18
32
26
27
25
29
29
32
30
36
26
25
18
21
20
25
30
24
22
23
25
24
19
27
26
30
27
25
24
25
22
23
24
23
28
19
19
28
23
22
31
23
24
22
33
25
24
29
26
22
22
22
24
31
27
22
21
23
27
22
20
25
32
26
23
34
28
26
27
21
31
27
18
21
24
25
21
30
24
22
2...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 30, 255

Test #18:

score: 0
Accepted
time: 6ms
memory: 7644kb

input:

1000
27
24
26
24
25
25
25
26
23
30
26
22
21
22
27
29
19
22
27
29
20
29
25
30
21
25
26
30
24
26
29
30
24
25
19
25
31
25
25
28
24
31
19
28
23
31
34
23
27
28
23
26
29
21
20
19
24
19
26
19
27
20
27
24
24
22
26
18
31
18
29
25
31
26
28
22
24
25
27
21
34
26
27
27
20
28
23
23
26
31
23
29
31
24
28
27
25
27
2...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 284, 957

Test #19:

score: 0
Accepted
time: 5ms
memory: 7520kb

input:

1000
27
21
27
29
23
30
30
25
21
21
30
30
22
27
27
20
27
29
27
27
30
23
23
26
24
26
27
29
26
24
21
27
23
18
21
25
24
24
26
23
22
28
16
28
28
23
27
27
19
28
22
27
21
25
24
26
25
32
17
28
27
24
25
18
22
26
20
24
26
20
20
26
33
24
24
25
32
20
29
26
25
32
24
23
24
21
24
23
29
19
21
25
26
25
22
28
24
25
1...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 478, 343

Test #20:

score: 0
Accepted
time: 2ms
memory: 7664kb

input:

1000
24
27
30
28
25
33
26
25
27
20
25
17
27
27
23
26
28
29
28
24
25
26
22
24
29
20
25
30
25
25
16
26
28
28
27
21
28
23
28
27
30
16
24
25
32
26
22
28
26
18
26
19
24
20
25
27
29
24
25
22
22
26
28
24
22
27
26
22
24
24
27
27
25
32
23
21
27
23
23
29
24
22
29
29
24
20
27
25
27
22
28
27
27
22
25
29
20
25
2...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 352, 402

Test #21:

score: 0
Accepted
time: 2ms
memory: 7592kb

input:

1000
27
22
21
24
24
24
23
25
23
27
29
26
31
24
20
27
20
25
29
31
21
26
33
26
21
28
23
27
26
22
26
29
21
27
25
25
26
18
29
22
24
24
26
29
23
29
32
28
32
30
21
22
23
29
20
23
29
23
29
27
25
22
28
27
25
25
22
27
23
20
21
25
22
26
24
31
23
29
29
25
26
28
23
20
22
21
25
26
26
22
19
19
26
25
22
24
25
28
2...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 874, 462

Test #22:

score: 0
Accepted
time: 4ms
memory: 7628kb

input:

1000
29
27
19
25
25
19
18
25
21
17
14
21
26
27
26
24
27
24
23
29
28
30
25
29
33
22
27
21
32
29
24
30
29
21
21
25
20
29
26
28
22
24
25
25
24
25
24
33
20
27
30
26
25
27
25
22
27
30
23
25
21
23
24
19
25
25
29
22
29
19
18
21
28
31
24
33
28
24
27
26
26
23
27
21
23
26
26
26
22
29
31
19
30
26
29
24
31
25
1...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 747, 521

Test #23:

score: 0
Accepted
time: 6ms
memory: 7512kb

input:

1000
28
26
25
21
32
22
26
25
27
21
32
22
25
25
26
22
22
23
19
25
28
27
30
23
19
28
27
29
26
26
27
24
22
27
22
22
29
26
25
26
25
18
21
28
25
23
29
21
26
22
29
34
19
19
24
25
20
26
24
29
23
25
23
28
19
35
31
22
22
23
28
24
32
23
26
24
31
22
26
31
24
26
24
22
29
30
23
24
31
28
31
27
27
22
25
16
21
24
1...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 861, 621

Test #24:

score: 0
Accepted
time: 6ms
memory: 7476kb

input:

1000
24
26
26
20
27
20
22
26
32
16
24
30
24
21
21
17
27
22
26
18
25
21
25
20
31
30
16
17
24
28
23
26
25
21
24
26
23
24
28
24
21
23
29
25
23
29
27
23
24
23
28
26
27
24
28
33
26
25
31
29
27
29
28
23
27
27
31
25
23
27
30
30
32
26
29
23
29
28
26
22
27
23
26
32
25
27
26
25
27
28
22
24
23
23
23
19
24
25
1...

output:

831 101
831 871
831 357
831 500
831 520
831 393
831 709
831 79
831 137
831 428
831 339
831 529
831 996
831 619
831 497
831 773
831 476
831 873
831 777
831 847
831 543
831 51
831 978
831 993
831 336
831 413
831 176
831 882
831 55
831 292
831 5
831 848
831 716
831 806
831 398
831 629
831 269
831 1
831...

result:

ok Found equal strings: 920, 143

Test #25:

score: 0
Accepted
time: 6ms
memory: 7296kb

input:

1000
22
26
26
28
23
29
22
25
27
25
29
26
29
23
28
21
28
25
22
18
28
26
21
26
27
30
28
28
30
21
29
29
25
20
26
27
22
26
30
24
17
30
31
25
23
28
18
24
27
23
28
26
25
23
23
31
25
28
26
26
25
25
25
26
22
28
24
27
31
25
20
30
21
25
29
21
26
23
26
29
24
25
20
28
20
23
22
29
26
25
32
22
21
28
26
26
30
25
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 17, 979

Test #26:

score: 0
Accepted
time: 8ms
memory: 7384kb

input:

1000
27
20
23
24
22
19
19
23
22
30
28
27
23
28
30
25
27
19
26
23
25
29
27
23
27
30
23
22
29
24
24
26
24
23
24
22
24
24
24
26
21
23
26
26
23
26
23
26
19
27
31
28
33
28
23
20
29
18
24
29
21
26
24
26
35
26
30
24
28
29
27
19
18
28
27
28
27
28
20
24
23
33
22
27
29
29
27
21
24
21
29
26
26
21
24
30
17
22
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 538, 39

Test #27:

score: 0
Accepted
time: 3ms
memory: 7596kb

input:

1000
29
25
29
17
24
26
23
26
26
21
22
30
15
26
30
26
26
29
24
25
25
32
21
20
19
30
25
22
30
24
25
25
23
26
31
22
24
31
23
20
24
20
26
27
31
19
19
28
24
24
22
27
25
25
27
22
30
29
28
31
22
27
17
35
22
25
27
20
26
24
22
25
27
24
22
27
23
28
23
31
22
23
28
30
24
23
27
28
25
27
27
26
25
18
27
25
28
26
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 98, 412

Test #28:

score: 0
Accepted
time: 1ms
memory: 7316kb

input:

1000
22
28
20
23
26
20
30
21
23
23
26
34
26
26
28
32
29
20
31
21
25
20
29
20
31
25
22
20
24
19
19
26
30
23
34
22
23
19
32
29
25
25
30
27
25
26
23
20
17
29
23
30
27
28
23
26
22
30
23
19
24
29
30
24
27
25
19
19
26
27
34
25
33
28
22
27
27
23
23
29
24
31
26
24
23
27
24
25
28
23
27
25
19
21
24
24
28
24
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 598, 970

Test #29:

score: 0
Accepted
time: 6ms
memory: 7516kb

input:

1000
24
22
23
29
28
22
28
22
26
23
27
29
32
24
23
31
26
21
21
26
20
25
19
21
18
25
23
26
27
24
24
26
24
28
29
31
27
23
26
20
25
22
23
28
23
23
25
22
26
25
19
29
29
29
26
20
27
26
28
26
29
26
26
24
24
25
26
22
24
21
19
27
29
22
18
19
28
22
20
32
27
21
23
26
21
20
30
27
25
31
25
22
27
20
28
21
31
29
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 657, 844

Test #30:

score: 0
Accepted
time: 2ms
memory: 7380kb

input:

1000
26
17
21
23
32
27
23
27
22
23
23
24
28
23
23
22
23
23
21
21
26
27
20
23
31
26
22
29
29
29
29
25
25
27
24
27
26
23
25
29
22
20
25
27
28
28
28
24
27
25
21
25
26
26
24
25
25
30
20
25
24
25
20
23
26
25
30
28
20
27
30
27
22
29
24
27
23
25
22
16
21
32
27
23
28
23
22
24
20
29
27
28
34
21
26
24
23
30
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 718, 716

Test #31:

score: 0
Accepted
time: 6ms
memory: 7592kb

input:

1000
23
21
25
24
22
26
26
27
25
21
26
24
20
28
30
21
32
25
18
26
26
25
25
26
17
22
29
25
29
27
23
22
22
28
23
23
26
23
23
24
31
28
25
21
23
19
22
24
32
26
20
20
25
24
21
20
22
25
25
27
25
30
30
23
28
21
26
27
28
27
22
19
24
31
28
24
24
19
23
22
27
24
28
20
28
30
25
28
31
24
27
20
25
26
31
25
27
21
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 240, 57

Test #32:

score: 0
Accepted
time: 5ms
memory: 7424kb

input:

1000
22
27
19
33
26
28
26
24
21
24
27
29
23
25
28
28
25
26
26
22
28
19
24
23
25
22
18
27
26
30
26
21
22
19
22
25
21
25
21
26
23
22
25
27
26
26
26
24
24
19
24
26
28
21
28
26
30
26
24
33
25
20
30
28
25
25
25
23
29
25
24
28
30
30
30
24
24
27
26
27
28
23
25
26
20
22
22
25
22
23
25
20
30
24
26
22
24
24
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 113, 116

Test #33:

score: 0
Accepted
time: 5ms
memory: 7352kb

input:

1000
22
26
24
24
24
26
23
30
26
25
30
28
28
27
25
21
23
23
22
21
24
29
29
21
30
26
26
22
24
31
26
32
25
33
25
26
27
26
31
28
21
18
20
23
25
20
28
27
24
23
28
28
23
20
33
23
22
23
27
25
20
26
28
26
26
26
21
27
24
27
21
24
27
34
20
26
23
31
26
19
21
22
26
28
29
27
22
25
25
28
26
26
27
25
20
24
19
22
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 635, 175

Test #34:

score: 0
Accepted
time: 1ms
memory: 7476kb

input:

1000
22
21
28
22
32
25
20
24
24
26
18
33
28
31
24
20
28
26
26
24
25
22
25
21
22
26
29
28
26
27
26
29
26
28
18
25
20
25
23
23
22
24
26
29
26
28
21
24
34
18
27
27
29
28
24
26
24
28
30
23
25
26
20
30
25
20
26
25
21
33
23
23
31
20
25
24
26
26
28
28
24
26
16
26
27
24
29
29
26
23
28
29
33
26
26
29
24
22
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 509, 235

Test #35:

score: 0
Accepted
time: 3ms
memory: 7444kb

input:

1000
24
28
18
20
26
34
19
29
31
24
28
28
26
28
28
27
27
24
28
28
25
18
21
28
23
24
28
32
30
25
22
28
23
22
30
25
24
20
23
27
23
31
25
29
29
23
29
22
28
25
25
26
23
29
22
19
21
28
24
37
28
27
26
23
21
22
25
18
30
26
26
26
23
30
16
26
24
30
22
25
24
25
27
19
24
26
24
27
30
22
25
28
29
28
30
20
20
29
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 294, 30

Test #36:

score: 0
Accepted
time: 0ms
memory: 7440kb

input:

1000
23
23
26
24
22
29
28
19
26
29
28
23
27
29
31
27
22
25
27
29
23
24
24
23
29
22
24
28
29
25
20
25
19
26
27
23
24
21
25
28
25
27
26
26
23
25
26
21
27
27
18
25
25
23
28
18
34
31
24
24
31
27
26
23
20
20
17
26
23
20
28
29
31
25
30
18
26
23
24
25
30
21
22
23
23
29
25
20
31
19
27
22
24
23
23
28
24
24
2...

output:

296 951
296 333
296 537
296 504
296 571
296 444
296 702
296 206
296 948
296 823
296 985
296 435
296 167
296 735
296 287
296 45
296 648
296 41
296 195
296 132
296 476
296 516
296 698
296 219
296 261
296 247
296 87
296 419
296 83
296 407
296 525
296 116
296 354
296 298
296 397
296 722
296 797
296 276
...

result:

ok Found equal strings: 634, 904

Test #37:

score: 0
Accepted
time: 5ms
memory: 7552kb

input:

1000
24
25
25
23
27
22
31
34
19
23
28
19
26
26
28
23
22
20
28
29
23
34
28
23
23
27
26
19
24
19
23
25
25
24
25
23
29
22
27
21
23
26
25
20
27
25
19
25
21
23
21
26
26
26
32
28
27
17
30
19
24
29
21
24
26
20
22
25
33
23
29
26
27
25
20
23
24
24
21
20
27
24
27
31
31
30
25
28
24
21
31
30
25
18
24
25
19
28
2...

output:

233 364
233 252
233 245
233 442
233 358
233 264
233 345
233 21
233 218
233 161
233 732
233 414
233 549
233 255
233 430
233 395
233 2
233 842
233 352
233 891
233 137
233 604
233 180
233 936
233 771
233 32
233 959
233 679
233 981
233 23
233 881
233 332
233 206
233 380
233 598
233 33
233 543
233 71
233...

result:

ok Found equal strings: 693, 778

Test #38:

score: 0
Accepted
time: 1ms
memory: 7328kb

input:

1000
22
24
25
26
25
23
24
24
21
22
26
28
22
24
25
20
31
19
23
21
19
25
27
29
26
29
22
28
31
23
21
27
25
25
26
25
17
24
28
25
24
22
20
27
21
29
28
30
28
32
26
21
27
26
27
24
23
27
20
24
22
23
27
22
22
26
21
19
23
29
28
17
24
24
23
24
21
31
21
18
26
25
28
22
25
25
22
24
22
24
23
27
29
28
21
22
22
21
2...

output:

233 364
233 252
233 245
233 442
233 358
233 264
233 345
233 21
233 218
233 161
233 732
233 414
233 549
233 255
233 430
233 395
233 2
233 842
233 352
233 891
233 137
233 604
233 180
233 936
233 771
233 32
233 959
233 679
233 981
233 23
233 881
233 332
233 206
233 380
233 598
233 33
233 543
233 71
233...

result:

ok Found equal strings: 912, 336

Test #39:

score: 0
Accepted
time: 1ms
memory: 7504kb

input:

2
0

output:

2 1

result:

ok Found equal strings: 2, 1

Extra Test:

score: 0
Extra Test Passed