akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <cassert>
#include <deque>
#include <map>
#include <queue>
#include <climits>
#include <set>
#include <stack>

using namespace std;

#define ll long long
#define MAX 100000
#define MAX1 10000
#define MAX2 100000
#define inf 1000000000
#define eps 1e-12
#define MOD 1000000007

vector<ll> a[2];
int m[2];

ll mul(ll x, ll y) {
    x %= MOD;
    y %= MOD;
    if (y < 0) {
        y += MOD;
    }
    if (x < 0) {
        x += MOD;
    }
    ll z = x * y;
    if (z >= MOD) {
        z %= MOD;
    }
    return z;
}

ll ok(int &i, int &j) {
    ll b1, b2;
    if (i > 0 and j + 1 < m[1]) {
        b1 = a[0][i] * a[0][i - 1];
        b2 = a[1][j] * a[1][j + 1];
        if (b1 > b2) {
            i -= 2;
            return b1;
        } else {
            j += 2;
            return b2;
        }
    } else if (i > 0) {
        b1 = a[0][i] * a[0][i - 1];
        i -= 2;
        return b1;
    } else if (j + 1 < m[1]) {
        b2 = a[1][j] * a[1][j + 1];
        j += 2;
        return b2;
    } else {
        b1 = a[0][i] * a[1][j];
        i--, j++;
        return b1;
    }
}

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif

    int n, k, i, x, j;
    ll ans = 1;
    cin >> n >> k;
    for (i = 0; i < n; ++i) {
        cin >> x;
        a[x < 0].push_back(x);
        m[x < 0]++;
    }
    sort(a[0].begin(), a[0].end());
    sort(a[1].begin(), a[1].end());
    if (k & 1) {
        if (a[0].empty()) {
            for (i = m[1] - 1; i >= m[1] - k; --i) {
                ans = mul(ans, a[1][i]);
            }
            k = 0;
        } else {
            ans = a[0].back();
            a[0].pop_back();
            k--;
            m[0]--;
        }
    }
    // k is even
    i = m[0] - 1, j = 0;
    while (k > 0) {
        ans = mul(ans, ok(i, j));
        k -= 2;
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 4988
#include <cstdio>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cmath>
#include <iomanip>
#include <deque>
#include <queue>
#include <unordered_map>
#include <stack>
#include <bitset>
#include <cstdlib>
#include <sstream>
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;
ll pow(ll N, ll P){
    if(P==0) return 1;
    if(P%2==0){
        ll t = pow(N, P/2);
        return t*t;
    }
    return N * pow(N, P-1);
}
ll modpow(ll N, ll P,ll k){
    if(P==0) return 1;
    if(P%2==0){
        ll t = modpow(N, P/2,k)%k;
        return t*t%k;
    }
    return N * modpow(N, P-1,k)%k;
}
ll modkai(ll n,ll m,ll k){//n*(n-1)*(n-2)*...(m+1)%k
    if(n == m)return 1;
    return modkai(n-1,m,k)*n%k;
}
ll mod_cnb(ll n,ll m,ll k){//nCm%k,kは十分大きい素数
  int m_=modkai(m,0,k);
  return modkai(n,n-m,k)*modpow(m_,k-2,k)%k;
}
ll gcd(ll n,ll m){
    ll n_ = max(n,m);
    ll m_ = min(n,m);
    if(n_%m_ == 0)return m_;
    return gcd(m_,n_%m_);
}
ll lcm(ll n,ll m){
    return n*m/gcd(n,m);
}

int main() {
    int n,m,x,y;cin>>n>>m>>x>>y;
    int mx,my;
    mx=x;
    my=y;
    rep(i,n){int p;cin>>p;mx=max(mx,p);}
    rep(i,m){int p;cin>>p;my=min(my,p);}
    if(mx<my)cout<<"No War"<<endl;
    else cout<<"War"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
	vector<char> x(3);
	rep(i, 3) {
		cin >> x[i];
	}
	int normal = 700;
	if (x[0] == 'o') {
		normal += 100;
	}
	if (x[1] == 'o') {
		normal += 100;
	}
	if (x[2] == 'o') {
		normal += 100;
	}
	cout << normal << endl;
}

Measured memory_bytes: 3624
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		try (Scanner sc = new Scanner(System.in)) {
			final int N = sc.nextInt();
			final int Y = sc.nextInt();
			
			for(int x = 0; x <= N; x++){
				for(int y = 0; x + y <= N; y++){
					final int z = N - (x + y);
					
					if(x * 10000 + y * 5000 + z * 1000 == Y){
						System.out.println(x + " " + y + " " + z);
						return;
					}
					
				}
			}
			
			System.out.println("-1 -1 -1");
			
		}
	}
 
	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;
 
		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}
 
		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}
 
		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}
 
		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = this.nextInt();
			}
			return ret;
		}
 
		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = this.nextLong();
			}
			return ret;
		}
 
		public void close() throws IOException {
			br.close();
		}
	}
}

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

int main() {
 int W, a, b;
 cin >> W >> a >> b;
 int a2 = a+W;
 int b2 = b+W;
 
 if (((a <= b)&&(a2 >= b))||((a <= b2)&&(a2 >= b2))) 
  cout << "0" << endl;
 else if(a < b) 
   cout << b-a2 << endl;
 else 
   cout << a-b2 <<endl;  
}

Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d", $d);
fscanf(STDIN, "%s", $str);

$m = str_split($str);
$p = array_count_values($m)['E']??0;
$s = $p;

foreach ($m as $i) {
    if ($i === "E") {
        $p -= 1;
    }else{
        $p += 1;
    }
    $s = min($s, $p);
}
echo $s;

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

int main() {
  int N, M;
  cin >> N>> M;
  int sum, count = 0;
  vector<int> A(N);
  for(int i = 0; i < N; i++) {
    cin >> A.at(i);
  } 
  for(int i = 0; i < N ; i++) {
    sum += A.at(i);
  }
  for(int i = 0; i < N ; i++) {
    if(A.at(i)*4*M >= sum) {
      count++;
    }
  }
  if(count>=M) {
    cout << "Yes";
  }
  else {
    cout << "No";
  }
}



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

int main(){
    int n = 0;
    cin >> n;
    char s[n];
    int result = 0;
    for(int i=0;i<n;i++){
        cin >> s[i];
        if(s[i]=='Y'){
            cout << "Four" << endl;
            return 0;
        }
    }
    cout << "Three" << endl;
    return 0;
}

Measured memory_bytes: 256
# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read

n,*a = [int(i) for i in read().split()]

from itertools import accumulate
if n%2==0:
    a1 = list(accumulate([0]+a[::2]))
    a2 = list(accumulate([0]+a[n-1::-2]))[::-1]
    #print(a1,a2)
    print(max(x+y for x,y in zip(a1,a2)))
#elif n==3: print(max(a))
else:
    dp0 = [0]*(n+9)
    dp1 = [0]*(n+9)
    dp2 = [0]*(n+9)
    for i in range(n):
        if i%2==0:
            dp0[i] = dp0[i-2]+a[i]
            if i >= 2:
                dp2[i] = max(dp2[i-2],dp1[i-3],dp0[i-4]) + a[i]
        else:
            dp1[i] = max(dp1[i-2],dp0[i-3]) + a[i]
    #print(dp0)
    #print(dp1)
    #print(dp2)
    print(max(dp2[n-1],dp1[n-2],dp0[n-3]))





Measured memory_bytes: 36428
x1, y1, x2, y2 = map(int, input().split())

dx, dy = x2 - x1, y2 - y1
x3 = x2 - dy
y3 = y2 + dx
x4 = x1 - dy
y4 = y1 + dx

print(x3, y3, x4, y4)


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

int main() {
    int l , r;
    cin >> l >> r;
    if (r - l >= 2019) {
        cout << 0 << endl;
        return 0;
    }
    int ans = 2019;
    bool flag = false;
    for (int i = l; i < r; ++i) {
        for (int j = i + 1; j < r + 1; ++j) {
            int a = i % 2019;
            int b = j % 2019;
            ans = min(ans, a * b % 2019);
            if (ans == 0) {
                flag = true;
                break;
            }
        }
        if (flag) break;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b;
string s,t,u;
int main()
{
    cin>>s>>t;
    cin>>a>>b;
    cin>>u;
    if(u==s)
    {
        cout<<a-1<<' '<<b<<endl;
    }
    else
    {
        cout<<a<<' '<<b-1<<endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
#define MOD 1000000007


lli dp[3010][3010];
 
signed main(){

	string s,t;
	cin>>s>>t;

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

	for(lli i=1;i<=s.size();i++){
		for(lli j=1;j<=t.size();j++){
			if(s[i-1]==t[j-1]){
				dp[i][j] = dp[i-1][j-1]+1;
			}
			else{
				dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
			}
		}
	}

	string ans="";
	lli x = s.size();
	lli y = t.size();
	while(x>0 && y>0){
		if(dp[x][y] == dp[x-1][y])x--;
		else if(dp[x][y] == dp[x][y-1])y--;
		else{
			x--;
			y--;
			ans.push_back(s[x]);
		}
	}

	reverse(ans.begin(),ans.end());
	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 71040
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) b.rbegin(),v.rend()
typedef long long ll;
//isPrime
//modpow modinv
int main() {
  cout << fixed << setprecision(10);
  int a,b,c;
  cin >> a >> b >> c;
  cout << max(c-a+b,0) << endl;
}


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

typedef long long ll;

struct UF {
  vector<size_t> p;
  vector<size_t> c;
  UF(size_t n) : p(n), c(n) {
    for (size_t i = 0; i < n; ++i) {
      p[i] = i;
      c[i] = 1;
    }
  };
  size_t f(size_t x) {
    while (x != p[x]) {
      tie(x, p[x]) = make_tuple(p[x], p[p[x]]);
    }
    return x;
  }
  void u(size_t x, size_t y) {
    x = f(x);
    y = f(y);
    if (x == y) {
      return;
    }
    if (c[x] < c[y]) {
      swap(x,y);
    }
    p[y] = x;
    c[x] = c[x] + c[y];
  }
};

void solve(long long N, long long M, std::vector<long long> A, std::vector<long long> B){
  auto uf = UF(N);
  for (ll i = 0; i < M; ++i) {
    uf.u(A[i]-1, B[i]-1);
  }
  auto rv = *max_element(uf.c.begin(), uf.c.end());
  cout << rv << endl;
}

int main() {
  long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
  std::vector<long long> A(M);
  std::vector<long long> B(M);
  for(int i = 0 ; i < M ; i++){
    scanf("%lld",&A[i]);
    scanf("%lld",&B[i]);
  }
  solve(N, M, std::move(A), std::move(B));
  return 0;
}


Measured memory_bytes: 9576
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

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

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

	if(n==m)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;

	return 0;
}

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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>
#define Graph vector<vector<int>>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

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

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main() {
    long long N;
    scanf("%lld", &N);
    long long K;
    scanf("%lld", &K);

    ll rem = N % K;

    if (rem < K - rem) {
        cout << rem << endl;
    }

    else {
        cout << K-rem << endl;
    }

    return 0;
}


Measured memory_bytes: 256
s=list(input())
n=len(s)
if n == 1:
    print(int(s[0]))
else:    
    n2 = 2**(n-1)
    #print(n2)
    n3 = (n-1)*-1
    # if n2 = 1
    ans=0
    for i in range(n2):
        li = list(format(i,'010b'))
        li = li[n3:]
        #    print(li)
        tmpstr=s[0]
        tmpnum=0
        index = 0
        for j in li:
            #        print("ans",ans,"tmpstr",tmpstr,"tmpnum",tmpnum,"index",index)
            if j == '0':
                # string
                tmpstr=tmpstr+s[index+1]
            else:
                # plus
                if tmpstr =="":
                    tmpnum=0
                else:
                    tmpnum=int(tmpstr)
                    tmpstr=s[index+1]
                    ans=ans+tmpnum
            index += 1
        if tmpstr != "":
            #        print("ans",ans,"tmpstr",tmpstr)
            tmpnum=int(tmpstr)
            ans=ans+tmpnum
    print(ans)


Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<=n;++i)
int main(){
  int x;cin>>x;
  int ans=0;
  int num=x/100;
  if(x%100<=num*5)ans=1;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#define _GLIBCXX_DEBUG
using namespace std;

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string_view>

/*-----------------macros-----------------*/

//input, output=============================
#define fastio                              \
std::ios::sync_with_stdio(false);           \
std::cin.tie(nullptr);                      \
std::cout.tie(nullptr)

#define endl '\n'
#define fcout(a)                            \
cout << fixed << setprecision((int)(a))

//typedef===================================
typedef long long       ll;
typedef long double     ld;
typedef vector<int>     Vi;
typedef vector<ll>      Vl;
typedef pair<int, int>  Pii;
typedef pair<ll, ll>    Pll;

//const number==============================
constexpr ll INF    = (ll)1e9 + 1;
constexpr ll INFll  = (ll)1e18 + 1;
constexpr ll MOD1   = 1000000007;
constexpr ll MOD2   = 998244353;
constexpr ld PI     = 3.141592653589793L;

//member====================================
#define psb push_back
#define epb emplace_back
#define psf push_front
#define mkp make_pair
#define fst first
#define snd second

//others====================================
#define sz(x)                               \
(int) x.size()

#define all(x)                              \
(x).begin(), (x).end()

#define rall(x)                             \
(x).rbegin(), (x).rend()

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

#define reps(i, n)                          \
for(int i = 1; (i) <= (n); ++(i))

#define rrep(i, n)                          \
for(int i = n - 1; (i) >= 0 ; --(i))

#define repbit(bit, n)                      \
for(int bit = 0; (bit) < (1 << (n)); ++(bit))

#define ifbit(bit, i)                       \
if((bit) & (1 << (i)))

#define CtoI(c)                             \
int((c)) - int('0')

#define ItoC(c)                             \
char((c) + '0')

//functions=================================
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b)
{ return a < b && (a = b, true); }

template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b)
{ return a > b && (a = b, true); }

// Vi  dx = {1, 0, -1, 0},
//     dy = {0, 1, 0, -1};

// Vi  dx2 = { 1,1,0,-1,-1,-1,0,1 },
//     dy2 = { 0,1,1,1,0,-1,-1,-1 };

/*---------------additional---------------*/



/*-----------------main-------------------*/

int main() {
fastio;
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a*b);

return 0;
}

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

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

using namespace std;

int main() {
  int N;
  int arr[100001] = {0};
  int tmp[100001] = {0};
  cin >> N;
  rep(i, N) {
    int a;
    cin >> a;
    arr[i] = a;
  }
  int cnt = 1;
  tmp[0] = 1;
  int next = arr[0] - 1;
  while (true) {
    if (next + 1 == 2) {
      cout << cnt << endl;
      break;
    }
    if (tmp[next] == 1) {
      cout << -1 << endl;
      break;
    }
    cnt++;
    tmp[next] = 1;
    next = arr[next] - 1;
  }

  return 0;
}


Measured memory_bytes: 1024
using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		var A = Console.ReadLine().Split().Select(z => int.Parse(z)).ToArray();
		int[] x = new int[N];
		x[0] = 0;
		for (var i = 0; i < N; i++)
		{
			if (i % 2 == 0) { x[0] += A[i]; }
			else { x[0] -= A[i]; }
		}
        for(var i = 1; i < N; i++)
		{
			x[i] = 2 * A[i - 1] - x[i - 1];
		}
        for(var i = 0;i<N;i++)
		{
			Console.Write(x[i] + " ");
		}
	}
}

//var input = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
//入力用

public class Calculation //各種値の計算メソッド
{
	public int GetGcd(int a, int b) //最大公約数(２数)
	{
		if (a * b == 0)
		{
			return 0;
		}
		if (a < b)
		{
			int c = a;
			a = b;
			b = c;
		}

		int r = a % b;
		while (r > 0)
		{
			a = b;
			b = r;
			r = a % b;
		}
		return b;
	}
	public int GetGcdOfSortedArray(int[] array) //最大公約数(ソート済み数列)
	{
		if (array.Length == 0) { return 1; }
		else if (array.Length == 1) { return array[0]; }
		else
		{
			int n = 0;
			int g = -1;
			while (n <= array.Length - 2)
			{

				int a = array[n + 1];
				int b = array[n];
				int r = a % b;
				while (r > 0)
				{
					a = b;
					b = r;
					r = a % b;
				}
				g = b;
				array[n + 1] = g;
				n++;
			}

			return g;

		}
	}
	public long GetGcdOfSortedArrayL(long[] array) //最大公約数(ソート済み配列[long型])
	{
		if (array.Length == 0) { return 1; }
		else if (array.Length == 1) { return array[0]; }
		else
		{
			int n = 0;
			long g = -1;
			while (n <= array.Length - 2)
			{

				long a = array[n + 1];
				long b = array[n];
				long r = a % b;
				while (r > 0)
				{
					a = b;
					b = r;
					r = a % b;
				}
				g = b;
				array[n + 1] = g;
				n++;
			}

			return g;

		}
	}

	public long GetNCR(int n, int r) //二項係数(生の値)
	{
		if (n == 1) { return 1; }
		long[] nC = new long[n + 1];
		nC[0] = 1;
		for (var i = 0; i <= r - 1; i++)
		{
			nC[i + 1] = nC[i] * (n - i) / (i + 1);
		}
		return nC[r];
	}


}

class Modulo //1000000007で割る問題用
{
	private const int M = 1000000007;
	private readonly int[] m_facs;
	public int Mul(int a, int b) //掛け算
	{
		return (int)(Math.BigMul(a, b) % M);
	}
	public Modulo(int n)
	{
		m_facs = new int[n + 1];
		m_facs[0] = 1;
		for (int i = 1; i <= n; ++i)
		{
			m_facs[i] = Mul(m_facs[i - 1], i);
		}
	}
	public int Fac(int n)
	{
		return m_facs[n];
	}
	public int Pow(int a, int m) //累乗
	{
		switch (m)
		{
			case 0:
				return 1;
			case 1:
				return a;
			default:
				int p1 = Pow(a, m / 2);
				int p2 = Mul(p1, p1);
				return ((m % 2) == 0) ? p2 : Mul(p2, a);
		}
	}
	public int Div(int a, int b) //除算
	{
		return Mul(a, Pow(b, M - 2));
	}
	public int Ncr(int n, int r) //二項係数
	{
		if (n < r) { return 0; }
		if (n == r) { return 1; }
		int res = Fac(n);
		res = Div(res, Fac(r));
		res = Div(res, Fac(n - r));
		return res;
	}
	public Modulo() { }
}





Measured memory_bytes: 31704
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define CONO cout<<"NO"<<endl;
#define CONo cout<<"No"<<endl;
#define COno cout<<"no"<<endl;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
using namespace std;


int main(){
  string S;
  cin>>S;
  
  int N=S.size(),ans=0;
  
  if(N%2==0){
    for(int i=0; i<N/2; ++i){
      if(S.at(i)!=S.at(N-1-i)) ans++;
    }
  }
  
  else{
    for(int i=0; i<N/2; ++i){
      if(S.at(i)!=S.at(N-1-i)) ans++;
    }
  }
  
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<vector>

using namespace std;

typedef long long ll;

const int MAX = 100;
int n;
string name;

int main(){

  while(cin >> n && n){
    map<string,ll> M;
    for(int i = 0; i < n; i++){
      int price;
      cin >> name >> price;
      M[name] = price;
    }
    int rev;
    cin >> rev;
    for(int i = 0; i < rev; i++){
      int num;
      cin >> name >> num;
      ll sum = 0;
      for(int j = 0; j < num; j++){
	string str;
	cin >> str;
	sum += M[str];
      }
      M[name] = min(M[name],sum);
    }
    cin >> name;
    cout << M[name] << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<stdio.h>
int main(){
  int x, y, i;

  scanf("%d %d",&x,&y);

  while(1){
    if(x >= y) i = x % y;
    else i = y % x;

    if(i == 0) break;
    else{
      x = y;
      y = i;
    }
  }

  printf("%d\n",y);

  return 0;
}

Measured memory_bytes: 592
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char** argv){
    string S, T;
    cin >> S >> T;
    int ans = 0;
    for (int i=0; i<3; i++) if (S[i] == T[i]) ans++;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <utility>
#include <numeric>

using namespace std;

const int INF = 2E9;
const uint64_t MOD = 1E9 + 7;

int partition(vector<int> &a)
{
	int x = a.back();
	int id = -1;

	for (int i = 0; i < a.size() - 1; i++)
	{
		if (a.at(i) <= x)
		{
			id++;
			swap(a.at(i), a.at(id));
		}
	}
	swap(a.at(id + 1), a.back());

	return id + 1;
}

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

	vector<int> a(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a.at(i);
	}

	int p = partition(a);

	for (int i = 0; i < n; i++)
	{
		cout << (i == 0 ? "" : " ");
		if (i == p)
		{
			cout << "[" << a.at(i) << "]";
		}
		else
		{
			cout << a.at(i);
		}
	}

	cout << endl;
}


Measured memory_bytes: 3108
package main

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

func main() {
	R := ReadInt()
	if R < 1200 {
		fmt.Println("ABC")
		return
	}
	if R < 2800 {
		fmt.Println("ARC")
		return
	}
	fmt.Println("AGC")
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 1840
#include"bits/stdc++.h"
using namespace std;
namespace ORIGIN {
#define LL long long
#define VLL vector<long long>
#define SORT(x) sort(x.begin(),x.end())
#define REVE(x) reverse(x.begin(),x.end())
#define rep(i,n) for(int i=0;i<n;i++)
#define COUT(x) cout<<x<<endl
#define WHOLE(x) x.begin(),x.end()
	double pai = 3.1415926535;
	string atc = "atcoder";
	typedef pair<long long, long long> data_t;
	string strnum = "0123456789";
	string alpS = "abcdefghijklmnopqrstuvwxyz";
	string alpL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	int sizealp = (int)(alpS.size());
	int mod = 1e9 + 7;
	bool test = false;
}
using namespace ORIGIN;

void Test(char a) {
	if (test) {
		printf("%c", a);
	}
}
int gcd(LL a, LL b) {
	if (a == 0 || b == 0)return 0;
	if (a < b)swap(a, b);
	if (a % b == 0)return b;
	else gcd(b, a % b);
}
vector<int> nsinsuu(int base,int keta) {

}

int main() {
	int a, b;
	cin >> a >> b;
	if (a <= 5) {
		COUT(0);
	}
	else if (a <= 12) {
		COUT(b / 2);
	}
	else
		COUT(b);
}

Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,i,j;
    cin >> a >> b;
    for(i=b-a+1; i<b; i++)cout << i << " ";
    for(i=b; i<=b+a-1; i++)
    {
        if(i==b+a-1)cout << i << endl;
        else cout << i << " ";
    }

    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1145141919810364364LL;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

ll N, M, P;
ll dist[3000];
vector<vector<ll>>Eli;
vector<ll>E[3000];
int vis[3000];
void dfs(int now){
	fore(x, E[now]) {
		if (vis[x])continue;
		vis[x] = 1;
		dfs(x);
	}
}

ll Bellman_Ford(){
	//init
	for (int i = 0; i < N; i++)dist[i] = inf;
	dist[0] = 0;
	for (int i = 0; i < N - 1; i++) {
		for (int j = 0; j < M; j++) {
			ll u = Eli[j][0];
			ll v = Eli[j][1];
			ll c = Eli[j][2];
			if (!vis[u] || !vis[v])continue;
			if (dist[u] == inf)continue;
			if (dist[v] > dist[u] + c)dist[v] = dist[u] + c;
		}
	}

	
	//check
	for (int j = 0; j < M; j++) {
		ll u = Eli[j][0];
		ll v = Eli[j][1];
		ll c = Eli[j][2];
		if (!vis[u] || !vis[v])continue;
		if (dist[u] == inf)continue;
		if (dist[v] > dist[u] + c)return inf;
	}
	return max(0LL,-dist[N - 1]);
}

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

	cin >> N >> M >> P;
	for (int i = 0; i < M; i++) {
		ll A, B, C;
		cin >> A >> B >> C;
		A--, B--;
		Eli.pb({A,B,-(C-P)});
		E[B].pb(A);
	}
	vis[N - 1] = 1;
	dfs(N - 1);


	ll ans = Bellman_Ford();
	if (ans == inf)puts(-1);
	else puts(ans);

	return 0;
}

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

int dp[1<<16];
int data[16][17];

int main(){
	while(true){
		int n;
		cin >> n;
		if(n==0){
			break;
		}

		for(int i=0;i<n;i++){
			for(int j=0;j<n+1;j++){
				cin >> data[i][j];
			}
		}
		
		
		fill(dp,dp+(1<<n),INT_MAX);

		dp[0] = 0;
		for(int i=0;i<(1<<n);i++){
			if(dp[i] != INT_MAX){
				for(int j=0;j<n;j++){
					int use = data[j][0];
					for(int k=0;k<n;k++){
						if(i&(1<<k)){
							use = min(use,data[j][k+1]);
						}
					}
					dp[i|(1<<j)] = min(dp[i|(1<<j)],dp[i]+use);
				}
			}
		}

		cout << dp[(1<<n)-1] << endl;
	}
}

Measured memory_bytes: 1416
#include<stdio.h>
int main()
{
    int i,j,num[101],n;
    while(scanf("%d",&n)!=EOF)
    {
        int s=0;
        for(i=1;i<=n;i++)
            scanf("%d",&num[i]);
        for(i=1;i<=n;i++)
        {
            int min=i;
            for(j=i;j<=n;j++)
            {
                if(num[j]<num[min])
                    min=j;
            }
            if(i!=min)
            {
                int t=num[i];
                num[i]=num[min];
                num[min]=t;
                s++;
            }
        }
        for(i=1;i<n;i++)
            printf("%d ",num[i]);
        printf("%d\n",num[n]);
        printf("%d\n",s);
    }
}



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

typedef long long ll;
typedef double lf;
typedef long double Lf;
typedef pair <int,int> pii;
typedef pair <ll, ll> pll;

#define TRACE(x) cerr << #x << "  " << x << endl
#define FOR(i, a, b) for (int i = (a); i < int(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define _ << " " <<

#define fi first
#define sec second
#define mp make_pair
#define pb push_back


namespace Dinic {
  const int MAXV = 300;
  const int MAXE = MAXV*MAXV;
  const int oo = 1e8;

  int V, E;
  int last[MAXV], dist[MAXV], curr[MAXV];
  int next[MAXE], adj[MAXE]; int cap[MAXE];

  void init(int n) {
    V = n;
    E = 0;
    REP(i, V) last[i] = -1;
  }

  void edge(int x, int y, int c1, int c2) {
    adj[E] = y; cap[E] = c1; next[E] = last[x]; last[x] = E++;
    adj[E] = x; cap[E] = c2; next[E] = last[y]; last[y] = E++;
  }

  int push(int x, int sink, int flow) {
    if (x == sink) return flow;

    for (int &e = curr[x]; e != -1; e = next[e]) {
      int y = adj[e];

      if (cap[e] && dist[x] + 1 == dist[y])
        if (int f = push(y, sink, min(flow, cap[e])))
          return cap[e] -= f, cap[e^1] += f, f;
    }
    return 0;
  }

  int run(int src, int sink) {
    int ret = 0;
    for (;;) {
      REP(i, V) curr[i] = last[i];
      REP(i, V) dist[i] = -1;

      queue<int> Q;
      Q.push(src), dist[src] = 0;

      while (!Q.empty()) {
        int x = Q.front(); Q.pop();

        for (int e = last[x]; e != -1; e = next[e]) {
          int y = adj[e];
          if (cap[e] && dist[y] == -1) Q.push(y), dist[y] = dist[x] + 1;
        }
      }
      if (dist[sink] == -1) break;

      while (int f = push(src, sink, oo)) ret += f;
    }
    return ret;
  }
}

const int MAXN = 105;

int n, m;
char s[MAXN][MAXN];

int main() {
  scanf("%d %d",&n,&m);
  REP(i, n) scanf("%s",s[i]);

  pii S, T;
  REP(i, n) {
    REP(j, m) {
      if (s[i][j] == 'S') S = {i, j};
      if (s[i][j] == 'T') T = {i, j};
    }
  }

  if (S.fi == T.fi || S.sec == T.sec) {
    puts("-1");
    return 0;
  }

  Dinic::init(n + m + 2);
  REP(i, n) {
    REP(j, m) {
      if (s[i][j] == 'o') {
        Dinic::edge(i, j + n, 1, 1);
      }
    }
  }
  Dinic::edge(n + m, S.fi, 10000, 10000);
  Dinic::edge(n + m, S.sec + n, 10000, 10000);
  Dinic::edge(T.fi, n + m + 1, 10000, 10000);
  Dinic::edge(T.sec + n, n + m + 1, 10000, 10000);
  printf("%d\n",Dinic::run(n + m, n + m + 1));
  return 0;
}



Measured memory_bytes: 512
// 木の直径を求める
//　今度証明しよう

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;

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

struct edge{ll to,cost;};
ll n;
vector<edge> G[100000];
bool used[100000];

P dfs(ll v) {
    used[v] = true;
    P ret = P(0,v);

    for(auto e : G[v]) {
        if(used[e.to])continue;
        P p = dfs(e.to);
        ret = max(ret,P(p.first + e.cost,p.second));
    }

    return ret;
}

int main() {
    cin >> n;
    rep(i,n-1) {
        ll s,t,w;
        cin >> s >> t >> w;
        G[s].push_back((edge){t,w});
        G[t].push_back((edge){s,w});
    }

    P p = dfs(0);
    fill(used,used+n,0);
    cout << dfs(p.second).first << endl;
    return 0;
}


Measured memory_bytes: 14864
#include <iostream>
#include <cmath>
using namespace std;
int main(){
    int n;
    char prime[1000000] = {1, 1};
    for(int k = 2; k < 1000; k++){
        if(prime[k] == 0){
            for(int j = k * k; j < 1000000; j += k)
                prime[j] = 1;
        }
    }
    while(cin >> n){
        int res = 0;
        for(int j = 2; j <= n;j++) 
			if(prime[j] == 0) 
				res++;
        cout << res << endl;
    }
}

Measured memory_bytes: 4056
#include <iostream>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    int tbl[4][13] = {0};
    char suit;
    int rank;
    for (int i=0; i<n; ++i) {
        cin >> suit >> rank;
        if (suit == 'S') {
            tbl[0][rank-1] = 1;
        } else if (suit == 'H') {
            tbl[1][rank-1] = 1;
        } else if (suit == 'C') {
            tbl[2][rank-1] = 1;
        } else if (suit == 'D') {
            tbl[3][rank-1] = 1;
        }
    }

    char suits[] = {'S', 'H', 'C', 'D'};
    for (int i=0; i<4; ++i) {
        for (int j=0; j<13; ++j) {
            if ( ! tbl[i][j]) {
                cout << suits[i] << " " << j+1 << "\n";
            }
        }
    }

    return 0;
}

Measured memory_bytes: 1196
#include <stdio.h>

int main(void){
	int n, i, max, m_c, yen = 0;
	int p[10];

	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%d", &p[i]);
	}

	max = p[0];
	m_c = 0;
	for(i=1; i<n; i++){
		if(max < p[i]){
			max = p[i];
			m_c = i;
		}
	}
	for(i=0; i<n; i++){
		if(m_c == i)
			yen += p[i] / 2;
		else
			yen += p[i];
	}
	printf("%d\n", yen);
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, a, b) for(int i = (a); i <= (b); i++)
#define PER(i, a, b) for(int i = (a); i >= (b); i--)
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define all(S) (S).begin(), (S).end()
#define pb push_back
#define mk make_pair
#define S second
#define F first
typedef long long ll;
typedef long double lf;
typedef pair<int, int> ii;
const int MAX = 1e5+5;

int main(int argc, char ** argv) {
	int N, K, X, Y;
	scanf("%d%d", &N, &K);
	scanf("%d%d", &X, &Y);
	printf("%d\n", min(N, K)*X+max(0, N-K)*Y);
	return 0;
}


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

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for (int i=(a); i<(b); ++i)
#define FORD(i,a,b) for (int i=(a)-1; i>=(b); --i)
#define FOREACH(i,x) for (__typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)

#define pb push_back
#define mp make_pair
#define st first
#define nd second

const int MOD = 1000000007;

int main() {
  // ios_base::sync_with_stdio(0);

  int N, M, K;
  scanf("%d%d%d", &N, &M, &K);
  REP(i,N+1)REP(j,M+1) {
    if ((N-i)*j + (M-j)*i == K) {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>
#include <unordered_set>
#include <unordered_map>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

#define rep(i, n) for(int i = 0;i < n;i++)
const int INF = 1LL << 30;
const int MOD = 1000000007;

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

    int n; string s,t; cin >> n >> s >> t;

    string ans = "";

    rep(i,n){
        ans+=s[i];
        ans+=t[i];
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)


typedef long long int ll;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
typedef vector<P> VP;


const int INF = (1<<30) - 1;
const D EPS = 1e-9;

#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

int N, T, L, B;
vector<vector<double> > memo;
vector<bool> lose;
vector<bool> back;


double dfs(int p, int turn){
    //??°???p??????turn?????\?????§??´??????????????????????¢?????????????
    if(p == N)
        return 1;
    if(turn <= 0) //==???????????¨lose??§?????°?????????
        return 0;
    
    if(memo[p][turn] != -1) return memo[p][turn];
    
    double ret = 0;
    for(int i=1; i<=6; i++){
        int np = p+i < N? p+i: 2*N-p-i;
        int nturn = turn-1;
        
        if(back[np])
            np = 0;
        if(lose[np])
            nturn--;
        ret += dfs(np, nturn);
    }
    
    return memo[p][turn] = ret/6.0;
}

void solve(){
    memo = vector<vector<double> >(N, vector<double>(T+1, -1));
    lose = vector<bool>(N, false);
    back = vector<bool>(N, false);
    
    for(int i=0; i<L; i++){
        int l; cin >> l;
        lose[l] = true;
    }
    for(int i=0; i<B; i++){
        int b; cin >> b;
        back[b] = true;
    }
    printf("%.6f\n", dfs(0, T));
}

//g++ -std=c++0x -msse4.2 -O3
//#include <bits/stdc++.h>
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    //cout.precision(16);
    
    while(cin >> N >> T >> L >> B, N|T|L|B){
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 1424
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007

signed main() {
    string s, t;
    cin>>s>>t;
    int n = s.size();
    int ans = 0;
    for(int i=0;i<n;i++){
        if(s[i]!=t[i])ans++;        
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3912
#include <stdio.h>

int main() {
    while (1) {
        int n;
        scanf("%d", &n);
        if (n == 0) {
            break;
        }

        int a, b;
        a = 0;
        b = 0;
        while (n--) {
            int _a, _b;
            scanf("%d%d", &_a, &_b);
            if (_a > _b) {
                a += _a + _b;
            } else if (_a < _b) {
                b += _b + _a;
            } else {
                a += _a;
                b += _b;
            }
        }
        printf("%d %d\n", a, b);
    }
}


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

int main() {
  // ここにプログラムを追記
  int a;
  int b;
  int c;
  int flag;
  int i;
  int p;
  cin>>a>>b;
  c=a+b+2;
  int d;
  d=c-1;
  string str;
  for(i=0;i<c;i++){
  cin>>str[i];
  }
  for(p=0;p<c;p++){
    if(p==a){
      if(str[p]=='-'){flag=flag+1;}
    }else{
      if((str[p]=='0')||(str[p]=='1')||(str[p]=='2')||(str[p]=='3')||(str[p]=='4')||(str[p]=='5')||(str[p]=='6')||(str[p]=='7')||(str[p]=='8')||(str[p]=='9')){
      flag=flag+1;
      }
    }
  }
  if(flag==d){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
}

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

int main(){
  int N,M,X;
  cin >> N >> M >> X;
  int counter = 0;
  for(int i = 0;i < M;i++){
    int A;
    cin >> A;
    
    if(X < A){
      counter++;
    }
  }
 
  if(M / 2 < counter){
    cout << M - counter << endl;
  }
  if(M / 2 >= counter){
    cout << counter << endl;
  }
}
    
      

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

int main() {
    string s; cin >> s;
    vector<int> alphabet(26, 0);
    for (int i = 0; i < (int)s.size(); i++) {
        alphabet.at(s[i] - 'a')++;
    }
    for (int i = 0; i < 26; i++) {
        if (alphabet[i] == 0) {
            cout << (char)('a' + i) << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
//const int N = ; 
int k;
int main() {
	cin >> k;
	if (k % 2 == 0 || k % 5 == 0) puts("-1");
	else {
		int x = 7, ans = 1;
		x %= k;
		while (x != 0) {
			x = (x * 10 + 7) % k;
			ans++;
		}
		cout << ans;
	} 
	return 0;
}

Measured memory_bytes: 3632
import java.util.Scanner;


public class Main {
    
    public static void main(String[] args) {
        
        int a,b,c,d;
        
        Scanner input = new Scanner(System.in);
        
        a = input.nextInt();
        b = input.nextInt();
        c = input.nextInt();
        d = input.nextInt();
        
        int area1 = a * b;
        int area2 = c * d;
        
        if(area1 > area2){
            
            System.out.println(area1);
        }else{
            System.out.println(area2);
        }
    }
}


Measured memory_bytes: 21716
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<cmath>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;


int main() {
    string a, b; cin >> a >> b;
    int c = stoi(a + b);
    rrep(i, 2, c) if (i * i == c) {cout << "Yes" << endl; return 0;}
    cout << "No" << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

using namespace std;

int main() {
    int a, b, c, d, e, f;
    scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f);

    int ms = f / 100 / a * 100 * a, sms = 0;
    double ds = 0.0;

    for (int i = 0; i <= f / 100 / a; ++i) {
        int _rem = f - 100 * a * i;
        for (int j = 0; j <= _rem / 100 / b; ++j) {
            int rem = _rem - 100 * b * j;
            int water = f - rem, sugar_max = min((i * a + j * b) * e, rem);
            if (water == 0) continue;
            int sugar = 0;
            for (int x = 0; x <= sugar_max / c; ++ x) {
                int y = (sugar_max - c * x) / d;
                sugar = max(sugar, x * c + d * y);
            }
            double t = double(sugar) / (sugar + water);
            if (t > ds) {
                ms = water + sugar;
                sms = sugar;
                ds = t;
            }
        }
    }

    printf("%d %d\n", ms, sms);
    return 0;
}


Measured memory_bytes: 128
#include <math.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <queue>
#include <sstream>
#include <vector>

using namespace std;
using Graph = vector<vector<int>>;

using ll = long long;
typedef pair<int, int> P;

const int INF = 1e8;

int main() {
  ll N;
  cin >> N;
  vector<ll> f(N + 1, 1);
  ll ans = 0;
  for (ll i = 1; i <= N; i++) {
    ans += i * f[i];
    for (ll j = 2; j <= (ll)(N / i); j++) {
      f[i * j]++;
    }
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 81328
#include <stdio.h>

int main(void)
{
    char a, b;

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

    if (a == 'H'){
        if (b == 'H')
        printf("H");
        else if (b == 'D')
        printf("D");
    }
    else if (a == 'D'){
        if (b == 'H')
        printf("D");
        else if (b == 'D')
        printf("H");
    }

    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
long long a, b, c;
int main() {
	cin >> a >> b >> c;
	for (int i = 0; i < 100000; i++) {
		if (a % 2 == 1 || b % 2 == 1 || c % 2 == 1) {
			cout << i << endl;
			return 0;
		}
		else {
			if (i == 99999) {
				cout << -1 << endl;
				return 0;
			}
			else {
				long long d, e, f;
				d = (b + c) / 2; e = (a + c) / 2; f = (a + b) / 2;
				a = d; b = e; c = f;
			}
		}
	}
}

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

int main() {
    int n;
    cin>>n;
    int f[n][10];
    rep(i,n){
        rep(j,10){
            cin>>f[i][j];
        }
    }
    int p[n][11];
    rep(i,n){
        rep(j,11){
            cin>>p[i][j];
        }
    }

    ll ans=-1LL<<60;
    for(int bit=1;bit<(1<<10);bit++){
        ll tmp=0;
        rep(i,n){
            int cnt=0;
            rep(j,10){
                if(f[i][j]==1 && (bit & (1<<j))) cnt++;
            }
            tmp+=p[i][cnt];
        }
        ans=max(ans,tmp);
    }

    cout<<ans<<endl;
}



Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

int N,M;
int P[100000],Y[100000]; vector<int> yd[100001];
int main () {
	scanf("%d%d",&N,&M);
	rep(i,M)scanf("%d%d",&P[i],&Y[i]),yd[P[i]].push_back(Y[i]);
	rep(i,N)sort(yd[i+1].begin(),yd[i+1].end());
	rep(i,M)printf("%012lld\n",ll(P[i])*1000000+int(lower_bound(yd[P[i]]. begin(),yd[P[i]].end(),Y[i])-yd[P[i]].begin())+1);
}

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()

using namespace std;
using ll = long long;

const double PI = 3.14159265358979;

void solve()
{
  int a;
  cin >> a;
  cout << (a ? 0 : 1);
}

int main()
{
  fastio;
  solve();

  return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

using namespace std;

int n;
int a[105];

int main()
{
    scanf("%d", &n);
    for(int i=1; i<=n; i++){
        scanf("%d", &a[i]);
    }
    int cnt = 0;
    for(int i=1; i<=n; i+=2){
        if(a[i]%2)
            cnt++;
    }
    printf("%d\n", cnt);
}


Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i <(n) ; ++i)
#define PI 3.14159265
#define INF 2147483647
using namespace std;
using ll = long long;
void self_max(int &a,int b){
	a = max(a,b);
}
void self_min(int &a,int b){
	a = min(a,b);
}

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

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main( ){
  int a,b;
  while( 1 ){
    cin >> a >> b;
    if( a+b==0 )break;
    if( a > b ){
      cout << b << " " << a << "\n";
    }else{
      cout << a << " " << b << "\n";
    }
  }
  return 0;  
}

Measured memory_bytes: 3100