akhauriyash/Code-Regression huggingface dataset:
// SmartCoder
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>  // Including tree_order_statistics_node_update

using namespace __gnu_pbds;
using namespace std;

#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define minei(x) min_element(x.begin(), x.end()) - (x).begin()
#define maxei(x) max_element(x.begin(), x.end()) - (x).begin()
#define LSOne(S) (S & (-S))

#define uns(v) sort((v).begin(), (v).end()), v.erase(unique(v.begin(), v.end()), v.end())
#define acusum(x) accumulate(x.begin(), x.end(), 0)
#define acumul(x) accumulate(x.begin(), x.end(), 1, multiplies<int>());
#define bits(x) __builtin_popcount(x)
#define oo INT_MAX
#define inf 1000000000
#define MAXN 1000007
#define MOD 1000000007

const double pi = acos(-1.0);
const double eps = 1e-11;

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

int main() {
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int a, b;
    cin >> a >> b;
    cout << max({a * b, a - b, a + b}) << '\n';

    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#include "atcoder/mincostflow"
using namespace atcoder;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 100000001

int main() {

	int N, M;
	cin >> N >> M;

	vector<string> S(N);
	rep(i, N)cin >> S[i];

	mcf_graph<int, int> G(N*M + 2);

	int s = N * M;
	int t = N * M + 1;
	int ans = 0;
	rep(i, N) {
		rep(j, M) {
			if (S[i][j] == '#') {
				continue;
			}
			//元、先、容量、コスト
			if (i != N - 1) {//一番下じゃない
				if (S[i + 1][j] != '#') {//行き先が障害物じゃない
					G.add_edge(i*M + j, (i + 1)*M + j, Inf, 0);
				}
			}
			if (j != M - 1) {//一番右じゃない
				if (S[i][j + 1] != '#') {//行き先が障害物じゃない
					G.add_edge(i*M + j, i*M + j + 1, Inf, 0);
				}
			}
			//tに
			G.add_edge(i*M + j, t, 1, (N + M) - (i + j));
			if (S[i][j] == 'o') {
				//sから
				G.add_edge(s, i*M + j, 1, 0);
				ans -= i;
				ans -= j;
				ans += (N + M);
			}
		}
	}

	ans -= G.flow(s, t).second;

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 4088
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep3(i, l, n) for (int i = l; i < n; ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define out(a) cout << a << endl
#define outa(a, n) rep(_, n) cout << a[_] << " "; cout << endl
#define SZ(v) (int)v.size()
#define inf (int)(1e9+7)

int main() {
    // 1 <= k <= 5
    string str;
    cin >> str;
    int k;
    cin >> k;
    set<string> s;
    rep(i, SZ(str)) {
        string tmp;
        rep3(j, i, i + 5) {
            if (j == SZ(str)) break;
            tmp += str[j];
            s.insert(tmp);
        }
    }
    int c = 0;
    for (auto e : s) {
        c++;
        if (c == k) { out(e); return 0;}
    }
    
}


Measured memory_bytes: 1664
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define FILL(Itr,n) fill((Itr).begin(),(Itr).end(),n)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;

template <class T> struct MaxFlow {
    const T INF = 1e9;
    struct  Edge {
        int to,rev; T cap;
        Edge(){}
        Edge(int _to, int _rev, T _cap){
            to = _to; rev = _rev; cap = _cap;
        }
    };
    vector< vector<Edge> > G;
    vector< bool > used;
    MaxFlow(int size){
        G.resize(size+10);
        used.resize(size+10);
    }
    void add_edge(int from, int to, int cap){
        G[from].push_back(Edge(to,(int)G[to].size(),cap));
        G[to].push_back(Edge(from,(int)G[from].size()-1,0));
    }
    T dfs(int v, int t, T f){
        if(v==t)return f;
        used[v] = true;
        for(int i=0;i<G[v].size();i++){
            Edge &e = G[v][i];
            if(!used[e.to] && e.cap>0){
                T d = dfs(e.to, t, min(f,e.cap));
                if(d>0){
                    e.cap -= d;
                    G[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }
    T getmax(int source, int sink){
        T flow = 0;
        while(true){
            for(int i=0;i<used.size();i++)used[i]=false;
            T f = dfs(source, sink, INF);
            if(f==0)return flow;
            flow += f;
        }
    }
};

int main(){
    
    MaxFlow<int> inst(300);
    
    int X,Y,E;
    cin>>X>>Y>>E;
    
    set<int> sx,sy;
    REP(i,E){
        int x,y; cin>>x>>y;
        inst.add_edge(x,y+110,1);
        sx.insert(x);
        sy.insert(y+110);
    }
    
    for(auto itr=sx.begin();itr!=sx.end();itr++){
        inst.add_edge(250,*itr,1);
    }
    
    for(auto itr=sy.begin();itr!=sy.end();itr++){
        inst.add_edge(*itr,260,1);
    }
    
    cout<<inst.getmax(250,260)<<endl;
    
    return 0;
}

Measured memory_bytes: 3228
import sys


def main():
    input = sys.stdin.buffer.readline
    N, M = map(int, input().split())
    skip = (N // 2) // 2 + 1 if N % 2 == 0 else None
    count = 0
    left, right = 0, N + 1
    while count < M:
        left += 1
        if left == skip:
            continue
        right -= 1
        print(left, right)
        count += 1


if __name__ == '__main__':
    main()


Measured memory_bytes: 9296
N,K=list(map(int,input().strip().split(" ")))
H=list(map(int,input().strip().split(" ")))
dp=[0]+[10**10]*(N-1)
for i in range(1,N):
    temp=0
    for j in range(i-K,i):
        if j>=0:
            dp[i]=min(dp[i],dp[j]+abs(H[i]-H[j]))
print(dp[-1])


Measured memory_bytes: 52980
#include<iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,x ;
  cin >> n >> x;
  int m[n];
  int ans = n ;
  int sum = 0 ;
  int min = 1001 ;

  for(int i=0;i<n;i++){
    cin >> m[i];
    sum+=m[i];
    if(min>m[i]) min = m[i] ;
  }
  int left = x-sum;
  
  while((left-min)>=0){
    left-=min;
    ans++ ;
  }  
  cout << ans << endl ;
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string.h>

using namespace std;

vector<int> sortStr(vector<string> strs, vector<int> nums){
    int len = strs.size();
    //cout << len << endl;
    vector<int> index;

    for(int i=0;i<len;i++){
        index.push_back(i);
    }

    for(int i=0;i<len;i++){
        for(int j=i+1;j<len;j++){
            if(strs[i] > strs[j]){
                swap(index[i], index[j]);
                swap(strs[i], strs[j]);
                swap(nums[i], nums[j]);
            }/*else if(strs[i] == strs[j] && nums[i] < nums[j]){
                swap(index[i], index[j]);
                swap(strs[i], strs[j]);
                swap(nums[i], nums[j]);
            }*/
        }
    }

    for(int i=0;i<len;i++){
        for(int j=i+1;j<len;j++){
            //cout << strs[i] << " " << strs[j] << endl;
            if(strs[i] == strs[j] && nums[i] < nums[j]){
                swap(index[i], index[j]);
                swap(strs[i], strs[j]);
                swap(nums[i], nums[j]);
            }
        }
    }

    return index;
}

int main(){
    vector<string> cities;
    vector<int> points;

    int N, P;
    string S;
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> S >> P;
        cities.push_back(S);
        points.push_back(P);
    }

    vector<int> dic = sortStr(cities, points);

    for(int i=0;i<N;i++){
        cout << dic[i]+1 << endl;
        //cout << cities[dic[i]] << points[dic[i]] << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int x1,y1,x2,y2;
  cin >> x1 >> y1 >> x2 >> y2;
  
  int x12 , y12 , x23 , y23 , x3 , y3 , x4 , y4 ;
  
  x12 = x2 - x1 ;
  y12 = y2 - y1 ;
  
  x23 = -1 * y12;
  y23 = x12;
  
  x3 = x2 + x23;
  y3 = y2 + y23;
  x4 = x1 + x23;
  y4 = y1 + y23;
  
  cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n, k;
    cin >> n >> k;
    VI a(n);
    REP(i,n) cin >> a[i];
    sort(ALL(a));
    reverse(ALL(a));
    int ans = 0;
    REP(i,k) ans += a[i];
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
mod=10**9+7
f=[1]
for i in range(10**5+7):f+=[f[-1]*(i+1)%mod]
def comb(a,b):return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod

n,k=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=1)
ans=0
for i in range(n-k+1):
  ans+=(a[i]-a[n-1-i])*comb(n-1-i,k-1)
  ans%=mod
print(ans)

Measured memory_bytes: 18544
def primes(n):
    sieve = [True] * n
    for i in range(3,int(n**0.5)+1,2):
        if sieve[i]:
            sieve[i*i::2*i]=[False]*((n-i*i-1)//(2*i)+1)
    return [2] + [i for i in range(3,n,2) if sieve[i]]

mx = 10**5
ps = primes(mx)

valid = [0]*(mx+1)

for i in range(3,mx,2):
    if i in ps and (i+1)//2 in ps:
        valid[i] = 1

from itertools import accumulate
acc = list(accumulate(valid))

q,*lr = [list(map(int, s.split())) for s in open(0)]

for l,r in lr:
    print(acc[r] - acc[l-1])

Measured memory_bytes: 92612
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
signed main(){
int a,b;
  cin>>a>>b;
 
    
  int c=0;
   if(a==1&&b==1)
     c+=400000;
   if(a==1)
     c+=300000;
  if(a==2)
    c+=200000;
  if(a==3)
    c+=100000;
  if(b==1)
    c+=300000;
  if(b==2)
    c+=200000;
  if(b==3)
    c+=100000;
  cout<<c<<endl;
    
}


Measured memory_bytes: 256
// E - Sequence Decomposing
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
	ios::sync_with_stdio(false); cin.tie(0);
	int n;
	cin >> n;
	multiset<int> s;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		if (s.size() == 0) {
			s.insert(x);
			continue;
		}
		multiset<int>::iterator it = s.lower_bound(x);
		if (it == s.begin()) {
			s.insert(x);
		} else {
			it--;
			if (*it == x) {
				s.insert(x);
			} else {
				s.erase(it);
				s.insert(x);
			}
		}
	}

	cout << s.size() << endl;

	return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;

int a[1000], used[1000], b[300][300], used2[1000];
vector<int> G[300];
void dfs(int u){
	if(used[u])return;
	used[u] = 1;
	rep(i,G[u].size()){
		dfs(G[u][i]);
	}
}

void dfs2(int u, int R, int t){
	if(used2[u])return;
	used2[u] = 1;
	int i = u;
	rrep(j,R){
		if(i+j >= t){b[i][t] = 1;dfs2(t, R, t);continue;}
		if(i+j+a[i+j] < 0){b[i][0] = 1;dfs2(0, R, t);continue;}
		if(i+j+a[i+j] >= t){b[i][t] = 1;dfs2(t, R, t);continue;}
		b[i][i+j+a[i+j]] = 1;dfs2(i+j+a[i+j], R, t);
	}
}

void init(){
	rep(i,300)rep(j,300)b[i][j] = 0;
	fill(used2, used2+1000, 0);
	fill(used, used+1000, 0);
	rep(i,300)G[i].clear();
}

signed main(){
	while(1){
		int R, n;
		scanf("%lld", &R);
		if(R == 0)break;
		scanf("%lld", &n);
		rrep(i,n)scanf("%lld", &a[i]);
		int s = 0, t = n+1;
		init();
		dfs2(0, R, t);
		rep(i,t+1)rep(j,t+1){if(b[j][i])G[i].pb(j);}
		dfs(t);
		
		int ans = 1;
		rep(i,t+1)if(used[i] != used2[i])ans = 0;
		printf("%s\n", ans ? "OK" : "NG");
	}
	return 0;
}





Measured memory_bytes: 3944
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cctype>
using namespace std;

namespace zyt
{
	const int N = 21, S = 1 << N | 13;
	int n, dp[N][S], ans[S], first[S];
	bool check(const int a, const int p)
	{
		return a & (1 << p);
	}
	void init()
	{
		first[0] = -1;
		for (int i = 1; i <= N; i++)
			for (int j = 1 << (i - 1); j < (1 << i); j++)
				first[j] = i - 1;
	}
	int work()
	{
		init();
		int k;
		scanf("%d%d", &n, &k);
		for (int i = 0; i <= n; i++)
		{
			static char str[S];
			scanf("%s", str);
			for (int j = 0; j < (1 << i); j++)
				dp[i][j | (1 << i)] = (str[j] == '1');
		}
		for (int i = n; i >= 0; i--)
			for (int j = 1; j < (1 << (n + 1)); j++)
			{
				if (!dp[i][j])
					continue;
				int p = first[j];
				int s1 = (j ^ (1 << p)) >> i, s2 = (j ^ (1 << p)) & ((1 << i) - 1);
				if ((p = first[~s2 & ((1 << i) - 1)]) != -1)
					dp[p][((j >> i << 1) << p) | (s2 & ((1 << p) - 1))] += dp[i][j];
				if ((p = first[s2]) != -1)
					dp[p][(((j >> i << 1) | 1) << p) | (s2 & ((1 << p) - 1))] += dp[i][j];
				ans[j >> i] += dp[i][j];
			}
		int res = 0;
		for (int i = 1; i < (1 << (n + 1)); i++)
			if (ans[i] >= k && first[i] > first[res])
				res = i;
		for (int i = first[res] - 1; i >= 0; i--)
			putchar(check(res, i) ? '1' : '0');
		return 0;
	}
}
int main()
{
	return zyt::work();
}

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

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

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N = I()
a = IL()
P(sum(a)-N)

Measured memory_bytes: 39792
//be name khoda
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll n;

int main()
{
    cin>> n;
    
    if(n == 1e18)
    {
    	cout<< 0 <<" "<< 0 <<" "<< 1000000000<<" "<< 0 <<" "<< 0 <<" "<< 1000000000;
    	return 0;
	}

    ll p = 1e9;

    ll x = p - n % p;

	ll x1 , x2 , y1 , y2;

	x1 = 1;
	y2 = x;
	x2 = p;
	y1 = (n + x1 * y2) / x2;

	cout<< 0 <<" "<< 0 <<" "<< x1 <<" "<< y1<<" "<< x2 <<" "<< y2;
}












Measured memory_bytes: 256
#include<stdio.h>
main(){
  int a,b,c,tmp;
  scanf("%d %d %d",&a,&b,&c);
  if(a>b){
    tmp=a;
    a=b;
    b=tmp;
  }
  if(b>c){
    tmp=b;
    b=c;
    c=tmp;
  }
  if(a>b){
    tmp=a;
    a=b;
    b=tmp;
  }
  printf("%d %d %d\n",a,b,c);
  return 0;
}


Measured memory_bytes: 2032
N = int(input())

import collections
a = list(map(int,input().split()))
b = [[0] * 3 for i in range(N)]
A = [] * 3 * N
for i in range(len(a)):
    b[i][0] = a[i] - 1
    b[i][1] = a[i]
    b[i][2] = a[i] + 1
    A.append(a[i] - 1)
    A.append(a[i])
    A.append(a[i] + 1)

c = collections.Counter(A)
ans = c.most_common()[0][1]
print(ans)


Measured memory_bytes: 46940
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    string s;
    cin >> s;
    bool a= false;
    for(int i = 0;i < s.size();i++){
        for(int j = i+1;j < s.size();j++){
            if(s[i] == s[j]){
                a = true;
                break;
                break;
            }
            
            
            
        }
    }
    if(a){
        cout << "no" << endl;
    }else{
        cout << "yes" << endl;
    }
    
    
}    

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long h = in.nextInt();
            long w = in.nextInt();
            long minDiff = Long.MAX_VALUE;

            for (int y = 1; y < h; y++) {
                long s1 = w * y;

                long s2 = (h - y) * (w >> 1);
                long s3 = (h - y) * ((w + 1) >> 1);
                long maxs = Math.max(Math.max(s1, s2), s3);
                long mins = Math.min(Math.min(s1, s2), s3);
                minDiff = Math.min(minDiff, maxs - mins);

                s2 = ((h - y) >> 1) * w;
                s3 = ((h - y + 1) >> 1) * w;
                maxs = Math.max(Math.max(s1, s2), s3);
                mins = Math.min(Math.min(s1, s2), s3);
                minDiff = Math.min(minDiff, maxs - mins);
            }

            long t = h;
            h = w;
            w = t;
            for (int y = 1; y < h; y++) {
                long s1 = w * y;

                long s2 = (h - y) * (w >> 1);
                long s3 = (h - y) * ((w + 1) >> 1);
                long maxs = Math.max(Math.max(s1, s2), s3);
                long mins = Math.min(Math.min(s1, s2), s3);
                minDiff = Math.min(minDiff, maxs - mins);

                s2 = ((h - y) >> 1) * w;
                s3 = ((h - y + 1) >> 1) * w;
                maxs = Math.max(Math.max(s1, s2), s3);
                mins = Math.min(Math.min(s1, s2), s3);
                minDiff = Math.min(minDiff, maxs - mins);
            }
            out.println(minDiff);
        }

    }

    static class InputReader {
        StringTokenizer st;
        BufferedReader br;

        public InputReader(InputStream is) {
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            this.br = br;
        }

        public String next() {
            if (st == null || !st.hasMoreTokens()) {
                String nextLine = null;
                try {
                    nextLine = br.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (nextLine == null)
                    return null;
                st = new StringTokenizer(nextLine);
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 21972
N=int(input())
X=input()

def pop(x): #10進数
    ret=0
    while x>0:
        ret+=x%2
        x//=2
    return ret

def solve(x): #10進数
    ret=0
    while x>0:
        pop_c=pop(x)
        x%=pop_c
        ret+=1
    return ret

mod=X.count("1") #>0
original_plus=0
original_minus=0
for i in range(N):
    if X[N-1-i]=="1":
        if mod>1:
            original_minus+=pow(2,i,mod-1)
        original_plus+=pow(2,i,mod+1)
for i in range(N):
    if X[i]=="0":
        tmp=original_plus+pow(2,N-1-i,mod+1)
        tmp%=mod+1
        print(solve(tmp)+1)
    else:
        if mod==1:
            print(0)
            continue
        tmp=original_minus-pow(2,N-1-i,mod-1)
        tmp%=mod-1
        print(solve(tmp)+1)


Measured memory_bytes: 9220
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int n;

int main(){
    INIT;
    cin >> n;
    cout << ((n + 1)/2) * (n/2) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll INF=(ll)1e9;
const ll MOD=(ll)1e9+7;
vector<int> dx={1,0,-1,0},dy={0,1,0,-1};

int main(){
  ll N;
  cin>>N;
  vector<ll> gu;
  vector<ll> ki;
  for(ll i=0;i<N;i++){
    ll a;
    cin>>a;
    if(i%2==0) gu.push_back(a);
    else ki.push_back(a);
  }
  
  if(N%2==1){
    reverse(gu.begin(),gu.end());
    for(ll i=0;i<gu.size();i++) cout<<gu[i]<<" ";
    for(ll i=0;i<ki.size();i++){
      cout<<ki[i];
      if(i!=ki.size()-1) cout<<" ";
    }
  }else{
    reverse(ki.begin(),ki.end());
    for(ll i=0;i<ki.size();i++) cout<<ki[i]<<" ";
    for(ll i=0;i<gu.size();i++){
      cout<<gu[i];
      if(i!=gu.size()-1) cout<<" ";
    }
  }
  cout<<endl;
}


Measured memory_bytes: 4456
A = input()
B = input()
C = input()
X = input()
ans = 0
for a in range(0,int(A)+1):
	for b in range(0,int(B)+1):
		for c in range(0,int(C)+1):
			total = 500*a+100*b+50*c
			if total == int(X):
				ans += 1
print(str(ans))

Measured memory_bytes: 3064
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll x, y;
	cin >> x >> y;
	if(abs(x-y) <= 1) cout << "Brown" << endl;
	else cout << "Alice" << endl;
	return 0;
}

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(begin(ret), end(ret));
    return (ret);
}


int main() {
    int N, M;
    cin >> N >> M;
    vector<long long> divs = divisor(M);
    ll ans = 1;
    for (auto d: divs) {
        if (d * N <= M) chmax(ans, d);
    }
    cout << ans << endl;
}

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

int n,x;
long long sum,ans;
map<long long,int> c;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	c[0]++;
	for (int i=1;i<=n;i++){
		cin >> x;
		sum+=x;
		ans+=c[sum];
		c[sum]++;
	}
	cout << ans << "\n";
}

Measured memory_bytes: 12800
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
#include <random>
#include <cstdint>
#include <bitset>
#include <iomanip>
#include <utility>
#include<map>
#include<functional>
using namespace std;
using ll = long long;
const int mod = 10000007;

int main() {
	ll n, a[100000];
	bool flg = true;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] % 2 == 1) {
			flg = false;
		}
	}
	if (flg)cout << "second" << endl;
	else cout << "first" << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<iomanip>
#include<sstream>
#include<cmath>
#include<bitset>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(long long int i = 1;i <=  n; i++)
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
typedef long long int ll;
typedef long double ld;
const ll INF = (1 << 31);
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
    std::fill((T*)array, (T*)(array + N), val);
}
vector<char> c = { '0','1','2','3','4','5','6','7','8','9' };

int main() {
    int n,ans = 0;
    string s; cin >>n >>s; 
    rep(i, 10) {
        rep(j, 10) {
            rep(k, 10) {
                string t;
                t += c[i]; t += c[j]; t += c[k];
                int in = 0;
                rep(l, n) {
                    if (s[l] == t[in]) in++;
                    if (in > 2) {
                        ans++;
                        break;
                    }
                }
            }
        }
    }cout << ans << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#include<stdio.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define pb                  push_back
#define arr                 vector<ll>
#define mem(x,val)          memset(x,val,sizeof(x))
#define vp                 vector<pair<ll,ll>>
#define matrix              vector<vector<ll> >
#define digit(x)            floor(log10(x))+1
#define debug(x)            cerr << #x << " is " << x << endl;
#define all(a)              a.begin(),a.end()
#define fixed               setprecision(15)
// ll dx[]={-1,1,0,0},dy[]={0,0,-1,1}; 4 Sides
//ll dx[]={-1,1,-1,1,0,0,-1,1} , dy[]={-1,1,0,0,-1,1,1,-1};    8 Sides
using namespace std;
arr read(ll n){
    arr a;
    for (ll i=0;i<n;i++){
        ll x;
        cin>>x;
        a.pb(x);
    }
    return a;
}
  int main(){
      ll n;
      cin >> n;
      string s;
      cin >> s;
      ll r=0,ans=0;
      for (ll i=0;i<s.size();i++){
          if (s[i] == 'R'){
              r++;
          }
      }
      for (ll i=0;i<r;i++){
          if (s[i] == 'W'){
              ans++;
          }
      }
      cout<<ans<<endl;
        return 0;
}


Measured memory_bytes: 3752
#include <iostream>
#define rep(i, n)   for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main(){
    int n, y;
    cin >> n >> y;
    int money[3] = {0};
    bool ok = false;
    for(int i = 0; i <= n && !ok; i++){
	money[0] = i;
	for(int j = 0; j <= n-i && !ok; j++){
	    money[1] = j;
	    if(10000*money[0]+5000*money[1]+1000*(n-(money[0]+money[1])) == y)ok=true;
	}
    }
    if(ok){
	money[2] = n - money[1] - money[0];
	printf("%d %d %d\n", money[0], money[1], money[2]);
    }else{
	printf("-1 -1 -1\n");
    }
}


Measured memory_bytes: 256
class dice:
    def __init__(self,label):
        self.top, self.front, self.right, self.left, self.rear, self.bottom \
                = label
  
    def roll(self,op):
        if   op=='N': self.top, self.front, self.bottom, self.rear = \
                                self.front, self.bottom, self.rear , self.top
        elif op=='E': self.top, self.left , self.bottom, self.right = \
                                self.left , self.bottom, self.right, self.top
        elif op=='W': self.top, self.right, self.bottom, self.left = \
                                self.right, self.bottom, self.left , self.top
        elif op=='S': self.top, self.rear , self.bottom, self.front = \
                                self.rear , self.bottom, self.front, self.top
  
    def print_top(self): print(self.top)
    def print_right(self): print(self.right)
  
    def get_label(self):
        return [self.top, self.front, self.right, self.left, self.rear, self.bottom]
 
    def compare(self, label):
        for op in 'EEENEEENEEESEEESEEENEEEN':
            if self.get_label() == label:
                return True
            self.roll(op)
        else:
            return False

if __name__=='__main__':
    n = int(input())
    L = []
    for i in range(n):
        label = list(map(int,input().split()))
        for d in L:
            if d.compare(label): break
        else:
            L.append(dice(label))
            continue
        print('No')
        break
    else:
        print('Yes')


Measured memory_bytes: 5608
#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <queue>
#define rep(i, a, n) for(int i = int(a);i < int(n);++i)
#define repe(i, a, n) for(int i = int(a);i <= int(n);++i)
#define repr(i, a, n) for(int i = int(a);i > int(n);--i)
#define reper(i, a, n) for(int i = int(a);i >= int(n);--i)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define pb push_back
#define EPS (1e-20)
#define INF 2147483647
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using namespace std;


int A, B;


bool solve(){
	if(A < B) swap(A, B);
	if(16-2*B >= 2*(A-B)) return true;
	return false;
}


int main(){
	cin >> A >> B;

	if(solve()) cout << "Yay!" << endl;
	else cout << ":(" << endl;

	return 0;
}

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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

ll res[3010];
int x, y, z, k, idx;
ll a[1005], b[1005], c[1005];

int main() {
    cin >> x >> y >> z >> k;
    for (int i = 0; i < x; ++i) {
        cin >> a[i];
    }
    for (int i = 0; i < y; ++i) {
        cin >> b[i];
    }
    for (int i = 0; i < z; ++i) {
        cin >> c[i];
    }
    sort(a, a + x, greater<ll>());
    sort(b, b + y, greater<ll>());
    sort(c, c + z, greater<ll>());
    auto sum = [](int i1, int i2, int i3) {
        return a[i1] + b[i2] + c[i3];
    };
    auto cmp = [&](iii &t1, iii &t2) {
        auto [i1, i2, i3] = t1;
        auto [j1, j2, j3] = t2;
        return sum(i1, i2, i3) < sum(j1, j2, j3);
    };
    priority_queue<iii, vector<iii>, decltype(cmp)> que(cmp);
    set<iii> seen;
    que.push({0,0,0});
    while (!que.empty() && idx < k) {
        auto tt = que.top();
        que.pop();
        auto [i1, i2, i3] = tt;
        if (seen.count(tt)) continue;
        // cout << i1 <<  ' ' << i2 << ' ' << i3 << endl;
        seen.insert(tt);

        res[idx++] = sum(i1, i2, i3);
        if (i1 < x - 1)
            que.push({i1 + 1, i2, i3});
        if (i2 < y - 1)
            que.push({i1, i2 + 1, i3});
        if (i3 < z - 1)
            que.push({i1, i2, i3 + 1});
    }
    for (int i = 0; i < k; ++i) {
        cout << res[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 3932
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define inf 1000000000000000
#define mod 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}

signed main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << a + b + c - max({ a,b,c }) << endl;

	return 0;
}


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

int main() {
  int a, b;
  cin >> a >> b;
  if(a > 8 || b > 8){
    cout << ":(";
  }
  else{
    cout << "Yay!";
  }
  return 0;
}

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

typedef long long ll;

bool arr[21][21];
ll memo[21][(1<<21)];
int n;

ll MATCH(int i, int mask)
{
	if(i == n)
	return 1;
	if(memo[i][mask] != -1)
	return memo[i][mask];
	ll ans = 0;
	for(int j=0;j<n;j++)
	{
		if((!(mask & (1<<j))) && arr[i][j])
		ans = ((ans%MOD) + (MATCH(i+1, mask | (1<<j))%MOD))%MOD;
	}
	memo[i][mask] = ans;
	return ans;	
}

int main(void)
{
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout.tie(NULL);
	memset(memo, -1, sizeof(memo));
	std::cin>>n;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		std::cin>>arr[i][j];	
	}
	ll ans = MATCH(0, 0)%MOD;
	std::cout<<ans<<"\n";
	return 0;
}

Measured memory_bytes: 344448
/*
      author  : nishi5451
      created : 14.08.2020 18:01:49
*/

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


int main(){
    int a,b,k;
    cin >> a >> b >> k;
    if(2*k >= b-a+1){
        for(int i=a; i<=b; i++){
            cout << i << endl;
        }
        return 0;
    }
    for(int i=a; i<a+k; i++){
        cout << i << endl;
    }
    for(int i=b-k+1; i<=b; i++){
        cout << i << endl;
    }
    return 0;
}

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

int main()
{
    string s;cin>>s;
    int i;
    bool search=true;
    for(i=0;i<s.length()-1;i++)
    {
        if(s.at(i)==s.at(i+1))
        {
            cout<<i+1<<' '<<i+2<<endl;
            search=false;
            break;
        }
    }
    if(search)
    {
        for(i=0;i<s.length()-2;i++)
        {
            if(s.at(i)==s.at(i+2))
            {
                cout<<i+1<<' '<<i+3<<endl;
                search=false;
                break;
            }
        }
    }
    if(search)
    {
        cout<<"-1 -1"<<endl;
    }
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;
long long n,c=0,l=0,x;
int main() {
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> x;
        if(x%4==0){
            c++;
        }else{
            if(x%2==0){
                l++;
            }
        }
    }
    if((c>=n/2)||(2*c+l>=n)){
        cout << "Yes";
    }else{
        cout << "No";
    }
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
using namespace std;

int main(){
  char ch;
  int alpha[26]={0};
  int i;

  /*for(int j=0; j<26; j++){
    alpha[j]=0;
  }*/

  while(scanf("%c", &ch)!=EOF){
    if(isalpha(ch)){
      ch=toupper(ch);
      i=ch-'A';
      alpha[i]+=1;
    }
  }
  //cout<<"done";
  for(int j=0; j<26; j++){
    printf("%c : %d\n", j+'a', alpha[j]);
  }

  return 0;
}

Measured memory_bytes: 3224
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    int N, M;
    vector<int> S, T;
    vector<vector<ll>> dp;

    void input() {
        cin >> N >> M;
        S.resize(N);
        T.resize(M);
        dp.resize(N + 1, vector<ll>(M + 1, -1));

        rep(i, 0, N) cin >> S[i];
        rep(i, 0, M) cin >> T[i];


    }

    ll calc(int n, int m) {
        if (dp[n][m] != -1) return dp[n][m];
        if (n == 0 || m == 0) return 1;

        ll ret = (calc(n - 1, m) + calc(n, m - 1)) % MOD;
        if (S[n - 1] != T[m - 1]) {
            ret -= calc(n - 1, m - 1);
            ret %= MOD;
            if (ret < 0) ret += MOD;
        }

        return dp[n][m] = ret;
    }

    void solve() {
        input();

        ll ans = calc(N, M);
        cout << ans << endl;

    }
};


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

    Solve().solve();


    return 0;
}


Measured memory_bytes: 32512
// Marcin Knapik
#include<bits/stdc++.h>
// #pragma GCC optimize("O3")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
using namespace std;

// #include <ext/pb_ds/assoc_container.hpp> // order_of_key
// #include <ext/pb_ds/tree_policy.hpp> // find by order
// using namespace __gnu_pbds; 
// #define ordered_set tree< int , null_type,less< int >, rb_tree_tag,tree_order_statistics_node_update>  

// const ll MAX_LL = 0xFFFFFFFFFFFFFFFF;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// #define losuj(a, b) uniform_int_distribution<ull>(a, b)(rng)

typedef long double             ld;
typedef long long               ll;
typedef unsigned long long      ull;
typedef pair<ll, ll>            pll;
typedef pair<int, int>          ii;
typedef vector<int>             vi;
typedef vector<ii>              vii;
typedef vector<vi>              vvi;
typedef vector<vector<ii>>      vvii;
typedef vector< ll >            vll;
typedef vector< pll >           vpll;

#define boost                   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(a)                   (int)(a).size()
#define pb                      push_back
#define all(c)                  (c).begin(), (c).end()
#define rall(c)                 (c).rbegin(), (c).rend()
#define FOR(i, a)               for (int i = 0; i < (a); i++)
#define f                       first
#define s                       second

template <class T> inline bool setmin(T &a, T b){if (a > b)return a = b, 1;return 0;}
template <class T> inline bool setmax(T &a, T b){if (a < b)return a = b, 1;return 0;}

template<class T> inline T fast(T a,T b,T mod) {ll res = 1; while(b){if(b&1) res = (res*a)%mod;a = (a*a)%mod;b >>= 1;}return res;}
template<class T> inline T russian(T a, T b, T mod) {ll res = 0; while(b){if(b&1) res = (res + a)%mod; a = (a+a)%mod; b>>=1;}return res;}
template<class T> istream &operator>>(istream &os, vector<T> &container){for (auto &u : container)os >> u;return os;}
template<class T> ostream &operator<<(ostream &os, const vector<T> &container){for (auto &u : container)os << u << " ";return os;}
template<class T> inline T gcd(T a, T b) { while (b)swap(a %= b, b); return a; }

const ll INF = 1e9 + 7;
const ll mod = 1186782211;
// const ll BIG_INF = 1000000000000000000;
const ll BIG_INF = 15000000000000;
const ll N = 1e6+7;
const ll T = 1<<20;
const ll Hope = 1000000123;

ll n, m, k, q;	

int main(){
	boost;

	cin >> n >> m;

	cout << n * (n-1) / 2 + m * (m-1) / 2;
}

Measured memory_bytes: 764
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

std::vector<int> getDigArr(int N);
bool check(std::vector<int> D, std::set<int> num);

int main(){
    std::set<int> num{0,1,2,3,4,5,6,7,8,9};
    int N,K,n,M,d;
    std::cin >> N >> K;
    for(int i=0;i<K;i++){
      scanf("%d",&n);
      num.erase(n);
    }

    //for(auto x:num) cout << x << endl;
    std::vector<int> D;
    while(true){
      D = getDigArr(N);
      if(check(D,num)){
        std::cout << N << std::endl;
        return 0;
      }
      N++;
    }
}

std::vector<int> getDigArr(int N){
  std::vector<int> v;
  while(N>0){
    v.push_back(N%10);
    N /= 10;
  }
  return v;
}

bool check(std::vector<int> D, std::set<int> num){
    int i = D.size();
    int s;
    for(auto d:D){
      s += num.count(d);
    }
    return ( i==s? true:false);
}


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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int n, m;
    cin >> n >> m;
    vector<P> v(n);
    for(int i = 0; i < n; ++i) {
        cin >> v[i].F >> v[i].S;

    }

    vector<P> c(m);
    for(int i = 0; i < m; ++i){
        cin >> c[i].F >> c[i].S;

    }

    for(int i = 0; i < n; ++i) {
        int mn = INF;
        int p;
        for(int j = 0; j < m; ++j) {
            if(mn > abs(v[i].F - c[j].F) + abs(v[i].S - c[j].S)) {
                mn = abs(v[i].F - c[j].F) + abs(v[i].S - c[j].S);
                p = j + 1;

            }
        }
        cout << p << endl;

    }
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <typeinfo>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    ll n, sum = 0;

    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        sum += (i % 3 != 0 && i % 5 != 0) ? i : 0;
    }
    cout << sum << endl;
}

Measured memory_bytes: 3632
//package Contest169;


import java.util.*;
import java.io.*;
import java.math.*;

import java.math.*;
class Main {
    public static void main(String args[] ) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        //Start here:
        //System.out.println(Long.MAX_VALUE);
        //.out.println(Integer.MAX_VALUE);
        //System.out.println("Hello");
        
        Scanner sc=new Scanner(System.in);
        
        int t=sc.nextInt();
        
        long a[]=new long[t];
        
        
        for(int i=0;i<t;i++)
        {
        	a[i]=sc.nextLong();
        }
        
        //BigInteger b=new BigInteger("1000000000000000000");
        //9223372036854775807
        //1000000000000000000
        //BigInteger ans=BigInteger.ONE;
        long max=1000000000000000000L;
        long ans=1L;
        boolean flag=true;
        Arrays.sort(a);
        //System.out.println(Long.MAX_VALUE);
        //System.out.println(Integer.MAX_VALUE);
        //System.out.println("Hello");
        for(int i=0;i<t;i++)
        {
        	if(a[i]==0)
        	{
        		System.out.println(0);
        		return;
        	}
        	if(ans>Long.MAX_VALUE/a[i])
        	{
        		System.out.println(-1);
        		return;
        	}
        	ans=(long)ans*a[i];
        	
        	if(ans==0)
        	{
        		System.out.println(0);
        		return;
        	}
        	if(ans>max)
        	{
        		System.out.println(-1);
        		return;
        	}
        	/*
        	BigInteger bb=new BigInteger(Long.toString(a[i]));
        	
        	//System.out.println(ans);
        	ans=ans.multiply(bb);
        	
        	if(ans.compareTo(BigInteger.ZERO)==0)
        	{
        		System.out.println(0);
        		return;
        	}
        	if(ans.compareTo(BigInteger.ZERO)<0)
        	{
        		System.out.println(-1);
        		return;
        	}*/
        }
        System.out.println(ans);
  

    }
}

Measured memory_bytes: 62096