QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#57406 | #4388. C++ to Python | qinjianbin# | AC ✓ | 0ms | 3672kb | C++17 | 513b | 2022-10-22 13:08:57 | 2022-10-22 13:08:57 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define _for(i, a, b) for(int i = (a); i <= (b); i++)
using namespace std;
int main()
{
map<char, bool> mp;
mp['('] = mp[')'] = mp[','] = mp['-'] = 1;
for(int i = '0'; i <= '9'; i++) mp[i] = 1;
int T; scanf("%d", &T);
while(T--)
{
string s;
cin >> s;
int len = s.size();
string ans = "";
rep(i, 0, len)
if(mp[s[i]])
ans.push_back(s[i]);
cout << ans << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3672kb
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