QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#219462#6389. TopicalliwuyouQOJCompile Error//C++141.5kb2023-10-19 15:08:322023-10-19 15:08:32

Judging History

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

  • [2023-10-19 15:08:32]
  • 评测
  • [2023-10-19 15:08:32]
  • 提交

answer

// A. course.cpp
// Started at 8:34
// Returned at 9:42
// Restarted at 14:25
#include <bits/stdc++.h>
#define int long long

using namespace std;

const int N = 1000005;

vector<int> r[N], u[N], c;
int p[N], cnt[N];
vector<pair<int, int> > g[N];

bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first != b.first ? a.first > b.first : a.second > b.second);
}

signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  //freopen("course.in", "r", stdin);
  //freopen("course.out", "w", stdout);
  int n, k, ans = 0;
  cin >> n >> k;
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < k; j++) {
      int x;
      cin >> x;
      r[i].push_back(x);
      g[j].push_back({x, i});
    }
  }
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < k; j++) {
      int x;
      cin >> x;
      u[i].push_back(x);
    }
  }
  for(int i = 0; i < k; i++) {
    sort(g[i].begin(), g[i].end(), cmp);
  }
  while(1) {
    for(int i = 0; i < k; i++) {
      while(g[i].size() && g[i][g[i].size() - 1].first <= p[i]) {
        cnt[g[i][g[i].size() - 1].second]++;
        if(cnt[g[i][g[i].size() - 1].second] == k) {
          c.push_back(g[i][g[i].size() - 1].second);
        }
        g[i].pop_back();
      }
    }
    if(c.size() == 0) {
      break;
    }
    for(int i : c) {
      for(int j = 0; j < k; j++) {
        p[j] = min(p[j] + u[i][j], 1145141919810);
      }
    }
    ans += c.size();
    c.clear();
  }
  cout << ans;
}
// Left at 9:06
// Gave up at 9:50

Details

answer.code: In function ‘int main()’:
answer.code:60:19: error: no matching function for call to ‘min(long long int, long int)’
   60 |         p[j] = min(p[j] + u[i][j], 1145141919810);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/bits/char_traits.h:39,
                 from /usr/include/c++/11/ios:40,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:5:
/usr/include/c++/11/bits/stl_algobase.h:230:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)’
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/11/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
answer.code:60:19: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘long int’)
   60 |         p[j] = min(p[j] + u[i][j], 1145141919810);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/bits/char_traits.h:39,
                 from /usr/include/c++/11/ios:40,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:5:
/usr/include/c++/11/bits/stl_algobase.h:278:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/11/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
answer.code:60:19: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long long int’ and ‘long int’)
   60 |         p[j] = min(p[j] + u[i][j], 1145141919810);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:5:
/usr/include/c++/11/bits/stl_algo.h:3449:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)’
 3449 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/11/bits/stl_algo.h:3449:5: note:   template argument deduction/substitution failed:
answer.code:60:19: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
   60 |         p[j] = min(p[j] + u[i][j], 1145141919810);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:5:
/usr/include/c++/11/bits/stl_algo.h:3455:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)’
 3455 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/11/bits/stl_algo.h:3455:5: note:   template argument deduction/substitution failed:
answer.code:60:19: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘long long int’
   60 |         p[j] = min(p[j] + u[i][j], 1145141919810);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~