akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll i=0; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define TWO(x) (1ULL << x)

template<class T>
class seg_tree{
private:
	vector<T> dat; ll n, max_value;
	void propagate(ll i){
		dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2]);
	}
	
	// [a,b)????????????????°?????????????
	// k     : ?????¨??????????????\????????????
	// [l,r) : k?????????????????????
	T query(ll a, ll b, ll k, ll l, ll r){
		if (r <= a || b <= l) return max_value; //?????????
		if (a <= l && r <= b) return dat[k]; //[l,r) ??? [a,b)

		//[l,r)????????¨???[a,b)???????????????
		ll md = (l + r) / 2; //[l,md),[md,r)
		ll nl = k * 2 + 1, nr = nl + 1; //????????\???
		T lval = query(a, b, nl, l, md);
		T rval = query(a, b, nr, md, r);

		return min(lval, rval); // ?????????????°??????????????????¨
	}
public:
	void init(const vector<T> & v, ll max_value){
		this->max_value = max_value;
		n = 1; while(n < v.size()) n <<= 1;
		dat = vector<T>(2 * n - 1, max_value);
		
		REP(i, v.size()) dat[n - 1 + i] = v[i];
		REP(i, n-2) propagate((n-2) - i);
	}
	
	void update(ll k, T val){
		k += n - 1; // seg_tree??????index?????????
		dat[k] = val;
		while(k > 0){
			k = (k - 1) / 2;
			propagate(k);
		}
	}
	
	T query(ll a, ll b) { return query(a, b, 0, 0, n); }
};

int main(){
	ll n, q;
	cin >> n >> q;
	seg_tree<ll> st;
	st.init((vector<ll>(n, TWO(31) - 1)), TWO(31) - 1);
	REP(_, q){
		ll com, x, y;
		cin >> com >> x >> y;
		if(com==0){ // update
			st.update(x, y);
		}else{ // find
			cout << st.query(x, y+1) << endl;
		}
	}

	return 0;
}

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

using namespace std;

template<class INT>
std::vector<INT> get_min_prime_fact_table(INT n){
    std::vector<INT> lp(n + 1), P;
    for (INT i = 2; i <= n; i++){
        if (lp[i] == 0){
            lp[i] = i;
            P.push_back(i);
        }
        for (INT j = 0; j <= P.size() and P[j] <= lp[i] and i * P[j] <= n; j++)
            lp[i * P[j]] = P[j];
    }

    return lp;
}

template<class INT>
std::map<INT, int> prime_factorize(INT n, std::vector<INT>& lp){
    std::map<INT, int> res;
    while (n != 1){
        res[lp[n]]++;
        n /= lp[n];
    }

    return res;
}

int main(){
    int n;
    cin >> n;
    vector<int> A(n);
    copy_n(istream_iterator<int>(cin), n, A.begin());

    int g = 0;
    for (const auto &a: A)
        g = gcd(g, a);
    
    if (g != 1){
        puts("not coprime");
        return 0;
    }

    auto lp = get_min_prime_fact_table(int(1e6));
    vector<int> DP(1e6 + 1);
    DP[1] = 1;
    for (int i = 2; i <= int(1e6); i++)
        DP[i] = DP[i / lp[i]] * (lp[i] == lp[i / lp[i]] ? 1 : lp[i]);
    
    vector<int> P(1e6 + 1);
    for (const auto &a: A){
        for (const auto &[p, c]: prime_factorize(DP[a], lp)){
            if (P[p] == 1){
                puts("setwise coprime");
                return 0;
            }
            P[p]++;
        }
    }

    puts("pairwise coprime");
}

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

int main() {
  pair<pair<string,int>,int>p[1000];
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string s;
    int P;
    cin>>s>>P;
    p[i]=make_pair(make_pair(s,-P),i+1);
  }
  sort(p,p+n);
  for(int i=0;i<n;i++){
    cout<<p[i].second<< endl;
  }
}

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

int main(){
  long n; cin>>n;
  vec ans;
  
  while(n>0){
    
    if(n%26==0){
      n-=26;
      n/=26;
      ans.push_back('z');
    }
    else{
      int x=n%26;
      n-=x;
      n/=26;
      ans.push_back('a'+x-1);
    }  
  }

  reverse(ans.begin(),ans.end());

  
  rep(i,ans.size())cout<<ans[i];

}

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

int main() {
  string s;
  cin >> s;
  int maxlen  = 0;
  int len = 0;
  for(int i = 0 ; i < s.size() ; i ++ ) {
    if(s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
      len++;
    } else {
      maxlen = max(maxlen , len);
      len = 0;
    }
  }
  maxlen = max(maxlen , len);
  cout << maxlen ;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
  int n,a[100],i,count=0,flag=1,tmp,j;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }

  while(flag){
    flag=0;

    for(j=n-1;j>0;j--){
      if(a[j]<a[j-1]) {
	tmp=a[j];
	a[j]=a[j-1];
	a[j-1]=tmp;
	flag=1;
	count++;
      }
    }

    
  }

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

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

Measured memory_bytes: 600
// template version 1.15
using namespace std;
#include <bits/stdc++.h>

// varibable settings
#define int long long
const int INF=1e18;

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(a, b, c) make_tuple(a, b, c)
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

#define divceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define slice(l, r) substr(l, r-l)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
    #include "lib/dump.hpp"
#else
    #define dump(...) 42
    #define dump_1d(...) 42
    #define dump_2d(...) 42
    #define cerrendl 42
#endif
//}}}

signed main() {
    int n,m;cin>>n>>m;

    vi a(n), b(n);
    rep(i, n){
        cin>>a[i]>>b[i];
    }

    vi x(m), y(m);
    rep(i, m){
        cin>>x[i]>>y[i];
    }

    rep(i, n){
        int d = INF;
        int res = -1;
        rep(j, m){
            int td = abs(a[i]-x[j]) + abs(b[i]-y[j]);
            if (td < d) {
                d = td;
                res = j;
            }
        }
        cout << res + 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <map>
#include <list>
#define MOD 1000000007
#define INF 1000000000
typedef long long ll;
using namespace std;
typedef pair<int,int> P;

int main(void){
    int n;
    cin>>n;
    vector<int>a(n);
    map<int,int>m;
    for(int i=0;i<n;i++){
        cin>>a[i];
        m[a[i]]++;
    }
    int ans=0;
    for(auto itr = m.begin(); itr != m.end(); ++itr) {
        if(itr->first<itr->second){
            ans+=itr->second-itr->first;
        }else if(itr->first>itr->second){
            ans+=itr->second;
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

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

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

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

int C[15];
int A[15][15];

void solve()
{
    int N, M, X;
    cin >> N >> M >> X;
    REP0 (i, N)
    {
        cin >> C[i];
        REP0 (j, M)
        {
            cin >> A[i][j];
        }
    }

    LL cost_ans = LLINF;

    REP0 (bit, 1 << N)
    {
        vector<int> alg(M);
        LL cost = 0;
        REP0 (i, N)
        {
            if (bit & 1 << i)
            {
                REP0 (j, M)
                {
                    alg[j] += A[i][j];
                }
                cost += C[i];
            }
        }
        bool isok = true;
        for (auto al : alg)
        {
            if (al < X)
            {
                isok = false;
            }
        }
        if (isok)
            cost_ans = min(cost_ans, cost);
    }

    std::cout << (cost_ans == LLINF ? -1 : cost_ans) << endl;
}

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


Measured memory_bytes: 3656
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <tuple>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;

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

//逆元を求める関数
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
      fac[i] = fac[i-1] * i % MOD;
      inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
      finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
//組み合わせ
long long COM (int n, int k) {
    if(n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

void solve() {
	string s; cin >> s;
	s[3] = '8';
	cout << s << endl;
    return;
}

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



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(ll i=0; i<(n); ++i)
#define rep1(i,n) for(ll i=1; i<=(n); ++i)
#define repi(i,a,b) for(ll i=a; i<=(b); ++i)
#define rrep(i,n) for(ll i=(n-1); i>=0; --i)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define print(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
using Edge = pair<ll,ll>;
using Graph = vector<vector<Edge>>;
typedef pair<ll,ll> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
ll MOD = 1e9 + 7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
ll devc(ll x, ll y){return 1 + (x-1)/y;}
ll modpow(ll x, ll y, ll m) {
    if (y == 0) return 1;
    ll res = modpow(x, y / 2, m);
    return res * res % m * (y & 1 ? x : 1) % m;
}
ll modinv(ll x) { return modpow(x, MOD - 2, MOD); }

int main(){
    ll N,A; cin >> N >> A;
    print(devc(N,A));
    return 0;
}

Measured memory_bytes: 256
import sys

def solve():
    input = lambda: sys.stdin.readline().rstrip()
    sys.setrecursionlimit(10 ** 7)
    mod = 10 ** 9 + 7

    def comb(n, r):
        if r > n: return 0
        return fac[n] * inv[r] * inv[n - r] % mod

    def dfs(v, Pa=-1):
        for u in to[v]:
            if u == Pa: continue
            dfs(u, v)
            size[v] += size[u]
            dp[v] *= dp[u] % mod
            dp[v] *= inv[size[u]] % mod
        dp[v] *= fac[size[v]] % mod
        size[v] += 1

    def bfs(v, Pa=-1, P_val=1, P_sz=0):
        ans[v] = P_val * dp[v] * comb(n - 1, P_sz) % mod
        for u in to[v]:
            if u == Pa: continue
            val = ans[v] * INV(dp[u] * comb(n - 1, size[u])) % mod
            bfs(u, v, val, n - size[u])

    n = int(input())
    to = [[] for _ in range(n)]
    for _ in range(n - 1):
        a, b = map(lambda x: int(x) - 1, input().split())
        to[a].append(b)
        to[b].append(a)

    fac = [1] * (n + 2)
    inv = [1] * (n + 2)

    for i in range(2, n + 1):
        fac[i] = fac[i - 1] * i % mod
    INV = lambda x: pow(x, mod - 2, mod)
    inv[n] = INV(fac[n])
    for i in range(n - 1, 1, -1):
        inv[i] = inv[i + 1] * (i + 1) % mod

    dp = [1] * n
    size = [0] * n
    ans = [0] * n

    dfs(0)
    bfs(0)
    print(*ans, sep='\n')

if __name__ == '__main__':
    solve()

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

int main(){
  string a,b;
  cin >> a >> b;
  char s[10],t[10];
  for(int i=0; i<=a.length()-1; i++){
    s[i] = a[i];
    t[i] = b[i];
    if(s[i] != t[i]){
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}


Measured memory_bytes: 3624
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<cmath>
using namespace std;
#define REP(i, limit) for(int i=0; i< limit; ++i)
#define FOR(i, j, limit) for(int i=j; i< limit; ++i)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ECHO(x) cout<<x<<endl;
#define MEMSET(a, n, x) REP(i, n) a[i]=x;
#define ARRIN(a, n) REP(i, n) cin>>a[i];
#define LL long long
int INF = 2147483647;
LL LINF = 9223372036854775807;
LL MOD = 1000000007;
typedef pair<int, int>P;
typedef pair<LL, LL>PL;
typedef vector<int> vi;
typedef vector<LL> vl;


int main(){
  LL h, w, x, y;
  cin>>w>>h>>x>>y;

  LL s[4];
  double a=(double)h*w/2;
  printf("%.9f ", a);
  if((double)h/2==y&&(double)w/2==x){
    cout<<1<<endl;
  }
  else {
    cout<<0<<endl;
  }


  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

int main(void) {
	int a;
	std::string s;
	std::cin >> a;
	std::cin >> s;
	if (a >= 3200) std::cout << s << std::endl;
	else std::cout << "red" << std::endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    string s, t;
    cin >> s >> t;
    cout << (s[0] == t[0]) + (s[1] == t[1]) + (s[2] == t[2]);
}


Measured memory_bytes: 256
import java.util.Scanner;

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

		int res = 0;
		for (int i = 0; i < 30; i++) {
			for (int j = 0; j < 20; j++) {
				res = 4 * i + 7 * j;
				if (res == N) {
					flg = true;
					break;
				}
				if (res > N) {
					break;
				}
			}
		}
		if (flg) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();

	}

}

Measured memory_bytes: 22612
import functools
import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
import random
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


H, W, N = read_values()
YP, XP = read_index()
S = input().strip()
T = input().strip()


def main():
    X = [0, W]
    Y = [0, H]
    for t, s in zip(T[::-1], S[::-1]):
        if t == "L":
            X[1] = min(W, X[1] + 1)
        elif t == "R":
            X[0] = max(0, X[0] - 1)
        elif t == "U":
            Y[1] = min(H, Y[1] + 1)
        elif t == "D":
            Y[0] = max(0, Y[0] - 1)

        if s == "L":
            X[0] += 1
        elif s == "R":
            X[1] -= 1
        elif s == "U":
            Y[0] += 1
        elif s == "D":
            Y[1] -= 1

        if X[0] >= X[1] or Y[0] >= Y[1]:
            print("NO")
            return

    if X[0] <= XP < X[1] and Y[0] <= YP < Y[1]:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()



Measured memory_bytes: 85392
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
using namespace std;
int book[11];
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    book[a]++;
    book[b]++;
    book[c]++;
    int i;
    for(i=1;i<=9;i++)
        if(book[i]==2)
    {
        cout<<"Yes"<<endl;
        break;
    }
    if(i==10)
        cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
def kaibun(lst):
    k = len(lst)//2 + len(lst)%2
    for i in range(1,k+1):
        if lst[i-1] != lst[-i]:
            return False

    return True
S = list(input())
N = len(S)
if kaibun(S) and kaibun(S[:(N-1)//2]) and kaibun(S[(N+3)//2-1:]):
    print('Yes')

else:
    print('No')

Measured memory_bytes: 9132
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
using namespace std;

int main(void) {
	long long s, c, count = 0, ma;
	cin >> s >> c;

	c = c / 2;
	count += min(c, s);
	c -= count;
	if (c > 0) {
		count += c / 2;
	}
	/*while (c > 1&&s>0) {
		c -= 2; s--; count++;
	}*/
	//count += c / 4;
	cout << count << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
typedef long long lint;

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	int A, B;
	cin >> A >> B;

	cout << A * B / 2 << "\n";

	return 0;
}

Measured memory_bytes: 256
n, d, a = map(int, input().split())
xh = sorted([list(map(int, input().split())) for _ in range(n)])
ret = 0
surface = 0
dec = []
j = 0
for i in range(n):
    x, h = xh[i]
    while j < len(dec) and dec[j][0] < x:
        surface -= dec[j][1]
        j += 1
    h = (h + a - 1) // a - surface
    if h > 0:
        dec.append((x + 2 * d, h))
        ret += h
        surface += h
print(ret)

Measured memory_bytes: 121536
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
#include <map>
#include <set>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    int n;
    cin >> n;
    string s;
    cin >> s;
    int condition = 2,result=0;
    REP(i,1000){
        condition = 2;
        REP(j,n){
            if((int)(s[j]-'0')==(i/((int)(pow(10,condition))))%10){
                if(condition){
                    condition--;
                }else{
                    result++;
                    break;
                }
            }
        }
    }

    cout << result << endl;
}


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


int main(){
  int a[3];
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3);

  cout<<a[2]*10+a[1]+a[0]<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>

using namespace std;

int main()
{
    int n,a;
    cin>>n>>a;
    if (n%500<=a) cout<<"Yes";
    else cout<<"No";
    return 0;
}


Measured memory_bytes: 256
#x枚目まででy枚選んで合計がzになる場合の数dp[x][y][z](x+1*y+1*たくさん)
N,A=map(int,input().split())
x=[int(i) for i in input().split()]
dp=[[[0]*(50*N+1) for i in range(N+1)]for k in range(N+1)]
ans=0
dp[0][0][0]=1
for made,i in enumerate(dp):#走査して、一個上を書き換え
    if made>N:break
    for maisu,j in enumerate(i):
        for wa,k in enumerate(j):
            if k and made<N:#made枚目までにmaisu枚選んでwaになる場合の数
                dp[made+1][maisu][wa]+=k#made+1枚目についての議論
                newwa=wa+x[made]
                if newwa<=A*N:
                    dp[made+1][maisu+1][newwa]+=k
for mai in range(1,N+1):
    a=dp[N][mai][mai*A]
    if a:
        ans+=a
print(ans)


Measured memory_bytes: 62928
fun main(args: Array<String>){
    val input = readLine()!!.split(" ")
    var a = input[0].toInt()
    var b = input[1].toInt()
    var c = input[2].toInt()

    if(a <= c && c <= b){
        println("Yes")
    }
    else if(b <= c && c <= a){
        println("Yes")
    }
    else{
        println("No")
    }
}

Measured memory_bytes: 37924
N, M = map(int, input().split())
A=list(map(int, input().split()))
sm=0

d={0:1}

c=0

for i in range(N):
    sm=sm+A[i]
    c=c+d.setdefault(sm%M,0)
    d[sm%M]=d[sm%M]+1
print(c)

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

using namespace std;
typedef long long ll;

vector<vector<ll>> G;
ll N,M;
ll H[100000];

int main(){
    cin >> N >> M;
    G.resize(N);
    for(int i=0;i<N;i++){
        cin >> H[i];
    }
    for(int i=0;i<M;i++){
        ll a,b;
        cin >> a >> b;
        G[a-1].push_back(b-1);
        G[b-1].push_back(a-1);
    }
    ll C = 0;
    for(int i=0;i<N;i++){
        bool f = true;
        for(auto &e : G[i]){
            if(H[i] <= H[e]){
                f = false;
                break;
            }
        }
        if(f) C++;
    }
    cout << C << endl;
    return 0;
}

Measured memory_bytes: 9772
import java.util.Scanner;

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

        long a = 1;
        long b = 1;
        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            int y = in.nextInt();

            long c1 = (a + x - 1) / x;
            long c2 = (b + y - 1) / y;

            long max = Math.max(c1, c2);

            a = x * max;
            b = y * max;
        }

        System.out.println(a + b);
    }
}


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

typedef tuple<string, int , int> mytuple;

bool mycompare(const mytuple &lhs, const mytuple &rhs)
{
	if (get<0>(lhs) != get<0>(rhs)) return get<0>(lhs) < get<0>(rhs);
	if (get<1>(lhs) != get<1>(rhs)) return get<1>(lhs) > get<1>(rhs);
	return get<2>(lhs) > get<2>(rhs);
}


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

	vector<tuple<string,int,int>> vec(n);
	vector<string> s(n);
	vector<int> p(n);
	vector<int> num(n);
	for (size_t i = 0; i < n; i++)
	{
		cin >> s[i];
		cin >> p[i];
	}
	for (size_t i = 0; i < n; i++)
	{
		vec[i] = make_tuple( s[i], p[i], i+1);
	}
	sort(vec.begin(), vec.end(), mycompare);

	for (size_t i = 0; i < n; i++)
	{
		tuple<string, int, int> t = vec[i];
		cout << get<2>(t) << endl;
	}

}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <unordered_set>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <cstdint>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

constexpr ll inf = INT64_MAX / 4;
constexpr double pi = asin(1) * 2;
constexpr ll mod = 1000000007;

template<class T>
class set2 : public set<T> {
private:
    typename set<T>::iterator back_itr() {
        auto e = this->end();
        e--;
        return e;
    }

public:
    T front() {
        if (this->empty()) throw;
        return *this->begin();
    }

    T back() {
        if (this->empty()) throw;
        return *this->back_itr();
    }

    void erase_front() {
        if (!this->empty()) this->erase(this->begin());
    }

    void erase_back() {
        if (!this->empty()) this->erase(this->back_itr());
    }
};

int n, m, l, a, b, c, q, s, t, d1[301][301], d2[301][301];

int main() {
    cin >> n >> m >> l;
    for (auto &e:d1)for (auto &f:e)f = INT32_MAX / 2;
    for (auto &e:d2)for (auto &f:e)f = INT32_MAX / 2;
    for (int i = 0; i < m; i++) {
        cin >> a >> b >> c;
        d1[a][b] = d1[b][a] = c;
    }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            for (int k = 1; k <= n; k++)
                d1[j][k] = min(d1[j][i] + d1[i][k], d1[j][k]);
    for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) if (d1[i][j] <= l) d2[i][j] = 1;
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            for (int k = 1; k <= n; k++)
                d2[j][k] = min(d2[j][i] + d2[i][k], d2[j][k]);
    cin >> q;
    for (int i = 0; i < q; i++) {
        cin >> s >> t;
        cout << (d2[s][t] == INT32_MAX / 2 ? -1 : d2[s][t] - 1) << endl;
    }
}


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

int main() {
	int n;
	ll m = 1e9+7;
	cin >> n;
	vector<ll> a(n), sum_a(n);
	rep(i,n) cin >> a[i];
	sum_a[0] = a[0];
	rep(i,n-1) {
		sum_a[i+1] = sum_a[i] + a[i+1];
		sum_a[i+1] %= m;
	}

	ll ans = 0;
	rep(i,n-1) {
		ans += a[i] * (sum_a[n-1] - sum_a[i] + m);
		ans %= m;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 6420
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.geom.Point2D;
import java.util.*;
 
public class Main {
    Scanner sc = new Scanner(System.in);
 
    public static void main(String[] args) {
    	new Main(); 
    }
 
    public Main() {
    	while(sc.hasNext()){
    		new aoj0076().doIt();
    	}
    }
    class aoj0076{
    	boolean result = false;
    	void dfs(int cnt,int num[]){
//    		System.out.print(cnt+" ");
//    		for(int i = 1;i <= 9;i++)System.out.print(num[i]);
//    		System.out.println();
    		if(cnt == 4){
    			for(int i = 1;i <= 9;i++)if(num[i] == 2)result = true;
    		}else{
    			for(int i = 1;i <= 7;i++){
    				if(num[i] > 0 && num[i+1] > 0 && num[i+2] > 0){
    					num[i]--;num[i+1]--;num[i+2]--;
    					dfs(cnt+1,num);
    					num[i]++;num[i+1]++;num[i+2]++;
    				}
    			}
    			for(int i = 1;i <= 9;i++){
    				if(num[i] > 2){
    					num[i] -= 3;
    					dfs(cnt+1,num);
    					num[i] += 3;
    				}
    			}
    		}
    	}
    	void doIt(){
    		String str = sc.next();
    		char ctr[] = str.toCharArray();
    		int num[] = new int [10];
    		boolean nump[] = new boolean[10];
    		for(int i = 0;i < 13;i++)num[Integer.parseInt(""+ctr[i])]++;
    		for(int i = 1;i <= 9;i++){
    			if(num[i] == 4)continue;
    			num[i]++;
    			result = false;
    			dfs(0,num);
    			if(result)nump[i] = true;
    			num[i]--;
    		}
    		int c = 0;
    		for(int i = 1;i < 10;i++){
    			if(nump[i])c++;
    		}
    		if(c == 0)System.out.println(0);
    		else{
    			int c2 = 0;
    			for(int i = 1;i <= 9;i++){
    				if(c2 == 0){
    					if(nump[i]){
    						System.out.print(i);
    						c2++;
    					}
    				}else{
    					if(nump[i]){
    						System.out.print(" "+i);
    						c2++;
    					}
    				}
    				if(c == c2){
    					System.out.println();
    					break;
    				}
    			}
    		}
    	}
    }
}

Measured memory_bytes: 27084
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
typedef long long ll;
int main(){
    int n;
    vector<int> v(100100);
    cin >> n;
    rep(i,n){
        int x;
        cin >> x;
        if(x>0)
            v[x - 1]++;
        v[x]++;
        v[x+1]++;
    }
    int res = 0;
    rep(i,100100){
        res = max(res,v[i]);
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 640
def main():
  s = input()
  mod = 10**9+7
  dp = [0]*13
  dp[0] = 1
  digit = 1
  for i in range(len(s)):
    nextDP = [0]*13
    if s[i] == "?":
      for k in range(10):
        for j in range(13):
          t = (k + j * 10)%13
          nextDP[t] = (dp[j] + nextDP[t]) % mod
    else:
      si = int(s[i])
      for j in range(13):
        t = (si + j * 10)%13
        nextDP[t] = (dp[j] + nextDP[t]) % mod
    dp = nextDP
    digit *= 10
  print(dp[5])

if __name__ == '__main__':
  main()

Measured memory_bytes: 77348
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef  long long ll;
double pi=3.1415926535898;
//double pi=acos(-1.0);
#define speed      ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
#define rng(i,a,b) for(int i=a;i>=int(b);i--)
#define rep(i,a,b) for(int i=a;i<=int(b);++i)
#define lop(i,n)   for(int i=0;i<int(n);i++)
#define ms(x,a)    memset(x,a,sizeof(x))
#define all(x)     (x).begin(),(x).end()
#define sz(x)      int(x.size())
#define pb         push_back
#define r0         return 0;
#define CC         continue;
#define bb(x)      cerr<< x <<endl;
#define pii        pair<int,int>
#define pis        pair<int,string>
#define vi         vector<int>
#define F          first
#define S          second
//#define max(a,b) a<b?b:a  __builtin_popcount;
//#define min(a,b) a<b?a:b
//freopen("output.txt","w",stdout),freopen("input.txt","r",stdin);
const ll M  = 1e9+7 ;
const int N = 50500;
const int inf = INT_MAX;
const double eps = 1e-6;
//////////////////////    Hi    ^_^  hack me if you can :P

int main()
{
    int x;
    cin>>x;
    if (x<1200)cout<<"ABC";
    else cout<<"ARC";
    r0;
}

/*



https://ideone.com/goT6Vy//http:
codeforces.com/problemset/problem/466/D

, vector < pair <int,int > >, greater <pair <int, int> >
http://codeforces.com/contest/295/submission/17929453
freopen("output.txt","w",stdout);
freopen("input.txt","r",stdin);

ll pwmod(ll a, ll n, ll mod)
{
    ll ret = 1;
    while (n)
    {
        if (n & 1) ret = ret * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return ret;
}

for (int i=0; i<n; i++)            Hi    ^_^  hack me if you can :P

int mx[]= {0,0,1,-1, 1,1,-1,-1};
int my[]= {1,-1,0,0, 1,-1,1,-1};
bool inside (int i,int j){return (i>=0 && i<n && j>=0 && j<m);}

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

void gcd(LL n,LL m,LL &d,LL &xx,LL &yy)
{
    if(!m)
    {
        d=n;
        xx=1;
        yy=0;
    }
    else
    {
        gcd(m,n%m,d,yy,xx);
        yy-=xx*(n/m);
    }
}

int getm(int l,int r)
{
    if(l>r)
        return N;
    if(l==r)
        return 0;
    if(l==r-1)
        return s[l] != s[r];
    if(s[l]==s[r])
        return getm(l+1,r-1);
    else
        return 1+min(getm(l+1,r),getm(l,r-1));
}

int BIT[si], a[si], n;
void update(int x, int delta)
{
    for(; x <= N; x += x&-x)
        BIT[x] += delta;
}
int query(int x)
{
    int sum = 0;
    for(; x > 0; x -= x&-x)
        sum += BIT[x];
    return sum;
}

#define sc(x)      scanf("%d",&x)
#define scl(x)     scanf("%lld",&x)
#define pr(x)      printf("%d ",x)
#define prl(x)     printf("%lld ",x)
#define prln(x)    printf("%d\n",x)
#define prlln(x)   printf("%lld\n",x)
#define scd(x)     scanf("%lf",&x)
#define prd(x)     printf("%.10f\n",x)


*/


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <set>

using namespace std;

bool descending(string str){
    for(int i=0;i<str.length()-1;i++){
        if(str[i] < str[i+1]){
            return false;
        }
    }
    return true;
}

int main(){
    string str; cin >> str;
    //if(str == "zyxwvutsrqponmlkjihgfedcba"){
    //    cout << -1 << endl;
    //    return 0;
    //}
    int N = str.length();
    set<char> st;
    for(int i=0;i<N;i++){
        st.insert(str[i]);
    }

    if(st.size() < 26){
        for(char c='a';c<='z';c++){
            if(st.find(c) == st.end()){
                str.push_back(c);
                break;
            }
        }
        cout << str << endl;
        return 0;
    }else{
        string ans;
        for(int i=0;i<N;i++){
            string ssub = str.substr(i, str.length());
            if(descending(ssub)){
                if(i==0){
                    cout << -1 << endl;
                    return 0;
                }else{
                    for(char c=str[i-1]+1;c<='z';c++){
                        string tmp = str.substr(0,i-1);
                        if(tmp.find(c) == string::npos){
                            ans = tmp;
                            ans.push_back(c);
                            break;
                        }
                    }
                    cout << ans << endl;
                    return 0;
                }
            }
        }
    }
    return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define Rep(i,j,n) for(int i=j; i<n; i++)
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100//000000000
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<int, int>
#define PP pair<int,P>
#define T tuple<int,int,int> 
using namespace std;

int main(){
  int m; cin >> m;
  ll ans=0;
  ll keta=0;
  rep(i,m){
    ll d,c; cin >> d >> c;
    ans+=d*c;
    keta+=c;
  }

  cout << (ans-1)/9+keta-1 << endl;
  return 0;
}
/*
-9 0
10-18 1
19-27 2
28-36 3
37-45 4 

9874
1774
874
154
64
10
1

*/

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  ll N,i,E,W=0,ans;string S;
  cin>>N>>S;ans=N;E=count(ALL(S),'E');
  REP(i,N){
    if(S[i]=='E')E--;
    ans=min(W+E,ans);
    if(S[i]=='W')W++;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 900
# -*- coding: utf-8 -*-

class Info():
    def __init__(self, x, y, h):
        self.X = x
        self.Y = y
        self.H = h

def main():
    N = int(input())
    infos = []
    for i in range(N):
        x, y, h = list(map(int, input().split(" ")))
        infos.append(Info(x, y, h))
    
    # [0, 100]に座標があるのでMAXを定義する
    MAX = 100
    for posY in range(0, MAX+1):
        for posX in range(0, MAX+1):
            # 頂上がどれくらいの高さであってほしいか。
            # -1はまだよくわからないとき。0以上は確定してるとき
            # -2はだめだとわかったとき
            ans_h = -1

            for i in range(N):
                # 各座標について考える
                if infos[i].H > 0:
                    H = infos[i].H + abs(posY - infos[i].Y) + abs(posX - infos[i].X)
                    if ans_h == -1:
                        ans_h = H
                    else:
                        if ans_h != H:
                            ans_h = -2
                            break
            
            # ダメだったら別の場所を探す
            if ans_h == -2:
                continue
            
            is_ok = True
            for i in range(N):
                # 各座標について、高さが0の場合に矛盾していないか調べる
                if infos[i].H == 0:
                    if ans_h - abs(posY - infos[i].Y) - abs(posX - infos[i].X) <= 0:
                        continue
                    else:
                        is_ok = False
                        break
            
            if is_ok:
                print(posX, posY, ans_h)
                return
            """
                if infos[i].H == 0:
                    dist = abs(posY - infos[i].Y) + abs(posX - infos[i].X)
                    if ans_h > dist:
                        ans_h = -2
                        break
            
            if ans_h == -2:
                continue

            print(posX, posY, ans_h)
            return

            """
            

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int,int>;
/* ちゃんと考えてわかって実装 */

int main(void){
    string s;
    cin >> s;
    if(s == "ABC") cout << "ARC";
    else cout << "ABC";
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ass 1e18
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x,y) cout<<#x<<": "<< x<< ", "<< #y<< ": "<< y<< endl;
#define debug3(x,y,z) cout<<#x<<": "<< x<< ", "<< #y<< ": "<< y<<" "<<#z<<" : "<<z<< endl;
using namespace std;
typedef long long int ll;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
ll arr[200005];

int main()
{
	boost
	string s;
	ll n;
	cin>>n>>s;
	if(n>=3200)
		cout<<s;
	else
		cout<<"red";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5+5 , M = 1e18+5, OO = 0x3f3f3f3f;
typedef long long ll;

int main()
{
    int n, d;
    cin >> n;
    if(n%2 == 0) d = n/2;
    else d = (n/2)+1;
    printf("%0.10lf", double(d)/double(n));
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<ll, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;
ll a[310][310];
bool used[310][310];

ll solve() {
    ll res = 0;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            res += a[i][j];
    
    for (int k = 0; k < n; k++) {
	for (int i = 0; i < n; i++) {
	    for (int j = 0; j < n; j++) {
                if (a[i][j] > a[i][k] + a[k][j]) return -1;
                if (k != i && k != j && a[i][j] == a[i][k] + a[k][j] && !used[i][j]) {
                    res -= a[i][j];
                    used[i][j] = true;
                }
            }
        }
    }
    return res / 2;
}

void input() {
    cin >> n;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            cin >> a[i][j];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << solve() << endl;
}


Measured memory_bytes: 1152
#include <stdio.h>

long long floor_sum(long long n, long long m, long long a, long long b)
{
	if (a >= m || b >= m) return n * (n - 1) * (a / m) / 2 + n * (b / m) + floor_sum(n, m, a % m, b % m);
	long long y = (n * a + b) / m, x = m * y - b;
	if (y == 0) return 0;
	else return (n - (x + a - 1) / a) * y + floor_sum(y, a, m, (a - x % a) % a);
}

int main()
{
	int t, T, N, M, A, B;
	scanf("%d", &T);
	for (t = 1; t <= T; t++) {
		scanf("%d %d %d %d", &N, &M, &A, &B);
		printf("%lld\n", floor_sum(N, M, A, B));
	}
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1720
// Let's bring the sky down :)
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 3e5 + 5;
ll a[N];
int main()
{
    ios_base ::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    for(int i = 0; i < n; i++)
        cout << s[i] << t[i];
return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>

using namespace std;

typedef long long ll;

int main() {
    int a, b;
    cin >> a >> b;
    cout << a * b << endl;
    return 0;
}

Measured memory_bytes: 3600
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        List<Point> red = new ArrayList<>();
        for(int i = 0;i < n;i++){
            Point x = new Point(sc.nextInt(),sc.nextInt());
            red.add(x);
        }
        List<Point> blue = new ArrayList<>();
        for(int i = 0;i < n;i++){
            Point x = new Point(sc.nextInt(),sc.nextInt());
            blue.add(x);
        }
        Collections.sort(red,new PointComparator());
        Collections.sort(blue,new PointComparator());

        long ans = 0;
        for(Point p : blue){
            Point max = null;
            for(Point q : red){
                if(q.x < p.x && q.y < p.y){
                    if(max == null || max.y < q.y){
                        max = q;
                    }
                }
            }
            if(max != null){
                ans++;
                red.remove(max);
            }
        }
        System.out.println(ans);
    }

    static class Point{
        int x;
        int y;
        public Point(int x,int y){
            this.x = x;
            this.y = y;
        }
    }
    static class PointComparator implements Comparator<Point>{
        public int compare(Point p1,Point p2){
            return p1.x - p2.x;
        }
    }
}


Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int H,W;
	char l;
	cin >> H >> W;
	vector<vector<char>> v(H,vector<char>(W));
	for (int i = 0 ;i< H;i++){
		for (int j = 0;j < W;j++){
			cin >> l;
			v[i][j]= l;
		}
	} 
	
	int flag = 0;
	for (int i = 0 ;i< H;i++){
		for (int j = 0;j < W;j++){
			if (v[i][j] == '#'){
				flag = 0;
				if (i - 1>=0 && i-1<H){
					if (v[i-1][j] == '#'){
						flag = 1;
					}
				}
				if (i +1>=0 && i + 1 <H){
					if (v[i+1][j] == '#'){
						flag = 1;
					}
				}
				if (j - 1>=0 && j - 1 <W){
					if (v[i][j-1] == '#'){
						flag = 1;
					}
				}
				if (j +1>=0 && j + 1 <W){
					if (v[i][j+1] == '#'){
						flag = 1;
					}
				}
			}
			else{
				flag = 1;
			}
			if (flag == 0){
				break;
			}
		}
		if (flag == 0){
			break;
		}
	} 
	if (flag == 0){
		cout << "No"<<endl;
	}
	else{
		cout << "Yes" <<endl;
	}
	return 0;
}

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++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(){
    ll a, b;
    cin >> a >> b;
    ll count = 0;
    ll i = 2;
    while(a <= b) {
        count++;
        a *= 2;
        i *= 2;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>

char A[105];
int cnt[300];
int main(){
    scanf("%s", &A[0]);

    for (int i=0; A[i] != '\0'; ++i) {
        cnt[A[i]]++;
    }

    for (char i='a'; i<='z'; ++i) {
        if (cnt[i]%2 != 0) {
            printf("No");
            return 0;
        }
    }

    printf("Yes");
    return 0;
}

Measured memory_bytes: 128
import java.io.*;
import java.util.*;

public class Main { // "Main" should be used for most online judges
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		int index = str.indexOf('A');
		int count = 1;
		for (int i = index; i < str.length(); i++ )
		{
			if(str.charAt(i)=='Z')
			{
				count = i -index +1;

			}
		}
		System.out.print(count);
	}
}

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

int main() {
  int A,B,C;
  cin >> A >> B >> C;
  
  if(A == B && B != C) {
    cout << "Yes" << endl;
  }
  
  else if(A != B && A == C) {
    cout << "Yes" << endl;
  }
  
  else if (A != B && B == C) {
    cout << "Yes" << endl;
  }
  
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<tuple>
#include<algorithm>
#include<cmath>
using namespace std;

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

int main(){
  int A, B;
  cin >> A >> B;
  if(A==1)
    A+=13;
  if(B==1)
    B+=13;
  if(A>B)
    cout << "Alice" << endl;
  else if(A<B)
    cout << "Bob" << endl;
  else
    cout << "Draw" << endl;
  return 0;
}

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

#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007 
#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define lrep(i,n) for(long long  i = 0; i < (long long)(n); i++)
#define lrep2(i,a,n) for(long long i = (long long)(a); i <= (long long)(n); i++)

#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,a,n) for(int i = (int)(n); i >= (int)(a); i--)

typedef long long ll;
typedef std::vector<char> v_char;
typedef std::vector<v_char > v2_char;
typedef std::vector<double> v_double;
typedef std::vector<v_double > v2_double;
typedef std::vector<int> v_int;
typedef std::vector<v_int > v2_int;
typedef std::vector<ll> v_ll;
typedef std::vector<v_ll > v2_ll;
typedef std::vector<std::string> v_string;
typedef std::vector<v_string > v2_string;
typedef std::vector<bool> v_bool;
typedef std::vector<v_bool > v2_bool;
typedef std::pair<ll, ll> pll;
typedef std::pair<int, int> pii;

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std; 

int main(void)
{
    ll x, y;
    cin >> x >> y;
    
    if(x == y) { cout << -1 << endl; return 0;} 
    for(ll i = 1; x * i <= 1000000000; i++) {
        if((x*i)%y != 0) {
            cout << x*i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}
/** tcoder **/


Measured memory_bytes: 256