akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(ll i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(ll i=(begin);i>(end);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(),greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}

#define ll long long
#define f first
#define s second
using namespace std;

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;

int main()
{
	// 入力
	ll N;
	cin >> N;

	vec H(N);
	vec maxH(N);
	maxH[0]=0;
	REP(i, N) {
		cin>>H[i];
		if(i==0) maxH[i]=H[i];
		else maxH[i]=max(H[i],maxH[i-1]);
	}

	ll ans=1;

	FOR(i,1,N){
		if(maxH[i-1]<=H[i]) ans++;
	}

	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
namespace AtCoder.ARC076
{
    class Connected
    {
        public static void Main()
        {
            var yes = "YES"; var no = "NO";
            var rcn = ReadLine().Trim().Split(' ').Select(_ => int.Parse(_)).ToArray();
            var r = rcn[0]; var c = rcn[1]; var n = rcn[2];
            var square = new Square { R = r, C = c };
            var points = (new int[n]).Select(_ => ReadLine().Split(' ').Select(__ => int.Parse(__)).ToArray()).Select((_, i) => new Line(i, _[0], _[1], _[2], _[3])).Where(_ => square.IsSeparatedByLine(_)).SelectMany(_ => new[] { _.A, _.B }).ToArray();
            var upper = points.Where(_ => square.OnUpperLine(_));
            var lower = points.Where(_ => square.OnLowerLine(_));
            var right = points.Where(_ => square.OnRightLine(_));
            var left = points.Where(_ => square.OnLeftLine(_));
            var stack = new Stack<int>();
            foreach (var edge in new [] { upper.OrderBy(_ => _.X), right.OrderByDescending(_ => _.Y), lower.OrderByDescending(_ => _.X), left.OrderBy(_ => _.Y) }) {
                foreach(var point in edge.Select(_ => _.Id)) {
                    if (stack.Count() != 0 && stack.Peek() == point) stack.Pop();
                    else stack.Push(point);
                }
            }
            if (stack.Count == 0) WriteLine(yes);
            else WriteLine(no);
        }
        public struct Point
        {
            public int Id, X, Y;
        }
        struct Square
        {
            public int R, C;
            public bool IsSeparatedByLine(Line line)
            {
                return (line.A.X == 0 || line.A.X == R || line.A.Y == 0 || line.A.Y == C) && (line.B.X == 0 || line.B.X == R || line.B.Y == 0 || line.B.Y == C);
            }
            public bool OnUpperLine(Point point)
            {
                return point.Y == C && point.X != 0;
            }
            public bool OnLowerLine(Point point)
            {
                return point.Y == 0 && point.X != R;
            }
            public bool OnRightLine(Point point)
            {
                return point.X == R && point.Y != C;
            }
            public bool OnLeftLine(Point point)
            {
                return point.X == 0 && point.Y != 0;
            }
        }
        struct Line
        {
            public Point A, B;
            public Line(int id, int x1, int y1, int x2, int y2)
            {
                A = new Point { Id = id, X = x1, Y = y1 };
                B = new Point { Id = id, X = x2, Y = y2 };
            }

        }
    }
}


Measured memory_bytes: 32928
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdint.h>
#include <tuple>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-12;
static const double PI = acos(-1.0);
static const ll MOD = 1000000007;
 
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a) (a).begin(), (a).end()
#define DEBUG(x) cout << #x << ": " << x << endl

void solve(long long N, long long A, long long B){
  std::cout << min(A, B) << " " << max(0ll, A + B - N) << std::endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(N, A, B);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<iterator>
#include<stack>
#include<queue>
#include<utility>
#include<functional>
#include<bitset>
#include<numeric>
#include<cstring>
#include<tuple>
using namespace std;

int n, m, mod = 1e9 + 7;
char grid[ 1003 ][ 1003 ];
long long dp[ 1003 ][ 1003 ];

long long solve( int i, int j )
{
	if( i == 0 || j == 0 )
	{
		return 0;
	}
	if( i == 1 && j == 1 )
	{
		return 1;
	}
	if( dp[ i ][ j ] != -1 )
	{
		return dp[ i ][ j ];
	}
	dp[ i ][ j ] = 0;
	if( grid[ i - 1 ][ j ] != '#' )
	{
		dp[ i ][ j ] += solve( i - 1, j );
	}
	if( grid[ i ][ j - 1 ] != '#' )
	{
		dp[ i ][ j ] += solve( i , j - 1 );
	}
	dp[ i ][ j ] %= mod;
	return dp[ i ][ j ];
}

int main( void )
{
	ios :: sync_with_stdio( 0 );
	cin.tie( 0 );
	
	memset( dp, -1, sizeof( dp ) );
	cin >> n >> m;
	for( int i = 1; i <= n; ++i )
	{
		for( int j = 1; j <= m; ++j )
		{
			cin >> grid[ i ][ j ];		
		}		
	}
	cout << solve( n, m ) << "\n";
	return 0;
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
void yes(bool expr) {
  cout << (expr ? "Yes" : "No") << "\n";
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int N, M;
    cin >> N >> M;
    if(N%2 == 1) {
        int l = 1;
        int r = N;
        REP(i, M) {
            cout << l << " " << r << "\n";
            l++;
            r--;
        }
    } else {
        int l = 1;
        int r = N;
        int zen = M-M/2;
        int kou = M/2;
        REP(i, zen) {
            cout << l << " " << r << "\n";
            l++;
            r--;
        }
        r--;
        REP(i, kou) {
            cout << l << " " << r << "\n";
            l++;
            r--;
        }
    }
}

Measured memory_bytes: 3652
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline int rd_int(void){
  int x;
  rd(x);
  return x;
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  int s=0;
  int m=0;
  char f[10];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class S, class T> inline S chmin(S &a, T b){
  if(a>b){
    a=b;
  }
  return a;
}
int N;
int M;
int L;
long long dis[300][300];
int res[300][300];
int main(){
  int KL2GvlyY, Lj4PdHRW;
  int i;
  int j;
  int k;
  rd(N);
  rd(M);
  rd(L);
  for(i=(0);i<(N);i++){
    for(j=(0);j<(N);j++){
      dis[i][j] = 4611686016279904256LL;
    }
  }
  for(i=(0);i<(N);i++){
    dis[i][i] = 0;
  }
  for(Lj4PdHRW=(0);Lj4PdHRW<(M);Lj4PdHRW++){
    rd(i);i += (-1);
    rd(j);j += (-1);
    rd(k);
    chmin(dis[i][j], k);
    chmin(dis[j][i], k);
  }
  for(k=(0);k<(N);k++){
    for(i=(0);i<(N);i++){
      for(j=(0);j<(N);j++){
        chmin(dis[i][j], dis[i][k] + dis[k][j]);
      }
    }
  }
  for(i=(0);i<(N);i++){
    for(j=(0);j<(N);j++){
      res[i][j] = 1073709056;
    }
  }
  for(i=(0);i<(N);i++){
    res[i][i] = 0;
  }
  for(i=(0);i<(N);i++){
    for(j=(0);j<(N);j++){
      if(dis[i][j] <= L){
        chmin(res[i][j], 1);
      }
    }
  }
  for(k=(0);k<(N);k++){
    for(i=(0);i<(N);i++){
      for(j=(0);j<(N);j++){
        chmin(res[i][j], res[i][k] + res[k][j]);
      }
    }
  }
  int Q5VJL1cS = rd_int();
  for(KL2GvlyY=(0);KL2GvlyY<(Q5VJL1cS);KL2GvlyY++){
    rd(i);i += (-1);
    rd(j);j += (-1);
    if(res[i][j]==1073709056){
      wt_L(-1);
      wt_L('\n');
    }
    else{
      wt_L(res[i][j]-1);
      wt_L('\n');
    }
  }
  return 0;
}
// cLay varsion 20191012-1

// --- original code ---
// int N, M, L;
// ll dis[300][300];
// int res[300][300];
// 
// {
//   int i, j, k;
//   rd(N,M,L);
//   rep(i,N) rep(j,N) dis[i][j] = ll_inf;
//   rep(i,N) dis[i][i] = 0;
//   rep(M){
//     rd(i--,j--,k);
//     dis[i][j] <?= k;
//     dis[j][i] <?= k;
//   }
//   rep(k,N) rep(i,N) rep(j,N) dis[i][j] <?= dis[i][k] + dis[k][j];
//   rep(i,N) rep(j,N) res[i][j] = int_inf;
//   rep(i,N) res[i][i] = 0;
//   rep(i,N) rep(j,N) if(dis[i][j] <= L) res[i][j] <?= 1;
//   rep(k,N) rep(i,N) rep(j,N) res[i][j] <?= res[i][k] + res[k][j];
// 
//   REP(rd_int()){
//     rd(i--,j--);
//     wt(if[res[i][j]==int_inf, -1, res[i][j]-1]);
//   }
// }


Measured memory_bytes: 1536
gets.to_i.times do
  _ = gets
  diff_arr = []

  gets.split.map(&:to_i).each_cons(2) { |a, b| diff_arr << b - a }

  max = diff_arr.max
  min = diff_arr.min
  max_up = max < 0 ? 0 : max
  max_down = 0 < min ? 0 : min.abs

  puts "#{max_up} #{max_down}"
end

Measured memory_bytes: 8816
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();

		double totalNum = 0;

		ArrayList<Integer> numListN = new ArrayList<Integer>();
		ArrayList<Integer> numListM = new ArrayList<Integer>();
//		System.out.println(numListN);

		for(int i = 1;i <= N;i++) {
			int num = sc.nextInt();
			numListN.add(num);
			totalNum += num;
		}
		sc.close();

		//最大値の取得
		for(int j = 0;j < M; j++) {
			int max = 0;
			int maxLocation = 0;
			for(int i = 0;i < numListN.size(); i++) {
				if(max < numListN.get(i)) {
					max = numListN.get(i);
					maxLocation = i;
				}
			}
			if(max != 0) {
				numListM.add(max);
				numListN.remove(maxLocation);
			}
		}

//		System.out.println(numListM);

		String answer = "Yes";
		for(int j = 0;j < M; j++) {
			if(numListM.get(j) < (totalNum/(4*M))) {
//				System.out.println(numListM.get(j));
				answer = "No";
			}
		}
//		System.out.println(totalNum);
		System.out.println(answer);
	}

}


Measured memory_bytes: 23252
#include<iostream>
#include<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
 
using namespace std;
 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#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 ret return
#define C(i) cin>>i
#define C2(i,j) cin>>i>>j
#define C3(i,j,k) cin>>i>>j>>k
#define C4(i,j,k,m) cin>>i>>j>>k>>m
////////////////////////////////////////////////////////////
int f[5] = {};
long long ans = 0;
void solve(int i , int cnt,int num[]){
	//printf("i:%d cnt:%d\n",i,cnt);
	if(cnt == 3){
		ans += (long)f[num[0]] * (long)f[num[1]] * (long)f[num[2]];
		ret;
	}
	
	if(i == 5)
		ret;

	else{
		solve(i+1,cnt,num);
		num[cnt] = i;
		solve(i+1,cnt+1,num);
	}

	ret;
}

int main(){
	int n;
	cin >> n;
	rep(i,0,n){
		string s;
		cin >> s;
		char c = s[0];
		if(c == 'M')
			f[0]++;
		else if( c == 'A')
			f[1]++;
		else if( c == 'R')
			f[2]++;
		else if( c == 'C')
			f[3]++;
		else if( c == 'H')
			f[4]++;
		else
			continue;
	}
	
	int num[3] = {};
	solve(0,0,num);
	P(ans);
	ret 0;
}

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

const int mxN = 1e6+5;
const int inf = 1e9+7;
using ll = long long;

using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()

using pi = pair<int, int>;
#define f first
#define s second
#define mp make_pair

string s;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    cin >> s;
    if (s[sz(s)-1] == 's') cout << s << "es\n";
    else cout << s << "s\n";
    return 0;
}


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

int n,ans;
char a[1005],b[1005];

int main(){
	int i,j;
	scanf("%d%s%s",&n,a+1,b+1);
	for(i=n;i;--i){
		for(j=1;j<=i;++j)
		 if(a[n-i+j]!=b[j]) break;
		if(j>i) {ans=i;break;}
	}
	cout<<n+n-ans;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
typedef unsigned int uint;
using namespace std;

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

  sort(d,d+N);

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

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


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

int a, b;

int greedy(int x) {
	return (x / b) + (x % b) / a + ((x % b) % a);
}

int f(int x) { return x / a + (x % a); }

int best(int x) {
	int i;
	int ret = x;
	
	for (i = 0; i * b <= x; i++) {
		int res = i + f(x - i * b);
		ret = min(ret, res);
	}
	return ret;
}

int main() {
	cin >> a >> b;
	
	if (((b + a - 1) / a) * (a - 1) + 1 <= b) { cout << -1 << endl; }
	else { cout << ((b - 1) / a + 1) * a << endl; }
	return 0;
}


Measured memory_bytes: 3112
/// Author: Sarfaraz Alam
# include <bits/stdc++.h>
# define pb push_back
# define ll long long

# define fi first
# define se second
# define all(vc) vc.begin(),vc.end()
//# define speed ios_base::sync_with_stdio(false);cin.tie(Null);cout.tie(Null)
# define DEBUG
typedef unsigned long long int ull;
using namespace std;
#include<string>
#include<cmath>
const int N = 1e5 + 7;
const int mod = 1e9 + 7;
ull gcd(ull a, ull b)
{
  if(a == 0)
  return b;

  gcd(b%a, a);
}

ull lcm(ull a, ull b)
{
  return (a/gcd(a,b))*b;
}



int main()
{
  //  speed;
    #ifdef DEBUGfd
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif // DEBUG

    //Code begins
    int n;
    cin>>n;
    int64_t a[n];
    for(int i = 0; i<n; i++)
    cin>>a[i];
    sort(a, a+n, greater<int>());
  //   ull last = a[0];
  //   for(int i = 1; i<n; i++)
  //   {
  //     last = lcm(a[i], last);
  //   //  cout<<"last value : "<<last<<endl;
  //   }
  //   cout<<last<<endl;
  // //  cout<<lcm(1000,1000);
    int flag = 0;
    int exist = 0;
    int64_t ans = 1e18+2;
    // for(int i = 0; i<n; i++)
    // {
    //   flag = 0;
    //   for(int j = 0; j<n; j++)
    //   {
    //       if(a[i] %a[j] != 0)
    //       flag = 1;
    //   }
    //   if(!flag){
    //     exist = 1;
    //   ans = min(ans, a[i]);}
    // }
    if(!exist){
        ull last = a[0];
        for(int i = 1; i<n; i++)
        {
          last = lcm(a[i], last);
        //  cout<<"last value : "<<last<<endl;
        }
        ans = last;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1005;
bool chk(ll n){
    set<ll> st;
    for(ll i=2;i*i<=n;i++){
        if(n%i)continue;
        ll cnt=0;
        while(n%i==0)n/=i,cnt++;
        st.insert(cnt);
    }
    if(n>1)st.insert(1);

    if(st.size()>1)return 0;
    return (*st.begin())>1;
}
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    ll x;cin>>x;
    for(ll n=x;n>1;n--)if(chk(n))return cout<<n , 0;
    cout<<1;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
const int MOD = 1e9+7;
const int INF = 0x3f3f3f3f;
const double PI = 4*atan(1);
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
// ll gcd(ll a, ll b) { 
//     if (a == 0) return b; 
//     return gcd(b % a, a); 
// }
// ll f(ll x) {
// 	x%=MOD;
// 	if(x<0)x+=MOD;
// 	return x;
// }
// ll power(int base, int power) {
// 	ll prod = 1;
// 	ll b = base;
// 	while(power) {
// 		if (power & 1) {
// 			prod = f(prod*b);
// 		}
// 		b = f(b*b);
// 		power/=2;
// 	}
// 	return prod;
// }
// struct line {
//     int m, c;
//     ll eval(int x) { return 1LL * m * x + c; }
//     double intersectX(line l) { return (double) (c - l.c) / (l.m - m); }
// };
int k;
double a,b;
void solve() {
	cin >> k >> a >> b;
	if (ceil(a/k)<=floor(b/k)) {
		cout << "OK\n";
	} else {
		cout << "NG\n";
	}
	
}
int main() {

	// int t;
	// cin >> t;
	// for (int i = 1; i <= t; i++) { 
		// cout << "Case #" << i << ": ";
		solve();
	// }
}

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

int main() {
    int x, y;
    cin >> x >> y;

    int ans = 0;
    if (abs(x) == abs(y)) {
        if (x >= 0 and y >= 0) {
            ans = 0;
        } else if (x < 0 and y < 0) {
            ans = 0;
        } else {
            ans = 1;
        }
    } else if (abs(x) < abs(y)) {
        if (x >= 0 and y > 0) {
            ans = abs(y) - abs(x);
        } else if (x < 0 and y < 0) {
            ans = 2 + abs(y) - abs(x);
        } else {
            ans = 1 + abs(y) - abs(x);
        }
    } else if (abs(x) > abs(y)) {
        if (x > 0 and y > 0) {
            ans = 2 + abs(x) - abs(y);
        } else if (x < 0 and y <= 0) {
            ans = abs(x) - abs(y);
        } else {
            ans = 1 + abs(x) - abs(y);
        }
    }

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

Measured memory_bytes: 256
s = input()

s1_sum = 0
s1 = None
s2_sum = 0
s2 = None

for i in s:
    if s1==i:
        s1_sum+=1
    elif s2==i:
        s2_sum += 1
    elif s1 == None:
        s1 = i
        s1_sum=1
    elif s2 == None:
        s2 = i
        s2_sum=1
    else:
        pass
if (s1_sum==2)&(s2_sum==2):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

int main(){
  string s; cin>>s;
  ll N = s.size();

  ll ans = 0;
  rep(i,N){
    ll tmp = 0, row = 0;
    for(ll j = i; j < N; j++){
      char c = s[j];
      if(c == 'A' or c == 'C' or c == 'G' or c == 'T'){
        row++;
      }
      else{
        row = 0;
      }
      tmp = max(tmp, row);
    }
    ans = max(ans,tmp);
  }
  cout<<ans<<endl;
}


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

int A(int x,int y){
  return x+y;
}

int B(int x,int y){
  return x-y;
}

int C(int x,int y){
  return x*y;
}

int D(int x,int y){
  return x/y;
}

int main() {
  int a,b;
  char op;
  while(1){
    cin >> a >> op >> b;
    if(op == '?')
      break;
    
    if(op == '+')
      cout << A(a,b) << endl;
    
    if(op == '-')
      cout << B(a,b) << endl;
    
    if(op == '*')
      cout << C(a,b) << endl;
    
    if(op == '/')
      cout << D(a,b) << endl;
    }
  
  }
  




Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
 
int ctoi(const char c){
  switch(c){
    case '0': return 0;
    case '1': return 1;
    case '2': return 2;
    case '3': return 3;
    case '4': return 4;
    case '5': return 5;
    case '6': return 6;
    case '7': return 7;
    case '8': return 8;
    case '9': return 9;
    default : return -1;
  }
}

#define INF 1e+9




int main(){

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

double n;
cin>>n;
cout << fixed << setprecision(15) <<(n*2)*M_PI << endl;

}


Measured memory_bytes: 3804
#include<bits/stdc++.h>
#define int long long
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(a) a.size()
#define re return 
#define MP make_pair
#define pb push_back
#define pii pair<int,int>
#define se second
#define fi first
using namespace std;
const int MOD=1e9+7;
int n;
int a=1,b=1,c=1;
signed main(){
	ios_base::sync_with_stdio(0);
	cin>>n;
	if(n<2){
		cout<<0;
		re 0;
	}
	for(int i=0;i<n;i++){
		a*=10,a%=MOD;
		b*=9,b%=MOD;
		c*=8,c%=MOD;
	}
	cout<<(a+MOD*2-b*2+c)%MOD;
	re 0;
}

Measured memory_bytes: 3620
s=input()
l=len(s)
p0=[0]*l
p1=[1]*l
for i in range(l):
    if i%2==1:
        p0[i]=1
        p1[i]=0
c0=0
c1=0
for i in range(l):
    if int(p0[i])!=int(s[i]):
        c0+=1
for i in range(l):
    if int(p1[i])!=int(s[i]):
        c1+=1
print(min(c0,c1))
    
    

Measured memory_bytes: 10772
/*
	AIZU ONLINE A0012
        A Point in a Triangle
*/
#include <stdio.h>
#include <float.h>


main()
{
  float x1,y1,x2,y2,x3,y3,xp,yp;
        float a,b,c,d,e,f,x,y;
	float det;
	
	while(EOF != scanf("%f %f %f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp))
	{
                a=x2-x1;
                b=x3-x1;
                c=xp-x1;
                d=y2-y1;
                e=y3-y1;
                f=yp-y1;


                det = a*e - b*d;
		x   = (e*c - b*f)/det;
		y   = (-d*c+ a*f)/det;
		/*printf("%.3f %.3f\n",x,y);*/

                if(x > 0 && y > 0 && x+y < 1)
                  printf("YES\n");
                else
                  printf("NO\n");

          
	}
	return(0);
}

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

int main() {
    string w;
    cin >> w;
    int arr[26] = {0};
    for(int i = 0; i < w.size(); i++){
        arr[(int) w[i]-97]++;
    }
    for(int i = 0; i < 26; i++){
        if(arr[i] % 2 == 1){
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
}

Measured memory_bytes: 256
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		sc.nextLine();
		while (n-- > 0) {
			BigDecimal ax = new BigDecimal(sc.next());
			BigDecimal ay = new BigDecimal(sc.next());

			BigDecimal bx = new BigDecimal(sc.next());
			BigDecimal by = new BigDecimal(sc.next());

			BigDecimal cx = new BigDecimal(sc.next());
			BigDecimal cy = new BigDecimal(sc.next());

			BigDecimal dx = new BigDecimal(sc.next());
			BigDecimal dy = new BigDecimal(sc.next());

			// y - ay = katamukiab * (x -ax)
			// by - ay = katamukiab * (bx - ax)
			// katamukiab = (by - ay) / (bx - ax)
			// katamukicd = (dy - cy) / (dx - cx)
//			if ( (by-ay)*(dx-cx) == (dy-cy)*(bx-ax) )
//				System.out.println("YES");
//			else
//				System.out.println("NO");
			BigDecimal temp1 = by.subtract(ay);
			BigDecimal temp2 = dx.subtract(cx);
			BigDecimal templeft = temp1.multiply(temp2);

			temp1 = dy.subtract(cy);
			temp2 = bx.subtract(ax);
			BigDecimal tempright = temp1.multiply(temp2);

			if ( templeft.compareTo(tempright) == 0 ) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}

}

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

typedef long long ll;
typedef double dd;

typedef vector<int> vi;
typedef pair<int,int> pii;

const int mx=1e6+11;
const long double PI=3.14159265358979;

#define nl '\n'
#define pb push_back
#define F first
#define S second
#define I insert
#define mp make_pair

#define sz(x) x.size()
#define sqr(a) ((a) * (a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sa(v) sort(v.begin(),v.end())
#define sd(v) sort(v.begin(),v.end(),greater<>())
#define rev(s) reverse(s.begin(),s.end())
#define tt int t; cin>>t; while(t--)
#define lo(i,a,b) for(ll i=a;i<b;i++)
#define be(a) (a).begin(),(a).end()

#define yes cout<<"YES"<<nl;
#define no cout<<"NO"<<nl;

#define su ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

int main()
{
   su;
   int sum=0,n,a;
   cin>>n;
   map <int,int>m;
   while(n--)
   {
      cin>>a;
      m[a]++;
   }
   for(auto i:m)
   {
      n=i.F;
      a=i.S;
      if(n>a)
         sum+=a;
      else if(n<a)
         sum+=(a-n);
   }
   cout<<sum<<nl;
   return 0;
}


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

int main(){
    long long X, t;
    bool check = false;
    cin >> X;
    for (long long i = 1; i <= pow(X, 0.5); i++) {
        if (X % i == 0) {
            for (long long j = -i/2; j <= pow(X, 0.25) - i; j++) {
                if (pow(j+i, 5) - pow(j, 5) == X) {
                    cout << j+i << ' ' << j;
                    check = true;
                    break;
                }
            }
            if (check) {
                break;
            }
            t = X / i;
            for (long long j = -t/2; j <= pow(X, 0.25) - t; j++) {
                if (pow(j+t, 5) - pow(j, 5) == X) {
                    cout << j+t << ' ' << j;
                    check = true;
                    break;
                }
            }
            if (check) {
                break;
            }
        }
    }
} 

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

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int MOD2 = MOD + 2; //1007681537;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
inline ll isqrt(ll k) {ll r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
#define db(x) cerr << #x << " = " << (x) << " ";
#define endln cerr << "\n";

int main() 
{
    int n;
    cin>>n;
    const double pi=3.1415926535;
    cout<<2*pi*n<<endl;
   return 0;
}

Measured memory_bytes: 3784
from collections import deque

N,M = map(int,input().split())

dic = {}
npflag = [True] * N
pnum = [0] * N
p = [None] * N
dep = [float("-inf")] * N

for i in range(N+M-1):

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

    if A not in dic:
        dic[A] = []

    dic[A].append(B)
    npflag[B] = False
    pnum[B] += 1

for i in range(N):

    if npflag[i]:
        root = i
        break

p[i] = -1
q = deque([i])
dep[i] = 0

while len(q) > 0:

    now = q.popleft()

    if now in dic:
        for i in dic[now]:

            if p[i] == None:
                p[i] = now
                dep[i] = dep[now] + 1
                pnum[i] -= 1
                if pnum[i] == 0:
                    q.append(i)

            elif dep[i] < dep[now] + 1:
                p[i] = now
                dep[i] = dep[now] + 1
                pnum[i] -= 1
                if pnum[i] == 0:
                    q.append(i)
                

for i in range(N):

    print (p[i]+1)


Measured memory_bytes: 79448
parseInt(x::String) = parse(Int, x)
parseInt(x::SubString{String}) = parse(Int, x)
parseInt(x::Char) = parse(Int, x)
parseInt(x::Float64) = trunc(Int, x)
parseFloat(x::String) = parse(Float64, x)
parseFloat(x::Int) = trunc(Float64, x)
parseFloat(x::SubString{String}) = parse(Float64, x)
parseFloat(x::Char) = parse(Float64, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n,m=parseMap(split(readline()))
    ab=[parseMap(split(readline())) for i in 1:n]
    cd=[parseMap(split(readline())) for i in 1:m]
    point=[0 for i in 1:n]
    for i in 1:n
        res,index=abs(ab[i][1]-cd[1][1])+abs(ab[i][2]-cd[1][2]),1
        for j in 2:m
            num=abs(ab[i][1]-cd[j][1])+abs(ab[i][2]-cd[j][2])
            if res>num
                res=num
                index=j
            end
        end
        point[i]=index
    end
    println(join(point,"\n"))
end
main()

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

int main() {
  int r, g;
  cin >> r;
  cin >> g;
  int ans;
  if(r <= g) {
    ans = g + (g - r);
  } else {
    ans = g - (r - g);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <numeric>

using namespace std;


int main() {
    int N;
    string S;
    cin >> N >> S;

    long long r = 0, g = 0, b = 0;
    for (int i = 0; i < N; i++) {
        if (S[i] == 'R') r++;
        else if (S[i] == 'G') g++;
        else b++;
    }

    long long res = r * g * b;
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            int k = j + (j - i);
            if (k < N && S[i] != S[j] && S[j] != S[k] && S[k] != S[i]) {
                res--;
            }
        }
    }

    cout << res << endl;
    return 0;
}


Measured memory_bytes: 3588
//  [amitdu6ey]
// g++ -std=c++11 -o2 -Wall filename.cpp -o filename
#include <bits/stdc++.h>
#define hell 1000000009
#define bug1(x) cout<<"$ "<<x<<" $"<<endl
#define bug2(x) cout<<"% "<<x<<" %"<<endl
#define bug3(x) cout<<"# "<<x<<" #"<<endl
#define ll long long
#define pb push_back
#define mp make_pair
#define tr(z) for(auto it=z.begin(); it!=z.end(); it++)
#define rloop(i,a,b) for(long long i=a; i>=b;i--)
#define loop(i,a,b) for(long long i=a; i<b; i++)
#define vbool vector< bool >
#define vvbool  vector< vector<bool> >
#define vchar vector<char>
#define vi vector<int>
#define vvi vector< vector<int> >
#define pll pair<long long, long long>
#define vll vector<long long>
#define vvl vector< vector<long long> >
#define ninf numeric_limits<long long>::min()
#define pinf numeric_limits<long long>::max()
#define comp(a,b) (abs(a-b)<1e-9) // to compare doubles
using namespace std;

void solve(){
    ll n;
    cin>>n;
    ll k=2;
    vll h(n,0);
    loop(i,0,n) cin>>h[i];
    vll dp(n,pinf);
    dp[0]=0;
    loop(i,1,n){
        loop(j,max(0ll,i-k),i){
            dp[i] = min(dp[i], dp[j] + abs(h[i]-h[j]));
        }
    }
    cout<<dp[n-1]<<endl;
    return;
}

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


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

int main()
{
    int n, m, sumA = 0;
    cin >> n >> m;

    for (int i = 0; i < m; i++) {
        int a;
        cin >> a;
        sumA += a;
    }

    if (sumA > n) cout << -1 << endl;
    else cout << n - sumA << endl;

    return 0;
}

Measured memory_bytes: 3624
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int m=1<<28,M=0,s=0;
    for(int i=0;i<n;++i){
      int t;cin>>t;
      m=min(m,t);
      M=max(M,t);
      s+=t;
    }
    cout << (s-m-M)/(n-2) << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順
#include <map>

using namespace std;
using ll = long long int;

int main(){
    ll N;cin>>N;
    if(N==1){
        cout << 0 << endl;
        exit(0);
    }
    ll n = sqrt(N);
    map<ll,int> m;
    for(ll i=2;i<=n;i++){
        while(N%i==0){
            N /= i;
            m[i]++;
        }
    }
    if(N!=1) m[N]++;
    if(m.size()==0){
        cout << 1 << endl;
        exit(0);
    }
    ll ans = 0; 
    for(auto i=m.begin();i!=m.end();++i){
        for(int j=1;i->second>=0;j++){
            i->second -= j;
            if(i->second<0) break;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3720
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        String[] a = new String[n];
        String[] b = new String[m];

        for (int i = 0; i < n; i++){
            a[i] = scanner.next();
        }
        for (int i = 0; i < m; i++){
            b[i] = scanner.next();
        }

        int bCounter = 0;
        int shift = -1;
        int rowFound = 0;
        for (int i = 0; i < n; i++){
            if (bCounter == 0){
                shift = a[i].indexOf(b[bCounter]);
                if (shift == -1){
                    continue;
                }
                rowFound++;
            }
            else if (bCounter < m){
                if (a[i].indexOf(b[bCounter]) == -1){
                    scanner.close();
                    System.out.println("No");
                    return;
                } else {
                    rowFound++;
                }
            }
            bCounter++;
        }
        if (rowFound == m){
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        scanner.close();
    }
}

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



i64 h,w, a,b;
const int MAX = 202020, MOD = INF;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
	inv[0] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long C(i64 n, i64 k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
void solve(){
	cin >> h >> w;
	cin >> a >> b;
	
	COMinit();
	
	i64 ans = 0;
	for(int i = b; i < w; i++){
		ans += mod(C(h-a-1+i, i) * C(a-1+w-i-1,a-1),INF);
		ans %= INF;
	}
	cout << ans << endl;
}

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


Measured memory_bytes: 4992
#include <stdio.h>
#include <math.h>
#define TRUE 1
#define FALSE 0
#define N 10000
int isprime(int);
int main(){
  int i;
  int n;
  int a[N],count =0 ;
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    }
  for(i=0;i<n;i++){
    if(isprime(a[i])==FALSE)continue;
    else if(isprime(a[i]) == TRUE)count ++;
    }
  printf("%d\n",count);
  return 0;
}




int isprime(int x){
  int i;
  if(x == 2)
    return TRUE;
  
  if(x < 2 || x%2 == 0)
    return FALSE;
  
  i = 3;
  while(i <= sqrt(x) ){
    if(x%i==0) 
    return FALSE;
    i = i + 2;
  }

  return TRUE;
}



Measured memory_bytes: 2084
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, l int
	fmt.Scan(&n, &l)

	s := make([]string, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&s[i])
	}
	sort.Strings(s)

	for i := 0; i < n; i++ {
		fmt.Print(s[i])
	}
	fmt.Println("")
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int> 
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
int n;
string s;
int main(){
    scanf("%d",&n);
    cin>>s;
    int j=0;
    int cnt=0;
    for(int i=0;i<s.size();i++){
        while(j<s.size() && s[j]==s[i]) j++;
        cnt++;
        i=j-1;
    }
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
    int x[3];
    cin >> x[0] >> x[1] >> x[2];
    sort(x, x+3);

    ll ans = 0;
    if ((x[1] - x[0]) % 2 == 1) {
        ans += 1;
        x[0]++;
        x[2]++;
    }
    ans += (x[1]-x[0]) / 2;
    ans += (x[2]-x[1]);
    

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

Measured memory_bytes: 256
N = int(input())
x = [0] * (N+1)
y = [0] * (N+1)
t = [0] * (N+1)
for i in range(N):
    a,b,c = map(int, input().split())
    t[i+1] = a
    x[i+1] = b
    y[i+1] = c

a = 'Yes'
for i in range(N):
    if t[i+1] - t[i] < abs(x[i+1]-x[i]) + abs(y[i+1] - y[i]):
      a = 'No'
      break
    if (t[i+1] - t[i]) % 2 != (abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])) % 2:
      a = 'No'
      break
print(a)

Measured memory_bytes: 17220
import java.util.*;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int HP = sc.nextInt();
        int hoge = sc.nextInt();
      	int waza = 0;
		for(int i = 0; i < hoge; i++){
			waza += sc.nextInt();
		}
		if(waza >= HP){
			System.out.print("Yes");
		}else{
			System.out.print("No");
		}
	}
}

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

using namespace std;

using i64 = int64_t;

const i64 MOD = 1e9+7;

const i64 INF = 1e18+7;


signed main(){
    int a, b, c, d, n, x, y;
    string s, t;


    auto Yes = [&](bool t){
        cout << (t ? "Yes" : "No") << endl;
    };
    auto YES = [&](bool t){
        cout << (t ? "YES" : "NO") << endl;
    };
    auto tri = [&](bool t, string a, string b){
        cout << (t ? a : b) << endl;
    };

    cin >> s;
    a = -1;
    for(int i = 0; i < s.size(); ++i){
        if(a == -1 && s[i] == 'A')
            a = i;
        if(s[i] == 'Z')
            b = i;
    }
    cout << b - a + 1 << endl;
}


Measured memory_bytes: 640
#include <stdio.h>
#include <iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,l,r) for(int i=l;i<r;i++)
using ll = long long;
const ll MOD=1e9+7;
const ll INF=9e18+10;
const int inf=2e9+10;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};


int main(){
        int k,n;cin>>k>>n;
        int A[n];
        rep(i,n)cin>>A[i];
        int subans=k+A[0]-A[n-1];
        for(int i=1;i<n;i++){
        subans=max(subans,A[i]-A[i-1]);
        }
        cout<<k-subans<<endl;
        return 0;
}

Measured memory_bytes: 4380
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> LP;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;


template<class Abel> class WeightedUnionFind{
    vector<ll> par; 
    vector<ll> r_size; 
    vector<ll> rank; 
    vector<Abel> diff_weight;
    public:
        WeightedUnionFind(ll N, Abel SUM_UNITY = 0){
            init(N, SUM_UNITY);
        }

        //Nの大きさで初期化
        void init(ll N, Abel SUM_UNITY = 0){
            par.resize(N); r_size.resize(N); rank.resize(N); diff_weight.resize(N);
            for(int i=0; i<N; ++i){ par[i] = i; r_size[i] = 1; rank[i] = 0; diff_weight[i] = SUM_UNITY; }
        }

        ll root(ll x){
            if(par[x] == x)return x;
            int r = root(par[x]);
            diff_weight[x] += diff_weight[par[x]];
            return par[x] = r;
        }

        int get_weight(int x){
            root(x);
            return diff_weight[x];
        }

        ll diff(int x, int y){
            return get_weight(y) - get_weight(x);
        }

        //xとyとが所属する集合を併呑する
        //なお，weight(y) - weight(x) = wとなるようにmerge
        void merge(ll x, ll y, Abel w){
            w += get_weight(x); w -= get_weight(y);
            ll rx = root(x); ll ry = root(y);
            if(rx == ry) return;
            if(rank[rx] < rank[ry]) swap(rx,ry), w = -w;
            if(rank[rx] == rank[ry]) ++rank[rx];
            r_size[rx] += r_size[ry];
            par[ry] = rx;
            diff_weight[ry] = w;
        }

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

        //素集合の大きさを返す
        ll size(ll x){
            return r_size[root(x)];
        }
};

int main(){
    int N, M, l, r, d;
    cin >> N >> M;
    WeightedUnionFind<int> uf(N,0);
    bool ans = true;
    rep(_,M){
        cin >> l >> r >> d;
        --l; --r;
        if(uf.same(l,r) && abs(uf.diff(l,r)) != d)ans = false;
        uf.merge(l,r,d);
    }
    cout << (ans ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 5880
// https://atcoder.jp/contests/abc122/tasks/abc122_b
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string str;
    cin >> str;
    regex patern("[ACGT]+");
    smatch match;

    size_t maxv = 0;
    while (regex_search(str, match, patern)) {
        // cout << match[0].str() << endl;
        maxv = max(maxv, match[0].str().length());
        str = match.suffix();
    }
    cout << maxv << endl;

    return 0;
}


Measured memory_bytes: 3820
import java.io.*
import java.util.*

val pw = PrintWriter(System.out)
fun solve(A: Int, B: Int){
    val size = 100
    pw.println("$size $size")
    val maze = Array(size){ y -> IntArray(size){ if(y < size/2) 0 else 1 } }
    var i = 0
    var j = 0
    repeat (A - 1){
        maze[i][j] = 1
        when(j){
            size - 2  -> { j = 0; i += 2 }
            else -> { j += 2 }
        }
    }
    i = size / 2 + 1
    j = 0
    repeat (B - 1){
        maze[i][j] = 0
        when(j){
            size - 2 -> { j = 0; i+= 2 }
            else -> { j += 2 }
        }
    }
    for (inner in maze){
        pw.println(inner.map{ if(it == 1) '.' else '#' }.joinToString(separator=""))
    }
    pw.flush()
    return
}


fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val A = sc.next().toInt()
    val B = sc.next().toInt()
    solve(A, B)
}


Measured memory_bytes: 33544
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 2147483647;

const int maxn = 1e5 + 7;
int n;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  int best = 0, id = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > best) {
      best = a[i];
      id = i;
    }
  }
  int second = a[1];
  if (id == 1) second = a[2];
  for (int i = 2; i <= n; i++) {
    if (min(a[i], best - a[i]) > min(second, best - second)) second = a[i];
  }
  printf("%d %d\n", best, second);
  return 0;
}



Measured memory_bytes: 640
D, G = map(int,input().split())
P = []
C = []
for _ in range(D):
    p, c = map(int,input().split())
    P.append(p)
    C.append(c)

S = []
for i in range(2**D):
    S.append(list(str(bin(i+2**D)))[3:])

ans = 10000
for l in S:
    total = 0
    cnt = 0
    for i, s in enumerate(l):
        if s == "1":
            total += 100 * (i + 1) * P[i] + C[i]
            cnt += P[i]
    if total >= G:
        if cnt < ans:
            ans = cnt

    i = D-1
    while i >= 0:
        if l[i] == "0":
            break
        i -= 1
    if i != -1:
        for j in range(1, P[i]):
            if total + 100 * (i + 1) * j >= G:
                if cnt+j < ans:
                    ans = cnt+j
                    break
print(ans)



Measured memory_bytes: 3188
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int bubbleSort(int,int []);
void trace(int,int []);

int main(){
    int N,i,l;
    cin >> N;
    int a[N];

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

    l = bubbleSort(N,a);
    cout << l << "\n";




    return 0;
}

int bubbleSort(int N, int a[]){
    int i,tmp,count=0,flag=1;
    while(flag){
        flag = 0;
        for(i=N-1;i>=1;i--){
            if(a[i]<a[i-1]){
                tmp = a[i];
                a[i] = a[i-1];
                a[i-1] = tmp;
                flag = 1;
                count++;
            }
        }
    }
    trace(N,a);
    return count;
}

void trace(int N,int a[]){
    for(int i=0; i<N; i++){
        if(i<N-1){
            cout << a[i] << " ";
        } else{
            cout << a[i] << "\n";
        }
    }
    return;
}


Measured memory_bytes: 3116