akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1000000000000
int MOD=1000000007;
struct edge {
    int to, cost;
};

int modpow(int a,int x){
  if(a<0)a+=MOD;
  int ans=1;
  while(x>0){
    if(x&1) ans=ans*a%MOD;
      a=a*a%MOD;
      x>>=1;
  }
  return ans;
}

int gyaku(int n){
    return modpow(n,MOD-2);
}

map<int,int> factor(int n){
  map<int,int>res;
  for(int i=2;i*i<=n;i++){
      for(; n%i==0;n/=i) res[i]++;
  }
  if(n>1)res[n]++;
  return res;
}
////////////////////////////////////////////////////////////

signed main() {
  int a,b,c;
  cin>>a>>b>>c;
  int k;
  cin>>k;
  int count=0;
  while(a>=b){
    count++;
    b*=2;
  }
  while(b>=c){
    count++;
    c*=2;
  }
  if(count<=k)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 3596
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;
long long n,m,d,k;
double ans,z;
int main(){
	cin>>n>>m>>d;
	ans=2*(n-d)*(m-1);
	z=(n*n);
	z=1/z;
	ans*=z;
	if(d==0) {
		z=n;
		z=1/z;
		ans=z*(m-1);
//		ans/=2;
	}
	printf("%.10lf",ans);
	return 0;
}

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

int main()
{
    int N, M, X, Y;
    int x[100];
    int y[100];
    bool War_flag = true;
    
    cin >> N >> M >> X >> Y;
    for(int i=0; i<N; i++)
    {
    	cin >> x[i];
    }
    for(int j=0; j<M; j++)
    {
    	cin >> y[j];
    }

    int a = x[0];
    int b = y[0];

    // maximum of x
    for(int i=1; i<N; i++)
    {
       	if (a<x[i])
        {
       	 	a = x[i];
       	}
    }

    // minimum of y
    for(int j=1; j<M; j++)
    {
        if (b>y[j])
        {
         	b = y[j];
        }
    }
    


    for(int Z=X+1; Z<=Y; Z++)
    {
       if(a<Z && b>= Z)
       {
       	  War_flag = false;
       	  break;
       }             
    }



    if(War_flag)
    {
        cout << "War" << endl;
    }

    else
    {
    	cout << "No War" << endl;
    }     


	return 0;
    
    
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const int INF=1000000001;
const double PI=3.141592653589;


int main(){
  int n,m,x; cin>>n>>m>>x;
  x--;
  vector<bool> a(n+1);
  int ans1=0;
  int ans2=0;
  rep(i,m){
    int m; cin>>m;
    m--;
    if(m<x)
    ans1++;
    else
    ans2++;
  }
  ans1=min(ans1,ans2);
  cout<<ans1<<endl;

  return 0;

}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    ll n, k;
    cin >> n >> k;
    vl a(n);
    map<int, vi> pos;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        pos[a[i]].push_back(i);
    }
    int curr = 0;
    ll loop = 0;
    while (loop < k - 1) {
        auto it = upper_bound(pos[a[curr]].begin(), pos[a[curr]].end(), curr);
        if (it == pos[a[curr]].end()) {
            loop++;
            curr = pos[a[curr]].front() + 1;
        } else {
            curr = *it + 1;
        }
        if (curr == n) {
            loop++;
            loop += (k - 1 - loop) / loop * loop;
            curr = 0;
        }
    }
    vector<ll> ret;
    map<ll, int> cnt;
    for (int i = curr; i < n; ++i) {
        ret.push_back(a[i]);
        cnt[a[i]]++;
        if (cnt[a[i]] == 2) {
            while (cnt[a[i]] > 0) {
                cnt[ret.back()]--;
                ret.pop_back();
            }
        }
    }
    print(ret);
    return 0;
}

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

using namespace std;

int main(){
    long long int X,Y;
    cin >> X >> Y;

    if(Y==1){
        cout << 0 << endl;
    }else{
    
        for(int i=1;i<100;i++){
            if(Y<=X*i-(i-1)){
                cout << i << endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 256
def gcd(a, b):
    
    if a == b:
        return a
    
    small = large = 0
    if a > b:
        small = b
        large = a
    else:
        small = a
        large = b
    
    while True:
        
        d, m = divmod(large, small)
        if m == 0:
            return small
        else:
            large = small
            small = m
    
    
    

def get_next_int():
    return int(float(input()))
def get_next_ints(delim=" "):
    return tuple([int(float(x)) for x in input().split(delim)])

def main():
    n = get_next_int()
    numbers = get_next_ints()
    
    current = numbers[0]
    candidates = {numbers[1]}
    
    for number in numbers[1:]:
        
        next_candidates = {}
        for candidate in candidates:
            next_candidates[gcd(candidate, number)] = 1
        candidates = next_candidates
        #print(candidates.keys())
        candidates[current] = 1
        current = gcd(current, number)    
    
    print(max(candidates.keys()))
    
if __name__ == '__main__':
    main()


Measured memory_bytes: 14428
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author teiwa
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int M = in.nextInt();
            int C = in.nextInt();
            int B[] = new int[M];
            for (int i = 0; i < M; i++) {
                B[i] = in.nextInt();
            }
            int[][] A = new int[N][M];
            for (int i = 0; i < N; i++) {
                for (int j = 0; j < M; j++) {
                    A[i][j] = in.nextInt();
                }
            }

            int counter = 0;
            for (int i = 0; i < N; i++) {
                int point = 0;
                for (int j = 0; j < M; j++) {
                    point += A[i][j] * B[j];
                }
                if (point + C > 0) {
                    counter++;
                }
            }
            out.println(counter);
        }

    }
}



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

#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ll long long
#define bit __builtin_popcountll
#define sqr(x) (x) * (x)
#define forit(it,S) for(__typeof((S).begin()) it = (S).begin(); it != (S).end(); it++)
#define debug(x) cout << #x <<" = " << x << endl
#define forn(i, n) for(int i = 0 ; (i) < (n) ; ++i)
#define printvpair(v) for(int i = 0 ; (i) < (v.size()) ; ++i) cout << v[i].first  <<" " << v[i].second << endl;
#define printv(v) for(int i = 0 ; (i) < (v.size()) ; ++i) cout << v[i] << " "; cout << endl;

using namespace std;

typedef pair<int, int> pii;

const double eps = 1e-9;
const double pi = acos(-1.0);
const int INF = 1000000000;

const int dx[4] = {0,  0, 1, -1};
const int dy[4] = {1, -1, 0,  0};

const int N = 100;
char a[N][N],b[N][N];
int n,m;
bool cmp(int x,int y){
	int x1 = x + m;
	int y1 = y + m;
	for(int i = 0,i1 = x; i < m && i1 < x1; i++,i1++)
		for(int j = 0,j1 = y; j < m && j1 < y1; j++,j1++)
			if (b[i][j] != a[i1][j1])
				return false;
	return true;
}
int main() {
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	forn(i,n) forn(j,n) cin >> a[i][j];
	forn(i,m) forn(j,m) cin >> b[i][j];
	
	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++){
			if (cmp(i,j)){
				cout << "Yes\n";
				return 0;
			}
		}
	cout << "No\n";
  	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

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

    ll n; cin>>n;

    if(n % 2 == 1) cout << 0 << endl;
    else{
        ll num = 10;
        ll sum = 0;
        while(n >= num){
            sum += (n / num);
            num *= 5;
        }
        cout << sum << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
static const int N=1000;

void trace(int A[], int n){
  int i;
  
  for(i=1;i<=n;i++)
    {
      if(i>1)printf(" ");
      printf("%d",A[i-1]);
    }
  printf("\n");
}

int main()
{
  int i,j,v,n;
  int A[N+1];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d",&A[i]);
    }
  for(i=1;i<n;i++)
    {
      trace(A,n);
      v=A[i];
      j=i-1;
      while(j>=0 && A[j]>v)
	{
	  A[j+1]=A[j];
	  j--;
	  A[j+1]=v;
	}
    }
  trace(A,n);
  return 0;
}

Measured memory_bytes: 608
#include <iostream>
#include <climits>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;

int INF = 1<<29;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする



int main(){
	int n,l,i;
	cin>>n>>l;
	string s[101];
	for(i=0;i<n;i++){
		cin>>s[i];
	}
	sort(s,s+n);
	for(i=0;i<n;i++){
		cout<<s[i];
	}
	cout<<endl;
	return 0;

}

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

int main () {
  vector<string> N = {"1","2","3","4","5","6","7","8","9"};
  int K;
  cin >> K;
  if (K <= 9) {cout << N[K-1]; return 0;}

  int start =0;
  int end = 8;
  int nextEnd=end;
  while (true) {
    for (int i = start;i <= end;i++ ){
      char endOfString=N[i][N[i].length()-1];

      if (endOfString  != '0') {
          N.push_back(N[i] + (char)((int)endOfString -1));
          nextEnd++;
          if (K-1 == nextEnd) {
            cout << N[K-1]; return 0;
          }
        }
      N.push_back(N[i] + endOfString);
      nextEnd++;
      if (K-1 == nextEnd) {
        cout << N[K-1]; return 0;
      }
      if (endOfString != '9') {
        N.push_back(N[i] + (char)((int)endOfString + 1));
        nextEnd++;
        if (K-1 == nextEnd) {
          cout << N[K-1]; return 0;
        }
      }
    }
    start = end+1;
    end=nextEnd;
  }

return 0;
}


Measured memory_bytes: 6916
#include<iostream>
int main(){
	int N;
	std::cin>>N;
	long int* A=new long int[N];
	long sum=0;
	for(int i=0;i<N;i++){
		std::cin>>A[i];
		sum+=A[i];
		sum%=1000000007;
	}
	long ans=0;
	for(int i=0;i<N;i++){
		sum-=A[i];
		if(sum<0){
			sum+=1000000007;
		}
		ans+=sum*A[i];
		ans%=1000000007;
	}
	std::cout<<ans;
	return 0;
}


Measured memory_bytes: 4692
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;

int kousa[17][17],memo[17][17],a,b,n;

int ans(int x,int y){
    int re=0;
    
    if(kousa[x][y])
        return 0;
    
    if(memo[x][y])
        return memo[x][y];
    
    if(x<a)
        re+=ans(x+1,y);
    if(y<b)
        re+=ans(x,y+1);
    
    return re;
}

int main(){
    int xin,yin;
    
    while(1){
    scanf("%d%d%d",&a,&b,&n);
        
    if(a+b==0) break;
    
    for(int i=0;i<17;i++)
        for(int j=0;j<17;j++){
            kousa[i][j]=0;
            memo[i][j]=0;
        }
    
    memo[a][b]=1;
    
    for(int i=0;i<n;i++){
        scanf("%d%d",&xin,&yin);
        kousa[xin][yin]=1;
    }
    
    printf("%d\n",ans(1,1));
    
    }
    return 0;
}

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

int main(){
  int n;
  cin>>n;
  vector<int> p(n);
  for(int i=0; i<n; i++){
    cin>>p[i];
  }
  int cnt=0;
  for(int i=0; i<n-2; i++){
    if(p[i+1]!=min({p[i],p[i+1],p[i+2]})&&p[i+1]!=max({p[i],p[i+1],p[i+2]})){
      cnt++;
    }
  }
  cout<<cnt<<endl;
}

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

int main()
{
    int n, x, y;
    cin >> n >> x >> y;
    x--; y--;
    
    vector<int> ans(n, 0);
    
    for(int i = 0; i < n - 1; ++i) {
        for(int j = i+1; j < n; ++j) {
            int dist = abs(j - i);
            dist = min(dist, abs(i - x) + 1 + abs(y - j));
            dist = min(dist, abs(i - y) + 1 + abs(x - j));
            ans[dist]++;
        }
    }
    
    for(int i = 1; i < n; ++i){
        cout << ans[i] << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
int main() {
  int A, B;
  cin >> A >> B;
  double al = A / 0.08;
  double ar = (A+1) / 0.08;
  double bl = B / 0.10;
  double br = (B+1) / 0.10;
  int ans = max(ceil(al), ceil(bl));
  if(al <= ans && ans < ar && bl <= ans && ans < br) cout << ans << endl;
  else cout << -1 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define si set <ll>
#define vi vector <ll>
#define popcount(x) __builtin_popcountll(x)
#define mii map <ll,ll>
#define vpi vector <pair <ll,ll> >
#define sz(c) (int)c.size()
#define fr first
#define ll long long
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define mem0(a) memset(a,0,sizeof(a))
#define rep(i,a,n) for(ll i=a ; i<n ; i++)
#define ld long double
#define rall(a) (a).rbegin(),(a).rend()
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")



ll power(ll b,ll e,ll m)
{
  if(b==0) return 0;
  if(e==0) return 1;
  if(e&1) return b*power(b*b%m,e/2,m)%m;
  return power(b*b%m,e/2,m);
}
ll power( ll b, ll e)
{
  if(b==0) return 0;
  if(e==0) return 1;
  if(e&1) return b*power(b*b,e/2);
  return power(b*b,e/2);
}  
bool isPowerOfTwo(ll x)
{
    // x will check if x == 0 and !(x & (x - 1)) will check if x is a power of 2 or not
    return (x && !(x & (x - 1)));
}


void solve()
{
  ll n;
  cin>>n;
  vi v(n);
  rep(i,0,n) cin>>v[i];
  ll ans=0;
  rep(i,0,n-1)
  {
    if(v[i+1]<v[i])
    {
      ans+=abs(v[i+1]-v[i]);
      v[i+1]+=abs(v[i+1]-v[i]);
    }
  }
  // for(auto i:v) cout<<i<<" ";
  cout<<ans;
}

int main()
{
  fastio
  ll tt=1;
  // cin>>tt;
  while(tt--)
  {
    solve();
    // cout<<"\n";
  }
}

Measured memory_bytes: 4760
using System;
using System.Linq;
using System.Collections.Generic;

namespace program
{
    class Program
    {
        static void Main()
        {
          int[] a = Input.ScanIntArray();
          Console.WriteLine(Math.Min(a[1]/a[0],a[2]));
        }
    }

    static class Input
    {
        static public int ScanInt() { return int.Parse(Console.ReadLine()); }
        static public uint ScanUint() { return uint.Parse(Console.ReadLine()); }
        static public double ScanDouble() { return double.Parse(Console.ReadLine()); }
        static public long ScanLong() { return long.Parse(Console.ReadLine()); }
        static public ulong ScanUlong() { return ulong.Parse(Console.ReadLine()); }
        static public int[] ScanIntArray() { return Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); }
        static public uint[] ScanUintArray() { return Console.ReadLine().Split(' ').Select(x => uint.Parse(x)).ToArray(); }
        static public double[] ScanDoubleArray() { return Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray(); }
        static public long[] ScanLongArray() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray(); }
        static public ulong[] ScanUlongArray() { return Console.ReadLine().Split(' ').Select(x => ulong.Parse(x)).ToArray(); }

        static public string ScanStr() { return Console.ReadLine(); }
        static public string[] ScanStrArray() { return ScanStr().Split(' '); }
    }

    static class MyMath
    {
        public static int GCD(int a, int b)
        {
            Func<int, int, int> gcd = null;
            gcd = (x, y) => y == 0 ? x : gcd(y, x % y);
            return a > b ? gcd(a, b) : gcd(b, a);
        }
        public static ulong GCD(ulong a, ulong b)
        {
            Func<ulong, ulong, ulong> gcd = null;
            gcd = (x, y) => y == 0 ? x : gcd(y, x % y);
            return a > b ? gcd(a, b) : gcd(b, a);
        }
        public static int LCM(int a, int b)
        {
            return a * b / GCD(a, b);
        }
        public static ulong LCM(ulong a, ulong b)
        {
            return a * b / GCD(a, b);
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 2e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;

int A[110];
int B[110];
int C[110];

int main()
{
    int n,m,k,a,b,x,y,q;
    int sum = 0;
    int cnt = 0;
    int mx = 0;
    int mn = INF;
    int cur = 0, idx = -1;
    int tc;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n;

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

    for(int i=1;i<=n;i++)A[i] = INF;

    for(int i=1;i<n;i++){
        A[i] = min(A[i],B[i]);
        A[i+1] = min(A[i+1],B[i]);
    }

    for(int i=1;i<=n;i++)
        sum+=A[i];

    cout<<sum<<"\n";

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n; cin>>n;
  int arr[n][3];
  for(int i=0;i<n;i++) 
    cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
  int ans[n][3]; 
  ans[0][0]=arr[0][0]; ans[0][1]=arr[0][1];ans[0][2]=arr[0][2];
  for(int i=1;i<n;i++){
      ans[i][0]=max(ans[i-1][1]+arr[i][0],ans[i-1][2]+arr[i][0]);
      ans[i][1]=max(ans[i-1][0]+arr[i][1],ans[i-1][2]+arr[i][1]);
      ans[i][2]=max(ans[i-1][0]+arr[i][2],ans[i-1][1]+arr[i][2]);
  }
  cout<<max(ans[n-1][0],max(ans[n-1][1],ans[n-1][2]));
  return 0;
}

Measured memory_bytes: 2560
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String[] line = bf.readLine().split(" ");
        int T = Integer.parseInt(line[0]);
        line = bf.readLine().split(" ");
        double[] in = new double[T];
        for (int i = 0; i < T; i++) {
            in[i] = Double.parseDouble(line[i]);
        }
        double[] dp = new double[T + 1];
        dp[0] = 1;
        for (int i = 1; i <= T; i++) {
            dp[i] = dp[i - 1] * in[i - 1];
            for (int j = i - 1; j > 0; j--) {
                dp[j] = dp[j] * (1 - in[i - 1]) + dp[j - 1] * in[i - 1];
            }
            dp[0] = dp[0] * (1 - in[i - 1]);
        }
        double ans = 0;
        for(int i = T/2+1; i<=T;i++) {
            ans += dp[i];
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 24660
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INF = 1000000007;
const int mod = 1000000007;

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

//----------------------------------------------------------------

int main()
{
    long long n, k;
    cin >> n >> k;
    int a;
    vector<int> p(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        p[i] = ((1 + a) * 10) / 2;
    }
    vector<int> ruiseki(n + 1);
    for (int i = 0; i < n; i++)
    {
        ruiseki[i + 1] = ruiseki[i] + p[i];
    }
    int ans = -INF;
    for (int i = k; i <= n; i++)
    {
        chmax(ans, ruiseki[i] - ruiseki[i - k]);
    }
    double final = ((double)ans) / 10;
    cout << fixed << setprecision(12) << final << endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
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; }
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e18)
#define PI (acos(-1))
#define MOD (1000000007)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1}; // 移動方向

int a,b,q;
vector<ll> s,t,x;

void input(){
    cin >> a >> b >> q;
    s.resize(a);
    t.resize(b);
    x.resize(q);
    for(int i=0;i<a;++i) cin >> s[i];
    for(int i=0;i<b;++i) cin >> t[i];
    for(int i=0;i<q;++i) cin >> x[i];
    s.push_back(-INF);
    s.push_back(INF);
    t.push_back(-INF);
    t.push_back(INF);
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    ll rec;
    for(int i=0;i<q;++i){
        int temple = lower_bound(t.begin(), t.end(), x[i]) - t.begin();
        int shrine = lower_bound(s.begin(), s.end(), x[i]) - s.begin(); // x[i]に一番近い神社と寺のindex
        rec = INF+1;
        for(int j=0;j<2;j++){
            for(int k=0;k<2;k++){
                chmin(rec, llabs(s[shrine-j]-x[i])+llabs(t[temple-k]-s[shrine-j]));
                chmin(rec, llabs(t[temple-k]-x[i])+llabs(s[shrine-j]-t[temple-k]));
            }
        }
        cout << rec << endl;
    }
    return 0;
}

Measured memory_bytes: 3680
#include <bits/stdc++.h>
#include<iostream>
#include<vector>
#include<map>
#include<math.h>

#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,n,a) for(int i = (int)(n); i >= (int)(a); i--)

#define fi first
#define se second

using namespace std;

using ll = long long;
using v_int = vector<int>;
using v2_int = vector<v_int>;
using v_ll = vector<ll>;
using v2_ll = vector<v_ll>;
using v_string = vector<string>;
using v_bool = vector<bool>;
using v2_bool = vector<v_bool>;
using pii = pair<int, int>;
using mii = map<int, int>;

const double PI = 3.1415926535897932;
const int INF = (int)2e9;
const ll LINF = (ll)2e18;
const ll MOD = 1000000007;
const int dc[8] = {1, -1, 0,  0, 1, -1,  1, -1};
const int dr[8] = {0,  0, 1, -1, 1,  1, -1, -1};

template<typename T, typename U> inline
ostream& operator<<(ostream &o, pair<T,U> &p) {
    return o << "{" << p.first << "," << p.second << "}";
}
template<typename T> inline
istream& operator>>(istream &is, vector<T> &vec) {
    for(auto &v : vec) { is >> v; }
    return is;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<T> &vec) {
    for(auto &v : vec) { os << v << ",";}
    return os;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<vector<T> > &mat) {
    for(auto &row : mat) { os << row << endl; }
    return os;
}

template<typename T> inline
void chmin(T &a, T b) { a = min(a, b); }
template<typename T> inline
void chmax(T &a, T b) { a = max(a, b); }

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

    int ans = max(a+b,a-b);
    cout << max(ans, a*b) << endl;
    return 0;
} /*atcoder*/



Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;

int main(){
    string s; cin >> s;
    int ans = 0;
    if(s == "RRR") cout << 3 << endl;
    else if(s == "RRS" || s == "SRR") cout << 2 << endl;
    else if(s == "SSS") cout << 0 << endl;
    else cout << 1 << endl;
}

Measured memory_bytes: 3628
#include<stdio.h> 
int main()
{
	char ch[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	int m;
	char n;
	scanf("%c",&n);
	for(m=0;m<26;m++)
	{
		if(ch[m]==n)
		printf("%c",ch[m+1]);		
	}
	return 0;

}
		
	


Measured memory_bytes: 128
#include <stdio.h>
#define a 100
#define n 100

int bubbleSort(int A[], int N){
    int flag = 1;
    int j = 0;
    int count = 0;
    int tmp = 0;
    int t = 0;
    
    while(flag == 1){
        flag = 0;
        for(j = N-1; j > 0; j--){
            if(A[j] < A[j-1]){
                tmp = A[j];
                A[j] = A[j-1];
                A[j-1] = tmp;
                count++;
                flag = 1;
            }
        }
    }
    
    for(t = 0; t < N; t++){
        if(t == N-1){
            printf("%d\n", A[t]);
        }else{
            printf("%d ", A[t]);
        }
    }
    printf("%d\n", count);
}

int main(void){
    int A[a] = {};
    int N = 0;
    int i = 0;
    
    scanf("%d", &N);
    for(i = 0; i < N; i++){
        scanf("%d", &A[i]);
    }
    
    bubbleSort(A, N);
    
    return 0;
}

Measured memory_bytes: 600
#include<iostream>
#include<string>
using namespace std;
int main(){
  string a,b,c;
  cin>>a>>b>>c;
  
  char d=a.at(0),e=b.at(0),f=c.at(0);
  char rr=d-32,ee=e-32,ff=f-32;
  cout<<rr<<ee<<ff;
  
  return 0;
}


Measured memory_bytes: 3052
q=int(raw_input())
for i in range(q):
	a,b=map(int,raw_input().split())
	p=int((a*b-1)**0.5)
	if p*p>a*b-1:
		p=p-1
	r=p*2-1
	if p*p+p>a*b-1:
		r=r-1
	if a==b:
		r=r+1
	print r



Measured memory_bytes: 2568
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
typedef long long ll;
const int MOD = 1000000007;
const int INF = 2002002002;
#define PI 3.141592653589
// 4方向探索用ベクトル
const int di[] = { -1, 0, 1, 0 };
const int dj[] = { 0, -1, 0, 1 };
using namespace std;

int main() {
	int h, w;
	cin >> h >> w;
	vector<string> s(h);
	for (int i = 0; i < h; i++)
		cin >> s[i];
	int ans = 0;
	// 始点探索
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (s[i][j] == '#')
				continue;
			// ある定めた始点からs[i][j]までの最短距離
			vector<vector<int>> dist(h, vector<int>(w, INF));
			queue<pair<int, int>> q;
			// 更新されていないマスを距離xで更新し、queueに入れる関数
			auto update = [&](int i, int j, int x) {
				// autoを使う利点は、main内で定義した配列を参照できる点
				if (dist[i][j] != INF)
					return;
				dist[i][j] = x;
				q.push(make_pair(i, j));
			};
			// 始点を0で更新
			update(i, j, 0);
			while (!q.empty()) {
				// queueの先頭を保存し、取り出す
				int nowi = q.front().first;
				int nowj = q.front().second;
				q.pop();
				// 4方向探索
				for (int dir = 0; dir < 4; dir++) {
					// nowの隣接
					int nexti = nowi + di[dir];
					int nextj = nowj + dj[dir];
					// 隣接が定義範囲内か判定
					if (nexti < 0 || nexti >= h || nextj < 0 || nextj >= w)
						continue;
					// 隣接が障害物マスならqueueには入れない
					if (s[nexti][nextj] == '#')
						continue;
					// updateは、既に更新されているかどうかの判定を含む
					update(nexti, nextj, dist[nowi][nowj] + 1);
				}
			}
			for (int k = 0; k < h; k++) {
				for (int l = 0; l < w; l++) {
					if (dist[k][l] == INF)
						continue;
					ans = max(ans, dist[k][l]);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}


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

int main(){
    int K;
    cin >> K;

    string S ,T;
    cin >> S;

    if(S.size()<K|| S.size()==K){
        cout << S <<endl;
    }else{
        for(int i=0; i<K; i++){
            T+=S.at(i);
        }
        cout << T << "..." << endl;
    }
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template < typename T > string tost( const T& n ) { ostringstream stm; stm << n; return stm.str();}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
int const INF = 1001001001;


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

int MAX = 101010;
vi is_prime(MAX,1);
is_prime[0] = 0; is_prime[1] = 0;
for(int i = 2; i < MAX; ++i) {
    if(!is_prime[i]) continue;
    for(int j = i*2; j < MAX; j += i) is_prime[j] = 0;
}

// a[i]:= iが2017に似た数ならば1でそうでないなら0を入れる
vi a(MAX,0);
rep(i,MAX) {
    if(i % 2 == 0) continue;
    if(is_prime[i] && is_prime[(i+1)/2]) a[i] = 1;
}
// 累積和 s[i]:= [0,i)に含まれる2017に似た数の個数
vi s(MAX+1,0);
rep(i,MAX) s[i+1] = s[i] + a[i];

int Q;
cin >> Q;
while(Q--) {
    int l,r;
    cin >> l >> r;
    r++;
    cout << s[r] - s[l] << endl;
}
return 0;
}

Measured memory_bytes: 1792
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vvi G(3*n);
    auto add = [&](int i, int j) {
        G[i*3].push_back(j*3+1);
        G[i*3+1].push_back(j*3+2);
        G[i*3+2].push_back(j*3);
    };
    rep(i, m) {
        int u, v;
        cin >> u >> v;
        --u;
        --v;
        add(u, v);
    }

    int s, t;
    cin >> s >> t;
    s--; t--;

    vi dist(3*n, -1);
    dist[s*3] = 0;
    queue<int> q;
    q.push(s*3);
    while(!q.empty()) {
        int now = q.front();
        q.pop();
        for(int ne:G[now]) {
            if(dist[ne] != -1) continue;
            dist[ne] = dist[now] + 1;
            q.push(ne);
            if(ne == t*3) {
                while(!q.empty()) {
                    q.pop();
                }
                break;
            }
        }
    }
    if(dist[3*t] > 0) {
        dist[3*t] /= 3;
    }
    cout << dist[3*t] << endl;
}

Measured memory_bytes: 20884
#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;

int main() {
int N;
cin >> N;
if (N == 1) cout << "Hello World" << endl;
else {
    int A,B;
    cin >> A >> B;
    cout << A+B << endl;
}



return 0;
}


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

void solve() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> jobs(100001);
    rep(i, n) {
        int a, b;
        cin >> a >> b;
        jobs[a].push_back(b);
    }

    int ans = 0;
    priority_queue<int> pq;
    for (int i = 1; i <= m; i++) {
        rep(j, jobs[i].size()) pq.push(jobs[i][j]);
        if (!pq.empty()) {
            // cout << i << " " << pq.top() << endl;
            ans += pq.top();
            pq.pop();
        }
    }

    cout << ans << endl;
}

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


Measured memory_bytes: 5632
#include <iostream>
using namespace std;
long long solve(long long a,long long b,long long s,long long temp){
	long long ans1,ans2;
	if((a%2==0)+(b%2==0)){
		ans1=a*b/2;
		ans2=a*b/2;
	}else{
		if(a<=b){
			ans1=a*(b/2+1);
			ans2=a*(b/2);
		}else{
			ans1=b*(a/2+1);
			ans2=b*(a/2);
		}
	}
	long long temp2;
	if(ans1<s){
		temp2=s-ans2;
	}else{
		if(ans2<s){
			temp2=ans1-ans2;
		}else{
			temp2=ans1-s;
		}
	}
//	cout<<temp<<' '<<temp2<<endl;
	if(temp<temp2){
		return temp;
	}else{
		return temp2;
	}
}

int main() {
	long long h,w;cin>>h>>w;
	long long ans=1;
	for(int i=0;i<10;i++)ans*=10;
	ans=solve(h,w-(w/3),h*(w/3),ans);
	ans=solve(h,w-(w/3+1),h*(w/3+1),ans);
	ans=solve(h-(h/3),w,(h/3)*w,ans);
	ans=solve(h-(h/3+1),w,(h/3+1)*w,ans);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<functional>
#include<algorithm>
#include<cstring>
using namespace std;
int main(void)
{
	int i,n;
	double sum,x;
	char u[4];
	scanf("%d",&n);
	sum=0.0;
	for(i=0;i<n;i++)	{
		scanf("%lf %s",&x,u);
		if(strcmp(u,"JPY")==0)	sum+=x;
		else sum+=x*380000.0;
	}
	printf("%lf\n",sum);
	return 0;
}


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


int main(){
  long h,w,i,j,x,y,ans=0,jud;
  cin >> h >> w;
  long a[h][w],b[h][w];
  jud=h*w;
  char c;
  long check[h*w],check2[h*w];
  long cur=0, cur2=0;
  
  for(i=0; i<h*w; i++){
    y=i/w; x=i%w;
    cin >> c;
    if(c=='#'){
      a[i/w][i%w]=0; check[cur2]=i; cur2++; jud--;
    }else{
      a[i/w][i%w]=2000;
    }
  }
  ans=0;
  while(jud>0){
    cur=cur2;
    ans++;
    cur2=0;
    for(j=0; j<cur; j++){
      i=check[j];
      y=i/w; x=i%w;
        if(y+1!=h && a[y+1][x]==2000){
          a[y+1][x]=ans; check2[cur2]=i+w; cur2++; jud--;
        }
        if(y-1!=-1 && a[y-1][x]==2000){
          a[y-1][x]=ans; check2[cur2]=i-w; cur2++; jud--;
        }
        if(x+1!=w && a[y][x+1]==2000){
          a[y][x+1]=ans; check2[cur2]=i+1; cur2++; jud--;
        }
        if(x-1!=-1 && a[y][x-1]==2000){
          a[y][x-1]=ans; check2[cur2]=i-1; cur2++; jud--;
        }

    }   
    for(j=0; j<cur2; j++){
      check[j]=check2[j];
    }
      
    /*
    for(i=0; i<h; i++){
      for(j=0; j<w; j++){
      cout << a[i][j] << ' ';
      }
      cout << endl;
    }
    cout << jud <<endl;
    */
  }
  cout << ans;
  


}

Measured memory_bytes: 20736
#include <stdio.h>
#include <string.h>

int main(){
	while(1){

	int n;
	scanf("%d", &n);
	if(n==0)break;

	int i;
	char order[10];
	int k=1;

	int data[] = {1,2,3,4,5,6};
	int d[6];
	for(i=0;i<n;i++){
		for(int j=0;j<6;j++) d[j] = data[j];
		scanf(" %s", order);
		if(!strcmp(order, "North")){
			int t[] = {1,5,2,3,0,4};
			for(int j=0;j<6;j++) data[j] = d[t[j]];
		}else if(!strcmp(order, "East")){
			int t[] = {3,1,0,5,4,2};
			for(int j=0;j<6;j++) data[j] = d[t[j]];
		}else if(!strcmp(order, "West")){
			int t[] = {2,1,5,0,4,3};
			for(int j=0;j<6;j++) data[j] = d[t[j]];
		}else if(!strcmp(order, "South")){
			int t[] = {4,0,2,3,5,1};
			for(int j=0;j<6;j++) data[j] = d[t[j]];
		}else if(!strcmp(order, "Left")){
			int t[] = {0,3,1,4,2,5};
			for(int j=0;j<6;j++) data[j] = d[t[j]];
		}else{
			int t[] = {0,2,4,1,3,5};
			for(int j=0;j<6;j++) data[j] = d[t[j]];
		}
		k += data[0];
	}

	printf("%d\n", k);
	}
}

Measured memory_bytes: 0
#include <stdio.h>
int main(void){
  int a[123]={},i;
  char s[101];
  scanf("%s",s);
  for (i=0;s[i];i++) a[(int)s[i]]++;
  for (i=97;i<123;i++){
    if (a[i]%2){
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ll long long int
#define FASTIO std::ios::sync_with_stdio(false);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define inf 1e18
#define g(x) cout<<x<<" "<<endl;
#define gg(x,y) cout<<x<<" & "<<y<<" "<<endl
#define jam(t) cout<<"Case #"<<t<<": "
#define ggg(x,y,z) cout<<x<<" & "<<y<<" & "<<z<<" "<<endl
#define all(x) x.begin(),x.end()
#define input_from_file  freopen("input.txt", "r", stdin);
#define mod 1000000007ll
#define sz 400005
#define bitcnt(x) __builtin_popcountll(x)
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
using namespace std;
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...);
}



void solve(){
    set <string> se;
    ll n;
    cin >> n;
    for(ll i=1;i<=n;i++){
        string s;
        cin >> s;
        se.insert(s);
    }
    g(se.size());
}
int main()
{
#ifndef ONLINE_JUDGE
input_from_file
#endif
 
    FASTIO
    cin.tie(NULL);
    fflush(stdout);
    ll t = 1;
 //   cin >> t;
    for(ll tcase = 1;tcase <= t;tcase++){
        solve();
        
    }
return 0;
}

Measured memory_bytes: 19296
class Node
  attr_accessor :h, :p
  def initialize(h, p)
    @h = h
    @p = p
  end
end

class Heap
  def initialize
    @nodes = []
  end

  def push(h, p)
    @nodes << Node.new(h, p)
    c = @nodes.size-1
    p = (c-1)/2

    while c != 0 && @nodes[p].h < h
      @nodes[c], @nodes[p] = @nodes[p], @nodes[c]
      c, p = p, (p-1)/2
    end
  end

  def pop
    res = @nodes.first
    if @nodes.size == 1
      @nodes.pop
      return res
    end

    @nodes[0] = @nodes.pop
    p = 0
    c = 2*p+1

    while c < @nodes.size
      if c+1 < @nodes.size && @nodes[c].h < @nodes[c+1].h
        c = c+1
      end
      if @nodes[p].h > @nodes[c].h
        break
      end

      @nodes[p], @nodes[c] = @nodes[c], @nodes[p]
      p, c = c, 2*c+1
    end
    return res
  end

  def size
    @nodes.size
  end
end

while true do
  n, m, a = gets.split.map(&:to_i)
  break if n|m|a == 0

  nums = []
  (1..n).each{ |i| nums << i }
  heap = Heap.new
  m.times do
    h, p, q = gets.split.map(&:to_i)
    heap.push(h, p-1)
  end

  until heap.size == 0
    p = heap.pop.p
    nums[p], nums[p+1] = nums[p+1], nums[p]
  end

  nums.each_with_index do |num, i|
    if num == a
      puts i+1
      break
    end
  end
end

Measured memory_bytes: 6140
#include <iostream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
int main(){
    int N, N3,N2,N1;
    cin >> N;
    
    N3=N/100;
    N2=(N%100)/10;
    N1=(N%10);

    if(N3==7 || N2==7 || N1==7){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 3636
import java.util.*;
 
 
class Main {
  static long gcd (long a, long b) {
    return b>0?gcd(b,a%b):a;
  }
  
  public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        double ans = 0;
        for(int i=0;i<N;i++){
          double value = sc.nextDouble();
          String S = sc.next();
          if (S.equals("JPY")){
            ans += value;
          }else{
            ans += value*380000.0;
          }
        }
        System.out.println(String.format("%.15f", ans));
      }
    
}

Measured memory_bytes: 23252
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


struct FastIO{
  FastIO(){
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
}fastio_beet;

//INSERT ABOVE HERE
signed main(){
  cout<<"square1001"<<endl;
  return 0;
}



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

int main() {    
    int N;
    cin >> N;
    
    vector<int> buttom(N);
    for (int i = 0; i < N; i++){
        cin >> buttom.at(i);
    }
    
    int push = 0;
    
    for (int j = 0; j < N; j++){
        if (buttom.at(push) == 2){
            cout << j + 1 << endl;
            break;
        }
        else{
            push = buttom.at(push) - 1;
            if (j == N - 1){
                cout << -1 << endl;
            }
        }
    }
}


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

int main(){
  vector<int> t(3);
  int j = 0;
  int k = 0;
  string s;
      cin >> s;
  for (int i = 0;i < 3;i++){

    if (s.at(i) == 'R'){
        t.at(j)++;
    }
      else
        j++;
    
  }
   k = max(t.at(0),max(t.at(1),t.at(2)));
     
  cout << k;
}

Measured memory_bytes: 3620
/* Author - thiolhub */

#include <bits/stdc++.h>

using namespace std;

#define ll              long long int
#define ld              long double
#define db              double
#define pi              3.1415926535897932384626
#define PI              acos(-1.0)
#define endl            "\n"
#define mod             1000000007
#define mk              make_pair
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(t)            ll t; cin>>t; while(t--)
#define sc(a)	        scanf("%lld",&a);
#define pr(a)	        printf("%lld\n",a)
#define f(i,a,n)		for(ll i=a;i<n;i++)
#define m(a)		    memset(a,0,sizeof(a))
#define FastIO          ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)



int main(){ FastIO;

ll a,b,n;cin>>n>>a>>b;
ll s=0;
s+=(n/(a+b))*a;
n%=(a+b);
if(n<a) s+=n;
else s+=a;
cout<<s;

return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void) {
    int n, p[100], c=0, i;
    
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&p[i]);
    
    for(i=0;i<n-2;i++){
        if((p[i]<p[i+1])&&(p[i+1]<p[i+2])) c++;
        else if((p[i]>p[i+1])&&(p[i+1]>p[i+2])) c++;
    }
    printf("%d\n",c);
    return 0;
}


Measured memory_bytes: 1736
//
// author  : Abhishek
//
#include <bits/stdc++.h>

#define ll long long
#define db double
#define deb(x) cout<<#x<<": "<<x<<"\n"
#define all(x) x.begin(),x.end()
#define fo(i, n) for(i=0 ; i<n ; i++)
#define Fo(i, k, n) for(i=k ; i<n ; i++)

using namespace std;

const ll mod = 1000000007;
const ll N = 300005;  // array size
const ll inf = 10000000000000000;


void print(vector<ll> v) {
    ll i;
    fo(i, v.size())cout << v[i] << " ";
    cout << "\n";
}

vector<ll> read(ll n) {
    ll i;
    vector<ll> arr(n, 0);
    fo(i, n)cin >> arr[i];
    return arr;
}

vector<ll> read(ll n, ll k) {
    ll i;
    vector<ll> arr(n + k, 0);
    Fo(i, k, n + k)cin >> arr[i];
    return arr;
}

bool isEven(ll n) {
    return n % 2 == 0;
}

bool isOdd(ll n) {
    return n % 2 != 0;
}


void solve() {
    ll t;
    cin >> (t);
    while (t--) {

        ll i, j, k, n, m, p, q, x, y, a, b, l, r;


    }
}

int main() {

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll i, j, k, n, m, p, q, x, y, a, b, l, r;

        
    string s1,s2;
    cin>>s1>>s2;
    
    
    ll ans = 0;
    fo(i,3){
        if(s1[i] == s2[i]){
            ans++;
        }
    }
    
    cout<<ans;




    return 0;
}




Measured memory_bytes: 3644
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = int_fast64_t;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

void answer() {
  ll n;
  cin >> n;
  map<ll, ll> m;
  rep(i, n) {
    ll a;
    cin >> a;
    m[a]++;
  }
  ll ans = 0;
  for(const auto& a : m) {
    ans += a.first * a.second;
  }
  ll q;
  cin >> q;
  rep(i, q) {
    ll b, c;
    cin >> b >> c;
    ll k = m[b];
    m[b] = 0;
    m[c] += k;
    ans -= b * k;
    ans += c * k;
    cout << ans << "\n";
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 9596
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;

long long gcd(long long x,long long y){
    if(x % y == 0){
        return y;
    }
    return gcd(y,x % y);
}

int main(){
    long long A,B;
    cin >> A >> B;
    
    long long ans = A*B/gcd(A,B);
    
    cout << ans << endl;
}


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

#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
using namespace std;

int main(){
	int l, r, d;	cin >> l >> r >> d;
	int ans = 0;

	for( int i = l; i <= r; i++ ){
		if( i % d == 0 )	ans++;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi; 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
const int mod = 1e9+7;
const int maxn = 2e5+10;
const int inf = 0x3f3f3f3f;
ll pre[maxn],nex[maxn];
int main()
{
	ios::sync_with_stdio(false);cin.tie(0);
	int n,k;
	cin>>n>>k;
	rep(i,1,n) pre[i]=pre[i-1]+i;
	per(i,n,0) nex[i]=nex[i+1]+i;
	ll ans=0;
	rep(i,k,n+1) {
		ans+=nex[n-i+1]-pre[i-1]+1;
		ans%=mod;
	}
	cout<<ans<<'\n';
	return 0;
}


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

using namespace std;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
typedef long long ll;
typedef pair<int, int> pi;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;

const int MAX_N = 2e5 + 100;

struct BIT{
	vector<int> val;
	BIT(int n) {
		val = vector<int>(n+10, 0);
	}
	void update(int v, int k) {for(v+=5; v<SZ(val); v+=v&-v) val[v] += k;}
	int getSum(int v) {int res=0; for(v+=5; v>0; v-=v&-v) res += val[v]; return res;}
	int getSum(int a, int b) {return getSum(b) - getSum(a-1);}
};

int N; char S[MAX_N];
vector<int> Ed[26];
int main() {
	scanf("%s", S); N = strlen(S);
	for(int i=0; i<N; i++) Ed[S[i]-'a'].push_back(i);
	int oddCnt = 0;
	for(int i=0; i<26; i++) if(SZ(Ed[i]) % 2) oddCnt++;
	if(oddCnt >= 2) return puts("-1") < 0;
	vector<pi> Pair;
	for(int i=0; i<26; i++) for(int j=0; j*2+1<SZ(Ed[i]); j++) Pair.emplace_back(Ed[i][j], Ed[i][SZ(Ed[i])-1-j]);
	sort(ALL(Pair), [&](pi a, pi b) {return a.two-a.one > b.two-b.one;});
	BIT bit = BIT(N);
	for(int i=0; i<N; i++) bit.update(i, 1);
	ll ans = 0;
	for(int i=0; i*2+1<N; i++) {
		int l, r; tie(l, r) = Pair[i];
		ans += bit.getSum(  0, l-1); bit.update(l, -1);
		ans += bit.getSum(r+1, N-1); bit.update(r, -1);
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 3316