QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#180423 | #5680. You You See What? | Clouds | WA | 0ms | 3452kb | C++14 | 1.9kb | 2023-09-15 20:10:28 | 2023-09-15 20:10:29 |
Judging History
answer
#include<bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
map<string,int>mp;
int idx;
void solve()
{
string s;
cin>>s;
while(1)
{
mp.clear();
string hou,p;
int flag=0;
for(int i=0;i<s.size();i++)
{
if(flag==1)
{
hou+=s[i];
continue;
}
if(s[i]=='!')
{
if(mp.count(p)==0)
{
mp[p]=++idx;
p="";
}
else
{
flag=1;
}
}
else
{
if(s[i]>='a'&&s[i]<='z')
p+=s[i];
else
{
char t=s[i];
t+=32;
p+=t;
}
}
}
if(flag==0)
{
cout<<s<<endl;
return ;
}
string qian;
string pp,t;
//cout<<s<<endl;
for(int i=0;i<s.size();i++)
{
if(s[i]=='!')
{
qian+=t;
qian+='!';
if(pp==p)
break;
pp="";
t="";
}
else
{
//cout<<s[i]<<endl;
t+=s[i];
if(s[i]>='a'&&s[i]<='z')
pp+=s[i];
else
{
char tt=s[i];
tt+=32;
pp+=tt;
}
}
}
s=qian+hou;
}
return ;
}
signed main()
{
int t=1;
//cin>>t;
while(t--)
{
solve();
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3452kb
input:
texasam!rice!baylor!csdept!baylor!rice!dev!bresearch!bpoucher
output:
texasam!rice!dev!bresearch!bpoucher
result:
ok single line: 'texasam!rice!dev!bresearch!bpoucher'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3416kb
input:
texasam!Rice!baYlor!csdept!BayloR!dev!Rice!bresearch!bpoucher
output:
texasam!Rice!bresearch!bpoucher
result:
wrong answer 1st lines differ - expected: 'texasam!Rice!baYlor!dev!Rice!bresearch!bpoucher', found: 'texasam!Rice!bresearch!bpoucher'