akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

const long long N = 3e6 + 17;
ll a[N], b[N], cnt, ans, lnt, n, m, r1, r0, l1, l0, sum, mx, h, c[N], t[N], mn = N, x, y, k;
pair<ll,ll>pr[N];
vector<ll>v,v2;
map<ll,ll>mp;
bool used[N];
char ch[N];
ll prime[N] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> m;
    if((n * m) % 2 == 1 or (n * m * 2) % 2 == 1 or (n * m * 3) % 2 == 1)
    {
        cout << "Yes";
        return 0;
    }
    cout << "No";
}


Measured memory_bytes: 4352
#include<iostream>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;

int main() {
	int a, b, x; cin >> a >> b >> x;
	if (x >= a&&x <= a + b)cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;

int main(void) {
	int N;
	cin >> N;

	vector<string>a(N);

	for (int i = 0; i < N;i++) {
		cin >> a[i];
	}

	int ans = N;

	sort(a.begin(), a.end());

	for (int i = 0; i < N - 1; i++) {
		if (a[i] == a[i+1]) {
			ans--;
		}
	}

	cout << ans;
	
	return 0;
}

Measured memory_bytes: 9496
#include<bits/stdc++.h>
using namespace std;
using ull=unsigned long long;
#define mod 1000000007
#define mod2 998244353 
#define PI 3.14159265
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define sz size()
#define setbits(x)  __builtin_popcount(x)
#define fi first
#define se second
#define lz length()
#define all(x) (x).begin(),(x).end()
#define scf(x) scanf("%lld",&x)
#define rep(i,n) for(ll i=0;i<n;i++)
const int INF = (int)1e9;
const ll IINF=1LL<<62;
const int maxn=10000005;

//int divr[maxn];
/**/
/*void divisor()
{for(int i=2;i<sqrt(maxn);i++)
     {
          if(!divr[i])
          {
               for(int j=i*i;j<maxn;j+=i)if(!divr[j])divr[j]=i;     
          }
     }
     for(int i=1;i<maxn;i++)if(!divr[i])divr[i]=i;
}*/
 
/*const int N=1000005;
ll n;
struct line {
    long long m, c;
    long long eval(long long x) { return m * x + c; }
    long double intersectX(line l) { return (long double) (c - l.c) / (l.m - m); }
};
vector<pair<pi,ll>> rect;
deque<line> dq;
*/
ll modexpo(ll a,ll b)
{
     ll ans=1LL;
     while(b>0)
     {
          if(b&1)ans=(ans*a)%mod;
          a=(a*a)%mod;
          b>>=1;
     }
     return ans;
}
 
 
 
 
 
 
 





int dp[1005][5005];
int main()
{
     string s;
     cin>>s;
     string t;
     cin>>t;
     set<int> st[1005];
     for(int i=0;i<s.length();i++){
          st[s[i]].insert(i);
     }
     ll a=0,b=0;
     for(int i=0;i<t.length();i++){
          if(st[t[i]].empty()){
               cout<<-1;return 0;
          }
          if(st[t[i]].lower_bound(b)==st[t[i]].end())a++,b=0;
          b=*st[t[i]].lower_bound(b);
          b++;
     }

     ll res=a*s.size()+b;
     cout<<res;
}






























Measured memory_bytes: 8552
#include<vector>
#include <iostream>

using namespace std;

int main(){
    int n;
    cin >> n ;
    int flag = 0;
    int a = 0;
    for(int i = 1; i < 10; i++){
        if(n % i == 0){
            a = n / i;
            if(a <= 9){
                flag = 1;
            }
        }
    }
    if(flag == 1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define P pair<int,int>
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
using namespace std;

signed main(){
    string s;
    cin >> s;
    int ans=0;
    REP(i,4){
        if(s[i]=='2'){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
// ਅਗਮਜੋਤ ਸਿੰਘ
// AGAMJOT SINGH

#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

// a_gamer

int power(int x, unsigned int y, int p) { 
    int res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or  
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p;   
    } 
    return res; 
} 
  
int max(int a, int b){
    if (a > b)
        return a;
    else
        return b;
}
int maxSubArraySum(vector<int> &v){
    int size = v.size();
    int max_so_far = 0, max_ending_here = 0;
    int a[size];
    for (int i = 0; i < size; i++)
    {
        a[i] = v[i];
    }
    for (int i = 0; i < size; i++)
    {
        max_ending_here = max_ending_here + a[i];
        if (max_ending_here < 0)
            max_ending_here = 0;
        else if (max_so_far < max_ending_here)
            max_so_far = max_ending_here;
    }
    return max_so_far;
}
int NcR(int n, int r) { 
   
    long long p = 1, k = 1;  
    if (n - r < r) 
        r = n - r;  
    if (r != 0) {   
        while (r) { 
            p *= n; 
            k *= r;  
            long long m = __gcd(p, k);  
            p /= m; 
            k /= m;  
            n--; 
            r--; 
        }  
    }  
    else
        p = 1;  
    return p; 
}

signed main(){ 
    fastio;
    int n;
    cin >> n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin >> arr[i];
    }
    int dp[n];
    for(int i=0;i<n;i++){
        if(i == 0){
            dp[i] = 0;
        } 
        else if(i == 1){
            dp[i] = dp[i-1] + abs(arr[i] - arr[i-1]);
        }
        else{
            dp[i] = min(dp[i-1] + abs(arr[i] - arr[i-1]), dp[i-2] + abs(arr[i] - arr[i-2]));
        }
    }
    cout << dp[n-1] << endl;
}

Measured memory_bytes: 1792
from sys import stdin

n=int(input())
valeurs=[0]*n
minimum=0
for i in range(n):
    valeur=int(stdin.readline())
    valeurs[i]=[valeur,i]
valeurs.sort()
compteur=[0]*2
for i in range(n):
    indice=valeurs[i][1]
    if i%2!=indice%2:
        compteur[indice%2]+=1
print(max(compteur))


Measured memory_bytes: 20112
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#define _GLIBCXX_DEBUG // check []
#define DIVISOR 1000000007

using namespace std;
typedef pair<int,int> pii;
typedef pair<int64_t, int64_t> pII;

template<typename T>
void cins(vector<T>& arr) { for(T& e: arr) cin >> e; }

#ifdef DEBUG
#define debug(fmt, ...) \
    printf("[debug: %s] " fmt, __func__, __VA_ARGS__)
#define ps(arr) \
    for(auto e: arr) cout << e << " "; \
    cout << endl;
#else
#define debug(fmt, ...)
#define ps(arr)
#endif

#define INF 1000
int main(void) {
    int num;
    cin >> num;
    vector<vector<int>> arr(num, vector<int>(26));

    for(int i = 0; i < num; i++) {
        string str;
        cin >> str;
        for(int j = 0; j < str.length(); j++) {
            char ch = str[j]-'a';
            arr[i][ch]++;
        }
    }

    string ans;
    for(int i = 0; i < 26; i++) {
        int cnt = INF;
        for(int k = 0; k < num; k++) {
            cnt = min(arr[k][i], cnt);
        }
        while(cnt--) ans.push_back(i+'a');
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

LL a, b, c, k, ans;

int main() {
	cin>>a>>b>>c>>k;
	if(k > a) {
		k -= a;
		ans += a;
	}
	else {
		ans = k;
		k = 0;
	}
	if(k > b) k -= b;
	else k = 0;
	ans -= k;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3636
N = int( input() )

AP = 0
BP = 0


for i in range(N):
    A,B = input().split()
    sa = 0
    X = max( len(A) , len(B) )
    A = A.ljust(X, '0')
    B = B.ljust(X, '0')
    if A == B:
        AP += 1
        BP += 1
    else:
        for j in range(X):
            if ord( A[j] ) > ord( B[j] ):
                AP += 3
                break
            elif ord( B[j] ) > ord( A[j] ):
                BP += 3
                break
            else:
                pass
print( AP,BP, sep=' ')


Measured memory_bytes: 5596
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

double dp[3000][3000];

int main() {
  clr(dp,0);
  ll n;
  cin>>n;
  double d0;
  cin>>d0;
  dp[0][1] = d0;
  dp[0][0] = 1.-d0;
  rep(i,1,n){
    double d;
    cin>>d;
    rep(j,0,3000){
      dp[i][j+1] += dp[i-1][j]*d;
      dp[i][j] += dp[i-1][j]*(1.-d);
    }
  }
  double ans = 0.;
  rep(i,0,n+1){
    ll a = i;
    ll b = n-i;
    if(a>b){
      ans += dp[n-1][a];
    }
  }
  printf("%20.20f\n",ans);
	return 0;
}

Measured memory_bytes: 70656
#include <stdio.h>

int main()
{
  int A,B,M;
  scanf("%d%d%d",&A,&B,&M);
  int a[A];
  int b[B];
  int x[M],y[M],c[M];
  int i;
  int minA;
  int minB;
  i = 0;
  while (i < A)
  {
    scanf("%d",&a[i]);
    //Aの最小値検索
    if (i == 0)
      minA = a[i];
    else if (minA > a[i])
        minA = a[i];
    i++;
  }
  i = 0;
  while (i < B)
  {
    scanf("%d",&b[i]);
    //Bの最小値検索
    if (i == 0)
      minB = b[i];
    else if (minB > b[i])
      minB = b[i];
    i++;
  }
  int minM;
  i = 0;
  while (i < M)
  {
    scanf("%d%d%d",&x[i],&y[i],&c[i]);
    //printf("x:%d y:%d c:%d\n",x[i],y[i],c[i]);
    if (i == 0)
    {
      //printf("a:%d b:%d c:%d\n",a[x[i] - 1],b[y[i] - 1],c[i]);
      minM = a[x[i] - 1] + b[y[i] - 1] - c[i];
      //printf("minM:%d\n",minM);
    }
    else if (minM > a[x[i] - 1] + b[y[i] - 1] - c[i])
    {
      //printf("else if");
      //printf("a:%d b:%d c:%d\n",a[x[i] - 1],b[y[i] - 1], c[i]);
      minM = a[x[i] - 1] + b[y[i] - 1] - c[i];
      //printf("minM:%d\n",minM);
    }
    i++;
  }
  //printf("A+B:%d M:%d\n",minA + minB, minM);
  if (minA + minB > minM)
    printf("%d",minM);
  else
    printf("%d",minA + minB);
}

Measured memory_bytes: 2176
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		StringBuilder a = new StringBuilder(in.next());
		StringBuilder b = new StringBuilder(in.next());
		int num = new Integer(a.append(b).toString());
		int sn = (int)Math.sqrt(num);
		if(sn * sn == num)
			System.out.println("Yes");
		else
			System.out.println("No");
	}

}


Measured memory_bytes: 21716
#include <stdio.h>
#include <algorithm>

using namespace std;

struct Info{
	Info(){m_node = m_distance = 0;}
	Info(int node,int distance){
		m_node = node;
		m_distance = distance;
	}
	int m_node,m_distance;
};

class InfoQueue{
public:
	InfoQueue(){
		info = new Info[10000];
		num_of_data = head = tail = 0;
	}
	bool isEmpty(){
		return num_of_data == 0;
	}
	void enqueue(Info data){
		info[tail] = data;
		tail = (tail+1)%10000;
		num_of_data++;
	}
	Info dequeue(){
		Info ret = info[head];
		head = (head+1)%10000;
		num_of_data--;
		return ret;
	}
private:
	Info* info;
	int head,tail,num_of_data;
};


int main(){

	int n,row,col,num;
	scanf("%d",&n);

	int table[n+1][n+1];
	int check_table[n+1];

	for(int i=1;i<=n;i++){
		check_table[i] = -1;
		for(int k=1;k<=n;k++)table[i][k] = 0;
	}

	for(int i=1;i<=n;i++){
		scanf("%d %d",&row,&num);
		for(int k=1;k<=num;k++){
			scanf("%d",&col);
			table[row][col]=1;
		}
	}

	check_table[1] = 0;

	InfoQueue Q;
	Q.enqueue(Info(1,0));

	Info tmp;
	while(!Q.isEmpty()){
		tmp = Q.dequeue();
		for(int i=1;i<=n;i++){
			if(table[tmp.m_node][i]==1 && check_table[i] == -1){
				check_table[i] = tmp.m_distance+1;
				Q.enqueue(Info(i,tmp.m_distance+1));
			}
		}
	}

	for(int i=1;i<=n;i++){
		printf("%d %d\n",i,check_table[i]);
	}

    return 0;
}

Measured memory_bytes: 2828
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
    int N;
    cin >> N;    
    long A[100005];
    long B[100005];

    for(int j = 0; j <= N; j++){
        cin >> A[j];
    }
    for(int k = 0; k < N; k++){
        cin >> B[k];
    }
    long ans = 0;
    
    for(int i = 0; i < N; i++){
        long Min;
        Min = min(A[i], B[i]);
        ans += Min;
        A[i] -= Min;
        B[i] -= Min;
        long right;
        right = min(A[i+1], B[i]);
        ans += right;
        A[i+1] -= right;
        B[i]   -= right;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,b; cin >>a >>b;
  string s; cin >>s;
  bool ans = true;
  for (int i=0; i<a; i++){
    if (s.at(i) == '-' || !ans){
      ans = false;
      break;
    }
  }
  if (s.at(a) != '-') ans = false;
  for (int i=a+1; i<a+b+1; i++){
    if (s.at(i) == '-' || !ans){
      ans = false;
      break;
    }
  }
  
  if (ans) cout <<"Yes";
  else cout <<"No";
  cout <<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <numeric>
#include <queue>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <map>
#include <functional>
#include <limits>
#include <set>
#define rep(i,a,b) for((i)=a;i<(int)(b);i++)
#define max(a,b) (a < b ? b : a)
#define min(a,b) (a > b ? b : a)
#define AAA (1000000007)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;


int main() {
	int N;
	vector<ll> A;
	cin >> N;
	int i, j, k;
	rep(i, 0, 3 * N) {
		ll a;
		cin >> a;
		A.push_back(a);
	}
	sort(A.begin(), A.end());
	ll sum = 0;
	for (i = 0; i <N; ++i) {
		j = 3 * N - 2*i-2;
		sum += A[j];


	}
	cout << sum;
	return 0;
}


Measured memory_bytes: 5872
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main(){
  ll x,y,a,b,c;
  cin>>x>>y>>a>>b>>c;
  priority_queue<ll> p;
  priority_queue<ll> q;
  priority_queue<ll> r;
  
  rep(i,a){
    ll x; cin>>x; p.push(x);
  }
  rep(i,b){
    ll x; cin>>x; q.push(x);
  }
  rep(i,c){
    ll x; cin>>x; r.push(x);
  }
  
  
  rep(i,x){
    r.push(p.top()); p.pop();
  }
  rep(i,y){
    r.push(q.top()); q.pop();
  }
  ll ans = 0;
  rep(i,x+y){
    ans += r.top(); r.pop();
  }
  cout << ans << endl;
}

Measured memory_bytes: 7664
#include <iostream>
#include<bits/stdc++.h>
#define MAX 3001
#define ll long long

using namespace std;

ll findit(ll arr[],int i,int j,ll dp[MAX][MAX])
{
    
   // pair<int,int> current=make_pair(i,j);
    
    if(dp[i][j]!=-1)
    {
        return dp[i][j];
    }
    
    
    if(i==j)
    {
        return arr[i];
    }
    
    if(j==i+1)
    {
      return max(arr[i],arr[j]);
    }
    
    ll way1=arr[i]+min( findit(arr,i+2,j,dp) ,findit(arr,i+1,j-1,dp)   );
    ll way2=arr[j]+min(findit(arr,i,j-2,dp) ,findit(arr,i+1,j-1,dp));
    
    
   dp[i][j]=max(way1,way2);
   return dp[i][j];
}


int main() 
{
  int n;
  cin>>n;
  ll arr[n];
 // map< pair<int,int> ,ll> v;
 ll dp[MAX][MAX];
 for(int i=0;i<MAX;i++)
 {
     for(int j=0;j<MAX;j++)
     {
         dp[i][j]=-1;
     }
 }
  ll total=0;
  for(int i=0;i<n;i++)
  {
      cin>>arr[i];
      total=total+arr[i];
  }
  
  ll maxxget=findit(arr,0,n-1,dp);
  ll yget=total-maxxget;
  
  cout<<maxxget-yget;
  


	return 0;
}


Measured memory_bytes: 70784
#include <bits/stdc++.h>

using namespace std;

#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x)                                                                        \
	sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<(c i) \
	{
sim > struct rge
{
	c b, e;
};
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c *x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug
{
#ifdef LOCAL
	~debug()
	{
		cerr << endl;
	}
	eni(!=) cerr << boolalpha << i;
	ris;
} eni(==) ris << range(begin(i), end(i));
}
sim, class b dor(pair<b, c> d)
{
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d)
{
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
	sim dor(const c &)
	{
		ris;
	}
#endif
}
;
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define forn(i, n) for (ll i = 0; i < int(n); i++)
#define rfor(n, i) for (ll i = (n - 1); i >= 0; --i)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define M_PI 3.14159265358979323846
#define EPS 1e-7

int cnt = 0;


void solve()
{
	int n; cin >> n;
	vector<ll> a(3*n);
	forn(i, 3 * n)
	{
		cin >> a[i];
	}
	sort(rall(a));
	ll res = 0;
	for (int i = 0; i < n; ++i)
	{
		res += a[2 * i + 1];
	}
	cout << res;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	solve();
}



Measured memory_bytes: 5508
const main = (input) => {
  let [a, b] = input.trim().split(' ')

  a = BigInt(a)
  b = BigInt(Number(b.split('.').join('')))

  return console.log(String((a * b) / 100n).split('n').join(''))
}

process.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))

Measured memory_bytes: 29572
N, M = map(int, input().split())

class UnionFind:
    def __init__(self, n):
        self.n = n
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    def root(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.root(self.par[x])
            return self.par[x]

    def unite(self, u, v):
        ru = self.root(u)
        rv = self.root(v)
        if self.rank[ru] < self.rank[rv]:
            self.par[ru] = rv
        else:
            self.par[rv] = ru
            if self.rank[ru] == self.rank[rv]:
                self.rank[ru] += 1

    def same(self, u, v):
        return self.root(u) == self.root(v)

    def num(self):
        mem = set()
        for i in range(1, self.n+1):
            if not self.root(i) in mem:
                mem.add(self.root(i))
        return len(mem)

u = UnionFind(N)

for i in range(M):
    x, y, z = map(int, input().split())
    u.unite(x,y)

print(u.num())

Measured memory_bytes: 16784
#include<bits/stdc++.h>
using namespace std;
long long a[200005],sum[200005],b[200005];
map<long long,long long> m;
int main(){
    long long n,k,ans=0;
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        sum[i]=sum[i-1]+a[i];
    }
    m[0]=1;
    for(int i=1;i<=n;i++){
        b[i]=(sum[i]-i)%k;
        if(i-k>=0) m[b[i-k]]--;
        ans+=m[b[i]];
        m[b[i]]++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 17408
#include <bits/stdc++.h>
using namespace std;

void solve(long long N, std::vector<long long> A)
{
    vector<long long> B(N + 1, 0);
    for (size_t i = 1; i <= N; i++)
    {
        B[A[i]] = i;
    }

    // for (size_t i = 1; i <= N; i++)
    // {
    //     cout << B[i] << (i == N ? "\n" : " ");
    // }
    // cout << flush;
    for (size_t i = 1; i <= N - 1; i++)
    {
        cout << B[i] << " ";
    }
    cout << B[N] << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> A(N + 1);
    for (int i = 1; i <= N; i++)
    {
        scanf("%lld", &A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 2432
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_C&lang=ja
//Knapsack Problem
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}
int main() {
#if LOCAL&01
    std::ifstream in("./test/sample-1.in");
    //std::ifstream in("./input.txt");
    std::cin.rdbuf(in.rdbuf());
#else
    cin.tie(0);
    ios::sync_with_stdio(false);
#endif
    ll N,W; cin>>N>>W;
    struct info {
        info(){}
        void set(ll iv,ll iw){
            v=iv, w=iw;
            vpw=(float)v/(float)w;
        }
        ll v=0,w=0;
        float vpw=0;
    };
    vector<info> vwn(N);
    for(auto&& vw:vwn){
        ll v,w; cin>>v>>w;
        vw.set(v,w);
    }

    vector<vector<ll>> dp(N+1,vector<ll>(W+1)); //数,weight
    FOR(i,0,N){
        FOR(w,0,W+1){
#if 01
            const auto& vw=vwn.at(i);
            dp[i+1][w]=max(dp[i+1][w],dp[i][w]);
            if(w-vw.w>=0) {
                dp[i+1][w]=max(dp[i+1][w], dp[i][w-vw.w]+vw.v); //いれる
                dp[i+1][w]=max(dp[i+1][w], dp[i+1][w-vw.w]+vw.v); //重複をゆるす
            }
#else
            const auto& vw=vwn.at(i);
            dp[i+1][w]=dp[i][w];
            auto num = w / vw.w;
            REP(n,num+1){
                dp[i+1][w]=max(dp[i+1][w], dp[i][w-vw.w*n]+vw.v*n); //いれる
            }
#endif
        }
    }
    ll ans=dp[N][W];
    // FOR(w,0,W+1){
    //     ans=max(ans,dp[N][w]);
    // }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 10800
#include <stdio.h>
#include <math.h>

int main(void)
{
    int i = 0;
    int dogs, monkeys;
    unsigned long long ans = 1;
    int now = 0;
    int flag = 0;

    scanf("%d %d", &dogs, &monkeys);

    if(dogs == monkeys){
        flag = 1;
        now = 0;
    }else if(dogs == monkeys+1){
        now = 0;
    } else if(dogs+1 == monkeys){
        now = 1;
    } else {
        printf("0\n");
        return 0;
    }

    i = pow(10, 9) + 7;
    while(dogs > 1 || monkeys > 1){
        if(now == 1){
            ans *= dogs;
            dogs--;
            now = 0;
        } else if(now == 0){
            ans *= monkeys;
            monkeys--;
            now = 1;
        }
        ans = ans % i;
    }

    if(flag == 1){
        ans *= 2;
        ans = ans % i;
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 128
//Zory-2020
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
#define DD 1
#else
#define DD 0
#endif
#define Debug if(DD) printf("line %d\n",__LINE__)
#define deb(x) if(DD) cerr<<#x<<'='<<x<<endl
#define debug if(DD) printf
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void gg1(){write2(-1);exit(0);}
	void gg2(){puts("NO");exit(0);}
	
	const double eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=1e9+7;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int N=2e6+10;
	
	
	void main()
	{
		map<string,int> mp;
		int n=qread();while(n--) { string str;cin>>str;mp[str]++; }
		int mx=0;for(auto t:mp) chmax(mx,t.SE);
		for(auto t:mp) if(t.SE==mx) cout<<t.FR<<endl;
	}
};//变量重名！
signed main()
{
	#ifdef DEBUG
	//freopen("a.in","r",stdin);
	freopen("z.txt","r",stdin);
	#endif
	srand(time(0));
	mine::main();
	if(DD) cerr<<"Time: " <<1.0*clock()/CLOCKS_PER_SEC<<"s";
}

Measured memory_bytes: 25216
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    int h,w; cin >> h >> w;
    vector<string> s(h+2);
    for (int i = 1; i <= h; i++) {
        string a; cin >> a;
        a = '.' + a + 'a';
        s[i] = a;
    }
    vector<vector<int>> cnt(h+2);
    rep(i,h+2) cnt[i].resize(w+2);
    for (int i = 1; i <= h; i++)
    {
        for (int j = 1; j <= w; j++)
        {
            if (s[i][j] == '#')
            {
                if (i == 1 && j == 1) {
                    cnt[i][j+1]++;
                    cnt[i+1][j]++;
                    cnt[i+1][j+1]++;
                    continue;
                }
                if (i == 1 && j == w) {
                    cnt[i][j-1]++;
                    cnt[i+1][j-1]++;
                    cnt[i+1][j]++;
                    continue;
                }
                if (i == h && j == 1) {
                    cnt[i-1][j]++;
                    cnt[i-1][j+1]++;
                    cnt[i][j+1]++;
                    continue;
                }
                if (i == h && j == w) {
                    cnt[i-1][j-1]++;
                    cnt[i-1][j]++;
                    cnt[i][j-1]++;
                    continue;
                }
                if (i == 1) {
                    cnt[i][j-1]++;
                    cnt[i][j+1]++;
                    cnt[i+1][j-1]++;
                    cnt[i+1][j]++;
                    cnt[i+1][j+1]++;
                    continue;
                }
                if (i == h) {
                    cnt[i-1][j-1]++;
                    cnt[i-1][j]++;
                    cnt[i-1][j+1]++;
                    cnt[i][j-1]++;
                    cnt[i][j+1]++;
                    continue;
                }
                if (j == 1) {
                    cnt[i-1][j]++;
                    cnt[i-1][j+1]++;
                    cnt[i][j+1]++;
                    cnt[i+1][j]++;
                    cnt[i+1][j+1]++;
                    continue;
                }
                if (j == w) {
                    cnt[i-1][j-1]++;
                    cnt[i-1][j]++;
                    cnt[i][j-1]++;
                    cnt[i+1][j-1]++;
                    cnt[i+1][j]++;
                    continue;
                }    
                cnt[i-1][j-1]++;
                cnt[i-1][j]++;
                cnt[i-1][j+1]++;
                cnt[i][j-1]++;
                cnt[i][j+1]++;
                cnt[i+1][j-1]++;
                cnt[i+1][j]++;
                cnt[i+1][j+1]++;
            }
        }
    }
    for (int i = 1; i <= h; i++ ) {
        for (int j = 1; j <= w; j++) {
            if (s[i][j] == '.')
            {
                cout << cnt[i][j];
            } else {
                cout << '#';
            }
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int n, l, i, ans = 0, flg = 0;
    scanf("%d %d", &n, &l);

    if (l > 0) {
        for (i = 1; i < n; i++) {
            ans += l + i;
        }

        printf("%d\n", ans);
    } else {
        for (i = 0; i < n; i++) {
            if (i == -l) {
                flg = 1;
            } else {
                ans += i + l;
            }
        }
        if (flg == 0) {
            ans -= l + i - 1;
        }

        printf("%d\n", ans);
    }

    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m,c;
  cin>>n>>m>>c;
  vector<int> b(m);
  for(int i=0;i<m;i++){
    cin>>b[i];
  }
  vector<vector<int>> a(n,vector<int>(m));
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      cin>>a[i][j];
    }
  }
  int ans=0;
  for(int i=0;i<n;i++){
    int hh=c;
    for(int j=0;j<m;j++){
      hh+=a[i][j]*b[j];
    }
    if(hh>0) ans++;
  }
  cout<<ans<<endl;
}
      

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0; i<(n); ++i)
#define REP(i, d, n) for(long long i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {//言語変えろ言語変えろ言語変えろ言語変えろ言語変えろ

int a,b,c,d;
  cin>>a>>b>>c>>d;
  if(a>=d){cout<<d<<endl;}
  else if(a+b>=d){cout<<a<<endl;}
  else{int m=0;
       m=d-a-b;
       cout<<a-m<<endl;    
  }
}


Measured memory_bytes: 3596
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
using namespace std;

/**
 * vector<int>ar(3);
 * for(auto&e:ar){
 *     scanf("%d",&e);
 * }
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 ***/

int main(){
    int n;
    scanf("%d",&n);
    int a[n];
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    for(int i=1;i<=n;i++){
        for(int p=0;p<n-1;p++){
            printf("%d ",a[p]);
        }
        printf("%d\n",a[n-1]);
        int v=a[i];
        int j=i-1;
        while(j>=0 && a[j]>v){
            a[j+1]=a[j];
            j--;
        }
        a[j+1]=v;
    }
    return 0;
}

Measured memory_bytes: 1172
N = int(input())
S = input()
S1 = ''
S2 = ''
if N%2==1:
    print('No')
else:
    for i in range(N//2):
        S1 += S[i]
    for j in range(N//2,N):
        S2 += S[j]
    if S1==S2:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 3060
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;

int main() {
    ll n;
    std::cin >> n;
    map<string,ll> m;
    ll mv = 0;
    for (int i = 0; i < n; i++) {
        string t;
        std::cin >> t;
        m[t]++;
        mv = max(mv,m[t]);
    }
    vector<string> ans;
    for (auto e : m) {
        if(e.second==mv){
            ans.push_back(e.first);
        }
    }
    sort(ans.begin(),ans.end());
    
    for (auto e : ans) {
        std::cout << e << std::endl;
    }
}


Measured memory_bytes: 26868
n,k=map(int,input().split())
v=list(map(int,input().split()))

result=0

for a in range(min(n,k)+1):
    for b in range(min(n,k)+1-a):
        tmp=v[:a]+v[n-b:]
        tmp.sort()

        lost=k-a-b

        ttt=[]
        cnt=0
        for item in tmp:
            if item<0 and cnt<lost:
                ttt.append(item)
                cnt+=1
            else:
                break
        result=max(result,sum(tmp)-sum(ttt))

print(result)



Measured memory_bytes: 41320
#include<bits/stdc++.h>   
#define ll long long
#define sz size
#define pb push_back
#define x first
#define y second
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define int long long    
#define rc(s) return cout<<s,0
using namespace std;

int n;
pair<int,pair<int,int>>q[1005];

signed main(){ 
    ios_base::sync_with_stdio(0);  cin.tie(); cout.tie();
    cin >> n;
    for(int i=1;i<=n;i++){
        cin >> q[i].y.x >> q[i].y.y >> q[i].x;
    }
    sort(q+1,q+n+1);
    if(q[n].x==0){
        cout<<'98'<<' '<<'2'<<' '<<'1';
        return 0;
        
        
        
        
        
    }
    for(int i=0;i<=100;i++){
        for(int j=0;j<=100;j++){
            int r=q[n].x+abs(i-q[n].y.x)+abs(j-q[n].y.y);
            for(int d=1;d<=n;d++){
                if(q[d].x==0){
                    if(r-abs(i-q[d].y.x)-abs(j-q[d].y.y)>=1) break;
                }
                 int t=q[d].x+abs(i-q[d].y.x)+abs(j-q[d].y.y);
                 if(r!=t && q[d].x!=0) break;
                 if(d==n){cout<<i<<' '<<j<<' '<<r; return 0;} 
            }
        }
    }
}


Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
 
int main() {
    ll N, K; cin >> N >> K;
    vector<ll> H(N);
    for(int i=0; i<N; i++) cin >> H[i];

    ll ans = 0;
    sort(H.rbegin(), H.rend());
    for(int i=0; i<N; i++) {
        if(i < K) ans += 0;
        else ans += H[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    string s;
    cin>>s;
    int l=s.length();
    if(s[a]!='-')
    {
        cout<<"No"<<endl;
        return 0;
    }
    for(int i=0;i<l;i++)
    {
        if(i!=a)
        {
            if(s[i]<'0' || s[i]>'9')
            {
                cout<<"No"<<endl;
                return 0;

            }
        }
    }

    cout<<"Yes"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn=1e7+10;
const long long inf=1e18;
int n,m,s,t,ti[52][52],c[52],d[52];
struct da{int x,s;}q[maxn];
long long dis[52][51*100],co[52][52];
bool f[52][51*100];
int main()
{
	scanf("%d%d%d",&n,&m,&s);
	for (int i=1;i<=n;i++)
	 for (int j=1;j<=n;j++) co[i][j]=inf;
	for (int i=1;i<=m;i++)
	{
		int x,y,cc,tt; scanf("%d%d%d%d",&x,&y,&cc,&tt);
		co[x][y]=co[y][x]=cc; ti[x][y]=ti[y][x]=tt;
	}
	for (int i=1;i<=n;i++) scanf("%d%d",&c[i],&d[i]);
	t=50*m+1; int l=1,r=0;
	for (int i=1;i<=n;i++)
	 for (int j=0;j<=(t);j++) dis[i][j]=inf;
	dis[1][min(s,t)]=0; q[++r]={1,min(s,t)}; f[1][min(s,t)]=1;
	while (l<=r)
	{
		da now=q[l++]; f[now.x][now.s]=0;
		if (now.s<t && dis[now.x][min(now.s+c[now.x],t)]>dis[now.x][now.s]+d[now.x])
		{
			dis[now.x][min(now.s+c[now.x],t)]=dis[now.x][now.s]+d[now.x];
			if (!f[now.x][min(now.s+c[now.x],t)]) q[++r]={now.x,min(now.s+c[now.x],t)},f[now.x][min(now.s+c[now.x],t)]=1;
		}
		for (int i=1;i<=n;i++)
		if (i!=now.x && co[now.x][i]!=inf)
		{
			if (now.s>=co[now.x][i] && dis[i][now.s-co[now.x][i]]>dis[now.x][now.s]+ti[now.x][i])
			{
				dis[i][now.s-co[now.x][i]]=dis[now.x][now.s]+ti[now.x][i];
				if (!f[i][now.s-co[now.x][i]]) q[++r]={i,now.s-(int)co[now.x][i]},f[i][now.s-co[now.x][i]]=1;
			}
		}
	}
	for (int i=2;i<=n;i++)
	{
		long long ans=inf;
		for (int j=0;j<=t;j++) ans=min(ans,dis[i][j]);
		printf("%lld\n",ans);
	}
return 0;	
}

Measured memory_bytes: 35592
#include<iostream>

int function(int x){
	int f = x*x;
	return f;
}

int main(){
	int d;
	
	while(std::cin >> d){
		double n = 600/d;
		int S = 0;
		
		for(int i=1; i<n ; ++i){
			S += function(i*d) * d;
		}
		
		std::cout << S << std::endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <climits>

#define mod 1000000007

using namespace std;
using ll = long long;

void solve(){
    string s, t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    reverse(t.begin(), t.end());
    if(s < t){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

int main(){
    solve();
    return 0;
}



Measured memory_bytes: 256
a = b = c = d = 0
[a,b,c,d] = list(map(int,list((input()))))
for i in range(8):
    bin_padded = bin(i)[2:].zfill(3)
    temp = list(bin_padded)
    op = [-1,-1,-1]
    for j in range(3):
        if temp[j] == '1':
            op[j] = 1
    if (a + op[0] * b + op[1] * c +  op[2] * d) == 7:
        opch = ['-', '-', '-']
        for k in range(3):
            if op[k] == 1:
                opch[k] = '+'
        ans = str(a)+opch[0]+str(b)+opch[1]+str(c)+opch[2]+str(d)+'=7'
        print(ans)
        exit()



Measured memory_bytes: 3064
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,M=map(int,input().split())
    X=list(map(int,input().split()))
    X.sort()
    dif=[0]*(M-1)
    for i in range(M-1):
        dif[i]=X[i+1]-X[i]
    dif.sort(reverse=True)
    ans=sum(dif[N-1:])
    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 52776
let readIntArray _ =
    stdin.ReadLine().Split(" ") |> Array.map int

let choice ok ng bool = if bool then ok else ng

stdin.ReadLine()
|> readIntArray
|> Array.fold (fun (ok, before) current ->
    if not ok then (ok, current)
    elif before <= current then (true, current)
    elif before - 1 <= current then (true, current + 1)
    else (false, current)) (true, 0)
|> fst
|> choice "Yes" "No"
|> printfn "%s"


Measured memory_bytes: 43924
# https://atcoder.jp/contests/abc063/tasks/arc075_a
# C - Bugged

n = int(input().split()[0])
s_list = []

for _ in range(n):
    s_list.append(int(input().split()[0]))

total = sum(s_list)
if total % 10 == 0:
    work_list = [s for s in s_list if s % 10 != 0]
    if work_list:
        total -= min(work_list)
    else:
        total = 0

print(total)


Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include  <iostream>
#include  <algorithm>
#include  <climits>
#include  <vector>
#include  <string>
#include  <cstring>
#include  <stack>
#include  <queue>
#include  <cmath>
#include  <iomanip>
#include  <set>
#include  <map>
#include  <new>
#include <cstdint>
#include <cctype>
#include  <cstdio>
#include  <sstream>
#include  <bitset>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define lrep(i,n,m)  for(int i = n; i < m; i++)

using ll = long long;
using ld = long double;
using Vii = vector<vector<int> >;
using Gjudge = vector<vector<bool>>;
using Vi = vector<int>;
using Vl = vector<ll>;
using Vd = vector<double>;
using Vld = vector<long double>;
using Vll = vector<vector<ll> >;
using Vldd = vector<vector<ld> >;
using Vs = vector<string>;
using Vb = vector<bool>;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Pli = pair<ll, int>;
using VPi = vector<Pi>;
using VPl = vector<Pl>;
using VPli = vector<Pli>;
using Ti = tuple<int, int, int>;
using Tl = tuple<ll, ll, ll>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int Mod = static_cast<int>(1e9 + 7);
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };


int main()
{
	int x;
	cin >> x;
	if (x <= 599) {
		cout << 8 << endl;
	}
	else if (x <= 799) {
		cout << 7 << endl;
	}
	else if (x <= 999) {
		cout << 6 << endl;
	}
	else if (x <= 1199) {
		cout << 5 << endl;
	}
	else if (x <= 1399) {
		cout << 4 << endl;
	}
	else if (x <= 1599) {
		cout << 3 << endl;
	}
	else if (x <= 1799) {
		cout << 2 << endl;
	}
	else{
		cout << 1 << endl;
	}
}


Measured memory_bytes: 3632
// Problem : D - Not Divisible
// Contest : AtCoder - AtCoder Beginner Contest 170
// URL : https://atcoder.jp/contests/abc170/tasks/abc170_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)


#include<iostream>
#include<vector>
#include <algorithm>
using namespace std;

int main(){
	int n;
	cin>>n;
	std::vector<int> a(n);
	for(int i=0; i<n; i++)cin>>a[i];
	
	std::sort(a.begin(), a.end());
	int aMax=a[n-1];
	std::vector<bool> dp(aMax+1);
	for(int i=0; i<aMax+1; i++)dp[i]=true;
	//cout<<"max:"<<aMax<<'\n';	
	
	int ans=0;
	for(int i=0; i<n; i++){
		int p = a[i];
		//std::cout<<"p:"<<std::endl;
		//for(auto z:dp){
		//	std::cout<<z<<" ";
		//}
		//std::cout<<std::endl;
		if(dp[p]){
			for(int j=0;j<aMax/p+1;j++){
				dp[p*j]=false;
			}
			if(a[i]!=a[i+1]){
				ans++;
			}
		}
	}
	if(dp[aMax])ans++;
	
	cout<<ans<<'\n';	
		
	return 0;
}


Measured memory_bytes: 4288
group = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]

x, y = map(int, input().split())
for i in range(0,2):
    if(group[i].count(x) > 0 and group[i].count(y) > 0):
        print("Yes")
        exit()
print("No")


Measured memory_bytes: 2940
def abc086_c():
    n = int(input())
    t = [0] * (n + 1)
    x = [0] * (n + 1)
    y = [0] * (n + 1)
    for i in range(1, n + 1):
        t[i], x[i], y[i] = map(int, input().split())

    for i in range(n):
        if abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]) > (t[i + 1] - t[i]) or \
                abs(abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i]) - (t[i + 1] - t[i])) % 2 == 1:
            print("No")
            return 0
    print("Yes")


abc086_c()

Measured memory_bytes: 11636
#include<stdio.h>
int C[2000001],B[2000001];
long n;
Counting_Sort(int A[],int k){
  int i,j; 
 for(i=0;i<=k;i++) C[i]=0;
 for(j=1;j<=n;j++) C[A[j]]=C[A[j]]+1;
 for(i=1;i<=k;i++) C[i]=C[i]+C[i-1];
 for(j=n;j>0;j--){
   B[C[A[j]]]=A[j];
   C[A[j]]=C[A[j]]-1;
 }
} 


int main(){
  int A[2000001];
  int i;
  int max=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&A[i]);
    if(max<A[i]) max=A[i];
  }
  
  Counting_Sort(A,max);
  for(i=1;i<=n;i++){
    if(i==n){
      printf("%d",B[i]);
      break;
    }
    printf("%d ",B[i]);
  } 
  printf("\n");
  
  return 0;  
  
}

Measured memory_bytes: 16604
#include <bits/stdc++.h>
using namespace std;


// type {{{
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int,int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
// }}}


// macro {{{
#define rep(i,n) for (ll i=0, i##_len=(n); i<i##_len; ++i)
#define reps(i,n) for (ll i=1, i##_len=(n); i<=i##_len; ++i)
#define FOR(i,a,n) for (ll i=(a), i##_len=(n); i<i##_len; ++i)
#define SZ(x) ((ll)(x).size())
#define all(x) begin(x),end(x)
// }}}


// debug {{{
#define dump(x) cerr<<#x<<" = "<<(x)<<endl
#define debug(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "[";
    rep (i, SZ(v)) {
        if (i) os << ", ";
        os << v[i];
    }
    return os << "]";
}

template<typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "(" << p.first << " " << p.second << ")";
}
// }}}


// chmax, chmin {{{
template<class T>
bool chmax(T& a, const T& b) {
    if (a < b) { a = b; return true; }
    return false;
}
template<class T>
bool chmin(T& a, const T& b) {
    if (b < a) { a = b; return true; }
    return false;
}
// }}}



// constants {{{
#define inf(T) numeric_limits<T>::max()
const ll MOD = 1e9+7;
const ld EPS = 1e-9;
// }}}

struct Cake {
    int w, h;
    Cake() {}
    Cake(int w, int h) : w(w), h(h) {}
    int area() {
        return w * h;
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    for (;;) {
        int N, W, D;
        cin >> N >> W >> D;
        if (W == 0) break;

        vector<Cake> cakes;
        cakes.emplace_back(W, D);

        rep(i, N) {
            int p, s; cin >> p >> s; --p;

            Cake cake = cakes[p];
            cakes.erase(begin(cakes) + p);

            int round = 2 * (cake.h + cake.w);
            s %= round;
            Cake left, right;

            if (s < cake.w) {
                left = {s, cake.h};
                right = {cake.w - s, cake.h};
            } else if (s < cake.w + cake.h) {
                left = {cake.w, s - cake.w};
                right = {cake.w, cake.w + cake.h - s};
            } else if (s < 2 * cake.w + cake.h) {
                left = {s - (cake.w + cake.h), cake.h};
                right = {2 * cake.w + cake.h - s, cake.h};
            } else {
                left = {cake.w, 2 * cake.w + 2 * cake.h - s};
                right = {cake.w, s - (2 * cake.w + cake.h)};
            }

            if (left.area() > right.area()) swap(left, right);
            cakes.push_back(left);
            cakes.push_back(right);

        }

        vi ans;
        for (auto cake : cakes) {
            ans.push_back(cake.area());
        }
        sort(all(ans));
        rep(i, SZ(ans)) {
            if (i) cout << " ";
            cout << ans[i];
        }
        cout << endl;
    }

    return 0;
}



Measured memory_bytes: 3132
using System;

public class Hello
{
    public static void Main()
    {
        string[] a = Console.ReadLine().Trim().Split(' ');
        Array.Sort(a);
        if (a[0] == "1" &&
            a[1] == "4" &&
            a[2] == "7" &&
            a[3] == "9") Console.WriteLine("YES");
        else Console.WriteLine("NO");
    }
}

Measured memory_bytes: 13408
// at_abc142c.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
using namespace std;
const int MAXN = 1e5 + 5;
int main()
{
    int n;cin >> n;
    int arr[MAXN];
    for (int i = 0;i < n;i++) {
        int temp;cin >> temp;
        arr[temp] = i + 1;
    }
    for (int i = 1; i<= n;i++) {
        cout << arr[i] << " ";
    }
    cout << "\n";
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file


Measured memory_bytes: 1152