akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("2");
            //1 2 2
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("3485");
            //872 1012974 1539173474040
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("4664");
            //3498 3498 3498
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        long N = long.Parse(InputList[0]);

        for (long B = 1; B <= 3500; B++) {
            for (long C = B; C <= 3500; C++) {
                long wkBunsi = -N * B * C;
                long wkBunbo = -4 * B * C + N * C + N * B;

                if (wkBunbo == 0) continue;
                if (wkBunsi % wkBunbo != 0) continue;
                long wkA = wkBunsi / wkBunbo;
                if (wkA <= 0) continue;

                Console.WriteLine("{0} {1} {2}", wkA, B, C);
                return;
            }
        }
    }
}


Measured memory_bytes: 13268
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
using namespace std;
#define INT(x) int x; scanf("%d",&x)
#define INPUT(x) scanf("%d",&x)
#define REP1(x,n) for(int x = 0; x < n; x++)
#define REP2(s,e) for(int x = s; x <= e; x++)
#define BR printf("\n")
#define INF 2000000000

int SEG[400000] = {};//18 stages

void upd(int i){
    if(i == 0) return;
    if(i%2 == 1){//left
        int p = (i-1)/2;
        SEG[p] = SEG[i] + SEG[i+1];
        upd(p);
    }else{
        int p = (i-2)/2;
        SEG[p] = SEG[i-1] + SEG[i];
        upd(p);
    }
}

void Updade(int i,int x){
    SEG[i+131071] += x;//i + 2^17-1
    upd(i+131071);
}

int Rsq(int a, int b, int k, int l, int r){
    if (b <= l || r <= a) return 0;
    if (a <= l && r <= b) return SEG[k];
    else{
        int lm = Rsq(a,b,2*k+1,l,(l+r)/2);
        int rm = Rsq(a,b,2*k+2,(l+r)/2,r);
        return lm + rm;
    }
}

int main(){
    INT(n);INT(q);
    
    REP1(i,q){
        INT(com);INT(x);INT(y);
        if (com == 0) {
            Updade(x,y);
        }else{
            printf("%d\n",Rsq(x,y+1,0,0,131072));//0 -> 2^17
        }
    }
    return 0;
}

Measured memory_bytes: 1984
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1001001001;

int main() {
    char C;

    cin >> C;

    C++;

    cout << C << endl;

    return 0;
    
}

Measured memory_bytes: 256
def solve():
    n, m = map(int, input().split())
    d = [{} for _ in range(n)]
    ans = [0 for _ in range(m)]
    for i in range(m):
        p, y = map(int, input().split())
        d[p-1][i] = y
    for i in range(n):
        d[i] = sorted(d[i].items(), key=lambda x:x[1])
        d[i] = list(map(list, d[i]))
        for x in range(len(d[i])):
            ans[d[i][x][0]] = '{:0=6}'.format(i + 1) + '{:0=6}'.format(x + 1)
    for i in ans:
        print(i)




if __name__ == '__main__':
    solve()


Measured memory_bytes: 55164
//  ©   ___MRX___

#include <bits/stdc++.h>
    using namespace std;

#define ll long long int

int main()
{
    int a, b, x = 0, i = 0;
    cin >> a >> b;
    while(i < 2) {
        x += max(a, b);
        a > b ? --a : --b;
        i++;
    }

    cout << x << '\n';

    return 0;
}


Measured memory_bytes: 3624
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
using namespace std;
const int MAXN = (int) 1500 + 10;
const int INF = (int) 0x3f3f3f3f;
typedef long long LL;

int m,n;
int h[MAXN],w[MAXN];
int cnt[1500000 + 10];

void work(){
    while(scanf("%d%d",&n,&m)&&n&&m){
        for(int i=1;i<=n;i++) scanf("%d",&h[i]);
        for(int i=1;i<=m;i++) scanf("%d",&w[i]);
        for(int i=2;i<=n;i++) h[i]+=h[i-1];
        for(int i=2;i<=m;i++) w[i]+=w[i-1];
        for(int i=1;i<=1500000;i++) cnt[i]=0;
        for(int i=0;i<n;i++){
            for(int j=i+1;j<=n;j++){
                cnt[h[j]-h[i]]++;
            }
        }
        LL ans=0;
        for(int i=0;i<m;i++){
            for(int j=i+1;j<=m;j++) ans+=cnt[w[j]-w[i]];
        }
        printf("%lld\n",ans);
    }
}

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













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

int arr[100000];
int arr2[100000];

int main()
{
	int n,k;
	std::cin >> n;
	std::cin >> k;
	for (int i = 0; i < n; i++)
	{
		std::cin >> arr[i];
	}
	for (int i = n-2; 0 <= i; i--)
	{
		int min = INT_MAX;
		for (int j = 1; j <= k; j++)
		{
			if (i + j < n) {
				int dif = std::abs(arr[i] - arr[i + j]) + arr2[i + j];
				if (dif < min)
					min = dif;
			}
		}
		arr2[i] = min;
	}
	std::cout << arr2[0] << std::endl;
}

Measured memory_bytes: 1024
# -*- coding: utf-8 -*-

def solve(x):
    q = x // 11
    r = x % 11
    
    if(r == 0):
        s = 0
    elif(r <= 6):
        s = 1
    else:
        s = 2
    
    print(q*2 + s)
    
if __name__ == '__main__':
    x = int(input())

    solve(x)

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

int main(){
  ll N,M;
  cin >> N >> M;
  ll ans = 0LL;
  ll tmp = min(N,M/2);
  ans += tmp;
  N -= tmp;
  M -= 2 * tmp;

  if(N == 0 && M >= 4){
    ans += M / 4;
  }

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


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

int main(void){
  while(true){
    string s;
    getline(cin, s);
    if(s == "."){ break; }

    bool ans = true;
    stack<char> scale;
    for(size_t i = 0; ans && i < s.length(); i++){
      if(s[i] == '(' || s[i] == '['){ scale.push(s[i]); }
      else if(s[i] == ')' || s[i] == ']'){
        if(scale.empty()){ ans = false; }
        else if((s[i] == ')' && scale.top() == '(') || (s[i] == ']' && scale.top() == '[')){ scale.pop(); }
        else{ ans = false; }
      }
    }
    if(ans){ ans = scale.empty(); }

    if(ans){ cout << "yes" << endl; }
    else{ cout << "no" << endl; }
  }
  
  return 0;
}

Measured memory_bytes: 3132
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n; cin >> n;
    vector<int> A(n), B(n), C(n-1);
    for (int i = 0; i < n; i++){
        cin >> A[i];}
    for (int i = 0; i < n; i++) {
        cin >> B[i];}
    for (int i = 0; i < n - 1; i++) {
        cin >> C[i];}

    int ans = 0;
    for (int i = 0; i < n; i++) {
        ans += B[A[i] - 1];
        if (i > 0) {
                if (A[i] - A[i - 1] == 1)
                    ans += C[A[i - 1] - 1];
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const int INF = 2e9;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin >> n;
  vi d(n);
  rep(i,n){
    cin >> d[i];
  }
  sort(all(d));
  print(d[n / 2 ] - d[n / 2 - 1]);
}

Measured memory_bytes: 1024
N, M, X = map(int,input().split())
A = list(map(int,input().split()))
a = len(A)

count_low = 0
count_high = 0
for i in range(a):
  if A[i] > X:
    count_high +=1
  elif A[i] < X:
    count_low += 1
    
if count_low >= count_high:
  print(count_high)
elif count_low < count_high:
  print(count_low)


Measured memory_bytes: 3060
route0 = 0
routeN = 0
N,M,X = map(int, input().split())
list = input().split(" ")
#print(list)
for i in range(0,M):
    if int(list[i]) <= X:
        route0 = route0 + 1
#print(route0)

for i in range(0,M):
    if int(list[i]) > X:
        routeN = routeN + 1
#print(routeN)
print(min(route0,routeN))
    

Measured memory_bytes: 3060
/*jai_ganeshdeva*/

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pu push  //  adds the value to the last of the queue 
#define lld long long int
#define ins insert /// used in set to insert the values 
#define adv advance  /// used to increment the iterator
#define mp make_pair
#define fi first
#define se second
#define all(c) c.begin(),c.end()
#define PI 3.1415926
#define INF (lld)1e18
#define vl  vector<long long int >
#define vpl vector< pair<lld ,lld> >
#define vvl vector<vector<lld> > 
#define pll pair <lld,lld>
#define modA(cccc,bbbb ,p) (((cccc+bbbb)%p+p)%p)
#define modS(cccc,bbbb ,p) (((cccc-bbbb)%p+p)%p)
#define modM(cccc,bbbb ,p) ((((cccc%p)*(bbbb%p))%p+p)%p)

long long int modp(lld a,lld p,lld n)
{
    lld d[100];
    lld i,j,k,l;
    if(n==0) return 1;
    for(i=0;n>=1;i++)
    {
        d[i]=n%2;
        n/=2;
    }
    l=i;
    long long int e=1;
    if(d[0]==1) e*=(a%p);
    for(i=1;i<l;i++)
    {
        a*=a;
        a=a%p;
        if(d[i]==1) 
        {
            e*=a;
            e=e%p;
        }
    }
    return e%p;
}
lld modInverse(lld n, lld p) 
{ 
    return modp(n, p, p-2); 
}

/*lld fac[500001]; 

void getfac(lld p)
{
    fac[0] = 1; 
    for (lld i=1 ; i<=500000; i++) 
        fac[i] = fac[i-1]*i%p; 
}    

long long int nCrmodp(lld n, lld r,lld p) 
{ 
   // Base case 
   if (r==0) 
      return 1; 
     
    return (fac[n]* modInverse(fac[r], p) % p * 
            modInverse(fac[n-r], p) % p) % p; 
}
*/



lld p1=1e9 + 7,p2=998244353;
lld l,r,mid,ans=0;
lld n,i,j,k,m,g;
lld x,y,n1,a,b=0,n2,h,z,c;
/*
void solve()
{
    cin>>n;
    ans=1;
    k=0;
    vector<lld > v;
    x=0;
    for(i=0;i<n;i++)
    {
        cin>>l;
        v.pb(l);
        if(l==0) k=1;
        if(l>1000000000) x+=1; 
        //cout<<"A";
    }
    if(x>=2)
    {
        cout<<"-1";
        return;
    }
    if(k==1)
    {
        cout<<"0";
        return;
    }
    ans=1;

    for(i=0;i<n;i++)
    {
        ans*=v[i];
    //  cout<<ans<<" \n";
        if(ans > 1000000000000000000 || ans < 0)
        {
            cout<<"-1";
            return;
        }
    }
    cout<<ans;
}
*/

void solve()
{
    cin>>n;
    x=0;
    k=0;
    vector<lld> v;
    for(i=0;i<n;i++)
    {
        cin>>l;
        v.pb(l);
        if(l==0)
        {
            k=1;
            continue;
        }
        x-=1;
        while(l>0)
        {
            x+=1;
            l/=10;
        }
    }
    if(k==1)
    {
        cout<<"0";
        return;
    }
    if(x>18)
    {
        cout<<"-1";
        return;
    }
    ans=1000000000000000000;
    for(i=0;i<n;i++)
    {
        ans/=v[i];
    }
    if(ans==0)
    {
        cout<<"-1";
        return;
    }
    ans=1;
    for(i=0;i<n;i++) ans*=v[i];
    printf("%lld",ans);

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lld t=1;
    
    //cin>>t;
    //cout<<t;
   //  getfac(p2);
    //check the value by which modulo is to be taken
    
    for(int i=0;i<t;i++)
    {
   //     cout<<"Case #"<<i+1<<": ";
                  solve();
    }
    return 0;
}

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

namespace ConsoleApplication1
{
    class Program
    {
        readonly static double r = 6378.1;

        struct Point
        {
            internal double x, y, z;
        }

        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();

            while (true)
            {
                double[] input = Array.ConvertAll(Console.ReadLine().Split(' '), double.Parse);

                if (input.All(n => n == -1)) break;

                double a = (90.0 - input[0]) * Math.PI / 180.0;
                double b = input[1] * Math.PI / 180.0;
                double c = (90.0 - input[2]) * Math.PI / 180.0;
                double d = input[3] * Math.PI / 180.0;

                Point s;
                s.x = r * Math.Sin(a) * Math.Cos(b);
                s.y = r * Math.Sin(a) * Math.Sin(b);
                s.z = r * Math.Cos(a);

                Point t;
                t.x = r * Math.Sin(c) * Math.Cos(d);
                t.y = r * Math.Sin(c) * Math.Sin(d);
                t.z = r * Math.Cos(c);

                double dist = (s.x - t.x) * (s.x - t.x) + (s.y - t.y) * (s.y - t.y) + (s.z - t.z) * (s.z - t.z);
                double res = Math.Round(r * Math.Acos(1 - dist / (2 * r * r)), 0, MidpointRounding.AwayFromZero);
                sb.AppendLine(res.ToString());
            }
            Console.Write(sb);
        }
    }
}

Measured memory_bytes: 9524
#include <bits/stdc++.h>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef unsigned long long ll;


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll a,b,x,ans=0ULL,c;
	cin >> a >> b >> x;

	if(a==0)c=0;
	else c = (a-1)/x+1;
	cout << b / x + 1 - c << endl; 
	return 0;
}

Measured memory_bytes: 256
import bisect

def solve():
    N, Q = [int(_) for _ in raw_input().split()]
    STX = []
    for i in range(N):
        Si, Ti, Xi = [int(_) for _ in raw_input().split()]
        STX.append((Si - Xi, Ti - Xi, Xi))
    D = []
    for i in range(Q):
        D.append((int(raw_input()), i))
    STX.sort(key = lambda x:x[2])
    # D have already been sorted based on settings on problem
    ans = [-1] * Q
    l = [None] * Q
    for i in range(N):
        Li, Ri, Xi = STX[i]
        lit = bisect.bisect_left(D, (Li, -1))
        rit = bisect.bisect_left(D, (Ri, -1))
        while lit < rit:
            if l[lit] is not None:
                lit = l[lit]
            else:
                ans[D[lit][1]] = Xi
                l[lit] = rit
                lit += 1
    for i in range(Q):
        print ans[i]

if __name__ == '__main__':
    solve()


Measured memory_bytes: 88220
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;

ll ANS,n,m;
vector<vector<ll>> abcd;
void dfs(vector<ll> r, int x){
    //for(int i:r)cout<<i<<",";cout<<endl;
    if(x==n){
        ll pts = 0;
        for(auto v:abcd){
            if(r[v[1]]-r[v[0]]==v[2])pts+=v[3];
        }
        ANS = max(ANS,pts);
    }else{
        for(int i=r[x-1]; i<m; i++){
            vector<ll> nex = r;
            nex[x]=i;
            dfs(nex,x+1);
        }
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll q;cin>>n>>m>>q;
    abcd=vector<vector<ll>>(q);
    rep(i,q){
        ll a,b,c,d;cin>>a>>b>>c>>d;
        abcd[i]={a-1,b-1,c,d};
    }
    vector<ll> now = vector<ll>(n,1);
    ll keta = 0;
    ll ans = 0;
    /*while(true){
        for(int i:now)cout<<i<<",";cout<<endl;
        ll pts = 0;
        for(auto v:abcd){
            if(now[v[1]]-now[v[0]]==v[2])pts+=v[3];
        }
        ans = max(ans,pts);
        if(now==vector<ll>(n,m))break;
        if(now[keta]==m){
            ll k = keta;
            keta++;
            now[keta]++;
            while(k>=0)now[k]=now[keta],k--;
        }else{
            now[keta]++;
        }
    }
    cout<<ans<<endl;*/
    for(int i=0;i<m; i++){
        vector<ll> vec(n,0);
        vec[0]=i;
        dfs(vec,1);
    }
    cout<<ANS<<endl;
    return 0;
}

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

typedef vector<int> vi;

vi normarize(const vi &v)
{
    vector<vi> r;
    rep(i,4)
    {
        vi t;
        rep(j,4) t.pb(v[(i+j)%4]);
        r.pb(t);
    }
    sort(all(r));
    return r[0];
}

inline ll P(int n, int r)
{
    if(n<r) return 0;

    ll ret=1;
    rep(i,r) ret*=n-i;
    return ret;
}

inline ll POW(int x, int n)
{
    ll ret=1;
    rep(i,n) ret*=x;
    return ret;
}

inline ll DIM(const vi &v)
{
    if(v[0]==v[1] && v[1]==v[2] && v[2]==v[3]) return 4;
    else if(v[0]==v[2] && v[1]==v[3]) return 2;
    return 1;
}

int main()
{
    int n;
    scanf(" %d", &n);

    vector<vi> c(n,vi(4));
    rep(i,n)rep(j,4) scanf(" %d", &c[i][j]);

    map<vi,int> ct;
    rep(i,n)
    {
        c[i]=normarize(c[i]);
        if(ct.find(c[i])==ct.end()) ct[c[i]]=1;
        else ++ct[c[i]];
    }

    ll ans=0;
    // 上面i, 下面j
    rep(i,n)rep(j,i)
    {
        // 下面の向きを設定
        rep(k,4)
        {
            vi u;
            rep(x,4) u.pb(c[j][(k+x)%4]);
            swap(u[1],u[3]);

            vector<vi> sides(4);
            map<vi,int> sides_ct;
            rep(x,4)
            {
                vi t(4);
                t[0]=c[i][(x+1)%4];
                t[1]=c[i][x];
                t[2]=u[x];
                t[3]=u[(x+1)%4];
                t=normarize(t);

                sides[x]=t;
                if(sides_ct.find(t)==sides_ct.end()) sides_ct[t]=1;
                else ++sides_ct[t];
            }

            ll add=1;
            for(const auto &x:sides_ct)
            {
                vi key=x.fi;
                int value=x.se;

                // 使ってないタイルのうち当てはめられる個数
                int num=ct[key];
                if(c[i]==key) --num;
                if(c[j]==key) --num;

                // 選び方、向き、位置
                add*=P(num,value)*POW(DIM(key),value);
            }
            ans+=add;
        }
    }

    // 向かい合う面の個数ぶん重複する
    cout << ans/3 << endl;
    return 0;
}


Measured memory_bytes: 139904
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "

int main(void){
    ll a,b,k;cin>>a>>b>>k;
    ll ans1=max(ll(0), a-k);
    ll ans2=max(ll(0), b-max(ll(0), (k-a)));
    cosp(ans1);co(ans2);
}


Measured memory_bytes: 256
n = gets.to_i
tree = Struct.new(:parent, :sibling, :degree, :depth, :height, :type, :children)
node = Array.new(n) {tree.new}
n.times do
  ar = gets.split.map(&:to_i)
  node[ar[0]].children = a = ar[1..-1].reject {|x| x == -1}
  node[ar[0]].degree = a.size
  node[ar[0]].parent = -1
  node[ar[0]].sibling = -1
  node[ar[0]].type = "internal node"
end

node.each_with_index do |nd, i|
  nd.children.each {|child| node[child].parent = i}
  case nd.degree
  when 0
    nd.type = "leaf"
    nd.height = 0
  when 1
    node[nd.children[0]].sibling = -1
  when 2
    node[nd.children[0]].sibling = nd.children[1]
    node[nd.children[1]].sibling = nd.children[0]
  end
end

root_index = 0
node.each_with_index {|nd, i| root_index = i if nd.parent == -1}
node[root_index].type = "root"

search = ->(index, depth) {
  node[index].depth = depth
  children = node[index].children
  height_max = 0
  children.each do |child|
    h = search.(child, depth + 1) + 1
    height_max = h if h > height_max
  end
  node[index].height = height_max
}
search.(root_index, 0)

node.each_with_index do |nd, i|
  puts "node #{i}: parent = #{nd.parent}, sibling = #{nd.sibling}, degree = #{nd.degree}, depth = #{nd.depth}, height = #{nd.height}, #{nd.type}"
end


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

int main() {
    int A, B;
    cin >> A >> B;

    if(A%2 && B%2) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<stdio.h>
#include <stdlib.h>
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

using namespace std;

int main(){
    int X, Y, Z, NUM;
    cin >> X >> Y >> Z;

    cout << Z << " " << X << " " << Y<<endl;
}
   

Measured memory_bytes: 256
'use strict';
(function(stdin) {
  var lines  = stdin.toString();
  var result = (function(data) {

    var hashmap = data.filter(function(v) {
        return /[A-Za-z]/.test(v);
    })
    .map(function(v) {
      return v.toLowerCase();
    })
    .reduce(function(map,key) {
      map[key]++;
      return map;
    },{a:0,b:0,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0
      ,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0,t:0
      ,u:0,v:0,w:0,x:0,y:0,z:0}
    );

    var keys = Object.keys(hashmap);
    return keys.map(function(key) {
      return key + ' : ' + hashmap[key];
    }).join('\n');

  }(lines.split('')
  ));
  console.log(result);
}(require('fs').readFileSync('/dev/stdin', 'utf8')));

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

N = int(input())
A = list(map(int, input().split()))


def check(m):
    if m == 1:
        pre = -1
        for a in A:
            if pre >= a:
                return False
            pre = a
    else:
        dp = {}
        pre = 0
        #count = 0
        for a in A:
            if pre < a:
                pre = a
                continue
            todelete = []
            for b in dp.keys():
                if b > a:
                    todelete.append(b)
            ind = a
            while ind > 0:
                if ind in dp and dp[ind] >= m-1:
                    todelete.append(ind)
                else:
                    break
                ind -= 1
            # 更新
            if ind in dp:
                dp[ind] += 1
            else:
                dp[ind] = 1
            if ind == 0 or dp[ind] >= m:
                return False
            for d in todelete:
                del dp[d]
            pre = a
    #print(m, count)
    return True



def main():
    l = 0
    r = N
    while r-l > 1:
        m = (r+l)//2
        if check(m):
            r = m
        else:
            l = m
    print(r)


if __name__ == "__main__":
    main()


Measured memory_bytes: 79316
import java.io.*;
import java.util.*;

public class Main {

	static long mod = (long) 1e9 + 7;
	static PrintWriter out = new PrintWriter(System.out);
	static Reader scn = new Reader();

	public static void main(String[] args) throws IOException {
		StringBuilder king = new StringBuilder();
		int r = scn.nextInt();

		out.println(2 * Math.PI * r);
		out.flush();
	}

	public static class Reader {

		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[100000 + 1];
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.')
				while ((c = read()) >= '0' && c <= '9')
					ret += (c - '0') / (div *= 10);
			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextLong();
			return arr;
		}

		public int[][] nextInt2DArray(int m, int n) throws IOException {
			int[][] arr = new int[m][n];
			for (int i = 0; i < m; i++)
				for (int j = 0; j < n; j++)
					arr[i][j] = nextInt();
			return arr;
		}
	}
}

Measured memory_bytes: 33064
while True:
    n,x= map(int,raw_input().split())

    if n == x == 0:
        break

    count = 0
    for i in range(1,n+1):
        for j in range(i+1,n+1):
            for k in range(j+1,n+1):
                if i+j+k == x :
                    count = count + 1
    print count

Measured memory_bytes: 6372
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize = read();
    let s: String = read();

    if a >= 3200 {
        println!("{}", s);
    } else {
        println!("red")
    }
}


Measured memory_bytes: 4352
# 参考:http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=2797666#1

COLOR = {
    "000000": "black",
    "0000ff": "blue",
    "00ff00": "lime",
    "00ffff": "aqua",
    "ff0000": "red",
    "ff00ff": "fuchsia",
    "ffff00": "yellow",
    "ffffff": "white"
}

while True:
    s = input()
    if len(s) == 1:
        break
    color = ""

    for first, second in zip(s[1::2], s[2::2]):
        if int(first + second, 16) <= 127:
            color += "00"
        else:
            color += "ff"
    print(COLOR[color])


Measured memory_bytes: 5568
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
#define inf 1e18+42
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971693993751058
#define maxn 100005

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define fori(it,A) for(auto it=A.begin();it!=A.end();it++)

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define all(x) (x).begin(),(x).end()
#define zero(x) memset(x,0,sizeof(x));
#define ceil(a,b) (a+b-1)/b
 
using namespace std;

int binpow(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

//START OF CODE ->->->->->->->

void solve()
{
    int n;
    cin>>n;
    int ans = 0;
    rep(i,1,n+1){
        int x = n/i;
        ans += i*(x)*(x+1)/2;
    }
    cout<<ans<<endl;
}

//END OF CODE ->->->->->->->->

signed main()
{
    fast;
    int t = 1;
    // cin>>t;

    while(t--)
    {
        solve();
    }
    return 0;
}



Measured memory_bytes: 3660
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
students = []
checkpoints = []
for i in range(N):
    students.append(list(map(int, input().split())))
#print(students)
for i in range(M):
    checkpoints.append(list(map(int, input().split())))
#print(checkpoints)
for i in range(N):
    mincp = -1
    mindist = -1
    for j in range(M):
        dist = abs(students[i][0]-checkpoints[j][0]) + abs(students[i][1]-checkpoints[j][1])
        if mincp == -1:
            mincp = j
            mindist = dist
        else:
            if dist < mindist:
                mindist = dist
                mincp = j
    print("%d" % (mincp+1))


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <string>

using namespace std;

bool check_passed(
    char ca,
    int domestic_passed,
    int foreign_passed,
    int a,
    int b
) {

    if (ca == 'a') {
        return (domestic_passed + foreign_passed) < (a + b);
    } else {

        if ((domestic_passed + foreign_passed) < (a + b)) {
            return foreign_passed < b;
        }

        return false;
    }
}

int main()
{

    int n, a, b;
    std::cin >> n >> a >> b;
    vector<char> s(n);
    for (int i = 0; i < n; i++) {
        cin >> s.at(i);
    }

    int domestic_passed = 0;
    int foreign_passed = 0;

    for (int i = 0; i < n; i++) {

        if (s.at(i) == 'a') {

            if ((domestic_passed + foreign_passed) < (a + b)) {
                domestic_passed += 1;
                cout << "Yes" << endl;
            } else {
                cout << "No" << endl;
            }
        } else if (s.at(i) == 'b') {

            if ((domestic_passed + foreign_passed) < (a + b)) {
                if(foreign_passed < b) {
                    foreign_passed += 1;
                    cout << "Yes" << endl;
                } else {
                    cout << "No" << endl;
                }
            } else {
                cout << "No" << endl;
            }
         } else {
             cout << "No" << endl;
         }

    }
    
    
    return 0;
}


Measured memory_bytes: 768
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int y = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int[] p =new int[a];
		int[] q=new int[b];
		int[] r =new int[c]; 
		for(int i=0;i<a;i++){
			p[i]= sc.nextInt();
		}
		for(int i=0;i<b;i++){
			q[i]= sc.nextInt();
		}
		for(int i=0;i<c;i++){
			r[i]= sc.nextInt();
		}
		Arrays.sort(p);
		Arrays.sort(q);
		Arrays.sort(r);
      	int[] u=new int[x+y+c];
      	for(int i=0;i<x;i++){
          u[i]=p[a-1-i];
        }      	
      	for(int i=0;i<y;i++){
          u[x+i]=q[b-1-i];
        }
      	for(int i=0;i<c;i++){
          u[x+y+i]=r[c-1-i];
        }
		Arrays.sort(u);
      	long s=0;
		for(int i=0;i<x+y;i++){
			s+=u[x+y+c-1-i];
		}
		System.out.println(s);
    }
}

Measured memory_bytes: 93520
/*
author: Apoorv Singh
*/
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
 
typedef vector <int> vi;
typedef pair <int, int> pii;
typedef vector <long long> vll;
typedef pair <long long, long long> pll;
#define pb push_back   
#define all(c) c.begin(), c.end()
#define For(i, a, b) for (long long i = a; i < b; ++i)
#define Forr(i, a, b) for (long long i = a; i > b; --i)
#define um unordered_map
#define F first
#define S second
#define ll long long 
#define endl "\n"
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cout << name << " : " << arg1 << endl;  
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

template <class X>
void printarr(X arr[], int n) 
{
	for (int i = 0; i < n; ++i)
		cout << arr[i] << ' ';
	cout << endl;
}
 
template <class T, class cmp = less<T>> using ordered_set = tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
 
ll modulo = 1e9 + 7;

ll fpow(ll a, ll n) 
{
	ll ans = 1;
	while (n) 
	{
		if (n&1) ans = (ans*a)%modulo;
		a = (a*a)%modulo; n = n >> 1;
	}
	return ans;
}

void solve() 
{
	int n;
	cin >> n;
	ll d;
	cin >> d;
	int ans = 0;
	For(i,0,n)
	{
		ll a,b;
		cin >> a >> b;
		if (a*a + b*b <= d*d) ++ans;
	}			
	cout << ans << endl;	
}

int main() 
{
	fast_io();
	int t = 1;
	// cin >> t;
	while (t--) solve();
	return 0;
}

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

namespace AGC023
{
    class A
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            long[] A = Console.ReadLine().Split().Select(long.Parse).ToArray();

            long[] S = new long[N + 1];
            for (int i = 0; i < N; i++)
            {
                S[i + 1] = S[i] + A[i];
            }

            S = S.OrderBy(x => x).ToArray();
            long res = 0;
            for (int i = 0; i < N; i++)
            {
                long count = 1;
                while (i < N && S[i] == S[i + 1])
                {
                    count++;
                    i++;
                }

                if (1 < count) res += count * (count - 1) / 2;

            }
            Console.WriteLine(res);
        }
    }
}


Measured memory_bytes: 44004
#include <iostream>
using namespace std;
int min(int a, int b);

int min(int a, int b){
        if (a>b){
                return b;
        }else{
                return a;
        }
}        

int main(){
        int n,i;
        cin >> n;
        int b[n-1];
        int a;
        for (i=0;i<n-1;i++){
                cin >> b[i];
        }
        a=b[0]+b[n-2];
        for (i=1;i<n-1;i++){
                a = a + min(b[i],b[i-1]);
        }
        cout << a;
}        


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

int main() {
  int n, t;
  int d[5000];
  set<int> s;

  while (1) {
    cin >> n;
    if (!n) break;
    s.clear();
    for (int i=1; i<n; i++) {
      s.insert((i*i)%n);
    }
    for (int i=1; i<=(n-1)/2; i++) {
      d[i] = 0;
    }
    for (set<int>::iterator it1=s.begin(); it1!=s.end(); it1++) {
      for (set<int>::iterator it2=s.begin(); it2!=s.end(); it2++) {
        if (it1 == it2) continue;
        t = *it1 - *it2;
        if (t < 0) t += n;
        if (t > (n-1)/2) t = n - t;
        ++d[t];
      }
    }
    for (int i=1; i<=(n-1)/2; i++) {
      cout << d[i] << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1444
#include <bits/stdc++.h>
#define int long long
#define uint unsigned int
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repr(i, a, b) for (int i = a; i >= b; i--)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (a).size()
#define pb(a) push_back(a)
#define eb(...) emplace_back(__VA_ARGS__)
#define mp(a, b) make_pair(a, b)
#define mt(...) make_tuple(__VA_ARGS__)
using namespace std;
using pii = pair<int, int>;
template <class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template <class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
constexpr int MOD = 1000000007;
constexpr int INF = 1LL << 30;
constexpr double EPS = 1e-10;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, 0, N) cin >> A[i];
  map<int, int> mp;
  int ans = 0, sum = 0;
  mp[0]++;
  rep(i, 0, N) {
    sum += A[i];
    ans += mp[sum];
    mp[sum]++;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 14336
a,b,m=map(int,input().split())
la=list(map(int,input().split()))
lb=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]
ans=[]
f=0
ma=min(la)
mb=min(lb)
for i in range(m):
  ans.append(la[l[i][0]-1]+lb[l[i][1]-1]-l[i][2])
  if la[l[i][0]-1]==ma and lb[l[i][1]-1]==mb:
    f=1
if f==0:
  ans.append(ma+mb)
print(min(ans))

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

int main(){
  int x,a,b;
  cin>>x>>a>>b;
  if(a>=b){
    cout<<"delicious"<<endl;
  }else{
    if(abs(a-b)<=x){
      cout<<"safe"<<endl;
    }else{
      cout<<"dangerous"<<endl;
    }
  }
}

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

#define debug(var)  do{std::cerr << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cerr << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cerr << e << " "; } std::cerr << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> v1;
typedef vector<v1> v2;
typedef vector<v2> v3;

typedef unordered_map<ll, unordered_map<ll, ll>> graph;

const ll INF = 1ll << 50;
const ll mod = 1000000007;

ll n;
v1 a;
ll alice,bob;

int main(){
    cin >> n;
    a = v1(n);
    for(ll i = 0;i < n;i++){
        cin >> a[i];
    }
    sort(a.rbegin(),a.rend());
    for(ll i = 0;i < n;i++){
        if(i%2 == 0){
            alice += a[i];
        }else{
            bob += a[i];
        }
    }
    cout << alice - bob << endl;
}


Measured memory_bytes: 3628
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>

using namespace std;

struct node{
	int key;
	node *pa,*le,*ri;
};

node *root,*NIL; 

void Insert(int k)
{
	node *y=NIL;
	node *x=root;
	node *z;
	z=(node *)malloc(sizeof(node));
	z->key=k;
	z->le=NIL;
	z->ri=NIL;
	while(x!=NIL){
		y=x;
		if(z->key < x->key){
			x=x->le;
		}else{
			x=x->ri;
		}
	}
	z->pa=y;
	if(y==NIL){
		root=z;
	}else{
		if(z->key < y->key){
			y->le=z;
		}else{
			y->ri=z;
		}
	}
}

void inorder(node *u)
{
	if(u==NIL)return;
	inorder(u->le);
	printf(" %d",u->key);
	inorder(u->ri);
}

void preorder(node *u)
{
	if(u==NIL)return;
	printf(" %d",u->key);
	preorder(u->le);
	preorder(u->ri);
}

int main()
{
	int n;
	cin>>n;
	string str;
	int k;
	for(int i=0;i<n;i++){
		cin>>str;
		getchar();
		if(str[0]=='i'){
			cin>>k;
			Insert(k);
		}else if(str[0]=='p'){
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
	}
	return 0;
}


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

using namespace std;
using ll = long long;

int main() {
  ll n, k;
  cin >> n >> k;
  vector<int> vec(n + 1);
  for (int i = 1; i <= n; ++i)
    cin >> vec[i];

  int cur = 1;
  vector<int> vec2(n + 1, -1);
  vector<int> vec3(n + 1, -1);
  for (ll i = 1; i <= k; ++i) {
    cur = vec[cur];
    if (vec2[cur] == -1) {
      vec2[cur] = i;
      vec3[i] = cur;
    } else {
      int idx = vec2[cur] + (k - vec2[cur]) % (i - vec2[cur]);
      cur = vec3[idx];
      break;
    }
  }
  cout << cur << endl;
}


Measured memory_bytes: 5640
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    int a[n];
    int b[100001]={0};
    int answer = 0;
    REP(i,n){
        cin >> a[i];
        b[a[i]]++;
    }
    REP(i,99999){
        if(b[i]+b[i+1]+b[i+2] > answer){
            answer = b[i]+b[i+1]+b[i+2];
        }
    }
    cout << answer << endl;
    

    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    cin>>N;
    int num;
    int k;
    vector< vector<int> >c(10,vector<int>(10));
    for(int i=1;i<=N;i++){
        int r=i%10;
        int l;
        int num=i;
        while(num!=0){
          k=num%10;
          num=num/10;
        }
        l=k;
        c[l][r]++;
    }
    long long total=0;
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            total+=c[i][j]*c[j][i];
        }
    }
    cout<<total;
    return 0;
}


Measured memory_bytes: 256
/*
 *    FileName:
 *      Source:
 *        Date:
 *      Author: Mew
 *	  Function:
 */
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<iomanip>
#include<fstream>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<set>
#include<map>
#include<iterator>
#include<ctime>
#define MQ 1000000007
#define MAXN 100003
using namespace std;
int n;
long long t[MAXN],a[MAXN];
int main()
{
	cin>>n;
	bool ns = false;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	a[0] = 0;
	for(int i=1;i<=n;i++)
		cin>>t[i];
	t[n+1] = 0;
	long long ans = 1;
	for(int i=1;i<=n;i++){
		int d = -1;
		if(a[i] > a[i-1]) d = a[i];
		if(t[i] > t[i+1]){
			if(d != -1 && d!=t[i]){
				ns = true;
				break;
			}
			d = t[i];
		}
		if(d == -1){
			ans = (ans * min(a[i],t[i]))%MQ;
		}
		else{
			if(d>min(a[i],t[i])){
				ns = true;
				break;
			}
		}
	}
	//cout<<ns<<endl;
	if(ns)cout<<0<<endl;
	else cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 1792
#include<iostream>
#include<string>
using namespace std;
int main(){
  string str;
  int ab[26]={};
  int i;
  while(getline(cin,str)){
    for(i=0;i<str.size();i++){
      if(str[i]>='a'&&str[i]<='z') ab[str[i]-'a']++;
      else if(str[i]>='A'&&str[i]<='Z') ab[str[i]-'A']++;
    }
  //cout << str << endl;
  }
  for(i=0;i<26;i++){
    cout << (char)('a'+i) << " : " << ab[i] << endl;
  }
  return 0;
}


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

using ll=long long;



void solve(){
    int n;
    cin>>n;
    vector<int> t(n);
    for(auto& e:t)cin>>e;
    int sum=0;
    for(auto e:t)sum+=e;
    int m;
    int maxi=-1;
    cin>>m;
    for(int i=0; i<m; i++){
        int p,x;
        cin>>p>>x;
        int a=t[p-1]-x;
        cout<<sum-a<<endl;
    }
}


signed main(){
    //while(1)
    solve();
}

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

#define ll long long int


int main(){
    int n,t;
    cin>>n>>t;
    int c[n],time[n];
    for(int i=0;i<n;i++)
        cin>>c[i]>>time[i];
    int mn = 1e9;
    for(int i=0;i<n;i++){
        if(time[i] <= t)
            mn = min(c[i],mn);
    }
    if(mn == 1e9)
        cout<<"TLE";
    else
        cout<<mn;
    return 0;
}


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

using namespace std;
typedef long long int ll;

#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)

int main(int argc, const char * argv[]) {
    
    string S;
    cin >> S;
    
    map<char, ll> m;
    
    ll two = 0;
    ll other = 0;
    
    for (int i = 0; i < S.length(); i++) {
        if (m[S[i]] == 1) {
            two++;
        } else {
            other++;
        }
        m[S[i]] += 1;
    }
    
    if (two == other) {
        cout << "Yes";
    } else {
        cout << "No";
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std ;
int main()
{
    string s;
    cin>>s;

    if(s=="Sunny"){
        cout<<"Cloudy"<<endl;
    }
    else if(s=="Cloudy"){
        cout<<"Rainy"<<endl;
    }
    else if(s=="Rainy"){
        cout<<"Sunny"<<endl;
    }

    return 0;
}


Measured memory_bytes: 256
import java.io.*;

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

      BufferedReader br =
       new BufferedReader(new InputStreamReader(System.in));

      String str = br.readLine();
      int x = Integer.parseInt(str);

      //System.out.println( x^3 );
      System.out.println( x*x*x );
      //System.out.println( Math.pow(x,3) );
      //System.out.println( (int)Math.pow(x,3) );
   


     }
}

Measured memory_bytes: 24260
#include<iostream>
#include<vector>
 
using namespace std;
 
int main(){
 
    int r,c;
 
    while(cin>>r>>c,r,c){
      
        if(r*c%2==0){
            cout<<"yes"<<endl;
        }
        else{
            cout<<"no"<<endl;
        }
    }
}

Measured memory_bytes: 3072
h,w = map(int,input().split())
ls = []
side = [[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]]
for i in range(h):
  ls.append(list(input()))
for i in range(h):
  ans2 = ""
  for j in range(w):
    ans = 0
    if ls[i][j] == "#":
      ans2 += "#"
    else:
      for k in range(8):
        if i+side[k][0] < 0 or j+side[k][1] < 0 or h <=i+side[k][0] or w <= j+side[k][1]:
          continue
        else:
          ans += (1 if ls[i+side[k][0]][j+side[k][1]] == "#" else 0)
      ans2 += str(ans)
  print(ans2)


Measured memory_bytes: 9184
#include <cstdio>
#include <algorithm>

using namespace std;
typedef long long ll;

int n;
int a[200001];

int main() {
    scanf("%d", &n);
    for (int i = 0; i < n; i ++) {
        scanf("%d", &a[i]);
    }
    if (n % 2 == 0) {
        for (int i = n - 1; i >= 1; i -= 2) printf("%d ", a[i]);
        for (int i = 0; i <= n - 2; i += 2) printf("%d ", a[i]);
    } else {
        for (int i = n - 1; i >= 0; i -= 2) printf("%d ", a[i]);
        for (int i = 1; i <= n - 2; i += 2) printf("%d ", a[i]);
    }
    puts("");
}

Measured memory_bytes: 2816
def Shiritori(x,y,z):

    len_x = len(x)
    len_y = len(y)
    len_z = len(z)

    if x[len_x-1] == y[0]:
        if y[len_y - 1] == z[0]:
            return "YES"
        else:
            return "NO"
    else:
            return "NO"

A,B,C=map(str,input().rstrip().split(' '))

FLAG = Shiritori(A,B,C)

print(FLAG)


Measured memory_bytes: 3060
//Zory-2020
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
#define DD 1
#else
#define DD 0
#endif
#define Debug if(DD) printf("line %d\n",__LINE__)
#define deb(x) if(DD) cerr<<#x<<'='<<x<<endl
#define debug if(DD) printf
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void gg1(){write2(-1);exit(0);}
	void gg2(){puts("NO");exit(0);}
	
	const double eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=1e9+7;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int N=2e5+10;
	
	int dp[N+N];
	void main()
	{
		int H=qread(),n=qread();
		mem(dp,0x3f);dp[0]=0;
		while(n--)
		{
			int a=qread(),b=qread();
			fo(i,0,H+N-a) chmin(dp[i+a],dp[i]+b);
		}int ans=INF;fo(i,H,N+N-1) chmin(ans,dp[i]);write(ans);
	}
};//变量重名！
signed main()
{
	#ifdef DEBUG
	//freopen("a.in","r",stdin);
	freopen("z.txt","r",stdin);
	#endif
	srand(time(0));
	mine::main();
	if(DD) cerr<<"Time: " <<1.0*clock()/CLOCKS_PER_SEC<<"s";
}

Measured memory_bytes: 1792