QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#314216#63. MeetingsXttttr0 22ms4092kbC++14863b2024-01-25 14:27:232024-01-25 14:27:24

Judging History

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

  • [2024-01-25 14:27:24]
  • 评测
  • 测评结果:0
  • 用时:22ms
  • 内存:4092kb
  • [2024-01-25 14:27:23]
  • 提交

answer

#include<bits/stdc++.h>
#include "meetings.h"
using namespace std;
mt19937 nsc(time(0));
inline void add_edge(int x,int y){
    if(x>y)swap(x,y);
    Bridge(x,y);
}
inline void solve(vector<int>q){
    int n=q.size();
    if(n==1)return;
    if(n==2)return add_edge(q[0],q[1]),void();
    shuffle(q.begin(),q.end(),nsc);
    vector<pair<int,int> >a(n);
    a[0]=make_pair(q[0],0),a[1]=make_pair(q[1],1);
    for(int i=2;i<n;i++)a[i]=make_pair(Query(q[0],q[1],q[i]),i);
    sort(a.begin(),a.end());
    vector<int>qq;
    for(int l=0,r=0;l<n;l=++r){
        qq.push_back(a[l].first);
        vector<int>cur(1,a[l].second);
        while(r+1<n&&a[r+1].first==a[r].first)cur.push_back(a[++r].second);
        solve(cur);
    }
    solve(qq);
}
void Solve(int N){
    vector<int>q;
    for(int i=0;i<N;i++)q.push_back(i);
    solve(q);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 7
Accepted
time: 1ms
memory: 3884kb

input:

3
0 2
0 1

output:

Accepted: 3

result:

ok 3 move(s)

Test #2:

score: -7
Wrong Answer
time: 1ms
memory: 3876kb

input:

4
1 2
0 2
0 3

output:

Wrong Answer [4]

result:

wrong answer 

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%

Subtask #4:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #40:

score: 0
Wrong Answer
time: 22ms
memory: 4092kb

input:

2000
58 503
623 1403
1004 1083
249 491
1524 1849
192 562
1261 1877
547 909
267 896
747 1986
381 1329
57 317
779 886
469 1652
628 1456
1732 1790
700 825
494 1799
1450 1733
103 1069
1114 1342
243 1496
930 1361
240 905
398 1737
1008 1765
357 954
1157 1898
1228 1344
1062 1731
160 1977
40 364
343 694
108...

output:

Wrong Answer [4]

result:

wrong answer