akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;


int main()
{
	int a, b;
	string op;
	cin >> a >> op >> b;
	if (op == "+") {
		cout << a + b << endl;
	}
	else {
		cout << a - b << endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
void printArray(int,int[]);
int solve(int,int,int,int[]);

int main(int argc, char** argv) {
    int size1, size2;
    scanf("%d\n", &size1);
    int array1[size1];
    for(int i = 0; i < size1; i++)
        scanf("%d", &array1[i]);
    scanf("%d\n", &size2);
    int array2[size2];
    for(int i = 0; i < size2; i++)
        scanf("%d", &array2[i]);
    
    for(int i = 0; i < size2; i++){
        if(solve(0, array2[i], size1, array1))
            printf("yes\n");
        else printf("no\n");
    }
    
    return (EXIT_SUCCESS);
}

void printArray(int size, int a[size]){
    for(int i = 0; i < size; i++){
        if(i != size - 1)
            printf("%d ", a[i]);
        else printf("%d\n", a[i]);
    }
}

int solve(int index, int val, int size, int a[size]){
    if(index < size && val-a[index] > 0 && solve(index+1, val-a[index], size, a))
        return 1;
    else if(index+1 > size) return 0;
    else if(val==a[index])return 1;
    return solve(index+1, val, size, a);
}



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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define RREP0(i, n) for (int i = (n)-1; i >= 0; --i)
#define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define RREP1(i, n) for (int i = (n); i >= 1; --i)
#define pow10(n) int(1e##n + n)

typedef long long LL;
typedef pair<int, int> P;

const int INTINF = int(1e9) + 1;
const LL LLINF = LL(1e18) + 1;
long double eps = 1.0E-14;

void solve()
{
    string s, t;
    cin >> s >> t;
    map<char, vector<int>> char_indices;
    REP0 (i, s.length())
    {
        char_indices[s[i]].push_back(i);
    }

    LL cnt = 0;
    int i_in_period = -1;
    int s_N = s.length();
    for (auto c : t)
    {
        if (char_indices.find(c) == char_indices.end())
        {
            std::cout << -1 << endl;
            return;
        }

        // 最も近い次の文字の出てくる添字を探す
        int ng = -1;
        int ok = char_indices[c].size();
        int mid = 0;
        while (abs(ok - ng) > 1)
        {
            mid = (ok + ng) / 2;
            if (i_in_period < char_indices[c][mid])
                ok = mid;
            else
                ng = mid;
        }

        if (ok == int(char_indices[c].size()))
        {
            cnt += s_N;
            i_in_period = char_indices[c][0];
        }
        else
        {
            i_in_period = char_indices[c][ok];
        }
    }
    cnt += i_in_period + 1;
    std::cout << cnt << endl;
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(20);
    solve();
    return 0;
}


Measured memory_bytes: 1228
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using namespace std;
using ll = long long;
const ll MOD = (ll)1e9+7;
//const ll MOD = 998244353;
//const ll MOD = 924844033;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
const double EPS = 1e-5;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

#ifdef DEBUG
#define OUTPUT(x) (output(x), outendl())
#else
#define OUTPUT(x) (void)0
#endif

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
}

bool was_output = false;
template<class t>
void output(t a){
	if(was_output)cout << " ";
	cout << a;
	was_output = true;
}
void outendl(){
	was_output = false;
	cout << endl;
}

int main(){
	set<int> s;
	s.insert(1);
	s.insert(2);
	s.insert(3);
	int n;
	cin >> n;
	s.erase(n);
	cin>>n;
	s.erase(n);
	cout << *s.begin() << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main () {
  long N;
  cin >> N;
  vector<long> data(N);
  long count;
  for(int i = 1; i <= N; i++){
    count = 1;
    while(count * i <= N){
      data.at(count * i - 1)++;
      count++;
    }
  }
  long ans = 0;
  for(long i = 1; i <= N; i++)ans += data.at(i - 1) * i;
  cout << ans << endl;
  return 0;
}

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


int main(){
    int N, X, L;
    int count = 1;
    int D = 0;
    std::cin >> N >> X;

    for(int i = 0; i < N; i++){
        std::cin >> L;
        D = D+L;
        if(D <= X){
            count++;
        }else{
            break;
        }

    }
    std::cout << count;

}

Measured memory_bytes: 3612
#include<stdio.h>

int main(){
    int n, m, c, i, j, ans = 0;
    int b[20] = {0}, x[20] = {0};
    int a[20][20] = {0};

    scanf("%d %d %d",&n,&m,&c);
    for(i = 0; i < m; i++){
        scanf("%d",&b[i]);
    }
    for(i = 0; i < n; i++){
        for(j = 0; j < m; j++){
            scanf("%d",&a[i][j]);
            x[i] += a[i][j] * b[j];
        }
        x[i] += c;
        if(x[i] > 0){
            ans++;
        }
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 128
#coding:utf-8

C = []
for i in range(3):
    C.append(list(map(int, input().split())))

ans = 0
A = []
B = []

for i in range(-200, 200):
   
    b1 = C[0][0] - i
    b2 = C[0][1] - i
    b3 = C[0][2] - i

    B.append(b1)
    B.append(b2)
    B.append(b3)

    A.append(i)
    A.append(C[1][0] - b1)
    A.append(C[2][0] - b1)

    for j in range(3):
        for k in range(3):
            #print(C[j][k], A[j] + B[k])
            if C[j][k] == A[j] + B[k]:
                continue
            else:
                ans = 1

if ans == 1:
    print("No")
else:
    print("Yes")


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

using namespace std;

const int MAX_N = 1000 + 7;

int X[MAX_N], Y[MAX_N];

int main() {
  int N, c = 0;

  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%d%d", &X[i], &Y[i]);

    if ((X[i] + Y[i]) & 1) c++;
    else c--;
  }

  if (abs(c) != N) {
    puts("-1");
    return 0;
  }

  int m = 31 + (c < 0);
  printf("%d\n", m);
  for (int i = 0; i < 31; i++)
    printf("%d ", (1 << i));
  if (c < 0) printf("1\n");
  else printf("\n");

  for (int i = 1; i <= N; i++) {
    int x = X[i];
    int y = Y[i];
    char ans[32 + 7] = {0};

    if (c < 0) {
      ans[31] = 'R';
      x--;
    }

    bool flag = 0;
    for (int j = 30; j >= 0; j--) {
      if (abs(x) < abs(y)) {
        swap(x, y);
        flag ^= 1;
      }

      if (x > 0) {
        x -= (1 << j);
        ans[j] = flag ? 'U' : 'R';
      }
      else {
        x += (1 << j);
        ans[j] = flag ? 'D' : 'L';
      }
    }

    puts(ans);
  }

  return 0;
}


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

using namespace std;
using LL = long long;
using P = pair<int, int>;

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

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = (int)1e9 + 7;

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

    string s;
    cin >> s;
    int ans = 0;
    REP(i, s.size()-1){
        if(s[i] != s[i+1]) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
const unsigned int m = 2e5;
 
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
   	int t;
   	//cin>>t;
   	t=1;
   	while(t--)
   	{
   		int a,b;
   		cin>>a>>b;
   		cout<<a*b<<endl;
   	}
	return 0;
}

Measured memory_bytes: 3648
import numpy as np
import itertools
Q = int(input())
LR = [[int(x) for x in input().split()] for _ in range(Q)]


## エラトステネスの篩
MAX = 10**5
is_prime = np.full(MAX, True)
is_prime[0] = is_prime[1] = False
for i in range(2, int(MAX**.5)+1):
    if is_prime[i]:
        is_prime[i*i::i] = False
        
NUM = np.zeros(MAX)
for p in range(MAX):
    if is_prime[p] and is_prime[(p+1)//2]:
        NUM[p] += 1

NUMcum = [0] + list(itertools.accumulate(NUM))

for l, r in LR:
    print(int(NUMcum[r+1] - NUMcum[l]))

Measured memory_bytes: 36464
import java.util.Scanner;

class Main{
 public static void main(String args[]){
  Scanner sc = new Scanner(System.in);
  int a = sc.nextInt();
  int b = sc.nextInt();
  if( a == b ){
   System.out.println("a == b");
  }else if(a < b){
   System.out.println("a < b");
   
  }else{
   System.out.println("a > b");
  }
 }
}


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

#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPL(i,a,n) for(ll i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define SORTVG(v) sort(v.begin(),v.end(),greater<>())
#define SORTV(v) sort(v.begin(),v.end())
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef tuple<int,int,bool> Tb;
typedef pair<int,int> Pii;
typedef vector<int> Vi;

template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}
template<class T> void YesNo(T& a) {if(a){cout << "Yes" << ENT;}else{cout << "No" << ENT;}}
template<class T> void YESNO(T& a) {if(a){cout << "YES" << ENT;}else{cout << "NO" << ENT;}}
template<class T> void AorB(T& a, string A,string B) {if(a){cout << A << ENT;}else{cout << B << ENT;}}


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


signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    atcoder();
    return 0;
}


Measured memory_bytes: 256
n = int(input())
s = input()

r=[]
g=[]
b=[]

for i in range(n):
    if s[i]=='R':
        r.append(i)
    if s[i]=='G':
        g.append(i)
    if s[i]=='B':
        b.append(i)

ans=len(r)*len(g)*len(b)

for i in range(n):
    for j in range(i+1,n):
        k=2*j-i
        if k<n and s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
            ans -= 1

print(ans)

Measured memory_bytes: 9152
import sys
import math

K,S = list(map(int,input().split()))

ans = 0
for i in range(K+1):
    if 2*K < S - i:
        continue
    for j in range(K+1):
        if K < S - i - j:
            continue
        if S >= i + j:
            ans += 1


print(ans)


Measured memory_bytes: 2940
import java.util.*;
public class Main {
    public static void main(String [] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int q = sc.nextInt();
        int time = 0;
        int [] T = new int[n];
        String [] Name = new String[n];
        Queue<Integer> L = new ArrayDeque<>();
        ArrayList<Integer> opt = new ArrayList<>();
        for(int i=0;i<n;i++){
            Name[i] = sc.next();
            T[i] = sc.nextInt();
            L.add(i);
        }
        while(L.size()!=0){
            int p_num = L.poll();
            if(T[p_num]-q>0){
                time+=q;
                T[p_num]-=q;
                L.add(p_num);
            }
            else{
                time+=T[p_num];
                T[p_num]=time;
                opt.add(p_num);
            }
        }
        for(int i:opt) System.out.println(Name[i]+" "+T[i]);
    }
}


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

void show( int rest ){
	int h = rest / 3600;
	rest %= 3600;
	int m = rest / 60;
	rest %= 60;
	int s = rest;
	cout << ( !( h / 10 ) ? "0" : "" ) << h << ":"
		 << ( !( m / 10 ) ? "0" : "" ) << m << ":"
		 << ( !( s / 10 ) ? "0" : "" ) << s << endl;
}

int main(){
	int h, m, s;

	while ( cin >> h >> m >> s && !( h == -1 && m == -1 && s == -1 ) ){
		int rest = 7200 - ( h * 3600 + m * 60 + s );
		show( rest );
		show( rest * 3 );
	}
	return 0;
}

Measured memory_bytes: 0
#include<stdio.h>

#define M 100
#define N 100
#define INF 10000000

int c[M][N];

typedef struct{
  int m;
  int n;
}GYORETSU;

void matrix(int *,int);
int min(int,int);

int main(){
  int i,j,k,n;
  int p[100];
  GYORETSU A[100];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d%d",&A[i].m,&A[i].n);
  }
  p[0]=A[0].m;
  p[1]=A[0].n;
  /* printf("p[0]=%d\np[1]=%d\n",p[0],p[1]); */
  for(i=2;i<n+1;i++){
    p[i]=A[i-1].n;
    /*    printf("p[%d]=%d\n",i,p[i]); */
  }
  
  matrix(p,n);
  printf("%d\n",c[1][n]); 
  return 0;
}
void matrix(int p[],int n){
  int i,j,k,l,q;
  
  for(i=1;i<n;i++){
    c[i][i]=0;
  }
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      c[i][j]=INF;
      for(k=i;k<=j-1;k++){
	q=c[i][k]+c[k+1][j]+p[i-1]*p[k]*p[j];
	c[i][j]=min(c[i][j],q);
	/*	printf("c[%d][%d]=%d\n",i,j,c[i][j]); */
      }
    }
  }
}
int min(int a,int b){
  if(a>=b)return b;
  else return a;
}

	
      
  



Measured memory_bytes: 2108
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
 
public class Hello{
    public static void Main(){
/*        string[] input = ReadLine().Split(' ');
        int n = int.Parse(input[0]);
        int m = int.Parse(input[1]);*/
//        int b = int.Parse(input[2]);
        string temp = ReadLine();
//        int a = int.Parse(ReadLine());
        if(temp[0] == temp[2]){
            WriteLine("Yes");
        }else{
            WriteLine("No");
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

using namespace std;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    double W,H,x,y;
    cin >> W >> H >> x >> y;
    cout << W*H/2 << " ";
    if(x==W/2 && y == H/2)cout << 1 << endl;
    else cout << 0 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define endl '\n'
#define int long long




signed main() { //[J][O][L][S][K][E][Y]
        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int n; cin >> n;
        int ans = 0;
        for (int i = 1; i <= n; i++) {
                if (i % 3 && i % 5)
                        ans+=i;
        }

        cout << ans;
        return 0;
}

/*

*/

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

int allnostone(int,int,int []);

int main(void){
	
	while(1){
		//入力
		int kouho_num,wan;
		cin >> kouho_num>> wan;
		if(kouho_num==0&&wan==0)
			break;

		//選出
		int current=0;
		int *kouho = new int[kouho_num];
		for(int i=0; i<kouho_num; i++)
			kouho[i]=0;
		while(1){
			if(wan!=0){
				kouho[current]++;
				wan--;
				if(wan==0){
					if( allnostone(kouho_num,current,kouho) )
						break;
				}
			}else if(kouho[current]!=0){
				wan+=kouho[current];
				kouho[current]=0;
			}
			current++;
			if(current>=kouho_num)
				current=0;
		}

		cout << current << endl;
	}
}

int allnostone(int kouho_num,int current,int kouho[]){
	for(int i=0; i<kouho_num; i++){
		if( current!=i&&kouho[i]!=0 )
		return 0;
	}
	return 1;
}

Measured memory_bytes: 908
import java.util.Scanner;

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

		for (int i = 1; i <= n; i++) {
			int x = i;
			if (x % 3 == 0) {
				System.out.print(" " + i);
			} else {
				do {
					if (x % 10 == 3) {
						System.out.print(" " + i);
						break;
					}
					x /= 10;
				} while (x != 0);
			}
		}

		System.out.println("");
	}
}



Measured memory_bytes: 28704
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define VIEW(x) do {cerr << #x << ": "; for(auto i : x) cerr << i << " "; cerr << endl;} while(0)
#define ALL(x) (x).begin(),(x).end()
template<class T>bool umax(T &a, const T &b) {if(a<b){a=b;return 1;}return 0;}
template<class T>bool umin(T &a, const T &b) {if(b<a){a=b;return 1;}return 0;}

template<typename A,size_t N,typename T> void FILL(A (&array)[N],const T &val){fill((T*)array,(T*)(array+N),val);}
template<typename T> void FILL(vector<T> &v, const T &x) {fill(v.begin(), v.end(), x);}
template<typename T> void FILL(vector<vector<T>> &v, const T &x) {for(auto &i:v)fill(i.begin(), i.end(), x);}


int main() {
  int h,w; cin >> h >> w;
  vector<string> s(h);
  rep(i,h) cin >> s[i];

  ll ans = 0;
  vector<pair<int,int>> MOVE = { make_pair(0,1), make_pair(1,0), make_pair(-1,0), make_pair(0,-1) };
  vector<vector<bool>> done(h, vector<bool>(w, false));

  rep(a,h) rep(b,w) {
    if(done[a][b]) continue;
    queue<pair<int,int>> q;
    done[a][b] = true;
    q.emplace(a,b);
    ll black=0, white=0;
    while(q.size()) {
      auto [i,j] = q.front(); q.pop();
      if(s[i][j]=='#') black++;
      else white++;
      for(auto [di, dj] : MOVE) {
        int ii = i + di, jj = j + dj;
        if(ii < 0 || ii >= h || jj < 0 || jj >= w) continue;
        if(s[i][j] == s[ii][jj]) continue;
        if(done[ii][jj]) continue;
        q.emplace(ii,jj);
        done[ii][jj]=true;
      }
    }
    ans += black * white;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3860
n,k = gets.chomp.split.collect{ |item| item.to_i}
s = gets.chomp
s.insert(0,"R")
s += "L"
 
ans = n
badn = 0
1.upto(n) do |i|
  if(s[i] == "R")
  	badn += 1 if (s[i] != s[i+1])
  else
    badn += 1 if (s[i] != s[i-1])
  end
end
ans -= [1,(badn - 2*k)].max
 
puts ans


Measured memory_bytes: 3836
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
# from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint

INF = float("inf")

def myinput():
    return map(int,input().split())

def mylistinput(n):
    return [ list(myinput()) for _ in range(n) ]

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

n = int(input())

# ls = ["a","b","c"]
# ans = list(combinations_with_replacement(ls,3))
# print(ans)

q = deque()
s = "a"
q.append(s)

while q:
    t = q.popleft()
    if len(t)==n:
        print(t)
    else:
        c = max(t)
        for j in range(97,ord(c)+2):
            nt = copy(t)
            nc = chr(j)
            nt += nc
            q.append(nt)

Measured memory_bytes: 61660
#include <stdio.h>
#include <math.h>

int main(void){
    int a,b,c;
    int t=0,h=0;
    
    while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
        if(a==b){
            if(c!=a*sqrt(2)) h++;
        }
        else{
            if(c==sqrt(a*a+b*b)) t++;
        }
    }
    printf("%d\n%d\n",t,h);
    return 0;
}


Measured memory_bytes: 2032
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(){

  int a, b, c, d, e, f, i, j, k;
  int N[100];

  scanf("%d", &a);
  if(a%2 !=0){
b = (a+1)/2.;
  c= (a-1)/2.;
    d = b*c;
  }
  d = a*a/4.;
  printf("%d\n", d);
  return 0;
}

Measured memory_bytes: 128
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "functional"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;

short dp[5001][5001];
short a[5001];
short b[5001];

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

	cin >> N >> M;
	for (int i = 1; i <= N; i++)cin >> a[i];
	for (int i = 1; i <= M; i++)cin >> b[i];
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++) {
			dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
			//dp[i][j + 1] = max(dp[i][j + 1], dp[i][j]);
			if (a[i + 1] == b[j + 1])dp[i + 1][j + 1] = max(dp[i + 1][j + 1], short(dp[i][j] + 1));
		}
	}
	short ans = 0;
	for (int i = 0; i <= 5000; i++) {
		for (int j = 0; j <= 5000; j++)ans = max(ans, dp[i][j]);
	}
	cout << ans << endl;
}


Measured memory_bytes: 52072
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <tuple>
#define rep(i,n) for (int i = 0; i < (n); i++)
typedef long long ll;

using namespace std;

int main()
{  
    int n;
    cin >> n;
    double ans = 0.0, A;
    rep(i,n){
        cin >> A;
        ans += 1.0 / A;
    }
    ans = 1.0 / ans;
    cout << setprecision(8) << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <algorithm>
#define INF 10000000
using namespace std;
typedef pair<int,int> P;

int n,m;
int p[1000];

int main(){
  while(1){
    cin >> n >> m;
    if(!n&&!m){
      return 0;
    }
    for(int i=0;i<n;i++){
      cin >> p[i];
    }
    sort(p,p+n);
    int sum=0;
    for(int i=1;i<=n;i++){
      if(i%m!=0){
        sum += p[n-i];
      }
    }
    cout << sum << endl;
  }
}

Measured memory_bytes: 1180
import java.io.PrintWriter
import java.util.*
import java.math.*
import java.lang.*

val pw = PrintWriter(System.out)
val MOD: Long = (1e+9 + 7).toLong()

fun main(args: Array<String>) {
    val (a, b, c, d) = readListOfInt() 
    val start = Math.max(a, c)
    val goal = Math.min(b, d)
    val ans = if(start < goal) goal - start else 0
    println(ans)
    pw.flush()
}

/****** Declared Functions and Data Structures ******/
// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }

fun Double.format(digits: Int) = String.format("%.${digits}f", this)
fun Float.format(digits: Int) = String.format("%.${digits}f", this)

fun print(value: Any) { pw.print(value) }
fun println(value : Any) { pw.println(value) }

fun<T> permutations(src: List<T>): List<List<T>> {
    if(src.size == 1) return listOf(src)
    val perms = mutableListOf<List<T>>()
    val insertElement = src[0]
    permutations(src.drop(1)).forEach { perm ->
        for(i in 0..perm.size) {
            val newPerm = perm.toMutableList()
            newPerm.add(i, insertElement)
            perms.add(newPerm.toList())
        }
    }
    return perms
}

// return nCr, if you want nCr, please access v[n][r]
fun combinations(n: Long): List<List<Long>> {
    val v = (0..n).map { (0..n).map{0L}.toMutableList() }.toMutableList()
    for(i in 0 until v.size) {
        v[i][0] = 1L
        v[i][i] = 1L
    }
    for(i in 0 until v.size) {
        for(j in 1 until i) {
            v[i][j] = (v[i-1][j-1] + v[i-1][j] % MOD)
        }
    }
    return v.map { it.toList() }.toList()
}

// should be a >= b
fun gcd(a: Long, b: Long): Long = 
    if(b == 0L) a else gcd(b, a % b)

// shoud be a >= b
fun lcm(a: Long, b: Long): Long = 
    a / gcd(a, b) * b

fun sumDigits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

fun isDecimal(v: Double): Boolean = ((v - Math.floor(v)) != 0.0)

// Data Structures
class Stack<T>(private var st: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = st.isEmpty()
    fun top(): T = st.last()
    fun push(e: T) { st.add(e) }
    fun pop() { st = st.dropLast(1).toMutableList() }
}

class Queue<T>(private var que: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = que.isEmpty()
    fun top(): T = que.first()
    fun push(e: T) { que.add(e) }
    fun pop() { que = que.drop(1).toMutableList() }
}


Measured memory_bytes: 35984
// g++ macro.cpp -std=c++14
#include <bits/stdc++.h> //STL include
typedef long long ll;// long long int
const ll INF = 10000000000;//INFinity
using namespace std;//namespace

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}//transform
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//#define int long long // yabai

#define dump(x)  cout << #x << " = " << (x) << endl;// debug cout

#define FOR(i,a,b) for(int i=(a);i<(b);++i)// for macro
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define ALL(obj) (obj).begin(),(obj).end()// iterator

#define pb(a) push_back(a)//push_back
#define mp make_pair// make_pair


int main(){

    string s;
    cin>>s;
    int a=-1;
    int b=-1;
    REP(i,s.size())FOR(j,i+1,(i+3>s.size()?s.size():i+3))if(s[i]==s[j]){a=i+1;b=j+1;break;}
    cout<<a<<" "<<b<<endl;

    return 0;
}


Measured memory_bytes: 512
#include <iostream>

using namespace std;

int main(){

	double w, h, x, y;
	cin >> w >> h >> x >> y;

	double ans = w * h / 2;
	printf("%.9lf ", ans);
	if (w / 2 == x && h / 2 == y) cout << "1" << endl;
	else cout << "0" << endl;

}

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

n = int(input())
d = {
    'AC': 0,
    'WA': 0,
    'TLE': 0,
    'RE': 0
}
for i in range(n):
    s = input().rstrip('\n')
    d[s] += 1

print('AC x ' + str(d['AC']))
print('WA x ' + str(d['WA']))
print('TLE x ' + str(d['TLE']))
print('RE x ' + str(d['RE']))


Measured memory_bytes: 67840
#include<iostream>
    #include<vector>
    #include<math.h>
    #include<bits/stdc++.h>
    #include<sstream>
     
    using namespace std;
     
    int main()
    {
        int n, ans = 0, final = 1;

        cin >> n;

        for(int i = 1; i <= n; i++)
        {
            int count = 0, num;

            num = i;

            while(num%2==0)
            {
                count++;
                num = num / 2;
            }

            if(count > ans)
            {
                final = i;
                ans = count;
            }
        }

        cout << final;
    } 

Measured memory_bytes: 3552
#include<iostream>
#include<cstdio>
#define LL long long
using namespace std;

int n;
char s[200005];
int main()
{
	int i,j;
	scanf("%d",&n);
	scanf("%s",s+1);
	for(i=1;i<=n;i++)
		if(s[i]=='W') break;
	for(j=n;j>i;j--)
		if(s[j]=='R') break;
	if(j<=i)
	{
		printf("0");
		return 0;
	}
	int cnt=0;
	for(;i<j;)
	{
		cnt++;
		for(i++;i<=n;i++)
			if(s[i]=='W') break;
		for(j--;j>i;j--)
			if(s[j]=='R') break;
	}
	printf("%d",cnt);
	return 0;
}

Measured memory_bytes: 4016
#include <stdio.h>

int main(void){


  int N;
  scanf("%d",&N);
  char S[100];
  scanf("%s",&S);
  int i;
  if(N%2!=0){
    printf("No");
  }
  else{
    for(i=0;i<N/2;i++){
      if(S[i]!=S[(N/2)+i]){
	break;
      }
    }
    if(i==(N/2)){
      printf("Yes");
    }
    else {
      printf("No");
    }
  }
return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define iter(i, c) for (auto i = (c).begin(); i != (c).end(); ++i)
#define riter(i, c) for (auto i = (c).rbegin(); i != (c).rend(); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int X, Y;
    cin >> X >> Y;
    int ans = 0;
    if (X == 1) ans += 300000;
    else if (X == 2) ans += 200000;
    else if (X == 3) ans += 100000;
    if (Y == 1) ans += 300000;
    else if (Y == 2) ans += 200000;
    else if (Y == 3) ans += 100000;
    if (X == 1 && Y == 1) ans += 400000;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <climits>
#include <iomanip>
#include <deque>

using namespace std;

int main()
{
  int a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int K;

  cin >> K;

  cout << a[K - 1];

  return 0;
}


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

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

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

  long long L[87];
  L[0] = 2;
  L[1] = 1;
  REP(i, n+1) {
    if (i == 0 || i == 1) { continue; }
    L[i] = L[i-1] + L[i-2];
  }
  cout << L[n] << endl;
  
  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main
{
    public static void main(String[] args)
    {
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        System.out.println((1000 - n%1000) % 1000);
    }
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
} 

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

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((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 EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

/*
1 5 2
11111
*/

int main() {
	int h, w, k; cin >> h >> w >> k;
	vector<string> f(h);
	for (int i = 0; i < h; i++) {
		cin >> f[i];
	}

	//横線区切る
	int ans = INF;
	for (int bit = 0; bit < (1 << h-1); ++bit) {
		int tmp = 0;
		
		//横線に応じた矩形の数、区切り+1個ある
		int nc = 1;
		for (int j = 0; j < h-1; j++) {
			if (bit&(1 << j)) {
				nc++;
				tmp++;
			}
		}
		vector<int> v(nc);

		
		bool valid = true;
		for (int j = 0; j < w; j++) {
			vector<int> vt(nc);
			int loc = 0;

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

				if (f[i][j] == '1')vt[loc]++;
				if (bit&(1 << i)) {
					loc++;
				}
			}

			for (int i = 0; i < nc; i++) {
				if (vt[i] > k)valid = false;
			}

			bool need_cut = false;
			for (int i = 0; i < nc; i++) {
				if (v[i]+vt[i] > k)need_cut = true;
			}
			
			if (need_cut) {
				tmp++;
				for (int i = 0; i < nc; i++) {
					v[i] = vt[i];
				}
			}
			else {
				for (int i = 0; i < nc; i++) {
					v[i] += vt[i];
				}
			}

		}



		if (valid) {
			ans = min(ans, tmp);
		}

	}

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

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

int main() {
    
    int i = 0;
    long long n;
    cin >> n;
    vector<long long>  a(n);
    for(i = 0;i<n;i++){
        cin >> a[i];
    }
    long long count = 0;
    for(i = 0;i<n;i= i+2){
        if(a[i] % 2 == 1){
            count++;
        }
    }
    cout << count <<endl;
}

Measured memory_bytes: 3628
#include<iostream>
using namespace std;
int main(){
    int h,r;
    cin >>h>>r;
    if(h>=0){
        cout<<1<<endl;
    }else if(h<0){
        if(r+h>0){
            cout<<1<<endl;
        }else if(r+h==0){
            cout<<0<<endl;
        }else{
            cout<<-1<<endl;
        }
    }

    return 0;
}


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

int main() {
    int n; cin >> n;
    string s1, s2;
    char c[2] = {'.', '#'};
    while ((int) s1.size() < n) {
        bool found = false;
        for (int c1 = 0; c1 < 2 && !found; ++c1) {
            for (int c2 = 0; c2 < 2 && !found; ++c2) {
                cout << s1 + c[c1] << '\n' << s2 + c[c2] << endl;
                string res; cin >> res;
                if (res != "F") {
                    found = true;
                    s1 += c[c1];
                    s2 += c[c2];
                }
            }
        }
        if (!found) break;
    }
    while ((int) s1.size() < n) {
        bool found = false;
        for (int c1 = 0; c1 < 2 && !found; ++c1) {
            for (int c2 = 0; c2 < 2 && !found; ++c2) {
                cout << c[c1] + s1 << '\n' << c[c2] + s2 << endl;
                string res; cin >> res;
                if (res != "F") {
                    found = true;
                    s1 = c[c1] + s1;
                    s2 = c[c2] + s2;
                }
            }
        }
        if (!found) break;
    }
    return 0;
}


Measured memory_bytes: 720
#include <iostream>
using namespace std;
int main() {
    long long width, height;
    bool gate, outergate = true;
    do {
        cin >> height >> width;
        if ((height == 0) && (width == 0)) {
            break;
        }
        for (long long j = 0; j < height; j++) {
            for (long long i = 0; i < width; i++) {
                if (gate) { 
                    cout << ".";
                    gate = false;
                } else {
                    cout  << "#";
                    gate = true;
                }
            }
            cout << "\n";
            if (outergate) {
                gate = true;
                outergate = false;
            } else {
                gate = false;
                outergate = true;
            }
        }
        cout << "\n";
        gate = false;
        outergate = true;
    } while (true);
}


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

using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
//typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = {0, 1, 0, -1};

const int INF = 1e9;

void enumerate(std::vector<std::pair<int, int>> &items, std::vector<std::pair<int, int>> &ps) {
  int L = items.size();
  REP(j, 1 << L) {
    int w = 0, v = 0;
    REP(k, L) {
      if (j >> k & 1) v += items[k].first, w += items[k].second;
    }
    ps.emplace_back(w, v);
  }
  sort(ALL(ps));
  int M = 1;
  REP(j, 1 << L) {
    if (ps[M-1].second < ps[j].second) {
      ps[M++] = ps[j];
    }
  }
  ps.resize(M);
}


int main() {
  // use scanf in CodeForces!
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N;
  std::cin >> N;
  std::vector<int> V(N), W(N);
  REP(i, N) std::cin >> V[i] >> W[i];

  int n_perm = std::min(N, (1 << 10) - 1);
  std::vector<std::vector<std::pair<int, int>>> permed(n_perm);

  REP(i, n_perm) {
    std::vector<std::pair<int, int>> items;
    int v = i;
    while (true) {
      items.emplace_back(V[v], W[v]);
      if (v == 0) {
        break;
      }
      v = (v - 1) / 2;
    }

    std::vector<std::pair<int, int>> ps;
    enumerate(items, ps);
    permed[i] = ps;
  }
  /*
  for (auto ps : permed) {
    for (auto p : ps) std::cout << '(' << p.first << ',' << p.second << ')' << ' ';
    std::cout << std::endl;
  }
  */

  int Q;
  std::cin >> Q;
  REP(_, Q) {
    int v, L;
    std::cin >> v >> L;
    v--;
    if (v < n_perm) {
      auto ans = std::lower_bound(ALL(permed[v]), std::make_pair(L, INF)) - 1;
      std::cout << ans->second << '\n';
    } else {
      std::vector<std::pair<int, int>> items;
      while (v >= n_perm) {
        items.emplace_back(V[v], W[v]);
        v = (v - 1) / 2;
      }
      int M = items.size();
      int ans = 0;
      REP(i, 1 << M) {
        int vv = 0, w = 0;
        REP(j, M) if (i >> j & 1) vv += items[j].first, w += items[j].second;
        if (w <= L) {
          auto cand = std::lower_bound(ALL(permed[v]), std::make_pair(L - w, INF)) - 1;
          ans = std::max(vv + cand->second, ans);
        }
      }
      std::cout << ans << '\n';
    }
  }
  return 0;
}

Measured memory_bytes: 10456
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
 
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;
 
#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second
 
int main(int argc, char **argv) {
	int n, i;
	cin >> n >> i;
	cout << (n - i + 1) << endl;
	return 0;
}
 

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

int main(void)
{
	string S;
	cin >> S;
	int l = S.size();
	int count = 0;
	
	rep(i, l/2) if(S[i]!=S[l-i-1]) count++;
	cout << count << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
ordered_set;	

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> para;
const ll inf = 1e18 + 7;
const ll maxN = 1e6 + 5;
const ll MOD = 1e9 + 7;

ll pow(ll a, ll b) {
	if (b == 0) return 1;
	ll d = pow(a, b / 2);
	ll z = 1;
	if (b % 2) z = a;
	return (((d * d) % MOD) * z) % MOD;
}

int a, b;

int main() {
	ios_base::sync_with_stdio(0);
	cin >> a >> b;
	RI(i, maxN) {
		double x = i * (double)(8.0 / 100);
		double y = i * (double)(10.0 / 100);
		//cout << x << " " << y << endl;
		if ((int)x == a && (int)y == b) {
			cout << i << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}


Measured memory_bytes: 256
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end

s=get_nsp
min=753
(s.size-2).times do|i|
  val=(s[i]+s[i+1]+s[i+2]).to_s.to_i 
  min=(753-val).abs if min>(753-val).abs
end
puts min

Measured memory_bytes: 1788
mod=10**9+7
n=int(input())
a=[format(int(i),'b') for i in input().split()]
d0=[0]*60
d1=[0]*60
ans=0
for i in a:
  d=i[::-1]
  l=len(i)
  for j in range(60):
    if j<l and d[j]=='1':
      d1[j]+=1
    else:
      d0[j]+=1
for j in range(60):
  ans+=d0[j]*d1[j]*(2**j)
  ans%=mod
print(ans)

Measured memory_bytes: 153064
#ifdef __unix__
#include <bits/stdc++.h>
#else
#include <iostream>
#include <algorithm>
#include <math.h>
#include <functional>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_set>
#endif


#define fastIO ios_base::sync_with_stdio(0), cin.tie(NULL)
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl '\n'
#define mkp make_pair
/*#define NUMTOSTR(x)  (unsigned char)((x) + 48);*/
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long  ull;
using namespace std;



int main() {
	fastIO;
	int n, k;
	cin >> n >> k;
	vector<int> fr;
	for (size_t i = 0; i < n; i++)
	{
		int temp;
		cin >> temp;
		fr.pb(temp);
	}
	sort(all(fr));
	int sum = 0;
	for (size_t i = 0; i < k; i++) sum += fr[i];
	cout << sum;
}


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

import sys

sys.setrecursionlimit(10**7)

# Override `input` function because `stdin.readline()` is 10x faster than built-in `input()`
input = sys.stdin.readline


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h(typ) if m > 1 else typ(input()) for _ in range(n)]


def main():
    n, = read_h()
    arr = read_h()
    #  print(arr)

    s = 0
    for a in arr:
        s ^= a

    if s == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


Measured memory_bytes: 14100
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <numeric>
#include <iomanip>
#include <cstdio>
#include <cmath>
using namespace std;


int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (a + b >= c) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back
#pragma GCC optimize ("-O3")

using namespace std;

#define DEBUG_IS_VALID

#ifdef DEBUG_IS_VALID
#define DEB 1 
#else
#define DEB 0
#endif
#define DUMPOUT cout
#define dump(...) if(DEB) DUMPOUT<<"  "<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl<<"    "; if(DEB) dump_func(__VA_ARGS__)
template<typename T1,typename T2>ostream& operator << (ostream& os, pair<T1,T2> p){cout << "(" << p.first << ", " << p.second << ")"; return os;}
template<typename T>ostream& operator << (ostream& os, vector<T>& vec) { os << "{"; for (int i = 0; i<vec.size(); i++) os << vec[i] << (i + 1 == vec.size() ? "" : ", "); os << "}"; return os; }
template<typename T>ostream& operator << (ostream& os, set<T>& st){for(auto itr = st.begin(); itr != st.end(); itr++) cout << *itr << (next(itr)!=st.end() ? ", " : ""); cout << "}"; return os;}
template<typename T1,typename T2>ostream& operator << (ostream& os, map<T1,T2> mp){cout << "{"; for(auto itr = mp.begin(); itr != mp.end(); itr++) cout << "(" << (itr->first) << ", " << (itr->second) << ")" << (next(itr)!=mp.end() ? "," : ""); cout << "}"; return os; }

void dump_func(){DUMPOUT << endl;}
template <class Head, class... Tail>void dump_func(Head&& head, Tail&&... tail){ DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...);}
template<class T> inline bool chmax(T& a,T const& b){if(a>=b) return false; a=b; return true;}
template<class T> inline bool chmin(T& a,T const& b){if(a<=b) return false; a=b; return true;}

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

const int mod=1e9+7,INF=1<<29;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll lmod = 1e9+7,LINF=1LL<<59; 

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N,T; cin >> N >> T ;
  vi c(N),t(N);
  rep(i,N) cin >> c[i] >> t[i] ;
  int mi = INF;
  rep(i,N){
    if(t[i]<=T) chmin(mi,c[i]);
  }
  if(mi!=INF) cout << mi << endl;
  else cout << "TLE" << endl;
  return 0;
}


Measured memory_bytes: 256
import math

A, B = map(int, input().split())

la = A/0.08
ra = (A+1)/0.08
lb = B/0.1
rb = (B+1)/0.1

ans = math.ceil(max(la, lb))
if ra <= lb or rb <= la:
  print(-1)
else:
  print(ans)

Measured memory_bytes: 3060