QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#495181#9156. 百万富翁TimDee#Compile Error//C++17542b2024-07-27 19:21:472024-07-27 19:21:47

Judging History

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

  • [2024-07-27 19:21:47]
  • 评测
  • [2024-07-27 19:21:47]
  • 提交

answer

#include "richest.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second 
#define all(x) x.begin(), x.end()
int richest(int n, int t, int s) {
    if (t==1) {
        vector<int> f,s;
        forn(i,n) forn(j,i) {f.pb(j); s.pb(i);}
        auto z = ask(f,s);
        vector<pi> cnt(n);
        forn(i,n) cnt[i].s=i;
        for(auto&x:z) cnt[x]++;
        sort(all(cnt));
        return cnt[n-1].s;
    }
}

詳細信息

answer.code: In function ‘int richest(int, int, int)’:
answer.code:17:29: error: no ‘operator++(int)’ declared for postfix ‘++’ [-fpermissive]
   17 |         for(auto&x:z) cnt[x]++;
answer.code:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^