# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
207258 | mayhoubsaleh | Fortune Telling 2 (JOI14_fortune_telling2) | C++14 | 743 ms | 71148 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include <string>
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mid (l+r)/2
#define left 2*i+1
#define righ 2*i+2
using namespace std;
const ll mod=1e9+7;
const ll maxn=2e5+100;
ll n,k;
ll a[maxn],b[maxn];
vector<ll> v[4*maxn];
pair<ll,ll>t[maxn];
void build(ll i,ll l,ll r){
if(l==r){
v[i].pb(t[r].second);
return;
}
build(left,l,mid);
build(righ,mid+1,r);
ll lp=0,rp=0;
while(lp<v[left].size()&&rp<v[righ].size()){
if(v[left][lp]<v[righ][rp])v[i].pb(v[left][lp++]);
else v[i].pb(v[righ][rp++]);
}
while(lp<v[left].size())v[i].pb(v[left][lp++]);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |