akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
#include <map>
#include <queue>
#include <list>
#include <set>
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
using namespace std;
using ll = long long;
const int INF = 1e9 + 1;
ll MOD = 1e9+7;
ll dx[9] = {-1, -1, -1, 0, 0, 0, 1, 1, 1};
ll dy[9] = {-1,  0,  1,-1, 0, 1,-1, 0, 1};

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

    int N;
    cin >> N;
    map<string, bool> used;
    string W, prevW;
    cin >> prevW;
    used[prevW] = true;
    REP(i, N-1){
        cin >> W;
        if(W[0] != prevW[prevW.length()-1] || used[W] == true){
            cout << "No" << endl;
            return 0;
        }
        used[W] = true;
        prevW = W;
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>

using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 8080
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;

typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

long long int MOD = 1000000007;
int N;

int K;

void dijkstra(const Graph &g, int s,
				  vector<Weight> &dist, vector<int> &prev) {
	int n = g.size();
	dist.assign(n, INF); dist[s] = 0;
	prev.assign(n, -1);
	priority_queue<Edge> Q; // "e < f" <=> "e.weight > f.weight"
	Edge hoge={-2, s, 0};
	for (Q.push(hoge); !Q.empty(); ) {
		Edge e = Q.top(); Q.pop();
		if (prev[e.dst] != -1) continue;
		prev[e.dst] = e.src;
		FOR(f,g[e.dst]) {
						 if (dist[f->dst] > e.weight+f->weight) {
																 dist[f->dst] = e.weight+f->weight;
				Edge fuga={f->src, f->dst, e.weight+f->weight};
				Q.push(fuga);
			}
		}
	}
}
int main(){
	cin>>K;
	Graph G(K);
	for(int i=0;i<K;i++){
		Edge hen={i,(i+1)%K,1};
		G[i].pb(hen);
	}
	for(int i=0;i<K;i++){
		Edge hen={i,(i*10)%K,0};
		if(i!=(i*10)%K)G[i].pb(hen);
	}
	vector<Weight> dis;
	vi hoge;
	
	dijkstra(G,1,dis,hoge);
	cout<<dis[0]+1<<endl;
}

Measured memory_bytes: 9592
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var n = next(), k = next();
  var a = nexts(n);
  var ans = [];
  for(var i = k; i < n; i++){
    if(a[i-k] < a[i])ans.push("Yes");
    else ans.push("No");
  }
  return ans.join("\n");
}

Measured memory_bytes: 62552
#include<iostream>

using namespace std;

int main(){
  int n;
  int a[150];
  int i;

  cin >> n;
  
  for(i=0;i<n;i++)
    cin >> a[i];

  cout << a[n-1];
  for(i=n-2;i>=0;i--)
    cout << " " << a[i];
  cout << endl;
}

Measured memory_bytes: 3088
import sys
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N, M = inpl()
ac = [False] * (N+10)
wa = [0] * (N+10)

for _ in range(M):
    p, S = input().split()
    p = int(p)
    if S == 'WA':
        if not ac[p]:
            wa[p] += 1
    else:
        ac[p] = True

a = 0
w = 0
for i in range(N+10):
    if ac[i]:
        a += 1
        w += wa[i]

print(a, w)

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)


Measured memory_bytes: 10496
#include<bits/stdc++.h>
#include<set>
#include<queue>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
using namespace std;
typedef long long ll;

#define pb push_back
#define PI acos(-1.0)
#define MAX 10000007 //1e7+7
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define __FastIO  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
ll arr[100005],brr[100005];
int main(){
  ll N,M,A,B,C,D,i,testCase;
  string str;
  while(cin>>str){
    if(str=="Sunny"){
      cout<<"Cloudy"<<endl;
    }
    else if(str=="Cloudy"){
      cout<<"Rainy"<<endl;
    }
    else{
      cout<<"Sunny"<<endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
import sys
import numpy as np
import math
import random
from decimal import Decimal
import itertools
import re
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(2147483647)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def main():
	n = I()
	factos = factorization(n)
	count = 0
	for num, facto in factos:
		sum_tmp = 0
		for i in range(1,facto+1):
			sum_tmp += i
			if sum_tmp <= facto:
				count += 1
	if n == 1:
		print(0)
	else:
		print(count)


if __name__ == '__main__':
    main()

Measured memory_bytes: 27176
// In the name of God

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> p(n);
	vector<int> a(n), b(n);
	for(int i=0;i<n;i++) {
		p[i] =  i+1;
	}
	for(int i=0;i<n;i++) cin >> a[i];
	for(int i=0;i<n;i++) cin >> b[i];
	int c = 0;
	int x, y;
	do {
		if(a == p) x = c;
		if(b == p) y = c;
		c++;
	}while(next_permutation(p.begin(), p.end()));
	cout << abs(x-y);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
ll N;
  cin>>N;
  vector<ll> P(N);
  vector<ll> Q(N);
  for(ll i=0;i<N;i++) {
cin>>P[i];
  }
  for(ll i=0;i<N;i++) {
cin>>Q[i];
  }
  vector<ll> vec(N);
  for(ll i=0;i<N;i++) {
vec[i]=i+1;
  }
  
 ll count=0;
  ll a,b;
  
  do {
    count++;
    bool A=true;
    bool B=true;
    for(ll i=0;i<N;i++) {
      if(vec[i]!=P[i]) {
A=false;
      }
      if(vec[i]!=Q[i]) {
B=false;
      }
    }
    if(A) {
a=count;
    }
    if(B) {
b=count;
    }
    
  } while(next_permutation(all(vec)));
  
  
  cout<<abs(a-b)<<endl;
}
      
      

  
  
  
  
  
  
  

Measured memory_bytes: 3544
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
const int mod = 1000000007;
ll modpow(ll a, int b) { return b ? modpow(a * a % mod, b / 2) * (b % 2 ? a : 1) % mod : 1; }
template<class T> ostream& operator<<(ostream& os, const vector<T>& v) { rep(i, sz(v)) { if (i) os << " "; os << v[i]; } return os; }
template<class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> inline void add(T &a, int b) { a += b; if (a >= mod) a - mod; }

void solve();

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

    int T;
    // cin >> T;
    T = 1;

    while (T--) {
      solve();
    }
}


void solve() {
  string s, t;
  cin >> s >> t;
  cout << t << s << endl;
}


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

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

int main(){
	string S; cin >> S;	
	string T = "keyence";
	repp(i,0,8){
		bool b = 1;
		repp(j,0,i) if(S[j] != T[j]) b = 0;
		repp(j,0,7-i) if(S[S.size()-1-j] != T[6-j]) b = 0;
		if(b) return cout << "YES" << endl, 0;
	}
	cout << "NO" << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(void)
{
	string s;
	cin>>s;
	
	string ans="Yes";
	for(int i=0;i<s.length();i++)
	{
		if((i+1)%2==0 && s[i]=='R')
		ans="No";
		if((i+1)%2==1 && s[i]=='L')
		ans="No";
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(read())
ans = n
for i in range(n + 1):
    cnt = 0
    v = i
    while v > 0:
        v, y = divmod(v, 6)
        cnt += y
    j = n - i
    while j > 0:
        j, y = divmod(j, 9)
        cnt += y
    if ans > cnt:
        ans = cnt
print(ans)


Measured memory_bytes: 3064
#include <cstdio>

int n;

int main()
{
	scanf("%d",&n);
	int n1=n,a[3],c=0;
	while(n1)
	{
		a[2-c]=n1%10;
		n1/=10;
		++c;
	}
	if(a[0]==a[1] && a[0]==a[2]) printf("%d\n",a[0]*100+a[0]*10+a[0]);
	else
	{
		if(a[0]<a[1] || a[0]<a[2]) ++a[0];
		printf("%d\n",a[0]*100+a[0]*10+a[0]);
	}
	return 0;
}

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

#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define MIN(c) (*min_element(ALL(c))) 
#define MAX(c) (*max_element(ALL(c)))
#define ACC(c) (accumulate(ALL(c), 0))
#define MP(a, b) (make_pair((a), (b)))
#define ENDL "\n"
#define PRINT(x) cout << (x) << ENDL

using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;

inline int in(int& a) {return scanf("%d", &a);}
inline void out(int n) {printf("%d\n", n);}
template<typename T> inline void swap(T& a, T& b) {T tmp = a; a = b; b = tmp;}
auto pint_compare = [](pint x, pint y) -> bool{return (x.first < y.first);};

signed main(){
    int N, K;
    cin >> N >> K;
    if(K == 1) PRINT("0");
    else PRINT(N - K);
    return 0;
}

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

#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i, n)  for(int i=0;i<(n);++i)
#define REPr(i, n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define FORqr(i, m, n) for(int i = (n);i >=(m);--i)
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x, y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
const ll MOD = 1000000007;

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

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 main() {
	int N,K;
	cin >> N >> K;
	string S;
	cin >> S;

	S[K-1] = tolower(S[K-1]);

	cout << S << endl;
}

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

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

#define debug(x) cout<<(#x)<<"="<<(x)<<", ";
#define debug1(x) debug(x) cout<<'\n';
#define debug2(x1, x2) debug(x1) debug(x2) cout<<'\n';
#define debug3(x1, x2, x3) debug(x1) debug(x2) debug(x3) cout<<'\n';
#define debug4(x1, x2, x3, x4) debug(x1) debug(x2) debug(x3) debug(x4) cout<<'\n';
#define debug5(x1, x2, x3, x4, x5) debug(x1) debug(x2) debug(x3) debug(x4) debug(x5) cout<<'\n';

#define fcout cout<<fixed<<setprecision(15)
#define repp(i,j,k) for(int i=j; i<k; ++i)
#define rep(i,j) repp(i,0,j)
#define rrep(i,j,k) for(int i=j; i>=k; --i)
#define all(x) (x).begin(), (x).end()
#define sort(x) sort(x.begin(), x.end())
#define lb(x,val) lower_bound(x.begin(), x.end(), val)
#define ub(x,val) upper_bound(x.begin(), x.end(), val)
#define pb(x) emplace_back(x);

typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
typedef vector<int> vi;
typedef vector<lli> vl;
typedef tuple<int, int, lli> tiil;

//const lli M=998244353ll;
const lli M=1000000007ll;
const double D=1.0;

int main(){
fast_io
int n,a,b;cin>>n>>a>>b;
cout<<min(n*a,b);
return 0;
}

Measured memory_bytes: 256
s=int(input())
for i in range(s//4,3501):
    for j in range(1,3501):
        t=4*i*j-i*s-j*s
        y=s*i*j
        if t>0 and s*i*j%t==0:
            print(s*i*j//t,i,j)
            exit()


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

#define MAX 100000
int h[MAX];

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

	string ans="Yes";

	for(int i=0;i<n-1;i++){
		if(h[i]<h[i+1]){
			h[i+1]--;
		}
	}
	//for(int i=0;i<n;i++)cout<<h[i]<<endl;
	for(int i=0;i<n-1;i++){
		if(h[i]>h[i+1]){
			ans="No";
			break;
		}
	}

	cout<<ans<<endl;


	return 0;
}


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

int main(){
  int n;
  cin >> n;
  int ans = 0;
  for(int i = 0; i < n; i++){
    int a,b;
    cin >> a >> b;
    ans += b - a + 1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3616
#!/usr/bin/env python3
import sys

def solve(s: str):
    from collections import Counter
    from math import floor
    N = len(s)
    c = Counter(s)
    return floor(N / 2) - c["p"]

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    print(solve(s))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


Measured memory_bytes: 9496
class Node
    attr_accessor :index, :children, :parent

    def initialize()
        @children = [nil, nil]
        @parent = nil
    end

    def depth
        parent == nil ? 0 : parent.depth + 1
    end

    def degree
        children.length
    end

    def height
        if children.empty?
            0
        else
            children.map {|e| e.height }.max + 1
        end
    end

    def preorder_array
        left_array = children[0] == nil ? [] : children[0].preorder_array
        right_array = children[1] == nil ? [] : children[1].preorder_array
        [[self], [left_array], [right_array]].flatten
    end

    def inorder_array
        left_array = children[0] == nil ? [] : children[0].inorder_array
        right_array = children[1] == nil ? [] : children[1].inorder_array
        [[left_array], [self], [right_array]].flatten
    end

    def postorder_array
        left_array = children[0] == nil ? [] : children[0].postorder_array
        right_array = children[1] == nil ? [] : children[1].postorder_array
        [[left_array], [right_array], [self]].flatten
    end

    def insert(node)
        if @index >= node.index
            if @children[0] == nil
                @children[0] = node
            else
                @children[0].insert(node)
            end
        else
            if @children[1] == nil
                @children[1] = node
            else
                @children[1].insert(node)
            end
        end
    end
end

root_node = nil

gets.to_i.times do
    s,i=gets.chomp.split(" ")
    
    if s == "print"
        if root_node == nil
            puts ""
            puts ""
        else
            puts " " + root_node.inorder_array.map {|e|e.index}.join(" ")
            puts " " + root_node.preorder_array.map {|e|e.index}.join(" ")
        end
    else
        i = i.to_i
        if root_node == nil
            root_node = Node.new
            root_node.index = i
        else
            node = Node.new
            node.index = i
            root_node.insert(node)
        end
    end
end



Measured memory_bytes: 138116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define FORR(I,A,B) for(ll I = (B-1); I >= (A); --I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
const ll INF=1e18+7;
const ll MOD=1e9+7;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	ll ans1=0,ans2=0;
	char x = s[0];
	FOR(i,1,s.size()){
		if(x!=s[i]){
			ans1++;
			x = s[i];
		}
	}
	FORR(i,0,s.size()){
		if(x!=s[i]){
			ans2++;
			x = s[i];
		}	
	}
	cout << min(ans1,ans2) << endl;
}

Measured memory_bytes: 512
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
int ceil(int a, int b) {
    return (a + b - 1) / b;
}
int round(int a, int b) {
    return (a + b / 2) / b;
}
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

ll sum(ll num) {
    ll res = 0;
    while (num > 0) {
        res += num % 10;
        num /= 10;
    }
    return res;
}

// main
int main() {
    int K;
    cin >> K;
    ll n = 1, d = 1;
    cout << 1 << endl;
    FOR(i, 1, K, 1) {
        if (sum(n + d) * (n + 10 * d) < sum(n + 10 * d) * (n + d)) {
            d *= 10;
        }
        n += d;
        cout << n << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream> 
#include <cstdlib>
#include <cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++) 

int main() {
    int N, K;
    cin >> N;
    cin >> K;
    
    int a = 1;
    for (int i = 0; i < N; i++) {
        if (a*2 < a+K) {
            a *= 2;
        } else a += K;
    }
    cout << a << endl;
}



Measured memory_bytes: 3576
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long int ll;
#define EPS (1e-7)
#define INF (1e9 + 10)
#define PI (acos(-1))
#define MOD (1000000007)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<x<<endl
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    int N, K;
    cin >> N;
    cin >> K;
    int K2 = 2 * K;
    int x[N], y[N];
    string c[N];
    int B[K2][K] = {};
    REP(i, N) {
        cin >> x[i];
        cin >> y[i];
        cin >> c[i];
        if (y[i] % K2 >= K) {
            x[i] = (x[i] >= K) ? (x[i] - K) : (x[i] + K);
            y[i] -= K;
        }
        if (c[i] == "W"){
            x[i] = (x[i] >= K) ? (x[i] - K) : (x[i] + K);
        }
        x[i] %= K2; y[i] %= K2;
        B[x[i]][y[i]] += 1;
    }
    int Bt[K2+1][K+1];
    REP(i, K2+1) {
        REP(j, K+1) {
            if (i==0 || j==0){
                Bt[i][j] = 0;
            }else{
                Bt[i][j] = Bt[i-1][j] + Bt[i][j-1] - Bt[i-1][j-1] + B[i-1][j-1];
            }
        }
    }
    int ans = 0;
    REP(i, K2) {
        REP(j, K) {
            int res = 0;
            int x1, x2;
            if (i < K) {
                x1 = i;
                x2 = i+K;
            } else {
                x1 = i-K;
                x2 = i;
            }
            int S1 = Bt[x1][j];
            int S2 = Bt[x2][j];
            int S3 = Bt[K2][j]; 
            int S4 = Bt[x1][K];
            int S5 = Bt[x2][K];
            int S6 = Bt[K2][K]; 
            if (i < K) {
                res = S3 + S5 - S4 - 2 * (S2 - S1);
            } else {
                res = S6 - S3 + S5 - S4 - 2 * (S5 - S4 - S2 + S1);
            }
            chmax(ans, res);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 22144
fun main(args: Array<String>) {
    val W = readLine()!!.toString()
    val T = mutableListOf<String>()
    while (true) {
        val s = readLine()!!.toString()
        if (s == "END_OF_TEXT") break
        T.addAll(s.split(" "))
    }
    println(T.filter { it.toLowerCase() == W.toLowerCase() }.count())
}


Measured memory_bytes: 33932
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

int n,m,memo[3340][3340];
bool done[3340][3340];
string s,t;


int dp(int i, int j){
	if(done[i][j]){
		return memo[i][j];
	}
	done[i][j] = true;
	if(i==n || j==m){
		memo[i][j] = 0;
		return memo[i][j];
	}
	memo[i][j] = max(dp(i+1,j),dp(i,j+1));
	if(s[i]==t[j]){
		memo[i][j] = max(memo[i][j],dp(i+1,j+1)+1);
	}
	return memo[i][j];
}

int main(void){
	int i,j;
	fill(done[0],done[3340],false);
	cin >> s >> t;
	n = s.l_ength();
	m = t.l_ength();
	while(i<n && j<m){
		if(s[i]==t[j]){
			if(dp(i+1,j+1) >= dp(i+1,j) && dp(i+1,j+1) >= dp(i,j+1)){
				cout << s[i];
				++i; ++j;
				continue;
			}
		}
		if(dp(i+1,j)>dp(i,j+1)){
			++i;
		}else{
			++j;
		}
	}
	cout << endl;
	return 0;
}


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


int main()
{
	string N;
	cin>>N;
	int ans=0;
	rep(i,N.size())
	{
		ans+=(int)(N[i]-'0');
	}
	int val=(N[0]-'0')-1;
	rep(i,N.size()-1)
	{
		val+=9;
	}
	cout<<max(ans,val)<<endl;
	return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define INF LLONG_MAX
#define ll  long long
#define ull unsigned long long
#define rep(i,n) for(int i=0; i<n; ++i)
#define MOD 1000000007
using namespace std;
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 main() {
  int N; cin >> N;
  vector<int> A(N+2);
  int sum = 0;
  A[0] = A[N+1] = 0;
  for(int i=1; i<=N; ++i) {
    cin >> A[i];
    sum += abs(A[i-1]-A[i]);
  }
  sum += abs(A[N]);
  for(int i=1; i<=N; ++i) {
    int sub = 0;
    if(A[i-1] <= A[i] && A[i] <= A[i+1]) sub = 0;
    else if(A[i+1] < A[i] && A[i] < A[i-1]) sub = 0;
    else sub = abs(A[i]-A[i-1])+abs(A[i]-A[i+1])-abs(A[i-1]-A[i+1]);
    cout << sum-sub << endl;
  }
}

Measured memory_bytes: 1664
# ABC133D - Rain Flows into Dams
def main():
    N = int(input())
    A = tuple(map(int, input().split()))
    X = [0] * N
    cur = sum(A) - 2 * sum(A[1::2])
    X[0] = cur
    for i, a in enumerate(A[:-1], 1):
        X[i] = a * 2 - cur
        cur = X[i]
    print(' '.join(map(str, X)))
    


if __name__ == "__main__":
    main()

Measured memory_bytes: 19140
N = int(input())
L = []
flag = True
for i in range(N):
    new = input()
    if new in L:
        flag = False
        break
    if L != []:
        if L[-1][-1] != new[0]:
            flag = False
            break
    L.append(new)

if flag:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int r,c;
  cin>>r>>c;
  int kazu[r+1][c+1];
  for(int i=0;i<r+1;i++){
    for(int j=0;j<c+1;j++){
      kazu[i][j]=0;
    }
  }
  for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
      cin>>kazu[i][j];
      kazu[r][j]+=kazu[i][j];
      kazu[i][c]+=kazu[i][j];
      kazu[r][c]+=kazu[i][j];
    }
  }  
  for(int i=0;i<r+1;i++){
    for(int j=0;j<c+1;j++){
      if(j==c){
        cout<<kazu[i][j]<<endl;
      }else{
        cout<<kazu[i][j]<<" ";
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3140
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

// z-algorithm : a[i] = s[0,n) と s[i,n) の最長共通接頭辞の長さ O(N)
vector<int> zAlgorithm(const string &s){
  int n = s.size();
  vector<int> a(n+1,0);
  int i=1, j=0;
  while(i<n){
    while(i+j<n && s[j] == s[i+j]) j++;
    a[i] = j;
    if(j==0){i++; continue;}
    int k = 1;
    while(i+k<n && k+a[k]<j) a[i+k]=a[k], k++;
    i += k;
    j -= k;
  }
  return a;
}

int main(){
  string s;
  cin>>s;
  s = s.substr(0,s.size()/2);
  long l,r;
  cin>>l>>r;

  auto z = zAlgorithm(s);
  long x = z.size()-1;
  repl(j,1,x+1) if(z[j] + j == x){
    x = j;
    break;
  }
  // sは周期xの文字列

  auto cnt = [&](long len){
    vector<long> vec(26,0);
    rep(i,len) vec[s[i]-'a']++;
    return vec;
  };

  if(s.size()%x==0){
    // [0...x) を繰り返す
    auto v = cnt(x);
    auto f = [&](long p){
      long q = p/x;
      auto v1 = v;
      auto v2 = cnt(p%x);
      rep(i,26) v1[i] = v1[i]*q + v2[i];
      return v1;
    };

    auto f1 = f(l-1), f2 = f(r);
    rep(i,26) cout << f2[i] - f1[i] << " \n"[i==25];
  }
  else {
    // fibonacci
    vector<vector<long>> nums;
    vector<long> len;
    nums.pb(cnt(x));
    len.pb(x);
    nums.pb(cnt(s.size()));
    len.pb(s.size());

    while( len[len.size()-1] + len[len.size()-2] <= r ){
      int sz = len.size();
      vector<long> v(nums[sz-1]);
      rep(i,26) v[i] += nums[sz-2][i];
      nums.pb(v);
      len.pb(len[len.size()-1] + len[len.size()-2]);
    }

    function<vector<long>(long)> f = [&](long p){
      int idx = upper_bound(all(len), p) - len.begin();
      if(idx==0){
        return cnt(p);
      }
      idx--;
      auto vr = f(p - len[idx]);
      rep(i,26) vr[i] += nums[idx][i];
      return vr;
    };

    auto f1 = f(l-1), f2 = f(r);
    rep(i,26) cout << f2[i] - f1[i] << " \n"[i==25];
  }

  return 0;
}


Measured memory_bytes: 2240
#include<bits/stdc++.h>
#define Rep(i,a,b) for(register int i=(a);i<=(b);++i)
#define Repe(i,a,b) for(register int i=(a);i>=(b);--i)
#define pb push_back
#define Chkmax(a,b) a=a>b?a:b
#define Chkmin(a,b) a=a<b?a:b
#define mx(a,b) (a>b?a:b)
#define mn(a,b) (a<b?a:b)
typedef unsigned long long uint64;
typedef unsigned int uint32;
typedef long long ll;
using namespace std;

namespace IO
{
    const uint32 Buffsize=1<<15,Output=1<<23;
    static char Ch[Buffsize],*S=Ch,*T=Ch;
    inline char getc()
	{
		return((S==T)&&(T=(S=Ch)+fread(Ch,1,Buffsize,stdin),S==T)?0:*S++);
	}
    static char Out[Output],*nowps=Out;
    
    inline void flush(){fwrite(Out,1,nowps-Out,stdout);nowps=Out;}

    template<typename T>inline void read(T&x)
	{
		x=0;static char ch;T f=1;
		for(ch=getc();!isdigit(ch);ch=getc())if(ch=='-')f=-1;
		for(;isdigit(ch);ch=getc())x=x*10+(ch^48);
		x*=f;
	}

	template<typename T>inline void write(T x,char ch='\n')
	{
		if(!x)*nowps++='0';
		if(x<0)*nowps++='-',x=-x;
		static uint32 sta[111],tp;
		for(tp=0;x;x/=10)sta[++tp]=x%10;
		for(;tp;*nowps++=sta[tp--]^48);
		*nowps++=ch;
	}
}
using namespace IO;

inline void file()
{
#ifndef ONLINE_JUDGE
	freopen("water.in","r",stdin);
	freopen("water.out","w",stdout);
#endif
}

const int MAXN=(1<<16)+7;

static int n,m,a[17];

inline void init()
{
	read(n);read(m);
	Repe(i,m,1)read(a[i]);
}

const int mod=1e9+7;

static int dp[17][MAXN],func[MAXN],inv[MAXN];

inline int power(int u,int v)
{
	static int sm;
	for(sm=1;v;v>>=1,u=(uint64)u*u%mod)if(v&1)
		sm=(uint64)sm*u%mod;
	return sm;
}

inline int ad(int u,int v){return (u+=v)>=mod?u-mod:u;}

inline int C(int u,int v)
{
	if(u<v)return 0;
	return (uint64)func[u]*inv[v]%mod*inv[u-v]%mod;
}

static int ans;

inline void solve()
{
	static int mx=(1<<n);

	func[0]=1;
	Rep(i,1,mx)func[i]=(uint64)func[i-1]*i%mod;
	
	inv[mx]=power(func[mx],mod-2);
	Repe(i,mx,1)inv[i-1]=(uint64)inv[i]*i%mod;

	dp[0][0]=1;
	
	--mx;

	Rep(i,0,m-1)
	{
		Rep(j,0,mx)
		{
			if(!dp[i][j])continue;
			dp[i+1][j]=ad(dp[i+1][j],dp[i][j]);
			Rep(k,0,n-1)if(!((j>>k)&1))
				dp[i+1][j|(1<<k)]=ad(dp[i+1][j|(1<<k)],(uint64)dp[i][j]
					*C((1<<n)-a[i+1]-j,(1<<k)-1)%mod*func[1<<k]%mod);
		}
	}
	Rep(i,0,mx)
		ans=ad(ans,__builtin_popcount(i)&1?
			mod-(uint64)dp[m][i]*func[(1<<n)-i-1]%mod:
			(uint64)dp[m][i]*func[(1<<n)-i-1]%mod);
	Rep(i,1,n)ans=ad(ans,ans);
	printf("%d\n",ans);
}

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


Measured memory_bytes: 4352
/*
 ID: bradyawn
 PROG: contest
 LANG: C++11
 */

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <utility>
#include <algorithm>
#include <set>
#include <ctime>
#include <queue>
#include <stack>
#include <bitset>
#include <random>
#include <cstring>

using namespace std;

typedef long long ll;
typedef pair<int,int> i2;
typedef pair<ll,ll> ll2;

int main()
{
    //ifstream inf("");
    //ofstream outf("");
    //cout << setprecision(10);
    //ios_base::sync_with_stdio(0);
    //cin.tie(0);
    
    int m;
    cin >> m;
    cout << 48-m << '\n';
    
    return 0;
    
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main(){
	int n,a[32] = 
    {
      1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
    };
	
  	cin >> n;
  
  	cout << a[n-1];
  
	return 0;
}

Measured memory_bytes: 384
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=qb
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
def dq():
	return queue.deque()
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1

n,r = readInts()
k=n

if n>=10:
	print(r)
else:
	print(r+100*(10-k))

Measured memory_bytes: 3952
#include<stdio.h>

int main()
{
    int n,m,x,a[2000],y,z,sum[2]={0};

    scanf(" %d %d %d",&n,&m,&x);

    for(y=0;y<m;y++){
        scanf(" %d",&a[y]);
    }

    for(y=x;y<n;y++){
        for(z=0;z<m;z++){
            if(a[z]==y){
                sum[0]++;
            }
        }
    }
    for(y=x;y>0;y--){
        for(z=0;z<m;z++){
            if(a[z]==y){
                sum[1]++;
            }
        }
    }
    if(sum[0]<sum[1])
        printf("%d",sum[0]);
    else
        printf("%d",sum[1]);

    return 0;
}


Measured memory_bytes: 128
#include<stdio.h>
#include<stdlib.h>
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define fast  ios_base::sync_with_stdio(0); cin.tie(0);
#define f(i,k) for(i=0;i<k;i++)
#define rep(i,n) for(i=1;i<=n;i++)
#define input(i,n,arr) for(i=0;i<n;i++) cin>>j, arr.push_back(j)
#define vect_ll vector<long long>
#define vect_ll_it vector<long long>::iterator
#define pb(p) push_back(p)
#define endl "\n"
#define mod 1000000007
const ll inf = 1e18;
ll i, j, k, n, m, x, y, p, q;
int main()
{
	fast
	int t = 1;
	//cin >> t;
	while (t--)
	{
		cin >> n;
		ll a[n + 1][3], dp[n + 1][3];
		for (i = 0; i < n; i++) for (j = 0; j < 3; j++) cin >> a[i][j], dp[i][j] = a[i][j];
		for (i = 1; i < n; i++)
		{
			for (j = 0; j < 3; j++)
			{
				dp[i][j] += max(dp[i - 1][(j + 1) % 3], dp[i - 1][(j + 2) % 3]);
			}
		}
		cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2]));


	}
	//cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
	return 0;
}


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

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


Measured memory_bytes: 256
#coding:utf-8
import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    a,b,c = LMIIS()
    #YN( ((a**0.5)+(b**0.5)) < (c**0.5))
    #YN((a**2+b**2+c**2+2*a*b-2*b*c-2*c*a ) > (4*a*b))
    YN(((c-b-a)**2) > (4*a*b) and c-b-a > 0)

if __name__ == '__main__':
    main()

Measured memory_bytes: 64876
/* In the name of ALLAH */
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<string>

// MAXIMUM and MINIMUM elements
#define mx_ari(a)   *max_element(a , a+sizeof(a)/4)
#define mn_ari(a)   *min_element(a , a+sizeof(a)/4)
#define mx_arl(a)   *max_element(a , a+sizeof(a)/8)
#define mn_arl(a)   *min_element(a , a+sizeof(a)/8)
#define mx_vec(v)   *max_element(v.begin() , v.end())
#define mn_vec(v)   *min_element(v.begin() , v.end())
// COUNT the occurence of an element
#define cnt_ari(a,b)   count(a , a+sizeof(a)/4 , b)
#define cnt_arl(a,b)   count(a , a+sizeof(a)/8 , b)
#define cnt_vec(v,b)   count(v.begin() , v.end() , b)
// INPUTs
#define sci(a)        scanf("%d",&a)
#define scii(a,b)     scanf("%d %d",&a,&b)
#define sciii(a,b,c)  scanf("%d %d %d",&a,&b,&c)
#define scl(a)        scanf("%lld",&a)
#define scll(a,b)     scanf("%lld %lld",&a,&b)
#define sclll(a,b,c)  scanf("%lld %lld %lld",&a,&b,&c)
#define scf(a)        scanf("%f",&a)
#define scff(a,b)     scanf("%f %f",&a,&b)
#define scfff(a,b,c)  scanf("%f %f %f",&a,&b,&c)
#define scd(a)        scanf("%ld",&a)
#define scdd(a,b)     scanf("%lf %lf",&a,&b)
#define scddd(a,b,c)  scanf("%lf %lf %lf",&a,&b,&c)
// OUTPUTs
#define pri(a)        printf("%d ",a)
#define prii(a,b)     printf("%d %d ",a,b)
#define priii(a,b,c)  printf("%d %d %d ",a,b,c)
#define prl(a)        printf("%lld ",a)
#define prll(a,b)     printf("%lld %lld ",a,b)
#define prlll(a,b,c)  printf("%lld %lld %lld ",a,b,c)
#define prd(a)        printf("%.4lf ",a)
#define prdd(a,b)     printf("%.4lf %.4lf ",a,b)
#define prddd(a,b,c)  printf("%.4lf %.4lf %.4lf ",a,b,c)
#define prf(a)        printf("%.4f ",a)
#define prff(a,b)     printf("%.4f %.4f ",a,b)
#define prfff(a,b,c)  printf("%.4f %.4f %.4f ",a,b,c)
// LOOPs
#define foi(i,n)      for(int i=0;i<n;i++)
#define fol(i,n)      for(long long int i=0;i<n;i++)
#define fod(i,n)      for(double i=0;i<n;i++)
#define fof(i,n)      for(float i=0;i<n;i++)
// NEWLINEs
#define nwl           << "\n"
#define nl            printf("\n");
// PAIRs and PUSHbacks
#define mp            make_pair
#define pb            emplace_back
// IMPORTANTs
#define ll          long long
#define ull         unsigned long long int
#define mod         1000000007
#define lcm(a,b)     (a*b) / __gcd(a,b)

using namespace std;






int main()
{
   ll n; cin >> n;
   ll dp[n][3];
   ll a[n][3];

   fol(i,n){
      fol(j,3){
         cin >> a[i][j];
      }
   }
   
   dp[0][0] = a[0][0];
   dp[0][1] = a[0][1];
   dp[0][2] = a[0][2];

   for(ll i=1;i<n;i++){
      dp[i][0] = a[i][0] + max(dp[i-1][1] , dp[i-1][2]);
      dp[i][1] = a[i][1] + max(dp[i-1][0] , dp[i-1][2]);
      dp[i][2] = a[i][2] + max(dp[i-1][1] , dp[i-1][0]);
   }

   cout << max(dp[n-1][0] , max(dp[n-1][1] , dp[n-1][2]));

   return 0;
}

Measured memory_bytes: 8264
#include<stdio.h>
#define MAX 2000009
int n=1;

void maxHeapify(int A[],int i){
  int l,r,largest,change;
  l=i*2;
  r=i*2+1;
  if(l<=n && A[l]>A[i]) largest=l;
  else largest = i;
  if(r<=n && A[r]>A[largest]) largest = r;
  if(largest!=i){
    change=A[i];
    A[i]=A[largest];
    A[largest]=change;
    maxHeapify(A,largest);
    }
}


void heapIncreasekey(int A[],int i,int key){
  int change;
  A[i]=key;
  while(i>1 && A[i/2]<A[i]){
    change=A[i];
    A[i]=A[i/2];
    A[i/2]=change;
    i = i/2;
  }
  
    }

int heapExtractMax(int A[]){
	int max;
	if(n<1) printf("helpunderflow");
	max=A[1];
	n--;
	A[1] = A[n];
	
	maxHeapify(A,1);
	return max;
}



int main(){
  int H[MAX];
  char sen[20];
  int k;
  int max;

  while(1){
    scanf("%s",sen);
    if(sen[0]=='i'){
      scanf("%d",&k);
      heapIncreasekey(H,n,k);
      n++;
    }
    else if(sen[1]=='x'){
      //for(k=1;k<=n;k++) printf("%d ",H[k]);
      //printf("\n");
    printf("%d\n",heapExtractMax(H));
    //for(k=1;k<=n;k++) printf("%d ",H[k]);
    //printf("\n");
      
      //     printf("%d\n",heapExtractMax(H));
     }
    else break;
  }
  //  for(k=1;k<n;k++) printf("%d ",H[k]);
  return 0;
}



Measured memory_bytes: 5628
function Main(input) {
  input = input.split('\n');
	var n = Number(input[0]);
  var str = '';
  var stri = new Array();
  var retu = new Array(n);
  var frg = 0;
  var count = 0;
  for(var i=0; i<n; i++){
    retu[i] = Number(input[1].charAt(i));
  }
  for(var i=0; i<1000; i++){
	str = String(i);
    frg = 0;
    if(i > 99){
          stri[0] = str.charAt(0);
    stri[1] = str.charAt(1);
    stri[2] = str.charAt(2);
  }else if(i > 9){
      stri[0] = 0; 
    stri[1] = str.charAt(0);
    stri[2] = str.charAt(1);
    }else{
            stri[0] = 0; 
    stri[1] = 0;
    stri[2] = str.charAt(0);
    }
    for(var j=0; j<n; j++){
    	if(stri[frg] == retu[j] && frg != 3){
          frg++;
           }
    }
    if(frg == 3){
       count++;
       }
  }
  console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main() {
    map<char, char> m = {
      {'A', 'T'},
      {'C', 'G'},
      {'T', 'A'},
      {'G', 'C'}
    };
  char c;
  cin >> c;
  cout << m[c] << endl;
}


Measured memory_bytes: 256
from collections import deque

def main():
    H, W, K = map(int, input().split())
    A = [input() for _ in range(H)]
    s = None
    for i in range(H):
        for j in range(W):
            if A[i][j] == "S":
                s = (i, j)
    q = deque()
    q.append((s[0], s[1], K))
    directions = [(0, 1), (1, 0), (0, -1), (-1, 0)]
    visited = [[False] * W for _ in range(H)]
    visited[s[0]][s[1]] = True
    dst = float("inf")
    while(len(q)):
        i, j, m = q.popleft()
        dst = min(dst, min([i, j, H-1-i, W-1-j]))
        if m == 0:
            continue
        for d in directions:
            ni = i + d[0]
            nj = j + d[1]
            if 0 <= ni < H and 0 <= nj < W:
                if A[ni][nj] == "." and not visited[ni][nj]:
                    q.append((ni, nj, m-1))
                    visited[ni][nj] = True
    ans = 1 - (-dst//K)
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 59228
#pragma GCC optimize("03")
#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long 
#define mod 100003

using namespace std;

int n, q;
char c[200100];
pair<char, char> a[200100];

int check(int pos, int cod) {
    for (int i = 1; i <= q; i++) {
        if (c[pos] != a[i].fi)
            continue;
        
        if (a[i].se == 'L')
            pos--;
        else pos++;

        if (cod == 0 && pos < 1)
            return 1;

        if (cod == 1 && pos > n)
            return 1; 
    }
    return 0;
}

int main() {
    // ifstream cin("tst.in");
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);

    cin >> n >> q;
    for (int i = 1; i <= n; i++)
        cin >> c[i];

    for (int i = 1; i <= q; i++)
        cin >> a[i].fi >> a[i].se;

    int cnt = 0;
    int st = 1, dr = n, mid;
    while (st <= dr) {
        mid = (st + dr) / 2;
        if (check(mid, 0))
            st = mid + 1;
        else dr = mid - 1;
    }

    int left = dr;
    st = 1, dr = n;
    while (st <= dr) {
        mid = (st + dr) / 2;
        if (check(mid, 1))
            dr = mid - 1;
        else st = mid + 1;
    }

    int right = st;

    cout << right - left - 1;

    return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll d, n;
    cin >> d >> n;

    ll p = 1;
    rep(i, d) {
        p *= 100;
    }

    if(n == 100) {
        out(p*101);
    }
    else {
        out(p*n);
    }
    
    re0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
const int INF = 1000000001;

int main(){
  string a, b, c;
  cin >>a >> b>>c;
  printf("%c%c%c\n",toupper(a.at(0)),toupper(b.at(0)),toupper(c.at(0)));
}

Measured memory_bytes: 256
//c++ テンプレ
#include<bits/stdc++.h>
using namespace std;

typedef long long llint;
typedef long double ld;

#define inf 1e18
#define mod 1000000007
priority_queue<llint,vector<llint>,greater<llint> > que;
priority_queue<llint> Que;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int W,H;
int x,y;

void solve(){
    cin >> W >> H >> x >> y;
    int c=0;
    if(W==x*2 && H==y*2)c=1;
    double ans=((double)H*(double)W)/2.0;
    printf("%.10f %d\n",ans,c);
}  

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


Measured memory_bytes: 256