QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#583428 | #9370. Gambling on Choosing Regionals | Line_Mao | Compile Error | / | / | C++98 | 1.1kb | 2024-09-22 19:55:15 | 2024-09-22 19:55:17 |
Judging History
answer
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
int main()
{
int n, k; cin >> n >> k;
vector<int>c(k);
for (int i = 0; i < k; i++) {
cin >> c[i];
}
sort(c.begin(),c.end());
vector<int>a(n);
vector<string>b(n);
map<string, vector<int>>mp;
for (int i = 0; i < n; i++)
{
cin >> a[i] >> b[i];
mp[b[i]].push_back(a[i]);
}
for (map<string, vector<int>>::iterator it = mp.begin(); it != mp.end(); it++)
{
sort(it->second.begin(), it->second.end());
}
for (int i = 0; i < n; i++)
{
int ans = 1;
for (map<string, vector<int>>::iterator it = mp.begin(); it != mp.end(); it++)
{
if (it->first == b[i])
{
for (int j = c[0] - 1; j > 0; j--)
{
if (a[i] < it->second[mp[it->first].size() - j])
{
ans = ans + j;
break;
}
}
}
else
{
for (int j = c[0]; j > 0; j--)
{
if (a[i] < it->second[mp[it->first].size() - j])
{
ans += j;
break;
}
}
}
}
cout << ans << endl;
}
}
Details
answer.code: In function ‘int main()’: answer.code:18:31: error: ‘>>’ should be ‘> >’ within a nested template argument list 18 | map<string, vector<int>>mp; | ^~ | > > answer.code:25:36: error: ‘>>’ should be ‘> >’ within a nested template argument list 25 | for (map<string, vector<int>>::iterator it = mp.begin(); it != mp.end(); it++) | ^~ | > > answer.code:33:44: error: ‘>>’ should be ‘> >’ within a nested template argument list 33 | for (map<string, vector<int>>::iterator it = mp.begin(); it != mp.end(); it++) | ^~ | > >