QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#597666#4276. Balls and HolescyxCompile Error//C++201.0kb2024-09-28 18:22:192024-09-28 18:22:19

Judging History

你现在查看的是最新测评结果

  • [2024-09-28 18:22:19]
  • 评测
  • [2024-09-28 18:22:19]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n;
int ans;
vector<int> v[5020];
int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        int k;
        cin >> k;
        while (k--)
        {
            int x;
            cin >> x;
            v[i].push_back(x);
        }
        sort(v[i].begin(), v[i].end());
    }
    for (int i = 1; i <= n; i++)
    {
        for (int j = i + 1; j <= n; j++)
        {
            int x = 0, y = 0;
            bool cnt[v[j].size()] = {};
            int t = 0;
            bool ok = 0;
            while (x < v[i].size() && y < v[j].size())
            {
                if (v[i][x] <= v[j][y])
                {
                    if (!cnt[y])
                        t++;
                    cnt[y]++;
                    x++;
                }
                else
                {
                    y++;
                }
            }
            ans += t & 1;
        }
    }
    cout << ans << endl;
    return 0;
}

詳細信息

answer.code: In function ‘int main()’:
answer.code:35:26: error: use of an operand of type ‘bool’ in ‘operator++’ is forbidden in C++17
   35 |                     cnt[y]++;
      |                     ~~~~~^