Give those children some toys! Problem Code: ECJN203
Link : https://www.codechef.com/problems/ECJN203
problem code:
/**< 🤣🤣🤣 */
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll;
typedef pair<ll, ll> Pll;
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define deb(X) cout << (X) << endl
#define ASH(X) cout << (X) << " "
#define all(x) x.begin(),x.end()
#define deb1(x) cout << #x << " " << x << endl;
#define deb2(x,y) cout << #x << " " << x << " " << #y << " " << y << endl;
#define deb3(x,y,z) cout << #x << " " << x << " " << #y << " " << y << #z << " " << z << endl;
#define FOR(I,A,B) for(ll I = (A); I <= (B); I++)
#define RFOR(I,B,A) for(ll I = (B); I >=(A); I--)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define SORT(c) (sort(c.begin(),c.end()))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASES int ___T; cin >> ___T; for(int cs=1;cs<=___T;cs++)
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
template<typename T>T gcd(T x, T y){if(y==0)return x;else return gcd(y,x%y);}
ll fx[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll fy[] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long INF = 1e18;
const int mod = 1e9 + 7;
const int inf = 1e9;
const int mx = 32000;
vector<ll>a1,b1,c1;
map<ll,ll>m1,m2,m3;
bool isPrime[mx];
ll POWER(ll y,ll z){ll res=1;while(z){if(z%2==1){res=(res*y)%mod;}y=(y*y)%mod;z>>=1LL;}return res;}
void sieve(){for(ll i=2; i<=mx; i++)isPrime[i]=true;for(ll i=3; i<=mx; i+=2){if(isPrime[i]==true)
{for(ll J=i*i; J<=mx; J+=i)isPrime[J]=false;}}}
/************************************************/
void Execute()
{
ll n, nb, val, q, a, b, c, l, r, d, x, y, p, m;
cin >> n;
vector<array<ll,3>> v;
FOR(i,1,n){
cin >> x >> y;
v.push_back({y,-x,-i});
}
SORT(v);
for(auto it:v){
cout << abs(it[2]) << " ";
}
cout<<endl;
}
int32_t main()
{
#ifndef ONLINE_JUDGE
freopen("atomm.txt", "r", stdin);
#endif
FAST();
Execute();
cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "sec \n";
}
/**< 🤣🤣🤣 */
Comments
Post a Comment