QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#397163 | #4388. C++ to Python | Diu | AC ✓ | 1ms | 3840kb | C++14 | 1.2kb | 2024-04-23 18:46:57 | 2024-04-23 18:46:57 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
inline int read(){
int x = 0, f = 1; char c = getchar();
while(c < '0' || c > '9'){if(c == '-')f = -1; c = getchar();}
while(c >= '0' && c <= '9'){x = (x << 1) + (x << 3) + c - '0'; c = getchar();}
return x * f;
}
int T;
char s[1010];
bool vis[1010];
int main(){
// freopen(".in", "r", stdin);
// freopen(".out", "w", stdout);
scanf("%d",&T);
for(;T--;){
scanf("\n%s",s+1);
int n=strlen(s+1);
for(int i=1;i<=n;i++)vis[i]=0;
int now=0;
for(int i=1;i<=n;i++){
if(s[i]=='s')now=1;
else if(s[i]=='t'&&now==1)++now;
else if(s[i]=='d'&&now==2)++now;
else if(s[i]==':'&&now==3)++now;
else if(s[i]==':'&&now==4)++now;
else if(s[i]=='m'&&now==5)++now;
else if(s[i]=='a'&&now==6)++now;
else if(s[i]=='k'&&now==7)++now;
else if(s[i]=='e'&&now==8)++now;
else if(s[i]=='_'&&now==9)++now;
else if(s[i]=='t'&&now==10)++now;
else if(s[i]=='u'&&now==11)++now;
else if(s[i]=='p'&&now==12)++now;
else if(s[i]=='l'&&now==13)++now;
else if(s[i]=='e'&&now==14)++now;
else now=0;
if(now==15){
for(int j=i-14;j<=i;j++)vis[j]=1;
now=0;
}
}
for(int i=1;i<=n;i++)if(!vis[i])putchar(s[i]);putchar('\n');
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3840kb
input:
100 std::make_tuple(-2,-2,4,-5,std::make_tuple(std::make_tuple(2,1,-4,5,-3),std::make_tuple(std::make_tuple(std::make_tuple(std::make_tuple(5,std::make_tuple(std::make_tuple(-4,std::make_tuple(std::make_tuple(std::make_tuple(0,std::make_tuple(std::make_tuple(std::make_tuple(1,-1,-3,-5,4),std::make_t...
output:
(-2,-2,4,-5,((2,1,-4,5,-3),((((5,((-4,(((0,(((1,-1,-3,-5,4),(((0,(2,(((-4,-2,2,-1,5,((0,4),-2)),-5,-2),-5,3),-5)),5),0,3)),-3,-5)),3),4,5)),5)),1),5,4),4,-1)),-5,-3) (-5,4,-2,5,(-4,(0,(((-5,(4,((0,(4,((2,-3,-1,-3,-2),((-1,((-3,(1,((2,(((-1,(2,(-3,((5,0),4),-2),4)),0),2,-4)),-1),-3)),-5)),-2)),-3)),0...
result:
ok 100 lines