akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,n) for(lli i=0;i<n;i++)
#define repb(i,n) for(lli i=n-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
#define all(X) X.begin(),X.end()
#define iterate(X) for(it=X.begin();it!=X.end();it++)
lli combi(lli n,lli k)
{
    lli ans=1;
    k=k>n-k?n-k:k;
    lli j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli findlcm(vector <lli> arr, lli n)
{
    lli ans = arr[0];
    for (lli i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));

    return ans;
}
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
lli gcdExtended(lli a, lli b, lli *x, lli *y);
lli modInverse(lli b, lli m)
{
    lli x, y;
    lli g = gcdExtended(b, m, &x, &y);
    if (g != 1)
        return -1;
    return (x%m + m) % m;
}
lli modDivide(lli a, lli b, lli m)
{
    a = a % m;
    lli inv = modInverse(b, m);
    return (inv * a) % m;
}
lli gcdExtended(lli a, lli b, lli *x, lli *y)
{
    if (a == 0)
    {
        *x = 0, *y = 1;
        return b;
    }
    lli x1, y1;
    lli gcd = gcdExtended(b%a, a, &x1, &y1);
    *x = y1 - (b/a) * x1;
    *y = x1;
    return gcd;
}
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,k;
    cin>>n>>k;
    vector <lli> arr;
    lli x;
    rep(i,n){
    	cin>>x;
    	arr.pb(x);
	}
	sort(all(arr));
	lli ans=0;
	rep(i,k){
		ans+=arr[i];
	}
	cout<<ans;
	
    return 0;
}


Measured memory_bytes: 3692
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
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;}
template <class T, class U>ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}
template <class T>ostream& operator<<(ostream& os, const vector<T>& v) {
	os << "{";
	rep(i, v.size()) {
		if (i) os << ",";
		os << v[i];
	}
	os << "}";
	return os;
}
template <class T, class U>istream& operator>>(istream& is, pair<T, U>& p) {
	is >> p.first >>p.second ;
	return is;
}
template <class T>istream& operator>>(istream& is,  vector<T>& v) {
	rep(i, v.size()) {
		is >> v[i];
	}
	return is;
}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n;
	int ans=1;
	cin >>n;
	V a(n);
	cin >> a;
	int comp = 0;
	ll last = 0;
	rep(i,n){
	
		if(i==0){
			last = a[i];
			continue;
		}
		if(comp==0){
			if (last > a[i]) {
				comp = -1;
			}else if(last < a[i]){
				comp = 1;
			}
		}else{
			if(comp==1 and last >a[i]){
		//		clog << "|" << endl;
				ans++;
				comp = 0;
			}else if(comp==-1 and last < a[i]){
		//		clog << "|" << endl;
				ans++;
				comp = 0;
			}
		}
	//	clog << i << endl;
		last = a[i];

	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3892
import java.util.*;


public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int[] l = new int[m];
        int[] r = new int[m];
        for(int i = 0; i < m; i++){
            l[i] = scan.nextInt();
            r[i] = scan.nextInt();
        }
        int min = 0;
        int max = (int)Math.pow(10, 5) + 1;
        for(int i = 0; i < m; i++){
            if(min < l[i]) min = l[i];
            if(max > r[i]) max = r[i];
        }
        System.out.println(max >= min ? max - min + 1 : 0);
        scan.close();
    }
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

// {{{
template<typename T>
void printmatrix(vector<vector<T> > ar){
    for (int i = 0; i < (int)ar.size(); i++) {
        for (int j = 0; j < (int)ar[0].size(); j++) {
            cout << ar[i][j];
        }
        cout << endl;
    }
}

template<typename T>
void printvector(vector<T> vec){
    for (int i = 0; i < (int)vec.size(); i++) {
        cout << vec[i] << endl;
    }
}

template<typename T>
void unique(vector<T>& vec){
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
}

template<typename T>
vector<T> cumsum(vector<T> vec){
    vector<T> newvec((T)vec.size());
    int tmp = 0;
    for (int i = 0; i < (int)vec.size(); i++) {
        tmp += vec[i];
        newvec[i] = tmp;
    }

    return newvec;
}

template<typename T>
T digitsum(T x){
    T y=0;
    while(x){
        y += x % 10;
        x /= 10;
    }

    return y;
}
// }}}
/* vim:set foldmethod=marker: */

int main(int argc, char const* argv[])
{
    string s;
    cin >> s;

    for (int i = 0; i < sz(s); i++) {
        if ((i+1) & 1) {
            cout << s[i];
        }
    }
    cout << endl;
    return 0;
}

// sortの仕方
// int a[N];
// array<int,N> ar;
// vector<int> v;
//
// sort(a, a+N); // 配列
// sort(ar.begin(), ar.end()); // array
// sort(v.begin(), v.end()); // vector 昇順
// sort(v.begin(), v.end(), greater<int>()); // 降順

// Template
// template <class T>
// T foomax(T x, T y){
//   if (x > y){
//     return x;
//   }else{
//     return y;
//   }
// }

// string を int に変換 stoi("1010")
// int を string に変換 to_string(1010)


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

bool d(int a){
        if(a%2==1)return false;
        if(a%5==0||a%3==0)return false;
        else return true;
}

int main(){

        int n;
        cin >>n;
        int a[n-1];
        for(int i=0;i<n;i++){
                cin>>a[i];
                if(d(a[i])){
                        cout<<"DENIED";
                        break;
                }
                if(i==n-1){
                        cout<<"APPROVED";
                }
        }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int mass,k,a,b,c;
    cin>>a;
    b = a%10;
    if(b==0){
    b=10;
    mass = a-a%10;
    }
    else
    mass  = a-a%10+10;
    for(int i=0;i<4;i++){
        cin>>a;
        if(a%10==0){
        mass=mass+a;
        continue;
        }
        else if(a%10<b)
        b = a%10;
        mass = mass + a - a%10+10;
    }
    if(b!=10)
        mass  = mass-10+b;
    cout<<mass<<endl;
    
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
int n;
double dp[310][310][310];
double rec(double a,double b,double c){
  if(dp[(int)a][(int)b][(int)c]>=0) return dp[(int)a][(int)b][(int)c];
  double res=0.;
  if(a>0) res+=rec(a-1,b,c)*a/(a+b+c);
  if(b>0) res+=rec(a+1,b-1,c)*b/(a+b+c);
  if(c>0) res+=rec(a,b+1,c-1)*c/(a+b+c);
  res+=n/(a+b+c);
  return dp[(int)a][(int)b][(int)c]=res;
}
int main(){
  cin>>n;
  int a[310];
  rep(i,n){
    cin>>a[i];
  }
  double ca=0,cb=0,cc=0;
  rep(i,n){
    if(a[i]==1){
      ca++;
    }
    else if(a[i]==2){
      cb++;
    }
    else {
      cc++;
    }
  }
  fill(dp,-1);
  dp[0][0][0]=0.;
  double res=rec(ca,cb,cc);
  printf("%.10f\n",res);

  

  return 0;
}


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

int c[6], cost[110][1 << 6], m, n, k, d;
struct st {
	int a, b, c;
}v[600];
int num(string s) {
	if (s == "H")return m + n;
	if (s == "D")return m + n + 1;
	if (s[0] == 'C')return s[1] - '1';
	return stoi(s.substr(1)) - 1 + m;
}
int main() {
	while (scanf("%d%d%d%d", &m, &n, &k, &d), m) {
		rep(i, m)scanf("%d", &c[i]);
		rep(i, d) {
			string s, t; int e; cin >> s >> t >> e; e *= k;
			int a = num(s), b = num(t);
			v[i * 2] = { a,b,e };
			v[i * 2 + 1] = { b,a,e };
		}
		memset(cost, 0x3f, sizeof(cost));
		cost[m + n][0] = 0;
		bool update = true;
		while (update) {
			update = false;
			rep(j, 2 * d)rep(i, 1 << m) {
				st&e = v[j];
				if (cost[e.a][i] == INF)continue;
				if (e.b < m) {
					if (!(i >> e.b & 1) && cost[e.b][i | 1 << e.b] > cost[e.a][i] + e.c - c[e.b])
						cost[e.b][i | 1 << e.b] = cost[e.a][i] + e.c - c[e.b], update = true;
				}
				else if (cost[e.b][i] > cost[e.a][i] + e.c)
					cost[e.b][i] = cost[e.a][i] + e.c, update = true;
			}
		}
		int Min = INF;
		rep(i, 1 << m)Min = min(Min, cost[m + n + 1][i]);
		printf("%d\n", Min);
	}
}

Measured memory_bytes: 3340
N,M= map(int, input().split())
A = list(map(int, input().split())) 
 
all = sum(list(A))
p = 1/(4*M)*all
cnt = 0
 
for i in A:
  if i >= p:
    cnt += 1
 
if cnt >= M :
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3064
# coding: utf-8
# マージソート
INFTY = int(1E20)
count = 0


def merge(A, left, mid, right):
    global INFTY
    global count

    L = [i for i in A[left:mid]]
    R = [i for i in A[mid:right]]

    L.append(INFTY)
    R.append(INFTY)

    idx_L = 0
    idx_R = 0
    for idx in range(left, right):
        count += 1
        if L[idx_L] <= R[idx_R]:
            A[idx] = L[idx_L]
            idx_L += 1
        else:
            A[idx] = R[idx_R]
            idx_R += 1


def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)
    else:
        return


if __name__ == "__main__":
    n = int(input())
    A = [int(i) for i in input().split()]

    mergeSort(A, 0, n)

    print(' '.join([str(i) for i in A]))

    print(count)



Measured memory_bytes: 66816
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int[] n = new int[s.length()];
		for(int i = 0; i < s.length(); i++) {
			n[i] = Character.getNumericValue(s.charAt(i));
		}
		
		char[] op = {'-', '+'};
		char[] tempOp = {'-', '-', '-'};
		
		for(int i = 0; i < 1 << 3; i++) {	
			
			for(int j = 0; j < 3; j++) {
				
				if((i >> j & 1) == 1) {
					tempOp[j] = '+';
				}
				
			}
			
			String str = String.valueOf(tempOp);
			int temp = 0;
			switch(str) {
			case "---":
				temp = n[0] - n[1] - n[2] - n[3];
				break;
			case "--+":
				temp = n[0] - n[1] - n[2] + n[3];
				break;
			case "-+-":
				temp = n[0] - n[1] + n[2] - n[3];
				break;
			case "-++":
				temp = n[0] - n[1] + n[2] + n[3];
				break;
			case "+--":
				temp = n[0] + n[1] - n[2] - n[3];
				break;
			case "+-+":
				temp = n[0] + n[1] - n[2] + n[3];
				break;
			case "++-":
				temp = n[0] + n[1] + n[2] - n[3];
				break;
			case "+++":
				temp = n[0] + n[1] + n[2] + n[3];
				break;
			}
			
			if(temp == 7) {
				break;
			}
			
			for(int j = 0; j < 3; j++) {
				tempOp[j] = '-';
			}
			
		}
		
		System.out.println(n[0] + "" + tempOp[0] + "" + n[1] + "" + tempOp[1] + "" + n[2] + "" + tempOp[2] + "" + n[3] + "=" + "7");
		
	}

}


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

int main() {
	string s1,s2;
	cin>>s1>>s2;
	for(int i=0;i<3;i++)
	if(s1[i]!=s2[2-i])
	{
		cout<<"NO";
		return 0;
	}
	cout<<"YES";
	
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    multiset<int> st;
    int a[100010];
    set<int> st2;
    rep(i, N) {
        cin >> a[i];
        st.insert(a[i]);
        st2.insert(a[i]);
    }
    if (st2.size() > 3) {
        cout << "No" << endl;
        return 0;
    }
    int num0 = a[0];
    int num1 = a[1];
    if (st2.size() > 1) {
        auto itr = st2.begin();
        num0 = *itr;
        itr++;
        num1 = *itr;
    }
    int s = num0;
    //dump(num0);
    //dump(num1);
    int t = num0 ^ num1;
    st.erase(st.find(num0));
    st.erase(st.find(num1));
    rep(i, N - 1) {
        if (i == N - 2) {
            if (t != s) {
                cout << "No" << endl;
                return 0;
            }
            break;
        }
        auto itr = st.find(t);
        if (itr == st.end()) {
            cout << "No" << endl;
            return 0;
        }
        
        st.erase(itr);
        num0 = num1;
        num1 = t;
        t = num0 ^ num1;
        //cout << t << endl;
    }
    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 7808
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
            out.flush();
        }
    }

    void solve(InputReader in, PrintWriter out) {
        int r = in.nextInt();
        int d = in.nextInt();
        int x = in.nextInt();

        int next = r * x - d;
        for (int i = 0; i < 10; i++) {
            out.println(next);
            next = r * next - d;
        }

    }
}

class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

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

    long nextLong() {
        return Long.parseLong(this.sc.next());
    }

    double nextDouble() {
        return Double.parseDouble(this.sc.next());
    }

    @Override
    public void close() {
        this.sc.close();
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz size()
#define ll long long
#define all(_v) _v.begin(), _v.end()

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll x;
	cin >> x;
	cout << x / 500 * 1000 + (x - x / 500 * 500) / 5 * 5;
	return 0;
}


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

struct Node{
    int parent = -1;
    int left;
    int right;
    int depth  = 0;
    int height = 0;
};
int find_root(const vector<Node>& n){
    for (int i = 0; i < n.size(); i++) {
        if (n[i].parent == -1) return i;
    }
}
void calc_depth(vector<Node>& n, int i){
    if (i == -1) return;
    n[i].depth = n[n[i].parent].depth + 1;
    calc_depth(n, n[i].left );
    calc_depth(n, n[i].right);
}
int calc_height(vector<Node>& n, int i){
    if (i == -1) return -1;
    return n[i].height =
      max(calc_height(n, n[i].left), calc_height(n, n[i].right)) + 1;
}
int sibling(const vector<Node>& n, int i){
    int p = n[i].parent;
    if (p == -1) return -1;
    if (n[p].left == i) return n[p].right;
    return n[p].left;
}
int degree(const vector<Node>& n, int i){
    if (n[i].left == -1 && n[i].right == -1) return 0;
    if (n[i].left != -1 && n[i].right != -1) return 2;
    return 1;
}
string type(const vector<Node>& n, int i){
    if (n[i].parent == -1) return "root";
    if (n[i].left == -1 && n[i].right == -1) return "leaf";
    return "internal node";
}
int main(){
    int n;
    cin >> n;
    vector<Node> node(n);
    for (int i = 0; i < n; i++) {
        int id;
        cin >> id;
        cin >> node[id].left;
        cin >> node[id].right;
        node[node[id].left ].parent = id;
        node[node[id].right].parent = id;
    }
    int root = find_root(node);
    calc_depth(node, node[root].left );
    calc_depth(node, node[root].right);
    calc_height(node, root);
    for (int i = 0; i < n; i++) {
        cout << "node " << i;
        cout << ": parent = " << node[i].parent;
        cout << ", sibling = " << sibling(node, i);
        cout << ", degree = " << degree(node, i);
        cout << ", depth = " << node[i].depth;
        cout << ", height = " << node[i].height;
        cout << ", " << type(node, i);
        cout << endl;
    }
    return 0;
}

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

using namespace std;

bool yy(string s) {
  return true;
}

bool mm(string s) {
  return s != "00" && stoi(s) <= 12;
}

bool yymm(string s) {
  return yy(s.substr(0, 2)) && mm(s.substr(2, 2));
}

bool mmyy(string s) {
  return mm(s.substr(0, 2)) && yy(s.substr(2, 2));
}

int main() {
  string s;
  cin >> s;
  if (yymm(s) && mmyy(s)) {
    cout << "AMBIGUOUS";
  } else if (yymm(s)) {
    cout << "YYMM";
  } else if (mmyy(s)) {
    cout << "MMYY";
  } else {
    cout << "NA";
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,sum=0;
	cin>>n;
	int c[n];
	for(int i=0;i<n;i++)
	{
		cin>>c[i];
	}
	sort(c,c+n);
	for(int i=0;i<n-1;i++)
	{
		sum=sum+c[i];
	}
	if(sum>c[n-1])
	cout<<"Yes"<<endl;
	else
	cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <queue>
#include <memory>
#include <cstring>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>

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

using namespace std;
using ll = long long;
const int mod = 1e9+7;

int main(){
    set<int> st;
    int n,tmp;
    cin >> n;

    rep(i,n){
        cin >> tmp;
        if(st.count(tmp) == 0){
            st.insert(tmp);
        }else{
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;
    return 0;
}

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

int main()
{
    long long int n,i,len,cnt = 0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        len = log10(i) + 1;
        if(len%2!=0)
        {
            cnt++;
        }
    }
    cout<<cnt<<endl;

    return 0;
}


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

int main(int argc, char **argv)
{
	ll n;
  cin>>n;
  vector <ll> arr(n);
  for(ll i=0;i<n;i++) cin>>arr[i];
  ll ans=numeric_limits<int>::max();
  for(ll i=-100;i<=100;i++){
    ll sum=0;
    for(ll j=0;j<n;j++){
      sum+=pow((arr[j]-i),2);
    }
    if (sum<ans) {
      ans=sum;
    }
  }
  cout<<ans<<"\n";
	return 0;
}


Measured memory_bytes: 3528
program harlequin
  implicit none
  integer :: n, a, i
  read(*,*) n
  do i = 1, n
    read(*,*) a
    if (mod(a,2).eq.1) then
      write(*,'(a)') "first"
      stop
    end if
  end do
  write(*,'(a)') "second"
  stop
end program harlequin

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

using ll    = long long;
using ull   = unsigned long long;
using veci  = vector<int>;
using vecll = vector<ll>;
#define EPS (1e-7)
#define INF (1e9)
#define PI  (acos(-1))
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define REP(i,n) for(int i= 0;i<(int)(n);++i)
#define pb push_back

veci enum_div(int n){
	veci ret;
	ret.pb(1);
	for(int i=1;i*i<n;i++){
		if(n%i==0){
			ret.pb(i);
			if(i != n/i){ret.pb(n/i);}
		}
	}
	ret.pb(n);
	return ret;
}
int gcb(int a,int b){return ((b == 0)? a : gcb(b,a%b));}
int gcd(int a,int b){return (a*b) / gcb(a,b);}

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    if(a+b == c || a+c == b || b+c == a){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}



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

using namespace std;

void sort_vertices_dfs(
    const unordered_multimap<int, int> &G, 
    vector<int> &ans,
    unordered_set<int> &discovered,
    const int source
) {
    const auto range = G.equal_range(source);
    for (auto it = range.first; it != range.second; ++it) {
        if (discovered.count(it->second)) continue;
        discovered.insert(it->second);
        sort_vertices_dfs(G, ans, discovered, it->second);
        ans.push_back(it->second);
    }
}

int solve(const int N, const unordered_multimap<int, int> &G) {
    vector<int> ordering;
    unordered_set<int> discovered{0};
    sort_vertices_dfs(G, ordering, discovered, 0);
    ordering.push_back(0);

    vector<int> dp(N + 1, 0);

    for (auto it = ordering.cbegin(); it != ordering.cend(); ++it) {
        const auto range = G.equal_range(*it);
        for (auto jt = range.first; jt != range.second; ++jt) {
            dp[*it] = max(dp[*it], dp[jt->second] + 1);
        }
    }

    return *max_element(dp.cbegin(), dp.cend()) - 1;
}

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

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

    unordered_multimap<int, int> G;
    for (int i = 1; i <= N; ++i) {
        G.emplace(0, i);
    }

    for (int i = 0; i != M; ++i) {
        int x, y;
        cin >> x >> y;
        G.emplace(x, y);
    }

    cout << solve(N, G) << endl;

    return 0;
}


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

using namespace std;
using ll = long long;
using ld = long double;
using cd = complex<ld>;

const ll MOD = 2e5 + 3;
const ll P_ROOT = 2; //primitive root
const ld PI = acos(-1);

ll pw[MOD + 5], ipw[MOD + 5];
 
void fft(vector<cd>& a, bool invert) {
  int n = (int)a.size();
  for(int i = 1, j = 0; i < n; i++) {
    int bit = n >> 1;
    for(; j & bit; bit >>= 1) {
      j ^= bit;
    }
    j ^= bit;
    if(i < j) {
      swap(a[i], a[j]);
    }
  }
  for(int len = 2; len <= n; len <<= 1) {
    ld ang = 2 * PI / len * (invert ? -1 : 1);
    cd wlen(cos(ang), sin(ang));
    for(int i = 0; i < n; i += len) {
      cd w(1);
      for(int j = 0; j < len / 2; j++) {
        cd u = a[i + j], v = a[i + j + len / 2] * w;
        a[i + j] = u + v;
        a[i + j + len / 2] = u - v;
        w *= wlen;
      }
    }
  }
  if(invert) {
    for(auto & x : a) {
      x /= n;
    }
  }
}
 
vector<cd> conv(vector<cd> const& a, vector<cd> const& b) {
  vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
  int n = 1;
  while(n < (int)a.size() + b.size()) {
    n <<= 1;
  }
  fa.resize(n);
  fb.resize(n);
  fft(fa, false);
  fft(fb, false);
  for(int i = 0; i < n; i++) {
    fa[i] *= fb[i];
  }
  fft(fa, true);
  return fa;
}

void init() {
  ll temp = 1;
  ipw[temp] = 0;
  pw[0] = temp;
  for(int i = 1; i < MOD - 1; i++) {
    temp = (temp * P_ROOT) % MOD;
    ipw[temp] = i;
    pw[i] = temp;
  }
}

void solve() {
  init();
  int n;
  cin >> n;
  vector<int> A(MOD, 0);
  ll ans = 0;
  for(int i = 0; i < n; i++) {
    ll x;
    cin >> x;
    if(x == 0) continue;
    ans = (ans - (x * x) % MOD);
    A[ipw[x]]++;
  }
  vector<cd> Ac(MOD);
  for(int i = 0; i < MOD; i++) {
    Ac[i] = cd(A[i]);
  }
  vector<cd> Sq = conv(Ac, Ac);
  int sz = (int)Sq.size();
  for(int i = 0; i < MOD - 1; i++) {
    ll temp = 0;
    if(i < sz) temp += (ll) roundl(Sq[i].real());
    if(i + MOD - 1 < sz) temp += (ll) roundl(Sq[i + MOD - 1].real());
    ans = (ans + temp * (pw[i]));
  }
  ans /= 2;
  cout << ans << '\n';
}

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

  int TC = 1;
  for(int i = 1; i <= TC; i++) {
    solve();
  }
  
  return 0;
}

Measured memory_bytes: 52564
N = int(input())
eList = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
n = N
mod = N
numList = []
 
while n > 0:
  n, mod = divmod(n,26)
  if mod != 0:
    numList.insert(0, mod - 1)
  else:
    numList.insert(0, 25)
    n -= 1
ans =''
for num in numList:
  ans += eList[num]
print(ans)

Measured memory_bytes: 9176
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstring>
#include<queue>
#include<tuple>
#include<utility>
#include<map>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include<stdlib.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
#define MP make_pair
using Graph = vector<vector<int>>;
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int N;
	cin >> N;
	if (N < 100)
	{
		cout << 0 << endl;
		return 0;
	}
	FOR(i,1,20){
		if(N>i*105&&N<(i+1)*100){
			cout << 0 << endl;
			return 0;
		}
	}

	cout << 1 << endl;

	return 0;
}



Measured memory_bytes: 3652
import java.util.*;

class Main
{
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    
	    int a = Integer.parseInt(sc.next());
	    int b = Integer.parseInt(sc.next());
	    
	    int counter = 0;
	   
	    while(a * counter - (counter - 1) < b) {
	        ++counter;
	    }
	    System.out.println(counter);
	  
	}
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
#define int long long
int MOD = (int)1e9 + 7;
int INF = (int)2e18;
// Comment out below and program paste

// #include "UnionFind.hpp"
// #include "power.hpp"

signed main() {
    char b;
    cin >> b;
    if (b == 'A') cout << 'T' << endl;
    else if (b == 'C') cout << 'G' << endl;
    else if (b == 'G') cout << 'C' << endl;
    else if (b == 'T') cout << 'A' << endl; 
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO.Compression;
using System.IO.Pipes;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Console;
using static System.Math;
 
namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = ReadLine();
            
                if (S == "ABC")
                {
                    WriteLine("ARC");
                }
                else
                {
                  WriteLine("ABC");
                }
        }
 
        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}

Measured memory_bytes: 25876
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

ll a[1444441];
bool marked[1444441];
int MX;
bool visited[1444441];
bool isvalid(int x)
{
	return (x>=0&&x<MX&&!marked[x]);
}

void dfs(int x)
{
	visited[x]=1;
	//cerr<<x<<' ';
	if(x%7!=0&&isvalid(x-1)&&!visited[x-1]) dfs(x-1);
	if(x%7!=6&&isvalid(x+1)&&!visited[x+1]) dfs(x+1);
	if(isvalid(x-7)&&!visited[x-7]) dfs(x-7);
	if(isvalid(x+7)&&!visited[x+7]) dfs(x+7);
}

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll n, m, q; cin>>n>>m>>q;
	for(int i=0;i<q;i++)
	{
		cin>>a[i];
	}
	if(m%7!=0)
	{
		for(int i = 1; i < 7; i++)
		{
			for(int j = 0; j < q; j++)
			{
				a[i*q+j] = a[j] + i*m;
			}
		}
		m*=7;
		q*=7;
	}
	for(int i = 0; i < q; i++)
	{
		marked[a[i]] = 1;
	}
	MX = m;
	ll cc1 = 0;
	for(int i = 0; i < m; i++)
	{
		if(!marked[i]&&!visited[i])
		{
			cc1++;
			dfs(i);
			//cerr<<'\n';
		}
	}
	if(n*7==m)
	{
		cout<<cc1<<'\n';
		return 0;
	}
	MX*=2;
	for(int i = 0; i < q; i++)
	{
		a[q+i] = a[i] + m;
	}
	q*=2;
	m*=2;
	memset(visited,0,sizeof(visited));
	memset(marked,0,sizeof(marked));
	for(int i=0;i<q;i++)
	{
		marked[a[i]]=1;
	}
	ll cc2 = 0;
	for(int i = 0; i < m; i++)
	{
		if(!marked[i]&&!visited[i])
		{
			cc2++;
			//cerr<<'\n';
			dfs(i);
		}
	}
	//cerr<<"HERE\n";
	//cerr<<cc1<<' '<<cc2<<'\n';
	ll diff = cc2 - cc1;
	cout<<cc1 + ll(n*7/(m/2) - 1)*diff<<'\n';
}


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

using namespace std;

int main(){
  string S;
  cin >> S;
  vector<string> s={"SUN","MON","TUE","WED","THU","FRI","SAT"};
  for(int i=0;i<7;i++){
    if(S ==s[i]){
      cout << (7-i);
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{ 
  char a[16]={'C','O','D','E','F','E','S','T','I','V','A','L','2','0','1','6'};
    char b[16];
    int c=0;
	
	 for(int i=0;i<16;i++)
	 {   cin>>b[i];
	     if(b[i]!=a[i]) c++;  
	 }
    cout<<c<<endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))

Process = True
i = 0
while i < n:
    if a[i] % 2 == 0:
        if a[i] % 3 != 0 and a[i] % 5 != 0:
            Process = False
    i += 1

if Process:
    print("APPROVED")
else:
    print("DENIED")

Measured memory_bytes: 3060
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <utility>
using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define MOD 1000000007

int main(int argc, char const *argv[]) {
  long x;
  cin >> x;
  if(x < 11){
    if(x<7){
      cout << 1 << endl;
    }else{
      cout << 2 << endl;
    }
  }else{
    int m = x%11;
    long p = (x-m)/11;
    //cout << "m:" << m << endl;
    if(m == 0){
      cout << (2*p) << endl;
    }else if(m <= 6){
      cout << (2*p+1) << endl;
    }else{
      cout << (2*p+2) << endl;
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main() {
    LL N;cin >> N;
    vector<LL> A(N);
    rep(i,N)cin >> A[i];

    vector<LL> num(N);
    rep(i,N){
        num[i] = i - A[i];
    }
    bool ok = true;
    if(num[0] != 0)ok = false;
    rep(i,N-1){
        if(A[i+1] - A[i] > 1)ok = false;
    }

    if(ok){
        LL ans = 0;
        rep(i,N){
            if(binary_search(all(num),i)){
                LL k = upper_bound(all(num),i) - num.begin() - 1;
                ans += (k-i);
            }
        }
        cout << ans << endl;
    }
    else{
        cout << -1 << endl;
    }
}

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

#define TYPE(c)   remove_reference_t<decltype(c)>
#define REP(i, n) for(TYPE(n) i = 0; i < n; i++)
#define FOR(v, c) for(TYPE(c.begin()) v = c.begin(); v != c.end(); v++)
#define ALL(c)    c.begin(), c.end()
#define SORT(c)   sort(ALL(c))
#define RSORT(c)  sort(ALL(c), greater<TYPE(c)::value_type>())
#define UNIQUE(c) c.erase(unique(ALL(c)), c.end())

using namespace std;
using ll = long long;

constexpr int MOD  = (int)1e9 + 7;
constexpr int INF  = (int)1e9 + 1;
constexpr ll  LINF = (ll)1e18 + 1;
template<typename T> constexpr bool chmax(T& a, const T& b)
{ if(a < b) { a = b; return true; } else { return false; } }
template<typename T> constexpr bool chmin(T& a, const T& b)
{ if(b < a) { a = b; return true; } else { return false; } }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T>& p)
{ return os << "(" << p.first << "," << p.second << ")"; }
ostream& operator<<(ostream &os, const string& s)
{ FOR(v, s) os << *v; return os; }
template<typename T> auto operator<<(ostream& os, const T& t)
    -> typename conditional<true, ostream&, decltype(*t.begin())>::type
{ os << "["; FOR(v, t) { if(v != t.begin()) os << ","; os << *v; } os << "]"; return os; }

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

    ll x;
    std::cin >> x;
    ll ans = 0;
    ans += (6 < x % 11) ? 2 : (x % 11 == 0) ? 0 : 1;
    ans += (x / 11) * 2;
    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 256
while 1:
	try:
		a=raw_input()
		cjoi=cioi=0
		for i in range(len(a)-2):
			if a[i+1]=="O" and a[i+2]=="I":
				if   a[i]=="J":cjoi+=1
				elif a[i]=="I":cioi+=1
		print cjoi
		print cioi
	except:
		break		

Measured memory_bytes: 4416
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        long ans = 0;
        if (N == 0) ans = 2;
        else if (N == 1) ans = 1;
        else {
            long p2 = 2;
            long p1 = 1;
            long cur = 0;
            for (long i = 2; i <= N; i++) {
                cur = p1 + p2;
                p2 = p1;
                p1 = cur;
            }
            ans = cur;
        }
        System.out.println(ans);

        return;
    }

}

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

#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) begin(x), end(x)
#define uniq(x) (x).erase(unique(all(x)), end(x))
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint = vector<int>;
using vvint = vector<vint>;
using pint = pair<int, int>;
using vpint = vector<pint>;
template<typename T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
constexpr long double PI = 3.1415926535897932384626433832795028L;
constexpr int DY[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int DX[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T, typename U> bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int N, M;
int A[110];
signed main() {
    cin >> N >> M;
    int cnt = 0, sum = 0;
    rep(i, N) {
        cin >> A[i];
        sum += A[i];
    }
    rep(i, N) {
        if (A[i] * 4 * M >= sum) { cnt++; }
    }
    if (cnt >= M) { cout << "Yes" << endl; }
    else { cout << "No" << endl; }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int N, L[100];
	scanf("%d", &N);
	for (int i = 0; i < N; i++)scanf("%d", &L[i]);
	int max = 0, memo, sum = 0;
	for (int i = 0; i < N; i++) {
		if (max < L[i]) {
			max = L[i];
			memo = i;
		}
	}
	for (int i = 0; i < N; i++) {
		if (i == memo)continue;
		else sum += L[i];
	}
	if (max < sum)printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 128
l,r=map(int,input().split())
min1=2018
if r-l>=2018:
  print(0)
  exit()
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      min1=min(i*j%2019,min1)
print(min1)
      

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define int long long
using namespace std;
int MOD = 1000000007;
vector<int> fact;
int pw(int a, int b){
    if (b==0) return 1;
    if (b==1) return a%MOD;
    if (b%2){
        int rs = pw(a, b-1);
        return (a*rs) %MOD;
    }
    int rs = pw(a, b/2);
    return (rs*rs) %MOD;
}
int C(int n, int k){
    int X = fact[n];
    int Y = (fact[k] * fact[n-k]) % MOD;
    return (X*pw(Y, MOD-2)) % MOD;
}
int calc(int n){
    vector<int> v;
    for (int i=0; i < n-1; i++) v.push_back(i);
    int ans =0 ;
    vector<int> st(n);
    do {
        vector<bool> x(n);
        fill(x.begin(), x.end(), false);
        int k = n;
        for (int i=0; i < n; i++){
            if (!x[v[i]]) k--;
            if (!x[v[i] + 1]) k--;
            x[v[i]] = true;
            x[v[i]+1] = true;
            if (!k){
                ans += i+1;
                st[i+1]++;
                if (i+1==3){
                    cout << v[0] << " " << v[1] << " " << v[2] << endl;
                }
                break;
            }
        }
    }
    while (next_permutation(v.begin(), v.end()));
    for (int i=0; i < n; i++) cout << st[i]*i << " ";
    cout << endl;
    return ans;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    //cout << calc(n) << endl;
    fact.push_back(1);
    for (int i=1; i < 2e6; i++) fact.push_back((fact.back() * i) % MOD);
    if (n==2){
        cout << 1 << endl;
        return 0;
    }
    int nole = 1;
    int ans = 0;
    while (true){
        if (n-1-2*nole <= 0) break;
        int X = C(n-3-nole, nole-1) * (nole+1);
        if (n-2-2*nole > 0) X += C(n-3-nole, nole) * (nole+1) * 2;
        X %= MOD;
        X *= fact[n-2-nole];
        X %= MOD;
        X *= (n-1-nole);
        X %= MOD;
        X *= fact[nole];
        X %= MOD;
        ans += X;
        nole++;
    }
    ans += 2 * fact[n-1];
    ans %= MOD;
    cout << ans;
}



Measured memory_bytes: 18792
#include<bits/stdc++.h>
#define mod 1000000007
#define mod1 998244353
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long int li;
typedef unsigned long long int ull;
using namespace std;
bool sortbysec(const pair<li,li>&a,const pair<li,li>&b)
{
    return (a.second<b.second);
}
int main()
{
fast_io
li n,s=0,i;
cin>>n;
for(i=1;i<=n;i++)
{
  if(i%3&&i%5)
  s+=i;
}
cout<<s;
  return 0;
}


Measured memory_bytes: 3652
#include <iostream>
using namespace std;
int main(){
   int n;
   cin >> n;
   int a[n];
   for(int i = 0; i<n; i++){
       cin >> a[i];
   }
   int cnt = 0;
   for(int i = 0; i<n; i++){
       if(i+1 != a[i]){
           cnt++;
       }
   }
   if(cnt <= 2){
       cout << "YES" << endl;
   } else {
       cout << "NO" << endl;
   }
   return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int a, b, c, temp;
	scanf("%d %d %d", &a, &b, &c);
	if(a > b && b > c) {
		temp = a; a = c; c = temp;
	}
	if(a > b) {
		temp = a; a = b; b = temp;
	}
	if(b > c) {
		temp = b; b = c; c = temp;
	}
	printf("%d %d %d\n", a, b, c);
}

Measured memory_bytes: 1852
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int n,n2,s=0;

    cin >> n;
    n2=n;
    while(n!=0)
    {
        s+=n%10;
        n=n/10;
    }
    if(n2%s==0)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }


    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdlib>  
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
 
int main() {
    int a,b; cin>>a>>b;
    int s = 0;
    s = a+b;
    if(s < a-b) s= a-b;
    if(s <a*b) s = a*b;
    cout<<s;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{

    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        String s;
        char a=' ';
        s=input.next();
        char arr[]=new char[s.length()];
        for(int i=0;i<s.length();i++)
        {
            arr[i]=s.charAt(i);
        }
        for(int i=0;i<s.length();i++)
        {
            if(arr[i]==',')
                arr[i]=a;
        }
        for(int i=0;i<s.length();i++)
        {
            System.out.print(arr[i]);
        }
        System.out.println();
    }
    
}


Measured memory_bytes: 26948
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

const int N=100005;

int n,a[N];

int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	std::sort(a+1,a+n+1);
	if (a[n]==0) {puts("Yes");return 0;}
	if (n%3!=0) {puts("No");return 0;}
	if (a[1]!=a[n/3]||a[n/3+1]!=a[n/3*2]||a[n/3*2+1]!=a[n]) {puts("No");return 0;}
	if ((a[1]^a[n/3+1]^a[n])==0) puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 640
import java.io.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	    int i,n=0,start=-1,end=-1,keyi,sp2;
	    String[] sp = new String[2];
		BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
       	try{
       	n=Integer.parseInt(sc.readLine());
 	   }catch(IOException e){
		System.out.println(e);
	   }		    
     int[] data = new int[n];
     int[] next = new int[n];
     int[] befo=  new int[n];
     for(i=0;i<n;i++){
	 try{
    	 sp=(sc.readLine()).split("[\\s]+");
	 }catch(IOException e){
		System.out.println(e);
	     }
	     if(sp[0].equals("insert")){
	     data[i]=Integer.parseInt(sp[1]);
    	  if(start!=-1){
    		  next[i]=start;
    		  start=i;
    	   	  befo[next[i]]=i;
    	 }else{
    		 start=i;
    		 end=i;
    	 }
    	 }
    	 if(sp[0].equals("delete")){
	     if((keyi=search(data,next,start,Integer.parseInt(sp[1]),end))!=-1){
       	         if(start ==end){start =end = -1;
       			 continue;
       			 }
    		 if(keyi==end){
    			 end=befo[end];
    			 next[end]=-1;
    	 }else if(keyi==start){
    		 start=next[start];
    		 befo[start]=-1;
    	 }else{
    		 next[befo[keyi]]=next[keyi];
    		 befo[next[keyi]]=befo[keyi];
    	 }
    	 }
    	 }
    	 if(sp[0].equals("deleteFirst")){
   	      if(start ==end){
   	    	start =end = -1;
   			 continue;
   			 }
    		 if(start!=-1){
    		 start=next[start];
    		 }
    	 }
    	 if(sp[0].equals("deleteLast")){
    		 if(start!=-1){
    			 if(start ==end){start =end = -1;
    			 continue;
    			 }
    			 if(befo[end]!=-1)
    			 end=befo[end];
    		 }else{
    			 start=-1;
    		 }
    			 next[end]=-1;
    		 }
     }
     for(i=start;i!=next[end];i=next[i]){
    	 if(i!=end){
    		 System.out.print(data[i]+" ");
    	 }else{
    		 System.out.println(data[i]);
    	 }
    	 }
	}
	public static int search(int []data,int[]next,int start,int key,int end){
		int x;
		x=start;
		while(x !=end&&data[x]!=key){
			x=next[x];
		}
		if(x==end&& data[x]!=key) return -1;
		return x;
	}
}



Measured memory_bytes: 568020
using System;

namespace B___Bounding
{
    class Program
    {
        static void Main(string[] args)
        {
            var read = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
            var N = read[0];
            var X = read[1];

            var Li = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);

            var acum = new int[N+1];
            acum[0] = 0;
            for(int i = 1 ; i < N+1 ; i++ ) acum[i] = acum[i-1] + Li[i-1];
            var result = 0;
            for(int i = 1 ; i < N+1 ; i++)
            {
                if(acum[i] > X)
                {
                    result = i;
                    break;
                }
            }
            if(acum[N] <= X) result = N+1;
            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 13140
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3121000;
long long fact[C_SIZE];
long long finv[C_SIZE];
long long inv[C_SIZE];
long long Comb(int a,int b){
 	if(a<b||b<0)return 0;
 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
}
void init_C(int n){
	fact[0]=finv[0]=inv[1]=1;
	for(int i=2;i<n;i++){
		inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
	}
	for(int i=1;i<n;i++){
		fact[i]=fact[i-1]*i%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
}
long long pw(long long a,long long b){
	long long ret=1;
	while(b){
		if(b%2)ret=ret*a%mod;
		a=a*a%mod;
		b/=2;
	}
	return ret;
}
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
// ここから編集しろ
int b[110000];
long long ans[110000];
int z[110000];
long long bit[110000][2];
long long sum(int a,int b,int c){
	if(a)return sum(0,b,c)-sum(0,a-1,c);
	long long ret=0;
	for(;b>=0;b=(b&(b+1))-1)ret+=bit[b][c];
	return ret;
}
void add(int a,long long b,int c){
	for(;a<110000;a|=a+1)bit[a][c]+=b;
}
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d",b+i);
	for(int i=0;i<a;i++)z[i]=b[i];
	std::sort(z,z+a);
	long long S=0;
	for(int i=0;i<a;i++){
		S+=b[i];
		add(lower_bound(z,z+a,b[i])-z,b[i],0);
		add(lower_bound(z,z+a,b[i])-z,1,1);
	}
	int now=0;
	long long las=S;
	for(int i=0;i<a;i++){
		if(now<b[i]){
			now=b[i];
			long long tmp=sum(lower_bound(z,z+a,b[i])-z,a-1,0);
			tmp-=sum(lower_bound(z,z+a,b[i])-z,a-1,1)*b[i];
			long long nx=tmp;
			ans[i]=las-nx;
			las=nx;
		}

		add(lower_bound(z,z+a,b[i])-z,-b[i],0);
		add(lower_bound(z,z+a,b[i])-z,-1,1);
	}
	for(int i=0;i<a;i++){
		printf("%lld\n",ans[i]);
	}
}

Measured memory_bytes: 4992
import numpy as np
n,m,x=map(int,input().split())
c=[None for i in range(n)]
a=[None for i in range(n)]
for i in range(n):
    l=[int(i) for i in input().split()]
    c[i]=l[0]
    a[i]=np.array(l[1:])
mincos=1000000000000
for mask in range(2**n):
    rikai=np.zeros(m,dtype="int32")
    cos=0
    mm=mask
    for i in range(n):
        if mm%2:
            rikai+=a[i]
            cos+=c[i]
        mm//=2
    if np.all(rikai>=x):
        mincos=min(cos,mincos)

if mincos==1000000000000:
    print(-1)
else:
    print(mincos)


Measured memory_bytes: 27368