akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

long long A;
long long B;
long long C;

void input() {
    cin >> A;
    cin >> B;
    cin >> C;
}

int main() {
    input();
    long long d = C - A- B;
    if(d > 0 && d * d> 4* A * B){
        cout << "Yes" << endl;
        
    }else{
        cout << "No" << endl;

    }

    return 0;
}

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

namespace question1
{
    class Program
    {
        static void Main(string[] args)
        {
            var p = new Program();
            p.Run();
        }

        void Run(){
            var d = int.Parse(Console.ReadLine());
            var c = 25-d;
            var text = Enumerable.Repeat("Eve", c).Aggregate("Christmas", (a,b)=>$"{a} {b}");

            Console.WriteLine(text);
        }
    }
}

Measured memory_bytes: 11220
#include <iostream>
using namespace std;
int main(void){
    int N;
    cin>>N;
    int num[N];
    for(int i=0;i<N;i++){
        cin>>num[i];
    }
    int sum=0;
    for(int i=0;i<N;i++){
        sum+=num[i]-1;
    }
    cout<<sum;
    return 0;
}


Measured memory_bytes: 764
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define PB push_back
#define MP make_pair
#define FST first
#define SND second
#define SZ(a) (signed)((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int MOD = 1000000007;
const char ENDL = '\n';

#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"  << " " << __FILE__ << endl;

signed main(void) {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(10);
    cin.tie(0);

    string s;
    cin >> s;
    REP(i,s.length()){
        if (s[i]=='B'){
            if(i>0) {
                s.erase(--i, 2);
                i--;
            } else{
                s.erase(i--, 1);
            }
        }
    }

    cout << s << ENDL;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define F first
#define S second
typedef vector<pli> vpli;
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end() 
#define tests int t; cin>>t; while(t--)
#define take(a,b,c) for(b=0;b<c;b++) cin>>a[b];
#define INF 1e18
// https://codeforces.com/problemset/page/3?tags=1500-1800
int main()
{	
  //auto start = std::chrono::high_resolution_clock::now();
  string s;
  cin>>s;
  int n = s.size();
  int flag=0;
  string s1 = s.substr(0,(n-1)/2);
  string s2 = s.substr((n+3)/2-1,(n+3)/2);
  for(int i=0;i<=s1.size()/2;i++){
    if(s1[i]!=s1[s1.size()-1-i]){
      flag=1;
      break;
    }
  }
  if(s1!=s2) flag=1;
  if(flag==0) cout<<"Yes"<<'\n';
  else cout<<"No"<<'\n';
  //auto stop = std::chrono::high_resolution_clock::now(); 
  //auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(stop - start);
  //cout << duration.count() << endl; 

}

Measured memory_bytes: 256
def solve():
    N = int(input())
    L = list(map(int, input().split()))
 
    count = 0
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if(L[i] != L[j] and L[j] != L[k] and L[k] != L[i]):
                    if(L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j]):
                        count += 1
 
    print(count)
 
if __name__ == "__main__":
    solve()

Measured memory_bytes: 9172
/* 
    HARSHAD VAGHASIYA

        @DAIICT
    
          H_M_Vaghasiya
    
            */
#include<bits/stdc++.h>
using namespace std;
#define FS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define MAX_INT 100000
#define ld long double
#define pb push_back
#define mp make_pair
#define pu push
ll gcd(ll a,ll b){return __gcd(a,b);}
ll fact(ll n){ll s=1; for(ll i=1;i<=n;i++)s*=i; return s;}
ll pow1(ll n,ll k,ll mm){
    if(k==0)return 1;
    if(k%2==0)return (pow1((n%mm)*(n%mm),k/2,mm))%mm;
    return ((n%mm)*(pow1((n%mm)*(n%mm),k/2,mm)%mm))%mm; 
}
ll pow2(ll n,ll k){
    ll ans=1;
    while(k>0){
        if(k%2==1)ans=ans*n;
        n=n*n;
        k/=2;
    }return ans;
}
void solve(){
    ll i,j,k,n,m,x,y,z;
    
}
int main()
{
    FS; 
    ll i,j,k,n,m,x,y,z;
    //string s[]={"Sunny", "Cloudy", "Rainy"};
    string t;
    cin>>t;
    for(i=0;i<t.length();i++){
        if((i+1)%2==0 && t[i]=='R'){
            cout<<"No"<<endl;
            return 0;
        }
        if((i+1)%2==1 && t[i]=='L'){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes";
    return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readLine()!!.split(" ").map { it.toInt() }
    var x = n[1]
    var count = 1
    for (i in 0..100){
        x = x - n[0]
        if (n[1] == 1){
            count = 0
            break
        } else if (x <= 0){
            break
        } else {
            count++
            x = x + 1
        }
    }
    println(count)
}


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

class DisjointSet {
public:
    vector<int> p, rank;

    DisjointSet(int n) {
        p.resize(n, 0);
        iota(p.begin(), p.end(), 0);
        rank.resize(n, 0);
    }

    int findSet(int x) {
        if (p[x] == x) return x;
        return findSet(p[x]);
    }

    bool same(int x, int y) {
        return (findSet(x) == findSet(y));
    }

    void unite(int x, int y) {
        int xroot = findSet(x), yroot = findSet(y);
        if (rank[xroot] < rank[yroot]) {
            p[xroot] = yroot;
        } else {
            p[yroot] = xroot;
            if (rank[xroot] == rank[yroot]) rank[xroot] ++;
        }
    }
};

int main() {
    ios::sync_with_stdio(false);

    int n, q;
    cin >> n >> q;

    DisjointSet obj(n);
    int com, x, y;
    while (q --) {
        cin >> com >> x >> y;
        if (com == 0) {
            obj.unite(x, y);
        } else {
            cout << (int)obj.same(x, y) << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 1284
ans=0
a=input()
def dfs(i,s=''):
  global ans
  if i==len(a)-1:
    if eval(s+a[-1])==7:
      ans=s+a[-1] + '=7'
      return 

    else:
      return
  dfs(i+1,s+a[i]+'-')
  dfs(i+1,s+a[i]+'+')

dfs(0)
print(ans)

Measured memory_bytes: 3060
#include<cstdio>
#define MAX 10000
#define NIL -1

struct Node { int parent, left, right; };

Node T[MAX];
int n, D[MAX], H[MAX];

void setDepth(int u, int d) {
  if (u == NIL) return;
  D[u] = d;
  setDepth(T[u].left, d + 1);
  setDepth(T[u].right, d + 1);
}

int setHeight(int u) {
  int h1 = 0, h2 = 0;
  if (T[u].left != NIL) {
    h1 = setHeight(T[u].left) + 1;
  }
  if (T[u].right != NIL) {
    h2 = setHeight(T[u].right) + 1;
  }
  return H[u] = (h1 > h2 ? h1 : h2);
}

int getSibling(int u) {
  if (T[u].parent == NIL) return NIL;
  if (T[T[u].parent].left != u && T[T[u].parent].left != NIL) {
    return T[T[u].parent].left;
  }
  if (T[T[u].parent].right != u && T[T[u].parent].right != NIL) {
    return T[T[u].parent].right;
  }
  return NIL;
}

void print(int u) {
  printf("node %d: ", u);
  printf("parent = %d, ", T[u].parent);
  printf("sibling = %d, ", getSibling(u));
  int deg = 0;
  if (T[u].left != NIL) deg ++;
  if (T[u].right != NIL) deg ++;
  printf("degree = %d, ", deg);
  printf("depth = %d, ", D[u]);
  printf("height = %d, ", H[u]);

  if (T[u].parent == NIL) {
    printf("root\n");
  } else if (T[u].left == NIL && T[u].right == NIL) {
    printf("leaf\n");
  } else {
    printf("internal node\n");
  }
}

int main() {
  int v, l, r, root = 0;
  scanf("%d", &n);

  for (int i = 0; i < n; i ++) T[i].parent = NIL;

  for (int i = 0; i < n; i ++) {
    scanf("%d %d %d", &v, &l, &r);
    T[v].left = l;
    T[v].right = r;
    if (l != NIL) T[l].parent = v;
    if (r != NIL) T[r].parent = v;
  }

  for (int i = 0; i < n; i ++) if (T[i].parent == NIL) root = i;

  setDepth(root, 0);
  setHeight(root);

  for (int i = 0; i < n; i ++) print(i);
}



Measured memory_bytes: 2772
#include <stdio.h>

int main(void){
  int k,a,b,c,gcd;
  long long ans=0;

  scanf("%d",&k);
  for(a=1;a<=k;a++){
    for(b=1;b<=k;b++){
      for(c=1;c<=k;c++){
        gcd = a;
        if(gcd>b){
          gcd = b;
        }
        if(gcd>c){
          gcd = c;
        }

        for(;gcd>0;gcd--){
          if(a%gcd==0 && b%gcd==0 && c%gcd==0){
            ans += gcd;
            break;
          }
        }
      }
    }
  }

  printf("%lld\n",ans);
  return 0;
}


Measured memory_bytes: 1736
n, k, q = gets.split.map(&:to_i)
w = q.times.map { gets.to_i }
p = [].fill(k - q, 0...n)
w.each { |i| p[i - 1] += 1 }
p.each { |j| puts j > 0 ? 'Yes' : 'No'}

Measured memory_bytes: 4276
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
using ll = long long;
int main(){
    int N;
    cin >> N;
    ll L[100010];
    L[0] = 2;
    L[1] = 1;
    for(int i = 2;i <= N;i++){
        L[i] = L[i-1] + L[i-2];
    }
    cout << L[N];
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define repi(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)
#define rep(i,n) repi(i,0,n)
#define all(x) (x).begin(),(x).end()
#define tsort(v) sort((v).begin(), (v).end())
#define trev(v) tsort(v); reverse((v).begin(), (v).end())
#define siz(v) ((int)(v).size())
#define ers(v, n) (v).erase((v).begin() + n)
#define el "\n"
#define co(x) cout<<(x)<<el
#define coc(c, a, b) if(c)co((a));else co((b))
#define YES(c) coc(c,"YES", "NO")
#define Yes(c) coc(c,"Yes", "No")
#define yes(c) coc(c,"yes", "no")
#ifdef tqktmp_1
#define gc() getchar(); getchar()
#else
#define gc() 1
#endif
typedef long long lint;

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

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

	string s;
	cin >> s;
	Yes(s[0] == '9' || s[1] == '9');
	gc();
}

Measured memory_bytes: 256
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;

	int[][] next = {{1,4},
					{0,2,5},
					{1,3,6},
					{2,7},
					{0,5},
					{1,4,6},
					{2,5,7},
					{3,6}};
	HashMap<Integer, Integer> ans = new HashMap<Integer, Integer>();
	void run() {
		Scanner sc = new Scanner(System.in);
		bfs();
		while(sc.hasNext()) {
			int q = 0;
			int tmp = 1;
			for(int i=0;i<8;i++) {
				q += sc.nextInt() * tmp;
				tmp *= 8;
			}
			System.out.println(ans.get(q));
		}
	}
	
	void bfs() {
		boolean[] visited = new boolean[16777216];
		Struct now = new Struct(new int[] {0, 1, 2, 3, 4, 5, 6, 7}, 0);
		LinkedList<Struct> que = new LinkedList<Struct>();
		que.add(now);
		visited[toInt(now.s)] = true;
		for(;!que.isEmpty();) {
			now = que.removeFirst();
			ans.put(toInt(now.s), now.c);
//			System.out.println(toString(now.s));
			int a[] = now.s.clone();
			int zero = 0;
			for(int i=0;i<8;i++) if(a[i] == 0) {
				zero = i; break;
			}
			for(int i=0;i<next[zero].length;i++) {
				int[] b = a.clone();
				int tmp = b[zero];
				b[zero] = b[next[zero][i]];
				b[next[zero][i]] = tmp;
				Struct next_s = new Struct(b, now.c+1);
				int ind = toInt(b);
				if( !visited[ind] ) {
					visited[ind] = true;
					que.addLast(next_s);
				}
			}
		}
	}
	
	int toInt(int[] a) {
		int ret = 0;
		int tmp = 1;
		for(int i=0;i<8;i++) {
			ret += a[i]*tmp;
			tmp *= 8;
		}
		return ret;
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	class Struct {
		int[] s;
		int c;
		int zero;
		Struct(int s[], int c) {
			this.s = s.clone();
			this.c = c;
		}
	}
}

Measured memory_bytes: 31000
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define ll long long
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N = 1e5 + 5, M = 3e5 + 5;

string s[] = {"Sunny", "Cloudy", "Rainy"};

int main(){
    string k;
    cin >> k;
    for(int i = 0 ; i < 3 ; ++i)
        if(s[i] == k)
            cout << (s[(i + 1) % 3]) << endl;
}

Measured memory_bytes: 256
from collections import deque
H=deque(input())
Q=int(input())
reverse=False

A,B="",""
for _ in range(Q):
    T=input()
    if T[0]=="1":
        reverse=not reverse
    else:
        _,F,C=T.split()

        if ((not reverse) and F=="1") or (reverse and F=="2"):
            H.appendleft(C)
        else:
            H.append(C)

if reverse:
    H.reverse()

for s in H:
    print(s,end="")
print()


Measured memory_bytes: 93912
import java.util.*;

public class Main {
    public static void main(String[] args ) throws Exception {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
		boolean flag = false;
      	int times = (B-A);
        for(int i=0;i<times+1;i++){
            if(A % K == 0){
                System.out.println("OK");
              flag = true;
                break;
            } else if(A < B){
                A++;
            }
        }
      if(!flag){
        System.out.println("NG");
      }
    }
}


Measured memory_bytes: 27076
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#define int ll 
#define FOR(i,s,e) for(ll i = s; i <= (ll)e; ++i)
#define DEC(i,s,e) for(ll i = s; i >= (ll)e; --i)
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define db(x) cerr << #x << "=" << x << "\n"
#define db2(x, y) cerr << #x << "=" << x << " , " << #y << "=" << y << "\n"
#define db3(a,b,c) cerr<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<"\n"
#define dbv(v) cerr << #v << ":"; for (auto ite : v) cerr << ite << ' '; cerr <<"\n"
#define dbvp(v) cerr << #v << ":"; for (auto ite : v) cerr << "{"  << ite.f << ',' << ite.s << "} "; cerr << "\n"
#define dba(a,ss,ee) cerr << #a << ":"; FOR(ite,ss,ee) cerr << a[ite] << ' '; cerr << "\n"
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long 
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define reach cerr << "LINE: " << __LINE__ << "\n";
typedef pair <ll, ll> pi;
typedef tuple<ll,ll,ll> ti3;
string cts(char x) {string t(1,x); return t;}
ll rand(ll a, ll b) { return a + rng() % (b-a+1); }
const int MOD = 1e9 + 7;
const int inf = (int)1e9 + 500;
const long long oo = (ll)1e18 + 500;
template <typename T> void chmax(T& a, T b) { a = max(a, b); }
template <typename T> void chmin(T& a, T b) { a = min(a, b); }
const int MAXN = -1;
#ifndef LOCAL
#define cerr if(0)cout
#endif
int A[300005], lf[300005], rg[300005];
int32_t main() 
{
	IAMSPEED
	int n; cin >> n;
	int m = n*3;
	FOR(i,1,m) cin >> A[i];
	priority_queue<int,vector<int>,greater<int>>pq;
	int sum = 0;
	FOR(i,1,m) {
		pq.push(A[i]);
		sum += A[i];
		if((int)pq.size()>n){
			sum-=pq.top();
			pq.pop();
		}
		lf[i]=sum;
	}
	priority_queue<int>pq2;
	sum=0;
	DEC(i,m,1) {
		pq2.push(A[i]);
		sum+=A[i];
		if((int)pq2.size()>n) {
			sum-=pq2.top();
			pq2.pop();
		}
		rg[i]=sum;
	}
	int ans = -oo;
	//dba(lf,1,m);
	//dba(rg,1,m);
	FOR(i,n,2*n) {
		chmax(ans, lf[i]-rg[i+1]);
	}
	cout << ans;
}


Measured memory_bytes: 11824
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		new Main().run();
	}
	public void run(){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int n = scan.nextInt();
			int sTime = scan.nextInt();
			Process[] schedule = new Process[n];
			int count = n;
			int j = 0;
			int sumTime = 0;
			for(int i = 0;i < n;i++){
				schedule[i] = new Process(scan.next(),scan.nextInt());
			}
			int a = 0;
			int len = schedule.length;
			while(count > 1){
				if(count < len/2 && j == len && count > 1000){
					Process[] newSchedule = new Process[count];
					int k = 0;
					for(int i = 0;i < len;i++){
						if(schedule[i].getTime() == 0){
							continue;
						}
						newSchedule[k] = new Process(schedule[i].getName(),schedule[i].getTime());
						k++;
					}
					schedule = newSchedule;
					len = schedule.length;
					j = 0;
				}
				if(j >= len){
					j %= len;
				}
				a = schedule[j].getTime();
				if(a == 0){
					j++;
					continue;
				}else if(a <= sTime){
					sumTime += a;
					System.out.println(schedule[j].getName() + " " + sumTime);
					schedule[j++].setTime(0);
					count--;
					continue;
				}
				sumTime += sTime;
				schedule[j++].minusTime(sTime);
			}
			for(int i = 0;i < len;i++){
				if(schedule[i].getTime() == 0){
					continue;
				}
				System.out.println(schedule[i].getName() + " " +(sumTime+schedule[i].getTime()));
				break;
			}
		}
	}
	class Process{
		String name;
		int time;
		public Process(){
		}
		public Process(String name,int time){
			this.name = name;
			this.time = time;
		}
		public int getTime(){
			return this.time;
		}
		public void setTime(int time){
			this.time = time;
		}
		public String getName(){
			return this.name;
		}
		public void minusTime(int time){
			this.time -= time;
		}
		public void setName(String name){
			this.name = name;
		}
	}
}

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

const int MAXN = 100010;
int h[MAXN], dp[MAXN];
int main() {
	int n;
	cin>>n;
	for (int i=0; i<n; i++)
		cin>>h[i];
	memset(dp, 0xff, sizeof(dp));
	dp[0] = 0;
	for (int i=0; i<n; i++) {
		if (dp[i+1] == -1 || dp[i+1] > dp[i] + abs(h[i] - h[i+1]))
			dp[i+1] = dp[i] + abs(h[i] - h[i+1]);
		if (dp[i+2] == -1 || dp[i+2] > dp[i] + abs(h[i] - h[i+2]))
			dp[i+2] = dp[i] + abs(h[i] - h[i+2]);
	}
	cout<<dp[n-1]<<endl;
	return 0;
}


Measured memory_bytes: 1024
import sys
 
arr=[int(input()) for i in range(5)]
k=int(input())
 
for i in range(len(arr)):
    for j in range(len(arr)-i-1):
        if abs(arr[i] - arr[i+j+1]) > k:
            print(":(")
            sys.exit()
 
print("Yay!")


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < int(n); i++)
#define FOR(i, a, b) for (int i = a; i < int(b); i++)
#define FOREACH(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define SIZE(v) ((int)(v).size())
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define ll long long
#define llint long long
#define pii pair<int, int>
#define UNVISITED -1


template<typename T>
string to_string(const vector<T>& vc, int w) {
	if(vc.empty()) return "";
	if(w + 1 == vc.size()) return to_string(vc[w]);
	return to_string(vc[w]) + "," + to_string(vc, w + 1);
}
 
template<typename T>
string to_string(const vector<T>& vc) {
	return "{" + to_string(vc, 0) + "}";
}
 
void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
 
#ifdef DEBUG
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
 
class DebugStream {}LOG;
template <typename T>DebugStream &operator<<(DebugStream &s, const T&) { return s; }
#ifdef DEBUG
#define LOG clog
#endif


int main() {
    ll a, b, c, d; scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    ll ans = max(a*c, b*d);
    ans = max(ans, a*d);
    ans = max(ans, c*b);
    printf("%lld\n", ans);

}

Measured memory_bytes: 3824
n,y = map(int,input().split())
res10000 = -1
res5000 = -1
res1000 = -1
for a in range(n+1):
    for b in range(n+1-a):
        c = n-a-b
        total = a*10000+b*5000+c*1000
        if total == y:
            res10000 = a
            res5000 = b
            res1000 = c
print(res10000, res5000, res1000)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000001
#define r(i,a,b)    for(i=a;i<b;i++)
#define ra(i,a,b)   for(i=a;i<=b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define ss          set<ll int>
using namespace std;
 
#define N 1000000
#define M 100000000

struct unit {
  ll int a[N];  
};

ll fact (ll int x)
{if(x==1 || x==0)return 1;
else return x*fact(x-1);}

ll power(ll int x,ll int n)
{if(n==0)return 1;
else if(n%2 == 0)return power(x*x,n/2);
else return x*power(x*x,(n-1)/2);}

bool cmp (const pii&a,const pii&b)
{ return((a.F-a.S) > (b.F-b.S));
/*if(a.S<=b.S){if(a.S==b.S)return a.F<b.F;else return a.S<b.S;}
else return a.S<b.S;*/}

void solve()
{
  ll a,n;
  cin>>a;
  cout<<a+power(a,2)+power(a,3);
    
}


int main()
{
    cin.tie(0), cin.sync_with_stdio(0), cout.tie(0), cout.sync_with_stdio(0);
    ll t=1;
   // cin>>t;
    while(t--)
    {
        solve();
    }
    
}
//pr12

Measured memory_bytes: 3648
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>
#include <iterator>

using namespace std;

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

typedef pair<int, int> pint;
typedef long long ll;

int main()
{
    int data[(int)2e5 + 1] = {};
    int n, k;
    cin >> n >> k;
    rep(i, n)
    {
        int tmp;
        cin >> tmp;
        data[tmp]++;
    }

    priority_queue<int, vector<int>, greater<int>> q;
    rep(i, (int)2e5 + 1)
    {
        if (data[i] > 0)
        {
            q.push(data[i]);
        }
    }

    int ans = 0;
    while (q.size() > k)
    {
        ans += q.top();
        q.pop();
    }

    cout << ans << endl;
}

Measured memory_bytes: 2168
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};


int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int h,w,m;
    cin>>h>>w>>m;
    vector<P> a(m);
    rep(i,m) cin>>a[i].first>>a[i].second;

    vector<int> hcnt(h,0);
    vector<int> wcnt(w,0);
    int x,y;
    rep(i,m){
        tie(x,y)=a[i];
        x --,y --;
        a[i]=P(x,y);
        hcnt[x] ++;
        wcnt[y] ++;
    }
    int hmax=0, wmax=0;
    rep(i,h){
        hmax=max(hmax,hcnt[i]);
    }
    rep(i,w){
        wmax=max(wmax,wcnt[i]);
    }

    map<P,int> b;
    rep(i,m) b[a[i]]=1;

    vector<int> hpla(0),wpla(0);
    rep(i,h){
        if(hcnt[i]==hmax) hpla.emplace_back(i);
    }
    rep(i,w){
        if(wcnt[i]==wmax) wpla.emplace_back(i);
    }

    int ans=hmax+wmax;
    rep(i,hpla.size()){
        rep(j,wpla.size()){
            if(b[P(hpla[i],wpla[j])]==0){
                cout<<ans<<endl;
                return 0;
            }
        }
    }
    cout<<ans-1<<endl;
}/*
./problem.exe
*/

Measured memory_bytes: 30780
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    map<int,int> cnt;

    int N; cin>>N;
    REP(i,N){
        int a; cin>>a;
        cnt[a]++;
    }
    
    int ans=0;
    for(auto p:cnt){
        if(p.second%2==1) ans++;
    }
    cout<<ans<<endl;

}


Measured memory_bytes: 6528
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll n, c;
static ll x[114514], v[114514], cv[114514], cm[114514], acv[114514], acm[114514];
int main(){
  cin >> n >> c;
  for(int i=0;i<n;i++) cin >> x[i] >> v[i];
  ll ans = 0;
  ll now = 0, maxi = 0;
  for(int i=0;i<n;i++){
    now += v[i] - x[i] + ((i>0) ? x[i-1] : 0);
    maxi = max(maxi, now);
    cv[i] = now;
    cm[i] = maxi;
  }
  ans = max(ans, cm[n-1]); // ->->->
  now = 0, maxi = 0;
  for(int i=n-1;i>=0;i--){
    now += v[i] - ((i+1<n) ? x[i+1] : c) + x[i];
    maxi = max(maxi, now);
    acv[i] = now;
    acm[i] = maxi;
  }
  ans = max(ans, acm[0]); // <-<-<-
  // -> <- <-
  for(int i=0;i+1<n;i++){
    ans = max(ans, cv[i] - x[i] + acm[i+1]);
  }
  // <- -> ->
  for(int i=n-1;i>0;i--){
    ans = max(ans, acv[i] - (c - x[i]) + cm[i-1]);
  }
  cout << ans << endl;
  return 0;
}
  
  

  
  

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())

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

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<pair<T, T>>& vp) {
	for (int i = 0; i < vp.size(); ++i) {
		s << "(" << vp[i].first << "," << vp[i].second << ")" << ( i+1 == vp.size() ? "" : ",\t" );
	}
	return s;
}

// 多重vector
// auto dp=make_v<int>(4,h,w) みたいに使える
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

// 多重vectorのためのfill
// fill_v(dp,0) みたいに使える
template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


//main code

int main(int argc, char const* argv[])
{
	LL n,m;
	cin >>n >>m;
	VL a(n);
	cin >> a;
	VL rui(n+1,0);
	map<LL, LL> amari;
	amari[0]++;
	for (int i = 0; i < n; i++) {
		rui[i+1] = rui[i] + a[i];
		amari[rui[i+1]%m]++;
	}
	LL ans = 0;
	for (auto&& v : amari) {
		if (v.second > 1) {
			ans += (v.second * (v.second-1)) / 2;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 5760
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
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;}

// 0 false, 1 true 
// string to int : -48
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    std::cout << std::fixed << std::setprecision(15);
    ll n;
    cin >> n;
    vector<long long> vec(n);
    vector<long long> vec2(n);
    ll ans = 0;

    map<ll,ll> mp;

    for(long long i = 0; i < n; i ++){
        ll a;
        cin >> a;
        vec[i] = a + i;
        vec2[i] = i - a;
        mp[i-a]++;
    }

    

    rep(i,n){
        ans += mp[vec[i]];
    }


    cout << ans << endl;

}


Measured memory_bytes: 29072
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
using namespace std;
const int num = 100;
int v[num][num], n, c[num], p[num], d[num];;
inline int mini(int k) {
	for (int i = 0; i < n; i++) {
		d[i] = 99999999;
	}

	d[k] = 0;
	p[k] = -1;
	while (1) {
		int minv = 99999999, u = -1;
		for (int i = 0; i < n; i++) {
			if (d[i] < minv && c[i] == 0) {
				minv = d[i];
				u = i;
			}
		}
		if (u == -1) break;
		for (int i = 0; i < n; i++) {
			if (v[u][i] != -1 && c[i] == 0) {
				if (d[i] > v[u][i]) {
					d[i] = v[u][i];
					p[i] = u;
				}
			}
		}
		c[u] = 1;
	}
	int sum = 0;
	for (int i = 0; i < n; i++) {
		if(p[i] != -1) sum += v[i][p[i]];
	}
	return sum;
}
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> v[i][j];
		}
	}
	for (int i = 0; i < n; i++) {
		c[i] = 0;
	}
	cout << mini(0) << endl;
	return 0;
}

Measured memory_bytes: 3112
using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        string str;
        string[] strer = new string[2];
        var strlist = new List<string>();
        var data = new List<int>();
        int cou = 0;
       
        do
        {
            str = Console.ReadLine();
            if (str == "0 0")
            {
                break;
            }

            strer = str.Split(' ');

            foreach (string s in strer)
            {
                data.Add(int.Parse(s));
            }            
          
        } while (true);

        
        for (int i = 0; i < (data.Count/2); i++)
        {

            for (int j =0; j < data[cou]; j++)
            {
                for (int k = 0; k < data[cou+1]; k++)
                {
                    if ( j != 0 && j != data[cou]-1 && k > 0 && k < data[cou+1]-1 )
                    {
                        Console.Write(".");
                    }
                    else
                    {
                        Console.Write("#");
                    }                 
                }
                Console.Write("\n");
            }
            Console.Write("\n");
            cou += 2;

        }
               
    }
}


Measured memory_bytes: 15920
#include <bits/stdc++.h>
using namespace std; 
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a) (a).begin(),(a).end()
#define ll long long
long long min(long long x,long long y){return (x<y ? x:y);}
long long max(long long x,long long y){return (x>y ? x:y);}
#define ld long double
int stoi(string s) {return atoi(s.c_str());}
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
#define LINEY "YES\n"
#define Liney "Yes\n"
#define LINEN "NO\n"
#define Linen "No\n"

//o-o-o
int main(){
  int N,K; cin>>N>>K;
  int need = K*2-1;
  if(N>=need)cout<<LINEY;
  else cout<<LINEN;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define space " "
#define MOD (long long) 1000000007
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename T> void __f(const char* variable_name, T&& value){cout << variable_name << ": " << value << endl;}
template <typename T1, typename... T2> void __f(const char* names, T1&& arg1, T2&&... args){const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << ": " << arg1 << " |";__f(comma + 1, args...);}

const ll N = 5e5 + 5;
ll *v;
ll n;

void solve(){
    cin >> n;
    double ans = 2 * 3.14 * n;
    cout << ans << endl;
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    ll t = 1;
    // cout << "\n\nBLAH BLAH BLAH\n\n";
    // cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3800
// atcoder/abc134/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

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

  int r;
  while (cin >> r) {
    cout << 3 * r * r << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define SQ(x) ((x)*(x))
#define Mod(x, mod) (((x)+(mod)%(mod))
#define MP make_pair
#define PB push_back
#define Fi first
#define Se second
#define INF (1<<29)
#define EPS 1e-10
#define MOD 1000000007

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

vector<string>s;
int N;

int main(){
  while(cin >> N && N){
    s.clear();
    rep(i,N){
      string str; cin >> str;
      s.push_back(str);
      rep(j,s[i].size()){
	if(s[i][j]!='.') continue;
	if(s[i][j+1]=='.') s[i][j] = ' ';
	else{
	  s[i][j] = '+';
	  break;
	}
      }
    }

    rep(i,N) rep(j, s[i].size()){
      if(s[i][j]!='+') continue;
      int y = i+1;
      while(1){
	if(y >= N) break;
	if(s[y].size() <= j) break;
	if(s[y][j]=='+'){
	  for(int k=i+1;k<y;k++) s[k][j] = '|';
	  break;
	}else if(s[y][j]!=' '){
	  break;
	}
	y++;
      }
    }
    rep(i,N) cout << s[i] << endl;
  }
  return 0;
}

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

 int main(){
 string s, t;
 cin >> s >> t;
 int ans = 0;
 if(s[0] == t[0]) ans++;
 if(s[1] == t[1]) ans++;
 if(s[2] == t[2]) ans++;
 cout << ans << endl;
 return 0;
 }

Measured memory_bytes: 256
import java.util.*

fun main(args: Array<String>) {
    val s = readLine()!!
    val t = readLine()!!
    val map = HashMap<Char, ArrayList<Long>>()
    s.toCharArray().forEachIndexed { index, c ->
        val i = index.toLong()
        if (map[c] == null) {
            map[c] = arrayListOf(i, i + s.length)
        } else {
            with(map[c]!!) {
                add(i)
                add(i + s.length)
            }
        }
    }
    map.values.forEach { it.sort() }

    var ans = 0L
    t.forEach { c ->
        if (map[c] == null) {
            println("-1")
            return
        }
        val list = map[c]!!
        var b = list
                .binarySearch(ans % s.length)
                .let { if (it < 0) it.inv() else it }
        val p = list[b]
        ans += (p - ans % s.length + 1)
    }
    println(ans)
}

Measured memory_bytes: 50452
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
constexpr double EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max()/2;
constexpr int MOD = 1e9+7;

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

    int r,g,b;cin>>r>>g>>b;
    if((g*10+b)%4==0) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}


Measured memory_bytes: 256
N, K, Q = (int(i) for i in input().split())
A=[]
B=[0]*N
for i in range(Q):
    a=int(input())
    A.append(a-1)
for i in range(Q):
    B[A[i]]+=1
for i in range(N):
    if B[i]-Q+K>0:
        print('Yes')
    else:
        print('No')

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

ll dp[202][101010];

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

    ll N, X;
    cin >> N >> X;
    vector<ll> S(N);
    REP(i, N) cin >> S[i];
    sort(S.begin(), S.end());

    REP(i, 202)REP(j, 101010) dp[i][j] = 0;
    REP(j, 101010) dp[0][j] = j;

    REP(i, N){
    	REP(j, 101010){
    		dp[i+1][j] += dp[i][j%S[i]];
    		dp[i+1][j] %= mod;
    		dp[i+1][j] += i*dp[i][j];
    		dp[i+1][j] %= mod;
    	}
    }

    cout << dp[N][X] << endl;

    return 0;
}

Measured memory_bytes: 159616
function Main(input) {
  const data = input.split("\n")
  const temps = data[1].split(" ")
  const T = temps[0]
  const A = temps[1]
  const Hs = data[2].split(" ")
  
  const c = Hs.map( h => T - h*0.006)
    .reduce( (acc, t, i) => {
      return Math.abs(t - A) > Math.abs(acc[0] - A) ? acc : [t, i]
    }, [100000, 0])[1] + 1

  console.log(c);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8")); 

Measured memory_bytes: 21192
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    if(s[2]==s[3]&&s[4]==s[5]){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
S = input()
tile_1 = str()
tile_2 = str()
flag = True
for ii in range(len(S)):
    if flag:
        tile_1 += '1'
        tile_2 += '0'
        flag = False
    else:
        tile_1 += '0'
        tile_2 += '1'
        flag = True
        
count_1, count_2 = 0, 0
for s in range(len(S)):
    if S[s] != tile_1[s]:
        count_1 += 1
    
    if S[s] != tile_2[s]:
        count_2 += 1
        
print(min(count_1, count_2))

Measured memory_bytes: 3316
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int max = a, min = a;
		
		for(int i = 1; i < n; i++) {
			a = sc.nextInt();
			if(min > a) {
				min = a;
			}else if(max < a) {
				max = a;
			}
		}
		System.out.print(max - min);
		
	}
}


Measured memory_bytes: 20564
#include <iostream>
#include <algorithm>
#include <map>
#include <utility>
#include <vector>
#include <cstdio>
#include <iomanip>
#include <cmath>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)


int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;

    int ans = N;
    for (int i = 1; i <= N; i++) {
        if (S[i-1] == S[i]) {
            --ans;
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
    int N;
    cin >> N;
    
    int A[N];
    rep(i,N){
        cin >> A[i];
    }
    bool flag = true;
    int i;
    
    for(i = N-1; i>=0; i--){
        if(A[i] - A[i-1] == -1){
            A[i - 1] = A[i-1]-1;
        }
        if(A[i] - A[i-1] < -1){
            flag = false;
        }
    }
    
    if(flag == true){
        cout << "Yes";
    }else{
        cout << "No";
    }
    
    return 0;
}

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

typedef long long ll;
const int INF = 1e9;
const ll LINF = 1e18;
const int mod = 1e9+7;

#define pi pair<int,int>
#define pl pair<lld,lld>

#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

#define mem0(x) memset(x,0,sizeof(x))
#define fillnum(x,n) fill(begin(x),end(x),n)
#define asort(x) sort(x.begin(),x.end())
#define dsort(x,t) sort(x.begin(),x.end(),greater<t>())
#define vuniq(x) x.erase(unique(x.begin(), x.end()), x.end())

#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)

int main() {
    string S; cin >> S;
    string D = "CODEFESTIVAL2016";
    ll cnt = 0;
    for (int i = 0; i < S.size(); i++) {
        if(S[i] != D[i]){
            cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3604
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;

int gcd(int a,int b){
	if(a==0 || b==0) return 0;
	while(a != b){
		if(a>b) a = a - b;
		else b = b - a;
	}
	return a;
}
int lcm(int a,int b){
	if(a==0 || b==0) return 0;
	int tmp = a/gcd(a,b);
	return tmp*b;
}

int main(){
	int a,b;
	while(cin >> a >> b){
		cout << gcd(a,b) << " " << lcm(a,b) << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
       Scanner scan= new Scanner(System.in);

        for(int i=0;;i++){
            int H=scan.nextInt();
            int W=scan.nextInt();
            if(W==0 && H==0){
                break;
            }

            for(int j=0;j<H;j++) {
                for (int k = 0; k < W; k++) {

                    if(j%2==0){
                        if(k%2==0){
                            System.out.print("#");
                        }else{
                            System.out.print(".");
                        }
                    }else{
                        if(k%2==0){
                            System.out.print(".");
                        }else{
                            System.out.print("#");
                        }
                    }
                }
                System.out.println();
            }
            System.out.println();
        }
    }
}



Measured memory_bytes: 35100
#include <bits/stdc++.h>
 
using namespace std;
using LL = long long int;

#define int long long
const int INF = 100000000000000000;

const int MAX_N = 100005;
const int MAX_M = 100005;

int N, M;
int A[MAX_M], B[MAX_M];

bool used[MAX_M];
vector<int> L[MAX_N];
vector<int> R[MAX_N];

signed main()
{
    int A[3];
    cin >> A[0] >> A[1] >> A[2];
    sort(A, A+3);
    
    cout << abs(A[0] - A[1]) + abs(A[1] - A[2]) << endl;

    return 0;
}

Measured memory_bytes: 6400
n,m = map(int,input().split())
dd = [[False]*n for _ in range(n)]
visited = [False]*n

a=[]
b=[]

for i in range(m):  
  ai,bi= map(int,input().split())  
  a.append(ai-1)
  b.append(bi-1)  
  dd[a[i]][b[i]] = dd[b[i]][a[i]] = True  

def dfs(v):
  visited[v] = True
  for v2 in range(n):
    if dd[v][v2] == False:
      continue
    if visited[v2] == True:
      continue
    dfs(v2)  
    
ans = 0
for i in range(m):
  dd[a[i]][b[i]] = dd[b[i]][a[i]] = False  
  
  for j in range(n):
    visited[j] = False
    
  dfs(0)
  
  if sum(visited) == n:
    ans +=1
    
  dd[a[i]][b[i]] = dd[b[i]][a[i]] = True
  
  
print(m-ans)  

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

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

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

#define SUM(vec) accumulate(all(vec),0LL) // 配列の中身を全部足す
template<typename T>void print(T&& x){cout<<x<<endl;}// 改行付き出力
ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
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 ctoi(char c){return c-'0';}

// TODO: write
int main() {
  string s;cin>>s;
  ll ans = 0;
  ll cnt = 0;
  rep(i,s.size()){
    if(s[i] == 'B')cnt++;
    else ans += cnt;
  }
  print(ans);
  return 0;
}



Measured memory_bytes: 640
def resolve():
    '''
    code here
    '''
    import collections
    N = int(input())
    D = [int(item) for item in input().split()]
    d_dict = collections.Counter(D)

    cnt = 0
    if D[0] != 0:
        pass
    else:
        cnt = 1
        for i in D[1:]:
            cnt *= d_dict[i-1]
            cnt %= 998244353


    print(cnt % 998244353)

if __name__ == "__main__":
    resolve()


Measured memory_bytes: 24520
#include <stdio.h>

int main() {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  int i, n;
  n = 0;
  for(i = a; i <= b; i++) {
    if(c % i == 0) n++;
  }
  printf("%d\n", n);
  return 0;
}

Measured memory_bytes: 2740