QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#576171 | #7279. Tricks of the Trade | Crying | 0 | 1ms | 5776kb | C++14 | 803b | 2024-09-19 19:00:45 | 2024-09-19 19:00:45 |
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 2.5e5+10,INF = 1e18;
template<typename T>void tomin(T& x,T y){x = min(x,y);}
template<typename T>void tomax(T& x,T y){x = max(x,y);}
int n,k,a[N],b[N];
int arr[N],rk[N];
namespace T1{ //corner
void solve(){
ll mx = -INF; for(int i=1;i<=n;i++)tomax(mx,(ll)b[i]-a[i]);
cout<<mx<<"\n";
for(int i=1;i<=n;i++)cout<<(b[i]-a[i] == mx);
exit(0);
}
}
int main(){
ios::sync_with_stdio(false); cin.tie(0);
cin>>n>>k;
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<=n;i++)cin>>b[i],arr[i] = i;
sort(arr+1,arr+1+n,[&](int x,int y){return b[x] >= b[y];});
for(int i=1;i<=n;i++)rk[arr[i]] = i;
if(k==1)T1::solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 5776kb
input:
5 3 3 5 2 3 6 2 1 5 2 3
output:
result:
wrong output format Unexpected end of file - int64 expected
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Wrong Answer
Test #30:
score: 0
Wrong Answer
time: 0ms
memory: 5744kb
input:
5 2 1 6 1 5 2 4 1 6 2 4
output:
result:
wrong output format Unexpected end of file - int64 expected
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%