akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
    int N;
    vector<int> A;
    cin >> N;
    int tmp;
    for (int i = 0; i < N; i++){
        cin >> tmp;
        A.push_back(tmp);
    }

    int min = *min_element(A.begin(), A.end());
    int max = *max_element(A.begin(), A.end());

    cout << max - min << endl;
}


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

using namespace std;

int main() {
  int N;
  cin >> N;
  set<int> s;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    s.insert(a);
  }
  if ((int)s.size() == N) puts("YES");
  else puts("NO");
  return 0;
}



Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,s,n) for(int i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll a, b, k;
  cin >> a >> b >> k;
  
  int ans = 0;
  for(int i = max(a, b); i >= 1; i--) {
    if (a % i == 0 and b % i == 0)
      k--;
    if(k == 0) {
      ans = i;
      break;
    }
  }
  
  cout << ans << "\n";

}


Measured memory_bytes: 256
#include <stdio.h>

#define M 10000

int main(void){
  int n,q,i,j,S[M],T,res = 0;
  scanf("%d",&n);
  for(i = 0 ; i < n ; i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i = 0 ; i < q ; i++){
    scanf("%d",&T);
    for(j = 0 ; j < n ; j++){
      if(T == S[j]){
        ++res;
        break;
      }
    }
  }
  printf("%d\n",res);
  return 0;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int n, v, u, p[200005], e[2], m[2][200005], mi;
vector<int> G[200005];

void dfs(int u, int p, int d){
	m[d][e[d]++] = u;
	for(int nx: G[u]) if(nx != p) dfs(nx, u, d^1);
}
int main(){
	scanf("%d", &n);
	rep(i,n-1){
		scanf("%d%d", &v, &u);
		v--; u--;
		G[v].push_back(u);
		G[u].push_back(v);
	}
	dfs(0,0,0);
	mi = e[0] > e[1];
	if(e[mi] <= n/3){
		rep(i,e[mi]) p[m[mi][i]] = (i+1)*3;
		rep(i,e[mi^1]) p[m[mi^1][i]] = (i+e[mi]-n/3 < 0 ? (i+1+e[mi])*3 : (i+e[mi]-n/3) < (n+2)/3 ? (i+e[mi]-n/3)*3 + 1 : (i+e[mi]-n/3-(n+2)/3)*3+2);
	}else{
		rep(i,e[0]) p[m[0][i]] = i<(n+1)/3 ? i*3+2 : (i-(n+1)/3+1)*3;
		rep(i,e[1]) p[m[1][i]] = i<(n+2)/3 ? i*3+1 : (i+e[0]-(n+1)/3-(n+2)/3+1)*3;
	}
	rep(i,n) printf("%d%c", p[i], i==n-1 ? '\n' : ' ');
}

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

int main(){
  int N;
  cin >> N;
  
  string color;
  for(int i=0;i<N;i++){
    cin >> color;
    if(color=="Y"){
      cout << "Four" << endl;
      color="end";
      break;
    }
  }
  if(color!="end"){
    cout << "Three" << endl;
  }
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    System.out.println(A*B);
  }
}


Measured memory_bytes: 35784
#include <bits/stdc++.h>
#define MAXN 300002
#define val first
#define poz second
#define zeros(x) (x&(-x))
std::pair <int,int> v[MAXN+1];
std::map <int,int> mp;
int real[MAXN+1];
int vec[MAXN+1];
struct Data{
   long long sum;
   int cnt;
};
Data aib1[MAXN+1],aib2[MAXN+1];
inline void update1(int poz,int val,int cnt){
    for(int i=poz;i<=MAXN;i+=zeros(i)){
       aib1[i].cnt+=cnt;
       aib1[i].sum+=val;
    }
}
inline void update2(int poz,int val,int cnt){
    for(int i=poz;i>0;i-=zeros(i)){
       aib2[i].cnt+=cnt;
       aib2[i].sum+=val;
    }
}
long long anssum=0;
int anscnt=0;
inline long long query1(int poz){
    anssum=anscnt=0;
    for(int i=poz;i>0;i-=zeros(i)){
      anssum+=aib1[i].sum;
      anscnt+=aib1[i].cnt;
    }
}
inline long long query2(int poz){
    anssum=anscnt=0;
    for(int i=poz;i<=MAXN;i+=zeros(i)){
      anssum+=aib2[i].sum;
      anscnt+=aib2[i].cnt;
    }
}
long long sp1[MAXN+1];
long long sp2[MAXN+1];
int main(){
    FILE*fi,*fout;
    int i,n;
    //fi=fopen("A.in" ,"r");
    //fout=fopen("A.out" ,"w");
    fi=stdin;
    fout=stdout;
    fscanf(fi,"%d" ,&n);
    for(i=1;i<=3*n;i++){
       fscanf(fi,"%d" ,&v[i].val);
       sp1[i]=sp1[i-1]+v[i].val;
       real[i]=v[i].val;
       v[i].poz=i;
    }
    for(i=3*n;i>=1;i--)
       sp2[i]=sp2[i+1]+v[i].val;
    std::sort(v+1,v+3*n+1);
    int val=0;
    for(i=1;i<=3*n;i++){
       if(v[i].val!=v[i-1].val)
          val++;
       vec[v[i].poz]=val;
       mp[val]=v[i].val;
    }
    for(i=1;i<=n;i++)
       update1(vec[i],real[i],1);
    for(i=n+1;i<=3*n;i++)
       update2(vec[i],real[i],1);
    long long ans=-(1LL<<62);
    for(i=n;i<=2*n;i++){
       int sz1,sz2;
       sz1=i-n;
       sz2=(3*n-i)-n;
       int rez=0,pas;
       for(pas=1<<18;pas;pas>>=1){
         if(rez+pas<=MAXN)
            query1(rez+pas);
         if(rez+pas<=MAXN&&anscnt<sz1)
           rez+=pas;
       }
       long long a,b;
       query1(rez);
       a=anssum+1LL*mp[rez+1]*(sz1-anscnt);
       rez=0;
       for(pas=1<<18;pas;pas>>=1){
         if(MAXN>rez+pas)
           query2(MAXN-rez-pas);
         if(MAXN-rez-pas>0&&anscnt<sz2)
           rez+=pas;
       }
       query2(MAXN-rez);
       b=anssum+1LL*mp[MAXN-rez-1]*(sz2-anscnt);
       ans=std::max(ans,sp1[i]-a-(sp2[i+1]-b));
       update1(vec[i+1],real[i+1],1);
       update2(vec[i+1],-real[i+1],-1);
    }
    fprintf(fout,"%lld\n" ,ans);
    //fclose(fi);
    //fclose(fout);
}


Measured memory_bytes: 33024
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fr front()
#define tp top()
typedef long long int ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <pii, int> ppi;
typedef pair <int, pii> pip;
#define iofast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define iofile freopen("input.txt","r",stdin),freopen("output.txt","w",stdout)
const ll LLINF = 1e18;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1);
const int SIZE = 100005;

int N;
int A[SIZE];

int main (){
	
	scanf("%d", &N);
	A[0]=0;
	for(int i=1;i<=N;i++){
		scanf("%d", &A[i]);
	}
	sort(A,A+N+1);
	// for(int i=0;i<=N;i++){
	// 	printf("%d ", A[i]);
	// }
	// printf("\n");
	for(int i=0;i<=N;i++){
		if(i%2==0) A[i]=24-A[i];
		if(A[i]==24) A[i]=0;
		
	}
	// for(int i=0;i<=N;i++){
	// 	printf("%d ", A[i]);
	// }
	// printf("\n");
	sort(A,A+N+1);
	// for(int i=0;i<=N;i++){
	// 	printf("%d ", A[i]);
	// }
	// printf("\n");
	int ans=INF;
	for(int i=1;i<=N;i++){
		ans=min(ans,A[i]-A[i-1]);
	}
	printf("%d\n", ans);
	
	return 0;
}

Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144 * 4LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

void init() {
    iostream::sync_with_stdio(false);
    cout << fixed << setprecision(20);
}


//#define int ll

unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

void solve() {
    string s;
    while (cin >> s) {
        vector<string> inputs;
        inputs.push_back(s);
        REP(i, 7) {
            cin >> s;
            inputs.push_back(s);
        }
        map<string, int> go;
        vector<int> cnter;
        REP(i, 8) {
            go[inputs[i]]++;
        }
        int now = 0;
        for (auto i : go) {
            REP(q, i.second) {
                cnter.push_back(now);
            }
            now++;
        }
        int ans = 0;
        set<vector<int>> trying;
        do {
            if (trying.count(cnter)) continue;
            ans++;
            vector<int> now = cnter;
            queue<vector<int>> next;
            trying.insert(now);
            next.push(now);
            while (next.empty() == false) {
                vector<int> now = next.front();
                next.pop();
                vector<int> tmp = now;
                for (int q = 2; q < 8; ++q) {
                    swap(now[q - 2], now[q]);
                }
                if (trying.count(now) == 0) {
                    trying.insert(now);
                    next.push(now);
                }
                now = tmp;
                tmp[0] = now[1];
                tmp[2] = now[3];
                tmp[6] = now[0];
                tmp[4] = now[2];
                tmp[1] = now[7];
                tmp[3] = now[5];
                tmp[5] = now[4];
                tmp[7] = now[6];
                if (trying.count(tmp) == 0) {
                    trying.insert(tmp);
                    next.push(tmp);
                }
            }
        } while (next_permutation(ALL(cnter)));
        cout << ans << endl;
    }
}

#undef int
int main() {
    init();
    solve();
}



Measured memory_bytes: 7468
def bfs(field,H,W,start_x,start_y,tmp_N):
    direction = [[-1,0],[1,0],[0,-1],[0,1]]
    que = []
    que.append([start_x,start_y])
    INF = 1000000
    min_path = [[INF] * W for i in range(H)]
    min_path[start_y][start_x] = 0
    while len(que) != 0:
        current = que.pop(0)
        for d in direction:
            nx = current[0] + d[0]
            ny = current[1] + d[1]
            if 0 <= nx < W and 0 <= ny < H and field[ny][nx] != "X" and min_path[ny][nx] == INF:
                min_path[ny][nx] = min_path[current[1]][current[0]] + 1
                if field[ny][nx] == tmp_N:
                    return nx,ny,min_path[ny][nx]
                else:
                    que.append([nx,ny])

def getField():
    matrix = []
    first = input().strip()
    H,W,N = map(int,first.split())
    for i in range(H):
        row = list(input().strip())
        for j in range(W):
            if row[j].isdigit():
                row[j] = int(row[j])
        matrix.append(row)
    return matrix,H,W,N

def getStart(field):
    for y in range(len(field)):
        for x in range(len(field[0])):
            if field[y][x] == "S":
                return x,y

def main():
    matrix,H,W,N = getField()
    sx,sy = getStart(matrix)
    distance = 0
    tmp_x,tmp_y,tmp_dist = bfs(matrix,H,W,sx,sy,1)
    distance += tmp_dist
    tmps = [tmp_x,tmp_y]
    for k in range(N-1):
        tmp_x,tmp_y,tmp_dist = bfs(matrix,H,W,tmps[0],tmps[1],k+2)
        distance += tmp_dist
        tmps = [tmp_x,tmp_y]
    print(distance)

if __name__=='__main__':
    main()

Measured memory_bytes: 36996
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans, mid = 0, 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            mid = i*500 + j * 100 + k * 50
            if mid == x:
                ans += 1
print(ans)


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

#define int long long



signed main() {
    int N;
    cin >> N;
    vector<int> d(N);
    for(int i=0; i<N; i++){
        cin >> d[i];
    }
    sort(d.begin(), d.end());
    
    cout<< d[N/2] - d[N/2-1] << endl;
    
    return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		String subT = T.substring(0, T.length() - 1);
		System.out.println(S.equals(subT) ? "Yes" : "No");

		sc.close();
	}
}

Measured memory_bytes: 35512
#include "bits/stdc++.h"
using namespace std;

using ll = long long int;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

#define pi 3.14159265358979323846

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; }




ll cnt_rep = 0;
ll powmod(ll N, ll P, ll M){
  cnt_rep++;
  if(P == 0) return 1;
  if(P%2 == 0){
    ll t = powmod(N, P/2, M);
    return t*t % M;
  }
  return (N * powmod(N, P-1, M)) % M;
}


ll gcd(ll a, ll b){
  ll resi, g, l;
  if(a > b){
    g = a; l = b;
  }else if(b > a){
    g = b; l = a;
  }else{
    return a;
  }
  resi = g % l;
  if(resi != 0){
    return gcd(l, resi);
  }else{
    return l;
  } 
}

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}

int ans = 0;
int N, M, Q;

template<typename T>
void showall(vector<T> v){
  rep(i, 0, v.size()){
    cout << v[i] << " ";
  }
  cout << endl;
}

template<typename T>
ll com(T n, T m, T mod){
  ll a = 1, b = 1, ans;
  if(n == m || m == 0){
    ans = 1;
  }else{
    for(ll i = 0;i < m; i++){
      a *= n-i;
      a %= mod;
      b *= i+1;
      b %= mod;
    }
    ans = (a * powmod(b, mod-2, mod)) % mod;
  }
  
  return ans;
}



 
int main() {
  int A, B;
  cin >> A >> B;

  cout << 6-(A + B) << endl;


  // cout << setprecision(8) << ans << endl;  // For double
}



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

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep2(i,s,n) for(int i = (s); i < (n); ++i)
#define ll long long
#define ld long double
#define P pair<ll,ll>
#define all(v) v.begin(),v.end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

int main(void)
{
    ll k,s,ans=0; cin>>k>>s;
    rep(i,k+1)rep(j,k+1){
        ll z=s-i-j;
        if(0<=z&&z<=k) ++ans;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3580
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;
typedef long long ll;

/*
    AtCoder Beginner Contest 173
    c   H and V

    n行m列

    row（0~(1<<n)-1)二进制数，第i个二进制数 1表示第i行涂红，0表示不涂
    col（0~(1<<m)-1)二进制数，第i个二进制数 1表示第i列涂红，0表示不涂

*/

char ma[10][10];

int main()
{
    int n,m,k;
    cin>>n>>m>>k;
    for(int i=0;i<n;++i)
    {
        for(int j=0;j<m;++j)
            cin>>ma[i][j];
    }
    int ans=0;
    for(int row=0;row<(1<<n);++row)
    {
        for(int col=0;col<(1<<m);++col)
        {
            int cut=0;
            for(int i=0;i<n;++i)
            {
                for(int j=0;j<m;++j)
                {
                    if(!(row&(1<<i))&&!(col&(1<<j))&&ma[i][j]=='#')
                       cut++;
                }
            }
            if(cut==k)
               ans++;
        }
    }
    cout<<ans<<endl;
    return 0;

}




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

int main()
{
    long long n, m, total = 0;
    std::cin >> n >> m;
    for (int i = 0; i < m; i++) { 
        long long a;
        std::cin >> a;
        total += a;
    }

    long long ans = (total <= n) ? n - total : -1;
    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

int main(){
	
	int c[8][8];
	int d[8][8];
	
	for(int i = 0; i < 8; i++){
		for(int j = 0; j < 8; j++){
			c[i][j] = 0;
			d[i][j] = 0;
		}
	}
	
	c[1][2] = 300;
	d[1][2] = 6;
	c[1][3] = 500;
	c[2][3] = 350;
	d[1][3] = 13;
	d[2][3] = 7;
	c[1][4] = 600;
	c[2][4] = 450;
	c[3][4] = 250;
	d[1][4] = 18;
	d[2][4] = 12;
	d[3][4] = 5;
	c[1][5] = 700;
	c[2][5] = 600;
	c[3][5] = 400;
	c[4][5] = 250;
	d[1][5] = 23;
	d[2][5] = 17;
	d[3][5] = 10;
	d[4][5] = 5;
	c[1][6] = 1350;
	c[2][6] = 1150;
	c[3][6] = 1000;
	c[4][6] = 850;
	c[5][6] = 600;
	d[1][6] = 43;
	d[2][6] = 37;
	d[3][6] = 30;
	d[4][6] = 25;
	d[5][6] = 20;
	c[1][7] = 1650;
	c[2][7] = 1500;
	c[3][7] = 1350;
	c[4][7] = 1300;
	c[5][7] = 1150;
	c[6][7] = 500;
	d[1][7] = 58;
	d[2][7] = 52;
	d[3][7] = 45;
	d[4][7] = 40;
	d[5][7] = 35;
	d[6][7] = 15;
	
	for(int i = 0; i < 8; i++){
		for(int j = 0; j < 8; j++){
			c[i][j] /= 50;;
		}
	}
	
	while(true){
		
		int d1, d2;
		int h, m, time;
		
		bool is_half = false;
		bool is_half2 = false;
		
		cin >> d1;
		
		if(d1 == 0){
			break;
		}
		
		cin >> h >> m;
		
		time = h * 60 + m;
		
		if(time >= 17 * 60 + 30 && time <= 19 * 60 + 30){
			is_half = true;
		}
		
		cin >> d2;
		
		cin >> h >> m;
		
		time = h * 60 + m;
		
		if(time >= 17 * 60 + 30 && time <= 19 * 60 + 30){
			is_half = true;
		}
		
		if(d[d1][d2] <= 40){
			is_half2 = true;
		}
		
		int ans = c[d1][d2];
		
		if(is_half && is_half2){
			ans = (ans + 1) / 2;
		}
		
		cout << ans * 50 << endl;
		
	}
	return 0;
}

Measured memory_bytes: 3044
#include <stdio.h>
#include <stdlib.h>

int int_compare(const int* a, const int* b)
{
    if (*a < *b) {
        return 1;
    } else if (*a > *b) {
        return -1;
    }
    return 0;
}

int main(void)
{
    int n;
    scanf("%d", &n);

    int* a = calloc(n, sizeof(int));

    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }

    int* sorted = calloc(n, sizeof(int));

    for (int i = 0; i < n; i++) {
        sorted[i] = a[i];
    }

    qsort(sorted, n, sizeof(int), (int (*)(const void*, const void*))(*int_compare));

    int max = sorted[0];
    int second_max = sorted[1];

    for (int i = 0; i < n; i++) {
        printf("%d\n", (a[i] == max ? second_max : max));
    }
    return 0;
}


Measured memory_bytes: 3120
#pragma GCC optimize("O3")

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define sz size
#define f first
#define s second

pair<ll,ll> arr[51];

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll N;
    cin >> N;
    ll first, second;
    FOR(i,1,N+1)
    {
        cin >> first >> second;
        arr[i] = make_pair(first, second);
    }
    sort(arr+1, arr+N+1);
    pair<ll,ll> diff;
    vector<pair<ll,ll>> l;
    ll count;
    ll minimum = N-1;
    bool free;
    // cout << "N: " << N << endl;
    FOR(i,1,N+1)
    {
        FOR(j,i+1,N+1)
        {
            l.clear();
            count=0;
            diff.f = arr[j].f-arr[i].f;
            diff.s = arr[j].s-arr[i].s;
            // cout << "diff: " << diff.f << ", " << diff.s << endl;
            // Iterating through differences
            FOR(x,1,N+1)
            {
                // cout << "MADE IT HERE..." << endl;
                free = false;
                // cout << "x: " << x << endl;
                F0R(p,l.size())
                {
                    // cout << "l: " << l[p].f << " " << l[p].s << endl;
                    if(arr[x].f-diff.f==l[p].f && arr[x].s-diff.s==l[p].s)
                    {
                        free = true;
                        // cout << "REACHED HERE..." << endl;
                        break;
                    }
                }
                if(!free)
                {
                    count++;
                }
                l.pb(make_pair(arr[x].f,arr[x].s));
            }
            minimum=min(minimum,count);
        }
    }
    if(N==1)
        cout << 1;
    else
        cout << minimum;

    return 0;
}


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

void solve()
{
 
    ll a,b,c;
    cin>>a>>b>>c;
    if(a<=b*c)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int t=1;
  //  cin>>t;
    while(t--)
        solve();
}

Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll mod = 1e9+7;
const int N=2e5+9;
int main()
{
    FASTINOUT;
    int x,y,z;
    cin>>x>>y>>z;
    if (z-y<=0)
        cout<<"delicious\n";
    else if (z-y<=x)
        cout<<"safe\n";
    else
        cout<<"dangerous\n";
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define MAX 1000000
int A[MAX],n;
int partition(int, int);
int main(){
  int i,q;
  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&A[i]);
  q=partition(0,n-1);

  for(i=0;i<n;i++){
    if(i)printf(" ");
    if(i==q)printf("[");
    printf("%d",A[i]);
    if(i==q)printf("]");
  }
  printf("\n");
  return 0;
}

int partition(int p,int r){
  int x=A[r];
  int i=p-1; 
  int t;
  for(int j=p;j<r;j++){
    if(A[j]<=x){
      i++;
      t=A[i];
      A[i]=A[j];
      A[j]=t;
    }
  }
  t=A[i+1];
  A[i+1]=A[r];
  A[r]=t;
  return i+1;
}



Measured memory_bytes: 2120
// 2020-09-27 19:08:16
// clang-format off
#include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
// #include <atcoder/convolution>
// #include <atcoder/dsu>
// #include <atcoder/fenwicktree>
// #include <atcoder/lazysegtree>
// #include <atcoder/math>
// #include <atcoder/maxflow>
// #include <atcoder/mincostflow>
// #include <atcoder/modint>
// #include <atcoder/scc>
// #include <atcoder/segtree>
// #include <atcoder/string>
// #include <atcoder/twosat>
// #include <atcoder/all>
// using namespace atcoder;

// clang-format on
void answer() {
  int x;
  cin >> x;
  cout << (2000 - x + 199) / 200 << '\n';
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

const int mod = 1000000007;
struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if(!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if(t & 1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
mint fact(int n) {
  if(n == 1 || n == 0) return 1;
  mint res = n;
  return res * fact(n - 1);
}

int main() {
  ll n;
  cin >> n;
  vl c(n);
  rep(i, n) cin >> c[i];
  vl last(2e5 + 1, -1);
  vector<P> p;
  rep(i, n) {
    if(last[c[i]] != -1 && last[c[i]] != i - 1) p.push_back({last[c[i]], i});
    last[c[i]] = i;
  }
  sort(all(p));
  ll m = p.size();
  vl over(m, 0);
  rep(i, m) {
    ll l = i;
    ll r = m;
    while(l + 1 < r) {
      ll x = (l + r) / 2;
      if(p[x].first >= p[i].second)
        r = x;
      else
        l = x;
    }
    over[i] = l - i;
  }
  vector<mint> ans(m + 1, 0), sum(m + 1, 0);
  ans[0] = sum[0] = 1;
  for(ll i = m - 1; i >= 0; i--) {
    ll j = m - 1 - i - over[i];
    ans[m - i] = sum[j];
    sum[m - i] = sum[m - i - 1] + ans[m - i];
  }
  mint res = 0;
  rep(i, m + 1) res += ans[i];
  cout << res << endl;
}

Measured memory_bytes: 14228
x, n = map(int,input().split())
p = list(map(int,input().split()))

if n == 0:
    print(x)
    exit()

f = [1]*200
sa = x
ans = 0

for i in p:
    f[i-1] = 0

for i in range(200):
    if f[i] == 1 and sa > abs(i+1-x):
        sa = abs(i+1-x)
        ans = i+1

print(ans)

Measured memory_bytes: 9208
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cctype>
#include <cmath>
#include <functional>
#include <map>
#include <cstdio>
#include <stack>
using namespace std;
typedef long long ll;

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)

int main(){
    map<string,int> mp;
    vector<string> vec;
    string s;
    int k;
    cin >> s;
    cin >> k;

    rep(i,s.length()){
        mp[s.substr(i,1)]++;
    }

    if(s.length() >= 2){
        rep(i,s.length()-1){
            mp[s.substr(i,2)]++;
        }
    }

    if(s.length() >= 3){
        rep(i,s.length()-2){
            mp[s.substr(i,3)]++;
        }
    }
    if(s.length() >= 4){
        rep(i,s.length()-3){
            mp[s.substr(i,4)]++;
        }
    }
    if(s.length() >= 5){
        rep(i,s.length()-4){
            mp[s.substr(i,5)]++;
        }
    }

    for(auto elem : mp){
        vec.push_back(elem.first);
    }

    sort(vec.begin(),vec.end());
    cout << vec[k-1] << endl;
    

    return 0;
}


Measured memory_bytes: 2176
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
			StringBuilder output = new StringBuilder();
			String lb = System.getProperty("line.separator");
			
			int n = Integer.parseInt(input.readLine());
			String[] line1 = input.readLine().split(" ");
			String[] line2 = input.readLine().split(" ");
			int[] dist = new int[n];
			for (int i = 0; i < n; i++) {
				final int x = Integer.parseInt(line1[i]);
				final int y = Integer.parseInt(line2[i]);
				dist[i] = x > y ? x-y : y-x;
			}
			input.close();
			
			output.append(String.valueOf(minkowski(dist, 1))).append(lb)
				.append(String.valueOf(minkowski(dist, 2))).append(lb)
				.append(String.valueOf(minkowski(dist, 3))).append(lb)
				.append(String.valueOf(minkowski(dist, 0))).append(lb);
			
			System.out.print(output);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private static double minkowski(int[] seq, double p) {
		double minkowski;
		if (p == 0) {
			minkowski = seq[0];
			for (int i = 1; i < seq.length; i++) {
				if (minkowski < seq[i]) {
					minkowski = seq[i];
				}
			}
		} else if (p == 1) {
			minkowski = 0;
			for (int i = 0; i < seq.length; i++) {
				minkowski += seq[i];
			}
		} else {
			minkowski = 0;
			for (int i = 0; i < seq.length; i++) {
				minkowski += Math.pow(seq[i], p);
			}
			minkowski = Math.pow(minkowski, 1/p);
		}
		return minkowski;
	}
}

Measured memory_bytes: 17092
// -----------------------------------
// Author     : MatsuTaku
// Country    : Japan
// Created    : 05/02/20 20:07:37
// -----------------------------------

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);

  int n,m,q; cin>>n>>m>>q;
  struct Cond {
    int a,b,c,d;
  };
  vector<Cond> cs(q);
  for (int i = 0; i < q; i++) {
    auto& v=cs[i];
    cin>>v.a>>v.b>>v.c>>v.d;
    v.b--; v.a--;
  }
  int ans = 0;
  vector<int> A(n);
  auto dfs = [&](auto &f, int i) {
    if (i == n) {
      int res = 0;
      for (auto cnd:cs) {
        if (A[cnd.b]-A[cnd.a]==cnd.c)
          res+=cnd.d;
      }
      ans = max(ans, res);
      return;
    }
    for (int t = i>0?A[i-1]:1; t <= m; t++) {
      A[i] = t;
      f(f, i+1);
    }
  };
  dfs(dfs, 0);
  cout << ans << endl;

  return 0;
}


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

typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;

int main(){
  string s;
  cin>>s;
  ll len=s.length();
  ll ans=0;
  for(int mask=0;mask<1<<(len-1);mask++){
    ll num=s[0]-'0';
    for(int i=0;i<len-1;i++){
      if(mask&1<<i){
        ans+=num;
        num=0;
      }
      num=num*10+(s[i+1]-'0');
    }
    ans+=num;
  }
  cout<<ans<<endl;
  return 0;
}

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

int main() {
    int n, k;
    cin >> n >> k;
    int x[100];
    rep(i, n) cin >> x[i];
    int ans = 0;
    
    rep(i, n) {
        ans += min(x[i], abs(k - x[i]));
    }
    
    cout << (ans * 2) << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		String ans[] = {"bust", "win"};
		int an = 0;
		sc.close();
		if(a + b + c < 22)an = 1;
		System.out.println(ans[an]);
	}
}


Measured memory_bytes: 22868
/**************************************
*Coded By: BadduCoder (Sumit Badsara) *
***************************************/
#include<bits/stdc++.h>
using namespace std;

//All the Loops and defines required
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert( B <= A && A <= C)
#define MP make_pair
#define PB push_back
#define ff first
#define ss second
#define _cin ios_base::sync_with_stdio(0);  cin.tie(0); cout.tie(0);
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007

//All the declarations using typedef

typedef long long int ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef map<int,int> MII;
typedef set<int> SETI;
typedef multiset<int> MSETI;
typedef long int l;

int main()
{
    _cin;
    ll n;
    cin>>n;
    ll h[n],ans[n];
    REP(i,n)
        cin>>h[i];
    
    ans[0] = 0;
    ans[1] = abs(h[0]-h[1]);

    FOR(i,2,n,1)
        ans[i] = min(ans[i-1]+abs(h[i]-h[i-1]),ans[i-2]+abs(h[i]-h[i-2]));

    cout<<ans[n-1];

    return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>
#define A 100

main(){
  int length[A];
  int change=0;
  int N;
  int count=0;
  int i,j;
  
  scanf("%d",&N);/*input includes an integer N*/
  
  for(i=1; i<=N; i++){
    scanf("%d",&length[i]);
  }
  
  
  for(i=1; i<=N; i++){
    for(j=N; j>i; j--){
      if(length[j] < length[j-1]){
      change=length[j-1];
      length[j-1]=length[j];
      length[j]=change;
      count++;
      }
    }
  }
  
  for(i=1; i<=N; i++){
    printf("%d",length[i]);
    if(i < N)
      printf(" ");
  }
  printf("\n");
  printf("%d\n",count);
  return 0;
}

Measured memory_bytes: 604
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
const int INF = 2147483647;
const ll MOD = 1000000007;

using namespace std;

int main() {
  int n;
  cin >> n;
  vi a(n);
  REP(i, n) { cin >> a[i]; }
  sort(ALL(a));
  REP(i, n - 1) {
    if (a[i] == a[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

class Main{

	static char[][] map;
	static int H;
	static int W;
	static	int D ;
	static	int G ;
	static	int[] p;
	static	int[] c;
	static int ans = 100000000;

	public static void main(String[] args) {



		Scanner sc = new Scanner(System.in);			//文字の入力
		D = sc.nextInt();
		G = sc.nextInt();
		p = new int[D+1];
		c = new int[D+1];

		for(int i = 1;i < D+1;i++){
			p[i] = sc.nextInt();
			c[i] = sc.nextInt();
		}



		dfs(D-1,p[D],100*D*p[D]+c[D]);
		
		if(G  <= p[D]*(100*D)){				//現在のG-scoreに対し、
			if(G % (100*D) == 0){
				dfs(D-1, (G /(100*D)), G);
			}else{
				dfs(D-1, (G /(100*D))+1, G);

			}

		}
		dfs(D-1,0,0);

		System.out.println(ans);


	}




	static void dfs(int mondai,int sum,int score){			//numは数、mondaiは問題番号,sumは問題をといた数


		if(score >= G){
			
			ans = Math.min(ans, sum);
			return;
		}
		if(mondai < 1){
			return;
		}


		dfs( mondai-1, sum+p[mondai], score+100*mondai*p[mondai]+c[mondai]);

		if((G-score)  <= p[mondai] *(100*mondai) ){				//現在のG-scoreに対し、

			if((G-score) %(100*mondai)== 0){
				dfs(mondai-1, sum+ ((G-score) /(100*mondai)), G);
			}else{
				dfs(mondai-1, sum+ ((G-score) /(100*mondai))+1, G);

			}

		}

		dfs( mondai-1, sum, score);
		return;
	}


}





Measured memory_bytes: 23764
N = input()
a = []
a.append(map(int, raw_input().split()))

a=a[0]

c=[0,0,0,0,0,0,0,0]

free=0

for i in a:
    if 1<=i and i<=399:
        c[0]=1
    elif 400<=i and i<=799:
        c[1]=1
    elif 800<=i and i<=1199:
        c[2]=1
    elif 1200<=i and i<=1599:
        c[3]=1
    elif 1600<=i and i<=1999:
        c[4]=1
    elif 2000<=i and i<=2399:
        c[5]=1
    elif 2400<=i and i<=2799:
        c[6]=1
    elif 2800<=i and i<=3199:
        c[7]=1
    elif 3200<=i:
        free+=1

ma=sum(c)+free



mi=sum(c)
if mi<1:
    mi=1


print(str(mi) + " " + str(ma))

Measured memory_bytes: 2696
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
    ll n; scanf("%lld",&n);
    vector<ll> vc(5);
    rep(i, 5) scanf("%lld",&vc[i]);
    ll mi = vc[0];
    rep(i, 5) mi = min(mi, vc[i]);
    cout << (n+mi-1)/mi + 4;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
string s;
int main()
{
	cin>>s;
	for (int i=0;i<s.length();++i)
	{
		if (s[i]=='C')
		{
			for (int j=i+1;j<s.length();++j)
			{
				if (s[j]=='F')
				{
					cout<<"Yes\n";
					return 0;
				}
			}
		}
	}
	cout<<"No\n";
	return 0;
}

Measured memory_bytes: 256
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<functional>
#include<iomanip>
#include<iostream>
#include<list>
#include<map>
#include<queue>
#include<random>
#include<set>
#include<stack>
#include<string>
#include<utility>
#include<vector>

#define FOR(i,a,b) for(long long i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define FORR(i,a,b) for(long long i=(a);i>=(b);--i)
#define REPR(i,n)   FORR(i,n,0)

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll>pll;

int main() {
	int D;
    cin>>D;
    if(D==25){
        cout<<"Christmas"<<endl;
    }
    else if(D==24){
        cout<<"Christmas Eve"<<endl;
    }
    else if(D==23){
        cout<<"Christmas Eve Eve"<<endl;
    }
    else{
        cout<<"Christmas Eve Eve Eve"<<endl;
    }


	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int a, b, c, d=0;
	scanf("%d %d %d", &a, &b, &c);
	if (a >= b && a >= c) {
		d = b + c;
		if (a == d) {
			printf("Yes");
		}
		else {
			printf("No");
		}
	}
	else if (a >= b && a <= c || a <= b && b <= c) {
		d = a + b;
		if (c == d) {
			printf("Yes");
		}
		else {
			printf("No");
		}
	}
	else if (a <= b && b >= c) {
		d = a + c;
		if (b == d) {
			printf("Yes");
		}
		else {
			printf("No");
		}
	}
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
using namespace std;
using ll = long long;

unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    long long a;
    long long b;
    cin >> a >> b;
    b = min(a-1, b);
    long long ans = 0;
    vector<long long> bik(a+1);
    long long z=1;
    for (int i = 1; i < a + 1; i++) {
        z *= i;
        z %= 1000000007;
        bik.at(i) = z;
    }
    bik.at(0) = 1;
    for (int i = 0; i < b+1; i++) {
        long long y = 1;
            y *= bik.at(a - 1);
            y %= 1000000007;
            y *= modinv(bik.at(a - 1 - i), 1000000007);
            y %= 1000000007;
            y *= modinv(bik.at(i), 1000000007);
            y %= 1000000007;
            y *= bik.at(a);
            y %= 1000000007;
            y *= modinv(bik.at(a - i), 1000000007);
            y %= 1000000007;
            y *= modinv(bik.at(i), 1000000007);
            y %= 1000000007;
        ans += y;
        ans %= 1000000007;
    }
    cout << ans << endl;
}

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

typedef long long ll;
const ll MOD = 1e9+7;
const int N = 1e5+5;

int n,m,a[N],b[N],ind[N];

bool cmp(int &x,int &y){
    return a[x]<a[y];
}

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>n>>m;

    for(int i=1;i<=n;i++){
        cin>>a[i]>>b[i];
        ind[i]=i;
    }

    sort(ind+1,ind+1+n,cmp);

    ll ans=0;
    for(int i=1;i<=n;i++){
        ans+=1LL*a[ind[i]]*min(m,b[ind[i]]);
        m-=min(m,b[ind[i]]);
    }

    cout<<ans;

    return 0;
}


Measured memory_bytes: 1408
#include <iostream>

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	char S[4];
	cin >> S;
	char now = S[0];
	for(int i=1;i<4;i++)
	{
		if(S[i] == now)
		{
			cout << "Bad" << endl;
			return 0;
		}
		else
			now = S[i];
	}
	cout << "Good" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include "stdio.h"

void swap(int *a, int *b){
    int tmp;
    tmp = *a;
    *a = *b;
    *b = tmp;
    return;
}

int main(void){
    int a, b, c, tmp;
    scanf("%d %d %d", &a, &b, &c);
    if (a > b) {
        swap(&a, &b);
    }
    if (b > c) {
        swap(&b, &c);
    }
    if (a > b) {
        swap(&a, &b);
    }
    printf("%d %d %d\n", a, b, c);
    return 0;
}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repr(i, n) for(int i=n; i>=0; i--)
#define reps(i, s, e) for(int i=s; i<e; i++)
#define inf 1e18
#define vsort(v) sort(v.begin(), v.end())
#define vsortr(v) sort(v.begin(), v.end(), greater<ll>())
#define sz(x) x.size()
#define ceil(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T &a, T b){ if(a<b){ a=b; return true; } return false; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a){ a=b; return true; } return false; }
template<typename T> T gcd(T a, T b){ if(b==0) return a; return gcd(b, a%b); }
template<typename T> T lcm(T a, T b){ return a*b/gcd(a, b); }
template<typename T> T vdebug(vector<T> v){ for(auto vv : v){ cout << vv << " "; } cout << endl; }
template<typename T> T adebug(T arr[], int n){ rep(i, n){ cout << arr[i] << " "; } cout << endl; }
void ans(bool b){ if(b) cout << "Yes" << endl; else cout << "No" << endl; }
void ans2(bool b){ if(b) cout << "YES" << endl; else cout << "NO" << endl; }
int keta(ll num){ int k=0; while(num>0){ num/=10; k++; } return k; }
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    ll n, k, tmpx;
    vector<ll> x;
    cin >> n >> k;
    rep(i, n){
        cin >> tmpx;
        x.push_back(tmpx);
    }

    ll l=0, r=k-1;

    ll resmin = inf;
    while(r < x.size()){
        ll tmp = min(abs(x[l]) + abs(x[r] - x[l]), abs(x[r]) + abs(x[r]-x[l]));
        chmin(resmin, tmp);
        r++; l++;
    }

    cout << resmin << endl;

    return 0;
}

Measured memory_bytes: 1400
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
inline int read()
{
    int x=0,t=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-') t=-1,ch=getchar();
	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();
	return x*t;
}
int n,ans;
int k;
int main ()
{
	n=read(),k=read();
	for(int i=1;i<=n;i++)
	{
		int x=read();
		if(x>=k) ans++;
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    long int a,b,k,e=0,o=0;
    cin>>a>>b;
    if(a%2==0)
        e++;
    else
        o++;
    if(b%2==0)
        e++;
    else
        o++;
    if( e==2 || o==2)
    {
        k = abs(a+b)/2;
        cout<<k<<endl;
    }
    else
    {
        cout<<"IMPOSSIBLE"<<endl;
    }
}


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

int main()
{
	ll n, m;
	cin >> n >> m;
	vector<vector<string>> arr(n, vector<string>());
	vector<bool> corr(n, false);
	for (int i = 0; i < m; i++)
	{
		ll a;
		string s;
		cin >> a;
		cin >> s;
		a--;
		arr[a].push_back(s);
		if (s == "AC")
		{
			corr[a] = true;
		}
	}
	ll correct = 0;
	for (auto x : corr)
	{
		correct += x;
	}
	ll pen = 0;
	for (int i = 0; i < n; i++)
	{
		if (!corr[i])
		{
			continue;
		}
		int j = 0;
		while (j < arr[i].size() && arr[i][j] == "WA")
		{
			pen++;
			j++;
		}
	}
	cout << correct << " " << pen << endl;
	return 0;
}

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

void solve(long long N)
{
    cout << ceil(static_cast<double>(N) / 2) << 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);
    solve(N);
    return 0;
}


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

int main(){
	int a,b;
	cin >> a >> b;
	if(a>b){
		cout << -1 << endl;
	}else{
		int f=0;
		for(int i=1;i<=10099;i++){
			if(f==0){
				if((i*8)/100==a&&(i*10)/100==b){
					cout << i << endl;
					f=1;
				}
			}
		}
		if(f==0){
			cout << -1 << endl;
		}
	}
}


Measured memory_bytes: 256
S = list(map(str, input()))
T = list(map(str, input()))

dic, dic_2 = dict(), dict()

def dictionary_append(dictionary, lst):
	id = 0
	for s in lst:
		if not s in dictionary:
			dictionary[s] = []	
		dictionary[s].append(id)
		id += 1

dictionary_append(dic, S)
dictionary_append(dic_2, T)
	
s_prime	= list(dic.values())
t_prime = list(dic_2.values())
s_prime.sort()
t_prime.sort()


no_flg = 0
for s, t in zip(s_prime, t_prime):
	if not s == t:
		print("No")
		no_flg = 1
		break
if not no_flg:
	print("Yes")

Measured memory_bytes: 82664
import math
import sys
def makestr(i):
    if (i % 2 == 0):
        return '0'
    else:
        return '1'
s = input()
candicate1 = ''
candicate2 = ''
for i in range(len(s)):
    candicate1 += makestr(i)
    candicate2 += makestr(i + 1)
ans1 = 0
ans2 = 0
for i in range(len(s)):
    if (candicate1[i] != s[i]):
        ans1 += 1
    else:
        ans2 += 1
print(min(ans1,ans2))

Measured memory_bytes: 3316
// 基本テンプレート
#define _GLIBCXX_DEBUG // for STL debug
#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;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int 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;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int N, x[20], y[20], ans;

bool is_parallel(pair<int, int> A, pair<int, int> B) {
    // fprintf(stderr, "A = (%lld, %lld), B = (%lld, %lld)\n", A.first, A.second, B.first, B.second);
    // fprintf(stderr, "result = %d\n", A.first * B.second - A.second * B.first == 0);
    return A.first * B.second - A.second * B.first == 0;
}

void solve(int bit=0, vector< pair<int, int> > lines=vector< pair<int, int> >(), int cnt=0) {
    for(int i=0; i<N; i++) {
        if(!(bit >> i & 1)) {
            for(int j=0; j<N; j++) {
                if(i == j) continue;
                if(bit >> j & 1) continue;

                int nbit = bit | (1 << i) | (1 << j);
                pair<int, int> vec(x[i] - x[j], y[i] - y[j]);
                int ncnt = cnt;
                for(auto L : lines) {
                    ncnt += is_parallel(vec, L);
                }

                auto nlines = lines;
                nlines.push_back(vec);
                solve(nbit, nlines, ncnt);
            }
            return;
        }
    }
    ans = max(ans, cnt);
}

signed main() {
    cin >> N;
    for(int i=0; i<N; i++) {
        cin >> x[i] >> y[i];
    }
    solve();
    cout << ans << endl;
    return 0;
}



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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

signed main()
{
  int X; cin >> X;
  cout << 8 - (X - 400)/200 << endl;
  return 0;
}


Measured memory_bytes: 3632