akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define in insert
#define er erase
#define fr first
#define sc second
const int inf=INT_MAX;
const int nmax=1e5+5;
const int mod=1e9+7;
typedef long long ll;
using namespace std;
int n,i,a[101],sum;
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
	//freopen("sol.in","r",stdin);
	cin>>n;
	for(i=1;i<=n;i++)cin>>a[i],sum+=a[i];
	sort(a+1,a+n+1);
	if((sum%10))cout<<sum<<endl;
	else
	{
		for(i=1;i<=n;i++)if((a[i]%10))break;
		if(i<=n)cout<<sum-a[i]<<endl;
		else cout<<0<<endl;
	}
	return 0;
}

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



int main() {
  ll n, d, count = 0;
  cin >> n >> d;
  vector<ll> A(n);
  for(int i = 0; i < n; i++) {
    ll a, b;
    cin >> a >> b;
    A[i] = a * a + b * b;
  }
  
  for(int i = 0; i < n; i++) {
    if(A[i] <= d * d) count++;
  }

  cout << count << endl;
}

Measured memory_bytes: 4788
#include<iostream>
#include<string>
#define ll long long
using namespace std;
int main(){
	string str;
	int ab[26]={};
	while(getline(cin,str)) {
		for (int i = 0; i < str.size(); i++) {
			if(str[i]>='a'&&str[i]<='z') ab[str[i]-'a']++;
			else if(str[i]>='A' && str[i]<='Z') ab[str[i]-'A']++;
		}
		
		}
		for (int i = 0; i < 26; i++) {
			cout << (char)('a'+i) << " : " << ab[i] << endl;
	}
}


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

using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using f64 = double;
using f80 = long double;

#define FOR(v, a, b) for(i64 v = (a); v < (b); ++v)
#define FORE(v, a, b) for(i64 v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(i64 v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define UNIQ(v) (v).erase(unique(ALL(v)), (v).end())
#define bit(i) (1LL<<(i))

#ifdef DEBUG
#include <Mylib/Debug/debug.cpp>
#else
#define dump(...) ((void)0)
#endif

using namespace std;

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T> void puts_all(const T &value){std::cout << value << "\n";}
template <typename T, typename ...Args> void puts_all(const T &value, const Args&... args){std::cout << value << " ";puts_all(args...);}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}
template <typename T> auto make_vector(int n, int m, const T &value){return vector<vector<T>>(n, vector<T>(m, value));}


struct Init{
  Init(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cerr << fixed << setprecision(12);
  }
}init;



int main(){
  int N, M;

  while(cin >> N >> M){
    int ans = -1;

    vector<int> s(M), c(M);
    REP(i,M) cin >> s[i] >> c[i];

    FORE(i,0,1000){
      auto S = to_string(i);
      if((int)S.size() == N){
        bool t = true;

        REP(j,M){
          if(S[s[j]-1] != '0'+c[j]) t = false;
          
        }

        if(t){
          ans = i;
          break;
        }
      }
    }
    
    
    puts_all(ans);    
    
  }

  return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))

L_list = {}
R_list = {}
cnt = 0
for i in range(N):
    L = i+1 + A[i]
    R = i+1 - A[i]

    if L in R_list.keys():
        cnt += R_list[L]
    if R in L_list.keys():
        cnt += L_list[R]

    if L in L_list.keys():
        L_list[L] += 1
    else:
        L_list[L] = 1
    if R in R_list.keys():
        R_list[R] += 1
    else:
        R_list[R] = 1

print(cnt)

Measured memory_bytes: 134960
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
 while(1){
  ll n,m;
  cin>>n>>m;
  if(n == 0 ) break;
  vector<ll> c(m),x(n);
  for(ll i=0;i<m;i++)cin>>c[i];
  for(ll i=0;i<n;i++)cin>>x[i];
  vector<vector<ll> > dp(n+1,vector<ll>(256,inf) );
  dp[0][128] = 0;
 //cout<<"OK"<<endl;
  for(ll i=0;i<n;i++){
   for(ll j=0;j<256;j++){
    if( dp[i][j] == inf ) continue;
    for(ll k=0;k<m;k++){
     //if( 0<= j+c[k] && j + c[k] < 256 ){
      ll next = min(max(0ll,j+c[k]),255ll);
      dp[i+1][next] = min( dp[i+1][next] , dp[i][j] + ( next - x[i] )*( next - x[i] ) );
     //}
 /*    if( j - c[k] >= 0 ){
      dp[i+1][j-c[k]] = min( dp[i+1][j-c[k]] , dp[i][j] + ( j-c[k] - x[i] )*( j-c[k] - x[i] ) );
     }*/
    }

   }
  }
  ll res = inf;
  for(ll i=0;i<256;i++) res = min( res , dp[n][i] );
  cout<<res<<endl;

 }
    return 0;
}



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

int main() {
	int n;
	while (cin >> n) {
		int ans = 0;
		for (int a = 0; a < 10; a++) {
			for (int b = 0; b < 10; b++) {
				for (int c = 0; c < 10; c++) {
					for (int d = 0; d < 10; d++) {
						if (a + b + c + d == n) ans++;
					}
				}
			}
		}
		cout << ans << endl;
	}
}

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int) (x).size()

const int maxn = 2005;

int n, k;
int dp[2][maxn][maxn][2];
int Dp[maxn][maxn];

const int mod = 924844033;

void add(int &a, int b){
    a += b;
    if(a >= mod){
        a -= mod;
    }
}

void init(){
    dp[0][0][0][1] = 1;
    dp[1][0][0][0] = 1;
    for(int iter = 0;iter < 2;iter++){
        for(int i = 1;i <= n;i++){
            for(int j = 0;j <= n;j++){
                for(int k = 0;k < 2;k++){
                    add(dp[iter][i][j][0], dp[iter][i - 1][j][k]);
                }
                add(dp[iter][i][j + 1][1], dp[iter][i - 1][j][1]);
                add(dp[iter][i][j + 1][0], dp[iter][i - 1][j][0]);
                add(dp[iter][i][j + 1][1], dp[iter][i - 1][j][0]);
            } 
        }
    }
}

int M[maxn];
int fac[maxn];

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n >> k;
    init();     
    int m = 0;
    Dp[0][0] = 1;
    for(int st = 1;st <= min(n, 2 * k);st++){
        int ed = st;
        m++;
        for(;ed <= n;ed += 2 * k){}
        ed -= 2 * k;
        int len = (ed - st) / (2 * k) + 1;
        for(int j = 0;j <= n;j++){
            for(int l = 0;l <= len;l++){
                int S, T;
                if(st - k > 0){
                    S = 1;
                }else
                    S = 0;
                int tmp = dp[S][len][l][0];
                if(ed + k <= n){
                    add(tmp, dp[S][len][l][1]);
                }
                if(j - l >= 0){
                    add(Dp[m][j], 1LL * Dp[m - 1][j - l] * tmp % mod);
                }
            }    
        }
    } 
    for(int j = 0;j <= n;j++){
        M[j] = Dp[m][j];
    }
    fac[0] = 1;
    for(int i = 1;i <= n;i++){
        fac[i] = 1LL * fac[i - 1] * i % mod;
    }
    int ans = 0;
    for(int i = 0;i <= n;i++){
        if(i & 1){
            ans = (ans - 1LL * M[i] * fac[n - i] % mod + mod) % mod;
        }else{
            ans = (ans + 1LL * M[i] * fac[n - i] % mod + mod) % mod;
        }
    }
    cout << ans << endl;
    return 0;
}


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

int main(){
  int n;cin>>n;
  pair<int, int> robo[100001];
  
  REP(i,n){
    int x,l;cin>>x>>l;
    robo[i].first=x+l;
    robo[i].second=x-l;
  }
  sort(robo,robo+n);
  
  int ans=0,t=-1e9;
  REP(i,n){
    //cout<<robo[i].second<<" "<<robo[i].first<<endl;
    if(t<=robo[i].second){
      ans++;
      //cout<<ans<<endl;
      t=robo[i].first;
    }
  }
  
  cout<<ans;
}

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

int main(){
    int N;
    cin>>N; N%=10;
    if(N==2 || N==4 || N==5 || N==7 || N==9) cout<<"hon";
    else if(N==0 ||N==1||N==6||N==8) cout<<"pon\n";
    else cout<<"bon";
}

Measured memory_bytes: 3636
S = list(str(input()))
del S[-1]
del S[-1]

def ss(string):
    if len(string)&2==1:
        retrun(False)
    else:
        for i in range(len(string)//2):
            if S[i]!=S[len(string)//2+i]:
                return(False)
        return(True)

while True:
    if ss(S):
        print(len(S))
        exit()
    else:
        del S[-1]
        del S[-1]


Measured memory_bytes: 9068
/*
Author: Racer5x
 ***************************************   UNAUTHORISED COPYING OF CODE PROHIBITED   **********************************
*/
 
// #pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include<bits/stdc++.h>
#define int         long long
#define double      long double
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define endl        '\n'
#define hell        998244353 
#define PI          3.141592653589
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MAX         2000000000000000000
#define M           1000000007
 
using namespace std;
 
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int power(int x,int n){
    int result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x) % hell;
        x=(x*x) % hell;
        n=n/2;
    }
    return result % hell;
}
 
class dsu{
    vi p,rank;
    vi set_count;
  
  public:
    dsu(int n){
        p.assign(n,0); 
        rank.assign(n,0);
        set_count.assign(n,1);
        for(int i=0;i<n;i++) p[i] = i;
    }
    int findSet(int x){
        return (p[x] == x) ? x:(p[x] = findSet(p[x]));
    }
    bool isSame(int i, int j){
        return (findSet(i) == findSet(j));
    }
    void unionSet(int i, int j){
        if(!isSame(i,j)){
            int x = findSet(i), y = findSet(j);
            if(rank[x] > rank[y]) {p[y] = x; set_count[x]+=set_count[y];}
            else{
                p[x] = y;
                set_count[y]+=set_count[x];
                if(rank[x] == rank[y]) rank[y]++;
            }
        }
    }
    int count(int x){
        return set_count[findSet(x)];
    }
};

int S[105][105];
int T[105][105];

// code copied from god_arham
int mod_inv(int a,int m){
    a=a%m;
    return power(a,m-2)%hell;
}
int fact[200005];
void count_fact(){
    int i,x=1;
    fact[0]=1;
    for(int i=1;i<200002;i++){
        
        x=(x*i)%hell;
      //  cout<<x<<" ";
        fact[i]=x;
        
    }
}
 
int ncr(int n,int r){
    int a=fact[n],b=fact[r],c=fact[n-r];
    
    return (a*mod_inv(b*c,hell))%hell;
} 
//copied code ends here
 
signed main()
{
    tezz
 
    int n;
    cin>>n;
    vi v(n);
    for(int &x:v) cin>>x;

    int count = 1;
    for(int i=0;i<n;i++){
        if(v[i] == count){
            count++;
        }
    }
    if(count == 1) cout<<-1;
    else cout<<n - count + 1;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <iomanip>

typedef long double ld;
typedef long long ll;

void print()
{
  std::cout << std::endl;
}

template<class T>
void print(T param)
{
  std::cout << param << std::endl;
  return;
}

template<class T, class... S>
void print(T param1, S... param2)
{
  std::cout << param1 << " "; print(std::forward<S>(param2)...);
}

void fail()
{
  return;
}

void solve()
{
  ll K, A, B;
  std::cin >> K >> A >> B;

  ll ans = 0LL;
  if (B >= A + 2) {
    ans += A;
    K -= A - 1;
    if (K % 2 == 1) ans++;
    K /= 2;
    ans += K * (B-A);
  } else {
    ans = K + 1;
  }
  print(ans);
  return;
}

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


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

constexpr int64_t INF = 1'010'000'000'000'000'017LL;
constexpr int64_t MOD = 1'000'000'007LL;
constexpr double EPS = 1e-12;
constexpr double PI = 3.14159265358979323846;

#define FOR(i, start, end) for(int64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

signed main() {
  int64_t a,b;
  cin >> a >> b;
  
  char aChar, bChar;
  aChar = '0' + (char)a;
  bChar = '0' + (char)b;

  string ab, ba;
  REP(i,b){
    ab += aChar;
  }
  REP(i,a){
    ba += bChar;
  }
  
  if(ab.compare(ba)>0){
    cout << ba << endl;
  }else{
    cout << ab << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;
public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
        int a, b, count;
        while( input.hasNext() )
        {
            a = input.nextInt();
            b = input.nextInt();
            a += b;
            count = 0;
            while( a > 0 )
            {
                count ++;
                a /= 10;
            }
            System.out.println( count );
        }
	}
}

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

int main() {
  static const double pi = acos(-1);
  int a, b, h, m;
  cin >> a >> b >> h >> m;
  double at, bt, ax, ay, bx, by, ans;
  at = pi/2 - ((double)h / 12 + (double)m / 60 / 12) * 2 * pi;
  bt = pi/2 - (double)m / 60 * 2 * pi;
  ax = (double)a * cos(at);
  ay = (double)a * sin(at);
  bx = (double)b * cos(bt);
  by = (double)b * sin(bt);
  ans = sqrt(pow(ax-bx, 2) + pow(ay-by, 2));

  cout << fixed << setprecision(15) << ans << endl;
  return 0;
}


Measured memory_bytes: 4088
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
#include <stack>
#include <cmath>
using namespace std;
typedef long long LL;
#define debug(x) cerr << #x << "=" << x << endl;
#define lgx cerr << "--------------" << endl;
const int MAxn = 1e5 + 5;

int main() {
	LL n;
	while(cin >> n){
		long long num = sqrt(n), ans = 1;
		int flag = 0;
		while(!flag) {
			if(num*num <= n) {
				ans = num*num;
				flag = 1;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    ll ans=0;
    ll flg = 0;
    cin >> a[0];
    rep(i, n-1){
        cin >> a[i+1];
        if (flg == 1){
            if (a[i] > a[i+1]){
                ans++;
                flg = 0;
            }
        }else if (flg == -1){
            if (a[i] < a[i+1]){
                ans++;
                flg = 0;
            }
        }else{
            if (a[i] < a[i+1]){
                flg = 1;
            }else if (a[i] > a[i+1]){
                flg = -1;
            }
        }
    }

    cout << ans+1 << endl;

    return 0;
}


Measured memory_bytes: 3948
while True:
    n = int(input())
    if n == 0:
        break
    D = {}
    L = []
    for i in range(n):
        e = list(map(str,input().split()))
        L += e[0]
        D[e[0]] = e[1]
    k = int(input())
    S = ''
    for i in range(k):
        s = input().strip()
        if s in L:
            S += D[s]
        else:
            S += s
    print (S)



Measured memory_bytes: 5716
#include <iostream>
#include <iomanip>
using namespace std;

int main(){
  int n;
  cin >> n;
  if (n % 2 == 0){
    cout << fixed << setprecision(10) << (n/2)/double(n) << endl;
  }else{
    cout << fixed << setprecision(10) << (n/2 + 1)/double(n) << endl;
  }
}

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

using namespace std;

// Repetitions
#define FOR(i,a,n) for(ll i = ((ll) a); i < ((ll) n); ++i)
#define FORR(i, s, g) for(ll i = ((ll)s - 1); i >= ((ll) g); --i)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) FORR(i, n, 0)

// Container Utils
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define SORTALL(v) sort(ALL(v))
#define SZ(a) int((a).size())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())

// For Debug
#define DMP(x)  cerr << #x << " = " << (x) << endl
#define DBG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

// Aliases
#define PB push_back
#define MP make_pair
typedef long long ll;
typedef string str;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

// I/O Asynchronizing
struct aaa{
    aaa(){
        cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);
    };
}aaaaaaa;

int main() {
    int n;
    cin >> n;
    set<int> st;
    REP(i, n) {
        int d;
        cin >> d;
        st.insert(d);
    }
    vi d(ALL(st));
    SORTALL(d);
    cout << d.size() << "\n";

    return 0;
}


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

#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

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

    cout << r *r << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define numrep(i,p,n) for(int i=p;i<=n;i++)
#define ll int64_t
#define all(v) v.begin(), v.end()
#define bitrep(n) for(int bit=0;bit<(1<<n);bit++)

const int MOD = 1000000007;

const double PI=3.14159265358979323846;

int main() {

double A,B,H,M; cin >> A >> B >> H >> M ;

cout << fixed << setprecision(18);

double angleL=30*H+M/2, angleS=6*M;

double Ang=abs(angleL-angleS);

double C=cos(Ang*PI/180);

double ans=A*A+B*B;

ans=ans-2*A*B*C;

ans=sqrt(ans);

cout << ans << endl;

return 0;
}

Measured memory_bytes: 4228
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)

A, B = map(int, input().split())

# Aの倍数を1倍からB倍まで列挙して、それがBの倍数であるものを選ぶ
for b in range(1, B + 1):
    A_x = b * A
    if A_x % B == 0:
        print(A_x)
        exit()

Measured memory_bytes: 2940
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <deque>
using namespace std;
using ll = long long;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(x) (x).begin(),(x).end()

int fun(vector<int>& v, int num, int n, int maxDiscardNum){
  int ans=0;
  vector<int> choice(num,0);
  REP(i, num+1){
    choice.clear();
    REP(j,i){
      choice.push_back(v[j]);
    }
    for(int j=n;j>n-(num-i);j--){
      choice.push_back(v[j-1]);
    }
    sort(ALL(choice));
    REP(j,maxDiscardNum){
      if(choice[j]<0)
	choice[j]=0;
    }
    int sum=accumulate(ALL(choice),0);
    ans=sum>ans?sum:ans;
    
  }
  return ans;
}

int main () {
  int n, k;
  cin >> n >> k;
  vector<int> v(n);
  REP(i, n){
    cin >> v[i];
  }

  int ret=0;
  int a=min(k,n);
  REP(i,a+1){
    int temp=fun(v, i, n, min(i, k-i));
    ret=temp>ret?temp:ret;
  }
  cout << ret;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
const int N = 20 + 5;

int T;

int main()
{
    scanf("%d", &T);
    while(T--)
    {
        int left = 0, right = 0, flag = 0;
        for(int i = 0; i < 10; i++)
        {
            int tmp;
            scanf("%d", &tmp);
            if(tmp > left) left =tmp;
            else if(tmp > right) right = tmp;
            else flag = 1;
        }
        if(flag)
            printf("NO\n");
        else
            printf("YES\n");
    }
    return 0;
}

Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
//#include<boost/multiprecision/cpp_int.hpp>
//using boost::multiprecision::cpp_int;

#define int long long
#define cint cpp_int
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2
#define PI acos(-1.0)

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vvout(VVi &v){for(int i=0;i<(v).size();i++) vout(v[i]);}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
Vi accum(Vi v){Vi ret((v).size());ret[0]=v[0];REP(i,1,(v).size()) ret[i]=ret[i-1]+v[i];return ret;}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

struct good{int weight,value;};
struct napsak{
    int N,W;
    vector<good> goods;
    VVi dp;
    napsak(int n,int w){
        init(n,w);
    }
    void init(int n,int w){
        N=n; W=w;
        dp.resize(N+1);
        REP(i,0,N+1) dp[i].resize(W+1);
        REP(i,0,N+1) REP(j,0,W+1) dp[i][j]=INF;
    }
    void add_goods(int w,int v){
        good g;
        g.weight=w,g.value=v;
        goods.pb(g);
    }
    int solve(){
        REP(i,0,N+1) REP(j,0,W+1) dp[i][j]=0;
        REP(i,0,N){
            REP(j,0,W+1){
                chmax(dp[i+1][j],dp[i][j]);
                if(j+goods[i].weight<=W) chmax(dp[i+1][j+goods[i].weight],dp[i][j]+goods[i].value);
            }
        }
        return dp[N][W];
    }
};

signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(12);
    int n,W;
    cin>>n>>W;
    Vi w(n),v(n);
    REP(i,0,n) cin>>w[i]>>v[i];

    napsak NS(n,W);
    REP(i,0,n){
        NS.add_goods(w[i],v[i]);
    }

    cout<<NS.solve()<<endl;

    return 0;
}



Measured memory_bytes: 79488
let a, b, c, d, e, f = Scanf.scanf " %d %d %d %d %d %d" @@ fun a b c d e f -> a, b, c, d, e, f
let ws = Array.make (f + 1) false
let ss = Array.make (f + 1) false
let (<@) (w, s) (w2, s2) = (w2 + s2) * s <= (w + s) * s2
let ans = ref (100 * a, 0)
let _ =
  for i = 0 to f / 100 do
    for j = 0 to f / 100 do let w = 100 * i * a + 100 * j * b in if w <= f then ws.(w) <- true done done;
  for i = 0 to f do
    for j = 0 to f do if i * c + j * d <= f then ss.(i * c + j * d) <- true done done;
  for i = 0 to f do
    for j = 0 to f do if ws.(i) && ss.(j) && i + j <= f && 100 * j <= i * e then (ans := if !ans <@ (i, j) then i, j else !ans) done done;
  let w, s = !ans in Printf.printf "%d %d\n" (w + s) @@ s

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

const int N = 1e5 + 100;

int a[N];

int main() {
	int n, k, q;
	cin >> n >> k >> q;
	for (int i = 0; i < q; i++) {
		int u;
		cin >> u;
		u--;
		a[u]++;
	}
	for (int i = 0; i < n; i++)
		if (a[i] + k - q > 0)
			cout << "Yes" << '\n';
		else
			cout << "No" << '\n';
}


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

int main()
{
	int x, y,z;
	while (cin >> x >> y) {
		if (x == 0&&y == 0)break;
        if (x > y){
			 z = x;
			 x = y;
			 y = z;
	              }
		 cout << x << " " << y << endl;
		}
	return 0;
}

Measured memory_bytes: 1160
//Author : pakhandi
//
using namespace std;

#include <bits/stdc++.h>

#define wl(n) while(n--)
#define fl(i,a,b) for(i=a; i<b; i++)
#define rev(i,a,b) for(i=a; i>=b; i--)

#define si(n) scanf("%d", &n)
#define sll(l) scanf("%lld",&l)
#define ss(s) scanf("%s", s)
#define sc(c) scanf("%c", &c)
#define sd(f) scanf("%lf", &f)

#define pi(n) printf("%d\n", n)
#define pll(l) printf("%lld\n", l)
#define ps(s) printf("%s\n", s)
#define pc(c) printf("%c\n", c)
#define pd(f) printf("%lf\n", f)

#define debug(x) cout<<"\n#("<<x<<")#\n"
#define nline printf("\n")

#define mem(a,i) memset(a,i,sizeof(a))

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

#define PB push_back
#define SZ size
#define MP make_pair

int main()
{
	int i, j;

	string str1;
	int moves;

	cin >> str1 >> moves;

	int limit = str1.SZ();

	fl(i,0,limit)
	{
		if(moves > 0 && str1[i] != 'a')
		{
			int movesToMakeSmall = int('z' - str1[i]) + 1;
			if(movesToMakeSmall <= moves)
			{
				moves -= movesToMakeSmall;
				str1[i] = 'a';
			}
		}
	}

	int ind = limit - 1;

	if(moves > 0)
	{
		moves %= 26;
		fl(i,0,moves)
		{
			if(str1[ind] == 'z')
			{
				str1[ind] = 'a';
				continue;
			}
			// cerr << str1[ind] << " ";
			str1[ind] = char(int(str1[ind]) + 1);
		}
	}

	cout << str1;

	return 0;
}
/*
	Powered by Buggy Plugin
*/


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define N 100005
#define ll long long
using namespace std;
ifstream in("in.txt");
const ll M=1000000007;
ll fortza(ll x, ll i){
    if(i==1){
        return x;
    }
    ll t=fortza(x,i/2);
    t=(t*t)%M;
    if(i&1){
        t=(t*x)%M;
    }
    return t;
}
int main(){
    ll n, a, b, x=1, t;
    cin>>n>>a>>b;
    for(ll i=1; i<=a; ++i){
        x=x*((n-i+1)*fortza(i, M-2)%M)%M;
    }
    t=(fortza(2, n)-1-x+M)%M;
    for(ll i=a+1; i<=b; ++i){
        x=x*((n-i+1)*fortza(i, M-2)%M)%M;
    }
    cout<<(t-x+M)%M;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <utility>
#include <map>
#include <set>
#include <algorithm>

#define rep(i, a, b) for (int i=a; i <b; i++)
#define F first
#define S second

using namespace std;

typedef long long ll;
typedef vector< int > vi;

int main() {
    int n, z, w;
    scanf("%d %d %d", &n, &z, &w);
    vi a(n);
    rep(i, 0, n) {
        scanf("%d", &a[i]);
    }
    int ans = 0;
    if (n == 1) {
        ans = abs(a[0] - w);
        printf("%d\n", ans);
        return 0;
    }

    if (abs(a[n-1] - a[n-2]) >= abs(a[n-1] - w)) {
        printf("%d\n", abs(a[n-1] - a[n-2]));
    } else {
        printf("%d\n", abs(a[n-1] - w));
    }
    return 0;
}

Measured memory_bytes: 256
// #include <bits/stdc++.h>
#include<climits>
#include<cmath>
#include<cstdio>
#include<deque>
#include<map>
#include<set>
#include<vector>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<numeric>
#include<string>
#include<tuple>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define pt pop_front
#define pk pop_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
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;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}

inline void solve(void){
  long N,K;
  in(N,K);
  vector<long> a(N),b(N),A(N+1),B(N+1);
  rep(i,N){
    in(a[i]);
    A[i+1]=A[i]+a[i];
    b[i]=max(0L,a[i]);
    B[i+1]=B[i]+b[i];
  }
  long ans=0,tmp;
  rep(i,N-K+1){
    tmp=B[i]+max(A[i+K]-A[i],0L)+B[N]-B[i+K];
    chmax(ans,tmp);
  }
  out(ans);
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void solve() {
    ll R, C, K;
    cin >> R >> C >> K;
    vector<vector<ll>> grid(R + 1, vector<ll>(C + 1, 0));
    rep(i, K) {
        ll r, c, v;
        cin >> r >> c >> v;
        r--;
        c--;
        grid[r][c] = v;
    }
    vector<vector<vector<ll>>> dp(R + 1, vector<vector<ll>>(C + 1, vector<ll>(4, 0)));
    rep(i, R) {
        rep(j, C) {
            rep(k, 4) {
                dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k]);
                dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k]);
                if (k <= 2) {
                    dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + grid[i][j]);
                    dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][k] + grid[i][j]);
                }
            }
        }
    }
    ll ans = 0;
    rep(k, 4) {
        ans = max(ans, dp[R][C - 1][k]);
    }
    cout << ans << '\n';
}

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


Measured memory_bytes: 707228
#include <stdio.h>

#define N 100001
#define setData(d,i,_from,_to,_cost,_next) do{(d)[i].from=(_from);(d)[i].to=(_to);(d)[i].cost=(_cost);(d)[i].next=(_next);}while(0);

typedef long long ll;

typedef struct _Data{
    int from;
    int to;
    ll cost;
    int next;
} Data;

Data d[N*2];
ll cost[N];
int tail[N];

int que[N];
int rp,wp;

int main(){
    int i;
    int n,a,b,c,q,k,x,y;
    int idx,to;
    
    scanf("%d",&n);
    for(i=0;i<n;i++){
        tail[i]=0;
    }
    for(i=1;i<n;i++){
        scanf("%d %d %d",&a,&b,&c);
        setData(d,i,a,b,c,tail[a]);
        tail[a]=i;
        setData(d,N+i,b,a,c,tail[b]);
        tail[b]=N+i;
    }
    scanf("%d %d",&q,&k);
    for(i=0;i<=n;i++){
        cost[i]=-1;
    }
    cost[k]=0;
    que[0]=k;
    rp=0;
    wp=1;
    while(rp<wp){
        i=que[rp++];
        idx=tail[i];
        while(idx){
            to=d[idx].to;
            if(cost[to]<0){
                cost[to]=cost[i]+d[idx].cost;
                que[wp++]=to;
            }
            idx=d[idx].next;
        }
    }
    for(i=0;i<q;i++){
        scanf("%d %d",&x,&y);
        printf("%lld\n",cost[x]+cost[y]);
    }
    return 0;
}


Measured memory_bytes: 7936
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second
#define endl "\n"

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef pair<int, int> P;


int main(){
    int n;  cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
        a[i]--;
    }

    int count = 0;
    for(int i = 0; i < n; i++){
        if(a[i] == count){
            count++;
        }
    }
    if(count > 0)
        cout << n - count << endl;
    else{
        cout << -1 << endl;
    }


    return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>

void trace(int A[], int N) 
{
	for (int i = 0; i < N; i++)
	{
		if (i > 0)
		{
			printf(" ");
		}

		printf("%d", A[i]);
	}
	printf("\r\n");
}

void insertSort(int A[], int N)
{
	int v,j;
	for (int i = 1; i < N; i++)
	{
		v = A[i];
		j = i - 1;
		while (j >= 0 && A[j] > v) 
		{
			A[j + 1] = A[j];
			j--;
		}
		A[j + 1] = v;
		trace(A, N);
	}
	
}

int main()
{
	int N, A[100];

	scanf("%d", &N);
	
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &A[i]);
	}
	trace(A , N);
	insertSort(A, N);

    return 0;
}


Measured memory_bytes: 2676
n = int(input())
num_list = list(map(int, input().split()))

counter = 0
max_counter = 0

for i in range(n-1):
  if num_list[i] >= num_list[i+1]:
    counter += 1
    if max_counter < counter:
      max_counter = counter
  else:
    counter = 0

print(max_counter)

Measured memory_bytes: 14228
#include <map>
#include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <string>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
 
template<class T> bool chmin(T &a, T b) { return a>b?(a=b,true):false; }
template<class T> bool chmax(T &a, T b) { return a<b?(a=b,true):false; }
#define forn(i,x,y) for(int i=(x);i<(int)(y);i++)
#define rep(i,y) for(int i=0;i<(int)(y);i++)
#define repb(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
#define debug(X) cerr<<" "<<#X<<" = "<<X<<endl;
 
template<class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) os << " ";
    os << *it;
  }
  return os;
}
# define int ll
ll N,P;
signed main() {
  cin>>N>>P;
  if (N==1) {
    cout << P << endl;
    return 0;
  }
  ll ans = 1;
  forn(i, 2, 2000000) if (P%i==0) {
    ll a = pow(i, N);
    if (P%a==0) ans=i;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 512
#include <iostream>
using namespace std;
int main(void){
  int n, y;
  cin >> n >> y;
  for(int i=0; i<=n; i++){
    for(int j=0; j<=n-i; j++){
      if(10000*i+5000*j+1000*(n-i-j)==y){
        cout << i << " " << j << " " << n-i-j << endl;
        return 0;
      }
    }
  }
  cout << "-1 -1 -1" << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
       if(n==1) System.out.println("Hello World");
       else {
            int a = Integer.parseInt(sc.next());
            int b = Integer.parseInt(sc.next());
            System.out.println(a+b);
       }
    }  
}

Measured memory_bytes: 23892
#include<iostream>

using namespace std;

int main(){
  
  long long A, B, N, M;
  
  N = 0; M = 0;
  
  cin >> A >> B;
  
  if(A > B){
    
    for(int i = 1; i < B + 1; i++){
      
      if((A % i == 0)&&(B % i == 0)) N = i;
      
      else continue;
      
    }
    
  }
  
  if(B >= A){
    
    for(int i = 1; i < A + 1; i++){
      
      if((A % i == 0)&&(B % i == 0)) N = i;
      
      else continue;
      
    }
    
  }
  
  if(N == 0) M = A * B;
  
  else M = A * B / N;
  
  cout << M;
  
}

Measured memory_bytes: 256
MOD=10**9+7
FAC=[]
FIN=[]

def gli
  return gets.split.map(&:to_i)
end

def power(base, exp, mod)
  return 1 if exp == 0
  return (base ** (exp % 2) * power(base, exp/2, mod) ** 2) % mod
end

def pre_process(n)
  FAC[0] = 1
  FIN[0] = power(FAC[0], MOD-2, MOD)
  for i in 1..n
    FAC[i] = FAC[i-1] * i % MOD
    FIN[i] = power(FAC[i], MOD-2, MOD)
  end
end

def combination(n, k)
  return (FAC[n] * FIN[n - k] % MOD) * FIN[k] % MOD
end

H, W, A, B = gli

pre_process(H + W)

ret = 0

for i in 1..H-A do
  ret += combination(i + B - 2, B - 1) * combination(H + W - i - B - 1, W - B - 1) % MOD
end

puts ret % MOD


Measured memory_bytes: 5016
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();

		if (A <= C && C <= B) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}
}


Measured memory_bytes: 20692
#include <cstdio>
#include <iostream>
#include <type_traits>
#include <vector>

using namespace std;

class DisjointSet {
private:
	vector<int> p, height;
public:
	DisjointSet(int size) {
		p.resize(size, 0);
		height.resize(size, 0);
		for (int i = 0; i < size; ++i)
			p[i] = i;
	}

	int find(int v) {
		if (p[v] != v)
			p[v] = find(p[v]);
		return p[v];
	}

	void link(int a, int b) {
		if (height[a] > height[b]) {
			p[b] = a;
		} else {
			if (height[a] == height[b]) {
				++height[b];
			}
			p[a] = b;
		}
	}

	void unite(int a, int b) {
		link(find(a), find(b));
	}

	bool same(int a, int b) {
		return find(a) == find(b);
	}
};

int main() {

	int n, q;
	scanf("%d %d", &n, &q);

	DisjointSet d(n);

	for (int i = 0; i < q; ++i) {
		int com, x, y;
		scanf("%d %d %d", &com, &x, &y);
		if (com == 0) {
			d.unite(x, y);
		} else {
			if (d.same(x, y)) {
				cout << 1 << endl;
			} else {
				cout << 0 << endl;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 3256
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long A,B;
    long long N,ans,maxpos;
    cin >> A >> B >> N;
    long long maxval=0;
    if(B>N){
        maxval=(A*N)/B;
    }else{
        maxval=(A*(B-1))/B;
    }
    cout << maxval;
    return 0;
}


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

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
			int N = scanner.nextInt();
			int[] kazu = new int [N];
			int[] kazusort = new int [N];
			
			for(int i = 0; i < N; i++) 
			{
				kazu[i] = scanner.nextInt();
				kazusort[i] = kazu[i];
			}
			
			Arrays.sort(kazusort);
			for(int i = 0; i < N; i++) 
			{
				if( kazu[i] > kazusort[N / 2 - 1] ) 
				{
					System.out.println(kazusort[N/2 - 1]);
				}
				else 
				{
					System.out.println(kazusort[N/2]);
				}
			}
		    scanner.close(); }
		  }

Measured memory_bytes: 91444
//---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
//---------------------------------------------------------------
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define SIZE 100005
#define INF 1000000000000000LL
#define all(x) x.begin(),x.end()
using pint = pair<int,int>;
using vec = vector<int>;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
//---------------------------------------------------------------
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 n,m,q;
vec a,b,c,d;
int ans;

void dfs(vec A){
   if(A.size()==n+1){
    int now=0;        
        rep(i,q){
            if(A[b[i]] - A[a[i]] == c[i]) now+=d[i];

        }
    ans = max(ans, now);     
    return;       
    }

    A.push_back(A.back());    
    while(A.back()<=m){
        dfs(A);
        A.back()++;        
    }
}

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


    cin>>n>>m>>q;
    a = b = c = d =vec(q);
    rep(i,q){
        cin>>a[i]>>b[i]>>c[i]>>d[i];
    }

    dfs(vec(1,1));

    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3656
#include<iostream>
using namespace std;
int main(){
  string a;
  while(true){
    cin >> a;
    if(a == "#")
      break;
    int count=0;
    int s[26]={0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,0,0,1,0};
    for(int i=0;i<a.size()-1;i++){
      if(s[a[i]-'a']!=s[a[i+1]-'a'])
        count++;
    }
    cout << count << endl;
  }
}

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

int main(){
  int h,n;
  cin >> h >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int sum = 0;
  rep(i,n) sum += a[i];
  if(sum >= h) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 640
//122B
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
using namespace std;
int main(void){
    string S= " ";
    string ACGT = "ACGT";
    int tmp =0, ans =0;
    cin >> S;
    rep(i, S.size()){
        if ((int)ACGT.find(S[i]) !=-1){
            tmp+=1;
        }else{
            if(tmp > ans) ans = tmp;
            tmp=0;
        }
        if (tmp > ans) ans = tmp;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<ii> vii;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fr(be, en) for(int i = be; i <= en; i++) 
ll mod = LLONG_MAX;
ll power(ll a, ll b)
{
	if(b == 0) return 1;
	ll ans = power(a, b/2);
	ans = (ans*ans)%mod;
	if(b%2) ans*=a;
	return ans%mod;
}
ll mul(ll a,ll n, ll mod)
{
	ll ret;
	if(n==0) return 0;
	ret = mul(a,n/2, mod);
	ret = (ret+ret)%mod;
	if(n%2)	ret=(ret+a)%mod;
	return ret;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cout.tie(NULL);
	cin.tie(NULL);
	ll n; cin >> n;
	vi s(1e7 + 1, 0);
	for(ll i = 2; i <= 4000; i++)
	{
		if(s[i] != 0) continue;
		for(ll j = i; j*i <= 1e7; j++) if(s[j*i] == 0) s[j*i] = i;
	}
	ll ans = 0;
	unordered_map<int, int> :: iterator it;
	auto start = chrono::high_resolution_clock::now(); 
	for(ll i = 1; i <= n; i++)
	{
		ll x = i;
		ll prod = 1;
		ii curr  = {0, 0};
		while(s[x] != 0)
		{
			if(s[x] == curr.fi) curr.se++;
			else 
			{
				prod*=(curr.se + 1);
				curr = {s[x], 1};
			}
			x/=s[x];
		}
		if(x == curr.fi)
		{
			curr.se++;
			prod*=(curr.se + 1);
		}
		else
		{
			prod*=(curr.se + 1);
			prod*=2;
		}
		// sort(hm.begin(), hm.end());
		// for(int j = 0; j < hm.size(); j++) if(hm[j] != hm2[j]) flag = 0;
		// max_st = max(max_st, st);
		// it = hm.find(curr);
		// if(it == hm.end()) hm.insert({curr, 1});
		// else it->se++;
		// sz = max(sz, (int)hm.size());
		// curr = i;
		// for(it = hm.begin(); it != hm.end(); it++) curr*=((ll)it->se + (ll)1);
		ans += prod*i;
	}
	auto stop = chrono::high_resolution_clock::now(); 
	double time_taken =  chrono::duration_cast<chrono::nanoseconds>(stop - start).count(); 
	time_taken *= 1e-9; 
	// cout << "Time taken by program is : " << fixed  << time_taken << setprecision(9); 
	// cout << " sec" << endl; 
	// cout << max_st << " " << sz << " ";
	cout << ans - 1;
}

Measured memory_bytes: 81280
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define MAX 100000
void inarray(int a[], int n){
    for(int i = 0; i < n; i++) cin >> a[i];
}

int main(){
    int n,m; cin >> n >> m;
    cout << (n*(n-1))/2 + (m*(m-1))/2 << endl;
    return 0;
}

Measured memory_bytes: 764
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i < (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.16f\n", a)//少数出力
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue

using ll = long long;

const int INF = 1073741823;
const int MINF = -1073741823;
const ll LINF = ll(4661686018427387903);
const ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

#include <iostream>

using namespace std;

void scans(string & str) {
	char c;
	scanf("%c", &c);
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {

	int n, m;
	scanf("%d%d", &n, &m);
	map<int, int> a;
	int tmpa, tmpb;
	rep(i, n) {
		scanf("%d%d", &tmpa, &tmpb);
		a[tmpa] += tmpb;
	}
	ll cost = 0;
	for (auto aa : a) {
		cost += (ll)aa.first * min(m, aa.second);
		m -= aa.second;
		if (m <= 0)break;
	}
	printf("%lld\n", cost);

 	return 0;
}


Measured memory_bytes: 4992