QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#495319#9156. 百万富翁TimDee#Compile Error//C++171.9kb2024-07-27 20:01:302024-07-27 20:01:30

Judging History

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

  • [2024-07-27 20:01:30]
  • 评测
  • [2024-07-27 20:01:30]
  • 提交

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].f++;
        sort(all(cnt));
        return cnt[n-1].s;
    }
    vector<int> a; forn(i,n) a.pb(i);
    for(int it=0; it<4; ++it) {
        vector<int> f,s;
        for(int i=0; i<a.size(); i+=2) {
            f.pb(a[i]);
            s.pb(a[i+1]);
        }
        auto z = ask(f,s);
        a = z;
    }
    vector<int> cnt(n);
    if (1) {
        vector<int> f,s;
        for(int i=0; i<a.size(); i+=4) {
            for(int x=0; x<4; ++x) {
                for(int y=x+1; y<4; ++y) {
                    f.pb(a[i+x]);
                    s.pb(a[i+y]);
                }
            }
        }
        auto z = ask(f,s);
        for(auto&x:z) cnt[x]++;
        vector<int> b;
        forn(i,n) if (cnt[i]==3) b.pb(i);
        forn(i,n) cnt[i]=0;
        a=b;
    }
    for(int it=0; it<3; ++it) {
        vector<int> f,s;
        for(int i=0; i<a.size(); i+=5) {
            for(int x=0; x<5; ++x) {
                for(int y=x+1; y<5; ++y) {
                    f.pb(a[i+x]);
                    s.pb(a[i+y]);
                }
            }
        }
        auto z = ask(f,s);
        for(auto&x:z) cnt[x]++;
        vector<int> b;
        forn(i,n) if (cnt[i]==4) b.pb(i);
        forn(i,n) cnt[i]=0;
        a=b;
    }
    
    forn(i,125) forn(j,i) {f.pb(a[j]); s.pb(a[i]);}
    auto z = ask(f,s);
    for(auto&x:z) cnt[x]++;
    forn(i,n) if (cnt[i]==124) return i;
}

詳細信息

answer.code: In function ‘int richest(int, int, int)’:
answer.code:7:11: error: ‘first’ was not declared in this scope
    7 | #define f first
      |           ^~~~~
answer.code:67:28: note: in expansion of macro ‘f’
   67 |     forn(i,125) forn(j,i) {f.pb(a[j]); s.pb(a[i]);}
      |                            ^
answer.code:8:11: error: ‘second’ was not declared in this scope
    8 | #define s second
      |           ^~~~~~
answer.code:67:40: note: in expansion of macro ‘s’
   67 |     forn(i,125) forn(j,i) {f.pb(a[j]); s.pb(a[i]);}
      |                                        ^
answer.code:7:11: error: ‘first’ was not declared in this scope
    7 | #define f first
      |           ^~~~~
answer.code:68:18: note: in expansion of macro ‘f’
   68 |     auto z = ask(f,s);
      |                  ^
answer.code:8:11: error: ‘second’ was not declared in this scope
    8 | #define s second
      |           ^~~~~~
answer.code:68:20: note: in expansion of macro ‘s’
   68 |     auto z = ask(f,s);
      |                    ^
answer.code:71:1: warning: control reaches end of non-void function [-Wreturn-type]
   71 | }
      | ^