QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#193866 | #7522. Sequence Shift | ucup-team896# | Compile Error | / | / | C++14 | 1.1kb | 2023-09-30 17:59:13 | 2023-09-30 17:59:13 |
Judging History
你现在查看的是最新测评结果
- [2023-10-04 16:13:32]
- hack成功,自动添加数据
- (//qoj.ac/hack/400)
- [2023-09-30 17:59:13]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-09-30 17:59:13]
- 提交
answer
#pragma GCC optimize(2, 3, "Ofast")
#include<bits/stdc++.h>
#define int ll
using namespace std;
const int N=1e6+7;
int n,q,a[N],b[N*2],c[N],d[N*2];
int ans[N],lim,maxn[N];
vector<int>e;
void del(int id){
for(int i=1;i<=710;i++)
if(maxn[i]==id){
for(int j=i;j<710;j++)
maxn[i]=maxn[i+1];
}
return;
}void add(int vl,int id){
for(int i=1;i<=710;i++)
if(vl>b[maxn[i]]){
for(int j=710;j>i;j--)
maxn[j]=maxn[j-1];
maxn[i]=id;
return;
}
return;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);cin>>n>>q;
for(int i=1;i<=n;i++){
cin>>a[i];
c[i]=a[i];
}sort(c+1,c+n+1);
lim=c[max(1,n-N*400/n)];
for(int i=1;i<=n;i++)
cin>>b[i];
for(int i=1;i<=n;i++)
if(a[i]>=lim)e.push_back(i);
int ans=0;
for(int i=1;i<=n;i++){
ans=max(ans,a[i]+b[i]);
add(b[i],i);
}
cout<<ans<<"\n";
for(int i=1;i<=q;i++){
del(i);
cin>>b[n+i];
b[n+i]^=ans;ans=0;
add(b[n+i],n+i);
for(auto v:e)ans=max(ans,a[v]+b[v+i]);
for(int j=1;j<=710;j++)if(maxn[j]>=i+1&&maxn[j]<=i+n)
ans=max(ans,b[maxn[j]]+a[maxn[j]-i]);
cout<<ans<<"\n";
}return 0;
}
详细
answer.code:3:13: error: ‘ll’ does not name a type 3 | #define int ll | ^~ answer.code:5:7: note: in expansion of macro ‘int’ 5 | const int N=1e6+7; | ^~~ answer.code:3:13: error: ‘ll’ does not name a type 3 | #define int ll | ^~ answer.code:6:1: note: in expansion of macro ‘int’ 6 | int n,q,a[N],b[N*2],c[N],d[N*2]; | ^~~ answer.code:3:13: error: ‘ll’ does not name a type 3 | #define int ll | ^~ answer.code:7:1: note: in expansion of macro ‘int’ 7 | int ans[N],lim,maxn[N]; | ^~~ answer.code:3:13: error: ‘ll’ was not declared in this scope 3 | #define int ll | ^~ answer.code:8:8: note: in expansion of macro ‘int’ 8 | vector<int>e; | ^~~ answer.code:8:11: error: template argument 1 is invalid 8 | vector<int>e; | ^ answer.code:8:11: error: template argument 2 is invalid answer.code:9:6: error: variable or field ‘del’ declared void 9 | void del(int id){ | ^~~ answer.code:3:13: error: ‘ll’ was not declared in this scope 3 | #define int ll | ^~ answer.code:9:10: note: in expansion of macro ‘int’ 9 | void del(int id){ | ^~~ answer.code:16:7: error: variable or field ‘add’ declared void 16 | }void add(int vl,int id){ | ^~~ answer.code:3:13: error: ‘ll’ was not declared in this scope 3 | #define int ll | ^~ answer.code:16:11: note: in expansion of macro ‘int’ 16 | }void add(int vl,int id){ | ^~~ answer.code:3:13: error: ‘ll’ was not declared in this scope 3 | #define int ll | ^~ answer.code:16:18: note: in expansion of macro ‘int’ 16 | }void add(int vl,int id){ | ^~~ answer.code: In function ‘int main()’: answer.code:28:25: error: ‘n’ was not declared in this scope; did you mean ‘yn’? 28 | cin.tie(0);cin>>n>>q; | ^ | yn answer.code:28:28: error: ‘q’ was not declared in this scope 28 | cin.tie(0);cin>>n>>q; | ^ answer.code:3:13: error: ‘ll’ was not declared in this scope 3 | #define int ll | ^~ answer.code:29:13: note: in expansion of macro ‘int’ 29 | for(int i=1;i<=n;i++){ | ^~~ answer.code:29:21: error: ‘i’ was not declared in this scope 29 | for(int i=1;i<=n;i++){ | ^ answer.code:30:22: error: ‘a’ was not declared in this scope 30 | cin>>a[i]; | ^ answer.code:31:17: error: ‘c’ was not declared in this scope 31 | c[i]=a[i]; | ^ answer.code:32:15: error: ‘c’ was not declared in this scope 32 | }sort(c+1,c+n+1); | ^ answer.code:33:9: error: ‘lim’ was not declared in this scope 33 | lim=c[max(1,n-N*400/n)]; | ^~~ answer.code:33:23: error: ‘N’ was not declared in this scope 33 | lim=c[max(1,n-N*400/n)]; | ^ answer.code:3:13: error: ‘ll’ was not declared in this scope 3 | #define int ll | ^~ answer.code:34:13: note: in expansion of macro ‘int’ 34 | for(int i=1;i<=n;i++) | ^~~ answer.code:34:21: error: ‘i’ was not declared in this scope 34 | for(int i=1;i<=n;i++) | ^ answer.code:35:22: error: ‘b’ was not declared in this scope 35 | cin>>b[i]; | ^ answer.code:3:13: error: ‘ll’ was not declared in this scope 3 | #define int ll | ^~ answer.code:36:13: note: in expansion of macro ‘int’ 36 | for(int i=1;i<=n;i++) | ^~~ answer.code:36:21: error: ‘i’ was not declared in this scope 36 | for(int i=1;i<=n;i++) | ^ answer.code:37:20: error: ‘a’ was not declared in this scope 37 | if(a[i]>=lim)e.push_back(i); | ^ answer.code:37:32: error: request for member ‘push_back’ in ‘e’, which is of non-class type ‘int’ 37 | if(a[i]>=lim)e.push_back(i); | ^~~~~~~~~ answer.code:3:13: error: ‘ll’ was not declared in this scope 3 | #define int ll | ^~ answer.code:38:9: note: in expansion of macro ‘int’ 38 | int ans=0; | ^~~ answer.code:39:17: error: expected ‘;’ before ‘i’ 39 | for(int i=1;i<=n;i++){ | ^ answer.code:39:21: error: ‘i’ was not declared in this scope 39 | for(int i=1;i<=n;i++){ | ^ answer.code:40:17: error: ‘ans’ was not declared in this scope; did you mean ‘abs’? 40 | ans=max(ans,a[i]+b[i]); | ^~~ | abs answer.code:40:29: error: ‘a’ was not declar...