QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#500962 | #8791. Tasks and Bugs | ydzr00000 | WA | 0ms | 8456kb | C++20 | 1.4kb | 2024-08-02 08:12:01 | 2024-08-02 08:12:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
inline int string_to_number(string s)
{
int num=0,len=s.length();
for(int i=0;i<len;i++)
num=(num<<1)+(num<<3)+(s[i]^48);
return num;
}
set<int>st[100001];
set<int>tk;
int main(){
string str;
while(getline(cin,str))
{
str+=" ";
int len=str.length();
string bug="";
int now=0;
bool flag=false;
for(int i=3;i<len;i++)
{
if(isdigit(str[i]))
{
bug+=str[i];
flag=true;
}
else if(flag)
{
now=i;
break;
}
}
int bugid=string_to_number(bug);
string task="";
for(int i=now;i<len;i++)
{
if(isdigit(str[i]))
task+=str[i];
else
{
if(task!="")
{
int tid=string_to_number(task);
st[tid].insert(bugid);
tk.insert(tid);
}
task="";
}
}
}
for(auto tkid: tk)
{
printf("CS-%d: ",tkid);
int num=*(--st[tkid].end());
for(auto bugid: st[tkid])
printf("CS-%d%c%c",bugid,", "[bugid==num]," \n"[bugid==num]);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 8456kb
input:
CS-20: CS-1 CS-100: CS-239 CS-300: CS-239, CS-11111
output:
CS-1: CS-20 CS-239: CS-100, CS-300 CS-11111: CS-300
result:
wrong answer 1st lines differ - expected: 'CS-1: CS-20', found: 'CS-1: CS-20 '