QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#800694 | #8791. Tasks and Bugs | ucup-team6015# | WA | 4ms | 27236kb | C++17 | 1.6kb | 2024-12-06 14:36:40 | 2024-12-06 14:36:40 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = l; i < r; i++)
#define hrp(i, l, r) for(int i = l; i <= r; i++)
#define rev(i, r, l) for(int i = r; i >= l; i--)
#define int ll
using namespace std;
typedef long long ll;
template<typename tn = int> tn next(void) { tn k; cin>>k; return k; }
#ifndef LOCAL
#define D(...) 0
#define I(...) 0
#endif
const int U = 1.01e6;
vector<int> tail[U];
int toNum(string str)
{
int ret = 0;
rep(i, 3, str.size()) ret += str[i]-'0', ret *= 10;
return ret/10;
}
signed main(void)
{
#ifdef LOCAL
freopen("C:\\Users\\Loxil\\Desktop\\IN.txt", "r", stdin);
// freopen("C:\\Users\\Loxil\\Desktop\\OUT.txt", "w", stdout);
#endif
int cnt = 0;
string str;
while(getline(cin, str))
{
string cur;
int head = 0, pos = -1;
while(++pos < str.size())
{
if (str[pos] == ' ') continue;
if (str[pos] == ':') { head = toNum(cur); D(head); cur.clear(); continue; }
if (str[pos] == ',') { tail[head].push_back(toNum(cur)); cur.clear(); continue; }
cur += str[pos];
}
tail[head].push_back(toNum(cur));
}
rep(i, 1, 1000000) if (tail[i].size())
{
cout<<"CS-"<<i<<": ";
sort(tail[i].begin(), tail[i].end());
rep(j, 0, tail[i].size())
{
cout<<"CS-"<<tail[i][j];
if (j != tail[i].size()-1) cout<<", ";
}
cout<<endl;
}
return 0;
}
/*
CS-20: CS-1
CS-100: CS-239
CS-300: CS-239, CS-11111
*/
详细
Test #1:
score: 0
Wrong Answer
time: 4ms
memory: 27236kb
input:
CS-20: CS-1 CS-100: CS-239 CS-300: CS-239, CS-11111
output:
CS-20: CS-1 CS-100: CS-239 CS-300: CS-239, CS-11111
result:
wrong answer 1st lines differ - expected: 'CS-1: CS-20', found: 'CS-20: CS-1'