No RT
谁帮忙调一下啊,#1 WA 90pts
#include <bits/stdc++.h>
using namespace std;
string str;
void init(){
str.resize(str.size()+1);
for(int i = str.size(); i>=1; i--)
str[i]=str[i-1];
str[0]=' ';
return ;
}
bool zero(int i,int j){
// cout<<i<<' '<<j<<endl;
for(int x=(i-1)*5+1; x<=(j)*5; x++){
// putchar(str[x]);
if((str[x]^':')&&(str[x]^'0')) return false;
}
return true;
}
int maxx=-121,maxi=-1,maxj=-1;
void print(){
for(int i = 1; i<=8; i++){
if(i==maxi){
putchar(':');
putchar(':');
i=maxj;
continue;
}
bool t=false;
for(int j = (i-1)*5+1; j<=i*5; j++){
if(j==(maxi-1)*5) break;
if(j==40) return ;
if(t) putchar(str[j]);
else if(str[j]^'0'){
if(!t) t=true;
putchar(str[j]);
}
// system("pause");
}
}
}
int main(){
cin>>str;
init();
// cout<<zero(4,7);
// cout<<str;
for(int i = 1; i<=8; i++){
for(int j = i; j<=8; j++){
if(zero(i,j))
if(j-i+1>maxx)
maxx=j-i+1,maxi=i,maxj=j;
// system("pause");
}
}
// if(maxi==maxj) exit(-1);
// cout<<maxi<<maxj;
// system("pause");
print();
return 0;
}