akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
typedef long long ll;
typedef pair<ll,ll> pint;
int main(){
  ll n;cin>>n;
  ll ans =0;
  rep(i,n+1){
    if(i%3==0||i%5==0){
    }
    else{
      ans+=i;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define y1 y122
#define int long long

/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
/*
#pragma comment(linker, "/STACK: 20000000005")
*/


using namespace std;


const int N = 200005, MOD = 1e9 + 7;



main()
{
    ios_base::sync_with_stdio(0);
    int X;
    cin >> X;
    int ans = 0;
    ans = X / 500 * 1000;
    X %= 500;
    ans += X / 5 * 5;
    cout << ans << endl;
    return 0;
}


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

# ls[i]とls[i-1]の情報からls[i+1]を決定する関数
def decide_right(ls):
    '''
    ls[0]とls[1]が確定したlsを与えられたら、その情報からls全体(一意に定まる)を返す
    '''
    N = len(ls)
    for i in range(1,N-1):
        if ls[i] == 'S':
            if s[i] == 'o':
                ls[i+1] = ls[i-1]
            else:
                if ls[i-1] == 'S':
                    ls[i+1] = 'W'
                else:
                    ls[i+1] = 'S'
        else:
            if s[i] == 'o':
                if ls[i-1] == 'S':
                    ls[i+1] = 'W'
                else:
                    ls[i+1] = 'S'
            else:
                ls[i+1] = ls[i-1]
    return ls

'''
def decide_left(ls):
    #ls[1]とls[0]が確定したlsを与えられたら、その情報からls全体(一意に定まる)を返す
    
    N = len(ls)
    for i in range(N,0,-1):
        if s[i] == 'o':
            ls[i-1] = ls[i+1]
        else:
            if ls[i+1] == 'S':
                ls[i-1] = 'W'
            else:
                ls[i-1] = 'S'
'''

def check(first):
    # 矛盾のないlsを発見し次第それをreturn、可能性が無くなったらFalseをリターン
    # ls1は左から決めていく
    ls1 = [0] * (n+1)
    ls1[0] = first

    for second in ['S','W']:
        ls1[1] = second
        ls1 = decide_right(ls1)
        
        if ls1[0] != ls1[-1]:
            continue
        
        # 0の両隣の判定

        ls = ls1[:-1]
        res = True
        for i in range(n):
            r = i+1
            if r == n:
                r = 0
            if ls[i] == 'S':
                if s[i] == 'o' and ls[i-1] != ls[r]:
                    res = False
                    break
                elif s[i] == 'x' and ls[i-1] == ls[r]:
                    res = False
                    break
            else:
                if s[i] == 'o' and ls[i-1] == ls[r]:
                    res = False
                    break
                elif s[i] == 'x' and ls[i-1] != ls[r]:
                    res = False
                    break
        if not res:
            continue
        '''
        ls2 = [0] * (n+1)
        ls2[-1] = first
        if s[0] == 'o':
            ls2[-2] = second
        else:
            if second == 'S':
                ls2[-2] = 'W'
            else:
                ls2[-2] = 'S'
        ls2 = decide_left(ls2)
        if ls2[0] != ls2[-1]:
            continue
        
        for i in range(n+1):
            if ls1[i] != ls2[i]:
                continue
        '''
        
        return ls1[:-1]
    
    return False

for first in ['S','W']:
    c = check(first)
    if c:
        print(*c,sep='')
        sys.exit()
print(-1)

Measured memory_bytes: 81636
import java.util.*;

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


Measured memory_bytes: 35664
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>

#include <iomanip>

using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define FIND(x, target) find(x.begin(),x.end(),target)
#define pb(x) push_back(x)
#define pob(x) pop_back(x)
#define output(x) cout<<x<<endl
#define ERASE(x, n) x.erase(x.begin()+n)
// #define int long long
// #define P pair<int, int>
typedef long long ll;

const long long int MOD = 1e9+7;
const ll INF = 1e17;
// ll dp[100005][13];
ll dp[10005];

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

signed main(void) {
  ll H, N;
  cin >> H >> N;
  vector<pair<ll, ll> > pairs(N);
  rep(i, N) {
    ll A, B;
    cin >> A >> B;
    pairs[i] = make_pair(A, B);
  }

  SORT(pairs);

  // dp[N]: 体力Nを減らすために必要な最少魔力
  dp[0] = 0;
  for(int i=1; i<=H; i++) {
    ll min = INF;
    for(int k=0; k<N; k++) {
      ll result = INF;
      ll remain = i - pairs[k].first;
      if (remain < 0) {
        result = dp[0] + pairs[k].second;
      } else {
        result = dp[remain] + pairs[k].second;
      }
      if (result < min) {
        min = result;
      }
    }
    dp[i] = min;
  }

  cout << dp[H] << endl;
}


Measured memory_bytes: 384
#ifndef ONPC
  #define _FORTIFY_SOURCE 0
  #pragma GCC optimize("Ofast")
  #pragma GCC optimize("no-stack-protector")
  #pragma GCC optimize("unroll-loops")
  #pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
  #pragma GCC optimize("fast-math")
#endif

#include <bits/stdc++.h>

#define mp make_pair
#define eb emplace_back
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#endif


const int MAXN = 100;
//#define int long long
const int INF = 1e9;

signed main()
{
    #ifdef FILEIO
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n, x, y;
    cin >> n >> x >> y;
    x--;
    y--;

    vector<int> ans(n);

    for (int i = 0; i < n; i++){
      for (int j = i+1; j < n; j++){
        int d = j - i;
        //if (i <= x && j >= y) d = (x - i) + 1 + (j - y);
        d = min(d, abs(x - i) + 1 + abs(j - y));
        ans[d]++;
      }
    }

    for (int i = 1; i < n; i++) cout << ans[i] << '\n';

    return 0;
}


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

int main()
{
	string s;
	
	cin >> s;
	
	int pcnt=0;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='p')
			pcnt++;
	}
	
	cout << s.size()/2-pcnt << endl;
	return 0;
}

Measured memory_bytes: 512
// 161-C Replacing Integer

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#include <assert.h>
#include <string.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>

// qsortで用いる比較用関数．*a<*bならaが先になる．
int compare(const void* a, const void* b) {
    return *(char*)a - *(char*)b;
}

void kojun(char* word) {
    char min_alphabet[2],tmp[2];
    int i, min_i,j;

    for (j = strlen(word) - 1; j > 0; j--) {
        min_i = 0;
        min_alphabet[0] = word[min_i];
        for (i = 1; i < j+1; i++) {
            if (word[i] < min_alphabet[0]) {
                //printf("word[i]:%c min_alphabet:%c ", word[i], min_alphabet[0]);
                min_alphabet[0] = word[i];
                min_i = i;
            }
        }
        tmp[0] = word[j];
        word[j] = word[min_i];
        word[min_i] = tmp[0];
        
        //printf("j:%d min_alphabet:%c\n", j, min_alphabet[0]);
    }
    return;
}

void syojun (char* word) {
    char max_alphabet[2], tmp[2];
    int i, max_i, j;

    for (j = strlen(word) - 1; j > 0; j--) {
        max_i = 0;
        max_alphabet[0] = word[max_i];
        for (i = 1; i < j + 1; i++) {
            if (word[i] > max_alphabet[0]) {
                //printf("word[i]:%c max_alphabet:%c ", word[i], max_alphabet[0]);
                max_alphabet[0] = word[i];
                max_i = i;
            }
        }
        tmp[0] = word[j];
        word[j] = word[max_i];
        word[max_i] = tmp[0];

        //printf("j:%d max_alphabet:%c\n", j, max_alphabet[0]);
    }
    return;
}


int main() {

    char word_s[101], word_t[101];

    scanf("%s", word_s);
    scanf("%s", word_t);
    

    syojun(word_s);
    kojun(word_t);
    //printf("%s %s\n", word_s, word_t);
    if (strcmp(word_s, word_t) < 0) {
        printf("Yes\n");
    }
    else {
        printf("No\n");
    }
    
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
long long m=1e9+7;
int main(){
long long n;cin>>n;
  vector <long long> v(63,0);
  for(int i=0;i<n;i++){
  long long a;cin>>a;
    for(int j=0;j<63;j++){
    if(a&1ll<<j)v[j]++;
    }
  }
  long long ans=0;
  for(int i=0;i<63;i++){ans+=((1ll<<i)%m)*v[i]%m*((n-v[i])%m);ans%=m;}
  cout<<ans;
}


Measured memory_bytes: 384
#include <iostream>
int main() {
	char x, y;
	std::cin >> x;
	std::cin >> y;
	if (x < y) {
		std::cout << '<';
	} else if (x > y) {
		std::cout << '>';
	} else {
		std::cout << '=';
	}
	return 0;
}

Measured memory_bytes: 256
# bit演算, 全探索で多分いける
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    n = int(input())
    fs = [int(input().replace(' ', ''), 2) for _ in range(n)]
    # print(fs)
    ps = [list(map(int, input().split())) for _ in range(n)]
    # print(ps)
    ans = -float("INF")
    for i in range(1, 2 ** 10):
        num_simal_stores = [bin(i & f).count('1') for f in fs]
    
        ans_tmp = 0
        for i in range(n):
            ans_tmp += ps[i][num_simal_stores[i]]

        ans = max(ans, ans_tmp)
    
    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
import Control.Applicative
import Data.List

qsort :: [Int] -> [Int]
qsort [] = []
qsort (p:xs) = qsort lt ++ [p] ++ qsort gteq
  where lt   = [x | x <- xs, x <  p]
        gteq = [x | x <- xs, x >= p]

modeValue :: [(Int, Int)] -> Int
modeValue xs = maximum $ map snd xs

findMax :: [(Int, Int)] -> Int -> [Int]
findMax [] _ = []
findMax xs m =
  let ys = filter (\y -> snd y == m) xs
  in
      map fst ys

reshape :: [Int] -> [(Int, Int)]
reshape [] = []
reshape (x:xs) =
  let ys = filter (\y -> x == y) xs
  in
      (x, 1 + length ys) : reshape (xs \\ ys)

solver :: [Int] -> [Int]
solver [] = []
solver xs =
  let ys  = reshape xs
      m   = modeValue ys
  in
      findMax ys m

main :: IO()
main = do
  contents <- map (read :: String -> Int) . lines <$> getContents
  mapM_ print $ qsort $ solver contents

Measured memory_bytes: 4096
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
int N,M;
vector<int>G[1000];
int cnt[1000];
main()
{
	cin>>N>>M;
	for(int i=0;i<M;i++)
	{
		int u,v;cin>>u>>v;u--,v--;
		G[u].push_back(v);
		cnt[v]++;
	}
	queue<int>P;
	for(int i=0;i<N;i++)
	{
		if(cnt[i]==0)P.push(i);
	}
	int sz=0;
	while(!P.empty())
	{
		sz++;
		int u=P.front();P.pop();
		for(int v:G[u])
		{
			if(--cnt[v]==0)P.push(v);
		}
	}
	cout<<-(sz==N)<<endl;
}


Measured memory_bytes: 256
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		string[] input = Console.ReadLine().Split(' ');
		long a = long.Parse(input[0]);
		long b = long.Parse(input[1]);

		Console.WriteLine(a*b/Gcd(a,b));
	}

  static long Gcd(long a, long b) 
      {//引数a,bの最大公約数を返す
           if (a < b)
               return Gcd(b, a);//入れ替え
           while (b != 0) 
           {
               long changeTo = a % b;
               a = b;
               b = changeTo;
           }
           return a;
       }
  
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < int(n); i++)
ll mod=998244353;

int main(){
    std::ios::sync_with_stdio(false);
    int n;
    cin>>n;
    cout<<pow(n,3);

    return 0;
}



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

ll b(ll a){
	if(a == 1)
		return 0;
	if(a == 2){
		return 1;
	}
	return b(a-1) + a-1;
}         

int main(){               
	int n;
	ll ans = 0;
	cin >> n;
	vector<string> v(n);    	
  for(int i = 0; i < n; i++){
  	cin >> v[i];
  	sort(v[i].begin(), v[i].end());
  } 
  sort(v.begin(), v.end());
  ll temp = 0;
  for(int i = 1; i < n; i++){
  	if(v[i] == v[i-1])
  		temp++;
  	else
  		temp = 0;
  	ans += temp;	
  }             
  cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7296
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String c=sc.next();
		if(c.equals("a")||c.equals("e")||c.equals("i")||c.equals("o")||c.equals("u")){
			System.out.println("vowel");
		}
		else{
			System.out.println("consonant");
		}
	}
}

Measured memory_bytes: 23892
#include<bits/stdc++.h>
#define ll long long 
#define ld long double
#define vl vector
#define pb push_back
#define ff first
#define ss second
using namespace std;

int main()
{
    ll n,m,i,a=0,b=0,k,t,j;
    cin>>n;
    ll arr[n];
    for(i=0;i<n;i++) cin>>arr[i];
    ll count=1;
    ll brk=0;
    for(i=0;i<n;i++)
    {
        if(count==arr[i]) count++;
        else brk++;
    }
    if(brk==n) cout<<"-1";
    else cout<<brk;
}

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

int main()
{
  string S;
  cin >> S;
  int A = S[0] - '0';
  int B = S[1] - '0';
  int C = S[2] - '0';
  int D = S[3] - '0';
  if (A + B + C + D == 7)
    printf("%d+%d+%d+%d=7\n", A, B, C, D);
  else if (A - B + C + D == 7)
    printf("%d-%d+%d+%d=7\n", A, B, C, D);
  else if (A + B - C + D == 7)
    printf("%d+%d-%d+%d=7\n", A, B, C, D);
  else if (A + B + C - D == 7)
    printf("%d+%d+%d-%d=7\n", A, B, C, D);
  else if (A + B - C - D == 7)
    printf("%d+%d-%d-%d=7\n", A, B, C, D);
  else if (A - B + C - D == 7)
    printf("%d-%d+%d-%d=7\n", A, B, C, D);
  else if (A - B - C + D == 7)
    printf("%d-%d-%d+%d=7\n", A, B, C, D);
  else
    printf("%d-%d-%d-%d=7\n", A, B, C, D);
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#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 all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
int main(){
	int a[4];
	rep(i,4) cin>>a[i];
	sort(a,a+4);
	if(a[0]==1 && a[1]==4 && a[2]==7 && a[3]==9) puts("YES");
	else puts("NO");
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
int s[55];
int main()
{
    int n,m,a,b;
    cin >> n >> m;
    for(int i = 1; i <= m; i++){
        cin >> a >> b;
        s[a]++;
        s[b]++;
    }
    for(int i = 1; i <= n; i++)
        cout << s[i] << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        scanner.nextLine();
        String str = scanner.nextLine().trim().substring(0, n);
        Fenwick fenwick = new Fenwick(str);
        int q = scanner.nextInt();
        for (int i = 0; i < q; i++) {
            int queryType = scanner.nextInt();
            if(queryType==1){
                int pos = scanner.nextInt();
                char c = scanner.nextLine().trim().charAt(0);
                fenwick.change(pos, c);
            }else{
                int lq = scanner.nextInt();
                int rq = scanner.nextInt();
                System.out.println(fenwick.numberOfDifferentChars(lq, rq));
            }
        }
    }

    public static class Fenwick {
        public static final int abc = 26;
        private char[] str;
        private final int[][] t;
        private final int n;
        public String debugPrint(){
            return new String(str);
        }

        public Fenwick(String string){
            this.str = string.toCharArray();
            n = string.length();
            t = new int[n][abc];
            for (int i = 0; i < n; i++) {
                inc(i,str[i]-'a', 1);
            }
        }
        public void change(int i, char c){
            i=i-1;
            if(str[i]!=c){
                int oldChar = str[i]-'a';
                int newChar = c-'a';
                str[i]=c;
                inc(i, oldChar, -1);
                inc(i, newChar, 1);
            }
        }

        private void inc(int i, int c, int delta){
            for (; i < n; i = (i | (i+1)))
                t[i][c] += delta;
        }

        public int numberOfDifferentChars(int l, int r){
            l--;
            r--;
            int res = 0;
            for (int i = 0; i < abc; i++) {
                if(sum(l, r, i)!=0) res++;
            }
            return res;
        }

        private int sum(int l, int r, int c){
            return sumR(r, c) - sumR(l-1, c);
        }

        private int sumR(int r, int c){
            int result = 0;
            for (; r >= 0; r = (r & (r+1)) - 1)
                result += t[r][c];
            return result;
        }
    }
}

Measured memory_bytes: 415664
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define vec vector
typedef long long ll;
typedef pair<ll,ll> P;
//const ll big=998244353;
const ll big=1000000007LL;
const ll INF=1e18;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll max(ll x,ll y){
    if(x>y)return x;
    else return y;
}
ll min(ll x,ll y){
    if(x<y)return x;
    else return y;
}
ll expm(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (expm(x,y-1)*x)%big;
    ll t=expm(x,y/2);
    return (t*t)%big;
}
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||y==0)return x;
    if(y%2==1)return exp(x,y-1)*x;
    ll t=exp(x,y/2);
    return t*t;
}


int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    /*--------------------------------*/
    
    int n;cin >> n;
    int l;cin >> l;
    int cnt=0;
    rep(i,n)cnt+=l+i;
    ll ans=100000000;
    rep(i,n){
        if(abs(l+ans) > abs(l+i))ans=i;
    }
    cout << cnt - (l+ans) << endl;
}

Measured memory_bytes: 3616
import java.util.*;
 
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
      	long memo[] = new long [n+1];
      	memo[0] = 2;memo[1]=1;
      
      for(int i =2;i <= n ;i++){
        memo[i] = memo[i-1]+memo[i-2];
      }
      System.out.print(memo[n]);
	}
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m;i<n;i++)
#define c(n) cin>>n
#define c2(n,m) cin>>n>>m
#define c3(n,m,k) cin>>n>>m>>k
#define c4(n,m,k,l) cin>>n>>m>>k>>l
#define co(n) cout<<n<<endl
using namespace std;

int main(){
  long a,b=2,c=0,d=0,e,n,m=0,x;
  c2(a,b);
  c=b-a;
  d=(c*c+c)/2;
  co(d-b);
  
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    string S;
    cin>>S;
    string T;
    int c=0;
    while(1){
        cin>>T;
        if(T=="END_OF_TEXT") break;
        for(int i=0;i<T.size();i++){
            if(0<=T[i]-'A'&&T[i]-'A'<=25) T[i]=T[i]-'A'+'a';
        }
        if(T==S) c++;
    }
    cout<<c<<endl;
}


Measured memory_bytes: 3212
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'a' = 97

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



Measured memory_bytes: 3104
#include <bits/stdc++.h>
 
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1e5)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
typedef pair <ll,ll> P;

int main()
{
    ll N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) { 
        cin >> A[i];
    }
    vector<ll> B(N);
    copy(all(A),B.begin());
    sort(all(B));
    rep(i, N) {
        if (A[i] == B[N-1]) {
            print(B[N-2]);
        } else {
            print(B[N-1]);
        }
    }
    return 0;
}

Measured memory_bytes: 4736
a[9];main(t,i,j,k,x){for(scanf("%d",&t);t--;printf("%x\n",k)){
	for(i=0;i<9;i++)scanf("%x",a+i);
	for(k=j=0;j<32;k|=(x^a[8])&(1<<j++))for(x=i=0;i<8;i++)x+=a[i]^k;
}exit(0);}

Measured memory_bytes: 604
#include <bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9

typedef long long ll;

using namespace std;

const ll inf = 1e18;
const ll mod = 1e9+7;
const int N = 1e5+5;
//int a[N];

int main()

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

    int n, cnt = 0, ans = 0;

    cin >> n;

    for (int i = 1; i <= n; i+=2) {

        for (int j = 1; j*j <= i; j++) {

            if (i%j == 0) cnt++;
        }

        if (cnt == 4) ans++;
        cnt = 0;
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 256
height, width, cnt = gets.split.map(&:to_i)

board = {}

cnt.times do
  x, y = gets.split.map(&:to_i)
  x -= 1
  y -= 1
  [-1, 0, 1].repeated_permutation(2).collect.each do |dx, dy|
    new_x = x + dx
    new_y = y + dy
    next unless 0 < new_x && new_x < height - 1
    next unless 0 < new_y && new_y < width - 1
    board[new_x] ||= Hash.new(0)
    board[new_x][new_y] += 1
  end
end

counts = board.flat_map { |_key, h| h.values }.each_with_object(Hash.new(0)) {|e, h| h[e] += 1}
counts[0] = (height - 2) * (width - 2) - (counts.values.inject(&:+) || 0)

(0..9).each { |i| puts counts[i] }

Measured memory_bytes: 124268
#include<bits/stdc++.h>
 
using namespace std;
 
int main(){
    int N; cin >> N;
    for(int i = 0; i*4 <= N; ++i){
        for(int j = 0; j*7 <= N; ++j){
            if(i*4+j*7 == N){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    if(s[0]=='S' && s[1]=='U' && s[2]=='N')
        cout<<"7"<<endl;
    if(s[0]=='M' && s[1]=='O' && s[2]=='N')
        cout<<"6"<<endl;
    if(s[0]=='T' && s[1]=='U' && s[2]=='E')
        cout<<"5"<<endl;
    if(s[0]=='W' && s[1]=='E' && s[2]=='D')
        cout<<"4"<<endl;
    if(s[0]=='T' && s[1]=='H' && s[2]=='U')
        cout<<"3"<<endl;
    if(s[0]=='F' && s[1]=='R' && s[2]=='I')
        cout<<"2"<<endl;

    if(s[0]=='S' && s[1]=='A' && s[2]=='T')
        cout<<"1"<<endl;

    }



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

int main(){
	int n;
	cin >> n;
	vector<ll> a(n+1);
	rep(i,n+1) cin >> a[i];
	if(n >= 1 && a[0] != 0){
		cout << -1 << endl;
		return 0;
	}
	if(n == 0 && a[0] != 1){
		cout << -1 << endl;
		return 0;
	}
	ll ans = 0;
	vector<ll> sup(n+1);
	sup[n] = a[n];
	for (int j = n-1; j >= 0; --j) {
		sup[j] += a[j] + sup[j+1];
	}
	ll prev = 1;
	ans += 1;
	REP(i,n){
		ll node = min(sup[i], prev*2);
		ans += node;
		prev = node - a[i];
		if(prev < 0){
			cout << -1 << endl;
			return 0;
		}
	}
	cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4784
import sys
a, b, c = input().split()

a = int(a)
b = int(b)
c = int(c)

if a == b:
    if a and b != c:
        print("Yes")
        sys.exit()
if a == c:
    if a and c != b:
        print("Yes")
        sys.exit()
if b == c:
    if b and c != a:
        print("Yes")
        sys.exit()
print("No")



Measured memory_bytes: 3060
def main():
    S = list(input())
    K = int(input())
    L = len(S)
    for i in range(L):
        if S[i] == 'a':
            continue
        if ord('z') - ord(S[i]) + 1 <= K:
            K -= ord('z') - ord(S[i]) + 1
            S[i] = 'a'

    if K > 0:
        S[-1] = chr(ord(S[-1]) + K % 26)

    print(''.join(S))




if __name__ == "__main__":
    main()

Measured memory_bytes: 71816
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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



int main() {
    int n;
    cin>>n;
    int ans=0;
    vector<int>a(n);
    for(int i=0;i<n;i++){
        cin>>a.at(i);
        ans+=a.at(i);
    }
    cout<<ans-n<<endl;







    return 0;
}

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

using namespace std;

struct Bridge {
	int p, q;
};

int n, m, a;
vector< vector<Bridge> > bvec;

void solve() {
	for (int i = 1000 - 1; i >= 0; i--) {
		for (int j = 0; j < (int)bvec[i].size(); j++) {
			Bridge br = bvec[i][j];
			
			if (br.p == a) {
				a = br.q;
				break;
			} else if (br.q == a) {
				a = br.p;
				break;
			}
		}
	}
	
	cout << a << endl;
}

int main() {
	while (1) {
		cin >> n >> m >> a; if (n == 0) break;
		
		bvec.assign(1000, vector<Bridge>());
		for (int i = 0; i < m; i++) {
			int h, p, q; cin >> h >> p >> q;
			bvec[h - 1].push_back((Bridge){p,q});
		}
		
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 1304
import java.math.BigDecimal

fun main(args: Array<String>) {
  val (A, B, C) = readLongs()
  val a = BigDecimal.valueOf(A)
  val b = BigDecimal.valueOf(B)
  val c = BigDecimal.valueOf(C)
  if (c - a - b < BigDecimal(0)) {
    println("No")
  } else {
    if (BigDecimal.valueOf(4L) * a * b < (c - a - b) * (c - a - b)) {
      println("Yes")
    } else {
      println("No")
    }
  }
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readInts() = readStrings().map(Integer::parseInt)
fun readLong() = readString().toLong()
fun readLongs() = readStrings().map { it.toLong() }


Measured memory_bytes: 37912
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll h,w;cin>>h>>w;
  ll ans=100000000000000;
  for(ll i=1;i<=w-1;i++){
    ll a[3];
    a[0]=i*h;
    a[1]=(w-i)*(h/2);
    a[2]=h*w-a[0]-a[1];
    //cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;
    sort(a,a+3);
    ans=min(ans,a[2]-a[0]);
    ll b[3];
    if(i<=w-2){
    b[0]=i*h;
    b[1]=h*((w-i)/2);
    b[2]=h*w-b[0]-b[1];
      sort(b,b+3);
      ans=min(ans,b[2]-b[0]);
    }
  }
  for(ll i=1;i<=h-1;i++){
    ll a[3];
    a[0]=i*w;
    a[1]=(h-i)*(w/2);
    a[2]=h*w-a[0]-a[1];
    sort(a,a+3);
    ans=min(ans,a[2]-a[0]);
    ll b[3];
    if(i<=h-2){
    b[0]=i*w;
    b[1]=w*((h-i)/2);
    b[2]=h*w-b[0]-b[1];
      sort(b,b+3);
      ans=min(ans,b[2]-b[0]);
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
	double h, min = 1000000.0, max = 0.0;
	while(cin >> h){
		if( h > max ) max = h;
		else if( h < min ) min = h;
	}
	cout << fixed << setprecision(1) << max - min << endl;
}

Measured memory_bytes: 1280
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  string a; readV(a);
  string b; readV(b);

  if (a.length > b.length)
    writeln("GREATER");
  else if (a.length < b.length)
    writeln("LESS");
  else if (a > b)
    writeln("GREATER");
  else if (a < b)
    writeln("LESS");
  else
    writeln("EQUAL");
}


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

using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

void test_case() {
	int n, l;
	cin >> n >> l;
	string arr[n];
	for(int i = 0; i < n; i ++) {
		cin >> arr[i];
	}
	sort(arr, arr+n);
	for(int i = 0; i < n; i ++) {
		cout << arr[i];
	}
	printf("\n");
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t = 1; 
	//scanf("%d", &t);
	while(t --) {
		test_case();
	}
	return 0;
}


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

typedef long long ll;

ll mod = 1e9 + 7;

ll mp(ll a, ll b) {
    if (b == 0) return 1LL;
    if (b == 1) return a;
    ll ret = mp(a,b/2);
    ret *= ret;
    ret %= mod;
    if (b&1) ret *= a;
    return ret % mod;
}

ll inv(ll k) {
    return mp(k,mod-2);
}

ll n;
ll a[10010];
ll ans = 1;
int p[1000010];

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        sum += inv(a[i]);
        sum %= mod;
    }
    for (int i = 0; i < n; i++) {
        int tmp = a[i];
        for (int j = 2; j * j <= tmp; j++) {
            if (tmp % j == 0) {
                int cnt = 0;
                while (tmp % j == 0) {
                    tmp /= j;
                    cnt++;
                }
                if (p[j] < cnt) {
                    for (; p[j] < cnt;) {
                        p[j]++;
                        sum *= j;
                        sum %= mod;
                    }
                }
            }
        }
        if (tmp > 0) {
            for (; p[tmp] < 1;) {
                p[tmp]++;
                sum *= tmp;
                sum %= mod;
            }
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 2944
n, k = gets.split.map(&:to_i)
x = gets.split.map(&:to_i)

ans = 1_000_000_000

0.upto(n - k) do |l|
  r = l + k - 1
  if x[r] <= 0
    a = x[l].abs
  elsif x[l] >= 0
    a = x[r]
  else
    if x[l].abs >= x[r]
      a = x[r] * 2 + x[l].abs
    else
      a = x[l].abs * 2 + x[r]
    end
  end
  ans = a if a < ans
end

puts ans


Measured memory_bytes: 8460
from sys import stdin
import sys

# A, B, C = [int(x) for x in stdin.readline().rstrip().split()]
N, K = [int(x) for x in stdin.readline().rstrip().split()]
# print(N, K)
ans = 0
# min = 0
for i in range(K, N+2):
    # print(i)
    min = 0
    max = 0
    min = (i*(i-1))//2
    max = i*N-min
    # print(min, max)
    # min = 0
    # max = 0
    # for k in range(i):
    #     min += k
    #     max += N-k
    # print(min, max)
    ans += max-min+1
print(ans%(10**9+7))


Measured memory_bytes: 9180
#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define  fill(st,et,val,arr) for(int i=st;i<=et;i++)arr[i]=val;
#define all(v) v.begin(),v.end()
template <class T>
inline void read(T &x) {
    x = 0;
    char ch = getchar(), w = 0;
    while (!isdigit(ch)) w = ch == '-', ch = getchar();
    while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
    x = w ? -x : x;
    return;
}
 
const int M=1e9 + 7;
const int MAX=1e5+7;
using namespace std;
bool comp(int a,int b)
{	
	return a>b;
}
void printQ(vector<int> q)
{   
    cout<<"v->  ";
	for(int i=0;i<q.size();i++)
	{
		cout<<q[i]<<" ";
	}
	cout<<endl;
}

int32_t main() 
{
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	char c;
	cin>>c;
	cout<<(char)(c+1)<<endl;
	return 0;
}













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

bool check(int skill[20], int m, int x){
    for(int i = 0; i < m; i++){
        if(skill[i] < x){
            return false;
        }
    }
    return true;
}


int main(void){
    int n, m, x, ans;
    vector<int> ok;
    cin >> n >> m >> x;
    int c[20], a[20][20];
    for(int i = 0; i < n; i++){
        cin >> c[i];
        for(int j = 0; j < m; j++){
            cin >> a[i][j];
        }
    }


    int price, skill[m];
    price = 0;
    for(int i = 0; i < m; i++) skill[i] = 0;
    for(int i = 0; i < 1<<n; i++){
        for(int j = 0; j < n; j++){
            if((i>>j)%2 == 1){
                price += c[j];
                for(int k = 0; k < m; k++) skill[k] += a[j][k];
            }
        }
        if(check(skill, m, x)){
            ok.push_back(price);
        }
        price = 0;
        for(int j = 0; j < m; j++) skill[j] = 0;
    }
    sort(ok.begin(), ok.end());
    if(ok.empty()) cout << -1 << endl;
    else cout << ok[0] << endl;
            
    return 0;
}


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

#define ln                 '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fm, to)    for (int i = fm; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

const int nsz = 2e5;
const num inf = 0x3f3f3f3f3f3f3f3f;
int n, l[nsz + 5], r[nsz + 5];
num d, a[nsz + 5], ans;

num inline w1(int id) {
	return a[id] - d * id;
}

num inline w2(int id) {
	return a[id] + d * id;
}

num inline w(int u, int v) {
	return a[u] + a[v] + d * abs(u - v);
}

int main() {
	scanf("%d%lld", &n, &d);
	cont (i, n) {
		scanf("%lld", &a[i]);
	}
	a[0] = inf, a[n + 1] = inf;
	cont (i, n) {
		l[i] = w1(l[i - 1]) < w1(i) ? l[i - 1] : i;
	}
	for (int i = n; i >= 1; --i) {
		r[i] = w2(r[i + 1]) < w2(i) ? r[i + 1] : i;
	}
	int pre = 0;
	cont (i, n) {
		if (l[i] == i && r[i] == i) {
			if (pre)  ans += w(pre, i);
			pre = i;
		} else {
			ans += min(l[i] != i ? w(l[i], i) : inf, r[i] != i ? w(i, r[i]) : inf);
		}
	}
	cout << ans << ln;
}

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

typedef long long ll;
const int MOD = 1e9 + 7;
typedef vector<ll> vll;

static int speedUp = []() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    return 0;
}();

int main() {
    string s;
    cin >> s;
    if (s.length() == 3) {
        reverse(s.begin(), s.end());
    }
    cout << s << endl;
    return 0;

}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int t = int.Parse(input[2]);

            double times = t + 0.5;

            int biscuits = (int)(times / a) * b;
            
            Console.WriteLine(biscuits);
            
            return;
        }
    }
}

Measured memory_bytes: 11092
#include<bits/stdc++.h>
#define mod 1000000007
#define lim 1000000000000000007
#define lim1 18446744073709551615  //Unsigned
#define sq(a) ((a)*(a))
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mms(v,i) memset(v,i,sizeof(v))
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define REPN(i,a,b) for (int i = a; i >= b; i--)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pi;
typedef pair<ll,ll> PL;
typedef pair<ll,int> PLI;
typedef pair<int,ll> PIL;
typedef pair<int,pair<int,int> > pii;
typedef pair<double,double> pdd;
ll power(ll a,ll b) {
    if (b==0) return 1;
    ll c = power(a,b>>1);
    c = (c*c)%mod;
    if (b&1) return (c*a)%mod;
    return c;
}
ll gcdll(ll a,ll b) {
    if (b==0) return a;
    return gcdll(b,a%b);
}
int gcd(int a,int b) {
    if (b==0) return a;
    return gcd(b,a%b);
}
const int N = (int)1e5+5;
const int Q = 301;

void solve() {
    int a,b;
  	cin>>a>>b;
  	cout<<(6-a-b);
}
int main() {
    //freopen("class_treasurer.txt","r",stdin);
    //freopen("output.txt","w",stdout);

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

    int T=1;
    //cin>>T;
    REP(TC,1,T) {
        //cout<<"Case #"<<TC<<": ";
        solve();
        cout<<"\n";
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = 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;}
const int inf = 1001001001;

int main() {
    int n,k;
    cin >> n >> k;
    auto pro = [&](int i) {
        double ret = 1;
        while(i < k) {
            i *= 2;
            ret *= 0.5;
        }
        return ret;
    };
    double ans = 0;
    double d = double(1)/double(n);
    rep2(i,1,n+1) {
        ans += pro(i)*d;
    }
    printf("%.10f",ans);
}

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

using namespace std;

int d[5] = {5,7,5,7,7};

int main(){
	int n;
	while(cin >> n,n){
		vector<int> v;
		for(int i=0;i<n;i++){
			string s;
			cin >> s;
			v.emplace_back(s.size());
			//cout << s.size() << endl;
		}
		int sum=0;
		int idx=0;
		int start=0;
		for(int unsigned i=0;i<v.size();i++){
			sum+=v[i];
			//cout << v[i] << " " << sum << " " << d[idx] << " " << i << " " << " " << idx << " " << start << endl;
			if(sum == d[idx]){
				idx++;
				sum=0;
			} else if(sum > d[idx]){
				idx=0;
				i = start;
				start=i+1;
				sum=0;
			}
			if(idx >= 5){
				cout << start+1 << endl;
				break;
			}
		}
		//cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3160
a,b,c,x,y = map(int,input().split())
d = []
d.append(a*x+b*y)
if x >= y:
    d.append(a*(x-y)+c*y*2)
    d.append(c*x*2)
else:
    d.append(b * (y - x) + c * x * 2)
    d.append(c * y * 2)
print(min(d))


Measured memory_bytes: 3060
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_7_B
// Tree - Binary Trees

#define SUBMIT

#include <utility>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <limits>
#include <numeric>
#include <set>
#include <cmath>
#include <cstring>
#include <climits>

using namespace std;
using ui64 = unsigned long long;
using i64 = long long;

const int NIL = -1;
const int MAX_T = 100000;

struct node { int parent, left, right; };
struct node T[MAX_T];
int depth[MAX_T];
int height[MAX_T];

int get_sibling(int child) {
    if (child == NIL || T[child].parent == NIL) return NIL;
    auto parent = T[child].parent;

    if (T[parent].left == child) return T[parent].right;
    else return T[parent].left;
}

int get_degree(int u) {
    auto degree = 0;
    if (T[u].left != NIL) degree++;
    if (T[u].right != NIL) degree++;
    return degree;
}

void print_node(int u) {
    cout << "node " << u << ": ";
    cout << "parent = " << T[u].parent << ", ";
    cout << "sibling = " << get_sibling(u) << ", ";
    cout << "degree = " << get_degree(u) << ", ";
    cout << "depth = " << depth[u] << ", ";
    cout << "height = " << height[u] << ", ";

    if (T[u].parent == NIL) cout << "root" << endl;
    else if (T[u].left == NIL && T[u].right == NIL) cout << "leaf" << endl;
    else cout << "internal node" << endl;
}

void set_depth(int u, int d) {
    depth[u] = d;
    if (T[u].left != NIL) set_depth(T[u].left, d + 1);
    if (T[u].right != NIL) set_depth(T[u].right, d + 1);
}

int set_height(int u) {
    auto h1 = 0, h2 = 0;
    if (T[u].left != NIL) h1 = set_height(T[u].left) + 1;
    if (T[u].right != NIL) h2 = set_height(T[u].right) + 1;

    height[u] = max(h1, h2);
    return height[u];
}


int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) T[i].parent = NIL, T[i].left = NIL, T[i].right = NIL;

    int id, left, right;
    for (int i = 0; i < n; ++i) {
        cin >> id >> left >> right;
        T[id].left = left;
        T[id].right = right;
        if (left != NIL) T[left].parent = id;
        if (right != NIL) T[right].parent = id;
    }

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

    set_depth(root, 0);
    set_height(root);

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


Measured memory_bytes: 3084
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijoMOD(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i<=n;i++){
    num*=yakusu[i];
  }
  return num;
}

int H,W;
vs s(50);
vi dv ={-1,0,1,0};vi du={0,-1,0,1};
int cnt=1;
int dfs(int u,int v){
  s[u][v]='.';
  
  rep(i,4){
   
      int nu =u +du[i],nv=v+dv[i];
      if(nu<0||nu>=H||nv<0||nv>=W)continue;
      if(s[nu][nv]=='.')continue;
      cnt ++;
      dfs(nu,nv);
    
  }
  return cnt;

}
int keta_wa(int x){
  int tot=0;
  while(x>0){
    tot +=x%10;
    x/=10;
  }
  return tot;
}

//vc alp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//cout<<""<<endl;
int main(){
 string s;cin>>s;
  map<int ,int > mp;
  rep(i,s.size()){
    mp[s[i]] ++;
  }
  bool ok=true;
  for(auto x:mp){
   if(x.second>=2)ok=false;
  }
  if(ok)cout<<"yes"<<endl;
  else cout<<"no"<<endl;
}





Measured memory_bytes: 256
while True:
    a,op,b = input().split()
    a = int(a)
    b = int(b)
    
    if op == '?':
        break
    elif op == '+':
        print(int(a+b))
    elif op == '-':
        print(int(a-b))
    elif op == '*':
        print(int(a*b))
    elif op == '/':
        print(int(a/b))


Measured memory_bytes: 5588
import java.util.*;
import javax.lang.model.util.ElementScanner6;

public class Main {

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

        // 入力
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        // 処理
        String out = "No";
        if (a == b && a != c) {
            out = "Yes";
        } else if (b == c && b != a) {
            out = "Yes";
        } else if (a == c && a != b) {
            out = "Yes";
        }

        // 出力
        System.out.println(out);
    }

}

Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
int32_t main(){
	vector<int> a(90);
	int n; cin>>n;
	a[0] = 2;
	a[1] = 1;
	for(int i = 2; i <= n; i++){
		a[i] = a[i - 1] + a[i - 2];	
	}
	cout<<a[n]<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 100000;
//隣接リスト
vector<ll> G[50];
//隣接行列に辺のラベルを記録
ll graph[50][50];

ll depth[50];
ll par[50];

void dfs(ll v) {
  for (ll i = 0; i < G[v].size(); i++) {
    ll to = G[v][i];
    if (depth[to] == INF) {
      depth[to] = depth[v]+1;
      par[to] = v;
      dfs(to);
    } else {continue;}
  }
}

ll pow(ll n) {
  ll p = 1;
  for (ll i = 0; i < n; i++) {
    p*=2;
  }
  return p;
}
  

int main() {
  ll N;
  cin >> N;
  
  for (ll i = 0; i < N-1; i++) {
    ll a, b;
    cin >> a >> b; a--; b--;
    G[a].push_back(b);
    G[b].push_back(a);
    graph[a][b] = i;
    graph[b][a] = i;
  }
  
  //深さ, 親
  fill(depth, depth+N, INF);
  depth[0] = 0;
  par[0] = 0;
  dfs(0);
  
  
  //uとvの最深共通祖先を探す過程で最短路がわかる、最短路はlong long int path[M]で管理
  ll M;
  cin >> M;
  ll path[M];
  for (ll i = 0; i < M; i++) {
    path[i] = 0;
  }
  
  for (ll i = 0; i < M; i++) {
    ll u, v;
    cin >> u >> v; u--; v--;
    while (depth[u] > depth[v]) {
      path[i] += (1LL << graph[u][par[u]]);
      u = par[u];
    }
    while (depth[v] > depth[u]) {
      path[i] += (1LL << graph[v][par[v]]);
      v = par[v];
    }
    while (u != v) {
      path[i] += (1LL << graph[u][par[u]]);
      u = par[u];
      path[i] += (1LL << graph[v][par[v]]);
      v = par[v];
    }
  }
  
  //path[i] はi番目のpathに含まれる辺たちを記録
  //共通部分はor演算で求まる
  ll bits;
  ll ans = 0;
  
  for (bits = 0; bits < (1LL << M); bits++) {
    ll val = 0;
    for (ll i = 0; i < M; i++) {
      if (bits & (1LL << i)) {val |= path[i];}
    }
    ll c = __builtin_popcountl(val);
    ll b = __builtin_popcountl(bits);
    if (b % 2 == 1) { ans -= 1LL<<(N-1-c); }
    else { ans += 1LL<<(N-1-c); }
  }
  cout << ans << endl;
}


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

#define show(x) cerr << #x << " = " << x << endl ;
#define input_from_file freopen("input.txt","r",stdin)
#define output_to_file freopen("output.txt" , "w",stdout)
#define fastio ios_base::sync_with_stdio(0)
#define endl '\n'



int main()
{
	 #ifdef LOCAL
        input_from_file;
        output_to_file;
    #endif
	fastio;cin.tie(0);cout.tie(0);
	int a , b ;
	cin >> a >> b ;
	cout << max(0 , a - 2*b);


	return 0;
}


Measured memory_bytes: 256