# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
321509 | CaroLinda | Xylophone (JOI18_xylophone) | C++14 | 295 ms | 1192 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 "xylophone.h"
#include <bits/stdc++.h>
#define sz(x) (int)(x.size() )
#define all(x) x.begin(),x.end()
const int MAX = 5010 ;
using namespace std ;
map< pair<int,int> , int > mp ;
void trying(vector<int> &vec )
{
for(int i = 3 ; i < sz(vec) ; i++ )
{
int val12 = abs(vec[i-1]-vec[i-2] ) ;
int val23 = mp[ make_pair(i-1,i) ] ;
int val13 = mp[ make_pair(i-2,i) ] ;
if(val12 + val23 == val13 )
{
vec[i] = vec[i-2] + val13 ;
if( vec[i-1] < vec[i-2] ) vec[i] = vec[i-2] - val13 ;
}
else
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |