akhauriyash/Code-Regression huggingface dataset:
import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	
	String INPUT = "";
	
	public static void main(String[] args) throws Exception {
		new Main().run();
	}
	
	void run() {
		Scanner sc = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(new ByteArrayInputStream(INPUT.getBytes()));
		PrintWriter out = new PrintWriter(System.out);
		
		solve(sc, out);
		out.flush();
	}
	
	void solve(Scanner sc, PrintWriter out) {
		double r = sc.nextDouble();
		
		double a = 2*r*Math.PI;
		double b = r*r*Math.PI;
		System.out.println(String.format("%.6f", b) + " " + String.format("%.6f", a));
	}
}



Measured memory_bytes: 28304
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
t, a = na()
h = na()

best = -99999999999
arg = -1
for i in range(n):
    tt = t - h[i]*0.006
    if abs(tt-a) < abs(best-a):
        best = tt
        arg = i+1
print(arg)


Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<map>
#define ll long long
using namespace std;
map<pair<string, string>, ll> mp;
string a;
int main()
{
	ll n;
	scanf("%lld", &n);
	cin >> a;
	for (ll i = 0; i < (1 << n); i++)
	{
		string q, w;
		for (ll y = 0; y < n; y++)
		{
			if (i&((ll)1<<y))q += a[y];
			else w += a[y];
		}
		mp[{q, w}]++;
	}
	ll sum = 0;
	for (ll i = 0; i < (1 << n); i++)
	{
		string q, w;
		for (ll y = n - 1; y >= 0; y--)
		{
			if (i & ((ll)1<<y))w += a[y + n];
			else q += a[y + n];
		}
		sum += mp[{q, w}];
	}
	printf("%lld", sum);
}

Measured memory_bytes: 91904
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		long a[] = new long[n];
		long sum[] = new long[n];
		for(int i = 0; i < n; i++){
			a[i] = sc.nextLong();
		}

		Arrays.sort(a);
		sum[0] = a[0];
//		System.out.print(sum[0] + " ");
		for(int i = 1; i < n; i++){
			sum[i] += a[i] + sum[i - 1];

			//debug
//			System.out.print(sum[i] + " ");
		}
//		System.out.println();

		int result = 1;
		for(int i = n - 2; i >= 0; i--){
			if(sum[i]*2 < a[i + 1]){
//				System.out.println("i = "+i);
				result = n - i - 1;
				break;
			}
			else if(i == 0){
				result = n;
			}
		}

		System.out.println(result);
	}
}


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

int main() {
  int n,k;
  cin>>n>>k;
  vector<long long>y(n);
  for(int i=0;i<n;i++){
    cin>>y[i];
    y[i]++;
  }
  vector<long long>c(n+1);
  for(int i=0;i<n;i++)c[i+1]=c[i]+y[i];
  long long r=0;
  for(int i=0;i<=n-k;i++){
    r=max(r,c[i+k]-c[i]);
  }
   cout<<fixed<<setprecision(10)<<(double)(r)/2<<endl;
  
}



Measured memory_bytes: 3328
#include <stdio.h>

#define MAX 200000

int max(int a,int b) { return a>b ? a: b;}
int min(int a,int b) { return a<b ? a: b;}

int main(void) {
    int R[MAX], i, n;
    
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&R[i]);
    
    int maxv = -2000000000;
    int minv = R[0];
    
    for(int i=1; i<n; i++) {
        maxv = max(maxv, R[i] - minv);
        minv = min(minv, R[i]);
    }
    
    printf("%d\n",maxv);

    return 0;
}


Measured memory_bytes: 2628
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define pii pair<int,int> 
#define pb push_back
#define INF INT_MAX 
#define mod 1000000007ll
#define fi first
#define se second
#define f(i,p,q) for(int i=p;i<q;i++)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define siii(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pi(a) printf("%d\n",a)
#define psi(a) printf(" %d",a)
#define poi(a) printf("%d",a)
#define sl(a) scanf("%lld",&a)
#define pl(a) printf("%lld\n",a)
#define Nline() printf("\n")
#define sstr(str) scanf("%s",str)
#define pstr(str) printf("%s\n",str)
#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define vi vector<int>
#define vvi vector<vi>
#define all(v) (v).begin(),(v).end()
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())
#define ios ios::sync_with_stdio(false); cin.tie(0);cout.tie(NULL);
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(X) ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X) ( (X) * (X) )
#define SZ(V) (int )V.size()
#define FORN(i, n) for(i = 0; i < n; i++)
#define FORAB(i, a, b) for(i = a; i <= b; i++)
#define ALL(V) V.begin(), V.end()
#define IN(A, B, C)  (B) <= (A) && (A) <= (C)
#define AIN(A, B, C) assert(IN(A, B, C))

void solve(){
     ll n;cin>>n;
     if(n%1000==0){
     	cout<<0;
     }
     else cout<<1000*(n/1000 + 1)-n;
}
int main() {
    ios;
	int t=1;
	//cin>>t;
	while(t--)solve();
 
    
}


Measured memory_bytes: 3652
from collections import deque
K = int(input())
E = [[(i*10)%K,(i+1)%K] for i in range(K)] # E[i][0] がcost 0, E[i][1]がcost 1
INF = K*10
V = [INF] * (K)
V[1] = 1
q = deque([1])
i = 1
while q:
    i = q.popleft()
    if V[E[i][0]] > V[i]:
        q.appendleft(E[i][0])
        V[E[i][0]] = V[i]
    if V[E[i][1]] > V[i]+1:
        q.append(E[i][1])
        V[E[i][1]] = V[i]+1
print(V[0])

Measured memory_bytes: 21108
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd_(ll a,ll b){if(a%b==0)return b;return gcd_(b,a%b);}
ll lcm_(ll a,ll b){ll c=gcd_(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop_(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}




int main(){

  ll N;
  cin >> N;
  vector<ll> A(N),cnt(1000002,0);
  FOR(i,0,N) cin >> A[i];
  FOR(i,0,N) cnt[A[i]]++;


  vector<bool> is_p(1000009,true);
  bool ok = true;
  FOR(i,2,1000001){
    if(is_p[i]){
      ll cnt_ = 0;
      for(int j=i;j<1000001;j+=i){
        is_p[j] = false;
        cnt_ += cnt[j];
      }
      if(cnt_>1){
        ok = false;
      }
    }
  }

  if(ok){
    cout << "pairwise coprime" << endl;
    return 0;
  }



  ll all = A[0];
  FOR(i,1,N){
    all = gcd_(all,A[i]);
  }

  if(all == 1){
    cout << "setwise coprime" << endl;
    return 0;
  }

  cout << "not coprime" << endl;
}



Measured memory_bytes: 18924
import numpy as np
N, M = map(int, input().split())
towns = []
for i in range(M):
  towns.append(list(map(int, input().split()))+[i])

towns= sorted(towns, key=lambda x:x[1])
dic = {}
for i in range(M):
  if towns[i][0] in dic:
    towns[i].append(dic[towns[i][0]])
    dic[towns[i][0]] += 1
  else:
    dic[towns[i][0]] = 1
    towns[i].append(dic[towns[i][0]])
    dic[towns[i][0]] += 1
    
    
towns = sorted(towns, key=lambda x:x[2])

for i in range(M):
  s1 = "{0:06d}".format(towns[i][0])
  s2 = "{0:06d}".format(towns[i][3])
  print(s1+s2)
    

Measured memory_bytes: 44576
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <math.h>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> c(3, 0);
    vector<int> a(3, 0);
    if (n == 1)
    {
        c[0] = 0;
        a[0] = 0;
    }
    else
    {
        c[0] = 1;
        a[0] = 1;
    }

    int temp[2];
    bool f = true;
    for (int i = 0; i < m; i++)
    {
        cin >> temp[0] >> temp[1];
        if (c[temp[0] - 1] != a[temp[0] - 1] && temp[1] != c[temp[0] - 1])
        {
            f = false;
            break;
        }

        c[temp[0] - 1] = temp[1];
    }

    if (f && (c[0] != 0 || n == 1))
    {
        for (int i = 0; i < n; i++)
        {
            cout << c[i];
        }
        cout << endl;
    }
    else
    {
        cout << "-1" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int numCases = sc.nextInt();
        for (int i = 0; i < numCases; i++) {
            String input = sc.next();
            new Main(input).solve();
        }
        sc.close();
    }

    String input;

    char[] cs;
    int ind;

    public Main(String input) {
        this.input = input;
    }

    void solve() {
        cs = (input + "$").toCharArray();
        int ans = readNode();
        System.out.println(ans);
    }

    int readNode() {
        if (cs[ind] == '[') {
            ind++;
            if (cs[ind] == '[') {
                List<Integer> values = new ArrayList<Integer>();
                while (cs[ind] == '[') {
                    values.add(readNode());
                }

                Collections.sort(values);

                int ret = 0;
                for (int i = 0; i < values.size() / 2 + 1; ++i) {
                    ret += values.get(i);
                }

                assert cs[ind] == ']';
                ind++;
                return ret;
            } else if (isNum(cs[ind])) {
                int ret = readNum() / 2 + 1;

                assert cs[ind] == ']';
                ind++;
                return ret;
            } else throw new IllegalStateException();
        }
        throw new IllegalStateException();
    }

    int readNum() {
        int acc = 0;
        while (isNum(cs[ind])) {
            acc *= 10;
            acc += cs[ind] - '0';
            ind++;
        }
        return acc;
    }

    private static boolean isNum(char c) {
        return '0' <= c && c <= '9';
    }
}

Measured memory_bytes: 55760
n, m = map(int, input().split())
switch = []
for i in range(m):
    switch.append(list(map(int, input().split())))
p = list(map(int, input().split()))

ans = 0
for i in range(2**n):
    i = format(i, "0{}b".format(n))
    flag = 1
    for j in range(m):
        count = 0
        for k in range(switch[j][0]):
            if i[switch[j][k+1]-1] == "1":
                count += 1
        if count % 2 == p[j]:
            continue
        else:
            flag = 0
            break
    if flag == 1:
        ans += 1
print(ans)


Measured memory_bytes: 3188
#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <cstring>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
int main()
{
	long long int c,a,b;
	cin>>a>>b;
	c=(a-1)*(b-1);
	cout<<c<<endl;
	return 0;
} 

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<algorithm>
double F(int l1, int l2, int c)
{
	return abs(l1-l2)/(2000.0/(70+20.*c));
}
struct S{double t;int c,i;}dp[1<<15][15],x={1e9,-1,-1};
bool Cmp(const S&l,const S&r){return l.t<r.t;}
int main()
{
	std::fill(dp[0],dp[1<<15],x);

	int n,index[15],l[15],c[15],i,j,k;
	scanf("%d",&n);
	for(i=0;i<n;++i)
	{
		scanf("%d%d%d",&index[i],&l[i],&c[i]);
		dp[1<<i][i].t=0;
		dp[1<<i][i].c=c[i];
		dp[1<<i][i].i=i;
	}
	std::vector<int>u,v;
	for(i=1;i<(1<<n);++i)
	{
		u.clear();
		v.clear();
		for(j=0;j<n;++j)
			if(!(i&(1<<j)))v.push_back(j);
			else u.push_back(j);
		for(j=0;j<v.size();++j)
		{
			int b=v[j];
			for(k=0;k<u.size();++k)
			{
				int f=u[k];
				S&r=dp[i|(1<<b)][b];
				double T=dp[i][f].t+F(l[b],l[f],dp[i][f].c);
				if(r.t>T)
				{
					r.t=T;
					r.i=f;
					r.c=dp[i][f].c+c[b];
				}
			}
		}
	}
	v.clear();
	i=(1<<n)-1;
	k = std::min_element(dp[i],&dp[i][n],Cmp)-dp[i];
	for(i=(1<<n)-1;i;)
	{
		v.push_back(k);
		j = dp[i][k].i;
		i^=(1<<k);
		k = j;
	}
	for(i=v.size()-1;i>=0;--i)printf("%d%c",index[v[i]],i?' ':'\n');
	return 0;
}

Measured memory_bytes: 8452
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

long long inputValueLongLong(){
    long long a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}


int main(int argc, const char * argv[]) {
    int N = inputValue();
    int R = inputValue();

    if(N>9){
        cout << R << endl;
    }else{
        R += 100*(10-N);
        cout << R << endl;
    }
    return 0;
}

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

using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;






int main() {
	vector<pii> v(5, pii(0, 0));
	int a, b;
	while (1) {
		for (int i = 0; i < 5; i++) {
			cin >> a >> b;
			v[i].second = i;
			v[i].first = a + b;
		}
		if (cin.eof())break;
		sort(all(v));
		cout << (char)('A' + v[4].second) << " " << v[4].first << endl;
	}
}

Measured memory_bytes: 1196
/*
author : seryu
title : AIsing_ProgrammingContest B_"An Odd Problem"
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define mrep(i,j,n) for(int i = j; i < n; i++)
#define mreps(i,j,n) for(int i = j; i <= n; i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(all(x), val), x.end())
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }

void solve()
{
	int n;
	cin >> n;
	int ans = 0;
	rep(i, n)
	{
		int a;
		cin >> a;
		if (i % 2 == 0 && a % 2 == 1)ans++;
	}
	cout << ans << endl;
	return;	
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


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

int main(){
  int n;
  int p = 0;
  int a = 0;
  cin >> n;
  for(int i=1; i<n+1; i=i+2){
    for(int j=1; j<i+1; j=j+2){
      if(i%j==0){p++;}
    }
    if(p==8){a++;}
    p = 0;
  }
  cout << a << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<string.h>
#include<functional>
#include<set>
#include<string>
#include<bitset>
//aoj 0121
using namespace std;
char zzzt[8]={0,1,2,3,4,5,6,7};
char bj[8];
bitset<80000000> vis;
struct pt{
	int ztt;
	int lwz;
	int step;
};
int bs;
pt dl[1<<16];
int front=1,back=1;
int tt;
int ddd[8]={10000000,1000000,100000,10000,1000,100,10,1};
void bfs()
{
	tt=0;
	front=1;
	back=1;
	bs=0;
//	memset(vis,0,sizeof(vis));
	vis.reset();
	
	int cs=atoi(bj);
	vis[cs]=1;
	pt lsss;
	lsss.ztt=cs;
	lsss.lwz=strchr(bj,'0')-bj;
	lsss.step=0;
	dl[back]=lsss;
	back++;
	while(front<back)
	{
		pt ls1=dl[front];
		front++;
		if(ls1.ztt==1234567)
		{
			bs=ls1.step;
			tt=1;
			return;
		}
		pt lsjr;
		int kkk[4]={-1,1,-4,4};
		char sss[9];
//		sprintf(sss,"%08d", ls1.ztt);
		int tt=ls1.ztt;
		for(register int i=7;i>=0;i--){
			sss[i]=tt%10;
			tt/=10;
		}
		for(register int i=0;i<4;i++){
			lsjr.lwz=ls1.lwz+kkk[i];
			if((ls1.lwz==3&&lsjr.lwz==4) || (ls1.lwz==4&&lsjr.lwz==3)) continue;
			if(lsjr.lwz>=0&&lsjr.lwz<=7){
/*				
					int  a,b;
					a=ls1.ztt/ddd[ls1.lwz]%10;
					b=ls1.ztt/ddd[lsjr.lwz]%10;
					lsjr.ztt=ls1.ztt+(b-a)*ddd[ls1.lwz]+(a-b)*ddd[lsjr.lwz];
*/
				swap(sss[ls1.lwz],sss[lsjr.lwz]);
				lsjr.ztt=0;
				for(register int i=0;i<=7;i++){
					lsjr.ztt*=10;
					lsjr.ztt+=sss[i];
				}
				swap(sss[ls1.lwz],sss[lsjr.lwz]);
				if(!vis[lsjr.ztt])
					{
						lsjr.step=ls1.step+1;
						vis[lsjr.ztt]=1;
						dl[back]=lsjr;
						back++;
					}
			}
		}
	}
}
int main()
{
//	freopen("in","r",stdin);
	while(1)
	{
		if(scanf("%c",&bj[0])==EOF)
		{
			return 0;
		}
		scanf("%*c");
		for(int i=1;i<=6;i++)
		{
			scanf("%c%*c",&bj[i]);
		}
		scanf("%c",&bj[7]);
		bfs();
		if(tt)
		{
			printf("%d\n",bs);
		}else{
			printf("-1\n");
		}
		while(getchar()!='\n');
	}
	return 0;
}



Measured memory_bytes: 12696
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  int x, a, b;
  cin >> x >> a >> b;
  int p = b - a;
  if(p<=0) {
    cout << "delicious" << endl;
    return 0;
  }
  else if(p<=x) {
    cout << "safe" << endl;
    return 0;
  } 
  else {
    cout << "dangerous" << endl;
    return 0;
  }
  return 0;
}

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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> A(N), B(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  if (N % 2 == 0) {
    int a = A[N / 2 - 1] + A[N / 2];
    int b = B[N / 2 - 1] + B[N / 2];
    cout << b - a + 1 << '\n';
  } else {
    int a = A[N / 2];
    int b = B[N / 2];
    cout << b - a + 1 << '\n';
  }
  return 0;
}


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

using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;

template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;

template <class T, class U>
void chmax(T &a, U b) {
    if (a < b) a = b;
}
template <class T, class U>
void chmin(T &a, U b) {
    if (b < a) a = b;
}

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << endl;
#define int ll

const ll mod = 1e9 + 7;
const ll inf = (1LL << 50);

const string YES = "Yes";
const string NO = "No";
void solve(std::string S) {

    string revs = S;
    reverse(all(revs));
    if (revs != S) {
        cout << NO << endl;
        return;
    }

    string sl = S.substr(0, S.size() / 2);
    string sr = S.substr(S.size() - S.size() / 2, S.size() / 2);
    string revsl = sl;
    string revsr = sr;
    reverse(all(revsl));
    reverse(all(revsr));

    if (sl == revsl and sr == revsr) {
        cout << YES << endl;
        return;
    } else {
        cout << NO << endl;
    }
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
n, k = map(int, input().split())
d = list(map(int, input().split()))

flg = 0
flg2 = 0
while flg == 0:
	for i in range(len(str(n))):
		flg2 = 0
		if int(str(n)[i]) in d:
			flg2 = 1
			n += 1
			break
	if flg2 == 0:
		flg = 1
print (n)

Measured memory_bytes: 3060
let () =
  let _ = read_line () in
  let s = read_line ()
    |> Str.split (Str.regexp " ")
    |> List.map int_of_string in
  let max = List.fold_left (fun x y -> if x > y then x else y) (-99999999) in
  let min = List.fold_left (fun x y -> if x < y then x else y) 999999999 in
  let sum = List.fold_left (fun x y -> x + y) 0 in
  Printf.printf "%d %d %d\n" (min s) (max s) (sum s)

Measured memory_bytes: 4204
using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder
{
	class Program
	{
		public static void Main()
		{
			var inputStr = IO.Read();
			IO.Write(inputStr[2] == inputStr[3] && inputStr[4] == inputStr[5]);
		}
	}

	public static class IO
	{
		public static string   Read()							   { return Console.ReadLine(); }
		public static string[] ReadArray(char iSplitter = ' ')	   { return Read().Split(iSplitter); }
		public static int	   ReadInt()						   { return int.Parse(Read()); }
		public static int[]	   ReadIntArray(char iSplitter = ' ')  { return ReadArray().Select(iText => int.Parse(iText)).ToArray(); }
		public static long	   ReadLong()						   { return int.Parse(Read()); }
		public static long[]   ReadLongArray(char iSplitter = ' ') { return ReadArray().Select(iText => long.Parse(iText)).ToArray(); }
		public static char[]   ReadCharArray()					   { return Read().ToCharArray(); }

		public static void Write(string iValue)			  { Console.WriteLine(iValue); }
		public static void Write(int iValue)			  { Console.WriteLine(iValue); }
		public static void Write(IEnumerable<int> iValue) { Console.WriteLine(string.Join(" " , iValue)); }
		public static void Write(long iValue)			  { Console.WriteLine(iValue); }
		public static void Write(decimal iValue)		  { Console.WriteLine(iValue); }
		public static void Write(bool iValue)			  { Console.WriteLine(iValue ? "Yes" : "No"); }
	}

	public static class Util
	{
		public static long Gcd(long i0 , long i1) { return (i0 > i1) ? _Gcd(i0 , i1) : _Gcd(i1 , i0); }
		public static long Lcm(long i0 , long i1) { return (i0 * i1) / Gcd(i0 , i1); }
		public static long ModPow(long iBaseNumber , long iPow , long iModNumber)
		{
			var num = 1L;
			while(iPow != 0)
			{
				if((iPow & 0x1) != 0)
				{
					num = (num * iBaseNumber) % iModNumber;
				}
				iBaseNumber = (iBaseNumber * iBaseNumber) % iModNumber;
				iPow >>= 1;
			}
			return num;
		}

		private static long _Gcd(long i0 , long i1)	{ return (i1 == 0) ? i0 : _Gcd(i1 , i0 % i1); }
	}
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;
#define RET(ans) {cout<<ans<<endl;return 0;} 

    // 二次元ベクターの基本
    /*
    vector<vector<int>> dp; // 宣言
    dp.resize(n); // 1次元めの要素数決定
    dp[i].push_back(int); // プッシュバック
    rep(i,n){
        sort(dp[i].begin(),dp[i].end()); // 二次元めを昇順ソート
    }
    */

    // 整数スキャン（複数）
    /*
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s; cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s; cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    int a,b,t;
    cin >> a >> b >> t;


    ll ans = (t/a)*b;
    
    cout << ans << endl;
    return 0;
}
 
 


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000007;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	string s;
	cin >> s;

	Int len = s.size();
	Int C0 = 0;
	Int C1 = 0;

	for (Int i = 0; i < len; i++) {
		if (s[i] == '0')C0++;
	}

	C1 = len - C0;

	cout << 2 * min(C0, C1) << endl;

}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define repp(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//ミョ(-ω- ?)
int main() {
    string s;
    cin >> s;
    cout << s.substr(0,3) << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

typedef long long ll;

using namespace std;

int n,t,s,ans=0;
int a[3001],b[3001];
int dp[3001];

int main(){
    
    scanf("%d%d%d",&n,&t,&s);
    
    for(int i=0;i<n;i++){
        scanf("%d%d",&a[i],&b[i]);
        
        for(int j=t-b[i];j>=0;j--){
            if(j+b[i]<=s || s<=j)
                dp[j+b[i]]=max(dp[j+b[i]],dp[j]+a[i]);
        }
    }
    
    for(int i=0;i<=t;i++){
        ans=max(ans,dp[i]);
    }
    
    
    
    printf("%d\n",ans);
    
    return 0;
}

Measured memory_bytes: 1220
n,k,q=map(int,input().split())
import sys
input = sys.stdin.readline
a=[int(input()) for _ in range(q)]
import collections
c=collections.Counter(a)
for _ in range(1,n+1):
   if k-q+c[_]>0:
      print("Yes")
   else:
      print("No")

Measured memory_bytes: 11944
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i < (n+1); ++i)
using namespace std;
using ll = long long;
const int INF = -100100100;
typedef pair<int,int> P;

int main(){
    int n;
    cin >> n;
    vector<int> tk(n),v(n),c(n);
    rep(i,n)cin >> v.at(i);
    rep(i,n)cin >> c.at(i);
    rep(i,n)tk.at(i) = v.at(i) - c.at(i);
    int s = 0;
    rep(i,n){
        if(tk.at(i)>0)s+=tk.at(i);
    }
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n-1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define co(x) cout << x <<endl
#define cs(x) cout << x <<" "
#define cer(x) cerr << x <<endl
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(ALL(x), val), x.end())
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;
using namespace std;
ll mod = 1e9 + 7;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }

int main()
{
	string s;
	cin >> s;
	int n = s.size();
	int m = 0;
	for (int i = 0; i < n; i++)
	{
		if (s[i] != s[n-1-i])
		{
			m++;
		}
	}
	co(m/2);
	return 0;
}


Measured memory_bytes: 256
n=gets.chomp.to_i
 
ai = []
bi = []
ci = []
n.times do |i|
  a, b =gets.chomp.split(" ").map(&:to_i)
  ai << a
  bi << b
  ci << [(a + b), i]
end

ci = ci.sort_by {|cc| cc[0]}.reverse
t = 0
k = 0
tk = true
ci.each do |c|
  if tk
    t += ai[c[1]]
    tk = false
  else
    k += bi[c[1]]
    tk = true
  end
end
puts t - k 

Measured memory_bytes: 14200
var output;
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す
//1:数値へ変換 2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字に分割 7:1文字に分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main() {
  var s = myconv(next(),6);
  var list = {};
  for(var i = 0; i < s.length; i++){
    if(list[s[i]] == null){
       list[s[i]] = 1;
    }else{
       list[s[i]]++;
    }
  }
  var maxKeys = [];
  var max = 0;
  var keys = Array.from(Object.keys(list));
  if(keys.length == 1){
     myout(0);
    return;
  }
  for(var i = 1; i < keys.length; i++){
    max = Math.max(max,list[keys[i]]);
    if(max < list[keys[i]]){
       max = list[keys[i]];
    }
  }
  for(var i = 0; i < keys.length; i++){
    if(max == list[keys[i]]){
    	maxKeys.push(keys[i]);
    }
  }
  myerr(maxKeys);
  var output = 107;
  for(var j = 0; j < keys.length; j++){
    var tmpKey = keys[j];
    var tmpS = Object.assign([],s);
    var count = 0;
  while(!check(tmpS,tmpKey)){
    for(var i = 0; i < tmpS.length; i++){
      if(tmpS[i+1] == tmpKey){
         tmpS[i] = tmpKey;
      }
    }
    tmpS.pop();
    count++;
  }
    output = Math.min(output,count);
  }
  myout(output);
}
function check(str,chr){
    var ret = true;
    for(var i = 0; i < str.length; i++){
      if(str[i] != chr){
         ret = false;
      }
    }
    return ret;
}

Measured memory_bytes: 7628
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vs = vector<string>;
using vll = vector<long long>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, m;
    cin >> n >> m;
    cout << (100*n + 1800*m)*(ll)pow(2, m) << endl;
}

Measured memory_bytes: 256
n, l = map(int, input().split())

aji = []
for i in range(1, n+1):
    aji.append(l+i-1)
pie = sum(aji)

if 0 in aji:
    print(pie)
elif min(aji) < 0:
    print(sum(aji[:n-1]))
else:
    print(sum(aji[1:]))


Measured memory_bytes: 3060
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    String ans = "APPROVED";
    for (int i = 0; i < N; i++) {
      int A = sc.nextInt();
      if (A % 2 == 0 && A % 3 != 0 && A % 5 != 0) ans = "DENIED";
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 23380
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

    public String next() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public String nextLine() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          return reader.readLine();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      return tokenizer.nextToken("\n");
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }

    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    Map<Integer, Integer> counter = new HashMap<>();
    for (int i = 1; i <= n; i++) {
      counter.put(i, 0);
    }
    while (k-- > 0) {
      int d = sc.nextInt();
      int[] a = sc.nextIntArray(d);
      for (int ai: a) {
        counter.merge(ai, 1, Integer::sum);
      }
    }
    int sum = 0;
    for (int c : counter.values()) {
      sum += c == 0 ? 1 : 0;
    }
    System.out.println(sum);
  }
}

Measured memory_bytes: 31608
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define ll            long long

#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
//mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void sb()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int main()
{
	//sb();
    ll n,k;
    cin>>n>>k;
    vector<ll> a;
    vector<ll> dp(n,0);
    for(int i=0;i<n;i++){
        ll num;
        cin>>num;
        a.pb(num);
    }
    dp[0] = 0;
    
    for(int i=1;i<n;i++){
        int j=1;
        ll minn = INT_MAX;
        while(i-j>=0&&j<=k){
            minn = min(minn,dp[i-j]+abs(a[i]-a[i-j]));
            j++;
        }
        dp[i] = minn;
    }
       
    cout<<dp[n-1];



return 0;
}



Measured memory_bytes: 2168
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <iomanip> 
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<bool> vb;
typedef vector<ull> vul;
typedef vector<pair<ll, ll>> vpl;
typedef pair<ll, ll> pl;
#define For(i, n) for(ll i = 0; i < n; i++)
#define len(n) (ll)(n).size()
#define Sort(a) sort(a.begin(), a.end())
ll dp[110][100010];
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll n, W;
	cin >> n >> W;
	vl w(n);
	vl u(n);
	For(i, n) {
		cin >> w[i] >> u[i];
	}
	for (ll i = 1; i <= n; i++) {
		For(j, W + 1) {
			if (j >= w[i - 1]) {
				dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i - 1]] + u[i - 1]);
			}
			else {
				dp[i][j] = dp[i - 1][j];
			}
			//cout << dp[i][j] << ' ' << i << ' ' << j << endl;
		}
	}
	cout << dp[n][W];
	return 0;
}

Measured memory_bytes: 81800
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
  int n,keta,ans=0;
  cin>>n;
  for(int i=0;i<=5;i++) if(n>=pow(10,i)) keta=i+1;
  for(int i=1;i<keta;i++) if(i%2==1) ans+=9*pow(10,i-1);
  if(keta%2==1) ans+=n-pow(10,keta-1)+1;
  cout<<ans;
}

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

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

  if (A%10==(A%100-A%10)/10&&(A%100-A%10)/10==(A%1000-A%100)/100&&A==(A%1000-A%100)/100) {
    cout << "Yes" << endl;
  }
  // ここにプログラムを追記
  else if(A%10==(A%100-A%10)/10&&(A%100-A%10)/10==(A%1000-A%100)/100){
    cout<<"Yes"<<endl;
  }
  else if(A%10==(A%100-A%10)/10&&A==(A%1000-A%100)/100){
    cout<<"Yes"<<endl;
  }
  else if((A%100-A%10)/10==(A%1000-A%100)/100&&(A-A%1000)/1000==(A%1000-A%100)/100){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int main(){

	int N,X,Y;
	int *p;
	cin >> N >> X >>Y;
	p = new int [N - 1];
	for(int i = 0;i <= N-2;i++){
		p[i] = 0;
	}
	for(int i = 1;i <= N-1;i++){
		for(int j = i+1;j <= N;j++){
			if(j <= X){
				p[j - i -1] ++;
			}
			if(i <= X && X + 1 <= j && j <= Y -1){
				int normal_distance = j - i;
				int XY_distance = Y - j + X - i + 1;
				p[min(normal_distance,XY_distance) -1] ++;
			}
			if(X + 1 <= i && j <= Y-1){
				int normal_distance = j -i;
				int XY_distance = Y - j + i -X + 1;
				p[min(normal_distance,XY_distance) -1] ++;
			
			}
			if(X + 1 <= i && i <= Y - 1 && Y <= j){
				int normal_distance = j-i;
				int XY_distance = j - Y + i -X + 1;
				p[min(normal_distance,XY_distance)-1] ++;
			}
			if(Y <= i){
				p[j - i -1] ++;
			}
			if(i <= X && Y <= j){
				p[j - Y + X -i] ++;
			}
		}
	}
	for(int i = 0;i <= N-2;i ++){
		cout << p[i] << '\n';
	}

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;

int main(){

    int a, b, c;
    cin >> a >> b >> c;
    int array[] = {a, b, c};

    sort(array, array+3);
    cout << array[0] << " " << array[1] << " "<< array[2] << endl;
    return 0;

}


Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define ALL(a) (a).begin(), (a).end()
const ll mod = 1e9 + 7;

int n, m;
int a[50], b[50];

bool graph[50][50]; //隣接行列
bool visited[50];

void dfs(int v)
{
    visited[v] = true;
    for (int nv = 0; nv < n; nv++)
    {
        if (graph[v][nv] == false)
            continue;
        if (visited[nv] == true)
            continue;
        dfs(nv);
    }
}

int main()
{
    int ans = 0;
    cin >> n >> m;
    rep(i, m)
    {
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }
    rep(i, m)
    {
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = false;
        rep(j, n)
        {
            visited[j] = false;
        }
        dfs(0);
        bool bridge = false;
        rep(j, n)
        {
            if (visited[j] == false)
                bridge = true;
        }
        if (bridge)
            ans += 1;
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
A=[list(map(int,input().split())) for i in range(3)]
n=int(input())
b=[int(input()) for i in range(n)]
for i in range(3):
    for j in range(3):
        for k in range(n):
            if A[i][j]==b[k]:
                A[i][j]=-1
if A[0][0]==-1 and A[1][1]==-1 and A[2][2]==-1:
    print("Yes")
    exit()
elif A[0][2]==-1 and A[1][1]==-1 and A[2][0]==-1:
    print("Yes")
    exit()
for i in range(3):
    total=0
    if A[i].count(-1)==3:
        print("Yes")
        exit()
    for j in range(3):
        if A[j][i]==-1:
            total+=1
    if total==3:
        print("Yes")
        exit()
print("No")

Measured memory_bytes: 9256
/*やったぜ。　投稿者：変態糞土方 (8月16日（水）07時14分22秒)

昨日の8月15日にいつもの浮浪者のおっさん（60歳）と先日メールくれた汚れ好きの土方のにいちゃん

（45歳）とわし（53歳）の3人で県北にある川の土手の下で盛りあったぜ。

今日は明日が休みなんでコンビニで酒とつまみを買ってから滅多に人が来ない所なんで、

そこでしこたま酒を飲んでからやりはじめたんや。

3人でちんぽ舐めあいながら地下足袋だけになり持って来たいちぢく浣腸を3本ずつ入れあった。

しばらくしたら、けつの穴がひくひくして来るし、糞が出口を求めて腹の中でぐるぐるしている。

浮浪者のおっさんにけつの穴をなめさせながら、兄ちゃんのけつの穴を舐めてたら、

先に兄ちゃんがわしの口に糞をドバーっと出して来た。

それと同時におっさんもわしも糞を出したんや。もう顔中、糞まみれや、

3人で出した糞を手で掬いながらお互いの体にぬりあったり、

糞まみれのちんぽを舐めあって小便で浣腸したりした。ああ～～たまらねえぜ。

しばらくやりまくってから又浣腸をしあうともう気が狂う程気持ちええんじゃ。

浮浪者のおっさんのけつの穴にわしのちんぽを突うずるっ込んでやると

けつの穴が糞と小便でずるずるして気持ちが良い。

にいちゃんもおっさんの口にちんぽ突っ込んで腰をつかって居る。

糞まみれのおっさんのちんぽを掻きながら、思い切り射精したんや。

それからは、もうめちゃくちゃにおっさんと兄ちゃんの糞ちんぽを舐めあい、

糞を塗りあい、二回も男汁を出した。もう一度やりたいぜ。

やはり大勢で糞まみれになると最高やで。こんな、変態親父と糞あそびしないか。

ああ～～早く糞まみれになろうぜ。

岡山の県北であえる奴なら最高や。わしは163*90*53,おっさんは165*75*60、や

糞まみれでやりたいやつ、至急、メールくれや。

土方姿のまま浣腸して、糞だらけでやろうや。*/
#include "bits/stdc++.h"
#include <numeric>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define llMIN numeric_limits<long long>::min()
#define intMIN numeric_limits<int>::min()
#define d_5 100000
#define d9_7 1000000007
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
#define ld long double

int main(void){
  int h,w,n;
  cin>>h>>w>>n;
  ll sr,sc;
  cin>>sr>>sc;
  string s,t;
  cin>>s>>t;
  reverse(s.begin(),s.end());
  reverse(t.begin(),t.end());
  int flag=0;
  sr--;sc--;
  int maxy=h,maxx=w,minx=0,miny=0;
  int now1=0;
  int now2=0;
  int now3=w-1;
  int now4=h-1;
  rep(i,n){
    if(t[i]=='D' && now1 >0){
      now1--;
    }
    if(s[i]=='U'){
      now1++;
    }
    miny=max(miny,now1);

    if(t[i]=='R' && now2>0){
      now2--;
    }
    if(s[i]=='L'){
      now2++;
    }
    minx=max(minx,now2);

    if(t[i]=='L' && now3 <w-1){
      now3++;
    }
    if(s[i]=='R'){
      now3--;
    }
    maxx=min(maxx,now3);

    if(t[i]=='U' && now4 <h-1){
      now4++;
    }
    if(s[i]=='D'){
      now4--;
    }
    maxy=min(maxy,now4);

    if(now1>now4 || now2>now3){
      cout<<"NO"<<endl;
      return 0;
    }
  }
  //cout<<minx<<" "<<maxx<<" "<<miny<<" "<<maxy<<" ";
  /*if(minx<=sr && sr<=maxx && miny <= sc && sc <= maxy && minx<=maxx && miny <=maxy){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }*/
  if(now1<=sr && sr<=now4 && now2 <= sc && sc <= now3){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
  return 0;
}


Measured memory_bytes: 776
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mp make_pair
#define pb push_back
#define mod 100000009

void solve(){
	// Solve here
	ll n;
	cin>>n;

	ll arr[n];

	for(ll i=0;i<n;i++) {
		cin>>arr[i];
	}

	ll ans=0;
	ll max = arr[0];
	for(ll i=0;i<n;i++) {
		if(arr[i]>max) max = arr[i];
		if(max>arr[i]) {
			ans += max-arr[i];
		}
	}


	cout<<ans<<"\n";
}

int main() {

	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	ios::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
	int t=1;
	// cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(int i=(l);i<(r);i++)
#define dec(i, l, r)   for(int i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    string s, t;cin >> s >> t;
    int ans = 0;
    inc(i, 0, 3){
        if(s[i] == t[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;

namespace AtCoder {
    class Program {
        static void Main(string[] args) {

            var n = int.Parse(Console.ReadLine());
            var arr1 = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var t = arr1[0];
            var a = arr1[1];
            var ans = Console.ReadLine().Split(' ')
                                        .Select((val, idx) => new { val = Math.Abs(a - (t - int.Parse(val) * 0.006)), idx = idx + 1 })
                                        .Aggregate((min, elem) => (min.val > elem.val) ? elem : min).idx;

            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 13468
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
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; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W; cin >> H >> W;
	vector<vector<int>> dp(H + 1, vector<int>(W + 1));
	rep(i, 0, H) rep(j, 0, W) {
		int x; cin >> x;
		dp[i + 1][j + 1] = !x;
	}
	int ans = 0;
	dump(dp);
	rep(i, 1, H + 1)rep(j, 1, W + 1) {
		if (dp[i][j] == 0)continue;
		dp[i][j] = min({
			dp[i - 1][j],
			dp[i][j - 1],
			dp[i - 1][j - 1]
		}) + 1;
		chmax(ans, dp[i][j]);
	}
	dump(dp);
	cout << ans*ans << endl;
	return 0;
}

Measured memory_bytes: 10416
using System;
 
namespace arc071_a
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] max = new int[26];
            for (int i = 0; i < 26; i++)
            {
                max[i] = int.MaxValue;
            }
            for (int i = 0; i < n; i++)
            {
                string s = Console.ReadLine();
                int[] letter = new int[26];
                for (int j = 0; j < s.Length; j++)
                {
                    letter[s[j] - 97]++;
                }
                for (int j = 0; j < 26; j++)
                {
                    max[j] = Math.Min(max[j], letter[j]);
                }
            }
            for (int i = 0; i < 26; i++)
            {
                for (int j = 0; j < max[i]; j++)
                {
                    Console.Write((char)(i + 97));
                }
            }
            Console.WriteLine();
        }
    }
}

Measured memory_bytes: 11092