akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

const string seeds[10] = {
	"000",
	"001",
	"002",
	"011",
	"012",
	"022",
	"111",
	"112",
	"122",
	"222"
};

char evaluate( string ex )
{
	int f;
	int s;
	for ( int i = 0; i < ex.size(); i++ )
	{
		if ( ex[i] == '(' )
			f = i;
		else if ( ex[i] == ')' )
		{
			s = i;
			string sub = ex.substr( f+1, s-f-1 );
			ex.erase( ex.begin()+f, ex.begin()+s+1 );
			char n = evaluate( sub );
			ex.insert( ex.begin()+f, n );
			i = s = f = 0;
		}
	}

	// "-ðµæ¤"
	for ( int i = 0; i < ex.size(); i++ )
	{
		if ( ex[i] == '-' )
		{
			if ( ex[i+1] == '0' )
			{
				ex.erase( ex.begin()+i, ex.begin()+i+2 );
				ex.insert( ex.begin()+i, '2' );
			}
			else if ( ex[i+1] == '1' )
			{
				ex.erase( ex.begin()+i, ex.begin()+i+2 );
				ex.insert( ex.begin()+i, '1' );
			}
			else if ( ex[i+1] == '2' )
			{
				ex.erase( ex.begin()+i, ex.begin()+i+2 );
				ex.insert( ex.begin()+i, '0' );
			}
			i = 0;
		}
	}

	// ÁAæ
	for ( int i = 0; i < ex.size(); i++ )
	{
		if ( ex[i] == '*' )
		{
			if ( ex[i-1] == '0' || ex[i+1] == '0' )
				return '0';
			else if ( ex[i-1] == '1' || ex[i+1] == '1' )
				return '1';
			else
				return '2';
		}
		else if ( ex[i] == '+' )
		{
			if ( ex[i-1] == '2' || ex[i+1] == '2' )
				return '2';
			else if ( ex[i-1] == '1' || ex[i+1] == '1' )
				return '1';
			else
				return '0';
		}
	}

	return ex[0];
}

int main( void )
{
	string in;
	while ( cin >> in && in != "." )
	{
		// "--"ÍÁ¹é
		int index = 0;
		while ( ( index = in.find( "--" ) ) != string::npos )
		{
			in.replace( index, 2, "" );
		}

		int cnt = 0;
		for ( int k = 0; k < 10; k++ )
		{
			string seed;
			seed = seeds[k];
			do {
				string ex = in;
				replace( ex.begin(), ex.end(), 'P', seed[0] );
				replace( ex.begin(), ex.end(), 'Q', seed[1] );
				replace( ex.begin(), ex.end(), 'R', seed[2] );

				//==================================================
				// CÌ
				//==================================================
				char result = evaluate( ex );
				if ( result == '2' ) cnt ++;
			} while ( next_permutation( seed.begin(), seed.end() ) );
		}

		//==================================================
		// oÍ
		//==================================================
		cout << cnt << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
using namespace std;
int H, W, d[13][13], x;
int main() {
	cin >> H >> W;
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			cin >> d[i][j];
		}
	}
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			for (int k = 0; k < 10; k++) {
				d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
			}
		}
	}
	int ret = 0;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cin >> x;
			if (x != -1) ret += d[x][1];
		}
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 764
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<stdlib.h>
#include<set>

using namespace std;

int main(void)
{
    int N;
    cin>>N;
    long int a[N+1],b[N];
    for(int i=0;i<N+1;i++){
        cin>>a[i];
    }
    for(int i=0;i<N;i++){
        cin>>b[i];
    }
    
    long int sum=0;
    
    for(int i=0;i<N;i++){
        if(a[i]<=b[i]){
            sum+=a[i];
            long int rest=b[i]-a[i];
            if(a[i+1]<=rest){
                sum+=a[i+1];
                a[i+1]=0;
            }
            else{
                sum+=rest;
                a[i+1]-=rest;
            }
        }
        else{
            sum+=b[i];
        }
    }
    cout<<sum<<endl;
    
}


Measured memory_bytes: 1792
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <string>

using namespace std;

#define LL long long

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

int h, n;
int *a;

int main() {
	cin >> h >> n;
	int sm = 0;
	a = new int[n + 10];
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		sm += a[i];
	}
	if (sm >= h) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 640
//inlclude before define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
#include<assert.h>
//#include<deque>
#include<iomanip>
#include<set>
#include<tuple>
#include<map>
using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> P1;
typedef long long int ll;

//define
#define INF 1e9
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);i++)
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))


int main() {
	ll a, b, c;
	ll k;
	cin >> a >> b >> c >> k;
	ll ans;
	if (k % 2 == 0) {
		cout << a - b << endl;
	} else {
		cout << b - a << endl;
	}
}





Measured memory_bytes: 256
using System;
using System.Linq;

namespace CSharp
{
    class Program
    {
        public static void Main()
        {
            var input = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            var L = input[0];
            var R = input[1];

            var min = 2019L;
            var end = false;
            for (var i = L; i < R; i++)
            {
                for (var j = i + 1; j <= R; j++)
                {
                    if (i * j % 2019 < min)
                    {
                        min = i * j % 2019;
                        if (min == 0)
                        {
                            end = true;
                            break;
                        }
                    }
                }
                if (end)
                {
                    break;
                }
            }
            Console.WriteLine(min);
        }
    }
}


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

int main(){
  int n;
  cin >> n;
  vector<double> p(n+1);
  rep(i,n) cin >> p[i+1];
  vector<vector<double>> dp(n+1, vector<double>(n+1));
  dp[1][1] = p[1];
  dp[0][0] = 1;
  for(int i=1; i<=n; i++){
    for(int j=0; j<=n; j++){
      if(i==1 && j==1) continue;
      if(i<j) continue;
      if(j==0) dp[i][0] = dp[i-1][0]*(1-p[i]);
      else dp[i][j] = dp[i-1][j]*(1-p[i]) + dp[i-1][j-1]*p[i]; 
    }
  }
  //rep(i,4) cout << dp[n][i] << endl;
  double ans = 0;
  for(int j = n/2+1; j<=n; j++) ans += dp[n][j];
  printf("%.10f", ans);
}


Measured memory_bytes: 73776
#include <stdio.h>
#define INFTY 1000000000

void merge(int,int,int);
void mergeSort(int,int);
  
int L[5000000],R[5000000],S[5000000],count=0;

int main() {

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

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


void mergeSort(int left,int right)
{
  int mid;
  if(left + 1 < right) {
    mid = (left + right)/2;
    mergeSort(left,mid);
    mergeSort(mid,right);
    merge(left,mid,right);
  } 
}

void merge(int left,int mid,int right)
{
  int n1,n2,i,j,k;
  n1 = mid - left;
  n2 = right - mid;

  for(i = 0; i < n1; i++) {
    L[i] = S[left + i];
  }
  for(i = 0; i < n2; i++) {
    R[i] = S[mid + i];
  }
  L[n1] = INFTY;
  R[n2] = INFTY;
  i = 0;
  j = 0;
  
  for(k = left; k < right; k++) {
    count++;
    if(L[i] <= R[j]) {
      S[k] = L[i];
      i = i + 1;
    }
    else {
      S[k] = R[j];
      j = j + 1;
    }
}
}



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

// double solve(double ans, int here, vector<int> dest, int N, vector<vector<double>> dist){
//     // printf("N: %d\n", N);
//     // for (int i=0; i<N; i++){
//     //   printf("%d, ", dest[i]);
//     // }
//     // printf("\n");
//     double tmp = 0;
//     for (int i=0; i<N; i++){
//         // here から dest.at(i) への距離
//         double d = 0;
//         if (here >= 0){
//             d = dist.at(here).at(dest.at(i));
//         }
//         vector<int> new_dest;
//         for (int j=0; j<N; j++){
//             if (i==j) continue;
//             new_dest.push_back(dest.at(j));
//         }
//         tmp += ((N-1) * d + solve(ans, dest.at(i), new_dest, N-1, dist));
//     }
//     return (ans + tmp);
// }

double distance(vector<int> p1, vector<int> p2){
    return sqrt((p2.at(0) - p1.at(0)) * (p2.at(0) - p1.at(0)) + (p2.at(1) - p1.at(1)) * (p2.at(1) - p1.at(1)));
}

int main(){
    int N;
    cin >> N;
    vector<vector<int>> point(N, vector<int> (2));
    for (int i=0; i<N; i++){
        cin >> point.at(i).at(0) >> point.at(i).at(1);
    }
    
    vector<vector<double>> dist(N, vector<double> (N));
    for (int i=0; i<N; i++){
        for (int j=0; j<N; j++){
            if (i==j){
                dist.at(i).at(j) = 0;
            } else{
                dist.at(i).at(j) = distance(point.at(i), point.at(j));
            }
            //cout << dist.at(i).at(j) << endl;
        }
    }
    
    double ans = 0;
    // vector<int> dest(N);
    // for (int i=0; i<N; i++){
    //     dest.at(i) = i;
    // }
  	// ans = solve(ans, -1, dest, N, dist);

    for (int i=0; i<N; i++){
        for (int j=0; j<N; j++){
            ans += dist.at(i).at(j);
        }
    }
    // (N - 1) / (N * N - N) = 1 / N
    // int cnt = 1;
    // for (int i=0; i<N; i++){
    //   cnt *= i+1;
    // }
    
    printf("%.10f\n", ans / N);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

const int YEAR = 2019;

int main()
{
    int L, R, l, r, res=YEAR;
    cin >> L >> R;
    if(R - L < YEAR){
        l = L % YEAR;
        r = R % YEAR;
        if(l < r){
            for(int i=l; i<r;i++){
                for(int j=i+1;j<r+1;j++){
                    res = min(res, i*j % YEAR);
                }
            }
        }
        else{
            res = 0;
        }
    }
    else{
        res = 0;
    }
    cout << res << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
namespace Program
{
    class Test1
    {
        static void Main()
        {
            int nan = 0;
            string[] str = Console.ReadLine().Split(' ');
            string[] str1 = Console.ReadLine().Split(' ');
            int H = int.Parse(str[0]);
            int W = int.Parse(str[1]);
            List<int[]> aaa = new List<int[]>();

            for (int i = 0; i < W; i++)
            {
                int[] Hlength = new int[H];
                aaa.Add(Hlength);
            }
            int h = int.Parse(str1[0]);
            int w = int.Parse(str1[1]);
            for (int i = 0;i<W;i++)
            {
                for (int j = 0;j<H;j++)
                {
                    if (j<h)
                    {
                        aaa[i][j] += 1;
                    }
                }
            }
            for (int i = 0; i < W; i++)
            {
                for (int j = 0; j < H; j++)
                {
                    if (i < w)
                    {
                        aaa[i][j] += 1;
                    }
                }
            }
            for (int i = 0; i < W; i++)
            {
                for (int j = 0; j < H; j++)
                {
                    if (aaa[i][j] == 0)
                    {
                        nan++;
                    }
                }
            }
            Console.WriteLine(nan);
        }
    }
}

Measured memory_bytes: 11220
using static System.Math;
using System;

public class hello
{
    public static int h, w, sx, sy, gx, gy, tans;
    public static bool ok;
    public static int[] dx, dy;

    public static void Main()
    {
        while (true)
        {
            dx = new int[] { 0, 1, 0, -1 };
            dy = new int[] { 1, 0, -1, 0 };
            tans = 1000;
            ok = false; 
            string[] line = Console.ReadLine().Trim().Split(' ');
            w = int.Parse(line[0]);
            h = int.Parse(line[1]);
            if (w == 0 && h == 0) break;
            var map = new int[h, w];

            for (int i = 0; i < h; i++)
            {
                line = Console.ReadLine().Trim().Split(' ');
                for (int j = 0; j < w; j++)
                {
                    if (line[j] == "1") map[i, j] = 1;
                    else if (line[j] == "2") { sx = i; sy = j; }
                    else if (line[j] == "3") { gx = i; gy = j; }
                }
            }
            goDfs(map, sx, sy, 0);
            Console.WriteLine(ok? tans:-1);
        }
    }
    static void goDfs(int[,] map, int x, int y, int times)
    {
        if (times == 10 | times > tans) return;
        for (int i = 0; i < 4; i++)
        {
            var res = getP(map, x, y, i);
            if (res >= 30)
            {
                tans = Min(tans, times + 1);
                ok = true;
                return;
            }
            if (res >= 2)
            {
                var nx = x + (res - 1) * dx[i];
                var ny = y + (res - 1) * dy[i];
                map[x + res * dx[i], y + res * dy[i]] = 0;
                goDfs(map, nx, ny, times + 1);
                map[x + res * dx[i], y + res * dy[i]] = 1;
            }
        }
    }
    static int getP(int[,] map, int x, int y, int d)
    {
        var t = 1;
        var nx = x;
        var ny = y;
        while (true)
        {
            nx += dx[d];
            ny += dy[d];
            if (nx == gx && ny == gy) return 30;
            else if (nx < 0 || nx >= h || ny < 0 || ny >= w) return -1;
            else if (map[nx, ny] == 1) return t == 1 ? -1 : t;
            t++;
        }
    }
}



Measured memory_bytes: 17920
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v){stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n<<=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}
void YN(bool z){cout<<(z?"YES\n":"NO\n");}
void Yn(bool z){cout<<(z?"Yes\n":"No\n");}
void yn(bool z){cout<<(z?"yes\n":"no\n");}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 0;
char c;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  FOR(i, 0, 3){
    cin >> c;
    cout << 10 - (c-'0');
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

int bubbleSort(std::vector<int>* v, int n) {
  int cnt = 0;
  for(int i = 0; i < n; ++i) {
    for (int j = 0; j < n - 1 -i; ++j) {
      if (v->at(j) > v->at(j + 1)) {
        std::swap(v->at(j), v->at(j+1));
        ++cnt;
      }
    }
  }
  return cnt;
}

int main() {
  int n;
  std::cin >> n;
  std::vector<int> as;
  for (int i = 0; i < n; ++i) {
    int a;
    std::cin >> a;
    as.push_back(a);
  }
  int ans = bubbleSort(&as, n);
  for (int i = 0; i < n; ++i) {
    std::cout << as[i];
    if (i == n-1)
      std::cout << std::endl;
    else
      std::cout << " ";
  }
  std::cout << ans << std::endl;
}

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

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
   	int a,b,h;
    cin >> a >> b >> h;
    cout << (a+b)*h/2 << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

//using namespace __gnu_pbds;

using namespace std;

#define ll  long long

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef unordered_map<int,int> um;
typedef unordered_set<int> us;
typedef priority_queue<int> pq;
typedef deque<int> dq;
typedef queue<int> q;
typedef stack<int> st;

#define f first
#define s second
#define pb push_back
#define mp make_pair

#define rep(i,a,b) for (auto i = a; i < b; i++)


void c_p_c()
{
	
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

char arr[1001][1001];
int dp[1001][1001];

void init(){
	rep(i,0,1000){
		rep(j,0,1000){
			arr[i][j]='0';
		}
	}
}

int main(){

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll H,W;
	cin>>H>>W;

	init();

	rep(i,1,H+1){
		rep(j,1,W+1){
			cin>>arr[i][j];
		}
	}

	rep(i,0,H+1){
		rep(j,0,W+1){
			if(i==1 && j==1)
				dp[i][j]=1;
			else
				dp[i][j]=0;
		}
	}

	rep(i,1,H+1){
		rep(j,1,W+1){
			if(i==1 && j==1)
				continue;
			if(arr[i][j]=='#')
				dp[i][j]=0;
			else{
				dp[i][j]=(dp[i-1][j]+dp[i][j-1])%1000000007;
			}
		}
	}

	cout<<dp[H][W]%1000000007;

	return 0;
	}

		

Measured memory_bytes: 5120
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yassin
 */

#include <bits/stdc++.h>

using namespace std;

class agc026_a {
public:
    void solve(istream& in, ostream& out) {
        int N;
        in >> N;
        vector<int> a(N);
        for (int i = 0; i < N; ++i) {
            in >> a[i];
        }
        int res = 0;
        for (int i = 1; i < N; ++i) {
            if (a[i] == a[i - 1]) {
                ++res;
                ++i;
            }
        }
        out << res << "\n";
    }
};

int main() {
	std::ios::sync_with_stdio(false); cin.tie(nullptr);
	agc026_a solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

typedef long long ll;

using namespace std;


int main() {
    ll H, W, M;
    cin >> H >> W >> M;
    vector<pair<ll, ll>> row(H);
    for (int i = 0; i < H; ++i) {
        row[i] = {0, i};
    }
    vector<pair<ll, ll>> col(W);
    for (int i = 0; i < W; ++i) {
        col[i] = {0, i};
    }
    set<pair<ll, ll>> s;
    for (int i = 0; i < M; ++i) {
        ll h, w;
        cin >> h >> w;
        --h; --w;
        s.insert({h, w});
        ++row[h].first;
        ++col[w].first;
    }

    sort(row.begin(), row.end(), greater<>());
    sort(col.begin(), col.end(), greater<>());

    for (auto it_r = row.begin(); it_r != row.end() && it_r->first == row[0].first; ++it_r) {
        for (auto it_c = col.begin(); it_c != col.end() && it_c->first == col[0].first; ++it_c) {
            if (s.find({it_r->second, it_c->second}) == s.end()) {
                cout << row[0].first + col[0].first << endl;
                return 0;
            }
        }
    }

    cout << row[0].first + col[0].first - 1 << endl;

    return 0;
}

Measured memory_bytes: 31476
/*
 * b.cpp
 *
 *  Created on: 2017/08/26
 *      Author: pinebooks
 */

#include <cstdio>
#include <algorithm>

using namespace std;

int main() {
  int A, B, C, D;
  scanf("%d%d%d%d", &A, &B, &C, &D);

  int kagen = max(A, C);
  int jyogen = min(B, D);
  if (jyogen - kagen > 0)
    printf("%d", jyogen - kagen);
  else
    printf("%d", 0);
  return 0;
}


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

#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

template<typename T>
vector<T> gen_v(size_t a) { return vector<T>(a); }
template<typename T, typename ...Ts>
auto gen_v(size_t a, Ts... ts) { return vector<decltype(gen_v<T>(ts...))>(a, gen_v<T>(ts...)); }
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int x, y; cin >> x >> y;
	int ans = 0;
	if (x == 1 && y == 1) {
		ans += 400000;
	}
	if (x == 1) {
		ans += 300000;
	}
	else if (x == 2) {
		ans += 200000;
	}
	else if (x == 3) {
		ans += 100000;
	}

	if (y == 1) {
		ans += 300000;
	}
	else if (y == 2) {
		ans += 200000;
	}
	else if (y == 3) {
		ans += 100000;
	}
	cout << ans << endl;
	return 0;
}

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

int main() {
	string Sd, T, S = "UNRESTORABLE";
	cin >> Sd >> T;
	for (int i = Sd.size() - T.size(); i >= 0; i--) {
		for (int j = 0; j < T.size(); j++) {
			if (T[j] == Sd[i + j] || Sd[i + j] == '?') {
				if (j != T.size() - 1)
					continue;
			} else {
				break;
			}
			S = Sd;
			for (int k = 0; k < T.size(); k++) {
				S[i + k] = T[k];
			}
			for (int k = 0; k < S.size(); k++) {
				if (S[k] == '?') {
					S[k] = 'a';
				}
			}
			cout << S << endl;
			return 0;
		}
	}
	cout << S << endl;
	return 0;
}


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

int main() {
  int A,B;
  cin >> A >> B;
  int K=A,ans=1;
  while(K<B){
    K = K+(A-1);
    ans++;    
  }
  if(B==1){
    ans=0;
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
  ios::sync_with_stdio(false);
  int w, h, n;
  cin >> w >> h >> n;
  map<pair<int, int>, int> cnt;
  while (n--) {
    int x, y;
    cin >> x >> y;
    for (int i = x - 3; i < x; i++)
      for (int j = y - 3; j < y; j++)
        if (i >= 0 && j >= 0 && i + 2 < w && j + 2 < h)
          cnt[make_pair(i, j)]++;
  }
  vector<long long> res(10, 0);
  res[0] = (long long) (w - 2) * (h - 2);
  for (auto &it:cnt)
    res[it.second]++, res[0]--;
  for (auto &x:res)
    cout << x << endl;
  return 0;
}

Measured memory_bytes: 56576
#include <bits/stdc++.h>
using namespace std;
int dp[200005] ;
int h[200005] ;
int n , k ;
int main(){
    cin >> n >> k ;
    for ( int i = 1 ; i <= n ; i++ ){
        cin >> h[i] ;
    }
    dp[1] = 0 ;
    dp[2] = abs( h[2] - h[1] ) ;
    for ( int i = 3 ; i <= n ; i++ ){
        dp[i] = INT_MAX ;
        for ( int l = 1 ; l <= k ; l++ ){
            if ( i - l == 0 )
                break ;
            int t = dp[i-l] + abs( h[i] - h[i-l] ) ;
            dp[i] = min ( dp[i] , t ) ;
        }
    }
    cout << dp[n] ;
    return 0;
}


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

static const long long MOD=1e9+7;

int main(){
    string s;
    cin>>s;
    int n=s.size();
    vector<vector<long long>> dp(100005,vector<long long>(13,0));
    dp[0][0]=1;
    for(int i=0;i<n;++i){
        for(int j=0;j<13;++j){
            if(s[i]=='?'){
                for(int k=0;k<10;++k){
                    int j2=(10*j+k)%13;
                    dp[i+1][j2]=(dp[i+1][j2]+dp[i][j])%MOD;
                }
            }
            else{
                int k=s[i]-'0';
                int j2=(10*j+k)%13;
                dp[i+1][j2]=(dp[i+1][j2]+dp[i][j])%MOD;
            }
        }
    }

    cout<<dp[n][5]<<endl;
}

Measured memory_bytes: 16712
import sys
sys.setrecursionlimit(10**6)
 
N,u,v = map(int,input().split())
edges = [list(map(int,input().split())) for _ in range(N-1)]
E = [[] for _ in range(N+1)]
for a,b in edges:
    E[a].append(b)
    E[b].append(a)
 
depth = [[-1,-1] for _ in range(N+1)] 
depth[v][0] = 0
depth[u][1] = 0

def dfs1(E,v):
    vv = E[v]
    for vvv in vv:
        if depth[vvv][0] == -1:
            depth[vvv][0] = depth[v][0] + 1
            dfs1(E,vvv)
 
def dfs2(E,v):
    vv = E[v]
    for vvv in vv:
        if depth[vvv][1] == -1:
            depth[vvv][1] = depth[v][1] + 1
            dfs2(E,vvv)
dfs1(E,v)
dfs2(E,u)
depth = sorted(depth, reverse=True)
idx = 0
while True:
    if depth[idx][0] - depth[idx][1] >= 1:
        print(depth[idx][0]-1)
        exit()
    else:
        idx += 1

Measured memory_bytes: 119168
import java.util.Scanner;

public class Main {
    public static void main(String args[]){

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        String symbol = "";

        if(a < b && b < c)
            symbol = "Yes";
        else
            symbol = "No";

        System.out.println(symbol);
    }
}



Measured memory_bytes: 26196
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
	boxes = []
	while True:
		h, w = [int(i) for i in input().split(" ")]
		if h == 0 and w == 0:
			break
		boxes.append([h, w])
	for i in boxes:
		print("#"* i[1])
		for j in range(i[0] - 2):
			print("#"+ "." * (i[1] - 2) + "#")
		print("#"* i[1])
		print()
	return
if __name__ == '__main__':
  main()

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

int main()
{
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < s.length(); i++) {
    char ch = s.at(i);
    ch = ((ch - 0x41 + n) % 26) + 0x41;
    s.at(i) = ch;
  }
  cout << s << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int a, b;
int change;
int GCD(int m, int n)
{
	if((0==m)||(0==n))
	{
		return 0;
	}
	while(m!=n)
	{
		if(m>n)
		{
			m=m-n;
		}
		else
		{
			n=n-m;
		}
	}
	return m;
}
int LCM(int m,int n)
{
	if((0==m)||(0==n))
	{
		return 0;
	}
	return m/GCD(m,n)*n;
}
int main()
{
	while(cin>>a>>b)
	{
		printf("%d %d\n",GCD(a,b),LCM(a,b));
	}
}

Measured memory_bytes: 0
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

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

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
ll gcd(ll a, ll b)
{
	if (b == 0)return a;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region LCM
ll lcm(ll a, ll b)
{
	return a / gcd(a, b) * b;
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion

#pragma region イベントソート
using type = pair<int, ll>; // 1: query, 0; delete, -1: insert
using event = pair<ll, type>;
#pragma endregion

int main()
{
	int n, q; cin >> n >> q;
	vector<event> v;
	rep(i, n)
	{
		ll s, t, x; cin >> s >> t >> x;
		v.push_back({ s - x,{-1,x} });
		v.push_back({ t - x,{0,x} });
	}
	rep(i, q)
	{
		ll d; cin >> d;
		v.push_back({ d,{1,0} });
	}
	sort(all(v));
	multiset<ll> s;
	for (auto p : v)
	{
		ll e = p.second.first;
		ll pos = p.second.second;
		if (e == -1) s.insert(pos);
		else if (e == 0)s.erase(s.lower_bound(pos));
		else
		{
			if (s.empty())cout << -1 << endl;
			else cout << *s.begin() << endl;
		}
	}
}

Measured memory_bytes: 27752
//package abc047a;

import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int a, b, c;
		
		Scanner sc = new Scanner(System.in);
		a= sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();
		if((a + b == c) ||(a + c == b) || (b + c == a))
			System.out.println("Yes");
		else
			System.out.println("No");



	}

}


Measured memory_bytes: 23380
#include<bits/stdc++.h>
#define sqr(x) ((x)*(x))
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define vi vector<int>
#define HEAP(...) priority_queue<__VA_ARGS__ >
#define heap(...) priority_queue<__VA_ARGS__,vector<__VA_ARGS__ >,greater<__VA_ARGS__ > > 
#define pii pair<int,int> 
#define pb push_back
#define mp make_pair
#define debuge cerr<<"isok"<<endl
#define debug(x) cerr<<#x<<"="<<x<<endl
#define dprintf(...) fprintf(stderr,__VA_ARGS__)
#define SS second
#define FF first
#define ls (k<<1)
#define rs (k<<1|1)
#define clr(a,x) memset(a,x,sizeof(a))
#define cpy(a,x) memcpy(a,x,sizeof(a))
#define file(x) freopen(x".in","r",stdin),freopen(x".out","w",stdout)
#define SZ(x) ((int)x.size())
using namespace std;
template<class T> inline void gmin(T &x,const T &y){if(x>y) x=y;}
template<class T> inline void gmax(T &x,const T &y){if(x<y) x=y;}
const int BufferSize=1<<16;
char buffer[BufferSize],*Bufferhead,*Buffertail;
bool Terminal;
inline char Getchar(){
	if(Bufferhead==Buffertail){
		int l=fread(buffer,1,BufferSize,stdin);
		if(!l){Terminal=1;return 0;}
		Buffertail=(Bufferhead=buffer)+l;
	}
	return *Bufferhead++;
}
template<class T>inline bool read(T &x){
	x=0;char c=Getchar(),rev=0;
	while(c<'0'||c>'9'){rev|=c=='-';c=Getchar();if(Terminal)return 0;}
	while(c>='0'&&c<='9') x=x*10+c-'0',c=Getchar();
	if(c=='.'){
		c=Getchar();double t=0.1;
		while(c>='0'&&c<='9') x=x+(c-'0')*t,c=Getchar(),t=t/10;
	}
	x=rev?-x:x;
	return 1;
}
template<class T1,class T2> inline bool read(T1 &x,T2 &y){return read(x)&read(y);}
template<class T1,class T2,class T3> inline bool read(T1 &x,T2 &y,T3 &z){return read(x)&read(y)&read(z);}
template<class T1,class T2,class T3,class T4> inline bool read(T1 &x,T2 &y,T3 &z,T4 &w){return read(x)&read(y)&read(z)&read(w);}
inline bool reads(char *x){
	char c=Getchar();
	while(c<33||c>126){c=Getchar();if(Terminal)return 0;}
	while(c>=33&&c<=126) (*x++)=c,c=Getchar();
	*x=0;return 1;
}
template<class T>inline void print(T x,const char c='\n'){
	if(!x){putchar('0');putchar(c);return;}
	if(x<0) putchar('-'),x=-x;
	int m=0,a[20];
	while(x) a[m++]=x%10,x/=10;
	while(m--) putchar(a[m]+'0');
	putchar(c);
}
//--------------------------------head---------------------------------------------

const int inf=0x3f3f3f3f;
const int N=100005,M=100005,mod=1e9+7;
template<class T,class S> inline void ch(T &x,const S y){x=(x+y)%mod;}
inline int exp(int x,int y,const int mod=::mod){
	int ans=1;
	while(y){
		if(y&1) ans=(ll)ans*x%mod;
		x=(ll)x*x%mod;y>>=1;
	}return ans;
}

int n;
char s[N];

int main(){
#ifdef rqgao2014
	freopen("input.txt","r",stdin);
#endif
	scanf("%s",s+1);n=strlen(s+1);
	for(int i=1;i<=n-8;i++)
		putchar(s[i]);
	puts("");
	return 0;
}

Measured memory_bytes: 256
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 k = sc.nextInt();
		sc.close();

		int ans = 0;
		int kailen = 0;
		int[] kai = new int[100];
		int i;
		for (i=1; i<=100; i++) {
			if (a % i == 0 && b % i == 0) {
				kai[kailen]= i;
				ans++;
				kailen++;
			}
		}
		System.out.println(kai[kailen-k]);
	}
}


Measured memory_bytes: 21844
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll N,M; cin >> N >> M;
    
    vector<ll> ok(N);
    vector<ll> pena(N);
    
    for(int i = 0; i < M;i++){
        ll p; string S; cin >> p >> S;
        
        if(S == "AC"){
            ok[p-1] = true;
        }else{
            if(ok[p-1]==false){
                pena[p-1]++;
            }
        }
    }
    ll ans1 = 0;
    ll ans2 = 0;
    
    for(int i = 0; i < N;i++){
        if(ok[i]){
            ans1++;
            ans2 += pena[i];
        }
    }
    return res = vector<ll>{ans1,ans2};
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<vector<ll>>() << endl;
    return 0;
}


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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

ll div1(ll x){
  return x%1000000007;
}

//ost:列順で大きい,kst:列の中で大きい

main(){
    ll n=in(),k=in(),a[n],ans=0,ost,kst;
    for (int i=0;i<n;i++) cin >> a[i];
    for (int i=0;i<n;i++){
        ost=0;
        kst=0;
        for (int i2=0;i2<n;i2++){
            if (a[i2]<a[i] && i<i2) ost++;
            if (a[i2]<a[i]) kst++;
        }
      ans+=div1(ost*k)+div1(kst*div1(k*(k-1)/2));
      ans=div1(ans);
      //cout << a[i] <<' ' << ost << ' ' << kst  << ' ' << ans << endl;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws IOException {

		Scanner scanner = new Scanner(System.in);
		String ans = scanner.nextLine().toLowerCase();
		int count = 0;
		
		end:
		while (scanner.hasNext()) {
			String str = scanner.nextLine();
			String[] strs = str.split(" ");
			for (int i = 0; i < strs.length; i++) {
				if(strs[i].equals("END_OF_TEXT")){
					break end;
				}
				if (strs[i].toLowerCase().equals(ans)) {
					count++;
				}
			}
		}
		System.out.println(count);
	}
}

Measured memory_bytes: 26208
A, B, C = map(int, input().split())

count = 0

while True:
    if A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
        if A == B == C:
            print(-1)
            break

        a = B / 2 + C / 2
        b = A / 2 + C / 2
        c = A / 2 + B / 2
        A = a
        B = b
        C = c
        count += 1
    else:
        print(count)
        break

Measured memory_bytes: 3064
import sys
input = sys.stdin.readline


def read():
    C = []
    for i in range(3):
        c1, c2, c3 = map(int, input().strip().split())
        C.append((c1, c2, c3))
    return C,

def solve(C):
    for b0 in range(101):
        for b1 in range(101):
            for b2 in range(101):
                x = C[0][0] - b0
                y = C[0][1] - b1
                z = C[0][2] - b2
                if x != y or y != z:
                    continue
                x = C[1][0] - b0
                y = C[1][1] - b1
                z = C[1][2] - b2
                if x != y or y != z:
                    continue
                x = C[2][0] - b0
                y = C[2][1] - b1
                z = C[2][2] - b2
                if x != y or y != z:
                    continue
                return "Yes"
    return "No"


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))


Measured memory_bytes: 3064
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools

def bfs(x, n):
  que = deque([x])
  while que:
      node = que.popleft()
      for i in range(len(Edge[node])):
          if(Val[Edge[node][i]] > Val[node]):
              Val[Edge[node][i]] = Val[node]+1
              Dir[Edge[node][i]] = node
          que.append(Edge[node][i])
      Edge[node] = []


sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]

N, M = map(int,input().split())
INF = N+1
#G = [["X" for i in range(N] for i in range(N)]
Dir = [0 for i in range(N)]
Val = [INF for i in range(N)]
Val[0] = 0
Edge = [[] for i in range(N)]
ans = 0

for i in range(M):
    A, B = map(int,input().split())
    Edge[A-1].append(B-1)
    Edge[B-1].append(A-1)


bfs(0,N)


print("Yes")
for i in range(N-1):
    print(Dir[i+1]+1)


Measured memory_bytes: 110296
#include <iostream>
#include <stdio.h>
#include <cmath>

using namespace std;
int main () {
	double x1,y1,x2,y2;
	cin >> x1 >> y1 >> x2 >> y2;
	printf("%.6f\n",sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)));
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

using namespace std;

string key[3]={"the","this","that"};

string s,s2;

int main(){
	while(getline(cin,s)){
		bool flg=false;
		REP(c,'z'-'a'+1){
			s2=s;
			REP(i,s2.length()){
				if (s2[i]!=' ' && s2[i]!='.'){
					if ((int)s2[i]+c>'z'){
						s2[i]+='a'-'z'-1;
					}
					s2[i]+=c;
				}
			}
			REP(i,3){
				if (s2.find(key[i])!=string::npos){
					cout<<s2<<endl;
					flg=true;
					break;
				}
			}
			if (flg) break;
		}
	}
	return 0;
}

Measured memory_bytes: 1188
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var (
	sc = bufio.NewScanner(os.Stdin)
	// rdr = bufio.NewReaderSize(os.Stdin, 1000000)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

// func nextMega() string {
// 	buf := make([]byte, 0, 1000000)
// 	for {
// 		l, p, _ := rdr.ReadLine()
// 		buf = append(buf, l...)
// 		if !p {
// 			break
// 		}
// 	}
// 	return string(buf)
// }

func main() {
	sc.Split(bufio.ScanWords)
	// n, a, b := nextInt(), nextInt(), nextInt()
	var n, a, b int
	fmt.Scan(&n, &a, &b)
	// s := nextMega()
	var s string
	fmt.Scan(&s)
	rank := 0
	sum := 0
	for i := 0; i < n; i++ {
		ok := false
		if s[i] == 'a' && sum < a+b {
			sum++
			ok = true
		} else if s[i] == 'b' {
			rank++
			if sum < a+b && rank <= b {
				sum++
				ok = true
			}
		}
		if ok {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}
}


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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string b = System.Console.ReadLine();
            switch (b)
            {
                case "A":
                    Console.WriteLine("T");
                    break;
                case "T":
                    Console.WriteLine("A");
                    break;

                case "C":
                    Console.WriteLine("G");
                    break;
                case "G":
                    Console.WriteLine("C");
                    break;

            }
        }
    }
}

Measured memory_bytes: 11092
import math
a,b,h,m = map(int,input().split())
ax = a*math.cos(math.radians(30*h+0.5*m))
ay = a*math.sin(math.radians(30*h+0.5*m))
bx = b*math.cos(math.radians(6*m))
by = b*math.sin(math.radians(6*m))
leng = math.sqrt(((abs(ax-bx))**2+(abs(ay-by))**2))
print(leng)

Measured memory_bytes: 9468
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1001001001001001;
const int MOD = 1000000007;

template <typename T>
void print(const T &v);

int main()
{
    int n;
    cin >> n;
    vector<ll> list(n + 1);
    for (int i = 1; i <= n; i++)
    {
        list[i] = list[i - 1] + i;
    }
    // print(list);
    ll left = 0;
    ll right = n + 1;
    while (right - left > 1)
    {
        ll mid = (left + right) / 2;
        if (list[mid] < n)
        {
            left = mid;
        }
        else
        {
            right = mid;
        }
    }
    // cout << "right:" << right << endl;
    ll total = 0;
    for (int i = right; i > 0; i--)
    {
        if (total + i <= n)
        {
            cout << i << endl;
            total += i;
        }
    }
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

Measured memory_bytes: 81368
#include<bits/stdc++.h>
using namespace std;
int n,a;
double t;
double h[1010];
double cha[1010];
int id;
double minx=99999999;
int main()
{
	cin>>n;
	cin>>t>>a;
	for(int i=1;i<=n;i++)
	cin>>h[i];
	for(int i=1;i<=n;i++)
	cha[i]=fabs(t-h[i]*0.006-a);
	for(int i=1;i<=n;i++)
	if(cha[i]<minx) minx=cha[i],id=i;
	cout<<id<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {

    int n;

    scanf("%d", &n);

    if(n % 2 == 0) {
        n = n / 2;
    }
    else {
        n = n / 2 + 1;
    }

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

Measured memory_bytes: 128
program main;
var
  n, c, s, t : string;
  a, b : longint;


begin
  readln(n);
  readln(a, b);
  readln(c);
  s := copy(n, 1, pos(' ', n)-1); 
  t := copy(n, pos(' ', n)+1, length(n));
  if (c = s) then dec(a)
  else if (c = t) then dec(b);
  writeln(a, ' ', b);
end.

Measured memory_bytes: 1292
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <numeric>
#include <algorithm>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <cassert>
#include <bitset>
#include <cmath>
#include <iomanip>

using namespace std;

using int64 = long long;

/////////////////////
// Code starts here//
/////////////////////


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

    int H, W;
    cin >> H >> W;

    vector<string> grid(H);
    for (int i = 0; i < H; i++)
        cin >> grid[i];

    vector<vector<int>> dp(H, vector<int>(W, 1<<30));

    dp[0][0] = (grid[0][0] == '#' ? 1 : 0);

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (!i && !j)
                continue;

            if (i) {
                dp[i][j] = min(dp[i][j], dp[i-1][j] + (grid[i][j] != grid[i-1][j]));
            }

            if (j) {
                dp[i][j] = min(dp[i][j], dp[i][j-1] + (grid[i][j] != grid[i][j-1]));
            }
        }
    }

    cout << (dp[H-1][W-1] + 1) / 2 << "\n";

    return 0;
}


Measured memory_bytes: 384
#include <stdio.h>
#include <iostream>
#include <complex>
#include <cmath>
#define prt(cplx) printf("%.8lf %.8lf\n",cplx.real(),cplx.imag())

using namespace std;

typedef complex<double> P;

void draw(P p1, P p2, int depth) {
	if(depth<=0) {
		prt(p1);
		return;
	}

	P _p = (p2-p1);

	P s = p1+_p*1.0/3.0;
	P t = p1+_p*2.0/3.0;

	P _v = _p * P(0,1);
	_v = _v*sqrt(3.0)/6.0;

	P u = p1 + _p/2.0 + _v;

	draw(p1,s ,depth-1);
	draw(s ,u ,depth-1);
	draw(u ,t ,depth-1);
	draw(t ,p2,depth-1);
}

int main() {
	int n;
	cin >> n;
	draw(P(0,0),P(100,0),n);
	prt(P(100,0));
	return 0;
}



Measured memory_bytes: 3208
#include <cstdio>
#include <iostream>
#include <algorithm>
#define fi first
#define se second

using namespace std;

const int N=500010;

typedef pair<int,int> par;

int n,m,add[N<<2],mx[N<<2];
par p[N];

inline char nc(){
  static char buf[100000],*p1=buf,*p2=buf;
  return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}

inline void rea(int &x){
  char c=nc(); x=0;
  for(;c>'9'||c<'0';c=nc());for(;c>='0'&&c<='9';x=x*10+c-'0',c=nc());
}


inline void mark(int g,int x){
  add[g]+=x; mx[g]+=x;
}

inline void Push(int g){
  if(add[g]==0) return ;
  mark(g<<1,add[g]); mark(g<<1|1,add[g]); add[g]=0;
}

inline void Up(int g){
  mx[g]=max(mx[g<<1],mx[g<<1|1]);
}

void Build(int g,int l,int r){
  if(l==r) return void(mx[g]=-m+r-1);
  Build(g<<1,l,l+r>>1); Build(g<<1|1,(l+r>>1)+1,r);
  Up(g);
}

void Add(int g,int l,int r,int L,int R,int x=1){
  if(l==L&&r==R) return mark(g,x);
  int mid=L+R>>1; Push(g);
  if(r<=mid) Add(g<<1,l,r,L,mid,x);
  else if(l>mid) Add(g<<1|1,l,r,mid+1,R,x);
  else Add(g<<1,l,mid,L,mid,x),Add(g<<1|1,mid+1,r,mid+1,R,x);
  Up(g);
}

int Query(int g,int l,int r,int L,int R){
  if(l==L&&r==R) return mx[g];
  int mid=L+R>>1; Push(g);
  if(r<=mid) return Query(g<<1,l,r,L,mid);
  if(l>mid) return Query(g<<1|1,l,r,mid+1,R);
  return max(Query(g<<1,l,mid,L,mid),Query(g<<1|1,mid+1,r,mid+1,R));
}

int main(){
  rea(n); rea(m); Build(1,1,m+1);
  for(int i=1;i<=n;i++){
    rea(p[i].fi),rea(p[i].se);   
  }
  sort(p+1,p+1+n); int q=1,ans=0;
  for(int i=0;i<=m;i++){
    while(q<=n&&p[q].fi<=i){
      Add(1,1,p[q].se,1,m+1,1);
      q++;
    }
    ans=max(ans,Query(1,i+1,m+1,1,m+1)-i);
  }
  printf("%d\n",max(ans,n-m));
  return 0;
}


Measured memory_bytes: 10112