akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
	LL n,a[202020]={};
	LL b=1LL*mod*mod;
	cin>>n;
	LL ave=0;
	FOR(i,0,n){
		cin>>a[i];
		a[i]-=(i+1);
		a[i]+=mod;
		ave+=a[i];
	}
	LL l=0,r=1000000001+mod,m=(l+r)/2;
	while(m!=l){
		LL sum[3]={};
		FOR(i,0,n){
			LL t=a[i]-(m-1);
			if(t<0)t=-t;
			sum[0]+=t;
			t=a[i]-m;
			if(t<0)t=-t;
			sum[1]+=t;
			t=a[i]-m-1;
			if(t<0)t=-t;
			sum[2]+=t;
		}
		if(sum[0]>=sum[1]&&sum[1]>=sum[2])l=m;
		else r=m;
		m=(l+r)/2;
	}
	LL sum[3]={};
	FOR(i,0,n){
		LL t=a[i]-m;
		if(t<0)t=-t;
		sum[1]+=t;
		t=a[i]-(m+1);
		if(t<0)t=-t;
		sum[2]+=t;
	}
	LL ans2=min(sum[1],sum[2]);
	//ans2-=1LL*n*mod;
	cout<<ans2<<endl;
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef vector <string> VS;

bool check( string t ) {
    char R[4] = "&()";
    for ( int i = 0; i < 3; i++ ) {
        replace(t.begin(), t.end(), R[i], ' ');
    }
    istringstream is(t);
    VS terms;
    string term;
    while ( is >> term ) {
        terms.push_back( term );
    }
    for ( VS ::iterator it = terms.begin(); it != terms.end(); it++ ) {
        term = *it;
        if ( term[0] != '~' ) {
            string k = "~"+term;
            if ( find( terms.begin(), terms.end(), k ) != terms.end() ) return false;
        }
    }
    return true;
}

int main() {
    string IN;
    while ( cin >> IN ) {
        if ( IN == "#" ) break;

        replace( IN.begin(), IN.end(), '|', ' ' );
        istringstream is(IN);
        VS terms;
        string term;
        while ( is >> term ) {
            terms.push_back(term);
        }

        bool flag = false;
        for ( VS ::iterator it = terms.begin(); it != terms.end(); it++ ) {
            if ( check(*it) ) flag = true;
        }

        cout << ( flag ? "yes" : "no" ) << endl;
    }
    return 0;
}

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

#define boost ios_base::sync_with_stdio(false), cin.tie(NULL);

using namespace std;
const int N = 1e6 + 41;
const int mod = 1e9 + 7;
const long long INF = 3e18 + 12;
const int inf = 1e9;

int main () {
	boost;
	int n;
	string s;
	cin >> n >> s;
	for (int i = 0 ; i < s.size() ; ++ i) {
		char c = s[i];
		c += (n) % 26;
		if (c > 'Z') c -= 26;
		cout << char (c);
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <utility>
#include <queue>
#include <set>
#include <map>
#include <deque>
#include <iomanip>
#include <cstdio>
#include <stack>
#include <numeric>
#include <cassert>
using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back
#define inf 1000000007
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(int)(n);++i)
vector<int> makeTable(const string& s) {
    int n = s.size();
    vector<int> ret(n+1);
    ret[0] = -1;
    int j = -1;
    for (int i = 0; i < n; i++) {
        while (j >= 0 && s[i] != s[j]) j = ret[j];
        ret[i+1] = ++j;
    }
    return ret;
}
vector<int> kmp(const string& str, const string& word) {
    vector<int> table = makeTable(word), ret;
    int m = 0, i = 0, n = str.size();
    while (m+i < n) {
        if (word[i] == str[m+i]) {
            if (++i == (int)(word.size())) {
                ret.push_back(m);
                m = m+i-table[i];
                i = table[i];
            }
        } else {
            m = m+i-table[i];
            if (i > 0) i = table[i];
        }
    }
    return ret;
}

string calc(string t,int k){
    if(k==0){
        string s;
        return s;
    }else if(k==1){
        return t;
    }
    if(k%2==0){
        string s = calc(t,k/2);
        return s+s;
    }else{
        string s = calc(t,k/2);
        return s+s+t;
    }
}
int main(){
    string s,t;
    cin >> s >> t;
    if(s.size()>t.size()){
        s += s;
    }
    while(s.size()<t.size()*20){
        s += s;
    }
    int p = 0;
    int ok =0;
    int ng = s.size()/t.size();
    while(ng-ok>1){
        int mid = (ok+ng)/2;
        string tmp = calc(t,mid);
        vector<int>res = kmp(s,tmp);
        if(res.size()>=1){
            ok = mid;
        }else{
            ng = mid;
        }
    }
    if(ok==s.size()/t.size()-1){
        cout << -1 << endl;
    }else{
        cout << ok << endl;
    }
    return 0;
}

Measured memory_bytes: 140664
($K,$A,$B)=glob<>;
if($B-$A<=2 or $K<=$A){
    print $K+1;
}else{
    $o=1;
    if($o<$A){
        $K-=$A-$o;
        $o=$A;
    }
    $o++,$K-- if($K%2);
    $o+=$K/2*($B-$A);
    print$o;
}

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

int main() {
  int n,an,total = 0;
  cin >> n;
  an = n;
  for(int i = 0; i < 8; i++) {
    total += an%10;
    an /= 10;
  }
  if(n % total == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
ans = 0
def division2(x) :
    cnt = 0
    while x%2 == 0 :
        x //= 2
        cnt += 1
    return cnt
def count2(list) :
    ans = 0
    for i in range(len(list)) :
        ans += division2(list[i])
    return ans

print(count2(a))


Measured memory_bytes: 10092
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<math.h>
int main() {
	int n,i;
	double x, y, r;
	while (~fscanf(stdin, "%d", &n), n != -1) {
		x = 1.0, y = 0.0, r = 180.0;
		for (i = 0; i < n-1; i++) {
			r -= 90.0;
			if (r < -180.0) r += 360.0;
			y += sin(r / 180.0 * 4 * atan(1));
			x += cos(r / 180.0 * 4 * atan(1));
			r = atan2(y, x)*180.0/(4*atan(1))-180.0;
			if (r < -180.0) r += 360.0;
		}
		fprintf(stdout, "%.2lf\n%.2lf\n", x, y);
	}
	
	return 0;
}

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

int main()
{
  int r,c,i,j,sum=0,sheet[100][100];
  int ansy[100]={0}; int anst[100]={0};

  cin>>r>>c;
  for(i=0;i<r;i++){
    for(j=0;j<c;j++){
      cin>>sheet[i][j];
      ansy[i]+=sheet[i][j];
      anst[j]+=sheet[i][j];
    }
    sum+=ansy[i];
  }
  for(i=0;i<r;i++){
    for(j=0;j<c+1;j++){
      if(j<c) cout<<sheet[i][j]<<" ";
      if(j==c) cout<<ansy[i]<<endl;
    }
  }
  for(i=0;i<c;i++)
    cout<<anst[i]<<" ";
  cout<<sum<<endl;
}


Measured memory_bytes: 1196
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int[] next=new int[N+1];
        
        for(int i=0;i<N-1;i++){
            int cur=sc.nextInt();
            next[cur]++;
        }
        
        for(int i=1;i<N+1;i++){
            System.out.println(next[i]+" ");
        }
    }
}


Measured memory_bytes: 62396
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<cstdio>

using namespace std;

struct point{double x, y;};

double areaPol(vector<point> t){
  t.push_back(t[0]);
  int tsz=t.size();
  double area=0;
  for(int i=0;i<tsz-1;i++){
    area+=(t[i].x-t[i+1].x)*(t[i].y+t[i+1].y);
  }
  return abs(area)/2.0;
}

int main(void){
  point p;
  vector<point>t;
  char k;

  while(cin>> p.x >> k >> p.y)t.push_back(p);

  printf("%.6f\n",areaPol(t));

  return 0;
}

Measured memory_bytes: 1260
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2222;
char g[maxn][maxn];
int good[maxn], too_good[maxn], rly_good[maxn], was_good[maxn];
int main(){
	int n; cin >> n;
	for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) cin >> g[i][j];
	int sum = 0;
	for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) sum += g[i][j] == '#';
	if(sum == 0) return cout << -1 << endl, 0;
	int cols = 0;
	for(int j = 0; j < n; j++){
		int has = 0;
		for(int i = 0; i < n; i++) has |= g[i][j] == '.';
		cols += has;
	}
	int ans = 1<<30;
	for(int i = 0; i < n; i++){
		int has = 0, white = 0;
		for(int j = 0; j < n; j++) white += g[i][j] == '.';
		for(int j = 0; j < n; j++) has |= g[j][i] == '#';
		ans = min(ans, white + 1 - has);
	}
	cout << ans + cols << endl;
	return 0;
}


Measured memory_bytes: 1280
X,N= map(int, input().split())
List = list(map(int, input().split()))

if N==0:
    print(X)
else:
    s=True
    num=0
    num1=0
    max=0
    min=0
    while s:
        if not X+num in List:
            max=X+num
            break
        num+=1
    while s:
        if not X-num1 in List:
            min=X-num1
            break
        num1+=1
    #print(max,min)
    if max-X<X-min:
        print(max)
    if max-X> X-min:
        print(min)
    if max-X==X-min:
        print(min)

Measured memory_bytes: 9156
/* 
 * Project: AtCoder Beginners Contest 075 A - One out of Three
 * Author: toms74209200 <https://github.com/toms74209200>
 *
 * Created on 2020/06/29
 * Copyright (c) 2020 toms74209200
 * 
 * This software is released under the MIT License.
 * http://opensource.org/licenses/mit-license.php
 */
#include <cstdio>
using namespace std;

int a;
int b;
int c;

void solve() {

    if (!(a ^ b))
        printf("%d\n", c);
    else if (!(b ^ c))
        printf("%d\n", a);
    else if (!(c ^ a))
        printf("%d\n", b);

}

int main() {

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

    solve();

}

Measured memory_bytes: 3196
#include"cstdio"
#include"cstdlib"
#include"iostream"
using namespace std;
int main()
{
	int a,b,c,x,ab,bc;
	scanf("%d%d%d",&a,&b,&c);
	if (a<b){
		x=a;
		a=b;
		b=x;	
	}

	if (b<c){
		x=b;
		b=c;
		c=x;
	}
	if (a<b){
		x=a;
		a=b;
		b=x;
	}
	ab=abs(a-b);
	bc=abs(b-c);
	printf("%d",(ab+bc));
} 

Measured memory_bytes: 384
#include <iostream>

int main()
{
    int n, s = 0;
    while (std::cin >> n && n > 0) {
        int max, min, sum = 0;
        std::cin >> s;
        max = s;
        min = s;
        sum += s;

        for (int i = 0; i < n - 1; i++) {
            std::cin >> s;
            if (s > max)
                max = s;
            if (s < min)
                min = s;
            sum += s;
        }
        std::cout << (sum - max - min) / (n - 2) << '\n';
    }

    return 0;
}



Measured memory_bytes: 3060
#include<stdio.h>
int main(){
  int h,w,i,j,k,l,x;
  char s[51][51]={{0}};
  scanf("%d%d",&h,&w);
  for(i=0;i<h;i++)scanf("%s",s[i]);
  for(i=0;i<h;i++){for(j=0;j<w;j++){
    if(s[i][j]=='#')printf("#");
    else{
      x=0;for(k=-1;k<2;k++)for(l=-1;l<2;l++)if(i+k>=0&&j+l>=0)x+=s[i+k][j+l]=='#';
      printf("%d",x);
    }
  }printf("\n");}

}


Measured memory_bytes: 1720
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque> 
#include <string>


using namespace std;

char s[5];
char t[5];


int main()
{
	scanf("%s\n%s", s, t);
	
	int count = 0;
	for (int i = 0 ; i < 3 ; i++)
		if (s[i] == t[i])
			count++;
			
	printf("%d\n", count);

	return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <functional>
#include <queue>
#include <unordered_set>
#include <climits>
#include <set>
#include <list>
#include <cmath>

using namespace std;
typedef long long ll;

int main()
{
	ll N, W;
	ll w[101];
	ll v[101];
	cin >> N >> W;
	for(int i = 1; i <= N; i++){
		cin >> w[i] >> v[i];
	}
	w[0] = 0;
	v[0] = 0;
	
	static ll DP[101][101][3*100+1];
	for(int i = 0; i < 101; i++){
		for(int j = 0; j < 101; j++){
			for(int k = 0; k < 301; k++){
				DP[i][j][k] = 0;
			}
		}
	}
	
	for(int n = 1; n <= N; n++){
		for(int m = 0; m <= n; m++){
			ll w_ = w[n] - w[1];
			for(int g = 0; g <= 3*100; g++){
				DP[n][m][g] = DP[n-1][m][g];
				if(m > 0 && g >= w_ && m*w[1] + g <= W){
					DP[n][m][g] = max(DP[n][m][g], DP[n-1][m-1][g-w_] + v[n]);
				}
			}
		}
	}
	
	ll ans = 0;
	for(int m = 0; m <= N; m++){
		for(int g = 0; g <= 3*100; g++){
			if(w[1] * m + g <= W){
				//cout << m << " , " << g << " : " << DP[N][m][g] << endl;
				ans = max(ans, DP[N][m][g]);
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 24320
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int DP[100005];

int main() {
    int N;
    cin>>N;
    for(int i=0;i<=N;++i){
        DP[i] = inf;
    }
    DP[0] = 0;
    DP[1] = 1;
    for(int i=1;pow(6, i)<=N;++i){
        DP[int(pow(6, i))] = 1;
    }
    for(int i=1;pow(9, i)<=N;++i){
        DP[int(pow(9, i))] = 1;
    }
    for(int i=2;i<=N;++i){
        DP[i] = min(DP[i], DP[i-1]+1);
        for(int j=1;pow(6, j)<=i;++j){
            DP[i] = min(DP[i], DP[i-int(pow(6, j))] + 1);
        }
        for(int j=1;pow(9, j)<=i;++j){
            DP[i] = min(DP[i], DP[i-int(pow(9, j))] + 1);
        }
    }
    cout<<DP[N]<<endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int L(long long A){
  string S = to_string(A);
  int N = S.size();
  for (int i = 0; i < N - 1; i++){
    if (abs(S[i] - S[i + 1]) > 1){
      return i;
    }
  }
  return -1;
}
int main(){
  int K;
  cin >> K;
  long long i = 1;
  int count = 0;
  while (1){
    int l = L(i);
    if (l == -1){
      count++;
      //cout << i << endl;
      if (count == K){
        cout << i;
        break;
      }
      i++;
    } else {
      int N = to_string(i).size();
      int p = N - l - 2;
      long long A = 1;
      for (int j = 0; j < p; j++){
        A *= 10;
      }
      i += A;
    }
  }
}

Measured memory_bytes: 256
class Node
  attr_accessor :id, :key, :parent, :left, :right

  def set_info(id, key)
    @id = id
    @key = key
  end
end

class Tree
  attr_accessor :nodes, :root, :result

  def initialize(n)
    @nodes = Array.new(n).map{ Node.new() }
    @result = []
  end

  def insert(id, key)
    z = @nodes[id]
    z.set_info(id, key)
    y = nil
    x = @root

    while !x.nil?
      y = x
      if z.key < x.key
        x = x.left
      else
        x = x.right
      end
    end

    if y.nil?
      @root = z
    elsif z.key < y.key
      y.left = z
      z.parent = y
    else
      y.right = z
      z.parent = y
    end
  end


  def Preorder(u)
    @result.push(@nodes[u].key)
    Preorder(@nodes[u].left.id) unless @nodes[u].left.nil?
    Preorder(@nodes[u].right.id) unless @nodes[u].right.nil?
  end

  def Inorder(u)
    Inorder(@nodes[u].left.id) unless @nodes[u].left.nil?
    @result.push(@nodes[u].key)
    Inorder(@nodes[u].right.id) unless @nodes[u].right.nil?
  end

  def clean_result
    @result = []
  end

end

def main
  n = gets.to_i
  tree = Tree.new(n)

  n.times do |num|
    ins, key = gets.chomp.split
    if ins == 'insert'
      tree.insert(num, key.to_i)
    else
      tree.Inorder(tree.root.id)
      puts ' ' + tree.result.join(' ')
      tree.clean_result
      tree.Preorder(tree.root.id)
      puts ' ' + tree.result.join(' ')
      tree.clean_result
    end
  end
end

main



Measured memory_bytes: 80424
//Code is like humor. When you have to explain it, it’s bad.
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#include <bits/stdc++.h>
#define MOD 1000000007
#define int long long
using namespace std;
#define ss second
#define ff first
int32_t main()
{
    fastio;
    int T,n,m,i,j,k,a,b,c;
    T=1;
    while(T --> 0)
    {
        cin>>n;
        int sum=0;
        for(i=1;i<=n;i++)
        for(j=1;j<=n;j++)
        for(k=1;k<=n;k++)
        sum+=__gcd(i,__gcd(j,k));

        cout<<sum;

    }
    return 0;
}

Measured memory_bytes: 3652
# import itertools
# import math
# import sys
# sys.setrecursionlimit(500*500)
# import numpy as np

N = int(input())
# S = input()
# n, *a = map(int, open(0))
# N, M = map(int, input().split())
A = list(map(int, input().split()))
# B = list(map(int, input().split()))
# tree = [[] for _ in range(N + 1)]
# B_C = [list(map(int,input().split())) for _ in range(M)]
# S = input()

# B_C = sorted(B_C, reverse=True, key=lambda x:x[1])
# all_cases = list(itertools.permutations(P))
# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
# itertools.product((0,1), repeat=n)

# A = np.array(A)
# cum_A = np.cumsum(A)
# cum_A = np.insert(cum_A, 0, 0)

# def dfs(tree, s):
#     for l in tree[s]:
#         if depth[l[0]] == -1:
#             depth[l[0]] = depth[s] + l[1]
#             dfs(tree, l[0])
# dfs(tree, 1)

# def factorization(n):
#     arr = []
#     temp = n
#     for i in range(2, int(-(-n**0.5//1))+1):
#         if temp%i==0:
#             cnt=0
#             while temp%i==0:
#                 cnt+=1
#                 temp //= i
#             arr.append([i, cnt])
#     if temp!=1:
#         arr.append([temp, 1])
#     if arr==[]:
#         arr.append([n, 1])
#     return arr

sum_A = sum(A)

tot = 0
for i in range(N):
    sum_A -= A[i]
    tot += A[i] * sum_A
        
print(tot % 1000000007)

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

ll c;

struct node{
	__int128_t val,pre;

	long double cost(long double x)
	{
		return pre+(val-x)*(val-x)+c;
	}

	long double point(node x)
	{
		long double lo=0,hi=2e18+5,mid;

		while(lo<=hi)
		{
			mid=(lo+hi)/2;

			if(cost(mid)<=x.cost(mid))
				lo=mid+0.05;
			else
				hi=mid-0.05;

			//cout<<mid<<endl;
			//return mid;
		}

		return lo;
	}
};

main()
{
	//freopen("input.txt","r",stdin);
	ll n,x;
	cin>>n>>c;

	vector<node> v(n);

	__int128_t ans=0,fptr=0,bptr=0;

	for(int i=0;i<n;i++)
	{
		cin>>x;

		//for(int j=0;j<i;j++)
		//	ans=min(ans,v[j].cost(x)+c);

		ans=1e18;

		while(bptr-fptr>=2 && v[fptr].cost(x) >= v[fptr+1].cost(x))
			fptr++;

		if(fptr==bptr)
			ans=0;
		else
		{
			ans=v[fptr].cost(x);

			//for(int j=0;j<bptr;j++)
			//cout<<v[j].val<<" ";
		}

		while(bptr-fptr>=2 && v[bptr-2].point(v[bptr-1]) > v[bptr-2].point({x,ans}))
		{
			//cout<<v[bptr-2].val<<" "<<v[bptr-2].point(v[bptr-1])<<" "<<v[bptr-1].val<<" "<<v[bptr-2].point({x,ans})<<endl;
			bptr--;
		}

		v[bptr++]={x,ans};

		//cout<<ans<<endl;

		//cout<<v[fptr].val<<" "<<ans<<endl;
	}

	cout<<(ll)ans<<endl;
}

Measured memory_bytes: 6528
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(ll i##_len=(n) ,i=i##_len-1;i>=0;--i)
#define repi(i,a,b) for(ll i=ll(a);i<=ll(b);++i)
#define ALL(f,x,...) ([&](decltype((x)) xxxx) { return (f)(begin(xxxx), end(xxxx), ## __VA_ARGS__); })(x)
#define lim 1000000007ll
#include<bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = std::pair<ll,ll>;
using namespace std;
template<class T>T 
chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>T 
chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template <class T> T 
gcd(T a, T b){if (a < b) {a ^= b;b ^= a;a ^= b;} return b ? gcd(b, a % b) : a;}
template <class T> T 
lcm(T a, T b){return a * b / gcd(a, b);}
vector<char> 
string_to_vector_char(const string& input){vector<char> out(input.length());rep(i,input.length()){out[i]=input[i];}return out;}
map<char,int> 
count_same_elements(const vector<char>& v){map<char,int>cmap; for_each(v.begin(),v.end(),[&cmap](int x){cmap[x]++;}); return cmap; }
template<class A,class B> vector<B> 
mapf(const vector<A>& v,const function<B(A)>& func){vector<B> v_(v.size());rep(i,v.size()){ v_[i]=func(v[i]); }return v_;}
template<class A,class B> vector<B> 
adjacent_map(const vector<A>& v,const function<B(A,A)>& func){vector<B> v_(v.size()-1);rep(i,v.size()-1){ v_[i]=func(v[i+1],v[i]); }return v_;}
template<class A> bool
all_of(const vector<A>& v){bool flag=true;rep(i,v.size()){ if(v[i]<1){flag=false;}; }return flag;}
template<class A> bool
any_of(const vector<A>& v){bool flag=false;rep(i,v.size()){ if(v[i]>0){flag=true; break;}; }return flag;}
template<class A> bool
none_of(const vector<A>& v){bool flag=true;rep(i,v.size()){ if(v[i]>0){flag=false;}; }return flag;}
template<class T,class U>
void msg_with_compare(T A,T B,U A_greater_B,U A_eq_B,U A_less_B){
    if(A==B){cout<<A_eq_B<<"\n";}else if(A>B){cout<<A_greater_B<<"\n";}else{cout<<A_less_B<<"\n";}}
template<class B,class T>
void msg_with_boolean(B A,T true_msg,T false_msg){cout<< ( A? true_msg:false_msg);}
template<class B,class T>
void msg_with_boolean(B A1,B A2,T both_true_msg,T true_false_msg,T false_true_msg,T both_false_msg){
    if(A1){if(A2){cout<<both_true_msg;}else{cout<<true_false_msg;}
    }else{if(A2){cout<<false_true_msg;}else{cout<<both_false_msg;}}
}
template<class T>
void scan_vector(long long size,vector<T>& vector){
    vector.resize(size);
    for(long long i=0;i<size;++i){
        cin>>vector[i];
    }
}
bool operator<(pair<const string,int> lhs,pair<const string,int> rhs){
    return lhs.second < rhs.second;
}

ll n,m;
map<string,int> mp;
void input(){
    cin>>n;
    string s;
    rep(i,n){
        cin>>s;
        mp[s]++;
    }
    cin>>m;
    rep(i,m){
        cin>>s;
        mp[s]--;
    }
}
void src(){
    int maxx=-1000;
    for(auto i:mp){
        if(i.second>maxx) swap(i.second,maxx);
    }
    cout<<max(0,maxx);
}   

int main(int argc,char* argv[]){
    ios::sync_with_stdio(false);
 //   ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
    input();
    src();    
    return 0;
}

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

int matrixChainMultiplication(int *);

int n;

int main(){
  int i,A[101],l,j,k;

  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&A[i-1]);
    scanf("%d",&A[i]);
  }
  printf("%d\n",matrixChainMultiplication(A));


}
int matrixChainMultiplication(int *A){
  int i,l,j,k,P[101][101],g;
  for(i=1;i<n;i++){
    P[i][i]=0;
  }
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      P[i][j]=9999999;
      for(k=i;k<=j-1;k++){
	g=P[i][k]+P[k+1][j]+A[i-1]*A[k]*A[j];
	if(g<P[i][j])
	  P[i][j]=g;
	  
      }
    }
  }

  return P[1][n];
}
    



Measured memory_bytes: 2112
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<sstream>
#include<complex>
#include<functional>
#include<vector>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<set>

using namespace std;

int main(){

    int p,q,r;
    scanf("%d %d %d",&p,&q,&r);
    if(p>=q && p>=r)printf("%d\n",q+r);
    else if(q>=p && q>=r)printf("%d\n",p+r);
    else printf("%d\n",q+p);

    return 0;
}

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

int main(){
    int S;
    cin >> S;
    int top, last;
    bool t=false, l=false;
    top = (S/1000)*10 + (S%1000)/100;
    last = ((S%100)/10)*10+(S%10);

    if(top>=1 && top<=12)
        t=true;
    if(last>=1 && last<=12)
        l=true;

    if(t && l )
        cout << "AMBIGUOUS"<<endl;
    else if(t)
        cout << "MMYY"<<endl;
    else if(l)
        cout << "YYMM"<<endl;
    else
        cout << "NA"<<endl;

}


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

using namespace std;
using ll = long long;

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

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

  int ans = 0;
  rep(i, 3) if (s[i] == t[i])++ ans;
  cout << ans << endl;
  return 0;
}


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

typedef long long ll;

ll gcd(ll a, ll b){
return a != 0 ? gcd(b % a, a) : b;
}

int main() {
ll a, b;
while(cin >> a >> b)
cout << gcd(a, b) << " " << a / gcd(a, b) * b << endl;}

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define INF            1e9
#define REP(i,n)       for(lint i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)      for(lint i=1,i##_len=(n);i<=i##_len;++i)
#define REPI(i,ini,n)  for(lint i=(ini),i##_len=(n);i<i##_len;++i)
#define REPR(i,n)      for(lint i=(n)-1;i>=0;--i)
#define REPR1(i,n)     for(lint i=(n);i>0;--i)
#define REPRI(i,ini,n) for(lint i=(ini)-1,i##_len=(n);i>=i##_len;--i)
#define REPC(i,obj)    for(auto i:obj)
#define R_UP(a,b)      (((a)+(b)-1)/(b))
#define ALL(obj)       (obj).begin(),(obj).end()
using namespace std;
using lint = long long;
template<typename T = lint>inline T in() { T x; cin >> x; return x; }
int binary_search_p(int first_w, int last_w, int k, int min_w, int max_w, const vector<int>&w)
{
	auto get_minimum_k = [&w](int p_candidate)
	{
		int result = 1;
		int temp = 0;
		REPC(i, w)
		{
			if (temp + i <= p_candidate)temp += i;
			else
			{
				result++;
				temp = i;
			}
		}
		return result;
	};
	int p_candidate = first_w + (last_w - first_w) / 2;
	int min_k = get_minimum_k(p_candidate);
	if (first_w > last_w)
	{
		int result;
		for (int i = max(p_candidate, max_w);; i++)
		{
			int minimum_k = get_minimum_k(i);
			if (minimum_k <= k)return i;
		}
	}
	return min_k <= k ? binary_search_p(first_w, p_candidate - 1, k, min_w, max_w, w) : binary_search_p(p_candidate + 1, last_w, k, min_w, max_w, w);
}
signed main()
{
	int n = in(), k = in();
	vector<int>w(n);
	int min_w = 10001, max_w = -1, sum_w = 0;
	REPC(&i, w)
	{
		i = in();
		if (min_w > i)min_w = i;
		if (max_w < i)max_w = i;
		sum_w += i;
	}
	cout << binary_search_p(min_w, sum_w, k, min_w, max_w, w) << endl;
}


Measured memory_bytes: 3108
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(stdR.readLine());
        String A = stdR.readLine();
        String B = stdR.readLine();
        String C = stdR.readLine();
        int count = 0;
        for(int i = 0 ; i < N ; i++) {
            if(A.charAt(i) == B.charAt(i)) {
                if(A.charAt(i) != C.charAt(i)) {
                    count += 1;
                }
            }else if(A.charAt(i) == C.charAt(i)) {
                count += 1;
            }else if(B.charAt(i) == C.charAt(i)) {
                count += 1;
            }else {
                count += 2;
            }
        }
        System.out.println(count);
    }
}


Measured memory_bytes: 22612
import java.util.*

class Scanner(`in`: java.io.InputStream) {
    private val reader = java.io.BufferedReader(java.io.InputStreamReader(`in`))
    private var tokenizer: StringTokenizer? = null

    fun next(): String {
        if (tokenizer?.hasMoreTokens() != true) {
            tokenizer = StringTokenizer(reader.readLine())
        }
        return tokenizer!!.nextToken()
    }

    fun nextLine(): String {
        return if (tokenizer?.hasMoreTokens() != true) {
            reader.readLine()
        } else tokenizer!!.nextToken("\n")
    }
}

fun main(args: Array<String>) {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

////////////////////////////////////////////////////////////////////////

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val N = sc.next().toInt()
        val K = sc.next().toInt()
        val sunuke = IntArray(N)
        repeat(K) {
            val d = sc.next().toInt()
            repeat(d) {
                val a = sc.next().toInt() - 1
                sunuke[a]++
            }
        }
        pw.println(sunuke.count { it == 0 })
    }
}


Measured memory_bytes: 34908
#include <iostream>
#include <string>
#include <cstring>

int main()
{
  int a, b;
  std::cin >> a >> b;
  
  std::string sa, sb;
  for(int i = 0; i < b; ++i) sa += '0' + a;
  for(int i = 0; i < a; ++i) sb += '0' + b;
  
  int result = strcmp(sa.c_str(), sb.c_str());
  if(result <= 0) std::cout << sa << std::endl;
  else std::cout << sb << std::endl;
  
  return 0;
}

Measured memory_bytes: 256
from collections import defaultdict

d = defaultdict(int)

n = int(input())
li = [input() for _ in range(n)]

for i in li:
    d[i] += 1
    
d = sorted(d.items(), key=lambda x:x[1], reverse=True)

ans = []

s = 0
for i in range(len(d)):
    if s == 0:
        s = d[i][1]
    
    if s == d[i][1]:
        ans.append(d[i][0])
    else:
        break
    
ans.sort()

for i in ans:
    print(i)

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

void solve() {
  while (true) {
    int m, nmin, nmax;
    cin >> m >> nmin >> nmax;
    if (m == 0) return;
    vi32 p(m); cin >> p;

    int ma = 0, ans = -1;
    repi(i, nmin - 1, nmax) {
      if (ma <= p[i] - p[i + 1]) {
        ma = p[i] - p[i + 1];
        ans = i + 1;
      }
    }
    cout << ans << '\n';
  }
}



Measured memory_bytes: 3128
a, b, c, d = map(int, input().split())
if a < 0 and c < 0:
    if a*c > b*d:
        print(a*c)
    else:
        print(b*d)
elif a > 0 and c < 0:
    if a*d > b*d:
        print(a*d)
    else:
        print(b*d)
elif a < 0 and c > 0:
    if b*c > b*d:
        print(b*c)
    else:
        print(b*d)
else:
    print(b*d)

Measured memory_bytes: 9192
// Author : Rifayat Samee (Sanzee)
// Problem :
// Algorithm:

/*

*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll max(ll a,ll b){
    if(a < b) return b;
    return a;
}
int main(){

	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
    ll n,W;
    scanf("%lld %lld",&n,&W);
    vector<ll>dp(W+1,0);
    for(ll i=0;i<n;i++){
        ll curw,p;
        scanf("%lld %lld",&curw,&p);
        for(int w = W-curw;w>=0;w--){
            dp[w+curw] = max(dp[w+curw],dp[w]+p);
        }
    }
    ll res = 0;
    for(ll w = 0;w<=W;w++){
        res = max(res,dp[w]);
    }
    //printf("\n");
    printf("%lld\n",res);
	return 0;
}


Measured memory_bytes: 1024
use proconio::*;
use std::collections::VecDeque;

fn main() {
    input!{
        n: usize,
        m: usize,
        ab: [(usize, usize); m],
    }


    let mut g = vec![Vec::<usize>::new(); n];
    for (a, b) in ab {
        g[a-1].push(b-1);
        g[b-1].push(a-1);
    }
    let mut q = VecDeque::new();

    let mut ans = vec![200000; n];
    ans[0] = 0;
    for x in &g[0] {
        q.push_back(x);
        ans[*x] = 0;
    }

    while q.len() > 0 {
        let front: usize = *q.pop_front().unwrap();
        for x in &g[front] {
            if ans[*x] < n {
                continue;
            }
            ans[*x] = front;
            q.push_back(x);
        }
    }

    println!("Yes");
    for (i, x) in ans.iter().enumerate() {
        if i == 0 {
            continue;
        }
        println!("{}", *x + 1);
    }
}


Measured memory_bytes: 16032
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>//小数点以下表示
#include<map>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
    double l;
    cin>>l;
    cout<<fixed<<setprecision(30)<<pow((l/3),3)<<endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<map>
#include<cmath>
#include<queue>	
#include<functional>
#include<climits>
#include<tuple>

using namespace std;

//define
#define ALL(a) a.begin(),a.end()
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define debug(x) if(1)cout<<#x<<":"<<x<<endl;
#define DEBUG(x) if(1)cout<<#x<<":"<<x<<endl;
#define ll long long
#define pb push_back
#define PB push_back
#define lb lower_bound
#define LB lower_bound
#define ub upper_bound
#define UB upper_bound


//constant
const int MOD = 1000000007;
const int INF = INT_MAX / 2-1;
const double EPS = 1e-9;
const int dx4[4] = { 1,0,-1,0 };
const int dy4[4] = { 0,1,0,-1 };

//typedef
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;


int main() {
	int n;
	cin >> n;
	vi l(2 * n);
	REP(i, 2 * n)
		cin >> l[i];
	sort(ALL(l));
	int res = 0;
	REP(i, n)
		res += l[2 * i];
	cout << res << endl;


	return 0;
}

Measured memory_bytes: 256
import itertools
N,M,X = list(map(int,input().split()))
CA = [list(map(int,input().split())) for _ in range(N)]
options = itertools.product([0,1],repeat=N)
mincost = float('inf')
for o in options:
    XL = [X]*M
    cost = 0
    for i in range(N):
        if o[i] == 1:
            cost += CA[i][0]
            for j in range(M):
                XL[j] -= CA[i][j+1]
    if len(list(filter(lambda x: x > 0,XL))) == 0:
        mincost = min(mincost,cost)
if mincost == float('inf'):
    print(-1)
else:
    print(mincost)

Measured memory_bytes: 9192
import java.util.Scanner;

public class Main {
	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		String b = sc.next();
		sc.close();
		if("A".equals(b)) System.out.println("T");
		else if("T".equals(b)) System.out.println("A");
		else if("C".equals(b)) System.out.println("G");
		else System.out.println("C");
	}
}

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

int main(void){
  int cnt=0;
  char str[32]="";
  char str1[32]="CODEFESTIVAL2016";
  scanf("%s", str);
  for(int i=0;i<32;i++){
    if(str[i]!=str1[i])
      cnt++;
  }
  printf("%d\n",cnt);
  
  
  
  return EXIT_SUCCESS;
}


Measured memory_bytes: 128
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    n=len(s)
    K=int(input())
    dp_0=[[0]*(K+1) for _ in range(n+1)]
    dp_1=[[0]*(K+1) for _ in range(n+1)]
    dp_0[0][0]=1 
    for i in range(n):
        for j in range(K+1):
            for k in range(2):
                nd=int(s[i])-0
                for d in range(10): 
                    ni=i+1
                    nj=j
                    if d!=0:nj+=1
                    if nj>K:continue
                    if k==0:
                        if d>nd:continue
                        if d<nd:dp_1[ni][nj]+=dp_0[i][j]
                        else:dp_0[ni][nj]+=dp_0[i][j]
                    else:dp_1[ni][nj]+=dp_1[i][j]
    print(dp_0[n][K]+dp_1[n][K])

if __name__=='__main__':
    main()

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

using namespace std;
 
const int inf = 1e8;
#define ll long long
#define fr(i,a,n) for (int i=a;i<n;i++)
#define rfr(i,n,a) for (int i=n;i>=a;i--)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll> 
#define endl "\n"
typedef vector<int> VI;
typedef vector<ll> VL;

ll n,m,k;

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	string s;
	cin >> s;
	n = s.size();
	string x = "",y = "";
	for (int i = 0;i < n/2;i++) {
		x += s[i];
	}
	for (int i = n/2 + 1;i < n;i++) {
		y += s[i];
	}
	if (x != y) {
		cout << "No" << endl;
		return 0;
	}
	for (int i = 0, j = x.size()-1;i < j;i++,j--) {
		if (x[i] != x[j] || y[i] != y[j]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

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

typedef long long ll;

int main() {
  int N, K;
  cin >> N >> K;
  int A[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  if ((N - 1) % (K - 1) == 0) {
    cout << (N - 1) / (K - 1) << endl;
  } else {
    cout << (N - 1) / (K - 1) + 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 640
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
static const int MAX = 10000;
vector<int> G[MAX];
int indegs[MAX];
bool visited[MAX];

void visit(int x) {
  cout << x << endl;
  visited[x] = true;
}

void bfs(int start) {
  queue<int> q;
  q.push(start);

  while (!q.empty()) {
    int u = q.front();
    q.pop();

    for (auto t : G[u]) {
      indegs[t]--;
      if (indegs[t] == 0 && !visited[t])
        q.push(t);
    }
    visit(u);
  }
}

int main() {
  int nv, ne;
  cin >> nv >> ne;
  for (int i = 0; i < nv; i++) {
    indegs[i] = 0;
    visited[i] = false;
  }

  for (int i = 0; i < ne; i++) {
    int s, t;
    cin >> s >> t;
    G[s].push_back(t);
    indegs[t]++;
  }

  for (int i = 0; i < nv; i++) {
    if (indegs[i] == 0 && !visited[i])
      bfs(i);
  }
}

Measured memory_bytes: 3676
#include <string>
#include <vector>
#include <iostream>

#include <atcoder/dsu.hpp>

#ifdef USE_PYTHON_LIKE_PRINT
#include "print.h"
#else
template<char SEP = ' ', char END = '\n'> inline void print(...){}
template<char SEP = ' ', char END = '\n'> inline void printe(...){}
template<char SEP = ' ', char END = '\n'> inline void printo(...){}
#define define_print(...)
#define define_print_with_names(...)
#define define_to_tuple(...)
#endif

using namespace std;

int main(void){
	int N, M;
	cin >> N;
	cin >> M;
	
	atcoder::dsu d(N);
	
	for(int i = 0; i < M; i ++){
		int A, B;
		cin >> A >> B;
		A --;
		B --;
		d.merge(A, B);
	}
	
	cout << d.groups().size() - 1 << endl;
	
	
	return 0;
}


Measured memory_bytes: 8432
#include <iostream>
#include <cstdio>
#include <string>

int main(int argc, char* argv[])
{
  int A, B, C;
  std::string str;

  getline(std::cin, str);
  sscanf(str.c_str(), "%d %d %d", &A, &B, &C);

  if (A + B >= C) {
    std::cout << "Yes" << std::endl;
  } else {
    std::cout << "No" << std::endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

int n, m;

int main() {
    fastio();

    cin >> n >> m;

    int ans = 1900 * m + 100 * (n - m);

    forn(i, m) ans *= 2;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }

        List<Integer> l = new ArrayList<>();
        List<Integer> r = new ArrayList<>();
        if (n % 2 == 0) {
            // 偶数の場合、左右の順で詰める
            for (int i = 1; i < n; i++) {
                if (i % 2 == 0) {
                    r.add(a[i]);
                } else {
                    l.add(a[i]);
                }
            }
        } else {
            // 奇数の場合、右左の順で詰める
            for (int i = 1; i < n; i++) {
                if (i % 2 == 0) {
                    l.add(a[i]);
                } else {
                    r.add(a[i]);
                }
            }
        }

        for (int i = l.size() - 1; i >= 0; i--) {
            System.out.println(l.get(i));
        }

        System.out.println(a[0]);

        for (int i = 0; i < r.size(); i++) {
            System.out.println(r.get(i));
        }
    }
}


Measured memory_bytes: 104784
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;

fn main() {
    input! {
        n: usize, a: usize, b: usize,
        h: [usize; n],
    }

    let mut ok: i64 = (h.iter().max().unwrap() + 1) as i64;
    let mut ng: i64 = -1;
    while ok - ng > 1 {
        let mid = (ok + ng) / 2;
        let mut need = 0;
        for i in 0..n {
            if h[i] > b * mid as usize {
                need += (h[i] - b * mid as usize + a - b - 1) / (a - b);
            }
        }
        if need as i64 <= mid {
            ok = mid;
        } else {
            ng = mid;
        }
    }

    println!("{}", ok);
}


Measured memory_bytes: 4352
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

int main() {
    int n;
    cin >> n;
    ll ret = 1;
    for (int i = 1; i <= n; ++i) {
        ret = ret * i % MOD;
    }
    cout << ret << "\n";
    return 0;
}

Measured memory_bytes: 256
void solve();

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

//////////////////////////////////////////////////
//////////////////////////////////////////////////
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <functional>
#include <map>
#include <string>
#include <boost/multiprecision/cpp_int.hpp>
#include <limits.h>
#include <iomanip>
#include <stack>

using namespace std;
using namespace boost::multiprecision;

string S;

void solve() {
	cin >> S;
	int counter = 0;
	for (int s = 0; s < S.size(); s++) {
		if (S[s] == 'x')counter++;
	}
	if (counter >= 8)cout << "NO" << endl;
	else cout << "YES" << endl;
	return;
}

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

int main(void){
    int N,M;
    cin>>N>>M;
    vector<vector<int>> E(N);
    for (int i=0;i<M;i++){
        int a,b;
        cin>>a>>b;
        E[a-1].push_back(b-1);
        E[b-1].push_back(a-1);
    }
    for (int i=0;i<N;i++) cout<<E[i].size()<<endl;
    return 0;
}

Measured memory_bytes: 256