Tag: problem: (C) String Reconstruction Solution In C/C++

Codeforces Round #423 (Div. 2, rated, based on VK Cup Finals), problem: (C) String Reconstruction Solution In C/C++

#include<bits/stdc++.h> using namespace std; const int maxn=2e6+5; int main() { char a={}; int n,k,i; cin>>n; while(n–){ string x; cin>>x>>k; int t,len=x.size(),tt=-len; while(k–){ scanf(“%d”,&t); for(i=max(0,tt+len-t);i<len;i++) a=x; tt=t; } } for(i=maxn-1;!a;) i–; for(int j=1;j<=i;j++) putchar(a?a:’a’); return 0; } 📦 Looking for...

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!