wuenzi @ 2024-09-20 11:53:08
checker:
#include "testlib.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> a,b;
bool v[100005];
int n=100000;
int main(int argc, char* argv[]){
setName("Chicken");
registerInteraction(argc, argv);
registerGen(argc, argv,1);
cout<<n<<endl;
for(int i=0;i<n;i++){
int l1=rnd.next(1,1000000000);
a.push_back(l1);
cout<<l1<<" ";
}
cout<<endl;
for(int i=0;i<n;i++){
int l1=rnd.next(1,1000000000);
b.push_back(l1);
cout<<l1<<" ";
}
int pa = ouf.readInt();
int ans=0;
for(int i=0;i<n;i++){
int l=(lower_bound(a.begin(),a.end(),b[i])-a.begin());
// cout<<l<<endl;
while(v[l]==1&&l<n)l++;
if(l<n){
v[l]=1;
ans++;
}else break;
}
if (pa!=ans) quitf(_wa, "yinweiniSHAN!!!!");
else quitf(_ok, "orz");
}
交互库:
#include<bits/stdc++.h>
using namespace std;
int n;
extern "C" {
extern int p(int n,vector<int> a,vector<int> b);
}
int main() {
vector<int> a,b;
a.clear();
b.clear();
cin>>n;
for(int i=0;i<n;i++){
int k;
cin>>k;
a.push_back(k);
}
for(int i=0;i<n;i++){
int k;
cin>>k;
b.push_back(k);
}
cout << p(n,a,b) <<endl;
return 0;
}
by happy_guest @ 2024-09-20 12:47:31
?
by happy_guest @ 2024-09-20 12:47:58
哪道题?
by wuenzi @ 2024-09-20 12:56:47
是SPJ
by wuenzi @ 2024-09-20 12:57:12
@happy_guest