akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
const long double PI =(acos(-1));

int main(){
    double r;
    cin >> r;
    double area;
    double circumference;

    area=PI*r*r;
    circumference=2*PI*r;

    cout << fixed << setprecision(10);
    cout << area << " " << circumference << endl;  
    return 0;
}


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

int main() {
  int h,w;cin>>h>>w;
  vector<string> list(h);
  for (int i=0;i<h;i++) {
    cin>>list.at(i);
  }
  int flag=0;
  for (int i=0;i<h;i++) {
    for (int j=0;j<w;j++) {
      if(list.at(i).at(j)=='#') {
        if(j-1>-1) {
          if(list.at(i).at(j-1)=='#') {
            continue;
          }
        }
        if(j+1<w) {
          if(list.at(i).at(j+1)=='#') {
            continue;
          }
        }
        if(i-1>-1) {
          if(list.at(i-1).at(j)=='#') {
            continue;
          }
        }
        if(i+1<h) {
          if(list.at(i+1).at(j)=='#') {
            continue;
          }
        }
        flag=1;
        break;
      }
    }
    if(flag) {
      break;
    }
  }
  if(flag) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

ll N, A, B;
std::vector<ll> ans;

void showBin( ll x ) {
  std::string s;

  while( x > 0 ) {
    s += (x&1)+'0';
    x >>= 1;
  }

  while( s.size() != N )
    s += '0';

  std::reverse(all(s));

  std::cout << s << std::endl;

  return;
}

void po( ll n, ll mask, ll s, ll g ) {
  ll p = 0;

  if( n == 1 ) {
    rep( i, N ) if( mask>>i&1 )
    { ans.emplace_back(i); break; }

    return;
  }

  ll sm = s, gm = g;

  rep( i, N ) if( mask>>i&1 ) {
    if( (sm>>i&1) != (gm>>i&1) )
    { p = i; break; }
  }

  rep( i, N ) if( mask>>i&1 && p != i ) {
    sm ^= 1<<i;

    break;
  }

  po( n-1, mask^(1<<p), s, sm );
  ans.emplace_back( p );
  po( n-1, mask^(1<<p), sm^(1<<p), g );
}

int main() {
  std::cin >> N >> A >> B;

  if( (__builtin_popcount(A)&1) == (__builtin_popcount(B)&1) ) {
    std::cout << "NO" << std::endl;

    return 0;
  }

  po( N, (1<<N)-1, A, B );

  std::cout << "YES" << std::endl;

  ll cur = A;

  std::cout << cur;

  rep( i, (1<<N)-1 ) {
    cur ^= 1<<ans[i];

    std::cout << ' ' << cur;
  }

  std::cout << std::endl;

  return 0;
}

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

int main() {
    int S;
    cin >> S;
    int h,m,s;
    
    h = S / 3600;
    m = (S % 3600) / 60;
    s = (S % 3600) % 60;
    
    cout << h << ':' << m << ':' << s << endl;
}
    


Measured memory_bytes: 3084
#include <stdio.h>
int main(){
int h,w,y,i;
while(1){
scanf("%d %d\n",&h,&w);
if (h==0 && w==0){break;}
for (y=0;y<h;y++){
for (i=0;i<w;i++){printf("#");}
printf("\n");};
printf("\n");
};
return 0;
}

Measured memory_bytes: 576
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import static java.lang.Math.max;



public class Main {
    public static void main(String[] args) {
        FastScanner fsc = new FastScanner();
        int n=fsc.nextInt();
        long t=fsc.nextLong();
        long[] a=new long[n];
        for(int i=0;i<n;i++){
            a[i]=fsc.nextLong();
        }
        long[] max=new long[n];
        for(int i=n-1;i>=0;i--){
            if(i==n-1){
                max[i]=a[i];
            } else{
                max[i]=max(a[i], max[i+1]);
            }
        }
        long delMax=0;
        for(int i=0;i<n-1;i++){
            delMax=max(delMax, max[i+1]-a[i]);
        }
        int ans=0;
        for(int i=0;i<n-1;i++){
            if(max[i+1]-a[i]==delMax){
                ans++;
            }
        }
        System.out.println(ans);
    }
}


class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


Measured memory_bytes: 23992
s = str(input())
n = len(s)
ACGT = {"A", "C", "G", "T"}

res = []
for i in range(n):
    cnt = 0
    for j in range(i, n):
        if s[j] in ACGT:
            cnt += 1
        else:
            break
    res.append(cnt)

print(max(res))


Measured memory_bytes: 2940
from collections import deque
ss=deque()
s=list(input())
l=len(s)
for i in range(l):
    ss.append(s[i])
q=int(input())
info=[]
rev=[] #i回までに何回反転があるか
num=0
for i in range(q):
    info.append(list(input().split()))
moji=0 #文字の追加数
for i in range(q):
    if info[i][0]=="1":
        num+=1
    else:
        if info[i][1]=="2":
            rev.append([info[i][2],2,num]) #末尾
        else:
            rev.append([info[i][2],1,num])
        moji+=1
if num%2==1:
    ss.reverse()
#print(rev)
#print(num)
for i in range(moji):
    now=rev[i][1]
    if (num-rev[i][2])%2==1: #これが奇数だと２なら先頭になる
        #print("change")
        if rev[i][1]==2:
            rev[i][1]=1
        else:
            rev[i][1]=2
    if rev[i][1]==2:
        ss.append(rev[i][0])
    else:
        ss.appendleft(rev[i][0])
print("".join(ss))
#print(rev)

Measured memory_bytes: 56436
#!/usr/bin/env python3


def main():
    n = int(input())
    sizes = [int(input()) for _ in range(5)]
    min_size = min(sizes)
    if min_size < n:
        if n % min_size == 0:
            times = int(n / min_size)
        else:
            times = int(n / min_size) + 1
        print(5 + times - 1)
    else:
        print(5)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
n = int(input())
lis = list(map(int,input().split()))

import fractions
from functools import reduce

def gcds(numbers):
  return reduce(fractions.gcd,numbers)
def gcd2(*numbers):
  return reduce(fractions.gcd,numbers)
  

mx = 0

lisgcd = [0]*n
rlisgcd = [0]*n

lisgcd[0] = lis[0]
rlisgcd[n-1] = lis[n-1]

for i in range(n-1):
  lisgcd[i+1] = gcd2(lisgcd[i],lis[i])
  
for i in range(n-2,-1,-1):
  rlisgcd[i] = gcd2(rlisgcd[i+1],lis[i])
  
for i in range(n):
  if i == 0:
    if mx < rlisgcd[1]:
      mx = rlisgcd[1]
  elif i == n-1:
    if mx < lisgcd[n-1]:
      mx = lisgcd[n-1]
  else:
    t = gcd2(lisgcd[i],rlisgcd[i+1])
    if mx < t:
      mx = t
print(mx)


Measured memory_bytes: 14080
#pragma comment(linker, "/stack:200000000")
                #pragma GCC optimize ("Ofast")
                #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
                #include <iostream>
                #include <iomanip>
                #include <sstream>
                #include <cstring>
                #include <vector>
                #include <deque>
                #include <queue>
                #include <set>
                #include <map>
                #include <valarray>
                #include <iterator>
                #include <functional>
                #include <limits>
                #include <algorithm>
                #include <numeric>
                #include <cmath>
                #include <cassert>
                #include <unordered_map>
                #include <unordered_set>
                #include <stack>
                using namespace std;
                #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
                 #define trace(x) cerr << #x << ": " << x << " " << endl;
             
                typedef int64_t ll;
             
                #define endl '\n'
                #define int ll
                ll mod=1e9+7;
                ll mod1=1e9+5;
                
                ll power(ll a,ll b)
                {
                    if(b==0) return 1;
                    else if(b%2==0)
                        return power((((a%mod)*(a%mod))%mod),b/2)%mod;
                    else return ((a%mod)*(power((((a%mod)*(a%mod))%mod),b/2)%mod))%mod;
                }
                bool check(string s,string s1)
                {
                    int j=0;
                    for(int i=0;i<s.length();++i)
                    {
                        if(j==3)
                            break;
                        if(s[i]==s1[j])
                        {
                            j++;
                        }
                    }
                    if(j==3)
                        return 1;
                    return 0;

                }
             int32_t main()
                {
                IOS
               
                
                int a,b,c,d;
                cin>>a>>b>>c>>d;
                if(c==a+1)
                {
                    cout<<1;
                }
                else
                {
                    cout<<0;
                }


                
            }

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

#define mp(x,y) make_pair(x,y) 
#define MAX 999999999999999
#define M 1000000007
#define endl "\n"
#define pb(x) push_back(x)
#define llip(t) long long t ; cin >> t ;
#define llip2(a,b) long long a,b ; cin >> a >> b ;
#define dip(a) double a ; cin >> a ;
#define dip2(a,b) double a,b ; cin >> a >> b ; 
#define pll pair<long long,long long>  
typedef long long ll;
 
int main(){ 
    ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
    // llip(t)
    ll t = 1 ;
    while(t--){
        llip2(n,w) 
        vector<ll> value(n), weight(n) ;
        for(int i = 0 ; i < n ; i++){
            cin >> weight[i] >> value[i] ;
        }
        vector<vector<ll>> dp(n+1,vector<ll> (w+1)) ;
        for(int i = 1 ; i <= n ; i++){
            for(int j = 1 ; j <= w ; j++){
                if(j >= weight[i-1]) dp[i][j] = max(dp[i-1][j-weight[i-1]] + value[i-1],dp[i-1][j]);
                else dp[i][j] = dp[i-1][j] ;
            }
        }
        cout << dp.back().back() << endl ;
    }
}
 

Measured memory_bytes: 80256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef gp_hash_table<long long, long long> umap;
typedef tree<int, null_type, less<int>, rb_tree_tag,
		tree_order_statistics_node_update> oset;
// not that imp
typedef pair<pll, ll> plll;
typedef vector<ll> vl;
typedef vector<pll> vll;

#define inf 200000000000000ll
#define mod 1000000007ll
#define eps 1e-7
#define PI 3.1415926535897932385
// #define PI acos(-1)

#define pb push_back
#define bitc  __builtin_popcountll
#define mp make_pair
#define ff first
#define ss second
#define all(ar) ar.begin(), ar.end()

#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define foreach(it,ar) for (auto it = ar.begin(); it != ar.end(); it++)
#define fill(ar,val) memset(ar, val, sizeof(ar))

#ifdef bhartiya
#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...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif

mt19937 rng32(chrono::steady_clock::now().time_since_epoch().count());
inline bool equals(double a, double b) {return fabs(a - b) < 1e-9;}
ll gcd(ll a, ll b){ return b==0 ? a : gcd(b, a%b); }

const ll maxn = 500005;
ll n;

int main() 
{ 
	ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0), cout.precision(10); //cout<<fixed;
    cin.exceptions(cin.failbit);
    int t = 1;
    // cin>>t;
    while(t--){
        ll b;
        cin>>n>>b;
        if(n>=13) cout<<b;
        else if(n>=6) cout<<b/2;
        else cout<<0;
    }
    end_routine();
}

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

int main () {
	int a, b, k;
	cin >> a >> b >> k;

	for (int i = 0; i < k; i++) {
		if (i % 2 == 0) {
			if (a % 2 == 1) a--;
			a /= 2;
			b += a;
		}
		else {
			if (b % 2 == 1) b--;
			b /= 2;
			a += b;
		}
	}
	cout << a << " " << b << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define mp make_pair
#define pb push_back
#define ip pair<ll,ll>
#define ff first
#define ss second
#define MAX 305
const ll MOD = 998244353;

inline ll addmod(ll a, ll b){
	return (a+b)%MOD;
}

inline ll mulmod(ll a, ll b){
	return (a*b)%MOD;
}

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

	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	ll dp[c+1][d+1];
	// memset(dp,0,sizeof(dp));
	// dp[a][b] = 1;
	ll powers[MAX][MAX];
	for(ll i=1;i<MAX;i++){
		powers[i][0] = 1;
		for(ll p=1;p<MAX;p++)
			powers[i][p] = mulmod(powers[i][p-1],i);
	}

	dp[a][b] = 1;
	for(int j=b+1;j<=d;j++)
		dp[a][j] = mulmod(dp[a][j-1],a);

	for(int i=a+1;i<=c;i++){
		dp[i][b] = mulmod(dp[i-1][b],b);
		for(int j=b+1;j<=d;j++){
			dp[i][j] = addmod(addmod(mulmod(dp[i-1][j],j),mulmod(dp[i][j-1],i)),MOD-mulmod(mulmod(i-1,j-1),dp[i-1][j-1]));
			// cout<<"i="<<i<<" j="<<j<<" dp="<<dp[i][j]<<endl;
		}
	}

	cout<< dp[c][d] <<endl;
}

Measured memory_bytes: 73976
import numpy as np
n, k = map(int, input().split())

a = list(map(int, input().split()))


def gcd(a, b):
    larger = max(a, b)
    smaller = min(a, b)

    if larger % smaller == 0:
        return smaller
    else:
        return gcd(smaller, larger % smaller)


m = int(np.max(a))

g = None

for i in range(n):
    if g is None:
        g = gcd(a[i], a[i])
    else:
        g = gcd(a[i], g)

if k % g == 0 and k <= m:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


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

int main()
{
	int h,n;
	cin>>h>>n;
	int a = 0;
	for(size_t i = 0; i<n; i++)
	{
		int aa;
		cin>>aa;
		a += aa;
	}
	if(a<h)
	{
		cout<<"No"<<endl;
	}
	else
	{
		cout<<"Yes"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        long W = scanner.nextLong();
        long H = scanner.nextLong();
        long x = scanner.nextLong();
        long y = scanner.nextLong();

        if ((double)x == (double)W / 2 && (double)y == (double)H / 2) {
            double tmp = (double)H * ((double)W / 2);
            System.out.print(String.format("%.10f", tmp));
            System.out.print(" ");
            System.out.print(1);
            return;
        }

        System.out.print(String.format("%.10f", (double)H * ((double)W / 2)));
        System.out.print(" ");
        System.out.print(0);

    }
}


Measured memory_bytes: 23764
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <math.h>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#define ll long long
#define vi vector<ll>
#define vs vector<string>
#define fr(i, k, n) for (ll i = k; i < n; i++)
#define rep(i, n) fr(i, 0, n)
#define alll(v) v.begin(), v.end()
#define mp(a, b) make_pair(a, b)
#define rdd(a) ll a; cin >> a
#define rrd rdd(a); rep(i, a)
//min({a,b,c,d})などの記法
using namespace std;
template <class X> void pr(X x) { cout << x << endl; }
template <class X> void prr(X x) { for (auto it : x) { cout << it<< endl; } }

int main() {
    ll n,m,k;
    cin>>n>>m>>k;
    rep(i, n+1){
        rep(j, m+1){
            if (k==(n-i)*j+(m-j)*i) {
                pr("Yes");
                return 0;
            }
        }
    }
    pr("No");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#define Inf 1000000000
#define nmax_def 110000
#define mod 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;

int main() {
	string S, T;
	int A, B;
	cin >> S >> T;
	cin >> A >> B;
	string U;
	cin >> U;
	if (S == U)
		A--;
	else
		B--;
	cout << A << " " << B << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int n, a[1000000], cnt = 0;

void insertionSort(int g) {
    for (int i = g; i < n; ++i) {
        int j, v = a[i];
        for (j = i - g; j >= 0 && a[j] > v; j -= g) {
            a[j + g] = a[j];
            cnt++;
        }
        a[j + g] = v;
    }
}

void shellSort() {
    int m = 0, g[100], k = 1;
    while (k <= n) {
        g[m++] = k;
        k *= 3;
    }

    cout << m << endl;
    for (int i = m - 1; i >= 0; --i) {
        cout << g[i];
        if (i > 0)
            cout << " ";
    }
    cout << endl;
    for (int i = m - 1; i >= 0; --i) {
        insertionSort(g[i]);
    }
    cout << cnt << endl;
    for (int i = 0; i < n; ++i)
        cout << a[i] << endl;
}

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

    return 0;
}


Measured memory_bytes: 6988
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn=2e5+10;
int n,a[maxn],b;
ll ans;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	{
		scanf("%d",&a[i]);
		a[i]-=i;
	}
	sort(a+1,a+n+1);
	b=a[(n+1)/2];
	for(int i=1;i<=n;++i)
	ans+=abs(a[i]-b);
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 1024
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
    int n=0;
    scanf("%d",&n);
    int A[101];
    int dp[101][101];
    int INF=1<<30;
    memset(dp,INF,sizeof(dp));
    memset(A,0,sizeof(A));
    for(int i=1;i<=n;i++){
        scanf("%d",&A[i-1]);
        scanf("%d",&A[i]);
    }
    for(int i=1;i<=n;i++){
        dp[i][i]=0;
    }
    for(int l=2;l<=n;l++){
        for(int i=1;i<=n-l+1;i++){
            int j=i+l-1;
            dp[i][j]=INF;
            for(int k=i;k<=j-1;k++){
                dp[i][j]=min(dp[i][j],dp[i][k]+dp[k+1][j]+A[i-1]*A[k]*A[j]);
            }
        }
    }
    printf("%d\n",dp[1][n]);
    return 0;
}



Measured memory_bytes: 2720
n,x,y = map(int,input().split())
ko = [0 for i in range(10**4)]
for i in range(1,n):
  for j in range(i+1,n+1):
    c1 = j-i
    c2 = abs(x-i)+1+abs(y-j)
    ko[min(c1,c2)] += 1
  #  print(i,j,j-i,c1,c2,ko[:10])
for i in range(1,n):
  print(ko[i])

Measured memory_bytes: 9276
package main
 
import("fmt")
 
func main(){
  var n int
  var a, b, ans string
  fmt.Scanf("%d",&n)
  fmt.Scanf("%s %s",&a, &b)

  arune := []rune(a)
  brune := []rune(b)
  
  for i:=0; i<n; i++ {
    ans += string(arune[i])+string(brune[i])
  }
  fmt.Printf("%s",ans)
}

Measured memory_bytes: 512
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//int n = sc.nextInt();
		//String[][] array = new String[100][500];
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		List<Double> list=new ArrayList<Double>();

		double n = sc.nextInt();

		for(int i=0;n>i;i++) {
			double a = sc.nextInt();
			list.add(a);
		}

		Collections.sort(list);
		double answer=0;

		for(int i=0;n-1>i;i++) {
			answer=(list.get(0)+list.get(1))/2;
			list.remove(0);
			list.remove(0);
			list.add(answer);
			Collections.sort(list);
			//System.out.println(list);
		}

		System.out.println(list.get(0));
		}

}

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

void ins(map<int, int> &ma, int k) {
  for (int i = 1; i * i <= k; ++i) {
    if (k % i == 0) {
      ++ma[i];
      if (k / i != i)
        ++ma[k / i];
    }
  }
}

void era(map<int, int> &ma, int k) {
  for (int i = 1; i * i <= k; ++i) {
    if (k % i == 0) {
      --ma[i];
      if (ma[i] == 0)
        ma.erase(i);
      if (k / i != i) {
        --ma[k / i];
        if (ma[k / i] == 0)
          ma.erase(k / i);
      }
    }
  }
}

int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  if (k == 0)
    return 0 * printf("%lld\n", 1LL * n * n);
  map<int, int> divs;
  for (int i = 1; i <= k; ++i)
    ins(divs, i);
  long long x = 0;
  for (int i = 1; i + k - 1 <= n; ++i) {
    x -= divs.size();
    era(divs, i);
    if (i + k <= n)
      ins(divs, i + k);
  }
  long long ans = 0;
  for (int i = k; i < n; ++i)
    ans += n - i;
  ans -= 1LL * (k - 1) * k / 2;
  for (int i = 1; i <= n; ++i)
    x += i;
  printf("%lld\n", ans + x);
  return 0;
}

Measured memory_bytes: 4992
using System;

namespace B_004_57
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            new Logic_A().Start();
        }

        public class Logic_A
        {
            public void Start()
            {
                var str = Console.ReadLine().Split(' ');
                var a = Convert.ToInt32(str[0]);
                var b = Convert.ToInt32(str[1]);

                Console.WriteLine((a + b) % 24);
            }
        }
    }
}

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

const int maxn = 1e5+10 ;
int a[maxn] ;
int gcd1[maxn] ;
int gcd2[maxn] ;

int main() {

    int n ;
    cin >> n ;
    for(int i = 0; i < n; i++){
        cin >> a[i] ;
        gcd1[i] = a[i] ;
        if(i != 0){
            gcd1[i] = __gcd(gcd1[i], gcd1[i-1]) ;
        }
//        cout << i << ' ' << gcd1[i] << endl;
    }
//    cout << endl ;
    reverse(a, a+n) ;
    for(int i = 0; i < n; i++){
        gcd2[i] = a[i] ;
        if(i != 0){
            gcd2[i] = __gcd(gcd2[i], gcd2[i-1]) ;
        }
//        cout << i << ' ' << gcd2[i] << endl;
    }
    int ans = 1;
    for(int i = 0, tmp; i < n; i++){

        if(i == 0){
            ans = max(ans, gcd2[n-2]) ;
        }else if(i == n-1){
            ans = max(ans, gcd1[n-2]) ;
        }else{
            ans = max(ans, __gcd(gcd1[i-1], gcd2[n-i-2])) ;
        }

    }
    cout << ans ;

}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    string s;
    cin>>s;
    int sum=0;
    for(auto x:s)
    {
        sum+=x-'0';
        sum%=9;
    }
    if(sum==0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3788
# D

import math
inp = input().split(' ')
A, B, N = int(inp[0]), int(inp[1]), int(inp[2])

alpha, beta = math.floor(A/B), A%B
if B-1 < N:
    x = B-1
else:
    x = N
    
print(math.floor(A*x/B) - A * math.floor(x/B))

Measured memory_bytes: 9188
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
#ifdef LOCAL
#define debug(x) cerr << #x << ": " << x << endl
#else
#define debug(x)
#endif
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

const int INF = 1000000000;

char S[1000000];
int N;
short A[1000002] ={};
int dp[1000001][10];
int solve(int n, int haraisugi){
	if(haraisugi >= 10) return INF;
	if(n == N){
		if(haraisugi == 0) return 0;
		else return INF;
	}
	if(dp[n][haraisugi] != -1) return dp[n][haraisugi];
	int ret = INF;
	for(int i=-9; i<=9; i++){
		if(haraisugi*10+i-A[n] >= 0) ret = min(ret, solve(n+1, haraisugi*10+i-A[n])+abs(i));
	}
	return dp[n][haraisugi] = ret;
}

signed main(){
	scanf("%s", S);
	N = strlen(S);
	rep(i, N) A[i+1] = S[i] - '0';
	N++;
	memset(dp, -1, sizeof(dp));
	printf("%d\n", solve(0, 0));
}

Measured memory_bytes: 104704
#include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;

int main(){
	map<string, int> word;
	vector<string> w;
	string str;
	int max=0,length=0;

	while(cin >> str){
			
		w.push_back(str);
		
		//üÍµ½Pêª·ÅÉ é©T·
		if(word.find(str) != word.end() ){
			word[str]++;
		}else{
			word.insert( pair<string, int>(str,1));
		}
	}
	
	map<string,int>::iterator p;
	for(p = word.begin() ; p != word.end() ; p++){
		if( max < p->second) max = p->second;
	}
	for(p = word.begin() ; p != word.end() ; p++){
		if( max == p->second){
			cout << p->first << " ";
			break;
		}
	}
	for(int i=0 ; i<w.size() ; i++){
		if( length < w[i].size() ) length = w[i].size();
	}
	for(int i=0 ; i<w.size() ; i++){
		if( length==w[i].size() ){
			cout << w[i] << endl;
			break;
		}
	}
	
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const int INF = 1234567890;

int D;
int x[100000];

const int B = 100;
const int SZ = 1000;

// default,sorted
vector<int> d[B],s[B];

int f(int l, int r, int p, int q)
{
    int ret = r-l+1;
    for(int i=l; i<=r; ++i)if(p<=x[i] && x[i]<=q) --ret;
    return ret;
}

int g(int bid, int p, int q)
{
    int lidx = lower_bound(all(s[bid]), p) - s[bid].begin();
    int ridx = upper_bound(all(s[bid]), q) - s[bid].begin();
    int ct = ridx - lidx;
    return SZ - ct;
}

int query(int l, int r, int e)
{
    int a = min(x[l],x[r]), b = max(x[l],x[r]);
    int lb = l/SZ, rb = r/SZ;
    int ret = 0;
    if(lb==rb) ret += f(l,r,a-e,b+e);
    else
    {
        ret += f(l,SZ*(lb+1)-1,a-e,b+e);
        for(int i=lb+1; i<rb; ++i) ret += g(i,a-e,b+e);
        ret += f(SZ*rb,r,a-e,b+e);
    }
    return ret;
}

int main()
{
    scanf(" %d", &D);
    rep(i,D) scanf(" %d", &x[i]);

    rep(i,B)
    {
        d[i] = vector<int>(SZ,INF);
        rep(j,SZ)
        {
            int id = i*SZ+j;
            if(id<D) d[i][j] = x[id];
        }

        s[i] = d[i];
        sort(all(s[i]));
    }

    int Q;
    scanf(" %d", &Q);
    while(Q--)
    {
        int l,r,e;
        scanf(" %d %d %d", &l, &r, &e);
        --l; --r;
        printf("%d\n", query(l,r,e));
    }
    return 0;
}

Measured memory_bytes: 4224
a=int(raw_input())
b=int(raw_input())
c=int(raw_input())
x=int(raw_input())

ctr=0
for i in range(a+1):
	for j in range(b+1):
		for k in range(c+1):
			if i*500+j*100+k*50==x:
				ctr+=1

print ctr


Measured memory_bytes: 2568
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <deque>
using namespace std;
using P = pair<int,int>;
typedef long long int ll;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)

int main(){
    int a,b,c;
    cin>> a >> b >> c;
    int ans = c-(a-b);
    cout << max(ans,0) << endl;
    return 0;
}




Measured memory_bytes: 256
#include <iostream>

using namespace std;
static const int INF = 9999999;

void solve()
{
	int n, m;
	cin >> n >> m;
	int d[21][21];
	for(int i = 0; i < n; ++i)
	{
		for(int j = 0; j < n; ++j)
		{
			d[i][j] = INF;
		}
	}
	char c;
	for(int i = 0; i < m; ++i)
	{
		int a1, b1, c1, d1;
		cin >> a1 >> c >> b1 >> c >> c1 >> c >> d1;
		--a1;
		--b1;
		d[a1][b1] = c1;
		d[b1][a1] = d1;
	}
	for(int k = 0; k < n; ++k)
	{
		for(int i = 0; i < n; ++i)
		{
			for(int j = 0; j < n; ++j)
			{
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
	int x1, x2, y1, y2;
	cin >> x1 >> c >> x2 >> c >> y1 >> c >> y2;
	--x1;
	--x2;
	cout << y1 - y2 - d[x1][x2] - d[x2][x1] << endl;
}

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

Measured memory_bytes: 1160
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <stack>

using namespace std;


int main() {
	
	string s[5];
	cin >> s[0] >> s[1] >> s[2];
	cout << (char)(s[0][0] + 'A' - 'a') << (char)(s[1][0] + 'A' - 'a') << (char)(s[2][0] + 'A' - 'a');
}

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

#define ll long long

int main() {
	string s;
	cin >> s;
	int a = find(s.begin(),s.end(),'A') - s.begin();
	int z = find(s.rbegin(),s.rend(),'Z') - s.rbegin();
	z = (int) s.size() - z - 1;
	cout << z-a+1 << '\n';
	return 0;
}


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

int A[101010];

int main(){
  int N; cin>>N;
  rep(i,N) cin>>A[i];
  ll ans=A[0]-1;
  int lim=2;
  for(int i=1;i<N;i++){
    if(A[i]==lim) lim++;
    else if(A[i]>lim){
      ans+=A[i]/lim-(A[i]%lim==0);
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,anstemp = 0,ans = 0;
  cin >> N;
  vector <int> num1(N);
  vector <int> num1sum(N);
  vector <int> num2(N);
  vector <int> num2sum(N);
  for(int i = 0;i<N;i++){
    cin>>num1.at(i);
    if(i == 0){
      num1sum.at(0) == num1.at(0);
    }
    else{
      num1sum.at(i) = num1sum.at(i-1) + num1.at(i);
    }
  }
  for(int i = 0;i<N;i++){
    cin>>num2.at(i);
    if(i == 0){
      num2sum.at(0) == num2.at(0);
    }
    else{
      num2sum.at(i) = num2sum.at(i-1) + num2.at(i);
    }
  }
  cout << endl;
  for(int i = 0;i<N;i++){
    if(i == 0){
      anstemp = num1.at(0) + num2sum.at(N-1)+num2.at(0);
    }
    else{
      anstemp = num1.at(0) + num1sum.at(i) + num2sum.at(N-1) - num2sum.at(i-1);
    }
    if(anstemp > ans){
      ans = anstemp;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;

int main(){
	ll N, A, B;
	cin >> N >> A >> B;
	
	if(A > B){
		cout << 0 << endl;
		return 0;
	}
	if(N == 1 && A != B){
		cout << 0 << endl;
		return 0;
	}
	cout << (N-2)*B-(N-2)*A+1 << endl;

	return 0;
}


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

#define ln '\n'
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for(int i = (a); i <= (int)(b); ++i)
#define FORR(i, a, b) for(int i = (a); i >= (int)(b); --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<P> VP;
typedef vector<PL> VPL;
typedef vector<string> VS;


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int max_h = 0;
    int ans = 0;
    REP(i, n) {
        int h;
        cin >> h;
        if(h >= max_h) {
            ans++;
            max_h = h;
        }
    }
    cout << ans << ln;
    return 0;
}


Measured memory_bytes: 256
//Try until you reach your goal
#include <bits/stdc++.h>
using namespace std;
# define ll long long
# define endl "\n"
# define str string
# define vll vector<ll>
# define pb push_back
# define mll map<ll,ll>
# define mp make_pair
# define ff first
# define ss second
# define pll pair<ll,ll>
# define f(x,y) for(int x=0;x<y;x++)
ll x,y;
vector<vector<ll>> v;
vll visited;
ll ans=0;
void dfs(ll k){
    ans++;
    visited[k]=1;
    for(ll j=0;j<v[k].size();j++){
        if(visited[v[k][j]]==0){
            dfs(v[k][j]);
        }
    }
}
int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    cin>>x>>y;
    v.resize(x);
    for(ll i=0;i<y;i++){
        ll a,b;
        cin>>a>>b;
        a--;
        b--;
        v[a].pb(b);
        v[b].pb(a);
    }
    visited.resize(x,0);
    ll ans1=0;
    for(ll i=0;i<x;i++){
        if(visited[i]==0){
            ans=0;
            dfs(i);
            ans1=max(ans1,ans);
        }
    }
    cout<<ans1;
    return 0;
}

Measured memory_bytes: 21944
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main() {
  ll a,b,x;
  cin >> a >> b >> x;
  ll bb = b / x + 1;
  ll aa;
  if (a == 0) aa = 0;
  else aa = (a-1) / x + 1;
  cout << bb - aa << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
#include<deque>
#include<cstdio>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*pi*/const double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll i,fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=0,i=0;while(n/10>0){i++;d++;}return d;}
llfor;ll ans=0;////////////////////////////////////////////////////////////
int main(){
 string s,t;
 cin>>s;
 ll n=s.length();

 rep(i,0,n){
  // cout<<i<<" "<<s[i]<<endl;
  if(s[i]=='d'){
   t.clear();
   rep(j,i,i+5)t+=s[j];
  // cout<<i<<" "<<t<<endl;
   if(t!="dream"){
    pN;return 0;
   }
   i+=4;
   t.clear();
   rep(j,i+1,i+4)t+=s[j];
   //cout<<i<<" "<<t<<endl;
   if(t=="ere"||t=="erd")i+=2; 
   else if(i+5>n&&t[0]=='e'&&t[1]=='r')i+=3;
  }
   
  else if(s[i]=='e'){
   t.clear();
   rep(j,i,i+5)t+=s[j];
   //cout<<i<<" "<<t<<endl;
   if(t!="erase"){
    pN;return 0;
   }
   i+=4;
   t.clear();
   if(s[i+1]=='r')i++;
  }
 // cout<<i<<" "<<t<<endl;
  else {
   pN;return 0;
  }
 }
 pY;
return 0;}


Measured memory_bytes: 3760
N = gets.to_i

S = N.times.map {
  gets.chomp
}

max = 0

h = S.group_by(&:itself).each_with_object({}) {|(k, v), acc|
 acc[v.size] ||= []
 acc[v.size] << k
 max = v.size if max < v.size
 acc
}

puts h[max].sort

Measured memory_bytes: 57704
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	int a, b, c, d, e, k;

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

	if (max(a - e, e - a) <= k)cout << "Yay!";
	else cout << ":(";
}

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

int main() {
    int n,m,x;
cin>>n>>m>>x;
vector<int> kane(n);
vector<vector<int>> cot(m,vector<int>(n));
long int ans=1e18;
for (int i = 0; i < n; i++)
{
    cin>>kane.at(i);
for (int j = 0; j < m; j++)
{
    cin>>cot.at(j).at(i);
  
}

}
 


    bool exist = false;
    for (int bit = 0; bit < (1<<n); ++bit)
    {
int count=0;
int money=0;
        vector<int> sum(m);
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) {
            money+=kane.at(i);
                for (int j = 0; j < m; j++)
                {
                     sum.at(j) += cot.at(j).at(i);



                }
                
               
            }
        }

    
        for (int i = 0; i < m; i++)
        {
           
            
            if (sum.at(i) >= x) {count++; }
        }
        if (count==m)
        {
          
           if (ans>money)
           {
               ans=money;
           }
           
        }
        
        
    }
if (ans==1e18)
{
    cout << -1<< endl;
}
else
{
    cout<<ans<<endl;
}

 
}

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

long long mod_pow(long long x, long long n, long long &p) {
  long long ret = 1;
  while(n > 0) {
    if(n & 1) (ret *= x) %= p;
    (x *= x) %= p;
    n >>= 1;
  }
  return ret;
}


int main() {
  long long k;
  cin >> k;
  if (k % 2 == 0 || k % 5 == 0) cout << -1 << endl;
  else {
  long long ans = 1;
  long long k9 = k*9;
  while (true) {
    long long num = (7 * (mod_pow(10, ans, k9) - 1)) / 9;
    if (num % k == 0) break;
    else ans++;
  }
  cout << ans << endl;
  }
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll a,b,c,d;
    cin >> a >> b >> c >> c >> d;
    ll ans = 0;
    ans += b;
    if(a && c && d && (a%2+c%2+d%2 >= 2)){
        ans += 3;
        --a;
        --c;
        --d;
    }
    ans += (c/2)*2;
    c %= 2;
    ans += (d/2)*2;
    d %= 2;
    ans += (a/2)*2;
    cout << ans << '\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned 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 (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll tmp1,tmp2,tmp3;
const ll mod = 998244353;
const int INF = 1e9;
const ll INFLONG = 1e18;
void swap(ll *x,ll *y){
  ll tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}
int main(){
  double a,b,x;
  double ans;
  cin >> a >> b >> x;
  if(x <= a*a*b/2){
    double t = 2 * x / a / b;
    ans = atan(t/b);
    ans = ans * 180 / M_PI;
    ans = 90 - ans;
  }else{
    x = a * a * b - x;
    double t = 2 * x / a / a;
    ans = atan(t/a);
    ans = ans * 180 / M_PI;
  }
  printf("%.10f\n",ans);
}

Measured memory_bytes: 256
import math
s = input()
 
ans = 0
 
r = 0
p = 0
c = 0
for j in s:
  c = r-p
  if j == 'g':
    if c > 0:
      p += 1
      ans += 1
    else:
      r += 1
  else:
    if c > 0:
      p += 1
    else:
      r += 1
      ans -= 1
print (ans)

Measured memory_bytes: 9168
/*
 * main.c
 *
 *  Created on: 2016/12/23
 *      Author: stoneriver
 */

#include <stdio.h>

int main() {
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	if (a < b && b < c) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}
	return 0;
}

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

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

int main(int argc, char const *argv[])
{
    int D,G; cin >> D >> G;
    int ans = 1e9;
    int p[10];
    int c[10];
    REP(i, D){
        cin >> p[i] >> c[i];
    }

    REP (mask, (1 << D)){
        int s = 0, num = 0, rest_max = -1;
        REP(i, D){
            if (mask >> i & 1){
                s += (i + 1) * 100 * p[i] + c[i];
                num += p[i];
            }
            else {
                rest_max = i;
            }
        }
        if (s < G){
            int s_m = 100 * (rest_max + 1);
            if (G - s <= s_m * (p[rest_max] - 1)) {
                num += (G - s)/ s_m + ((G - s) % s_m != 0);
            } 
            else continue;
        }
        ans = min(ans, num);
    }
    cout << ans << "\n";
    return 0;
}


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

int main() {
    string s;
    cin >> s;
    set<char> st;
    rep(i,s.size()){
        st.insert(s[i]);
    } 
    if(st.size()==4){ cout << "Yes" << endl; return 0;}
    else if(st.size()==3) { cout << "No" << endl; return 0;}
    else if(st.size()==2){
        if((st.count('N')==1) && (st.count('S')==1)) { cout << "Yes" << endl; return 0;}
        if((st.count('W')==1) && (st.count('E')==1)) { cout << "Yes" << endl; return 0;}
        else cout << "No" << endl;
    }
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3612
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    x,y=MI()
    ans=0
    if x<=3:
        ans+=(4-x)*(10**5)   
    if y<=3:
        ans+=(4-y)*(10**5) 
    if x==1 and y==1:
        ans+=4*10**5
    print(ans)
        
        
        



        
        
        
        
        
    
if __name__=="__main__":
    main()



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

int main()
{
    int n;
    string s;
    cin >> n >> s;
    int r = count(s.begin(), s.end(), 'R');
    int b = count(s.begin(), s.end(), 'B');
    if(r>b) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i,n,m) for(int i = (int)(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 4e18;

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    REP(i, n) {
        cin >> a[i];
    }
    sort(ALL(a));
    if (a[0] < 0 && a[n-1] > 0) {
        vector<pair<ll, ll>> out;
        int k;
        for (k = n - 1; a[k-1] > 0; k--) {
            out.push_back({a[0],a[k]});
            a[0] = a[0] - a[k];
        }
        for (int i = 0; i < k; i++) {
            out.push_back({a[k],a[i]});
            a[k] = a[k] - a[i];
        }
        cout << a[k] << endl;
        for (auto p : out) {
            cout << p.first << " " << p.second << endl;
        }
    }
    else if (a[0] >= 0) {
        vector<pair<ll, ll>> out;
        for (int i = 1; i < n - 1; i++) {
            out.push_back({a[0],a[i]});
            a[0] -= a[i];
        }
        out.push_back({a[n-1],a[0]});
        a[n - 1] -= a[0];
        cout << a[n-1] << endl;
        for (auto p : out) {
            cout << p.first << " " << p.second << endl;
        }
    }
    else {
        vector<pair<ll, ll>> out;
        for (int i = 0; i < n - 1; i++) {
            out.push_back({a[n-1],a[i]});
            a[n-1] -= a[i];
        }
        cout << a[n - 1] << endl;
        for (auto p : out) {
            cout << p.first << " " << p.second << endl;
        }
    }
    getchar(); getchar();
}

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

int comp(const void *a, const void *b)
{
    return (*(int *)a - *(int *)b);
}

int main(void)
{
    int n, m;
    int a[100000];
    int i, j;
    int max;
    int t;
    
    scanf("%d%d", &n, &m);
    
    for (i = 0; i < m; i++){
        scanf("%d", &a[i]);
    }
    qsort(a, m, sizeof(int), comp);
#if 0
    for (i = 0; i < m; i++){
        printf("%d ", a[i]);
    }
#endif
    max = a[0] - 1;
    
    for (i = 0; i < m - 1; i++){
        t = (a[i + 1] - a[i]) / 2;
        if (max < t){
            max = t;
        }
    }
    t = n - a[m - 1];
    if (max < t){
        max = t;
    }
    
    printf("%d\n", max);
    
    return (0);
}

    
    


Measured memory_bytes: 2112
n = int(input())
t,a = map(int,input().split())
h_L = list(map(int,input().split()))

a_L = []
for val in h_L:
    temp = t-val*0.006
    x = abs(a-temp)
    a_L.append(x)

print(a_L.index(min(a_L))+1)

Measured memory_bytes: 38384