QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#340475#4388. C++ to Pythoncrsfaa#AC ✓1ms3740kbC++14621b2024-02-29 08:52:222024-02-29 08:52:23

Judging History

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

  • [2024-02-29 08:52:23]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3740kb
  • [2024-02-29 08:52:22]
  • 提交

answer

#include<bits/stdc++.h>
#define Yukinoshita namespace
#define Yukino std
using Yukinoshita Yukino;
int read()
{
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') w=ch=='-'?-1:1,ch=getchar();
	while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
	return s*w;
}
char s[1005];
int main()
{
	int T=read();
	while(T--)
	{
		scanf("%s",s+1);
		int n=strlen(s+1),i;
		for(i=1;i<=n;i++)
			if(s[i]=='-'||s[i]>='0'&&s[i]<='9'||s[i]==')'||s[i]=='('||s[i]==',')
				putchar(s[i]);
		puts("");
	}
}
/*
2
std::make_tuple(-2,3,3,std::make_tuple(3,3))
std::make_tuple(std::make_tuple(1,1,4,5,1,4))
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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