# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
887041 | PotatoMan | Stone Arranging 2 (JOI23_ho_t1) | C++14 | 146 ms | 15320 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>
#define inf INT_MAX
#define longlonginf LONG_LONG_MAX
#define mod 1000000007
#define MAXN 200005
#define pii pair<ll,ll>
#define ll long long
#define deb(x) cerr<<"[ "<<#x<<" = "<<x<<" ]";
#define yes() cout<<"YES\n";
#define no() cout<<"NO\n";
using namespace std;
ll n,k,m,cur,q,z;
ll ans = 0;
string subtask;
string s;
string l,r;
void solve(){
cin>>n;
ll a[n+5];
for(int i = 1 ; i <= n ; i++){
cin>>a[i];
}
map<int,int> mp;
for(int i = 1 ; i <= n ; i++) mp[a[i]] = i;
for(int i = 1 ; i <= n ;){
int x = i;
int y = mp[a[x]];
for(; i <= y ; i++){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |