akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, a, n) &((x)[a]), &((x)[n])
#define ADD(a, b) ((((a+MOD)%MOD)+((b+MOD)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define EPS (1e-20)
#define INF INT_MAX
#define INFLL LLONG_MAX
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using MCI = std::map<char, int>;
using VPII = std::vector<PII>;
using namespace std;


string s;


signed main(){
	cin >> s;

	cout << SIZE(s)/2 - count(ALL(s), 'p') << endl;

	return 0;
}

Measured memory_bytes: 512
<?php
fscanf(STDIN, "%d",$n);
for ($i=0; $i < $n; $i++)
	fscanf(STDIN, "%d",$t[$i]);

$result=$t[0];
for($i=1; $i < $n; $i++)
	$result=lcm($result,$t[$i]);

printf("%d",$result);

function gcd($n1,$n2)
{
    $n1=abs($n1);
    $n2=abs($n2);
    
    if($n1<$n2)
    {
        $temp=$n1;
        $n1=$n2;
        $n2=$temp;
    }
    if($n2<1)
        return -1;

    if($n1%$n2==0)
        return $n2;
    return gcd($n2,$n1%$n2);
}

function lcm($n1,$n2)
{
    return $n1/gcd($n1,$n2)*$n2;
}

Measured memory_bytes: 4728
import java.util.*;
 
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        if(n % 10 == 0){
        	System.out.println(10);
        }else{
        	String s = Integer.toString(n);
            int ans = 0;
            for(int i = 0; i < s.length(); i++){
            	int a = Integer.parseInt(s.substring(i, i + 1));
                ans += a;
            }
            System.out.println(ans);
        }
    }
}


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

using namespace std;
#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
//rep…「0からn-1まで」の繰り返し
#define rep2(i,s,n) for(long long i=s; i<=(long long)(n);i++)
//rep2…「sからnまで」の繰り返し
#define repr(i,s,n) for(long long i=s;i>=(long long)(n);i--)
//repr…「ｓからnまで」の降順の繰り返し

typedef long long ll;

const int inf = 1e9+7;
const int mod = 1e9+7;

int main(){
    double d,t,s;
    cin>>d>>t>>s;

    if(d/s>t)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
}


Measured memory_bytes: 3724
#include <iostream>
#include <cstdio>
#include <string>
#include <cctype>
#include <ctime>
#include <climits>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <tuple>
#include <cmath>
#include <algorithm>

using namespace std;

#ifndef M_PI
    #define M_PI 3.14159265358979323846
#endif

#define pii pair<int, int>
#define pll pair<long long, long long>
#define mp make_pair
#define fr first
#define sc second
#define tiii tuple<int, int, int>
#define tlll tuple<long long, long long, long long>
#define mt make_tuple
#define ll long long
#define ld long double
#define pb push_back


int32_t main()
{
    //freopen("input.txt", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    int p1 = 0, p2 = 0;

    for (int i = 0; i < n - 1; i++)
    {
        if (a[i] == a[i + 1])
        {
            if (p1 == 0)
                p1 = a[i];
            else if (p2 == 0)
                p2 = a[i];
            else
                break;
            i++;
        }
    }

    cout << (ll)p1 * p2 << endl;
    return 0;
}


Measured memory_bytes: 640
fun main(args: Array<String>) {
    val (H, A) = readIntList()
    println((H+A-1)/A)
}

fun readString() = readLine()!!
fun readStringList() = readLine()!!.split(" ")
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)


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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using ll = long long;

int main() {

    ll L,R;
    ll mod = 2018;
    ll m;
    cin >> L >> R;

    for(ll i=L; i<=min(L+2019,R); i++){
        for(ll j=i+1; j<=min(L+2019,R); j++){
            mod = min(mod,(i*j)%2019);
        }
    }

    cout << mod << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <sstream>
#include <algorithm>
#include <set>

using namespace std;

int main(int argc, char *argv[])
{
  int size;

  cin >> size;
  vector<int> elem;
  set<int> elemset;
  for(int i=0;i<size;i++){
    int v;
    cin >> v;
    elem.push_back(v);
    elemset.insert(v);
  }

  sort(elem.begin(), elem.end());
  /*
  for(set<int>::iterator iter=elemset.begin();
      iter != elemset.end();iter++){
    cout << *iter << endl;
  }
  */
  int maxk=2;
  for(int i=0;i<elem.size();i++){
    for(int j=i+1;j<elem.size();j++){
      int difference=elem[j] - elem[i];
      //int num = elem[j];
      for(int k=1;k<elem[elem.size()-1];k++){
	int nextnum = elem[j] + k * difference;
	if(nextnum > elem[elem.size()-1]) break;
	//cout << k << " " << nextnum << " " << elem[i] << " " << elem[j] << endl;
	if(elemset.find(nextnum) != elemset.end()){
	  maxk = max(k+2, maxk);
	}else{
	  break;
	}
      }
    }
  }
  cout << maxk << endl;
  
  return 0;
}



Measured memory_bytes: 3424
object Main extends App {
  import scala.math._
  
  val n = readLong
  val h = readLine.split(" ").map{_.toLong}.toArray
  
  val dp = Array.fill[Long](n.toInt)(Long.MaxValue)
  dp(0) = 0
  dp(1) = abs(h(1) - h(0))
  
  
  for (i <- 2 until n.toInt) {
    dp(i) = min(dp(i-1)+abs(h(i)-h(i-1)),dp(i-2)+abs(h(i)-h(i-2)))
  }
  
  println(dp(n.toInt-1))
}

Measured memory_bytes: 46908
N, K = map(int, input().split())
mod_0 = 0
mod_K2 = 0
for i in range(1, N+1):
  if i % K == 0:
    mod_0 += 1
  elif i % K == K/2:
    mod_K2 += 1

ans = pow(mod_0, 3) + pow(mod_K2, 3)
print(ans)

Measured memory_bytes: 3060
n,k,q=map(int,input().split())

#al=[int(input()) for i in range(q)]
d={}
for i in range(q):
  s=int(input())
  if not s in d.keys():
    d[s]=1
  else :
    d[s]+=1
#print(d)

pointl=[k-q for i in range(n)]

for k,v in d.items():
  pointl[k-1]+=v
for p in pointl:
  if p <= 0:
    print("No")
  else :
    print("Yes")

Measured memory_bytes: 13028
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

namespace
{
	struct modint
	{
		static constexpr ll MOD = 1000000007;
		ll x_;
		modint() : x_(0) {}
		modint(ll x) : x_(x% MOD) {}
		modint& operator+=(const modint& src)
		{
			if ((x_ += src.x_) >= MOD)
				x_ -= MOD;
			return *this;
		}
		modint& operator-=(const modint& src)
		{
			if ((x_ += MOD - src.x_) >= MOD)
				x_ -= MOD;
			return *this;
		}
		modint& operator*=(const modint& src)
		{
			(x_ *= src.x_) %= MOD;
			return *this;
		}

		modint& operator/=(const modint& src)
		{
			return (*this) *= src.inv();
		}
		modint inv() const
		{
			return pow(MOD - 2);
		}
		modint pow(ll t) const
		{
			if (t == 0)
				return 1;
			modint a = pow(t >> 1);
			a *= a;
			if (t & 1)
				a *= *this;
			return a;
		}
	};


	ll ModPow(ll a, ll p, ll mod)
	{
		if (p == 0)
			return 1;
		if (p % 2 == 0)
		{
			ll halfp = p / 2;
			ll half = ModPow(a, halfp, mod);
			return (half * half) % mod;
		}
		else
		{
			return (a * ModPow(a, p - 1, mod)) % mod;
		}
	}
	ll Combination(int n, int r, ll mod)
	{
		r = min(r, n - r);
		ll num = 1;
		ll den = 1;
		for (int i = 0; i < r; ++i)
		{
			num *= (n - i);
			num %= mod;
			den *= (i + 1);
			den %= mod;
		}
		ll ret = (num * ModPow(den, mod - 2, mod)) % mod;
		return ret;
	}
}

void ABC171F()
{
	const ll MOD = 1000000007;
	int K;
	cin >> K;
	string S;
	cin >> S;
	int N = S.size();
	modint last = 1;
	modint first = 1;
	for (int i = 0; i < K; ++i)
	{
		first *= 25;
	}

	modint sum = 0;
	modint comb = Combination(K + N - 1, N - 1, MOD);
	for (int i = 0; i <= K; ++i)
	{
		int m = K - i + N - 1;
		modint tmp = last;
		tmp *= first;
		tmp *= comb;
		comb *= m - (N - 1);
		comb /= m;

		sum += tmp;
		first /= 25;
		last *= 26;
	}
	cout << sum.x_ << endl;
}

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


Measured memory_bytes: 5336
#include <bits/stdc++.h>
#include <unistd.h>
#define ll long long
#define ull unsigned long long
#define inf 1000000007
#define inf16 0x3f3f3f3f
#define INF 1000000000000000007LL
#define VI vector<int>
#define VPII vector<pair<int, int> >
#define VLL vector<ll>
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define endl '\n'
#define ALL(c) (c).begin(), (c).end()
#define flush fflush(stdout)
using namespace std;

#define N 1007
#define int long long

int H, W, h, w, zle, dobre;

bitset<N> vis[N];

int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	cin >> H >> W >> h >> w;

	if(h*w==1)
	{
		cout << "No";
		return 0;
	}

	for(int i = 1; i+h-1 <= H; i += h)
	{
		for(int j = 1; j+w-1 <= W; j += w)
		{
			vis[i+h-1][j+w-1] = 1;
		}
	}

	for(int i = 1; i <= H; ++i)
	{
		zle += vis[i].count();
	}

	dobre = H*W-zle;

	if(-zle*h*w+dobre>0ll)
	{
		cout << "Yes" << endl;

		for(int i = 1; i <= H; ++i)
		{
			for(int j = 1; j <= W; ++j)
			{
				if(vis[i][j])
					cout << -h*w << " ";
				else
					cout << 1 << " ";
			}

			cout << endl;
		}
	}
	else
	{
		int d = (1000ll*1000*1000-1)/(h*w-1);
		int u = -d*(h*w-1)-1;

		if(zle*u+dobre*d>0ll)
		{
			cout << "Yes" << endl;

			for(int i = 1; i <= H; ++i)
			{
				for(int j = 1; j <= W; ++j)
				{
					if(vis[i][j])
						cout << u << " ";
					else
						cout << d << " ";
				}

				cout << endl;
			}
		}
		else
			cout << "No";
	}
}


Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin>>s;
	vi c(26,0);
	rep(i,4)c[s[i]-'A']++;
	int ans=0;
	rep(i,26)if(c[i]==2)ans++;
	Yn(ans==2);
	return 0;
}

Measured memory_bytes: 764
#include<iostream>
#include<vector>
using namespace std;

int m[101][101];

main()
{
  int n, u, k, v;
  
  cin >> n;

  for ( int i = 0; i < n; ++i ) {
    cin >> u >> k;
    --u;
    
    for ( int j = 0; j < k; j++ ) {
      cin >> v;
      --v;
      m[u][v] = 1;
    }
  }
  
  for ( int i = 0; i < n; i++ ) {
    for ( int j = 0; j < n; j++ ) {
      if (j) {
	cout << " ";
      }
      cout << m[i][j];
    }
    cout << endl;
  }

  return (0);
}



Measured memory_bytes: 3108
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define dbg(x) cout<<#x"="<<x<<endl

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;

#define INF 1000000000



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

  while(n-->0){
    string s;
    cin >> s;
    string rs = string(s);
    reverse(s.begin(), s.end());
    int sz=s.size();
    
    set<string> m;
    m.insert(s);
    m.insert(rs);
    rep(i,sz){
      if(i==0)continue;
      string s1=s.substr(0,i), //ab
	s2=s.substr(i,sz-i),   //cd
	s3=rs.substr(sz-i,i),  //ba
	s4=rs.substr(0,sz-i);  //dc

      m.insert(s1+s4);
      m.insert(s3+s2);
      m.insert(s3+s4);
      m.insert(s2+s1);
      m.insert(s2+s3);
      m.insert(s4+s1);
    }
/*
    for(auto it : m)
      cout << it << endl;
*/
    cout << m.size() << endl;
  }

}

Measured memory_bytes: 1288
import java.util.Scanner;

fun main (args: Array<String>) {
  val input = Scanner(System.`in`)
  
  while (input.hasNext()) {
    val a = input.next()[0];
    
    if (Character.isUpperCase(a)) {
      println("A") 
    } else {
      println("a") 
    }
  }
}

Measured memory_bytes: 36304
#include<bits/stdc++.h>
#define For(i,a,b) for(i=(a);i<=(b);++i)
#define Forward(i,a,b) for(i=(a);i>=(b);--i)
#define Rep(i,a,b) for(register int i=(a);i<=(b);++i)
#define Repe(i,a,b) for(register int i=(a);i>=(b);--i)
using namespace std;
template<typename T>inline void read(T &x)
{
	T s=0,f=1;char k=getchar();
	while(!isdigit(k)&&(k^'-'))k=getchar();
	if(!isdigit(k)){f=-1;k=getchar();}
	while(isdigit(k)){s=s*10+(k^48);k=getchar();}
	x=s*f;
}
/*void init()
{
}
void solve()
{
}*/
void done()
{
	printf("NO\n");
	exit(0);
}
int n,a[3];
char s[200010];
int main()
{
	//file();
	//init();
	//solve();
	scanf("%s",s);
	n=strlen(s)-1;
	Rep(i,0,n)++a[s[i]-'a'];
	int ma=max(a[0],max(a[1],a[2])),mi=min(a[0],min(a[1],a[2]));
	if(ma-mi>1)printf("NO\n");
	else printf("YES\n");
	return 0;
}



Measured memory_bytes: 384
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int top, S[1000];

void push(int x) {
    top++;
    S[top] = x;
}


int pop() {
    top--;
    return S[top+1];
}


int main() {
    int a, b;
    char s[1000];
    top = 0;

    while ( scanf("%s", s) != EOF ) {
        if ( s[0] == '+' ) {
            a = pop();
            b = pop();
            push(a+b);
        } else if ( s[0] == '-' ) {
            a = pop();
            b = pop();
            push(b-a);
        } else if ( s[0] == '*' ) {
            a = pop();
            b = pop();
            push(a*b);
        } else {
            push(atoi(s));
        }
    }


    printf("%d\n", pop());
    
    return 0;
}


Measured memory_bytes: 2764
from sys import setrecursionlimit
from collections import deque
import heapq

N, K = map(int, input().split())
V_array = list(map(int, input().split()))

ans = 0
D = V_array + V_array
# print(D)

for pop_count in range(K, 0, -1):
    if pop_count > N:
        continue
    append_count = K - pop_count
    for pop_index in range(N - pop_count, N + 1, 1):
        popped_object = D[pop_index:pop_index + pop_count]
        popped_object.sort()
        popped_sum = sum(popped_object)
        for i in range(min(pop_count, append_count)):
            if popped_object[i] < 0:
                popped_sum -= popped_object[i]
            else:
                break
        ans = max(ans, popped_sum)

print(ans)

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

using namespace std;
#define FOR(i,a,b) for(int (i) = (a); (i) < (b); (i)++)
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)

int main(){
  long long n;
  long long k;
  cin >> n >> k;

  long long ans;
  long long a;
  a = n / k;
  ans = min(abs(n - k*a), abs(n - k*(a+1)));

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define f first
#define s second

using namespace std;

typedef long long ll;

const int INF = 1e9 + 7;

ostream& operator << (ostream &os, vector <int> &v) {
    for (int i : v)
        os << i << " ";
    os << "\n";
    return os;
}

main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n, k;
    cin >> n >> k;
    vector <int> h(n), dp(n + k - 1, INF);
    for (int& i : h)
        cin >> i;
    dp[0] = 0;
    for (int i = 0; i < n; ++i)
        for (int j = 1; j <= k; ++j)
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]));
    cout << dp[n - 1] << "\n";
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

int main(){

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

    ll a[3][3];
    rep(i, 3){
        rep(j, 3){
            cin >> a[i][j];
        }
    }
    ll n; cin >> n;
    ll b[n];
    rep(i, n){
        cin >> b[i];
    }

    // rep(i, 3){
    //     rep(j, 3){
    //         cout << a[i][j] << " ";
    //     }
    //     cout << endl;
    // }

    // rep(i, n){
    //     cout << b[i] << endl;
    // }

    bool check[3][3] = {};

    rep(i, n){
        rep(j, 3){
            rep(k, 3){
                if(a[j][k] == b[i]){
                    check[j][k] = true;
                }
            }
        }
    }

    // check row or clm
    rep(i, 3){
        if(check[0][i] + check[1][i] + check[2][i] == 3){
            cout << "Yes" << endl;
            return 0;
        }
        if(check[i][0] + check[i][1] + check[i][2] == 3){
            cout << "Yes" << endl;
            return 0;
        }
    }

    // check diag
    if(check[0][0] + check[1][1] + check[2][2] == 3){
        cout << "Yes" << endl;
        return 0;
    }
    if(check[2][0] + check[1][1] + check[0][2] == 3){
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;

    // rep(i, 3){
    //     rep(j, 3){
    //         cout << check[i][j] << " ";
    //     }
    //     cout << endl;
    // }

    // cout << check[0][0] + check[1][1] + check[2][2] << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

bool order(const P &p0, const P &p1) {
	return p0.first < p1.first;
}

int main()
{
    ll n, m;
    cin >> n >> m;
    ll a[100001], b[100001];
    P p[100001];
    for(int i = 0; i < n; i++){
        cin >> a[i] >> b[i];
        p[i] = P(a[i], b[i]);
    }
    ll ans = 0;
    ll count = 0;
    sort(p, p + n, order);
    for(int i = 0; i < n; i++){
        ll ma = p[i].second;
        if(count + ma < m){
            count += ma;
            ans = ans + p[i].first * ma;
        }
        else{
            ans = ans + p[i].first * (m - count);
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3328
#include <math.h>
#include <ctype.h>
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, n) for (int i = a; i < n; i++)
#define REP(i, n) for(int i = 0; i < n; i++)
struct omt{omt(){ios::sync_with_stdio(false);cin.tie(0);}}star;

int main(){
    int x, a, b;
    cin >> x >> a >> b;
    x -= a;
    cout << x % b << endl;


    return 0;
}

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

#define ll long long
#define all(x) (x).begin(), (x).end()
const long long INF = 1LL << 60;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //(i, 10) i=0～i=9まで
#define repr(i, n) for (int i = n; i >= 0; i--)   // (i, 10) i=10～i=0まで
#define FOR(i, m, n) for (int i = m; i < n; i++)  // (i, 3, 10) i=3～i=9まで

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;

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

    // 入力
    int x, a;
    cin >> x >> a;

    // 処理
    if (x < a) {
        cout << 0 << endl;

    } else if (x >= a) {
        cout << 10 << endl;
    }

    // 出力

    return 0;
}


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

#define lint long long
#define P pair<int, int>
#define LLP pair<long long, long long>
#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define repr(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())

const int IINF = 1e9 + 100;
const long long LLINF = 2e18 + 129;
const long long MOD = 1e9 + 7;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;

struct node{
    int x, cost;

    bool operator<(const node & right) const {
        return cost > right.cost;
    }
};

template<typename T>
bool chmin(T &a, T b){
    if(a > b){
        a = b;
        return true;
    }else{
        return false;
    }
}

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

    int n, x;
    cin >> n >> x;

    vector<int> d(n), c(n);
    rep(i, n){
        cin >> d[i] >> c[i];
    }

    vector<int> cost((int)3e5 + 1, IINF);
    priority_queue<node> que;
    que.push({(int)1e5, 0});
    while(!que.empty()){
        node now = que.top();
        que.pop();
        if(!chmin(cost[now.x], now.cost)){
            continue;
        }
        rep(i, n){
            if(now.x + d[i] <= (int)3e5 && cost[now.x + d[i]] > now.cost + c[i]){
                que.push({now.x + d[i], now.cost + c[i]});
            }
            if(now.x - d[i] >= 0 && cost[now.x - d[i]] > now.cost + c[i]){
                que.push({now.x - d[i], now.cost + c[i]});
            }
        }
    }

    if(cost[x + (int)1e5] < IINF){
        cout << cost[x + (int)1e5] << endl;
    }else{
        cout << -1 << endl;
    }

    return 0;
}


Measured memory_bytes: 20432
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
list = [0]
x, y = 0, 0

v_sort = sorted(v,reverse = True)
c_sort = sorted(c,reverse = True)

for i in range(len(v)):
    if v[i] > c[i]:
        x += int(v[i])
        y += int(c[i])
        list.append(x - y)
    else:
        continue

print(max(list))

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


#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define F first
#define S second

using namespace std;
using namespace __gnu_pbds;

template<class T> using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
using ll  = long long;

using point = complex<double>;
using ii = pair<int,ll>;

void err(istream_iterator<string> it) {cerr << endl;}
template<typename T, typename... Args>void err(istream_iterator<string> it, T a, Args... args) {cerr << *it << " = " << a << endl;err(++it, args...);}




const int dx[] = {0, -1,1,0,1,-1, 1,-1};
const int dy[] = {1 , 0, 0, -1,1,-1,-1, 1};

const double EPS = 1e-9;
const long long mod = 1e9 + 7;
const long long INF = 1e18;
const int N = 1e6 + 5;
const ll CONSTANT = 9e18 + 7;


int add(int a, int b){
    return (a + b) % mod;
}
int dp[2500];
int solve(int sum){

    if(sum == 0)
            return 1;

    int &ret = dp[sum];
    if(~ret)
            return ret;
    ret = 0;
    for(int i = 3; i <= sum; ++i){
        ret = add(ret, solve(sum-i));
    }
    return ret;
}
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int s;
    cin >> s;
    memset(dp,-1,sizeof dp);
    cout << solve(s) << '\n';

    return 0;
}


Measured memory_bytes: 3624
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
mod = 10**9+7 # 変える
fac = [1]*n
finv = [1]*n
inv = [0]*n
inv[1] = 1
for i in range(2,n):
    fac[i] = fac[i-1]*i % mod
    inv[i] = mod - inv[mod%i] *(mod//i) %mod
    finv[i] = finv[i-1] * inv[i] % mod
def comb(n,k):
    if n<k:
        return 0
    if n<0 or k<0:
        return 0
    return fac[n]*(finv[k] * finv[n-k] % mod)%mod
ans=0
for i in range(n-k+1):
    ans+=comb(n-i-1,k-1)*(a[n-i-1]-a[i])
print(ans%mod)

Measured memory_bytes: 19024
#include<stdio.h>
int main()
{
    long long x,y,srx,sum=0;
    scanf("%lld%lld",&x,&y);
    srx=((long long)(y/x));
    while(srx>=1)
    {srx/=2;
    sum++;}
    printf("%d\n",sum);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
using P = pair<int, int>;
const int INF = 1001001001;

int main(void){
  int n;
  cin >> n;
  map<int, int> a, b;
  REP(i, n){
    int v;
    cin >> v;
    if(i%2){
      a[v]++;
    }else{
      b[v]++;
    }
  }
  vector<P> s, t;
  for(auto p : a) s.emplace_back(P(p.second, p.first));
  for(auto p : b) t.emplace_back(P(p.second, p.first));
  sort(ALLr(s));
  sort(ALLr(t));
  if(s.size() == 1 && t.size() == 1){
    if(s[0].second == t[0].second){
      cout << n/2 << endl;
    }else{
      cout << 0 << endl;
    }
    return 0;
  }
  if(s.size() > t.size()) swap(s, t);
  if(s.size() == 1){
    if(s[0].second == t[0].second){
      cout << n/2-t[1].first << endl;
    }else{
      cout << n/2-t[0].first << endl;
    }
    return 0;
  }
  if(s[0].second != t[0].second){
    cout << n-s[0].first-t[0].first << endl;
    return 0;
  }
  int m = max(s[0].first+t[1].first, s[1].first+t[0].first);
  cout << n-m << endl;
  return 0;
}

Measured memory_bytes: 6136
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long
int dp[200010];

int prev1[200010];
int prev2[200010];

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int C[200010];
    rep(i, N) cin >> C[i];
    rep(i, N) {
        if(prev1[C[i]] != 0) prev2[i] = prev1[C[i]];
        prev1[C[i]] = i + 1;
    }
    dp[0] = 1;
    // rep(i, N) cout << prev2[i] << " ";
    // cout << endl;
    rep(i, N) {
        if(prev2[i] != 0 && prev2[i] != i)
            dp[i + 1] += dp[prev2[i]];
        dp[i + 1] += dp[i];
        dp[i + 1] %= mod;
    }
    // rep(i, N + 1) cout << dp[i] << " ";
    // cout << endl;
    cout << dp[N] << endl;

    return 0;
}
// 3 1 4 3 1 3
// 3 3 3 3 1 3
// 3 1 1 1 1 3
// 3 1 4 3 3 3
// 3 3 3 3 3 3

// 1 2 1 2 3 2

Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
vector <long long int> v;
vector <double> vd;
 
vector <char> vc;
vector <string> vs;
map <string,int> sm;
map <int,int> mp;
map <char,int>cm;
set <int> st;
#define For(n) for(int i=0; i<n; i++)
//#define sort(v) sort(v.begin(),v.end());
#define vecprint(v){for(int i=0; i<v.size(); i++)cout << v[i];}
//int string_to_int(string s){stringstream x(s);double a=0; x>>a; return a;}
long long int gcd(long long int a, long long int b){if(a%b==0)return b;return gcd(b, a%b);}
long long int lcm(long long int a, long long int b){return (a*b)/gcd(a, b);}
//int string_sum(string s){int b = 0;auto k =s.size();for(int j=0; j<k; j++){b +=(s[j]-48);}return b;}
//long long int factorial(long long int n){if (n == 0)return 1;return n * factorial(n - 1);}
 
//int cnt =0;
 
void SieveOfEratosthenes(int n=20000000)
{
   // v.push_back(1);
 
//    bool prime[n+1];
//    memset(prime, true, sizeof(prime));
 
    vector <bool>prime(n+1,true);
 
    for (int p=2; p*p<=n; p++)
    {
 
        if (prime[p] == true)
        {
 
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
 
 
    for (int p=2; p<=n; p++)
       if (prime[p])
          mp[p]++;
}
 
 
//int mod(string num, int a)
//{
//    // Initialize result
//    int res = 0;
//
//    // One by one process all digits of 'num'
//    for (int i = 0; i < num.length(); i++)
//         res = (res*10 + (int)num[i] - '0') %a;
//
//    return res;
//}
 
//vector <int> arr(100,-1);
//
//int fib(int n)
//{
//    if(n<=1)return 1;
//
//    if(arr[n]==-1)
//    {
//        arr[n] = fib(n-1)+fib(n-2);
//    }
//    //else return arr[n];
//
//   return arr[n];
//}
 
 
//int arr[1050][1050];
//
//int mx=0;
//int LCS(string s, string p)
//{
//    for(int i=1; i<=s.size(); i++)
//    {
//        for(int j=1; j<=p.size(); j++)
//        {
//
//            if(s[i-1]==p[j-1])
//                arr[i][j]=1+arr[i-1][j-1];
//            else
//                arr[i][j]=max(arr[i-1][j],arr[i][j-1]);
//
//        }
//    }
//    return arr[s.size()][p.size()];
//}
//
//
//void primeFactors(long double n)
//{
//
//    while(fmod(n, 2)==0)
//    {
//        x++;
//        n /= 2;
//    }
//    h+=x;
//    x=0;
//
//    for(int i=3; i<=sqrt(n); i+=2)
//    {
//
//        while(fmod(n, i)==0)
//        {
//            x++;
//            n /= i;
//        }
//        h+=x;
//        x=0;
//
//    }
//
//    if(n>2){
//        h++;
//    }
//
//}
 
int main()
{

     int a,b=0,c=1,n;
    
    
    cin >> n ;
    
    
    for(int i=0; i<n; i++)
    {
        cin >> a;
        v.push_back(a);
    }
    
    
    for(int i=0; i<n; i++)
    {
        if(v[i]==c)
        {
            c++;
        }
        else b++;
        
        
    }
    
    if(b==n)cout << -1 << endl;
    else
    cout << b << endl;
    
    
    
  
    return 0;
}
 


Measured memory_bytes: 2420
#include <iostream>
using namespace std;
int main() {
    int length = 0;
    cin >> length;
    int* data = new int[length];

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

    int swap_times = 0;
    for (int i = 0; i < length - 1; ++i) {
        int min = data[i];
        int min_index = i;
        for (int j = i; j < length; ++j) {
            if (data[j] < min) {
                min = data[j];
                min_index = j;
            }   
        }   
        if (min < data[i]) {
            swap(data[min_index], data[i]);
            ++swap_times;
        }   
    }   

    for (int i = 0; i < length; ++i) {
        if (i < length - 1) {
            cout << data[i] << " ";
        } else {
            cout << data[i] << endl;
        }   
    }   
    cout << swap_times << endl;
}

Measured memory_bytes: 3092
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, Z, W; cin >> N >> Z >> W;
  int a[2020]; rep(i, N) cin >> a[i];
  int x = abs(W - a[N - 1]);
  if(N >= 2) x = max(abs(a[N - 1] - a[N - 2]), x);
  cout << x << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
# define FOR(i,a,n) for(register int i=a; i<=n; ++i)
# define FDR(i,a,n) for(register int i=a; i>=n; --i)
typedef long long ll;
typedef unsigned long long ull;

inline int scan() {
    int x=0,f=1; char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}
inline void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
using namespace std;
char str[305][305];
char str1[305][305];
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
    cin >> str[i];
    int ans = 0;
    int a = 0;
    int b = 0;
    for(int i = 0; i <= n-1; i++){
        for(int j = 0; j < n; j++){
            for(int k = 0; k < n; k++)
            str1[j][k] = str[j][(k+i)%n];
        }
        bool flag = true;
        for(int j = 0; j < n; j++){
            for(int k = 0; k < n; k++){
                if(str1[j][k] != str1[k][j])flag = false;
            }
        }
        if(flag)a++;
    }
    for(int i = 0; i <= n-1; i++){
        for(int j = 0; j < n; j++){
            for(int k = 0; k < n; k++)
            str1[j][k] = str[(j+i)%n][k];
        }
        bool flag = true;
        for(int j = 0; j < n; j++){
            for(int k = 0; k < n; k++){
                if(str1[j][k] != str1[k][j])flag = false;
            }
        }
        if(flag)b++;
    }
    ans = (a+b)*n/2;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>

using namespace std;

bool binary_search(int n, int l[], int m);

int main(){

	int n;
	int q;
	int tmp;
	int ans = 0;

	cin >> n;

	int l[n];
	for (int i=0; i<n; i++){
		cin >> tmp;
		l[i] = tmp;
	}

	cin >> q;

	for (int i=0; i<q; i++){
		cin >> tmp;
		if (binary_search(n,l,tmp)){
			ans++;
		}
	}

	cout << ans << endl;

	return 0;
}


bool binary_search(int n, int l[], int m){
	int right;
	int left;
	int tmp;
	bool included;

	left = 0;
	right = n-1;
	while (left != right){
		tmp = int((right + left) / 2);
		if (l[tmp] >= m){
			right = tmp;
		}
		else{
			left = tmp+1;
		}
	}
	return (l[right]==m);
}


Measured memory_bytes: 3404
import fractions

N,K = map(int,input().split())
A = list(map(int,input().split()))

n = A[0]
for i in range(N):
    n = fractions.gcd(n, A[i])

if K<=max(A) and K%n==0:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

Measured memory_bytes: 16240
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define len(X) (X).size()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tiii tuple<int, int, int>
#define Tlll tuple<ll, ll, ll>

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    ll r = a % b;
    while (r != 0) {
        a = b;  b = r;
        r = a % b;
    }
    return b;
}

ll pw(ll x, ll y, ll mod) {
    if (y == 0) return 1;
    else if (y == 1) return x % mod;
    else if (y % 2 == 0) {
        ll p = pw(x, y / 2, mod);
        return p * p % mod;
    }
    else {
        ll p = pw(x, y / 2, mod);
        return p * p % mod * x % mod;
    }
}

ll dv(ll x, ll y, ll mod) {
    x %= mod;
    y %= mod;
    return x * pw(y, mod - 2, mod) % mod;
}
 
ll comb(ll n, ll r, ll mod) {
    ll v = 1;
    if (n < r || n < 0 || r < 0) return 0;
    for (int i = 1; i <= r; i++) {
        v = v * dv(n - i + 1, i, mod) % mod;
    }
    return v;
}

int main() {
    ll n, a, b, k, mod = 998244353;
    cin >> n >> a >> b >> k;

    ll p = n + 1;
    for (int i = 0; i < b; i++) {
        if ((k - i*a) % b == 0) {
            p = i;
            break;
        }
    }
    ll q = (k - p*a) / b;
    ll l = a / gcd(a, b) * b;
    while (q < 0 || n < q) {
        p += l / a;
        q -= l / b;
    }
    if (p > n) {
        cout << 0 << endl;
        return 0;
    }
    
    ll ans = 0;
    ll ci = comb(n, p, mod), cj = comb(n, q, mod);
    for (ll i = p; i <= n; i += l / a) {
        ll j = (k - i*a) / b;
       // cout << i _ j << endl;
        if (0 <= j && j <= n) {
            ans += ci * cj;
            ans %= mod;
            for (int x = 1; x <= l / a; x++) {
                ci = ci * dv(n - i - x + 1, i + x, mod) % mod;
            }
            for (int x = 1; x <= l / b; x++) {
                cj = cj * dv(j - x + 1, n - j + x, mod) % mod;
            }
            //cout << ans _ ci _ cj << endl;
        }
    }
    cout << ans << endl;


}


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

int main() {
  string s,t;
  cin>>s>>t;
  int a;
  if(s[0]==t[0])a++;
  if(s[1]==t[1])a++;
  if(s[2]==t[2])a++;
  cout<<a<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size() 
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,n) for(int i=1;i<=n;i++)
#define ford(i,n) for(int i=n;i>=0;i--) 
#define REP(i,a,n) for(int i=a;i<n;i++)
#define foreach(c,itr) for(__typeof((c).begin(),(c).end())itr=c.begin();itr!=c.end();itr++) 
#define fill(a,b) memset(a,b,sizeof(a))
#define re return
#define INF 1e9
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi > vpi; 
int main(){
	int r;
	cin>>r;
	cout<<r*r; 
	re 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int cmp(const int *a, const int *b){
  return *a - *b;
}
int main(){
  int n;
  scanf("%d",&n);
  int l[n];
  for(int i=0;i<n;i++)scanf("%d",&l[i]);
  //qsort(l,n,4,cmp);
  for(int i=0;i<n;i++){
    for(int j=n-1;j>i;j--){
      if(l[j]<l[j-1]){
        int tmp = l[j];
        l[j]=l[j-1];
        l[j-1]=tmp;
      }
    }
  }
  int ans=0;
  for(int i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++){
      for(int k=j+1;l[i]+l[j]>l[k]&&k<n;k++)ans++;
    }
  }
  printf("%d",ans);
}


Measured memory_bytes: 128
import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void log(A...)(A arg) {
    stderr.writeln(arg);
}
int size(T)(in T s) {
    return cast(int)s.length;
}

void main() {
    int N = readln.chomp.to!int;
    auto A = readln.chomp.split(" ").map!(to!int).array;

    int ans = -1;
    void f(int a, int b) {
        int x = a * b;
        string s = x.to!string;
        int t = -1;
        foreach (c_; s) {
            int c = cast(int)(c_ - '0');
            if (t >= 0 && c - t != 1) return;
            t = c;
        }
        ans = max(ans, x);
    }

    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            int a = A[i], b = A[j];
            f(a, b);
        }
    }
    writeln(ans);
}

Measured memory_bytes: 3500
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		
		Scanner scan =new Scanner(System.in);
		int n=scan.nextInt();
		int[] arr=new int[n];
		for(int i=0;i<n;i++){
			arr[i]=scan.nextInt();
		}
		//insertsort(arr,n);
		//bubblesort(arr,n);
		selectSort(arr, n);
	}

	public  static  void selectSort(int[] arr,int n){
		int sum=0;
		for(int i=0;i<n;i++){
			int min=i;
			for(int j=i+1;j<n;j++){
				if(arr[min]>arr[j])
					min=j;
			}
			
			if(min!=i){
				swap(arr,min,i);
				sum++;
			}
				
		}
		arrPrint(arr);
		System.out.println(sum);
	}
	private static void swap(int[] arr, int i,int j) {
		// TODO Auto-generated method stub
		int tmp=arr[i];
		arr[i]=arr[j];
		arr[j]=tmp;
	}

	public  static void insertsort(int[] arr,int n){
		arrPrint(arr);
		for(int i=1;i<n;i++){
			int tmp=arr[i];
			int j=i-1;
			while(j>=0&&arr[j]>tmp){
				arr[j+1]=arr[j];
				j--;
			}
			arr[j+1]=tmp;
			arrPrint(arr);
		}
	}
	
	public static void bubblesort(int[] arr,int n){
		int res=0;
		for(int i=0;i<n;i++){
			boolean flag=false;
			for(int j=n-1;j>i;j--){
				if(arr[j]<arr[j-1]){
					int tmp=arr[j];
					arr[j]=arr[j-1];
					arr[j-1]=tmp;
					flag=true;
					res++;
				}
				
			}
			if(flag==false)
				break;
		}
		arrPrint(arr);
		System.out.println(res);
	}
	
	
	public static void arrPrint(int[] arr){
		int i=0;
		for(i=0;i<arr.length-1;i++)
			System.out.print(arr[i]+" ");
		System.out.println(arr[i]);
	}
}



Measured memory_bytes: 26344
#include<stdio.h>
int main()
{
    int A,B,C;
    scanf("%d%d%d",&A,&B,&C);
    if(A==B && A!=C)
        printf("Yes\n");
    else if(A==C && A!=B)
        printf("Yes\n");
    else if(B==C && B!=A)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}

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

int main()
{
    char a;
    cin>>a;
    if (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
    {
        cout <<"vowel";
    }
    else
    {
        cout <<"consonant";
    }

    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 N = sc.nextInt();
        Set<String> s = new HashSet<String>();
      
        for (int i=0; i<N; i++) {
            String a = sc.next();
          s.add(a);
        }        
		// 文字列の入力
		System.out.println(s.size());
	}
}

Measured memory_bytes: 65924
#include<bits/stdc++.h>
typedef long long ll;
#define REP(i,n) for(int i = 0;i < (n);i++)
#define rep(i,m,n) for(int i = (m);i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
#define Vec(a) vector <int> a
const int INF = 1 << 20;
const int MOD = 1e9+7;





int main(){
  int n,x;
  cin >> n >> x;
  
  if(x == 2*n-1 || x == 1){
    cout << "No" << endl;
  }
  else if(n == 2){
    cout << "Yes" << endl;
    REP(i,3){
      cout << i+1 << endl; 
    }
    return 0;
  }
  else{
    int a[2*n-1];
    vector <int> b;
    if(x != 2){
      REP(i,2*n-1){
	//int pos = (2*n-1)/2;
	if(i+1 != x && i+1 != x-1 && i+1 != x-2 && i+1 != x+1){
	  b.pb(i+1);
	}
      }
      int p = 0;
      REP(i,2*n-1){
	int pos = (2*n-1)/2;
	if(i == pos)
	  a[i] = x;
	else if(i == pos-1)
	  a[i] = x-1;
	else if(i == pos+1)
	  a[i] = x+1;
	else if(i == pos+2)
	  a[i] = x-2;
	else{
	  a[i] = b[p];
	  p++;
	}
      }
      cout << "Yes" << endl;
      REP(i,2*n-1){
	cout << a[i] << endl;
      }
      return 0;
    }
    else{
      REP(i,2*n-1){
	//int pos = (2*n-1)/2;
	if(i+1 != 1 && i+1 != 3 && i+1 != 2 && i+1 != 4){
	  b.pb(i+1);
	}
      }
      int p = 0;
      REP(i,2*n-1){
	int pos = (2*n-1)/2;
	if(i == pos)
	  a[i] = 2;
	else if(i == pos-1)
	  a[i] = 3;
	else if(i == pos+1)
	  a[i] = 1;
	else if(i == pos+2)
	  a[i] = 4;
	else{
	  a[i] = b[p];
	  p++;
	}
      }
      cout << "Yes" << endl;
      REP(i,2*n-1){
	cout << a[i] << endl;
      }
      return 0;
    }
  }
  return 0;
}


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

ll g(ll a,ll b){
  int n;
  while(a%b!=0){
    n=a%b;
    a=b;
    b=n;
  }
  return b;
}

int main(){
  int i,j,cnt=0;
  int n;ll x;
  cin>>n>>x;
  ll a[n+1];
  a[0]=x;
  for(i=1;i<=n;i++)cin>>a[i];
  sort(a,a+n+1);
  ll b[n];
  for(i=0;i<n;i++)b[i]=a[i+1]-a[i];
  sort(b,b+n);
  cnt=b[0];
  for(i=1;i<n;i++)cnt=g(cnt,b[i]);
  cout<<cnt<<endl;
}

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

int main() {
  int H,W;
  cin>>H>>W;
  string s;
  for(int i =0; i<W+2; i++){
     s+="#";
  }
  cout<<s<<endl;
  for(int i =0; i<H; i++){
    string str;
    cin>>str;
    cout<<"#"+str+"#"<<endl;
  }
  cout<<s<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#define rep(i,a,b) for(int (i)=(a);i<(b);i++)
#define INF 1000000000
#define MAX_N 100005
using namespace std;

int main(){
    int N,W;
    int v[102],w[102];
    int dp[102][10002];
    
    cin>>N>>W;
    rep(i,0,N)cin>>v[i]>>w[i];
    rep(i,0,N)dp[i][0]=0;
    rep(i,0,N)dp[0][i]=0;
    
    rep(i,1,N+1){
        rep(j,1,W+1){
            if(j-w[i-1]>=0)dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i-1]]+v[i-1]);
            else dp[i][j]=dp[i-1][j];
        }
    }
    
    cout<<dp[N][W]<<endl;
    
    return 0;
}

Measured memory_bytes: 7020
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;
const int N = 2e5 + 100;

long long n, cnt, k;
string str;
int main()
{
    cin >> str;
    for (int i = 0; i < str.size(); i++)
    {
        if (str[i] != '1')
            break;
        cnt++;
    }
    cin >> k;
    if (k <= cnt)
        printf("1\n");
    else
        printf("%c\n", str[cnt]);
}

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

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


Measured memory_bytes: 256