akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <typeinfo>
using namespace std;


// define list


namespace  math{
    const double PI = 3.14;
    const int INF = 1000000007;
    int GCM(int a,int b); //最大公約数
    int LCM(int a,int b); //最小公倍数
    int Pemu(int n,int r); //順列
    int Comb(int n,int m); //組み合わせ
    int Digit(int N); //桁和
    
    int GCM(int a,int b){
        if(a<b){
            swap(a,b);
        }
        int r = a%b;
        while (r!=0)
        {
            a=b;
            b=r;
            r=a%b;
        }
        return b;
    }

    int LCM(int a,int b){
        return a*(b/GCM(a,b));
    }

    int Pemu(int n,int r){
        int ans = n;
        for(int i=1;i<r;i++){
            ans*=(ans-i);
        }
        return ans;
    }

    int Comb(int n,int m){
        int a=n,b=m;
        for(int i=1;i<m;i++){
            a *= (a-i);
        }
        for(int i=1;i<m;i++){
            b *= (b-i);
        }
        
        return a/b;
    }

    int Digit(int N){
        if(N<10){
            return N;
        }
        int r = 0;
        while (N>=10)
        {
            r += (N%10);
            N /= 10;
        }
        r += N;
        return r;
    }
}

namespace SubLib{
    #define int long long
    #define double long double
    #define incin(n) int (n); cin >> (n);
    #define strcin(s) string (s); cin >> (s);
    #define incin2(a,b) int a,b; cin >> a >> b; 
    #define rap(n,i) for(int (i) = 0;i<(n);(i)++)
    #define input(n,v) (v) = SubLib::Input((n),(v))
    #define all(v) (v).begin(),(v).end()
    using intv = vector<int>;
    using strv = vector<string>;
    using charv = vector<char>;
    template <class T1>
    using pvec = vector<pair<T1,T1>>;
    template <typename T> vector<T> Input(int n,vector<T> v){
        for(int i=0;i<n;i++){
            cin >> v.at(i);
        }
        return v;
    }
}

using namespace math;
using namespace SubLib;

class Player{
    public:
        string card;
        int id;
        int trush;
        Player(){
            card = "";
            id = 0;
            trush = 0;
        };
};

signed main(){
    Player a,b,c;
    cin >> a.card >> b.card >> c.card;
    
    char pass = 'a';
    while (true)
    {   
        if(pass == 'a'){
            a.trush ++;
            if(a.trush > a.card.size()){
                cout << 'A' << endl;
                break;
            }
            pass = a.card[a.id];
            a.id ++;
        }
        if(pass == 'b'){
            b.trush ++;
            if(b.trush > b.card.size()){
                cout << 'B' << endl;
                break;
            }
            pass = b.card[b.id];
            b.id ++;
        }
        if(pass == 'c'){
            c.trush ++;
            if(c.trush > c.card.size()){
                cout << 'C' << endl;
                break;
            }
            pass = c.card[c.id];
            c.id ++;
        }
    }
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define MAX 100
#define MIN 1

int GetNumEqual( int *pNum );
void ComputePerimeter( int callValueA , int callValueB );
void ComputeArea( int callValueA , int callValueB );

int main( void )
{
    int height,width;
    
    if( 0 == GetNumEqual( &height ) )
    {
          if( 0 == GetNumEqual( &width ) )
          {
              ComputeArea( height , width );
              ComputePerimeter( height , width );
          }
    }
    
    return 0;
}

int GetNumEqual( int *pNum )
{
    int getNum;
    
    scanf( "%d" , &getNum );
    
    if( ( getNum >= MIN ) && ( getNum <= MAX ) )
    {
        *pNum = getNum;
        return 0;
    }
    
    return -1;
}

void ComputeArea( callValueA , callValueB )
{
    int computeResult;
	computeResult = callValueA * callValueB;
    
    printf( "%d " , computeResult );
}

void ComputePerimeter( callValueA , callValueB )
{
    int computeResult;
	computeResult = ( callValueA * 2 ) + ( callValueB * 2 );
    
    printf( "%d\n" , computeResult );
}

Measured memory_bytes: 1796
fun main() {
    val n = readInt()
    var pairs = 0L
    var currSum = 0L
    repeat(n) {
        val a = readInt()
        if (a == 0) {
            pairs += currSum/2
            currSum = 0
        }
        else currSum += a
    }
    pairs += currSum/2
    println(pairs)
}

// Input Reader
private fun readLn() = readLine()!!

private fun readInt() = readLn().toInt()

Measured memory_bytes: 56584
using System;
using static System.Console;
using System.Linq;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] tmp = ReadLine().Split(' ').ToArray();
            string S = tmp[0];
            string T = tmp[1];
            int[] nums = ReadLine().Split(' ').Select(int.Parse).ToArray();
            int A = nums[0];
            int B = nums[1];
            string U = ReadLine();
            if (U == S)
            {
                A = A - 1;
            }
            else
            {
                B = B - 1;
            }

            WriteLine("{0} {1}",A,B);
        }
    }
}

Measured memory_bytes: 13396
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
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;}

int main(){
  string s; cin >> s;
  
  for(int bit = 0; bit < (1<<3);bit++){
    int tmp = s[0] - '0';
    string ans = "";
    ans.push_back(s[0]);
    rep(i,3){
      if(bit & (1<<i)){
        tmp += s[i+1] - '0';
        ans = ans + "+";
        ans.push_back(s[i+1]);
      }else{
        tmp -= s[i+1] - '0';
        ans = ans + "-";
        ans.push_back(s[i+1]);
      }
    }
    ans = ans + "=7";
    if(tmp==7){
      cout << ans << endl;
      return 0;
    }
  }
  
  return 0;
}

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

int main() {
    int L, R, d;
    cin >> L >> R >> d;

    int res = 0;
    for (int i = L; i < R + 1; i++) {
        if (i % d == 0) res++;
    }

    cout << res << endl;
}

Measured memory_bytes: 3584
import sys
input = sys.stdin.readline
a,b,m = map(int,input().split())
als = list(map(int,input().split()))
bls = list(map(int,input().split()))
xyc = [list(map(int,input().split())) for i in range(m)]
ans = min(als)+min(bls)
for x,y,c in xyc:
  ans = min(ans,als[x-1]+bls[y-1]-c)
print(ans)

Measured memory_bytes: 38436
import itertools
import math
import sys

n, k = map(int, input().split())
al = list(map(int, input().split()))

print(math.ceil((n - k) / (k - 1)) + 1)
# ix = al.index(1)
# print(ix)
# cnt = 0
# if k >= ixx or k >= (n - ixx):
#     x = k
#     cnt += 1
#     while (x < n):
#         x += k
#         cnt += 1

# else:


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


def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    count = 0
    add = []
    # mini = 0

    cb = [None]*m
    for i in range(m):
        b, c = map(int, input().split())
        cb[i] = (c, b)

    cb.sort(reverse=True)

    for c, b in cb:
        count += b
        add += [c]*b
        if count >= n:
            # mini = c
            break

    # add = add[:n]  # 追加のカードを削るかどうか
    # a.sort()  # 昇順
    # idx = len(a)//2
    # for _ in range(10):
    #     if a[idx] <= mini:  # aの中央がminiより小さい
    #         a = a[idx:]
    #         idx = len(a)//2
    #     else:
    #         idx //= 2

    new_a = a + add
    new_a.sort(reverse=True)

    print(sum(new_a[:n]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 25740
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
    long int x, y, z;
    long int answer;
    scanf("%ld %ld %ld", &x, &y, &z);
    answer = (x-z)/(y+z);
    printf("%ld\n", answer);

    return 0;
}

Measured memory_bytes: 128
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()
T = input()

ans = 0
for s, t in zip(S, T) :
    if s == t :
        ans += 1

print(ans)


Measured memory_bytes: 43504
n = input()
a = list(n)
k = int(input())
n = len(a)
for i in range(n):
    a[i] = int(a[i])
dp = [[[0 for i in range(2)] for i in range(k+2)]for i  in range(n)]
dp[0][0][0] = 1
dp[0][1][0] = a[0]-1
dp[0][1][1] = 1
for i in range(n-1):
    for j in range(k+1):
        if a[i+1] == 0:
            dp[i+1][j][1] += dp[i][j][1]
            dp[i+1][j][0] += dp[i][j][0]
            dp[i+1][j+1][0] += dp[i][j][0]*9
        else:
            dp[i+1][j][0] += dp[i][j][0]+dp[i][j][1]
            dp[i+1][j+1][0] += dp[i][j][1]*(a[i+1]-1)+dp[i][j][0]*9
            dp[i+1][j+1][1] += dp[i][j][1]
print(dp[n-1][k][0]+dp[n-1][k][1])

Measured memory_bytes: 63104
#include <bits/stdc++.h>
using namespace std;
struct point{
	double x,y;
	point(){;}
	point(double a,double b):x(a),y(b){;}
};
vector<point> v;
double dis(point p1,point p2){
	return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
}

void dfs(int d,point pl,point pr){
	if(d<=0)return;
	// 1/3 1/2 2/3加3个点 
	point p1,p2,p3;
	p1.x=pl.x/3*2+pr.x/3;
	p1.y=pl.y/3*2+pr.y/3;
	dfs(d-1,pl,p1);
	v.push_back(p1);

	point vert;
	vert.x=-(pr.y-pl.y);
	vert.y=(pr.x-pl.x);
	vert.x/=2*sqrt(3);
	vert.y/=2*sqrt(3);

	p2.x=(pl.x+pr.x)/2+vert.x;
	p2.y=(pl.y+pr.y)/2+vert.y;
	dfs(d-1,p1,p2);
	v.push_back(p2);

	p3.x=pl.x/3+pr.x/3*2;
	p3.y=pl.y/3+pr.y/3*2;
	dfs(d-1,p2,p3);
	v.push_back(p3);
	dfs(d-1,p3,pr);
}
int main(){
	int n;cin>>n;
	v.push_back(point(0,0));
	dfs(n,point(0,0),point(100,0));
	v.push_back(point(100,0));
	for(int i=0;i<v.size();i++)
		printf("%.6f %.6f\n",v[i].x,v[i].y);
	return 0;
}


Measured memory_bytes: 3236
N, K = map(int, input().split())
D = list(map(int, input().split()))

ans = 99999
for i in range(99999, N-1, -1):
    for j in range(5):
        if 10**j > i:
            continue
        if (i//(10**j))%10 in D:
            break
    else:
        ans = i

print(ans)

Measured memory_bytes: 9060
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric> // accumulate
#include <queue>
#include <string>
#include <cmath> // sqrt
#include <map>
using namespace std;
typedef long long ll;


int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    map<int, int> memo;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        memo[a[i]] += 1;
    }

    sort(a.begin(), a.end());

    int count = 0;
    for (int t = 30; t > 0; t--) {
        for (int i = n-1; i >= 0; i--) {
            if (memo[a[i]] == 0) continue;
            if (((1 << t) - a[i]) > a[n-1]) continue;
            if (((1 << t) - a[i]) < 1) continue;
            int front = lower_bound(a.begin(), a.end(), (1 << t) - a[i]) - a.begin();
            int back = upper_bound(a.begin(), a.end(), (1 << t) - a[i]) - a.begin();
            if (front == back) continue;
            if (a[front] == a[i] && memo[a[i]] <= 1) continue;
            if (memo[a[front]] >= 1) {
                memo[a[front]] -= 1;
                memo[a[i]] -= 1;
                count += 1;
            }

        }
    }

    cout << count << endl;

    return 0;
}

Measured memory_bytes: 10496
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int v[110], w[110], W, N;
int dp[10010];

int main(){
	cin >> N >> W;
	REP(i, N){
		cin >> v[i] >> w[i];
	}

	for (int i = 0; i < N; i++){
		for (int j = W; j >= w[i]; j--){
			dp[j] = max(dp[j], dp[j - w[i]] + v[i]);
		}
	}
	cout << dp[W] << endl;
}

Measured memory_bytes: 1204
require 'pp'

H = {}
N,d=gets.chomp.split(' ').map{|n| n.to_i}
if(N == 0)
	puts 0
	exit(0)
end
0.upto(N-1){|i|
	s = gets.chomp
	H[s].nil? ? H[s]=1 : H[s]+=1
}
M,d=gets.chomp.split(' ').map{|n| n.to_i}
B = Array.new(M)
0.upto(M-1){|i|
	s = gets.chomp
	H[s].nil? ? H[s]=-1 : H[s]-=1
}

max = H.sort{|(k1,v1),(k2,v2)|v2<=>v1}[0][1]
if(max <= 0)
	puts 0
else
	puts max
end




Measured memory_bytes: 2172
using System;
using System.Collections.Generic;
using System.Text;

namespace AtTest.D_Challenge
{
    class ABC_068
    {
        static void Main(string[] args)
        {
            Method(args);
            Console.ReadLine();
        }

        static void Method(string[] args)
        {
            long k = ReadLong();
            long delta = k / 50;
            long margin = k % 50;
            Console.WriteLine(50);
            for(int i = 0; i < 50; i++)
            {
                long val = i < margin ? 100 - margin : 49 - margin;
                val += delta;
                Console.Write(val + " ");
            }
        }

        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


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

int main() {
  int n, x;
  cin >> n >> x;
  vector<int> m(n);
  long long tmp = 0;
  for (int i=0; i<n; ++i) {
    cin >> m[i];
    tmp += m[i];
  }
  sort(m.begin(), m.end());
  x -= tmp;
  cout << n+(x/m[0]) << endl;
  return 0;
}
  


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

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


Measured memory_bytes: 3212
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<ctime>

using namespace std;
using ll = long long;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  int k, n; cin >> k >> n;
  vector<int> a(n+1, 0);
  for(int i = 0; i < n; i++) cin >> a[i];
  int maxi = 0;
  a[n] = k;
  for(int i = n-1; i >= 0; i--) a[i] -= a[0];
  for(int i = 0; i < n; i++){
    maxi = max(maxi, abs(a[i] - a[i+1]));
  }
  cout << k - maxi << endl;

  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}


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

int main(){
string s,o,w;
int n,a,b;
cin>>s>>n;
for(int x=0;x<n;x++){

cin>>o>>a>>b;

if(o=="print"){
cout<<s.substr(a,b-a+1)<<endl;
}

if(o=="reverse"){
for(int i=a,j=b;i<j;i++,j--){
swap(s[i],s[j]);
}}

if(o=="replace"){
cin>>w;
s=s.substr(0,a)+w+s.substr(b+1);
}


}

return 0;
}


Measured memory_bytes: 3188
N = int(input())
ABC = [list(map(int,input().split())) for _ in range(N)]

dp = [[0 for _ in range(3)] for _ in range(N)]
for i in range(N):
  for j in range(3):
    if i == 0:
      dp[i][j] = ABC[0][j]
    else:
      dp[i][j] = max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3]) + ABC[i][j]
print(max(dp[N-1][0],dp[N-1][1],dp[N-1][2]))

Measured memory_bytes: 75992
import sys
from collections import deque
def input(): return sys.stdin.readline().rstrip()

def main():
    K = int(input())
    q = deque()
    for i in range(1, 10):
        if K == 1:
            print(i)
            exit()
        K -= 1
        q.append(i)
    while q:
        v = q.popleft()
        sv = int(str(v)[-1])
        for i in (-1, 0, 1):
            if 0 <= sv + i < 10:
                if K == 1:
                    print(v * 10 + sv + i)
                    exit()
                K -= 1
                q.append(v * 10 + sv + i)

if __name__ == '__main__':
    main()


Measured memory_bytes: 6084
s = input()
t = input()

inf = pow(10, 4)
dp = [[0]*(len(t)+1) for _ in range(len(s)+1)]
key = [[0]*(len(t)+1) for _ in range(len(s)+1)]
for i in range(len(s)+1):
  for j in range(len(t)+1):
    if i == 0 and j == 0:
      continue
    if i == 0:
      dp[i][j] = dp[i][j-1]
      continue
    if j == 0:
      dp[i][j] = dp[i-1][j]
      continue
    if s[i-1] == t[j-1]:
      dp[i][j] = dp[i-1][j-1] + 1
      key[i][j] = (i-1)*inf+(j-1)
    else:
      if dp[i-1][j] > dp[i][j-1]:
        dp[i][j] = dp[i-1][j]
        key[i][j] = key[i-1][j]
      else:
        dp[i][j] = dp[i][j-1]
        key[i][j] = key[i][j-1]

ans = []
i, j = key[len(s)][len(t)]//inf, key[len(s)][len(t)]%inf
while True:
  if s[i] == t[j]:
    ans.append(s[i])
  if i == 0 or j == 0:
    break
  i, j = key[i][j]//inf, key[i][j]%inf

ans.reverse()
print("".join(ans))

Measured memory_bytes: 176904
package main

import(
	"fmt"
	"os"
	"bufio"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var s, t string
	if sc.Scan() {
		s = sc.Text()
	}

	if sc.Scan() {
		t = sc.Text()
	}

	sei := strings.Split(s, "")
	ten := strings.Split(t, "")

	ans := 0

	for i := 0; i < 3; i++ {
		if sei[i] == ten[i]{
			ans++
		}
	}

	fmt.Println(ans);
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define rep1(i, n) for (int i = 1; i < int(n); ++i)
#define repx(i, x, n) for (int i = int(x); i < int(n); ++i)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; --i)
#define ALL(n) begin(n), end(n)
#define IN(a, x, b) ((a) <= (x) && (x) < (b))
#define OUT(a, x, b) ((x) < (a) || (x) < (b))
typedef long long ll;
typedef long double ld;
const ll INF = 1e18;
const ll MOD = 1000000007;

using Graph = vector<vector<int>>;

struct UnionFind
{
    vector<int> par;

    UnionFind(int N) : par(N)
    {
        rep(i, N) par[i] = i;
    }

    int root(int x)
    {
        if (par[x] == x)
            return x;
        else
            par[x] = root(par[x]);

        return par[x];
    }

    void unite(int x, int y)
    {
        int rx = root(x), ry = root(y);
        if (rx == ry)
            return;
        par[rx] = ry;
    }

    bool same(int x, int y)
    {
        int rx = root(x), ry = root(y);
        return rx == ry;
    }
};

int main()
{
    int N, K, L;
    cin >> N >> K >> L;
    UnionFind road(N), rail(N);
    rep(i, K)
    {
        int p, q;
        cin >> p >> q;
        p--;
        q--;
        road.unite(p, q);
    }
    rep(i, L)
    {
        int p, q;
        cin >> p >> q;
        p--;
        q--;
        rail.unite(p, q);
    }

    map<pair<int, int>, int> mp;

    rep(i, N)
    {
        pair<int, int> v(road.root(i), rail.root(i));
        mp[v]++;
    }
    rep(i, N)
    {
        pair<int, int> p(road.root(i), rail.root(i));
        cout << mp[p] << " ";
    }
    cout << endl;

    // rep(i, N)
    // {
    //     cout << road.root(i) << " " << rail.root(i) << endl;
    // }

    return 0;
}


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

int main(){
  int max=0;
  string s;
  cin >> s;
  for(int i=0;i<s.size();i++){
    if(s[i]!='A' && s[i]!='T' && s[i]!='G' && s[i]!='C')continue;
    else{
      int count=0;
      for (int j=i;j<s.size();j++){
        if(s[j]!='A' && s[j]!='T' && s[j]!='G' && s[j]!='C')break;
        count++;
        if(max<count)max=count;
      }
    }
  }
  cout << max << endl;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var A, B, K int
	fmt.Scan(&A, &B, &K)

	takahashi := true
	for i := 0; i < K; i++ {
		if takahashi {
			if A%2 != 0 {
				A--
			}
			B += A / 2
			A /= 2
		} else {
			if B%2 != 0 {
				B--
			}
			A += B / 2
			B /= 2
		}
		takahashi = !takahashi
	}
	fmt.Println(A, B)
	return
}


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

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
const int INFTY =2147483647;
int main(){
    int n;
    cin>>n;
    cout<<n/2+n%2<<endl;
}

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

int main(){
    ll n;
    cin >> n;
    ll sum = 0;
    vector<ll> a(n);
    for(ll i = 0; i < n; i++){
        cin >> a[i];
        sum += a[i];
    }
    ll sunuke = a[0], ans = abs(sum - 2 * sunuke);
    for(ll i = 1; i < n - 1; i++){
        sunuke += a[i];
        ans = min(ans, abs(sum - 2 * sunuke));
    }
    cout << ans << endl;
}

Measured memory_bytes: 4760
#include <cstdio>
#include <cstdint>
#include <vector>
#include <utility>
#include <algorithm>

namespace detail {
template <typename Tp, size_t N>
std::vector<Tp> make_vector(
    std::vector<size_t>& sizes,
    typename std::enable_if<(N == 1), Tp const&>::type x
) {
  return std::vector<Tp>(sizes[0], x);
}
template <typename Tp, size_t N>
auto make_vector(
    std::vector<size_t>& sizes,
    typename std::enable_if<(N > 1), Tp const&>::type x
) {
  size_t size = sizes[N-1];
  sizes.pop_back();
  return std::vector<decltype(make_vector<Tp, N-1>(sizes, x))>(
      size, make_vector<Tp, N-1>(sizes, x)
  );
}
}  // detail::

template <typename Tp, size_t N>
auto make_vector(size_t const(&sizes)[N], Tp const& x) {
  std::vector<size_t> s(N);
  for (size_t i = 0; i < N; ++i) s[i] = sizes[N-i-1];
  return detail::make_vector<Tp, N>(s, x);
}

int main() {
  size_t n, k;
  scanf("%zu %zu", &n, &k);

  auto dp = make_vector<int>({k+1, k+k+1}, 0);
  for (size_t i = 0; i < n; ++i) {
    size_t x, y;
    char c;
    scanf("%zu %zu %c", &x, &y, &c);
    x %= k+k;
    y %= k+k;
    if (y >= k) {
      (x += k) %= k+k;
      y += k;
    }
    if (c == 'W') (x += k) %= k+k;
    y %= k;

    ++dp[y+1][x+1];
  }

  for (size_t i = 0; i <= k; ++i)
    for (size_t j = 1; j <= k+k; ++j)
      dp[i][j] += dp[i][j-1];

  for (size_t j = 0; j <= k+k; ++j)
    for (size_t i = 1; i <= k; ++i)
      dp[i][j] += dp[i-1][j];

  size_t res = 0;
  for (size_t i = 0; i < k; ++i)
    for (size_t j = 0; j < k; ++j) {
      size_t cur = dp[i][j];
      cur += dp[k][j+k] - dp[k][j] - dp[i][j+k] + dp[i][j];
      cur += dp[i][k+k] - dp[i][j+k];

      res = std::max({res, cur, n-cur});
    }
  printf("%zu\n", res);
}


Measured memory_bytes: 8064
package main

import (
	"fmt"
)

func main(){
	var h, w, aij, n int
	fmt.Scan(&h, &w)
	matrix := make([][]int, h)
	ans_list := make([][4]int, 0, 500*500)
	for i:=0; i<h; i++{
		matrix[i] = make([]int, w)
	}
	for i:=0; i<h; i++{
		for j:=0; j<w; j++{
			fmt.Scan(&aij)
			matrix[i][j] += aij
			if i == h-1 && j == w-1{
				break
			} else if i != h-1 && matrix[i][j] % 2 == 1{
				n++
				ans_list = append(ans_list, [4]int{i+1, j+1, i+2, j+1})
				// matrix[i][j] -= 1//
				matrix[i+1][j] += 1
			} else if i == h-1 && matrix[i][j] % 2 == 1{
				n++
				ans_list = append(ans_list, [4]int{i+1, j+1, i+1, j+2})
				// matrix[i][j] -= 1//
				matrix[i][j+1] += 1
			}
		}
	}
	// fmt.Print(matrix)//
	fmt.Println(n)
	for _, list := range(ans_list){
		fmt.Printf("%d %d %d %d\n", list[0], list[1], list[2], list[3])
	}
}

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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n;
	cin >> n;
	vector<int> v(n), c(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> c[i];
	}
	int sum = 0;
	for (int i = 0; i < n; i++) {
		if (v[i] > c[i]) {
			sum += v[i] - c[i];
		}
	}
	cout << sum << '\n';	
	
	return 0;
}


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

int main(){
int M,N,j,b,max,k,an,a;
  j=0;
  an=0;
  a=0;
  cin>>N>>k;
  vector<int>A(N),C(N+1);
      for(int i=0;i<N+1;i++){
      C[i]=0;
  }
    for(int i=0;i<N;i++){
  cin>>A[i];
      C[A[i]]++;
  }
  sort(C.begin(),C.end());
  
  for(int i=0;i<N-k+1;i++){
an+=C[i];
    }
              cout<<an<<endl;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <math.h>
#include <string.h>
typedef long long ll;
int main(int argc,int *argv[])
{
	char s[4];
	scanf("%s",s);
	if(s[0]==s[1] && s[0]==s[1] && s[1]==s[2])
		printf("No");
	else
		printf("Yes");
		return 0;
}

Measured memory_bytes: 128
#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
// -----------------------------------------------

#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($arg:expr),*) => {
        #[cfg(debug_assertions)]
        $(writeln!(stderr(), "{} = {:?}", stringify!($arg), $arg).unwrap());*
    };
}

#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let (N, M, Q) = read!(usize, usize, usize);

    // dp[l][r] = (都市 l から r への列車の本数)
    let mut dp = vec![vec![0; N + 1]; N + 1];

    for _ in 0..M {
        let (l, r) = read!(usize, usize);
        dp[l][r] += 1;
    }

    // 累積和
    // dp'[l][r] = sum { 都市 l から q への列車の本数 | q <= r }
    for l in 1..N + 1 {
        for r in 1..N {
            dp[l][r + 1] += dp[l][r];
        }
    }

    // 累積和
    // dp''[l][r] = sum { 都市 p から q への列車の本数 | p <= l, q <= r }
    for r in 1..N + 1 {
        for l in (2..N + 1).rev() {
            dp[l - 1][r] += dp[l][r];
        }
    }

    // O(Q)
    for _ in 0..Q {
        let (p, q) = read!(usize, usize);
        println!("{}", dp[p][q])
    }
}


Measured memory_bytes: 4988
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	
	void doIt() {
		sB();
	}
	
	void sB() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int cnt[] = new int[m + 1];
		Arrays.fill(cnt, 0);
		for(int i = 0; i < n; i++) {
			int k = sc.nextInt();
			for(int j = 0; j < k; j++) {
				cnt[sc.nextInt()]++;
			}
		}
		int ans = 0;
		for(int i = 1; i <= m; i++) {
			if(cnt[i] == n) ans++;
		}
		System.out.println(ans);
	}
	
	public static void main(String[] args) {
		new Main().doIt();
	}
}


Measured memory_bytes: 22484
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;

int main(){
    int N, K;
    cin >> N >> K;
    int h[N];
    for(int i = 0; i < N; i++) cin >> h[i];
    
    int ans = 0;
    
    for(int i = 0; i < N; i++)
        if(h[i] >= K) ans++;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 640
/*
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <cmath>
#include <numeric>

int main()
{
    long long n, a, b;
    std::cin >> n;
    std::vector<std::pair<int, int>> ba;

    for (long long i = 0; i < n; i++)
    {
        std::cin >> a >> b;
        ba.push_back(std::pair<int, int>(b, a));
    }

    std::sort(ba.begin(), ba.end());

    long long sum = 0;

    for (int i = 0; i < ba.size(); i++)
    {
        sum += ba[i].second;
        if (sum > ba[i].first)
        {
            std::cout << "No" << std::endl;
            return 0;
        }
    }

    std::cout << "Yes" << std::endl;
    return 0;
}

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

using namespace std;

int main(){
  int K;
  cin >> K;
  
  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};
  
  cout << a[K - 1] << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define bitrep(X,N) for(ll X = 0; X < (1 << (N)); X++)
#define PI (acos(-1.0))
#define sorta(V) sort(V.begin(), V.end())
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end() 
#define CERR if(false) cerr

using namespace std;


int main(){

    int n,m,x;
    cin >> n >> m >> x;

    vector<int> a;

    int left = 0;
    int right = 0;

    rep(i,m){
        int tmp;
        cin >> tmp;

        if(tmp < x){
            left++;
        }else right++;
    }

    cout << min(left,right) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100003;
int n,a[MaxN],a1,a2;
int s1,s2;
int main() {
	scanf("%d",&n);
	for (int i=1;i<=n;++i) scanf("%d",a+i);
	sort(a+1,a+n+1);
	if (a[n]-a[1]>1) {
		puts("No");
		return 0;
	}
	if (a[n]==a[1]) {
		if (a[n]==n-1) {
			puts("Yes");
			return 0;
		}
		if (a[n]>n/2) {
			puts("No");
		} else {
			puts("Yes");
		}
		return 0;
	}
	s1=s2=0;
	for (int i=1;i<=n;++i) {
		if (a[i]==a[1]) s1++;
		if (a[i]==a[n]) s2++;
	}
	int d1=a[n]-s1;
	if (d1<1 || d1>s2/2) puts("No");
	else puts("Yes");
	return 0;
}

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

//入力の際に必要
using namespace std;

int main(){

    //cinが入力の意味
    int n, a, b; cin >> n >> a >> b;

    //ansを定義
    int ans = min(a*n,b);

    //cout << 〜　で〜を出力
    //endlで改行
    cout << ans << endl;

}

Measured memory_bytes: 256
n,k=map(int,input().split())
x,y=[[0,0] for i in range(n)],[[0,0] for i in range(n)]
xy=[list(map(int,input().split())) for i in range(n)]
for i in range(n):
    x_sub,y_sub=xy[i]
    x[i][0]=x_sub
    x[i][1]=i
    y[i][0]=y_sub
    y[i][1]=i
x.sort()
y.sort()
ans=(10**18)*5
for i1 in range(n):
    for l1 in range(n-i1,1,-1):
        for i2 in range(n):
            for l2 in range(n-i2,1,-1):
                x_sub1=x[i1][0]
                x_sub2=x[i1+l1-1][0]
                y_sub1=y[i2][0]
                y_sub2=y[i2+l2-1][0]
                z=[0]*n
                for i in range(n):
                    if x_sub1<=xy[i][0]<=x_sub2 and y_sub1<=xy[i][1]<=y_sub2:
                        z[i]=1
                if sum(z)>=k:
                    ans=min((x_sub2-x_sub1)*(y_sub2-y_sub1),ans)
print(ans)


Measured memory_bytes: 49244
<?php
$x=trim(fgets(STDIN));
$y=explode(' ',$x);
$a=(int)$y[0];
$b=(int)$y[1];
if($a<$b){echo "a < b\n";}
elseif($b<$a){echo "a > b\n";}
else{echo "a == b\n";}

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


int main(){
    string s, t;
    cin >> s >> t;
    int cnt = 0;

    for(int i=0; i<3; i++){
        if(s.at(i) == t.at(i)){
            cnt++;
        }
    } 
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	string N;
	bool flag = false;
	while (cin >> N) {
		if (flag)cout << endl;
		flag = true;
		int num = 5 - N.size();
		for (int i = 0; i < num; ++i) {

			N.insert(N.begin(), '0');
		}
		vector<vector<int>>memo{
			{ 1,0,1,0,1,1,1,1},
			{ 1,0,1,1,0,1,1,1 },
			{ 1,0,1,1,1,0,1,1 },
			{ 1,0,1,1,1,1,0,1 },
			{ 1,0,1,1,1,1,1,0 },
			{ 0,1,1,0,1,1,1,1 },
			{ 0,1,1,1,0,1,1,1 },
			{ 0,1,1,1,1,0,1,1 },
			{ 0,1,1,1,1,1,0,1 },
			{ 0,1,1,1,1,1,1,0 },

		};
		vector<string>field(8, "     ");
		for (int i = 0; i < 5; ++i) {
			for (int j = 0; j < 8; ++j) {
				field[j][i] = j == 2 ? '=' : memo[N[i] - '0'][j] ? '*' : ' ';
			}
		}
		for (int i = 0; i < field.size(); ++i) {
			cout << field[i] << endl;
		}
	}
	return 0;
}

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

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  long long p = 1;
  for (int i = 1; ; ++i) {
    p *= 3;
    if (n <= p) {
      cout << i << '\n';
      return 0;
    }
  }
}



Measured memory_bytes: 3212
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define sc(x) scanf("%d",&x);
int main(){
    int n, k;
    sc(n) sc(k)
    vector<int> x(n), neg, pos;
    for (int i = 0; i < n; i++) sc(x[i])
    int zero = 0, now = 0, ans = 1e9, tmp;
    for (int i = 0; i < n - k + 1; i++){
        tmp = min(abs(x[i]), abs(x[i+k-1]));
        tmp += abs(x[i+k-1] - x[i]);
        ans = min(tmp, ans);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 55;
const double g = 9.8;   //???????????????
const double EPS = 1e-10;
int N;
double V, X, Y;
double L[maxn], B[maxn], R[maxn], T[maxn];

//????????\vy??????????????´???????°????t?§?????????????
double calc(double vy, double t)
{
    return vy * t - g * t * t / 2;
}

//a??????lb???ub?????????
int cmp(double lb, double ub, double a)
{
    return a < lb + EPS ? -1 : a > ub - EPS ? 1 : 0;
}

//??????????°???????????????????(qx, qy)??¶????????????????????????
bool check(double qx, double qy)
{
    //??????????????¨x?????????y????????????????????????vx???vy????????????(qx, qy)?????¶??´???t
    //????§£??????????¨????vx^2 + vy ^2 = V^2, vx * t = 1x, vy * t - 1/2 g t^2 = qy
    double a = g * g / 4, b = g * qy - V * V, c = qx * qx + qy * qy;
    double D = b * b - 4 * a * c;
    if (D < 0 && D > -EPS)
        D = 0;
    if (D < 0)
        return false;
    for (int d = -1; d <= 1; d += 2){       //????????????????¨?????????????????§£?????????
        double t2 = (-b + d * sqrt(D)) / (2 * a);
        if (t2 <= 0)
            continue;
        double t = sqrt(t2);
        double vx = qx / t, vy = (qy + g * t * t / 2) / t;

        //??????????????????????????£??????
        double yt = calc(vy, X / vx);
        if (yt < Y - EPS)
            continue;

        bool ok = true;
        for (int i = 0; i < N; i++){
            if (L[i] >= X)
                continue;
            //????????¨?????£???????????????????????´?????????????¢????
            if (R[i] == X && Y <= T[i] && B[i] <= yt)
                ok = false;
            //????????¨?£???°????????£??????????????????????????°????¢????
            int yL = cmp(B[i], T[i], calc(vy, L[i] / vx));   //?????§???????????????
            int yR = cmp(B[i], T[i], calc(vy, R[i] / vx));   //?????§???????????????
            int xH = cmp(L[i], R[i], vx * (vy / g));      //????????????????????????
            int yH = cmp(B[i], T[i], calc(vy, vy / g));
            if (xH == 0 && yH >= 0 && yL < 0)
                ok = false;
            if (yL * yR <= 0)
                ok = false;
        }
        if (ok)
            return true;
    }
    return false;
}

void solve()
{
    //???????????\??????????¢????
    for (int i = 0; i < N; i++){
        R[i] = min(R[i], X);
    }
    bool ok = check(X, Y);      //??´??\??????????????????
    for (int i = 0; i < N; i++){
        ok |= check(L[i], T[i]);     //?????????????§??????????
        ok |= check(R[i], T[i]);     //?????????????§??????????
    }
    puts(ok ? "Yes" : "No");
}
int main(){
 	while(scanf("%d%lf%lf%lf",&N,&V,&X,&Y)!=EOF){
 		for(int i = 0; i < N; i++)
 			scanf("%lf%lf%lf%lf",&L[i],&B[i],&R[i],&T[i]);	
		solve();
	}
 	return 0;
}

Measured memory_bytes: 2756
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i,a,n) for(ll i=a;i<(ll)(n);i++)

int main(){
    int X; cin>>X;
    if(X == 7 || X == 5 || X == 3){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define me(a,x) memset(a,x,sizeof(a))
#define sc scanf 
#define itn int
using namespace std;
const int N=1e6;
const long long mod=1e9+7;
const int oo=0x7fffffff;
const int sup=0x80000000;
typedef long long ll;
typedef unsigned long long ull;
template <typename it>
string to_str(it n){string s="";while(n)s+=n%10+'0',n/=10;reverse(s.begin(),s.end());return s;}
template <typename it>int o(it a){cout<<a<<endl;return 0;}
int to_num(string str){
	int t=0;
	int n=str.length();
	for(int i=0;i<n;i++)t=t*10+str[i]-'0';
	return t;
}
char s[2*N];
int main(){
	cin>>(s+1);
	int n=strlen(s+1);
	ll ans=0;
	int A=0;
	int i=1;
	while(i<=n){
		if(s[i]=='A')A++,i++;
		else{
			if(!A)i++;
			else{
				if(s[i]=='B'&&s[i+1]=='C')ans+=A,i+=2;
				else A=0,i++;
			}
		}
	}
	o(ans);
}


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

int main(){
    int n,l;
    cin >> n >> l;
    vector<int>aji(n+1);
    int sum=0;
    string hugou;
    string minhugou="+";
    
    for(int i=1;i<=n;i++){
        aji[i]=l+i-1;
        sum+=aji[i];
    }
    
    int min=aji[n];
    if(min<0){
        minhugou="-";
    }
    int temp;
    
    for(int i=1;i<=n;i++){
        if(aji[i]<0){
            temp=aji[i]*-1;
            hugou="-";
        } else {
            temp=aji[i];
            hugou="+";
        }
        if(min>temp){
            min=temp;
            minhugou=hugou;
        }
    }
    if(minhugou=="+"){
        sum-=min;
    } else if(minhugou=="-"){
        sum-=min;
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main()
{   int n;
    scanf("%d",&n);
    int arr[100001]={0},i;
    arr[1]=1;
    for(i=2;i<100001;i++){
        arr[i]=arr[i-1]+i;
        if(arr[i]>=n){
            break;
        }
    }
    for(int j=1;j<=i;j++){
        if(j==arr[i]-n)continue;
        printf("%d\n",j);
    }
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int ans=0;
  for(int i=0;i<s.size()/2;i++)
  {
    ans+=(s[i]!=s[s.size()-i-1]);
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
my_value_list = []

while True:
    try:
        my_value_list.append(input().split())
    except EOFError:
        break

for i in range(0, len(my_value_list)):
    if my_value_list[i][1] == "+":
        print(int(my_value_list[i][0]) + int(my_value_list[i][2]))
    elif my_value_list[i][1] == "-":
        print(int(my_value_list[i][0]) - int(my_value_list[i][2]))
    elif my_value_list[i][1] == "/":
        print(int(my_value_list[i][0]) // int(my_value_list[i][2]))
    elif my_value_list[i][1] == "*":
        print(int(my_value_list[i][0]) * int(my_value_list[i][2]))
    else:
        break

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

int main(){
        int amount = 0;
        int cheaper = 1e6;
       int kinds = 0, grams = 0;
       cin >> kinds >> grams;
       for(int i = 0; i < kinds; i++){
        int x = 0;
        cin >> x;
        cheaper = min(cheaper, x);
        grams -= x;
        amount++;
       }
       amount += abs(grams / cheaper);
       cout << amount << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdlib>
#include <cmath>

using namespace std;

int main(){
  string A,B,C;
  cin >> A >> B >> C;
  int a=0,b=0,c=0;
  char turn='a';
  for(int i=0;i<A.size()+B.size()+C.size();i++){
    if(turn=='a'){
      if(a<A.size()){
        turn=A.at(a);
        a++;
      }
      else{
        cout << "A" << endl;
        return 0;
      }
    }
    else if(turn=='b'){
      if(b<B.size()){
        turn=B.at(b);
        b++;
      }
      else{
        cout << "B" << endl;
        return 0;
      }
    }
    else if(turn=='c'){
      if(c<C.size()){
        turn=C.at(c);
        c++;
      }
      else{
        cout << "C" << endl;
        return 0;
      }
    }
  }

  return 0;
}


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

int main(void){
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; ++i){
		cin >> a[i];	
	}
	bool flag = false;
	while(true){
		flag = false;
		sort(a.begin(), a.end());
		for(int i = 1; i < n; ++i){
			if(a[i] == INF) break;
			if(a[i] % a[0] == 0){
				a[i] = INF;
			}else{
				a[i] = a[i] % a[0];
				flag = true;
			}
		}
		if(!flag) break;
	}
	cout << a[0] << endl;
	return 0;
}

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

using namespace std;

int main() {
  int K = 0, S = 0;
  cin >> K >> S;
  int count = 0;
  
  for (int X = 0; X <= K; X++) {
    for (int Y = 0; Y <= K; Y++) {
      int Z = S - (X + Y);
      if (0 <= Z and Z <= K) {
        count++;
      }
    }
  }
  
  cout << count << endl;
}

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

int C(int A, int B, int M) 
{ 
	
	if (A % M == 0) 
		return (B / M) - (A / M) + 1; 

	return (B / M) - (A / M); 
} 


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

	cout << C(a,b,c) << endl; 

	return 0; 
} 


Measured memory_bytes: 3160
#include "iostream"
using namespace std;

int main()
{
	int N;
	cin >> N;
	int x, y, b, p;
	for (int i = 0; i < N; i++) {
		cin >> x >> y >> b >> p;
		int T = b * x + p * y;
		if (T < (5 * x + 2 * y)*0.8) {
			cout << T << endl;
		}
		else {
			if ((b>=5)&&(p>=2))
				cout << T*0.8 << endl;
			if ((b >= 5) && (p < 2))
				if (T > (b * x + 2 * y)*0.8)
					cout << (b * x + 2 * y)*0.8 << endl;
				else
					cout << T<<endl;
			if ((b < 5) && (p >= 2))
				if (T > (5 * x + p * y)*0.8)
					cout << (5 * x + p * y)*0.8 << endl;
				else
					cout << T<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3256
#include "bits/stdc++.h"
using namespace std;

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < (n); i++)
#define Rep(i, n) for(int i = 1; i < n; i++)

const int mod = 1000000007;
const int inf = (1 << 21);
const long long INF = 1LL << 60;

using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
using vd = vector<double>;
using vb = vector<bool>;
using vl = vector<ll>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvb = vector<vector<bool>>;
using vii = vector<pair<int, int>>;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
ll LCM(ll a, ll b) { return (a * b) / GCD(a, b); }
int round_int(int a, int b) { return (a + (b - 1)) / b; }

constexpr array<int, 9> dx = { 0, 1, 0, -1, -1, 1, 1, -1, 0 };
constexpr array<int, 9> dy = { 1, 0, -1, 0, 1, 1, -1, -1, 0 };

// ──────────────────────────────────────────────────────────────────

int main() {
	int n; cin >> n;
	vi a(n); rep(i, n) cin >> a[i];

	deque<int> d;
	rep(i, n) {
		int p = lower_bound(ASC(d), a[i]) - d.begin();

		if (p == 0) d.push_front(a[i]);
		else d[p - 1] = a[i];
	}
	cout << d.size() << endl;
}


Measured memory_bytes: 1024
import java.util.*;

public class Main {

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

        int h = sc.nextInt();
        int w = sc.nextInt();


        char chr[][] = new char[h][w];

        Queue<int []> queue = new ArrayDeque<int []>();
        for (int i=0; i<h; i++){
            String row = sc.next();
            for (int j=0; j<w; j++){
                chr[i][j] = row.charAt(j);
                if (chr[i][j]=='#'){
                    int start[] = {i, j, 0};
                    queue.add(start);
                }
            }
        }

        int flag[][] = new int[h][w];
        int count = 0;

        int dx[] = {1,0,-1,0};
        int dy[] = {0,1,0,-1};
        while(!queue.isEmpty()){
            int temp[] = queue.poll();
            int y = temp[0];
            int x = temp[1];
            int depth = temp[2];
            for (int i=0; i<4; i++){
                if (0<=y+dy[i] && y+dy[i]<= h-1 && 0<=x+dx[i] && x+dx[i]<=w-1){
                    if (flag[y+dy[i]][x+dx[i]]==0 && chr[y+dy[i]][x+dx[i]]=='.'){
                        flag[y+dy[i]][x+dx[i]]=1;
                        int add_queue[] = {y+dy[i], x+dx[i], depth+1};
                        queue.add(add_queue);
                        count = depth+1;
                    }
                }
            }
        }
        System.out.println(count);

    }

}



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

using namespace std;

# define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, int> pdi;
typedef pair<ll, ll> pll;

# define S second
# define F first
# define kill(x) return(cout << x << endl, 0)
# define debug(x) cerr<< #x << " : " << x << endl
# define ddebug(x, y) cerr<< #x << " : " << x  << ", " << #y << " : " << y << endl
# define sz(s) (int)s.size()
# define sq(x) (x) * (x)
# define PB(x) push_back(x)
# define smax(x, y) (x) = max((x), (y))
# define smin(x, y) (x) = min((x), (y))
# define all(x) x.begin(), x.end()
# define SP fixed << setprecision(10)

const int MAXN = 200 * 1000 + 10;
int a[MAXN];

int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	int n;
	cin >> n;
	for (int i = 0; i < n; i ++)
		cin >> a[i];
	
	int ans = 0, x = 0;
	for (int i = n - 1; i >= 0; i --)
	{
		if (x > a[i])
			kill(-1);
		if (x < a[i])
		{
			ans += a[i];
			x = a[i];
		}
		x --;
	}

	if (x != -1)
		kill(-1);

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1792
x = int(input())
if 400 <= x <= 599: ans = 8
elif 600 <= x <= 799: ans = 7
elif 800 <= x <= 999: ans = 6
elif 1000 <= x <= 1199: ans = 5
elif 1200 <= x <= 1399: ans = 4
elif 1400 <= x <= 1599: ans = 3
elif 1600 <= x <= 1799: ans = 2
elif 1800 <= x <= 1999: ans = 1
print(ans)

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

int main(void){
	int N,count,MIN,MAX;
    count=1;
	cin>>N;
	vector<int>P(N);
	for(int i=0;i<N;i++){
	    cin>>P[i];
	}
	MIN=MAX=P[0];
	for(int i=1;i<N;i++){
	    if(P[i]<MIN){
	        count++;
	    }
	    MIN=min(MIN,P[i]);
	}
	cout<<count<<endl;
}
	
	
	
	

Measured memory_bytes: 1024