akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
 
int main(int argc, char* argv[])
{
    char str[5] = {0};
    scanf("%s", str);

    long sum = 0;
    long i;
    for(i=0; i<4; i++) {
        if(str[i]=='+') {
            sum ++;
        }
        else {
            sum --;
        }
    }
    printf("%ld\n", sum);
 
    return 0;
}

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

int main(){

	double x1, x2, y1, y2;
	double r;

	cin >> x1 >> y1 >> x2 >> y2;

	r = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));


	printf("%.8lf\n" ,r);

 }

Measured memory_bytes: 1236
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++){
	if( (i%2==0&&s[i]=='L' )||(i%2==1&&s[i]=='R') ){
	    cout<<"No"<<endl;
	    return 0;
	}
    }
    cout<<"Yes"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

# define max_n 40

int main(void) {
    int i,j;
    int n;
    cin >> n;
    while(n--){
        int h, w;
        cin >> h >> w;
        vs s(h);
        rep(i,h) cin >> s[i];

        int a[26][4]; // left,right,top,bottom
        rep(i,26)rep(j,4)
            if(j%2) a[i][j] = 0;
            else a[i][j] = INF;
        rep(i,h)rep(j,w)if(s[i][j] >= 'A' && s[i][j] <= 'Z'){
            int alph = s[i][j] - 'A';
            a[alph][0] = min(a[alph][0], j);
            a[alph][1] = max(a[alph][1], j);
            a[alph][2] = min(a[alph][2], i);
            a[alph][3] = max(a[alph][3], i);
        }
        int cnt = 0;
        rep(i,26) if(a[i][0] < INF) cnt++;

        int t;
        bool ans = true;
        rep(t,cnt){
            if(ans == false)break;
            rep(i,26)if(a[i][0] < INF){
                int p,q;
                bool c = true;
                for(p = a[i][2]; p <= a[i][3]; p++){
                    for(q = a[i][0]; q <= a[i][1]; q++){
                        if(s[p][q] != ('A' + i) && s[p][q] != '*' ) c = false;
                    }
                }
                if(c){
                    for(p = a[i][2]; p <= a[i][3]; p++){
                        for(q = a[i][0]; q <= a[i][1]; q++){
                            s[p][q] = '*';
                        }
                    }
                    a[i][0] = INF;
                    break;
                }
            }
            if(i == 26) ans = false;
        }
        if(ans)
            cout << "SAFE" << endl;
        else
            cout << "SUSPICIOUS" << endl;
    }
}



Measured memory_bytes: 3124
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<map>
#include <typeinfo>
#include <stdlib.h>
#define ll long long
const int MOD = 1000000007;
using namespace std;

int main() {
	ll n, k, sum = 0;
	cin >> n >> k;
	ll a[100000] = {};
	for (ll i = 0; i < n; i++) {
		ll tmp1, tmp2;
		cin >> tmp1 >> tmp2;
		tmp1--;
		a[tmp1] += tmp2;
	}
	for (ll i = 0;; i++) {
		sum += a[i];
		if (sum >= k) {
			cout << i + 1 << endl;
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 1024
class Main {
  public static void main(String[] args) {
	  String s = new java.util.Scanner(System.in).nextLine();
	  String[] ss = s.split(" ");
	  int a = Integer.parseInt(ss[0]);
	  int b = Integer.parseInt(ss[1]);
	  if (a < b) { System.out.println("a < b"); }
	  else if (a > b) { System.out.println("a > b"); }
	  else { System.out.println("a == b"); }
  }
}


Measured memory_bytes: 26044
#include <iostream>

using namespace std;

const int N = 45;
int memo[N];

int fib(int n)
{
    if (memo[n]) return memo[n];
    if (n < 2) return memo[n] = 1;
    return memo[n] = fib(n-1) + fib(n-2);
}

int main()
{
    int n;
    scanf("%d", &n);
    printf("%d\n", fib(n));
    return 0;
}



Measured memory_bytes: 3208
H,W=map(int, input().split())
C=[[0]*W for i in range(H)]
D=[[] for i in range(H)]
p=10**9+7
for i in range(H):
    inp = input()
    for j in range(W):
        D[i].append(inp[j])
#print(D)
C[0][0]=1
for i in range(1,W):
    if(D[0][i]=="."):
        C[0][i]=C[0][i-1]
    else:
        C[0][i]=0

for i in range(1,H):
    if(D[i][0]=="."):
        C[i][0]=C[i-1][0]
    else:
        C[i][0]=0

for i in range(1,H):
    for j in range(1,W):
        if(D[i][j]=="#"):
            C[i][j]=0
        else:

            C[i][j]=C[i-1][j]+C[i][j-1]
            C[i][j]=C[i][j]%p
print(C[H-1][W-1])


Measured memory_bytes: 90972
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n1 = sc.nextInt();
		int n2 = sc.nextInt();
		int n3 = sc.nextInt();
		int n4 = sc.nextInt();
		sc.close();
		int[] r = new int[10];//1,4,7,9
		r[n1]++;
		r[n2]++;
		r[n3]++;
		r[n4]++;
		System.out.println(r[1]==1&&r[4]==1&&r[7]==1&&r[9]==1?"YES":"NO");
	}
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    int N,M;
    cin >> N >> M;
    ll ans = M * 1900 + (N-M) * 100;
    ans <<= M;
    cout << ans << endl;
}

Measured memory_bytes: 256
s = input()
N = len(s)
l = [0] * N

i = 0
while True:
    if s[i] == "R":
        f_r_idx = i
        cnt = 0
        for i_r in range(f_r_idx, N):
            if s[i_r] == "L":
                f_r_idx = i_r - 1
                i = i_r
                break
            else:
                cnt += 1
        l[f_r_idx + 1] += cnt // 2
        l[f_r_idx] += cnt - cnt // 2
    if s[i] == "L":
        f_r_idx = i
        cnt = 0
        for i_r in range(f_r_idx, N):
            if s[i_r] == "R":
                f_r_idx = i_r - 1
                break
            else:
                cnt += 1
        l[i - 1] += cnt // 2
        l[i] += cnt - cnt // 2
        if i_r == N-1:
            break
        i = i_r

print(" ".join(map(str, l)))


Measured memory_bytes: 51948
#include<iostream>
#include<string>
using namespace std;
int main(){
  string S,T;
  cin>>S>>T;
  int lgs=size(S);
  int lgt=size(T);
  int ans=1;//あってたら1
  for(int i=0;i<lgs;i++){
    if(S[i]!=T[i])ans=0;
  }
  if(ans==1)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

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

int y, sum=0;

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

Measured memory_bytes: 256
l=[0]*120
s="#"*20
for i in range(input()):b,f,r,v=map(int,raw_input().split());l[b*30+f*10+r-41]+=v
print "",
for i in range(120):
 print l[i],;j=i+1
 if j==120:break
 if j%30==0:print;print s,
 if j%10==0:print;print "",

Measured memory_bytes: 4216
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define vector2(a,b,c) vector<vector<int>> a(b/*縦！w*/,vector<int>(c/*横！w*/))
#define INF 1e10
#define MOD 1e9+7
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; }
using Graph = vector<vector<int>>;
signed main(){
  double a,b;
  cin>>a>>b;
  cout<<ceil(a/b)<<endl;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))

d = [0] * n
d[1] = abs(a[0]-a[1])

for i in range(2, len(a)):
    d[i] = min(d[i-1]+abs(a[i]-a[i-1]), d[i-2]+abs(a[i]-a[i-2]))
print(d[-1])    

Measured memory_bytes: 13980
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>

const long long INF = 1e6+7;
const long long MOD = 1e9+7;
const double PI=acos(-1);

using namespace std;

int main(){
	int a,b,c,d,e;
	cin >> a >> b >> c >> d >> e;
	int sum=a+b+c+d+e;
	int ans=15-sum;
	cout << ans << endl;
	return 0;
}


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

namespace algorithm
{
	class Program
	{

		static void Main(string[] args)
		{

			char[] c = Console.ReadLine().ToCharArray();
			char[] d = new char[c.Length * 2];
			char[] tmp = new char[c.Length * 2];
			int[] calc = new int[c.Length-1];
			long sum = 0;
			//初期化
			calc = Array.ConvertAll(calc, x => x = 0);

			for (int i = 0; i < c.Length; i++)
			{
				d[i * 2] = c[i];
				d[i * 2 + 1] = ' ';
			}

			for (int i = 0; i < 1 << calc.Length; i++)
			{
				Array.Copy(d, tmp,d.Length);
				StringBuilder sb = new StringBuilder();
				sb.Append(c[0]);
				for (int j = 0; j < calc.Length; j++)
				{
					//iを右シフトして最下位ビットをチェック
					
					if ((i >> j & 1) == 1)
					{
						sb.Append("+");
					}
					sb.Append(c[j+1]);

				}
				sum += sb.ToString().Split('+').Select(x => long.Parse(x)).ToArray().Sum();
			}
			Console.WriteLine(sum);
		}

		
	}
}


Measured memory_bytes: 13652
/*
Rathin Bhargava
IIIT Bangalore

*/
#include<bits/stdc++.h>
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define pr(v) { for(int i=0;i<v.size();i++) { v[i]==INF? cout<<"INF " : cout<<v[i]<<" "; } cout<<endl;}
#define t1(x)                cerr<<#x<<" : "<<x<<endl
#define t2(x, y)             cerr<<#x<<" : "<<x<<" "<<#y<<" : "<<y<<endl
#define t3(x, y, z)          cerr<<#x<<" : " <<x<<" "<<#y<<" : "<<y<<" "<<#z<<" : "<<z<<endl
#define t4(a,b,c,d)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<endl
#define t5(a,b,c,d,e)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<endl
#define t6(a,b,c,d,e,f)          cerr<<#a<<" : "<<a<<" "<<#b<<" : "<<b<<" "<<#c<<" : "<<c<<" "<<#d<<" : "<<d<<" "<<#e<<" : "<<e<<" "<<#f<<" : "<<f<<endl
#define GET_MACRO(_1,_2,_3,_4,_5,_6,NAME,...) NAME
#define t(...) GET_MACRO(__VA_ARGS__,t6,t5, t4, t3, t2, t1)(__VA_ARGS__)
#define _ cerr<<"here"<<endl;
#define __ {ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);}

using namespace std;
template<class A, class B> ostream& operator<<(ostream& out, const pair<A, B> &a){ return out<<"("<<a.first<<", "<<a.second<<")";}
template <int> ostream& operator<<(ostream& os, const vector<int>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { if(v[i]!=INF) os << v[i]; else os << "INF";if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { os << "["; for (int i = 0; i < v.size(); ++i) { os << v[i]; ;if (i != v.size() - 1) os << ", "; } os << "]\n"; return os; } 

int min(int x, int y)
{
  if(x<y) return x;
  return y;
}

int main()
{
  __;
  int n,w;
  cin >> n >> w;
  vector<vector<int> > dp(2,vector<int> (1e5+10,INF));

  // Base Case
  int weight,value;
  cin >> weight >> value;
  dp[0][value] = weight;
  dp[0][0] = 0;

  for(int i=1;i<n;i++)
  {
    cin >> weight >> value;
    int par = i&1;
    for(int j=0;j<=1e5;j++)
    {
      int a = (j >= value) ? dp[par^1][j-value] + weight: INF;
      if(a > w) a = INF;
      dp[par][j] = min(a,dp[par^1][j]);
    }
  }

  int ans = -1;
  for(int i=0;i<=1e5;i++)
  {
    int par = (n-1)&1;
    if(dp[par][i] - INF && dp[par][i] <= w) ans = i; 
  }
  cout << ans << endl;
  return 0;
}

/*
3 8
3 1
4 2
5 4

*/

Measured memory_bytes: 1408
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#define rep(i,a,b) for(int i=(a);i<b;i++)
#define INF 1000000000
using namespace std;
bool debug=false;

int main(){
  int n;
  int x,tmp;
  cin>>n>>tmp;
  int cnt=0;
  bool up=false,down=false;
  
  for(int i=1;i<n;i++){
    cin>>x;

    if(up==false&&down==false){
      if(tmp<x)up=true;
      else if(tmp>x)down=true;
    }else if(up==true&&down==false){
      if(tmp>x){
	cnt++;
	up=false;
	if(debug)cout<<"count"<<endl;
      }
    }else if(up==false&&down==true){
      if(tmp<x){
	cnt++;
	down=false;
	if(debug)cout<<"COUNT"<<endl;
      }
    }
    tmp=x;
  }
  cout<<cnt+1<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<tuple>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define Per(i,sta,n) for(int i=n-1;i>=sta;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};

int n;
string s[1000010];
ll a[1000010],b[1000010];
vector<int> G[3];

void solve(){
    cin >> n;
    rep(i,n){
        cin >> s[i];
    }
    vector<int> v={};
    rep(i,n){
        v.push_back(i);
        int m=s[i].length();
        ll res=0;
        rep(j,m){
            if(s[i][j]=='(') res+=1;
            else res-=1;
            b[i]=min(b[i],res);
        }
        a[i]=res;
    }
    ll M=0;
    rep(i,n){
        M+=a[i];
    }
    if(M!=0) {
        cout << "No" << endl;
        return;
    }
    sort(v.begin(),v.end(),[](int p,int q){return min(b[p],a[p]+b[q])>min(b[q],a[q]+b[p]);});
    ll mi=0,S=0;
    rep(i,n){
        //cout << v[i] << " " << a[v[i]] << " " << b[v[i]] << endl;
        mi=min(mi,S+b[v[i]]);
        S+=a[v[i]];
    }
    if(mi>=0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

Measured memory_bytes: 54208
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=200010;
const ll mod=1e9+7;

int n;
vector<int> v[mx];
vector<vector<int>> d(2, vector<int>(mx,inf));

void bfs(int i){
  queue<int> q;
  int k = (i==1?n-1:0);                  //0:fennec 0start, 1:snuke n-1start
  q.push(k);
  d[i][k]=0;
  while(!q.empty()){
    int x=q.front();
    q.pop();
    for(auto to:v[x]){
      if(d[i][to]==inf){
        d[i][to]=d[i][x]+1;
        q.push(to);
      }
    }
  }
}

int main() {
  cin >> n;
  rep(i,n-1){
    int a,b; cin >> a >> b; a--; b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  bfs(0);                                   //fennec
  bfs(1);                                   //snuke
  
  int fen=0,snk=0;
  rep(i,n){ if(d[0][i]<=d[1][i]){ fen++; } else { snk++; } }
  if(fen>snk){
    cout << "Fennec" << endl; 
  } else {
    cout << "Snuke" << endl; 
  }
  return 0;
}  


Measured memory_bytes: 9840
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pcc pair<char,char>
#define vi vector <int>
#define vl vector <ll>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d",x)
#define plld(x) printf("%lld",x)
#define pds(x) printf("%d ",x)
#define pllds(x) printf("%lld ",x)
#define pdn(x) printf("%d\n",x)
#define plldn(x) printf("%lld\n",x)
#define INF 2e9
#define INFLL 4e18
using namespace std;
ll powmod(ll base,ll exponent,ll mod){ // with mod < 1e9
	ll ans=1;
	while(exponent){
		if(exponent&1)ans=(ans*base)%mod;
		base=(base*base)%mod;
		exponent/=2;
	}
	return ans;
}
ll gcd(ll a, ll b){
	if(b==0) return a;
	else return gcd(b,a%b);
}
const int upperlimit = 1e6+1;
const int mod = 1e9+7;
struct data{
	int ind,val;
};
bool cmp(data a,data b){
	return (a.val<b.val);
}
int tim[upperlimit];
data deadline[upperlimit];
int main() {
	int n;
	sd(n);
	ll timer=0;
	for(int i = 1; i <= n; i++){
		sd(tim[i]);
		deadline[i].ind=i;sd(deadline[i].val);
	}
	sort(deadline+1,deadline+n+1,cmp);
	bool flag = true;
	for(int i = 1; i <= n; i++){
		timer+=tim[deadline[i].ind];
		if(timer>deadline[i].val) flag=false;
	}
	if(flag) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 5888
var
    s:ansistring;
    i,j:longint;

begin
    readln(s);
    for i := 1 to length(s) do
        if s[i] = 'C' then break;
    for j := i + 1 to length(s) do
        if s[j] = 'F' then
        begin
            writeln('Yes');
            halt;
        end;
    writeln('No');
end.

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define pb push_back
#define mp make_pair
#define fi first
#define se second

int main()
{
	string s;
	cin>>s;
	s.insert(4," ");
	cout<<s<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#define N 100
#define M -1
int fib(int);

int array[N];
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<N;i++)
    {
      array[i]=M;
    }
  printf("%d\n",fib(n));
}

int fib(int x)
{
  if(x==0||x==1)
    {
      return array[x]=1;
    }
  if(array[x]!=M) return array[x];
  else
    {
     return  array[x]=fib(x-2)+fib(x-1);
    }
}

Measured memory_bytes: 2592
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <complex>
using namespace std;

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

#define MAX 21
int brd[MAX][MAX];

int N;

int dx[] = { 0, 0, 1, -1 }; // N S E W
int dy[] = { 1, -1, 0, 0 };
int direc[128];

int main()
{
	direc['N'] = 0;
	direc['S'] = 1;
	direc['E'] = 2;
	direc['W'] = 3;
	while (cin >> N, N) {
		memset(brd, 0, sizeof(brd));
		rep(i, N) {
			int x, y;
			cin >> x >> y;
			brd[y][x] = 1;
		}

		int step;
		cin >> step;
		int x = 10, y = 10;	
		rep(t, step) {
			char d;	int s;
			cin >> d >> s;
			while (s--) {
				x += dx[direc[d]];
				y += dy[direc[d]];
				brd[y][x] = 0;
			}
		}

		int cnt = 0;
		rep(j, MAX) rep(i, MAX)	if (brd[j][i]) cnt++;
		cout << (cnt?"No":"Yes") << endl;
	}
	return 0;
}

Measured memory_bytes: 1152
#include <stdio.h>
#include <iostream>
#include <map>
#include <bits/stdc++.h>
#define LL long long

using namespace std;

const LL mod=1e9 + 7;
map<LL, LL> mp;

/*
int dp[N];
bool check[N];
*/

LL dfs(LL N){
    if(N==0) return 1;
    if(N==1) return 2;
    if(mp[N] > 0) return mp[N];

    return mp[N] = (dfs(N/2) + dfs((N-1)/2) + dfs((N-2)/2)) % mod;
} 

int main(void){
    LL N = 0;
    cin >> N;

    cout << dfs(N) << endl;
    return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10000000)


def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]


# xとyの属する集合の併合
def unite(x, y):
    x = find(x)
    y = find(y)

    if x == y:
        return False
    else:
        # sizeの大きいほうがx
        if par[x] > par[y]:
            x, y = y, x
        par[x] += par[y]
        par[y] = x
        return True


# xとyが同じ集合に属するかの判定
def same(x, y):
    return find(x) == find(y)


# xが属する集合の個数
def size(x):
    return -par[find(x)]


# 初期化
# 根なら-size,子なら親の頂点
N, M = map(int, input().split())
par = [-1] * (N + 1)
ans = 0
for _ in range(M):
    a, b = map(int, input().split())
    unite(a, b)
for i in range(1, N + 1):
    if par[i] < 0:
        ans += 1
# print(par)
print(ans - 1)


Measured memory_bytes: 74468
import sys

S = ""

while True:
    try:
        s = input()
        S += s.lower()
        if s == "":
            break
    except:
        break

dic = dict()

for c in S:
    dic[c] = dic[c] + 1 if c in dic else 1

for i in range(ord("z") - ord("a") + 1):
    c = chr(i + ord("a"))
    v = dic[c] if c in dic else 0

    print("{} : {}".format(c, v))




Measured memory_bytes: 5568
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;
template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	string s, t; cin >> s >> t;
	int mx = 0;
	rep(i, 0, N) {
		string a = s.substr(N - 1 - i, i + 1);
		string b = t.substr(0, i + 1);
		if (a == b) {
			chmax(mx, i + 1);
		}
	}
	cout << 2 * N - mx << "\n";

	return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>

void printRectangle(int H, int W){
    int i,j;
    
    for(i=0; i<H; i++){
        for(j=0; j<W; j++){
            printf("#");
        }
        printf("\n");
    }
    printf("\n");
}

int main(void){
    
    int h,w;
    
    while(1){
        scanf("%d %d", &h, &w);
        if(h==0 && w==0) break;
        printRectangle(h, w);
    }
    return 0;
}

Measured memory_bytes: 572
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sz(a) ll((a).size())
#define all(a) (a).begin(), (a).end()
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPD(i,n) for(int i=(n)-1;i>=0;--i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define FORD(i,a,b) for(int i=(a);i>=(b);--i)
const ll MOD = 1E9+7;
const ll INF = 1E18;
const double EPS = 1E-9;
const double PI = atan(1.0) * 4.0;
template<class T> T getbit(T s, int i) {return s>>i&1;}
template<class T> void flipbit(T& s, int i) {s^=(1LL<<i);}
constexpr int cntbit(ll x) {return __builtin_popcountll(x);}
constexpr int lg2(ll x) {return __lg(x);} // return int(log2(x))
// mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count()); 
ll fpow(ll a,ll p){ll res=1LL;while(p){if(p&1LL) res=res*a%MOD;a=a*a%MOD;p>>=1LL;} return res;}

const int N=1e5+5;
int n,c[N];
vector<pair<int,int>> adj[N];

void dfs(int u,int col,int p){
	c[u]=col;
	for(auto nxt:adj[u])
		if(nxt.fi!=p)
			dfs(nxt.fi,(nxt.se&1)?(col^1):col,u);
}

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>n;
	REP(i,n-1){
		int u,v,w;
		cin>>u>>v>>w;
		adj[u].eb(v,w);
		adj[v].eb(u,w);
	}
	dfs(1,0,-1);
	FOR(i,1,n) cout<<c[i]<<'\n';
}



Measured memory_bytes: 11420
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = n;i >= m;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define ALL(n) n.begin(),n.end()
#define MP make_pair
int s[600000], dp[600000];

int main() {
	ll l[100] = {},n;
	l[0] = 2;
	l[1] = 1;
	FOR(i, 2, 90) l[i] = l[i - 1] + l[i - 2];
	cin >> n;
	cout << l[n] << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <math.h>
#include <algorithm>
#include <map>
#include <vector>
#include <queue>
#include <set>
#include <list>
#include <string>
#include <memory.h>
#include <bitset>
#include <stack>
#include <assert.h>
using namespace std;
#define ll  long long
#define ld long double
#define ppi pair<ll, ll>
#define mp make_pair
const int N = 2e5 + 11, K = 20;
const int mod = 1e9 + 7;
int arr[N];
ll dp[3011][3011];
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
		scanf("%d", arr + i);
	for (int i = 0; i < n; i++)
		dp[i][i] = (n % 2 ? 1 : -1) * arr[i];

	for (int i = n - 1; i >= 0; i--)
		for (int j = 0; j < i; j++)
		{
			ll lhs = dp[j + 1][n - i + j];
			ll rhs = dp[j][n - i + j - 1];
			if (i % 2) dp[j][n - i + j] = max(lhs + arr[j], rhs + arr[n - i + j]);
			else dp[j][n - i + j] = min(lhs - arr[j], rhs - arr[n - i + j]);
		}
	cout << dp[0][n - 1];
}


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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

const ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// head
typedef vector<ll> vec;
typedef vector<vec> mat;

mat zeros(int n, int m) {
    return mat(n, vec(m));
}

mat id(int n) {
    mat ret = zeros(n, n);
    for (int i = 0; i < n; i++)
        ret[i][i] = 1;
    return ret;
}

mat add(mat a, const mat& b) {
    int n = a.size(), m = a[0].size();
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            a[i][j] = (a[i][j] + b[i][j]) % mod;
    return a;
}

mat mul(const mat& a, const mat& b) {
    int n = a.size(), m = a[0].size(), k = b[0].size();
    mat ret = zeros(n, k);
    for (int i = 0; i < n; i++)
        for (int j = 0; j < k; j++)
            for (int p = 0; p < m; p++)
                ret[i][j] = (ret[i][j] + (long long) a[i][p] * b[p][j]) % mod;
    return ret;
}

mat pow(const mat& a, ll p) {
    if (p == 0) return id(a.size());
    mat ret = pow(mul(a, a), p >> 1);
    if (p % 2) ret = mul(ret, a);
    return ret;
}

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

    int n; ll k;
    cin >> n >> k;

    mat adj = zeros(n,n);
    rep(i,0,n) {
        rep(j,0,n) {
            cin >> adj[i][j];
        }
    }
    mat ans = pow(adj,k);
    int a = 0;
    rep(i,0,n) rep(j,0,n) a = (a + ans[i][j]) % mod;
    cout << a << endl;
    return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <queue>
#include <limits>
#include <algorithm>
#include <string>
using namespace std;

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

	vector<int32_t> A(N), B(N), C(N);
	for (int32_t i = 0; i < N; i++)
		cin >> A[i];
	for (int32_t i = 0; i < N; i++)
		cin >> B[i];
	for (int32_t i = 0; i < N; i++)
		cin >> C[i];
	sort(A.begin(), A.end());
	sort(B.begin(), B.end());
	sort(C.begin(), C.end());

	int64_t res = 0;
	for (int32_t i= 0; i < N; i++) {
		decltype(A)::iterator it_A = lower_bound(A.begin(), A.end(), B[i]);
		int64_t cnt_A = it_A == A.end() ? N : it_A - A.begin();

		decltype(C)::iterator it_C = upper_bound(C.begin(), C.end(), B[i]);
		int64_t cnt_C = it_C == C.end() ? 0 : N - (it_C - C.begin());

		res += cnt_A * cnt_C;
	}

	cout << res << endl;

	return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
 typedef long long ll;
 
int main() {
int n,m;
cin>>n>>m;
int s[60][60];
int c[60][60];

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

for(int i=0;i<n;i++){
 int mi=1000000009;
    int k=0;
   for(int j=0;j<m;j++){
       int kari=0;
       kari=abs(s[0][i]-c[0][j])+abs(s[1][i]-c[1][j]);
       if(kari<mi){
           mi=kari;
           k=j+1;
       }
}
cout<<k<<endl;
}
}


Measured memory_bytes: 256
from collections import defaultdict
import sys
sdin = sys.stdin.readline

class UnionFind:
    def __init__(self, node:int) -> None:
        self.n = node
        self.par = [i for i in range(self.n)]
        self.rank = [0 for i in range(self.n)]
        
    def find(self, x:int) -> int:
        if x == self.par[x]:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
        
    def unite(self, x:int, y:int) -> bool:
        if self.isSame(x,y):
            #print("x and y has already united")
            return False
        
        rx = self.find(x)
        ry = self.find(y)
        
        if self.rank[rx] < self.rank[ry]:
            self.par[rx] = ry
        else:
            self.par[ry] = rx
            
            if self.rank[rx] == self.rank[ry]:
                self.rank[rx] += 1
                
        return True
    
    def isSame(self, x:int, y:int) -> bool:
        return self.find(x) == self.find(y)

    

        
N, M = map(int, sdin().split())
P = list(map(int, sdin().split()))
XY = []
for i in range(M):
    XY.append(list(map(int, sdin().split())))


root_node = defaultdict(list)

uf = UnionFind(N)
for x,y in XY:
    x -= 1
    y -= 1
    uf.unite(x,y)

for i in range(N):
    uf.find(i)
    
par = uf.par

for i,root in enumerate(par):
    root_node[root].append(i)
    
ans = 0
for node_list in root_node.values():
    num_list = []
    for i in node_list:
        num_list.append(P[i]-1)
    
    ans += len(set(node_list)&set(num_list))
            
print(ans)


Measured memory_bytes: 56300
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll n;
ll a[305][305];
ll d[305][305];
ll ans;
bool x[305][305];
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            cin>>a[i][j];
            d[i][j]=a[i][j];
            x[i][j]=true;
        }
    }
    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]);
                if(d[i][j]==d[i][k]+d[k][j]&&k!=i&&k!=j){
                    x[i][j]=false;
                    x[j][i]=false;
                }
            }
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(d[i][j]!=a[i][j]){
                cout<<-1<<endl;
                return 0;
            }
        }
    }
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            if(x[i][j]){
                ans+=d[i][j];
            }
        }
    }
    cout<<ans<<endl;

}



Measured memory_bytes: 5124
#include <bits/stdc++.h>
 
using namespace std;
#define endl '\n'
#define MAX 1000001
#define pb push_back
#define mk make_pair
#define ll long long
#define pii pair<int , int >
ll M = 1000000000 + 7;
ll sum[300005][65];
ll pot[63];
int main() {
    pot[0] = 1LL;
    for(int i =1; i<62; i++)
    {
        pot[i] = (pot[i-1] * 2LL)%M;
    }
    //ios_base::sync_with_stdio(false);
    //cin.tie(0);
    int n;
    cin >> n;
    vector<ll> arr;
    ll temp;
    for(int i =0; i<n; i++)
    {
        cin >> temp;
        arr.pb(temp);
    }
    for(int i =0; i< n; i++)
    {
        vector <int> many;
        for(int x=0; x< 61;x++)
        {
            if(((1LL<<x) & arr[i]) == (1LL<<x))
            {
                many.pb(1LL);
            }
            else
            {
                many.pb(0);
            }
        }
        for(int x=0; x< 61; x++)
        {
            if(i!= 0)
            {
                sum[i][x] = sum[i-1][x] + many[x];
            }
            else
            {
                sum[i][x] = many[x];
            }
        }
    }
    ll ans = 0;
    for(int i =1; i< n; i++)
    {
        for(int x=0; x< 61;x++)
        {
            //cout << "sum[i][x] = " << i << " " << x << " " << sum[i][x] << endl;
            if(((1LL<<x) & arr[i]) == (1LL<<x))
            {
                ll times = (1LL*i) - sum[i-1][x];

                ll add = (times*pot[x])%M;
                //cout << "times = " << times << endl;
                //cout << "add= " << add << endl;
                ans = (ans + add)%M;
            }
            else
            {
                ll times = sum[i-1][x];
                ll add = (times*pot[x])%M;
                //cout << "times = " << times << endl;
                //cout << "add= " << add << endl;
                ans = (ans + add)%M;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 155884
object Main extends App {
  import scala.io.StdIn.{readInt, readLine}

  val elevationRate = 0.006
  def averageTemperature(T: Double)(elevation: Int) : Double = T - elevation * elevationRate

  val _ = readInt()
  val Array(t, a) = readLine().split(' ').map(_.toInt)
  val elevations = readLine().split(' ').map(_.toInt)

  val distancesFromA = elevations.map(averageTemperature(t)(_) - a)

  println(distancesFromA.zipWithIndex.minBy(_._1.abs)._2 + 1)
}

Measured memory_bytes: 54908
A, B, C, D = map(int, input().split())

a_cnt = 0
while A > 0:
    A -= D
    a_cnt += 1

t_cnt = 0
while C > 0:
    C -= B
    t_cnt += 1

if t_cnt > a_cnt:
    print("No")
else:
    print("Yes")

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

namespace ABC115A
{
    class Program
    {
        static void Main(string[] args)
        {
            int d;
            d = int.Parse(Console.ReadLine());
            if (d == 25)
                Console.WriteLine("Christmas");
            else if (d == 24)
                Console.WriteLine("Christmas Eve");
            else if (d == 23)
                Console.WriteLine("Christmas Eve Eve");
            else
                Console.WriteLine("Christmas Eve Eve Eve");
            Console.ReadKey();
        }
    }
}

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

using namespace std;

using ll = long long;

#define REP(i,n) for(int i=0;i<n;i++)
#define REPD(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define ALL(v) v.begin(),v.end()
#define INF 1'000'000'000'000 //10^12
#define MOD 1'000'000'007

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  
  int n;
  cin >> n;
  string s[n];
  unordered_map<string,int> cnt;
  REP(i,n){
    cin >> s[i];
    sort(ALL(s[i]));
    cnt[s[i]]++;
  }
  ll sum = 0;
  for(const auto &[key,value] : cnt){
    sum +=(ll)value*(value-1)/2;
  }
  
  cout << sum << endl;
  
  return 0;
}

Measured memory_bytes: 13432
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		String result = null;

		if(N < 1000){
			result = "ABC";
		}else{
			result = "ABD";
		}
		System.out.println(result);
		
	}
}

Measured memory_bytes: 21844
#include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<math.h>
#include<vector>
#include<algorithm>
#include<string.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug" << x << endl;
using namespace std;

int main(){
    char input[10];
    int number[10] = {0};
    int x[10] = {1,9,36,84,126,126,84,36,9,1};
    int sum;
    while(cin >> input){
        sum = 0;
        rep(i,10){
            number[i] = input[i] - '0';
            sum+= (number[i] * x[i]);
        }
        cout << sum % 10 << endl;
    }
}

Measured memory_bytes: 1144
#include<bits/stdc++.h>
#define el endl
#define F(k) for(int i=0;i<k;i++) 
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	if(a+b==15){
		cout<<"+"<<el;
		return 0;
	}
	if(a*b==15){
		cout<<"*"<<el;
		return 0;
	}
	cout<<"x"<<el;
	return 0;
}

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

using ll = long long int;
using vi = vector<int>;
using vll = vector<long long int>;
using vii = vector<vi>;
using pii = pair<int, int>;

#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i, a, b) for(int (i) = a; (i) < (b);(i)++)
#define MAX(a, b) ((a > b) ? a : b)
#define MIN(a, b) ((a > b) ? b : a)

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const int MOD = 1e9 + 7;


int main(){
  int a, b, n; cin >> a >> b >> n;
  REP(i, n){
    if(i % 2 == 0){
      a /= 2;
      b += a;
    }
    else{
      b /= 2;
      a += b;
    }
  }
  cout << a << " " << b << "\n";
  return 0;
}

Measured memory_bytes: 256
k,t=map(int,input().split())
a=list(map(int,input().split()))
# 前回と同じケーキ以外でそのとき最も残り個数が多いものを常に入れていく。
# 前回と同じケーキしか残っていなければそれを入れる。

if t==1:
  print(k-1)
  exit(0)

cakes=[0]*t
for i in range(len(a)):
  cakes[i]=[a[i],i]

cur=-1
ans=0
for i in range(k):
  cakes=sorted(cakes,key=lambda x:x[0])
  if cakes[-1][1]!=cur:
    cakes[-1][0]-=1
    cur=cakes[-1][1]
  else:
    if cakes[-2][0]==0:
      cakes[-1][0]-=1
      cur=cakes[-1][1]
      ans+=1
    else:
      cakes[-2][0]-=1
      cur=cakes[-2][1]
print(ans)

Measured memory_bytes: 3064
import java.util.*;

class Main {
  public static int getPalacePoint(int t, int aveT, List<Integer> hightList) {
    int point = 0;
    double pointT = 9999;
    for(int i = 0; i < hightList.size(); i++) {
      double targetTemperature = (t - (hightList.get(i) * 0.006));
      double diff = targetTemperature - aveT;
      if(diff < 0) {
        diff = -diff;
      }
      if(diff < pointT) {
        point = i;
        pointT = diff;
      }
    }
    return point + 1;
  }
  
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    
    while(scanner.hasNextLine()) {
      int n = Integer.parseInt(scanner.nextLine());
      
      String[] values = scanner.nextLine().split(" ", 0);
      int temperature = Integer.parseInt(values[0]);
      int optTemprerature = Integer.parseInt(values[1]);
      
      String[] hights = scanner.nextLine().split(" ", 0);
      List<Integer> hightList = new ArrayList<Integer>();
      for(String h: hights) {
        hightList.add(Integer.parseInt(h));
      }
      System.out.println(getPalacePoint(temperature, optTemprerature, hightList));
     
    }
  }
}

Measured memory_bytes: 22612
#include <bits/stdc++.h>
typedef long long LL;
using namespace std;

const int maxn = 3005;
int n;
double pro[maxn];
double d;

int32_t main()
{
    // faster_input
    ios:: sync_with_stdio(0), cin.tie(0), cout.tie(0);

    //input
    cin >> n;
    for(int i = 1;i<=n;i++){
        cin >> pro[i];
    }

    // finding the answer


    // array_dp[i][j] --> i coins and j heads
    double dp[maxn][maxn];
    dp[0][0] = 1;
    dp[1][0] = 1 - pro[1];
    for(int i = 1;i<=n;i++){
        dp[0][i] = 0;
    }
    dp[1][0] = 1 - pro[1];
    for(int i = 1;i<=n;i++){
        for(int j = 0;j<=n;j++){
          	if(i == 1 && j == 0){
              continue;
            }
            dp[i][j] = (dp[i-1][j]*(1-pro[i])+dp[i-1][j-1]*pro[i]);
        }
    }




    // output
    double ans = 0;
    d = n;
    d /= 2;
    for(int i = 0;i<=n;i++){
        if(i > d){
            ans += dp[n][i];
        }
    }
    cout << setprecision(10) << fixed << endl;
    cout << ans << endl;

}


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

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int w = sc.NextInt();
        int h = sc.NextInt();
        int n = sc.NextInt();

        bool[,] map = new bool[w, h];

        for (int i = 0; i < n; i++)
        {
            int x = sc.NextInt();
            int y = sc.NextInt();
            int a = sc.NextInt();
            for (int j = 0; j < w; j++)
            {
                for (int k = 0; k < h; k++)
                {
                    switch (a)
                    {
                        case 1:
                            if (j < x)
                            {
                                map[j, k] = true;
                            }
                            break;
                        case 2:
                            if (j >= x)
                            {
                                map[j, k] = true;
                            }
                            break;
                        case 3:
                            if (k < y)
                            {
                                map[j, k] = true;
                            }
                            break;
                        case 4:
                            if (k >= y)
                            {
                                map[j, k] = true;
                            }
                            break;
                    }

                }
            }
        }

        int answer = 0;
        for (int i = 0; i < w; i++)
        {
            for (int j = 0; j < h; j++)
            {
                if (map[i, j] == false)
                {
                    answer++;
                }
            }
        }

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 11200
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

//typedef pair<int,int> P;

int main(){
	char a[101], s[101], b[101];

	scanf("%s", a);
	scanf("%s", s);
	scanf("%s", b);

	printf("%c%c%c\n",a[0],s[0],b[0]);

	return 0;
}


Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
int n;
bool cmp(pair < int, int >& a, pair < int, int >& b) {
    return a.second < b.second;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    //freopen("input.txt", "r", stdin);
    vector < pair < int, int > > all;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int x, l;
        cin >> x >> l;
        all.emplace_back(x - l, x + l);
    }
    sort(all.begin(), all.end(), cmp);
    int lst = -1e9 - 100;
    int cnt = 0;
    for (auto it : all) {
        if (it.first >= lst) {
            cnt++;
            lst = it.second;
        }
    }
    cout << cnt;
    return 0;
}

Measured memory_bytes: 1400
N = int(input())
numbers = list(map(int, input().split()))

def gcd(a, b):
  r = a % b
  while (r > 0):
    a = b
    b = r
    r = a % b
  return b

gcd_forward = [numbers[0]]
for i in range(1, N - 1):
  gcd_all = gcd(gcd_forward[-1], numbers[i])
  gcd_forward.append(gcd_all)

gcd_backward = [numbers[-1]]
for i in range(N - 2, 0, -1):
  gcd_all = gcd(gcd_backward[-1], numbers[i])
  gcd_backward.append(gcd_all)

gcd_max = 1
for i in range(N):
  gcd_temp = 1
  if (i == 0):
    gcd_temp = gcd_backward[-1]
  elif (i == N - 1):
    gcd_temp = gcd_forward[-1]
  else:
    gcd_temp = gcd(gcd_forward[i - 1], gcd_backward[N - 2 - i])
  gcd_max = max(gcd_max, gcd_temp)
  
print(gcd_max)


Measured memory_bytes: 14452
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1e9
#define LINF 1e18
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
#define int long long
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
struct edge{int to,cost;};
typedef pair<int,int> P;

bool isupper(char c){if('A'<=c&&c<='Z')return 1;return 0;}
bool islower(char c){if('a'<=c&&c<='z')return 1;return 0;}
bool isPrime(int x){if(x==1)return 0;if(x==2)return 1;if(x%2==0)return 0;for(int i=3;i*i<=x;i++)if(x%i==0)return 0;return 1;}
bool iskaibun(string s){for(int i=0;i<s.size()/2;i++)if(s[i]!=s[s.size()-i-1])return 0;return 1;}
bool isnumber(char c){return ('0'<=c&&c<='9');}
bool isalpha(char c){return (isupper(c)&&islower(c));}
void print(vector<int> v){rep(i,0,v.size()){if(i)cout<<" ";cout<<v[i];}cout<<endl;}
void printl(vector<int> v){rep(i,0,v.size()){cout<<v[i]<<endl;}}


signed main (){
    int r,b;
    r=b=0;
    int n;cin>>n;
    string s;cin>>s;
    rep(i,0,n){
        if(s[i]=='R')r++;
        else b++;
    }
    if(r>b)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    



}


/*
*/


Measured memory_bytes: 256
import statistics
N = int(input())
X = list(map(int,input().split()))
P = int(statistics.mean(X))
b = 0
for i in range(0,N):
    b = b + (X[i] - P) ** 2

while True:
    bb = 0
    P = P + 1
    for i in range(0,N):
        bb = bb + (X[i] - P) ** 2
    if b < bb:
        break
    elif b > bb:
        b = bb
print(b)

Measured memory_bytes: 5660
#include <stdio.h>

int main(void)
{
  int a = 0;
  int b = 0;
  int c = 0;

  scanf("%d %d %d", &a, &b, &c);

  if(a < b)
    if(b < c)
      printf("Yes\n");
    else
      printf("No\n");
  else  
    printf("No\n");

  return 0;
}

Measured memory_bytes: 580