QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#495185#9156. 百万富翁TimDee#15 622ms22872kbC++17546b2024-07-27 19:22:452024-07-27 19:22:45

Judging History

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

  • [2024-07-27 19:22:45]
  • 评测
  • 测评结果:15
  • 用时:622ms
  • 内存:22872kb
  • [2024-07-27 19:22:45]
  • 提交

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;
    }

}

詳細信息


Pretests

Pretest #1:

score: 15
Accepted
time: 619ms
memory: 22872kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Time Limit Exceeded

input:

1000000 20 2000000 29091473

output:

Unauthorized output

result:



Final Tests

Test #1:

score: 15
Accepted
time: 622ms
memory: 22240kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Memory Limit Exceeded

input:

1000000 20 2000000 29091471

output:

Unauthorized output

result: