akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

int main(){
  string S;
  cin >> S;
  stack<char> A;
  for(int i=0; i<S.size(); i++){
    if(A.empty()) A.push(S[i]);
    else if(S[i]=='S') A.push('S');
    else if(S[i]=='T'){
      if(A.top()=='T' || A.empty()){
        A.push('T');
      }
      else if(A.top()=='S'){
        A.pop();
      }
    }
  }
  cout << A.size() << endl;
  return 0;
}

Measured memory_bytes: 644
#include <iostream>

using namespace std;

int gcd(int a, int b)
{
  if (a%b == 0)
    {
      return(b);
    }
  else
    {
      return(gcd(b, a%b));
    }
}

int main(){
  int a,b;
  cin >> a >> b;
  cout << gcd(a,b) << endl;
  return 0;
}


Measured memory_bytes: 3100
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front

typedef long long ll;

using namespace std;

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

ll gcd(ll x,ll y){
    while(y > 0){
        ll tmp = y;
        y = x % y;
        x = tmp;
    }
    return x;
}

ll lcm(ll x, ll y){
    if(x > 2000000000 || y > 2000000000){
        return 2001001001;
    }
    else return x / gcd(x,y) * y;
}

int main(){
    ll N,M;
    cin>>N>>M;
    vector<ll> a(N);
    rep(i,0,N)cin>>a[i];

    ll t =a[0], n_2=0;
    while(double(t)/2 == t/2){
        n_2++;
        t /= 2;
    }

    ll lcm_2=1;
    rep(i,0,n_2){
        lcm_2 *=2; 
    }

    bool ok =true;

    rep(i,1,N){
        double c = a[i];
        if(!(c / double(lcm_2) == a[i] / lcm_2 && c / double(lcm_2*2) != (a[i] / (lcm_2*2)))){
            ok = false;
        }
    }
    ll lcm_ans=a[0]/2;
    if(ok){
        rep(i,0,N){
            a[i] /= 2;
        }
        rep(i,1,N){
            lcm_ans = lcm(lcm_ans,a[i]);
        }
        if(M/lcm_ans == 0) cout<<0;
        else cout<<(M/lcm_ans-1)/2+1;
    }
    else cout<<0;
    return 0;
}

Measured memory_bytes: 1024
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string S;
	cin >> S;
	int cnt = 0;
	bool ok = true;
	rep(i, 0, SZ(S) - 2)
	{
		if (S[i] != S[i + 2])
		{
			ok = false;
		}
	}

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

	cnt = SZ(S) - 2;

	if (S.front() == S.back())
	{
		cnt--;
	}

	if (cnt % 2 == 0)
	{
		cout << "Second" << endl;
	}
	else
	{
		cout << "First" << endl;
	}

	return 0;
}

Measured memory_bytes: 512
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if(Character.isUpperCase(s.charAt(0))){
			System.out.println("A");
		}else if(Character.isLowerCase(s.charAt(0))){
			System.out.println("a");
		}
	}
}


Measured memory_bytes: 35744
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
  int A, B, C;
  string ans;
  cin >> A >> B >> C;
  if((C<A&&C<B)||(C>A&&C>B))ans="No";
  else ans="Yes";
  cout << ans << endl;
}

Measured memory_bytes: 256
N, K = (int(x) for x in input().split())
list = list(int(x) for x in input().split())
now = 1
check = [0]*N
begin = 1
begin_len = 0
for i in range(N):
    check[now-1] = i
    now = list[now-1]
    # ループ検証
    if check[now-1] != 0:
        begin = now
        begin_len = check[now-1]
        loop = (i+1) - check[now-1]
        break
# print(begin)
# print(begin_len)
# print(loop)
if K <= (begin_len+loop):
    now = 1
    for i in range(K):
        now = list[now-1]
else:
    now = begin
    Ka = (K-begin_len) % loop
    for i in range(Ka):
        now = list[now-1]
print(now)


Measured memory_bytes: 91600
#include <cmath>
#include <iostream>

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

int main() {
  int n;
  std::cin >> n;
  int a[n - 1];
  rep(i, n - 1) std::cin >> a[i];

  int b[n];
  rep(i, n) b[i] = 0;

  rep(i, n - 1) { b[a[i] - 1]++; }

  rep(i, n) { std::cout << b[i] << '\n'; }
  return 0;
}


Measured memory_bytes: 5132
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define FORD(i,j,k) for(i=j;i>=k;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 1000000000
#define ninf -1000000000
#define endl '\n' 
#define she_told_me_dont_worry ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// Use cout.flush() for interactive problems.
// Use this for increased stack size: g++ -o a.exe -Wl,--stack=256000000 -O2 source.cpp
inline long long  MAX2(long long  a, long long int b){return (a)>(b)?(a):(b);}
inline long long  MAX3(long long  a, long long  b,long long  c){return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long  MIN2(long long  a, long long  b){return (a)<(b)?(a):(b);}
inline long long  MIN3(long long  a, long long b,long long c){return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c));}
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;
int main()
{
    she_told_me_dont_worry
    ll n, k;
    cin>>n>>k;
    n = n%k;
    cout<<MIN2(n, k-n)<<endl;
    cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define int long long
#define mp make_pair
#define inf 1000000007
#define LINF 10000000000000007LL
#define ll long long
using namespace std;
int dis[51][51];
signed main(){
	int n;
	cin>>n;
	vector<int> a,b;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		a.pb(x);
	}
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		b.pb(x);
	}
	vector<int> must;
	for(int p=50;p>=0;p--){
		for(int i=0;i<=50;i++){
			for(int j=0;j<=50;j++){
				if(i==j)dis[i][j]=0;
				else dis[i][j] = inf;
			}
		}
		for(int i=1;i<=p;i++){
			for(int j=0;j<=50;j++){
				dis[j][j%i] = min(dis[j][j%i], 1LL);
			}
		}
		for(int i=0;i<must.size();i++){
			for(int j=0;j<=50;j++){
				dis[j][ j%must[i] ] = min(dis[j][j%must[i]],1LL);
			}
		}
		for(int k=0;k<=50;k++){
			for(int i=0;i<=50;i++){
				for(int j=0;j<=50;j++){
					if(dis[i][j] > dis[i][k]+dis[k][j]){
						dis[i][j] = dis[i][k]+dis[k][j];
					}
				}
			}
		}
		for(int i=0;i<n;i++){
			if( dis[ a[i] ][ b[i] ] == inf){
				if(p==50){
					cout<<-1<<endl;
					return 0;
				}
				else{
					must.pb(p+1);
					break;
				}
			}
		}
	}
	ll ans = 0;
	for(int i=0;i<must.size();i++){
		ans += (ll)1<<must[i];
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
using namespace std;

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    if(max(a,max(b,c))*2 == a+b+c) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int i;
  int n;
  int a,b;
  int A,B;

  while(scanf("%d", &n), n!=0){
    A=0; B=0;
    for(i=0; i<n; i++){
      scanf("%d %d", &a,&b);
      if(a>b)
	A+=a+b;
      else if(a==b)
	A+=a, B+=b;
      else
	B+=a+b;
    }
    printf("%d %d\n", A, B);
  }

  return 0;
}

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

int main()
{
    int n, t, smallest = 1e9, ci, ti;
    cin>>n>>t;
    for(int i=0;i<n;i++)
    {
        cin>>ci>>ti;
        if(ti <= t && ci < smallest)
            smallest = ci;
    }
    if(smallest == 1e9)
        cout<<"TLE";
    else
        cout<<smallest;
    return 0;
}


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

// Shortening code
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;

// Macros
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define REP(i, a, b) for (int i = a; i < b; i++)
#define RREP(i, a, b) for (int i = a; i >= b; i--)

ll INF = 1e9 + 5;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    // Your code
    int n, k;
    cin >> n >> k;
    vi a(n);
    REP(i, 0, n)
    {
        cin >> a[i];
    }

    vi dp(n, INF);
    dp[0] = 0;

    REP(i, 0, n)
    {
        REP(j, 1, k + 1){
            if(i + j < n){
                dp[i + j] = min(dp[i + j], dp[i] + abs(a[i + j] - a[i]));
            }
        }
    }
    cout << dp[n - 1];

    return 0;
}

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

int main() {

	int n; scanf("%d", &n);
	vector<int> order(n + 1);
	for (int i = 1; i <= n; i++) {
		int a;
		scanf("%d", &a);
		order[a] = i;
	}	

	for (int i = 1; i <= n; i++) 
		cout << order[i] << " ";

	return 0;
}

Measured memory_bytes: 1152
[<EntryPoint>]
let main argv =
    //printfn "Make it!" 
    let nab = System.Console.ReadLine().Split() |> Array.map int
    let n, a, b = nab.[0], nab.[1], nab.[2]
    let ans = if n*a < b then n*a else b
    printfn "%d" ans
    0

Measured memory_bytes: 13916
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let n = nextInt()
    let a = []
    while(hasNext()){
        a.push(nextInt())
    }
    let b = [...a].sort((a,b) => b-a)
    for(let i = 0; i<a.length; i++){
        if(b[0] == a[i]){
            if(b[0]==b[1]){
                console.log(b[0])
            }else{
                console.log(b[1])
            }
        }else{
            console.log(b[0])
        }
    }
}
Main()



Measured memory_bytes: 63508
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <numeric>
#include <climits>
#include <math.h>
#include <memory.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, k, n) for(int i = (k); i < (int)(n); i++)
using namespace std;
using ll = long long;
int N, M;
int cnt = 0;
ll ans = 0LL;
int i_index;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};
string board[64];

int main(){
    char s[11000];
    cin >> s;
    int l = strlen(s);
    for(int i = l - 2; i > 0; i-=2){
        if(strncmp(s, s + i/2, i / 2) == 0){
            cout << i << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
const long long mod=1e9+7;
long long pre[200005];
/*快速幂*/
long long qmul(long long a,long long b)
{
	long long res=1;
	while(b)
	{
		if(b&1) res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res%mod;
}
/*组合数板子*/
long long C(int a,int b)
{
    long long res=1;
    for(long long i=1,j=a;i<=b;i++,j--)
    {
        res=res*j%mod;
        res=res*qmul(i,mod-2)%mod;
    }
    return res;
}
int main()
{
	long long n,a,b,ans;
	pre[0]=1;
    for(int i=1;i<=200005;i++)pre[i]=pre[i-1]*i%mod;
	scanf("%lld%lld%lld",&n,&a,&b);
	ans=(qmul(2,n)-1)-C(n,a)-C(n,b);
	while(ans<0)ans+=mod;
	printf("%lld\n",ans);
}
/*卢卡斯定理*/
/*long long lucas(long long a,long long b)
{
    if(a<mod&&b<mod)return C(a,b);
    return C(a%mod,b%mod)*lucas(a/mod,b/mod)%mod;
}*/

Measured memory_bytes: 1664
#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;

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

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

    cout << max(
            *max_element(x.begin(), x.end()) - *min_element(x.begin(), x.end()),
            *max_element(y.begin(), y.end()) - *min_element(y.begin(), y.end())
            ) << endl;
    return 0;
}

Measured memory_bytes: 4824
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            DecimalFormat df = new DecimalFormat("0.000");
            df.setRoundingMode(RoundingMode.HALF_UP);
            Double x1,x2,x3,y1,y2,y3;
            String line = br.readLine();
            int n = Integer.parseInt(line);
            for(int i=0;i<n;i++) {
                line = br.readLine();
                StringTokenizer st = new StringTokenizer(line);
                x1 = Double.parseDouble(st.nextToken());
                y1 = Double.parseDouble(st.nextToken());
                x2 = Double.parseDouble(st.nextToken());
                y2 = Double.parseDouble(st.nextToken());
                x3 = Double.parseDouble(st.nextToken());
                y3 = Double.parseDouble(st.nextToken());
                Triangle tri = new Triangle(new Point(x1,y1),new Point(x2,y2),new Point(x3,y3));
                System.out.println(df.format(tri.getP().x) + " " + df.format(tri.getP().y) + " " + df.format(tri.getR()));
            }
        } catch (Exception e) {
            System.err.println();
        }
    }
}

class Point{
    double x;
    double y;
    Point(double x, double y){
        this.x = x;
        this.y = y;
    }
}

class Line{
    Point A;
    Point B;
    double length;
    Line(Point A, Point B){
        this.A = A;
        this.B = B;
        this.length = getLength();
    }
    private double getLength(){
        return Math.sqrt((A.x-B.x)*(A.x-B.x) + (A.y-B.y)*(A.y-B.y));
    }
}

class Triangle{
    Point A;
    Point B;
    Point C;
    double a,b,c;
    Triangle(Point A, Point B, Point C){
        this.A = A;
        this.B = B;
        this.C = C;
        this.a = (new Line(B,C)).length;
        this.b = (new Line(A,C)).length;
        this.c = (new Line(A,B)).length;
    }
    double getCosA(){
        double cosA;
        cosA = (b*b + c*c -a*a)
                /(2*b*c);
        return cosA;
    }
    double getSinA(){
        double sinA,cosA = getCosA();
        sinA = Math.sqrt(1-(cosA*cosA));
        return sinA;
    }
    double getR(){
        double R,sinA = getSinA();
        R = a/(2*sinA);
        return R;
    }
    Point getP(){
        double elementA,elementB,elementC,elementD,elementP,elementQ,detA,px,py;
        elementA = 2*(B.x-A.x);
        elementB = 2*(B.y-A.y);
        elementC = 2*(C.x-B.x);
        elementD = 2*(C.y-B.y);
        elementP = B.x*B.x - A.x*A.x + B.y*B.y - A.y*A.y;
        elementQ = C.x*C.x - B.x*B.x + C.y*C.y - B.y*B.y;
        detA = elementA*elementD - elementB*elementC;
        px=(elementD*elementP-elementB*elementQ)/detA;
        py=(-elementC*elementP+elementA*elementQ)/detA;
        return new Point(px,py);
    }
}

Measured memory_bytes: 25812
#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
using ll = long long;
using ull = unsigned long long;
using vll = vector<long long>;
using pll = pair<ll, ll>;
#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)
#define VREP(s, ite) for (auto ite = s.begin(); ite != s.end(); ++ite)
#define FI first
#define SE second
#define ALL(v) v.begin(), v.end()
//#define endl "\n"
#define ciosup \
  cin.tie(0);  \
  ios::sync_with_stdio(false);
#define eb emplace_back
#define vint vector<int>
constexpr ll INF = 1e15 + 7LL;
constexpr ll MOD = 1e9 + 7LL;

template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (int i = 0; i < v.size(); ++i) {
    is >> v[i];
  }
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (int i = 0; i < v.size() - 1; ++i) {
    os << v[i] << " ";
  }
  if (v.size() > 0) {
    os << v[v.size() - 1] << endl;
  }
  return os;
}

int main() {
  int n;
  cin >> n;
  vector<vector<char>> G(n, vector<char>(n));
  REP(i,n){
    REP(j, n) { cin >> G[i][j]; }
  }
  int ans = -1;
  REP(i, n) {
    vint dist(n, -1);
    queue<int> que;
    que.push(i);
    dist[i] = 1;
    int maxv = 1;
    while (que.size()) {
      int now = que.front();que.pop();
      REP(j,n){
        if (G[now][j] == '1'){
          if (dist[j] == -1){
            dist[j] = dist[now] + 1;
            maxv = max(maxv, dist[j]);
            que.push(j);
          }
        }
      }
    }
    bool flag = false;
    REP(i, n) {
      FOR(j, i + 1, n){
        if (G[i][j] == '1' && dist[i] == dist[j]){
          flag = true;
        }
      }
    }
    if (!flag) ans = max(ans, maxv);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#define rep(i, n) for (int i = 0; i < (n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
// MAX int 2,147,483,647
// MAX O(n) 10^18

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

    int numOfdivisor = 0;
    for (int i = 1; i <= N; i = i + 2) {
        int count = 0;
        for (int j = 1; j * j <= i; j++) {
            if (i % j == 0) {
                count++;
                if (j * j != i) count++;
            }
        }
        if (count == 8) numOfdivisor++;
    }

    cout << numOfdivisor << endl;

    return 0;
}


Measured memory_bytes: 3620
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

string s,ans;
int k;
void dfs(string t){
  if(k==0) return;
  if(t.size()>0){
    bool ok = true;
    for(int i = 0; i+t.size()<=s.size(); ++i ){
      ok = true;
      rep(j,t.size()){
        if(s[i+j]!=t[j]){
          ok = false;
          break;
        }
      }
      if(ok){
        if(--k==0) ans = t;
        break;
      }
    }
    if(!ok) return;
  }
  if(t.size()<s.size()){
    for(char c = 'a'; c<='z'; ++c){
      string nt = t+c;
      dfs(nt);
    }
  }
}
int main() {
  cin >> s >> k;
  string t = "";
  dfs(t);
  cout << ans << endl;
}


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

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

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

    if(S[2] == S[3] && S[4]==S[5]){
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;

    return 0;
}



Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
  int n, i, x=0, y=0;
  char s[101];

  scanf("%d", &n);

  for(i=0;i<n;i++)
  {
    scanf("%s", &s[i]);
    if(s[i] == 'I')
      x++;
    else if(s[i] == 'D')
      x--;

    if(y < x)
      y = x;
  }
  printf("%d\n", y);
  return 0;
}

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

int cnt[1000], need[1000], p[100];
int main() {
	int n, r, t; scanf("%d%d%d", &n, &r, &t);
	rep(i, n)scanf("%d", &p[i]);
	for (int i = 1; i <= t; i++) {
		rep(j, n) {
			int po = (p[j]*i) % r;
			if (!cnt[po])need[po]++;
			else cnt[po]--;
		}
		if (i == 1)continue;
		rep(j, n) {
			int po = (p[j] * i) % r;
			cnt[po]++;
		}
	}
	printf("%d\n", accumulate(need, need + 1000, 0));
}

Measured memory_bytes: 3224
#include <iostream>

using namespace std;

int main() {
  int a,b, c,d,e;
  int na,nb,nc;
  int ret;

  cin >> a >> b >> c >> d >> e;
  while (a!=0 || b!=0 || c!=0 || d!=0 || e!=0){
    ret=0;
    cin >> na >> nb >> nc;
    if (nc >= d){
      //cout << "a";
      ret = nc * e;
      nc =0;
      //cout << "A"<< endl;
    }else if (d-nc<=nb){
      //cout << "b";
     if (nc*c+(d-nc)*b>d*e){
 	ret = d*e;
	nb-=d-nc;
	nc=0;
	//cout << "B"<< endl;
     }
    }else if(d-nc-nb<=na){
      if (nc*c+nb*b+(d-nc-nb)*a>d*e){
      //cout << "c";
      ret =d*e;
      na-=d-nc-nb;
      nc=0;
      nb=0;
      //cout << "C"<< endl;
    }
    }else if(na*a+nb*b+nc*c>d*e){
      //cout << "d";
      ret =d*e;
      nc=0;
      nb=0;
      na=0;
      //cout << "D"<< endl;
    }
    //cout << na << nb << nc;
    ret += na*a+nb*b+nc*c;
    cout << ret << endl;

    cin >> a >> b >> c >> d >> e;
  }

  return 0;
}

Measured memory_bytes: 1160
n, m = map(int, input().split())
AB = [[int(i) for i in input().split()] for i in range(n)]
CD = [[int(i) for i in input().split()] for i in range(m)]

for a, b in AB:
    dist = 10 ** 12
    for i, cd in enumerate(CD):
        tmp = abs(a - cd[0]) + abs(b - cd[1])
        if tmp < dist:
            dist = tmp
            ans = i + 1
    print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main() {
	int n, k; cin >> n >> k;
	int ans = 1;
	for(int i=0;i<n;i++){
		if(ans*2<ans+k){
			ans = ans*2;
		}else{
			ans = ans + k;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        String s = scan.next();
        int c = 0;
        int f = 1;
        for(int i = 0; i < n; i++){
            if(a + b <= c || s.charAt(i) == 'c'){
                System.out.println("No");
            }else if(s.charAt(i) == 'a'){
                System.out.println("Yes");
                c++;
            }else if(s.charAt(i) == 'b' && f <= b){
                System.out.println("Yes");
                c++;
                f++;
            }else{
                System.out.println("No");
            }
        }
        scan.close();
    }
}


Measured memory_bytes: 41264
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int ans = c - (a - b);
		if(ans < 0)
			ans = 0;
		System.out.println(ans);

	}

}


Measured memory_bytes: 24276
#include<bits/stdc++.h>
#include<vector>
#include<cmath>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
void chmin(int &a,int b){if(a>b) a=b;} //Compare two numbers and return smaller one in reference variety a

int main()
{
    ll l;
    ll min_value=1000000000;
    ll max_value=0;
    int N;
    int i=0;
    cin>>N;
    while (cin >> l) {
        if(l>max_value) max_value=l;
        if(l<min_value) min_value=l;
        i++;
        if (i >= N) {
            break;
        }
    }
    cout<<abs(max_value-min_value)<<endl;
}

Measured memory_bytes: 256
import math

a, b, h, m = [int(x) for x in input().split()]
radH = (360 / 12 * h + 30 / 60 * m) / 180 * math.pi
radM = (360 / 60 * m) / 180 * math.pi
ax, ay = math.cos(radH) * a, math.sin(radH) * a
bx, by = math.cos(radM) * b, math.sin(radM) * b
ans = ((ax - bx) ** 2 + (ay - by) ** 2) ** 0.5
print(ans)


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

const int INF = 2147483647;

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

int rec(int i, int K, int h[], int cost[]){

    if(cost[i] < INF){return cost[i];}
    if(i == 0){return 0;}

    int res = INF;
    
    for(int j = 1; j <= K; j++){
        if(i-j<0){continue;}
        chmin(res, rec(i-j,K,h,cost) + abs(h[i]-h[i-j]));
    }

    return cost[i] = res;
}

int main(){

    int N, K; cin >> N >> K;
    int h[N];for(int i = 0; i < N; i++){cin >> h[i];}
    int cost[N];fill(cost, cost+N, INF);

    cout << rec(N-1, K, h, cost) << endl;
}

Measured memory_bytes: 12288
// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <vector>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int h, w, k;
    int ans = 0;
    cin >> h >> w >> k;
    vector<string> s(h);
    // 表入力
    rep(i, h) cin >> s[i];
    rep(is, 1 << h) rep(js, 1 << w){
        int pat = 0;
        rep(i, h)rep(j, w) {
            if ((is >> i) & 1) {
                if ((js >> j) & 1) {
                    if (s[i][j] == '#') {
                        pat++;
                    }
                }
            }  
        }
        if (pat == k) {
            ans++;
        }
        
    }

    // cout << "hello" << endl;
    cout << ans << endl;
    return 0;
}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define bit(k) (1LL<<(k))
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {os << "{" <<p.first << ", " << p.second << "}";return os;}
struct fast_ios{ fast_ios(){cin.tie(0);ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; }fast_ios_;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

// #ifdef DEBUG
#define dump(x) cerr<<#x<<": "<<x<<endl;
// #else
// #define dump(x)
// #endif

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const long double PI = acos(-1.0);

/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

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

    string S, T;
    cin >> S >> T;
    int N = S.size();
    int M = T.size();
    ll ans = INFLL;
    for(int i = 0; i < N; i++){
        // if(i + M > N)continue;
        string tmp = S.substr(i, M);
        if(tmp.size() < M)continue;
        dump(tmp);
        ll cnt = 0;
        rep(j,M)cnt += T[j] != tmp[j];
        chmin(ans, cnt);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3708
#include <bits/stdc++.h>
using namespace std;
 
int main() {
string S;
  cin >> S;
  if(S == "SUN")cout<<7<<endl;
  if(S == "MON")cout<<6<<endl;
  if(S == "TUE")cout<<5<<endl;
  if(S == "WED")cout<<4<<endl;
  if(S == "THU")cout<<3<<endl;
  if(S == "FRI")cout<<2<<endl;
  if(S == "SAT")cout<<1<<endl;
 
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include <iomanip>
using namespace std;
 
#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
  string S;
  cin>>S;
  int N=S.size();
  int K=-1;
      int x=1;
  for(int i=0;i<N-1;i++){
    if(S[i]=='C'){
      K=i;
      break;
    }
  }
    if(K==-1) cout<<"No";
    else{
      for(int i=K+1;i<N;i++){
        if(S[i]=='F'){
          cout<<"Yes";
          x*=0;
          break;
        }
      }
      if(x==1) cout<<"No";
    }
return 0;}


Measured memory_bytes: 3496
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s1,s2;
	cin>>s1>>s2;
	int l=s1.size()+s2.size();
	for(int i=0;i<l;++i)if(i%2==0)cout<<s1[i/2];else cout<<s2[i/2];
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
    #include <filesystem>
    namespace fs = std::filesystem;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
static mt19937 _g(time(nullptr));
 
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N;
vector<ll> T,A;
void input(){
    fast_io();
    #ifdef __LOCAL
        fs::path __p = __FILE__;
        fs::path __input, __output;
        __input = __output = __p.parent_path();
        __input += string("/input/") + string(__p.stem()) + string(".txt");
        __output += string("/output/") + string(__p.stem()) + string(".txt");
        freopen(__input.c_str(), "r", stdin);
        freopen(__output.c_str(), "w", stdout);
    #endif
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        ll t,a; cin >> t >> a;
        T.push_back(t);
        A.push_back(a);
    }
    
}

int solve(){
    ll t=T[0], a=A[0];
    for (int i = 1; i < N; i++)
    {
        if(T[i]>=t && A[i]>=a){t=T[i],a=A[i];}
        else{
            ll lt = (t+T[i]-1)/T[i];
            ll la = (a+A[i]-1)/A[i];
            ll l=max(lt,la);
            t = l*T[i];
            a = l*A[i];
        }
    }
    cout << (t+a) << endl;
    
    return 0;
}   

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


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

namespace ConsoleApplication20
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            if (a[0] + a[1] == a[2] || a[0] + a[2] == a[1] || a[1] + a[2] == a[0])
                Console.WriteLine("Yes");
            else Console.WriteLine("No");
        }
    }
}


Measured memory_bytes: 2776
#include <iostream>
#include <vector>
#define N 3
void BSort(int* a);
void xswap(int*a, int x, int y);


int main(){
    int a[3];
    for(int i=0; i<N; ++i) std::cin>> a[i];
    BSort(a);
    for(int i=0; i<N-1; ++i) std::cout << a[i] <<" ";
    std::cout << a[N-1] <<"\n";
}
void xswap(int*a, int x, int y){
    int temp = a[x];
    a[x] = a[y];
    a[y] = temp;
}
void BSort(int* a){
    for(int i=0; i<N; ++i){
        for(int j=1; j<N-i; ++j){
            if(a[j]<a[j-1]) xswap(a, j, j-1);
        }
    }
}

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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) RFOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1 << 22;

template<typename T>
void printv(vector<T> const& s) {
  REP(i, SZ(s)) {
    cout << s[i] << " ";
  }
  cout << endl;
}

int main () {
  cin.tie(0);
  cout << setprecision(10);

  int n; cin >> n;
  vll a(n), b(n);
  REP(i, n) cin >> a[i] >> b[i];

  ll cnt = 0;

  RREP(i, n-1) {
    // if((a[i] + cnt - b[i]) <= 0) {
    //   cnt += b[i] - (a[i] + cnt);
    // } else {
    //   cnt += (b[i] - (a[i] + cnt) % b[i]) % b[i];
    // }
    cnt += (b[i] - (a[i] + cnt + b[i]) % b[i]) % b[i];
  }

  cout << cnt << endl;
}


Measured memory_bytes: 1792
#include <stdio.h>

int main()
{
    int n,m,i,k,j;
    int sum[100] = {0};
    
    scanf("%d %d", &n,&m);
    
    int a[n][m];
    int xb[m];
    
    //??????A
    for(i=0; i<n; i++)
    {
        for(k=0; k<m; k++)
        {
            scanf("%d ", &a[i][k]);
        }
    }
    
    //??????b
    for(i=0; i<m; i++)
    {
        scanf("%d", &xb[i]);
    }
    
    for(i=0; i<n; i++)
    {
        for(j=0; j<m; j++)
        {
            sum[i] += a[i][j] * xb[j];
        }
        printf("%d\n", sum[i]);
    }
    
    return 0;
}

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

using namespace std;

using ll = long long;
const int mod = 1000000007;
int N;
ll K;

const int di = 50;

struct Matrix {
	ll mat[di][di];
};

Matrix matMult(Matrix a, Matrix b) {
	Matrix ans;
	for (int i = 0; i < di; i++) {
		for (int j = 0; j < di; j++) {
			ans.mat[i][j] = 0LL;
			for (int k = 0; k < di; k++) {
				ans.mat[i][j] = (ans.mat[i][j] + 
					a.mat[i][k]*b.mat[k][j])%mod;
			}
		}
	}
	return ans;
}

Matrix matPow(Matrix base, ll p) {
	Matrix ans;
	for (int i = 0; i < di; i++) {
		for (int j = 0; j < di; j++) {
			if (i == j) ans.mat[i][j] = 1LL;
			else ans.mat[i][j] = 0LL;
		}
	}
	while (p) {
		if (p & 1) {
			ans = matMult(ans, base);
		}
		base = matMult(base, base);
		p = p/2;
	}
	return ans;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> N >> K;
	Matrix val;
	for (int i = 0; i < di; i++) {
		for (int j = 0; j < di; j++) {
			val.mat[i][j] = 0;
		}
	}
	int cv;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			cin >> cv;
			val.mat[i][j] = cv;
		}
	}

	Matrix cur = matPow(val, K);
	ll ans = 0LL;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			ans = (ans + cur.mat[i][j])%mod;
		}
	}
	cout << ans << endl;
}

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

class Item{
public:
	string name;
	int cost;
	vector< Item* > recipe;
	
	Item(string _name, int _cost){
		name = _name;
		cost = _cost;
	}
	Item(){ name = ""; cost = 0; }
};

int Run(Item &item){
	int cost = 0;
	
	for(vector< Item* >::iterator it = item.recipe.begin(); it != item.recipe.end(); ++it){
		cost += Run( (**it) );
	}
	
	if(!item.recipe.empty()){
		return min(item.cost, cost);
	}
	return item.cost;
}

int main(){
	int n, m, p, k;
	string i, o, q, item;
	map< string, Item > mp;
	
	while(cin >> n, n){
		mp.clear();
		for(int j = 0; j < n; ++j){
			cin >> i >> p;
			mp.insert(make_pair< string, Item >(i, Item(i, p)));
		}
		cin >> m;
		
		for(int i = 0; i < m; ++i){
			cin >> o >> k;
			for(int j = 0; j < k; ++j){
				cin >> q;
				mp[o].recipe.push_back(&mp[q]);
			}
		}
		cin >> item;
		
		cout << Run(mp[item]) << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1248
#include <cstdio>

using namespace std;

int c[500][500];

int main() {
    int k, n, i, j;
    
    scanf("%d", &k);
    
    if (k <= 500) {
        n = k;
        
        for (i = 0; i < n; i++) {
            for (j = 0; j < n; j++) {
                c[i][j] = (i + j) % n + 1;
            }
        }
    } else {
        n = 500;
        
        for (i = 0; i < n; i++) {
            for (j = 0; j < n; j++) {
                if (i % 2 == 0) {
                    c[i][j] = (i + j) % n + 1;
                } else {
                    c[i][j] = (i + j) % n + n + 1;
                    if (c[i][j] > k) c[i][j] -= n;
                }
            }
        }
    }
    
    printf("%d\n", n);
    
    for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
            if (j > 0) putchar(' ');
            printf("%d", c[i][j]);
        }
        puts("");
    }
    
    return 0;
}


Measured memory_bytes: 2048
#include <iostream>
#include<vector>
using namespace std;
 
int main()
{
    int num,d,flag=0;
    cin>>num;
    while(num>0)
    {
        d=num%10;
        if(d==7)
        {
            flag=1;
            break;
        }
        num=num/10;
    }
    if(flag)
        cout<<"Yes";
    else
        cout<<"No";
}

Measured memory_bytes: 3584
#include <stdio.h>
#include <map>
#include <set>
using namespace std;
map<int,set<int> >stak;
int nxt,RB[105][105],edge[105],deep[105];
void dfs(int here) {
	while (edge[here]>0) {
		int cur,i,j;scanf("%d",&cur);
		if (cur>0) {
			RB[here][nxt]++,RB[nxt][here]++,deep[nxt]=deep[here]+1,edge[here]--,edge[nxt]=cur-1;
			stak[deep[nxt]].insert(nxt);
			if (!edge[here]) stak[deep[here]].erase(here);
			if (!edge[nxt]) stak[deep[nxt]].erase(nxt);
			dfs(nxt++);
		} else {
			j=deep[here]+cur;i=*stak[j].begin();
			RB[here][i]++,RB[i][here]++,edge[i]--,edge[here]--;
			if (!edge[here]) stak[deep[here]].erase(here);
			if (!edge[i]) stak[deep[i]].erase(i);
		}
	}
}
int main() {
	int N,i,j;scanf("%d",&N);while (N--) {
		for (i=0;i<105;edge[i]=deep[i]=0,i++) for (j=0;j<105;RB[i][j++]=0);
		stak.clear();stak[0].insert(1);scanf("%d",&edge[1]);
		nxt=2;dfs(1);scanf("%*d");for (i=1;i<nxt;i++) {
			printf("%d",i);for (j=1;j<nxt;j++) while (RB[i][j]--) printf(" %d",j);puts("");}
	}
	return 0;
}

Measured memory_bytes: 1176
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <unistd.h>
#include <map>
#include <cmath>

#define pii pair<int,int>
#define REP(i, n) for (long long i = 0; i < (n); i++) 
using namespace std;


typedef long long ll;
static const ll INF = 1000000000000000000LL;
static const ll MOD = 1000000007;


int main()
{
    double a,b;
    cin >> a >> b;
    int res = -1;

    for(int i = 1; i <= 20000; ++i)
    {
        double a8,a10;
        a8 = i * (0.08);
        a10 = i * (0.10);

        if(floor(a) == floor(a8) && floor(b) == floor(a10))
        {
            res = i;
            break;
        }
    }


    cout << res << endl;

    return 0;
}

Measured memory_bytes: 256
n, m, x = map(int, input().split())
masu = list(map(int, input().split()))
max1 = 0
max2 = 0
for i in masu:
    if(i < x):
        max1 += 1
for i in masu:
    if(i > x):
        max2 += 1
if max1 >= max2:
    print(max2)
else:
    print(max1)


Measured memory_bytes: 3060
t=int(input())
dic={"AC":0,"WA":0,"TLE":0,"RE":0}
while(t>0):
    s=input()
    if(s=="AC"):
        dic["AC"]+=1
    elif(s=="WA"):
        dic["WA"]+=1
    elif(s=="TLE"):
        dic["TLE"]+=1
    elif(s=="RE"):
        dic["RE"]+=1
    t-=1
print("AC x "+str(dic["AC"]))
print("WA x "+str(dic["WA"]))
print("TLE x "+str(dic["TLE"]))
print("RE x "+str(dic["RE"]))




Measured memory_bytes: 70056
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace Aoj.ALDS.Chapter5C
{
    class Point
    {
        public double X {get; set;}
        public double Y {get; set;}

        public Point()
        {
            X = 0.0;
            Y = 0.0;
        }

        public Point(double x, double y)
        {
            X = x;
            Y = y;
        }
    }

    class Program
    {
        public static void Koch(int depth, Point a, Point b, Action<Point> printFunc)
        {
            if (depth <= 0)
                return;

            double rad = Math.PI * 60.0 / 180.0;

            var s = new Point(
                (2.0 * a.X + 1.0 * b.X) / 3.0,
                (2.0 * a.Y + 1.0 * b.Y) / 3.0
            );
            var t = new Point(
                (1.0 * a.X + 2.0 * b.X) / 3.0,
                (1.0 * a.Y + 2.0 * b.Y) / 3.0
            );
            var u = new Point(
                (t.X - s.X) * Math.Cos(rad) - (t.Y - s.Y) * Math.Sin(rad) + s.X,
                (t.X - s.X) * Math.Sin(rad) + (t.Y - s.Y) * Math.Cos(rad) + s.Y
            );

            Koch(depth - 1, a, s, printFunc);
            printFunc(s);
            Koch(depth - 1, s, u, printFunc);
            printFunc(u);
            Koch(depth - 1, u, t, printFunc);
            printFunc(t);
            Koch(depth - 1, t, b, printFunc);
        }

        public static void Solve(int n)
        {
            var a = new Point(0.0, 0.0);
            var b = new Point(100.0, 0.0);

            Action<Point> printFunc = (Point p) => {
                Console.WriteLine("{0:0.00000000} {1:0.00000000}", p.X, p.Y);
            };

            printFunc(a);
            Koch(n, a, b, printFunc);
            printFunc(b);
        }

        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            Solve(n);
        }
    }
}

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

using namespace std;

const long long MOD = 1000000000 + 7;
const string abc = "abacaba";

void solve() {
    int r, g, b, k;
    cin >>r>> g>> b >> k;
    int cnt = 0, cnt2 = 0;
    while (g <= r) {
        g *= 2;
        cnt++;
    }
    while (b <= g) {
        b *= 2;
        cnt++;
    }
    if (cnt <= k) {
        cout << "Yes";
    } else {
        cout << "No";
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    // int t;
    // cin >> t;
    // for (int tt = 0; tt < t; tt++) {
        solve();
    // }
    return 0;
}

Measured memory_bytes: 3636
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <climits>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <complex>
#include <functional>
#include <utility>
#include <iterator>

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

#ifdef LOCAL
  #define dprintf(...) fprintf(stdout, __VA_ARGS__)
#else
  #define dprintf(...) 0
#endif

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;

//const double PI = 3.1415926535897932384626433832795;

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;

ll a[100], n, p, dp[50][2];

ll f(int k, int s)
{
    if (k == n)
        return s == p;
    if (dp[k][s] != -1)
        return dp[k][s];
    ll sol = 0;
    sol += f(k + 1, (s + a[k]) % 2);
    sol += f(k + 1, s);
    return dp[k][s] = sol;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> p;
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    memset(dp, -1, sizeof dp);
    cout << f(0, 0);
}


Measured memory_bytes: 256