akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<algorithm>
using namespace std;
pair<double,int>dat[1000];
//Y*(tx-sx)=(X-sx)*(ty-sy)+sy*(tx-sx)
//Y*(bx-ax)=(X-ax)*(by-ay)+ay*(bx-ax)
//X=ax
//Y*(tx-sx)=(ax-sx)*(ty-sy)+sy*(tx-sx)
//(bx-ax)*(X*(ty-sy)+sy*tx-sx*ty)=(tx-sx)*(X*(by-ay)+ay*bx-ax*by)
//(bx-ax)*(ty-sy)*X+(bx-ax)*(sy*tx-sx*ty)=(tx-sx)*(by-ay)*X+(tx-sx)*(ay*bx-ax*by)
//((bx-ax)*(ty-sy)-(tx-sx)*(by-ay))*X=(tx-sx)*(ay*bx-ax*by)-(bx-ax)*(sy*tx-sx*ty)
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		long long ax,ay,bx,by;
		scanf("%lld%lld%lld%lld",&ax,&ay,&bx,&by);
		int c;
		if(ax>bx){
			long long cx=ax;
			ax=bx;
			bx=cx;
			long long cy=ay;
			ay=by;
			by=cy;
		}
		scanf("%d",&c);
		int now=0;
		if(ax==bx){
			if(ay>by){
				long long cy=ay;
				ay=by;
				by=cy;
			}
			for(int i=0;i<c;i++){
				long long sx,sy,tx,ty;
				int type,z;
				scanf("%lld%lld%lld%lld%d%d",&sx,&sy,&tx,&ty,&type,&z);
				type^=z;
				if(tx!=sx&&!(sx>ax&&tx>ax)&&!(sx<ax&&tx<ax)){
					double Y=(double)((ax-sx)*(ty-sy)+sy*(tx-sx))/(tx-sx);
					if((double)ay<Y&&Y<(double)by){
						dat[now++]=make_pair(Y,type);
					}
				}
			}
		}else{
			for(int i=0;i<c;i++){
				long long sx,sy,tx,ty;
				int type,z;
				scanf("%lld%lld%lld%lld%d%d",&sx,&sy,&tx,&ty,&type,&z);
				type^=z;
				if((bx-ax)*(ty-sy)-(tx-sx)*(by-ay)!=0){
					double X=(double)((tx-sx)*(ay*bx-ax*by)-(bx-ax)*(sy*tx-sx*ty))/((bx-ax)*(ty-sy)-(tx-sx)*(by-ay));
					if(sx==tx){
						double Y=(double)((sx-ax)*(by-ay)+ay*(bx-ax))/(bx-ax);
						if((double)sy<Y&&(double)ty<Y)continue;
						if((double)sy>Y&&(double)ty>Y)continue;
					}else{
						if((double)sx<X&&(double)tx<X)continue;
						if((double)sx>X&&(double)tx>X)continue;
					}
					if((double)ax<X&&X<(double)bx){
			//			printf("%f ",X);
						dat[now++]=make_pair(X,type);
					}
				}
			}
		}
		std::sort(dat,dat+now);
		int val=dat[0].second;
		int ret=0;
		for(int i=0;i<now;i++){
			if(dat[i].second!=val){
				ret++;
				val=dat[i].second;
			}
		}
		printf("%d\n",ret);
	}
}

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

int main()
{
	int a,b,c,sum=0;
	char s[100];
	
	cin>>a>>b;
	if(a<=8 && b<=8)
	{
		cout<<"Yay!"<<endl;
	}
	else
	{
		cout<<":("<<endl;
	}
		
	return 0;
}
	

Measured memory_bytes: 256
let rec solver lst =
	match lst with
	| [] -> 0
	| _::[] -> 0
	| x::y::xs ->
		if x = y
		then 0 + solver (y::xs)
		else 1 + solver (y::xs)

let _ = Scanf.scanf "%s\n" (fun x -> x)
		|> Extlib.ExtString.String.to_list
		|> solver
		|> Printf.printf "%d"

Measured memory_bytes: 8448
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#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;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    string s;
    cin >> s;
    int n = s.length();
    int m = n-7;
    REP(i,n) {
        string ans = "";
        REP(j,n){
            if(j >= i && j < i+m) continue;
            ans.push_back(s[j]);
        }
        if (ans == "keyence") {
            cout << "YES" << std::endl;
            return 0;
        }
    }
    cout << "NO" << std::endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a,b) ((a<b)?a:b)
#define _max(a,b) ((a<b)?b:a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a)?1:-1)
#define SORT(v) sort(v.begin(),v.end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380


int main()
{
	cout << fixed << setprecision(10);
	string s;
	cin >> s;

	int cnt = 0;
	REP(i, s.size() / 2)
	{
		if (s[i] != s[s.size() - i - 1])cnt++;
	}
	cout << cnt;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

int gcd(int a, int b)
{
        return b ? gcd(b, a % b) : a;
}

int main()
{
        //input->compute->output//

        int S, T, U;
        cin >> S >> T >> U;

        if (S == T)
        {
                cout << U << endl;
        }
        else if (S == U)
        {
                cout << T << endl;
        }
        else
        {
                cout << S << endl;
        }

        return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
	long long X, Y,i,j;
	std::cin >> X >> Y;
	i = X;
	j = Y;
	if (i%j==0)
	{
		cout << "-1";
		return 0;
	}
	while (true)
	{
		if (i%Y != 0)
		{
			cout << i;
			return 0;
		}
		i += X;
	}

	return 0;
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}


signed main() {
    int N;
    cin >> N;
    vi p(N);
    rep(i, N) cin >> p[i];

    int res = 0;
    rep(i, N) {
        if(i+1==p[i]) {
            if(i+1 < N) if(i+2==p[i+1]) i++;
            res++;
        }
    }
    
    cout << res << endl;
    
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef pair<double,double> point;
const ll MAX = 2010;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    s[3] = '8';
    PRINT(s);
}


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

int main() {
  int n, x, y, z, a, b, c;
  cin >> n;
  x = n % 10;//1のくらい
  y = n % 100;//二桁
  z = n % 1000;//三桁
  a = y / 10;//10のくらい
  b = z / 100;//100のくらい
  c = n / 1000;//1000のくらい
  if (c == b && b == a) {
    cout << "Yes" << endl;
  }
   else if (b == a && a == x) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

int main () {
	float weight;
	while ( cin >> weight ) {
		if ( 48 >= weight )	cout << "light fly" << endl;
		else if ( 51 >= weight )	cout << "fly" << endl;
		else if ( 54 >= weight )	cout << "bantam" << endl;
		else if ( 57 >= weight )	cout << "feather" << endl;
		else if ( 60 >= weight )	cout << "light" << endl;
		else if ( 64 >= weight )	cout << "light welter" << endl;
		else if ( 69 >= weight )	cout << "welter" << endl;
		else if ( 75 >= weight )	cout << "light middle" << endl;
		else if ( 81 >= weight )	cout << "middle" << endl;
		else if ( 91 >= weight )	cout << "light heavy" << endl;
		else	cout << "heavy" << endl;
	}
}

Measured memory_bytes: 1220
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  int N, K, A[222222];

  std::cin >> N >> K;

  for (int i = 0; i < N; i ++)
    std::cin >> A[i];

  for (int i = 0; i < N - K; i ++)
    std::cout << (A[i] < A[i + K] ? "Yes" : "No") << std::endl;

  return 0;
}


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

int main() {
  int n ;
  cin >> n ;
  int m=n ;
  int sum=0 ;
     while ( n ){
      sum+=n%10 ;
      n/=10 ;
    }
    if ( m%sum==0 ) cout << " Yes " << endl ;
    else cout << " No " << endl ;
}

      

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int a,b,c,coin,day;
    cin>>a>>b>>c;
    coin=0;
    day=0;
    for(;;){
        if(coin>=c){
            break;
        }
        coin=coin+a;
        day=day+1;
        if(day%7==0){
            coin=coin+b;
        }
    }
    cout<<day<<endl;
}   


Measured memory_bytes: 3116
import sys


class UnionFind:
    def __init__(self, n: int) -> None:
        self.forest = [-1] * n

    def union(self, x: int, y: int) -> None:
        x = self.findRoot(x)
        y = self.findRoot(y)
        if x == y:
            return
        if self.forest[x] > self.forest[y]:
            x, y = y, x
        self.forest[x] += self.forest[y]
        self.forest[y] = x
        return

    def findRoot(self, x: int) -> int:
        if self.forest[x] < 0:
            return x
        else:
            self.forest[x] = self.findRoot(self.forest[x])
            return self.forest[x]

    def issame(self, x: int, y: int) -> bool:
        return self.findRoot(x) == self.findRoot(y)

    def size(self, x: int) -> int:
        return -self.forest[self.findRoot(x)]

def main():
    input = sys.stdin.readline
    n,q = map(int,input().split())
    uf = UnionFind(n)
    for i in range(q):
        ti,ui,vi = map(int,input().split())
        if ti:
            print(int(uf.issame(ui,vi)))
        else:
            uf.union(vi,ui)


if __name__ == "__main__":
    main()



Measured memory_bytes: 11848
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus >= 201703L
#        pragma GCC target("avx2")
#    else
#        pragma GCC target("avx")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    Int n;
    cin >> n;

    cout << n / 3 << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

int* parent,*height;

struct Info{
	double x,y;
};

struct Data{
	bool operator<(const struct Data &arg) const{
			return cost > arg.cost;
	}
	double cost;
	int from,to;
};

double calc(Info left,Info right){
	return sqrt((left.x-right.x)*(left.x-right.x)+(left.y-right.y)*(left.y-right.y));
}

int getParent(int id){
	if(parent[id] == id)return id;
	else{
		return parent[id] = getParent(parent[id]);
	}
}

bool isSame(int left,int right){
	return getParent(left) == getParent(right);
}

void unite(int left,int right){
	int left_parent = getParent(left);
	int right_parent = getParent(right);

	if(left_parent == right_parent)return;

	if(height[left_parent] >= height[right_parent]){
		if(height[left_parent] == height[right_parent]){
			height[left_parent]++;
		}
		parent[right_parent] = left_parent;
	}else{
		parent[left_parent] = right_parent;
	}
}

int main(){

	int N,M;
	scanf("%d %d",&N,&M);

	Info* info = (Info*)malloc(sizeof(Info)*(N));
	Data* data = (Data*)malloc(sizeof(Data)*(M));
	parent = new int[N];
	height = new int[N];

	for(int i = 0; i < N; i++){
		parent[i] = i;
		height[i] = 0;
	}

	for(int i = 0; i < N; i++){
		scanf("%lf %lf",&info[i].x,&info[i].y);
	}

	double sum = 0;
	for(int i = 0; i < M; i++){
		scanf("%d %d",&data[i].from,&data[i].to);
		data[i].from--;
		data[i].to--;
		data[i].cost = calc(info[data[i].from],info[data[i].to]);
		sum += data[i].cost;
	}

	sort(data,data+M);

	double used = 0;

	for(int i = 0; i < M; i++){
		if(!isSame(data[i].from,data[i].to)){
			unite(data[i].from,data[i].to);
			used += data[i].cost;
		}
	}

	printf("%.3lf\n",sum-used);

	return 0;
}

Measured memory_bytes: 3448
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define mp make_pair
#define inf 200000000000000l
#define swap(a,b) {a=a^b;b=a^b;a=a^b;}
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define debug(x) cout<<#x<<": "<<x<<endl;
#define mod 1000000007
#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)

bool isPrime(ll n){
    if(n<2) return false;
    for(ll i=2;i*i<=n;i++){
        if(n%i == 0){
            return false;
        }
    }
    return true;
}
ll power[101];
int main()
{ 
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif
    ll t = 1;
    // cin>>t;
    while(t--){
        ll n; cin>>n;
        for(ll i=2;i<=n;i++){
            if(isPrime(i)){
                ll temp = i;
                while(n/temp > 0){
                    power[i] += (n/temp);
                    temp*=i;
                }
            }
            else{
                power[i] = 0;
            }
        }
        ll ans = 0;
        ll a74=0,a24=0, a14=0, a4=0, a2=0;
        rep(i,n+1){
            if(power[i] >= 74){
                a74++;
            }
            if(power[i]>=24){
                a24++;
            }
            if(power[i]>=14){
                a14++;
            }
            if(power[i]>=4){
                a4++;
            }
            if(power[i]>=2){
                a2++;
            }
        }
        ans += a24*(a2-1);
        ans += a14*(a4-1);
        if(a4>=2){
            ans += ((a4*(a4-1))/2)*(a2-2);
        }
        ans += a74;
        cout<<ans<<"\n";
    }
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int num(){
    char s[11];
    int i, n;
    for(i=0; i<sizeof(s); i++){
        s[i] = getchar();
        if(s[i] == ' ' || s[i] == '\n'){
            s[i] = '\0';
            break;
        }
    }
    sscanf(s, "%d", &n);
    return n;
}

int main(void)
{
    int i, ok, b=1, c=0;
    int n, a[200];
    n = num();
    for(i=0; i<n; i++){
        a[i] = num();
    }
    
    do{
        ok = 0;
        for(i=0; i<n; i++) {
            if(a[i]%2 != 0){
                printf("%d\n", c);
                
                return 0;

            }
            else{
                a[i] = a[i]/2;
            }
        }
        for(b=0; b<n; b++){
            if(a[b]%2 == 0)
                ok++;
        }
        c++;
    }while(ok == n);
    
    printf("%d\n", c);
    
    return 0;
}

Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Contest
{
    class Program
    {
        static int Main(string[] args)
        {
            new Program().Process();

            return 0;
        }

        private CommonInput cin;

        private void Process()
        {
            this.cin = new CommonInput();

            int x, y;

            x = cin.GetInt();
            y = cin.GetInt();

            Console.WriteLine("a {0} b", x > y ? ">" : x < y ? "<" : "==");

            Console.ReadKey();
        }
    }

    public class CommonInput
    {
        public CommonInput()
        {
            this._s = new string[0];
            this._i = 0;
        }

        private string[] _s;
        private int _i;
        private char[] _sep = { ' ' };

        public string GetLine()
        {
            if (this._i < this._s.Length)
                return this._s[this._i++];

            string line;
            this._i = 0;
            do
            {
                line = Console.ReadLine();
            } while (line == "");

            this._s = line.Split(this._sep, StringSplitOptions.RemoveEmptyEntries);

            return this._s[this._i++];
        }

        public int GetInt()
        {
            return int.Parse(this.GetLine());
        }

        public long GetLong()
        {
            return long.Parse(this.GetLine());
        }

        public double GetDouble()
        {
            return double.Parse(this.GetLine());
        }
    }
}

Measured memory_bytes: 5380
#include<stdio.h>
int main()
{
    int a,b;
    char x;
    scanf("%d %c %d",&a,&x,&b);
    if(x=='+')
    {
        printf("%d\n",a+b);
    }
    else
    {
        printf("%d\n",a-b);
    }
    return 0;
}


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

int N;
int mod = 1e9 + 7;

int main() {
    cin >> N;
    vector<long long> dp(N + 1, 1);
    vector<int> p(2e5 + 1, -1);   //p[i]: 最後の色iの位置
    int c; cin >> c;
    p[c] = 1; dp[0] = 1;
    for (int i = 1; i < N; i++) {
        cin >> c;
        dp[i] = dp[i - 1];
        if (p[c] > 0 && p[c] != i) {
            dp[i] += dp[p[c] - 1];
            dp[i] %= mod;
        }
        p[c] = i + 1;
    }
    cout << dp[N - 1] << endl;
}



Measured memory_bytes: 2560
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
	n = INT()
	count = Counter([input() for _ in range(n)])
	m = max(count.values())
	[print(s) for s in sorted([x for x in count if count[x] == m])]

if __name__=='__main__':
	main()


Measured memory_bytes: 37316
n,c,k = map(int,input().split())
ls = [int(input()) for _ in range(n)]
ls.sort()
ans = 0
cnt = 0
l,r = 0,0
for i in range(n):
    if l == 0:
        l = ls[i]
        r = ls[i] + k
    cnt += 1
    if cnt == c:
        ans += 1
        cnt = 0
        l = 0
        continue
    if i != n-1:
        if ls[i+1] > r:
            ans += 1
            cnt = 0
            l = 0
            continue
if cnt > 0:
    ans += 1
print(ans)

Measured memory_bytes: 13340
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define LINF 3e18+7
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

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

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 double PI = acos(-1.0);
const double EPS = 1e-10;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a;
    string s;
    cin>> a >> s;
    if(a>=3200) cout << s << endl;
    else cout << "red" << endl;
}


Measured memory_bytes: 256
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define SORTD(a) sort(a.rbegin(), a.rend());
#define UNIQUE(a) unique(a.begin(), a.end())
#define ll long long
#define INF 1000000000000000000
#define INT_MAX 2147483647

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cctype>
#include <numeric>
#include <algorithm>
#include <queue>
#include <set>
#include <utility>
#include <ios>
#include <iomanip>
#include <sstream>
#include <map>

using namespace std;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;

const ll mod = 1e9+7;

int main() {
	ll a, b, c;
	cin >> a >> b >> c;

	if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0) {
		cout << "0" << endl;
	}else{
		vl cube(3);
		cube[0] = a;
		cube[1] = b;
		cube[2] = c;
		SORT(cube);
		cout << cube[0] * cube[1] << endl;
	}
}

Measured memory_bytes: 256
#define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
string s;
pair<int,int> a[100007];
int num[5];
int main(){
    int n,k;
    cin>>n>>k;
    cin>>s;
    int cnt=0;
    ++a[++cnt].second;
    --a[cnt].first;
    if(s[0]=='L')
        ++num[1];
    else
        ++num[2];
    int sum=0;
    for(int i=1;i<n;++i){
        if(s[i]==s[i-1]){
            ++a[cnt].second,++sum;
            if(i==n-1)
                --a[cnt].first;
        }
        else{
            ++a[++cnt].second;
        }
    }
    sort(a+1,a+1+cnt);
    for(int i=cnt;i;--i){
        --k;
        sum+=2;
        if(a[i].first<0)
            --sum;
        if(!k)
            break;
    }
    cout<<min(n-1,sum);
    return 0;
}


Measured memory_bytes: 1280
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#define ls(x) x<<1
#define rs(x) x<<1|1
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 100010;
int n,m,ans;
bool vis[N];
struct node{
	int w,v;
}p[N];
bool cmp(node a,node b){
	if(a.v==b.v){
		return a.w>b.w;
	}
	return a.v>b.v;
}
int tr[N<<2];
void push_up(int k){
	tr[k]=max(tr[ls(k)], tr[rs(k)]);
}
void build(int k,int l,int r){
	if(l==r){
		tr[k]=l;
		return;
	}
	int mid=(l+r)>>1;
	build(ls(k), l, mid);
	build(rs(k), mid+1, r);
	push_up(k);
}
void update(int k,int l,int r,int p,int x){
	if(l==r){
		tr[k]=x;
		return;
	}
	int mid=(l+r)>>1;
	if(p<=mid){
		update(ls(k), l, mid, p, x);
	}
	if(p>mid){
		update(rs(k), mid+1, r, p, x);
	}
	push_up(k);
}
int query(int k,int l,int r,int L,int R){
	if(L<=l && r<=R){
		return tr[k];
	}
	int mid=(l+r)>>1,res=-1;
	if(L<=mid){
		res=max(res, query(ls(k), l, mid, L, R));
	}
	if(R>mid){
		res=max(res, query(rs(k), mid+1, r, L, R));
	}
	return res;
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1; i<=n; i++){
		scanf("%d%d",&p[i].w,&p[i].v);
	}
	sort(p+1, p+1+n, cmp);
	build(1, 1, m);
	for(int i=1; i<=n; i++){
		int t=m-p[i].w+1;
		if(t>=1){
			int pos=query(1, 1, m, 1, t);
			if(pos!=-1){
				update(1, 1, m, pos, -1);
				ans+=p[i].v;
			}
		}
	}
	printf("%d\n",ans);
	return 0;
}


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

int main()
{
	string S;
	int q;
	cin >> S >> q;
	string s[2];

	int h = 0;
	for (int i = 0; i < q; i++) {
		int t;
		cin >> t;
		if (t == 1) {
			h++;
		}
		else
		{
			int f;
			string c;
			cin >> f >> c;
			if (f == 1) {	// 先頭に追加
				s[h % 2] += c;
			}
			else			// 末尾に追加
			{
				s[(h + 1) % 2] += c;
			}
		}
	}
	reverse(s[0].begin(), s[0].end());
	S = s[0] + S + s[1];
	if (h % 2 == 1) {
		reverse(S.begin(), S.end());
	}
	cout << S << endl;
	return 0;
}

Measured memory_bytes: 1348
from collections import Counter

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        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 -self.parents[self.find(x)]

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

    def members(self, x):
        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()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


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

for _ in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    group.union(A, B)

print(max([group.size(x) for x in group.roots()]))

Measured memory_bytes: 20296
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=int(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;

int main(){
    int A,B,M;
    cin>>A>>B>>M;
    vector<ll> a(A),b(B);
    REP(i,A) cin>>a[i];
    REP(i,B) cin>>b[i];
    ll ans=*min_element(All(a))+*min_element(All(b));
    REP(i,M){
        int x,y;
        ll c;
        cin>>x>>y>>c;
        x--;y--;
        ans=min(ans,a[x]+b[y]-c);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD 1000000007
int main(int argv,char* argc[]){
    long long n,ans=1,def1=1,def2=1;
    scanf("%lld",&n);
    if(n==1){
        printf("0");
        return 0;
    }
    if(n==2){
        printf("2");
        return 0;
    }
    for(int i=0;i<n;i++){
        ans*=10;
        ans%=MOD;
        def1*=9;
        def1%=MOD;
        def2*=8;
        def2%=MOD;
    }
    ans-=(def1*2-def2);
    ans=(ans+MOD)%MOD;
    ans=(ans+MOD)%MOD;
    printf("%lld",ans);
    
    return 0;
}


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

int main(){
  int N;
  cin >> N;
  int L[100];
  for(int i=0; i<N; i++){
    cin >> L[i];
  }
  int count=0;
  //L.erase(unique(L.begin(),L.end()).L.end());
  //int r = L.size();
  /*if(r<3){
    cout << "0" << endl;
    return 0;
  } */ 
  for(int i=0; i<N; i++){
    for(int j=i+1; j<N; j++){
      for(int k=j+1; k<N; k++){
        if(L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]){
          int len = L[i]+L[j]+L[k];
          int ma = max(L[i], max(L[j],L[k]));
          int rest = len-ma;
          if(ma<rest) count = count + 1;
        }  
      }
    }
  }  
  cout << count << endl;
  return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii;
typedef pair<ld,ld> id;
typedef tuple<ll,ll,ll> tl;
typedef tuple<ll,ll,ll,ll> ql;

#define FOR(i, a, b) for(ll i=(a); i<=(b); i++)
#define ROF(i, a, b) for(ll i=(a); i>=(b); i--)
#define MEM(x, v) memset(x, v, sizeof(x))
#define FILL(x, n, v) fill(x, x+n, v);
#define ALL(x) x.begin(), x.end()
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define f first
#define s second
#define ins insert
#define e emplace
#define eb emplace_back
#define ef emplace_front
#define p push
#define pf push_front
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define ft front
#define bk back
#define pp pop
#define ppb pop_back
#define ppf pop_front

#define db cout<<"YEET\n";
#define ct(x) cout<<x<<'\n';

const ll MOD = 1e9+7; //998244353
const ll MAXN = 10+5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);

int main(){
    FAST
    ll n, start=100;
    cin >> n;
    ll cnt=0;
    while (start < n){
        start *= 1.01;
        cnt++;
    }
    cout << cnt;
}

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

#define INF_LL (ll)1e18
#define INF (int)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

int main(void){
  int32 N;
  cin >> N;
  cout << N/3 << endl;
}

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

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

using namespace std;

int main(){
	int m,d; scanf("%d%d",&m,&d);
	int ans=0;
	for(;d>0;d--) if(d/10>=2 && d%10>=2 && (d/10)*(d%10)<=m) ans++;
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<cmath>
#include<string>

using namespace std;

int main(){
    int k,x;
    cin >> k >> x;
    if(k*500>=x){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

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

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

string s;
set<int> st[26];
set<int>::iterator itr;

int main(void){
	int n,q,t,i,j,l,r,ans;
	char c;
	cin >> n;
	cin >> s;
	for(i=0; i<n; ++i){
		s[i] -= 'a';
		st[s[i]].insert(i);
	}
	cin >> q;
	for(i=0; i<q; ++i){
		cin >> t;
		if(t>1){
			cin >> l >> r; --l;
			ans = 0;
			for(j=0; j<26; ++j){
				itr = st[j].lower_bound(l);
				ans += (itr != st[j].end() && *itr < r);
			}
			cout << ans << endl;
		}else{
			cin >> j >> c; --j;
			c -= 'a';
			st[s[j]].erase(j);
			st[c].insert(j);
			s[j] = c;
		}
	}
	return 0;
}


Measured memory_bytes: 24324
////////////////////////////////////////////////////////////////////
// This source code is for Visual Studio
////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <stack>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <deque>
#include <math.h>
#include <assert.h>

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		INT32_MAX
#define Rep(i,n) for(int i = 0; i < (n); ++i )

using namespace std;

typedef vector< vector<int> > MAT;
typedef pair<int, int> PINT;
typedef long long ll;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int32_t s32;
typedef int64_t s64;

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

// main function
int main()
{
	ll ans = INF;
	ll N = 0;
	ll M = 0;
	ll R = 0;

	cin >> N >> M >> R;
	vector<ll> r(R);
	vector< vector<ll> > G(N, vector<ll>(N, INF));	// G[i][j] = cost

	Rep(i, R) {
		cin >> r[i];
		r[i]--;
	}
	sort(r.begin(), r.end());
	Rep(i, M) {
		ll from = 0;
		ll to = 0;
		ll cost = 0;
		cin >> from >> to >> cost;
		G[from - 1][to - 1] = cost;
		G[to - 1][from - 1] = cost;
	}
	Rep(i, N) {
		G[i][i] = 0;
	}

	// wershell-froit
	for (int i = 0; i < N; i++) {			// 経由する頂点
		for (int j = 0; j < N; j++) {		// 開始頂点
			for (int k = 0; k < N; k++) {	// 終端
				G[j][k] = min(G[j][k], G[j][i] + G[i][k]);
			}
		}
	}

	// solve
	do{
		// use r
		ll curr = r[0];
		ll dist = 0;
		Rep(i, r.size()) {
			dist += G[curr][r[i]];
			curr = r[i];
		}

		ans = min(ans, dist);
	}while (next_permutation(r.begin(), r.end()));

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 512
# cook your dish here
# from math import * 
#for _ in range(int(input().strip())):

h,w = map(int,input().split())
m = []
m.append('.'*(w+2))
for i in range(h):
    m.append('.'+input()+'.')
m.append('.'*(w+2))
for i in range(1,h+1):
    for j in range(1,w+1):
        if m[i][j]=='.':
            continue
        if (m[i][j]=='#' and m[i+1][j]=='#') or (m[i][j]=='#' and m[i-1][j]=='#') or (m[i][j]=='#' and m[i][j-1]=='#') or (m[i][j]=='#' and m[i][j+1]=='#'):
            pass
        else:
            print("No")
            exit(0)
print("Yes")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const double PI = 4*atan(1);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const string YES = "Possible";
const string NO = "Impossible";
#define pb push_back
#define mp make_pair
#define eb emplace_back

const int MAX_N = 2e6+10;

ll a,b,c,d;

void solve()
{
	ll ans = a*c;
	ans=max(ans,a*d);
	ans=max(ans,b*c);
	ans=max(ans,b*d);
	cout<<ans;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> a >> b >> c >> d;
	solve();
	return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P, ll> T;
 
long long int INF = 2e18;
const ll fact_table = 1200008;
double Pi = 3.1415926535897932384626;

priority_queue <ll> pql;
priority_queue <P> pqp;
priority_queue <P> bag;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//↓,→,↑,←

#define endl "\n"
#ifdef ENJAPMA
    #undef endl
#endif
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
#define pc(x) cout << x << ",";
#define rep(i,n) for (ll i = 0; i < (n); i++)
 
const ll mod = 998244353ll;
// const ll mod = 1000000007ll;
  
ll mypow(ll number1,ll number2, ll mod){
    if(number2 == 0){
        return 1ll;
    }else{
        ll number3 = mypow(number1,number2 / 2, mod);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
void YES(bool condition){
    if(condition){ p("YES"); }else{ p("NO"); }
    return;
}
void Yes(bool condition){
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}

ll mygcd(ll a, ll b){
    if(b > a)swap(a, b);
    if(a == b || b == 0)return a;
    return mygcd(b, a % b);
}
/*

ll fact[fact_table + 5],rfact[fact_table + 5]; 
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = mypow(fact[fact_table],mod - 2, mod);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    assert(n >= r);
    assert(n >= 0);
    assert(r >= 0);
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}
*/

// auto res = NTT::conv(mod, 3ll, atable, btable);

bool multicase = false;

ll n,m,num,a,b,c,d,e,q, w, ans ;
ll x[500005], y[500005];
ll r, k;
string s;

void solve(){
    cin >> s;
    ll n = s.size();
    ll cnt = 0;
    for(ll i=0;i<n;i++){
        if(s[i] == 'S')cnt ++;
        if(s[i] == 'T'){
            if(cnt >= 1){
                cnt --;
                ans += 2;
            }
        }
    }
    p(n- ans);
    return;
}

int main(){
    // init();
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll q, testcase = 1;
    if(multicase){
        cin >> q;
    }else{
        q = 1; 
    }
    while(q--){
        // pu("Case ");pu("#");pu(testcase);pu(": ");
        solve();
        testcase++;
    }
    // solve();
    return 0;
}
















Measured memory_bytes: 720
program main
 
 implicit none
 integer::leng,ans,i,j
 character::num*200000,a*1
 integer,allocatable::n(:)

 read*,num
 !print*,num
 leng=len_trim(num)
 !print*,leng
 allocate(n(leng))

 do i=1,leng
  a=num(i:i)
  read(a,*) n(i)
  !print*,n(i)
 end do


ans=0
 do j=1,leng
   ans=ans+n(j)
 end do
 
 if(mod(ans,9)==0) then
  print*,'Yes'
 else
  print*,'No'
 end if

end program main
  

Measured memory_bytes: 3896
open Batteries
let s = String.explode (read_line ())
let t = String.explode (read_line ())
let news = s @ [List.hd (List.rev t)]
let ans = List.fold_left2 (fun b x y -> if x = y then b else false) true news t
let () = print_endline (if ans then "Yes" else "No")

Measured memory_bytes: 5192
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	public static long mod = (long) (1e9+7);
	public static long[] fac,inv;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		Map<String,Integer> map = new HashMap<>();
		for(int i=0;i<n;++i) {
			add(map,sc.next());
		}
		List<String> list = new ArrayList<>();
		int max = 0;
		for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		}
		Collections.sort(list);
		for(String x : list) out.println(x);
		
	    out.close();

	}
	 static void add(Map<String, Integer> map, String string) {
			// TODO Auto-generated method stub
			if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1);
			
		}
	

}


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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#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 FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll n,m;
  cin >> n >> m;
  vector<string> a(n), b(m);
  REP(i, n)
    cin >> a[i];
  REP(i, m)
    cin >> b[i];

  for(ll i = 0; i+m-1<n; i++){
    for(ll j = 0; j+m-1<n; j++){
      bool flag = true;
      REP(k, m){
        string t = a[i+k].substr(j, m);
        if(t!=b[k]){
          flag = false;
          break;
        }
      }


      if(flag){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }


  cout << "No" << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, x, n) for(long i = x; i < n; i++)
#define erep(i, x, n) for(long i = x; i <= n; i++)
const long MOD = 1000000007;
#define all(a) a.begin(), a.end()
#define show(ans)  cout << ans << endl;


int main() {long N;
cin >> N;
vector<long> a(N+2);
erep(i, 1, N){
    cin >> a[i];
}
long sum = 0;
erep(i, 0, N){
    sum += abs(a[i+1]-a[i]);
}
erep(i, 1, N){
    long ans = sum;
    if((a[i]-a[i-1])*(a[i]-a[i+1]) > 0){
        ans = sum - min(abs(a[i+1]-a[i]), abs(a[i]-a[i-1]))*2;
    }
    show(ans);
}


  return 0;
 
}



Measured memory_bytes: 2048
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <string>
#include <set>
#include <queue>
using namespace std;
#define mem(a,n) memset(a,n,sizeof(a))
#define pb(x) push_back(x)
typedef long long ll;
typedef unsigned long long ull;
const int mod=1e9+7;
const double eps=1e-6;
const int INF=0x3f3f3f3f;
const int N=100+5;
struct node
{
    int to,next;
} e[N*N];
int first[N],cnt;
void insert(int u,int v)
{
    e[++cnt]=(node)
    {
        v,first[u]
    };
    first[u]=cnt;
    e[++cnt]=(node)
    {
        u,first[v]
    };
    first[v]=cnt;
}
int dfn[N],low[N];
int sum;
void tarjan(int x,int fa)
{
    dfn[x]=low[x]=cnt++;
    for(int k=first[x]; k; k=e[k].next)
    {
        if(!dfn[e[k].to])
        {
            tarjan(e[k].to,x),low[x]=min(low[x],low[e[k].to]);
            if(low[e[k].to]>dfn[x])
                sum++;
        }
        else if(e[k].to!=fa)
            low[x]=min(low[x],dfn[e[k].to]);
    }
}
int main()
{
    int n,m,u,v;
    while(~scanf("%d %d",&n,&m))
    {
        for(int i=1; i<=m; i++)
            scanf("%d %d",&u,&v),insert(u,v);
        cnt=0;
        for(int i=1; i<=n; i++)
            if(!dfn[i])	tarjan(i,-1);
        printf("%d\n",sum);
    }
    return 0;
}



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

int main()
{
    int a, b;
    cin >> a >> b;
    int x = a + b;
    if (x % 2 == 0)
        cout << x / 2 << endl;
    else
        cout << x / 2 + 1 << endl;
}


Measured memory_bytes: 3596
package main

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

func main() {
	var N int
	fmt.Scan(&N)
	lr := make([][]int, N)
	for i := range lr {
		lr[i] = NextIntArray()
	}

	count := 0
	for _, val := range lr {
		count += val[1] - val[0] + 1
	}

	fmt.Println(count)
}

// reader

var size = 100000
var rdr = bufio.NewReaderSize(os.Stdin, size)

func ReadLine() string {
	buf := make([]byte, 0, size)
	for {
		line, isPrefix, err := rdr.ReadLine()
		if err != nil {
			panic(err)
		}
		buf = append(buf, line...)
		if !isPrefix {
			break
		}
	}
	return string(buf)
}

func NextArray() []string {
	s := ReadLine()
	return strings.Split(s, " ")
}

func NextIntArray() []int {
	a := NextArray()
	na := make([]int, 0)

	for _, v := range a {
		if n, e := strconv.Atoi(v); e == nil {
			na = append(na, n)
		}
	}

	return na
}


Measured memory_bytes: 6400
#include <bits/stdc++.h>
using namespace std;
vector<int>adj[100005];
vector<int>dp(100005, 0);

bool visited[100005]={false};
void dfs(int node) {
	if(!visited[node]) {
		visited[node]=true;
		for(int i : adj[node]) {
			
				dfs(i);
				dp[node]=max(dp[node], 1+dp[i]);	
				
		}
	}	
}

int main() {
	int n, m;
	cin>>n>>m;
	for(int i=0;i<m;i++) {
		int a, b;
		cin>>a>>b;
		a--;
		b--;
		adj[a].push_back(b);
	}
	for(int i=0;i<n;i++) 
		if(!visited[i])
			dfs(i);
	
	sort(dp.begin(), dp.end(), greater<int>());
	//for(int i=0;i<n;i++)
	//	cout<<i<<" "<<dp[i]<<endl;
	cout<<dp[0]<<endl;
}

Measured memory_bytes: 8192
n = int(input())
a = list(map(int, input().split()))
i=0
cnt=0

tmp=[]
for i in range(1,n):
    if a[i]>a[i-1]:
        tmp.append(1)
    elif a[i]==a[i-1]:
        tmp.append(0)
    else:
        tmp.append(-1)

flg=0
swi=0
for j in range(len(tmp)):
    if swi==1:
        flg=tmp[j]
        swi=0
        continue
 
    if flg==0:
        flg=tmp[j]
    elif flg==1:
        if tmp[j]==-1:
            cnt+=1
            flg=-1
            swi=1
    elif flg==-1:
        if tmp[j]==1:
            cnt+=1
            flg=1
            swi=1

print(cnt+1)
    


Measured memory_bytes: 90824
#include <stdio.h>

int main(void){
	int i=0,j;
	char A[1200];
	gets(A);
	while(A[i]!='\0'){
		i++;
	}
	for(j=0;j<=i;j++){
		if('A'<=A[j] && A[j]<='Z') A[j]=A[j]+32;
		else if('a'<=A[j] && A[j]<='z') A[j]=A[j]-32;
	}
	printf("%s\n",A);
	return 0;
}

Measured memory_bytes: 524
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int T = sc.nextInt();
		int[] c = new int[n];
		int[] t = new int[n];
		for(int i=0; i<n; i++){
			c[i] = sc.nextInt();
			t[i] = sc.nextInt();
		}
		int min = 1001;
		for(int i=0; i<n; i++){
			if(t[i]<=T)min = Math.min(min, c[i]);
		}
		if(min==1001){
			System.out.println("TLE");
		}
		else{
			System.out.println(min);
		}
	}
}

Measured memory_bytes: 21844