ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1010. Discrete Function

Problem 1010. Discrete Function [why i am getting wrong test case passing]
Posted by Amish jha 23 Jul 2022 22:08
/*
::::
author:@DEANNOS at CODEFORCES 2022
::::
*/

#include <bits/stdc++.h>
//using policy based stl
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
#define endl "\n"
#define mod 1000000007
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pll pair<ll, ll>
#define pii pair<int, int>
#define ld  long double
#define ff  first
#define ss  second
#define vs  vector<string>
#define vpll vector<pll>
#define vb  vector<bool>
#define pb push_back
#define bg begin()
#define mp make_pair
#define ed end()
#define gi greater<int> ()
#define srt(v) (sort(all())
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()
#define fo(i,n) for(ll i=0;i<n;i++)
#define Fo(i,k,n) for(ll i=k;i<n;i++)
const int INF = 1000000000;
const int MAX_N = 2e5;

/*
int fastpower(int x, int y, int mod)
{
int res = 1;
x = x % mod;
if (x == 0)
{
return 0;
}
while (y > 0)
{
if (y & 1)
{
res = (res*x) % mod;
}
y = y>>1;
x = (x*x) % mod;
}
return res;
}
*/

/*
int GCD(int a,int b)
{
while(b!=0)
{
int rem=a%b;
a=b;
b=rem;
}
return a;
}
*/

ll integer(ll a)
{
return a >= 0 ? a : -a;
}

int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
ll ans1 = 1, ans2 = 2, mx = 0;
ll a;
cin >> a;
for (int i = 1; i < n; i++)
{
ll b;
cin >> b;
if (integr(a - b) > mx)
{
mx = integer(a - b);
ans1 = i;
ans2 = i + 1;
}
a = b;
}
cout << ans1 << ans2 << endl;
return 0;

}