akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int TEST,CASE=1;
#define sf scanf
#define pf printf
#define pb push_back
#define nl cout<<endl
#define all(x) x.begin(),x.end()
#define clr(a,b) memset(a,b,sizeof(a))
typedef long long int ll;
typedef long double ld;
ll n,m,a,b,c,k,x,y,z,ans=0,total=0;
ll arr[2000]={0};
string s;
int main(void){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<fixed<<setprecision(10);
#ifdef FILE_INPUT
  freopen("input.txt","r",stdin);
#endif /// FILE_INPUT
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>arr[i];
  }
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      ans=max(ans,abs(arr[j]-arr[i]));
    }
  }
  cout<<ans<<endl;
#ifdef FILE_INPUT
#endif /// FILE_INPUT
    return 0;
}


Measured memory_bytes: 256
//
// Created by moono on 2018/10/27.
//

#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;



int main() {
    int x, y, z;
    cin >> x >> y >> z;

    x -= z;
    int n = x / (y+z);

    cout << n << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll          long long int
#define lld          long double
#define pb          push_back
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define vec         vector<ll>
#define all(a)     (a).begin(),(a).end()
#define F           first
#define S           second
#define mod         1000000007
#define rep(i,a,b)	for(ll  i=a;i<b;i++)
#define repi(i,a,b)	for(ll  i=a;i<=b;i++)
#define per(i,a,b)  for(ll i=a;i>=b;i--)
#define mp          make_pair
#define mit         map<ll,ll>::iterator
#define sit         set<ll>::iterator
#define pit         pair<ll,ll>::iterator
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;
ll xo(ll x, ll y) 
{ 
   return (x | y) & (~x | ~y); 
}  
ll bin_Expo(ll x,ll n)
{
		if(x==0)
		return 0;
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return bin_Expo(x*x,n/2);
    else                             //n is odd
        return x*bin_Expo(x*x,(n-1)/2);
}
ll mod_Expo(ll x,ll n,ll M)
{
		if(x==0)
		return 0;
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return mod_Expo((x*x)%M,n/2,M);
    else                             //n is odd
        return (x*mod_Expo((x*x)%M,(n-1)/2,M))%M;
 
}
ll NcR(int n, int r) 
{ 
    ll p = 1, k = 1; 
    if (n - r < r) 
        r = n - r; 
  
    if (r != 0) { 
        while (r) { 
            p *= n; 
            k *= r; 
            ll m=__gcd(p, k); 
            p /= m; 
            k /= m; 
            n--; 
            r--; 
        } 
    } 
    else
        p = 1; 
    return p;
}
bool prime_check(ll x)
{
    bool prime = (x >= 2);
    for (ll i = 2; i * i <= x; i++) 
    {
        if (x % i == 0) 
        {
            prime = false;
            break;
        }
    }
    return prime;
}
ll logg(ll base,ll x)
{
    return (ll)(log(x)/log(base));
}
ll n,a[3001],k,dp[3001][3001][2];
ll f(ll st,ll ed,ll p)
{
	if(st>ed)
	return 0;
	if(dp[st][ed][p]!=-1)
	return dp[st][ed][p];
	if(st==ed)
	return dp[st][ed][p]=p==0?a[st]:-1*a[st];
	if(p==0)
		return dp[st][ed][p]=max(a[st]+f(st+1,ed,1),a[ed]+f(st,ed-1,1));
	else
		return dp[st][ed][p]=min(f(st+1,ed,0)-a[st],f(st,ed-1,0)-a[ed]);
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
//	cout<<setprecision(12)<<fixed;
	int TESTS=1;
//	cin>>TESTS;
    while(TESTS--)
    {
    	ll i,j,l,m,k;
    	cin>>n;
    	rep(i,0,n)
    	cin>>a[i];
    	repi(i,0,n)
    	{
    		repi(j,0,n)
    		{
    			rep(k,0,2)
    			dp[i][j][k]=-1;
			}
		}
		cout<<f(0,n-1,0);
    } 
	return 0;
}

Measured memory_bytes: 141184
/**
 *    +--+--+--++--++--In the name of ALLAH--++--++--+--+--+
 *
 *    author:  skmonir
 *    created: 21-Jun-2020 18:00:35
**/

#include <bits/stdc++.h>

using namespace std;

#define endl                '\n'
#define TN                  typename
#define mod                 1000000007LL
#define len(x)              (int) x.size()
#define all(x)              x.begin(), x.end()
#define rall(x)             x.rbegin(), x.rend()
#define mem(x, y)           memset(x, y, sizeof x)
#define FOR(x, l, r)        for (int x = l; x <= r; ++x)
#define ROF(x, l, r)        for (int x = l; x >= r; --x)

template <TN T> inline void Int(T &n) {
    n = 0; int f = 1; int ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
    n = n * f;
}

template <TN T> T gcd(T a, T b) {return !b ? a : gcd(b, a % b);}
template <TN T> inline void umin(T &a, T b) {a = a < b ? a : b;}
template <TN T> inline void umax(T &a, T b) {a = a > b ? a : b;}
template <TN T, TN W> inline void Int(T &x, W &y) {Int(x), Int(y);}
template <TN T, TN W, TN Q> inline void Int(T &x, W &y, Q &z) {Int(x, y), Int(z);}

const int N = 1e5 + 7;
const int inf = 1e9 + 7;


int solve() {
    char ch; cin >> ch;
    if (isupper(ch)) {
        cout << "A" << endl;
    } else {
        cout << "a" << endl;
    }

    return 0;
}

int main() {
    int tests = 1, CaseNo = 0;
    // Int(tests);
    while (tests--) {
        //printf("Case %d: ", ++CaseNo);
        solve();
    }
    return 0;
}

Measured memory_bytes: 3588
#include<cstdio>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n,a,b,c,d;
    scanf("%d",&n);
    if(n >= 1000 && n <= 9999)
    { a = n/1000;
    b = n % 1000/100;
    c =n%100/10;
     d =n%10;
	if(d ==b && b == c || a == b&&b == c)
	{	printf("Yes");}
	else printf("No");}
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 25
typedef struct{
  int p;
  int l;
  int r;
}Node;
  
void preorder(int);
void inorder(int);
void postorder(int);
  
Node T[N];
int main(){
  int n, i, j, id, left, right;
  scanf("%d\n",&n);
  for(i = 0 ; i < n ; i++){
    T[i].p =T[i].l =T[i].r =-1;
  }
  for(i = 0 ; i < n ; i++){
    scanf("%d%d%d", &id, &left, &right);
    T[id].l = left;
    T[left].p = id;
    T[id].r = right;
    T[right].p = id;
  }
  printf("Preorder\n");
  for(i = 0 ; i < n ; i++){
    if(T[i].p == -1){
      preorder(i);
    }
  }
  printf("\n");
  printf("Inorder\n");
  for(i = 0 ; i < n ; i++){
    if(T[i].p == -1){
      inorder(i);
    }
  }
  printf("\n");
  printf("Postorder\n");
  for(i = 0 ; i < n ; i++){
    if(T[i].p == -1){
      postorder(i);
    }
  }
  printf("\n");
  return 0;
}
  
void preorder(int u)
{
  if(u == -1) return;
  printf(" %d", u);
  preorder(T[u].l);
  preorder(T[u].r);
}
void inorder(int u)
{
  if(u == -1) return;
  inorder(T[u].l);
  printf(" %d", u);
  inorder(T[u].r);
}
  
void postorder(int u)
{
  if(u == -1) return;
  postorder(T[u].l);
  postorder(T[u].r);
  printf(" %d", u);
}

Measured memory_bytes: 616
#include<bits/stdc++.h>
#define mo 10007
#define pi 3.1415926535898
#define eps 1e-9 
using namespace std;
long long read(){
    long long xx=0,flagg=1;
    char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-')
        ch=getchar();
    if(ch=='-'){
        flagg=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        xx=xx*10+ch-'0';
        ch=getchar();
    }
    return xx*flagg;
}
void pus(long long xx,long long flagg){
    if(xx<0){
        putchar('-');
        xx=-xx;
    }
    if(xx>=10)
        pus(xx/10,0);
    putchar(xx%10+'0');
    if(flagg==1)
        putchar(' ');
    if(flagg==2)
        putchar('\n');
    return;
}
int n,h,i,zz[405],ru[405],chu[405],book[405],a,b,c,d;
int zzz(int z){
	if(zz[z]==z) return z;
	return zz[z]=zzz(zz[z]);
}
int main(){
	n=read();h=read();
	for(i=1;i<=h*2;i++)
		zz[i]=i;
	for(i=1;i<=n;i++){
		a=read();b=read();c=read();d=read();
		if(c==0)
			c=a;
		else
			c+=h;
		if(d==0)
			d=b+h;
		chu[c]++;
		ru[d]++;
		c=zzz(c);
		d=zzz(d);
		if(zz[c]!=d)
			zz[c]=d;
	}
	for(i=1;i<=h;i++)
		if(ru[i]>chu[i]||ru[i+h]<chu[i+h]){
			printf("NO\n");
			return 0;
		}
	for(i=1;i<=h*2;i++)
		if(ru[i]!=chu[i]||ru[i]==0&&chu[i]==0)
			book[zzz(i)]=1;
	for(i=1;i<=h*2;i++)
		if(zz[i]==i&&book[i]==0){
			printf("NO\n");
			return 0;
		}
	printf("YES\n");
   	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm> using namespace std; 
int main(){ int H,W; 
while(true){ scanf("%d %d",&H,&W); 
if(H == 0 && W == 0) break; 
for(int i = 0; i < W; i++) printf("#"); 
printf("\n"); for(int i = 1; i < H-1; i++){ printf("#");
for(int j = 1; j < W-1; j++) printf("."); printf("#\n");
} 
if(H > 1){ for(int i = 0; i < W; i++) printf("#"); printf("\n");
}
printf("\n"); 
    
} 
    
} 


Measured memory_bytes: 2540
s = int(input())

l = [s]
count = 1
ans = 0
while(True):
    now = l[count-1]
    count += 1
    if (now % 2 == 0):
        next = now/2
    else:
        next = 3*now+1
    if next in l:
        ans = count
        break
    else:
        l.append(next)

print(ans)


Measured memory_bytes: 2940
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
using namespace std;
int main()
{
	int x;
	scanf("%d", &x);
	int flag = 0;
	int r1=0, l1=100000;
	for (int i1 = 0; i1 * 105 <= x; i1++)
	{
		for (int i2 = 0; i2 * 104 + i1 * 105 <= x; i2++)
		{
			for (int i3 = 0; i2 * 104 + i1 * 105 + i3 * 103 <= x; i3++)
			{
				for (int i4 = 0; i2 * 104 + i1 * 105 + i3 * 103+i4*102 <= x;i4++)
				{
					for (int i5 = 0; i5 * 101 + i2 * 104 + i1 * 105 + i3 * 103 + i4 * 102<=x; i5++)
					{
						if ((x - (i5 * 101 + i2 * 104 + i1 * 105 + i3 * 103 + i4 * 102)) % 100 == 0)
						{
							printf("1\n");
							flag = 1;
							break;
						}
					}
						if (flag) break;
				}
				if (flag) break;
			}
			if (flag) break;
		}
		if (flag)  break;
	}
	if (!flag) printf("0\n");
	return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> moti(N);
  for(int i=0; i<N; i++)
    cin >> moti.at(i);
  sort(moti.begin(), moti.end());
  int base=101, count=0;
  for(int i=moti.size()-1; i>=0;i--){
   	if(moti.at(i)<base){
      base = moti.at(i);
      count++;
    }
  }
  cout << count << endl;
  
  return 0;
    
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static long numlong[];

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		while (str != null) {
			String numstr[] = str.split(" ", 0);
			numlong = new long[2];
			numlong[0] = Long.parseLong(numstr[0]);
			numlong[1] = Long.parseLong(numstr[1]);
			long gcm = Euclid();
			long lcm = numlong[0] * numlong[1] / gcm;
			System.out.println(gcm + " " + lcm);
			str = br.readLine();
		}
	}

	public static long Euclid() {
		long x = numlong[0];
		long y = numlong[1];
		while (x != y) {
			if (x < y) {
				y = y - x;
			} else {
				x = x - y;
			}
		}
		return x;
	}
}

Measured memory_bytes: 24048
#include <cmath>
#include <complex>
#include <algorithm>
using namespace std;

typedef long double Real;
typedef complex<Real> Point;
#define PCR Point const &
#define X real()
#define Y imag()

const Real EPS = 1e-10;
const Real INF = 1e100;
const Real PI = acos(-1);

struct Segment {
    Point p[2];
    Segment (PCR a = Point(), PCR b = Point()){
        p[0] = a, p[1] = b;
    }
    Point & operator [] (int k) { return p[k]; }
    Point const & operator [] (int k) const { return p[k]; }
};
typedef vector<Point> Polygon;
struct Circle { Real radius; Point center; };

Real dot(PCR a, PCR b){
    return a.X*b.X + a.Y*b.Y;
}
Real cross(PCR a, PCR b){
    return a.X*b.Y - a.Y*b.X;
}

Point pSP(Segment const & s, PCR p){
    Point base = s[1] - s[0];
    Real r = dot(p - s[0], base) / norm(base);
    return s[0] + base * r;
}

Point rSP(Segment const & s, PCR p){
    Point v = pSP(s,p) - p;
    return p + v * Real(2);
}

enum { LEFT = 1, RIGHT = -1, BACK = 2, FRONT = -2, ON = 0 };
int ccw(PCR x, PCR p, PCR q){
    // 端点を含む
    // コメントインすると端点を含まなくなる
    Point a = p - x, b = q - x;
    if(cross(a,b) > EPS) return LEFT;
    if(cross(a,b) < -EPS) return RIGHT;
    // if(abs(a) < EPS) return BACK;
    if(dot(a,b) < -EPS) return BACK;
    // if(abs(b) < EPS) return FRONT;
    if(norm(a) < norm(b)) return FRONT;
    return ON;
}

#include <iostream>
#include <cstdio>

int main(){
    Segment s;
    Real x,y;
    cin >> x >> y;
    s[0] = Point(x,y);
    cin >> x >> y;
    s[1] = Point(x,y);
    int q;
    cin >> q;
    for(int i=0;i<q;i++){
        cin >> x >> y;
        int c = ccw(s[0],s[1],Point(x,y));
        if(c==LEFT) puts("COUNTER_CLOCKWISE");
        if(c==RIGHT) puts("CLOCKWISE");
        if(c==BACK) puts("ONLINE_BACK");
        if(c==FRONT) puts("ONLINE_FRONT");
        if(c==ON) puts("ON_SEGMENT");
    }
}

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

constexpr int INF = (1 << 30) - 1;

// cost:=全頂点対の最短経路長がここに書き込まれる
void warshall_floyd(vector< vector<int> >& cost){
    const int v = (int)cost.size();

    for(int k = 0 ; k < v ; ++k){
        for(int i = 0 ; i < v ; ++i){
            for(int j = 0 ; j < v ; ++j){
                if(cost[i][k] < INF && cost[k][j] < INF){
                    cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
                }
            }
        }
    }

    return;
}

int main(){
    int N, M, R;
    cin >> N >> M >> R;

    vector<int> r(R);
    for(int i = 0 ; i < R ; ++i){
        cin >> r[i];
        --r[i];
    }

    vector< vector<int> > cost(N, vector<int>(N, INF));
    for(int i = 0 ; i < M ; ++i){
        int A, B, C;
        cin >> A >> B >> C;
        cost[--A][--B] = min(cost[A][B], C);
        cost[B][A] = min(cost[B][A], C);
    }

    warshall_floyd(cost);

    int ans = INF;
    sort(r.begin(), r.end());
    do{
        int tmp = 0;
        for(int i = 1 ; i < R ; ++i){
            tmp += cost[r[i - 1]][r[i]];
        }
        ans = min(ans, tmp);
    }while(next_permutation(r.begin(), r.end()));

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 384
(async () => {
  const buffers = [];
  for await (const chunk of process.stdin) buffers.push(chunk);
  const buffer = Buffer.concat(buffers);
  const text = buffer.toString();
  const lines = text.split(/\r?\n/);
  sum = lines.forEach((line, index) => {
    const sum = [].reduce.call(line, (accumulator, currentValue) => {
      return Number(accumulator) + Number(currentValue);
    });
    if (sum % 9 === 0) {
      console.log("Yes");
    } else {
	  console.log("No");
    }
  });
})();

Measured memory_bytes: 32096
// see https://gist.github.com/LumaKernel/ff55d49ee1af69b7388f15b707e75c15
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>
#include <random>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<P> VP;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RREP(i,n) RFOR(i,0,n)

#define LFOR(i,a,b) for(ll i=(a);i<(b);++i)
#define RLFOR(i,b,a) for(ll i=(b)-1;i>=(a);--i)

#define ALL(a) (a).begin(),(a).end()
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define PB push_back
#define EACH(i,c) REP(i,(int)(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define dump(x) cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";
#define dump2(x,y) cerr << "[L " << __LINE__ << "] " << #x << " = " << (x)\
			<< " , " << #y << " = " << (y) << "\n";

const int INF = 1e9;
const double EPS = 1e-10;

ll n,s;

ll f(ll b, ll n){
	return n < b ? n : f(b, n/b) + n%b;
}

ll solve(){
	cin >> n >> s;

	if(n==s) return n + 1;

	for(ll i=2;i*i<=n;i++){
		if(f(i, n) == s)return i;
	}

	if(n-s<0) return -1;

	ll ans = -1;
	for(ll p=1;p*p<n;p++){
		if((n-s)%p==0){
			ll b = (n-s)/p + 1;
			if(b>=2 && f(b, n) == s){
				if(ans == -1 || ans > b)ans = b;
			}
		}
	}

	return ans;
}

int main() {

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
#include <climits>
#include <functional>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<PII> VPI;
typedef vector<PLL> VPL;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define pf push_front
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ub upper_bound
#define lb lower_bound

#include <atcoder/convolution>
#include <atcoder/dsu>
#include <atcoder/fenwicktree>
#include <atcoder/lazysegtree>
#include <atcoder/math>
#include <atcoder/maxflow>
#include <atcoder/mincostflow>
#include <atcoder/modint>
#include <atcoder/scc>
#include <atcoder/segtree>
#include <atcoder/string>
#include <atcoder/twosat>
using namespace atcoder;
typedef modint998244353 mint;

int main(){
  int N,M;
  cin>>N>>M;
  VL A(N),B(M);
  rep(i,N) cin>>A[i];
  rep(i,M) cin>>B[i];
  VL ans=convolution(A,B);
  rep(i,N+M-1) cout<<ans[i]<<" ";
  cout<<endl;
}


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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  string n;
  cin >> n;
  
  cout << (n[0] == '9' || n[1] == '9' ? "Yes" : "No") << "\n";
}

Measured memory_bytes: 256
// 愚直に2重ループ
//
//   https://kimiyuki.net/writeup/algo/atcoder/arc-092-d/
// で紹介されている
//   https://atcoder.jp/contests/arc092/submissions/2242270
//   https://atcoder.jp/contests/arc092/submissions/2251371
// を参考に、
//   #pragma GCC optimize ("-O3", "unroll-loops")
//   __attribute__((target("avx")))
// を指定した。これで3秒以内に間に合った。
// ("avx2"の指定だとRE)
//
// さらに追加で、アラインメントを保証してメモリ確保した
// (参考: https://stackoverflow.com/questions/15067119/how-can-i-use-simd-to-accelerate-xor-two-blocks-of-memory)

#pragma GCC optimize ("-O3", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>


using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair
#define mt make_tuple




int main(void)
{
    cin.sync_with_stdio(false);
    int N;
    scanf("%d", &N);

    int* As = (int*)aligned_alloc(128, N * 4);
    int* Bs = (int*)aligned_alloc(128, N * 4);

    REP(n, N) scanf("%d", &As[n]);
    REP(n, N) scanf("%d", &Bs[n]);

    int ans = 0;
    int i = 0;
    for( ; i < (N / 8) * 8; i += 8) {
        int a0 = As[i];
        int a1 = As[i + 1];
        int a2 = As[i + 2];
        int a3 = As[i + 3];
        int a4 = As[i + 4];
        int a5 = As[i + 5];
        int a6 = As[i + 6];
        int a7 = As[i + 7];
        for(int j = 0; j < N; j++) {
            int b = Bs[j];
            ans ^= a0 + b;
            ans ^= a1 + b;
            ans ^= a2 + b;
            ans ^= a3 + b;
            ans ^= a4 + b;
            ans ^= a5 + b;
            ans ^= a6 + b;
            ans ^= a7 + b;
        }
    }
    for( ; i < N; i++) {
        int a = As[i];
        for(int j = 0; j < N; j++) {
            ans ^= a + Bs[j];
        }
    }
    cout << ans << endl;
    free(As);
    free(Bs);
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int R,G;
  double ave;
  double temp;
  cin >> R >> G;
  ave = (double)(R+G)/2;
  temp = ave-(int)ave;
  temp *= 10;
  if(temp>=1) temp=1;
  cout << (int)ave+temp << endl;
}

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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int n;cin>>n;
  vector<int> v(n);
  map<int, int> mp;
  int cnt = 0;
  for(int i=0;i<n;i++){
    cin>>v[i];
    mp[v[i]]++;
    if(mp[v[i]]==3){
      mp[v[i]]=1;
      cnt++;
    }
  }

  ll two = 0;
  for (auto& kv : mp) {
    if (kv.second == 2)two++;
  }
  cnt += two / 2;
  if(two % 2 == 1)cnt++;
  cout<<n - cnt*2<<endl;

  return 0;
}


Measured memory_bytes: 5376
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << ""; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

int main() {
	ll n, l;
	string s;
	vector<string> v;

	cin >> n >> l;

	REP(i, n) {
		cin >> s;
		v.push_back(s);
	}

	sort(v.begin(), v.end());

	cout << v << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
lli mod=1000000007;

int main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    lli w,s;
    cin>>s>>w;
    if(s>w)
    	cout<<"safe"<<endl;
    else
    	cout<<"unsafe"<<endl;

}

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

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

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

    vector<int> A(N);
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
    }

    int ans = A[0];
    for (int i = 0; i < N; i++)
    {
        ans = gcd(ans, A[i]);
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
from sys import stdin
import math
import fractions
from collections import deque
import sys

# 再起の上限を変更
sys.setrecursionlimit(100000)

INF = 10 ** 10

# 深さ優先探索
def dfs(i):
    global is_visited
    global tsort_res

    if is_visited[i]:
        return 

    is_visited[i] = True
    for j in nextl[i]:
        dfs(j)
    
    # 帰りがけ順で追加
    # 追加は先頭に行う
    tsort_res.appendleft(i)


# トポロジカルソート
def tsort():
    for i in range(1, N+1):
        dfs(i)

if __name__ == "__main__":

    N, M = [int(x) for x in stdin.readline().rstrip().split()]

    # トポロジカルソートで頂点iより後ろのパスの最大長
    dp = [0] * (N+1)

    # 頂点xから頂点vへの有向辺
    nextl = [[] for _ in range(N+1)]
    for _ in range(M):
        x, v = list(map(int, stdin.readline().rstrip().split()))
        nextl[x].append(v)
    
    # トポロジカルソートされた結果の入るリスト
    tsort_res = deque([])

    is_visited = [False] * (N+1)

    tsort()

    # 今回は逆順に使うのでリバースする
    # 汎用性のため、dfsでは先頭に追加するようにしている
    tsort_res = list(tsort_res)[::-1]

    for x in tsort_res:
        for v in nextl[x]:
            dp[x] = max(dp[x], dp[v] + 1)


    # for DEBUG
    #print(dp)
    print(max(dp))

Measured memory_bytes: 151860
n,time = input().split()
n = int(n)
time = int(time)

l = []
ltim = []
res = []
restim = []

for i in range(n):
    p,t = input().split()
    l.append(p)
    ltim.append(int(t))

ot = 0
qhead = 0
qtail = n

while qhead<qtail:
    cl = l[qhead]
    ct = ltim[qhead]
    if ct <= time:
        ot += ct
        res.append(cl)
        restim.append(ot)
        qhead += 1
    else:
        ot += time
        ct -= time
        l.append(cl)
        ltim.append(ct)
        qhead += 1
        qtail += 1


for o in range(n):
    print(res[o],restim[o])



Measured memory_bytes: 17536
#include<bits/stdc++.h>
using namespace std;
#define int long long
int dp[111][111][333];
signed main(){
  int n,W;
  cin>>n>>W;
  int w[100],v[100];
  for(int i=0;i<n;i++){
    cin>>w[i]>>v[i];
  }
  
  for(int i=0;i<111;i++)
    for(int j=0;j<111;j++)
      for(int k=0;k<333;k++)
	dp[i][j][k]=-1;
  dp[0][0][0]=0;
  int ans=0;
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++){
      for(int k=0;k<333;k++){
	if(dp[i][j][k]!=-1){
	  dp[i+1][j][k]=max(dp[i][j][k],dp[i+1][j][k]);
	  int nk=k+w[i]-w[0];
	  dp[i+1][j+1][nk]=max(dp[i+1][j+1][nk],dp[i][j][k]+v[i]);
	  if((j+1)*w[0]+nk<=W)ans=max(ans,dp[i+1][j+1][nk]);
	}
      }
    }
  cout<<ans<<endl;
  return 0;
}


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

using namespace std;

int main() {
  int H, W;
  scanf("%d %d", &H, &W);
  vector<string> S(H);
  for (int i = 0; i < H; ++i) cin >> S[i];
  vector< vector<int> > cnts_x(H, vector<int>(W, 0));
  vector< vector<int> > cnts_y(H, vector<int>(W, 0));
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (S[i][j] == '#') {
	cnts_x[i][j] = 0;
	cnts_y[i][j] = 0;
      } else {
	cnts_x[i][j] = j > 0? cnts_x[i][j - 1] + 1: 1;
	cnts_y[i][j] = i > 0? cnts_y[i - 1][j] + 1: 1;
      }
    }
  }

  for (int i = H - 2; i >= 0; --i) {
    for (int j = W - 2; j >= 0; --j) {
      if (cnts_x[i][j] == 0) continue;
      cnts_x[i][j] = cnts_x[i][j + 1] == 0? cnts_x[i][j]: cnts_x[i][j+1];
      cnts_y[i][j] = cnts_y[i + 1][j] == 0? cnts_y[i][j]: cnts_y[i + 1][j];
    }
  }

  int ans = 0;
  for (int i = 0; i < H; ++i) {
    for (int j = 0; j < W; ++j) {
      if (cnts_x[i][j] != 0) {
	ans = max(ans, cnts_x[i][j] + cnts_y[i][j] - 1);
      }
    }
  }

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



Measured memory_bytes: 35712
public class Main {

	/**
	 * ????????????????????????
	 *
	 * @param args
	 */
	public static void main(String[] args) {
		for (int i = 1; i < 10; i++) {
			for (int j = 1; j < 10; j++) {
				System.out.println(i + "x" + j + "=" + i * j);
			}
		}
	}
}

Measured memory_bytes: 24164
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <string>
#include <map>
#include <set>
using ll = long long;
using namespace std;

void monmo(){
    
}

int main() {
    int n;
    string s;
    int sum=0;
    vector<vector<int>> v(10,vector<int>(10,0));
    cin>>n;
    for(int i=1;i<=n;i++){
        s=to_string(i);
        int a=s[0]-'0'; //一番左
        int b=s[s.size()-1]-'0';//一番右
        v[a][b]++; //初期値0
    }
    for(int i=1;i<10;i++){
        for(int j=1;j<10;j++){
            sum+=v[i][j]*v[j][i];
        }
    }
    cout<<sum;
}


Measured memory_bytes: 256
#! /usr/bin/env python3
import sys
sys.setrecursionlimit(10**9)


YES = "Yes"  # type: str
NO = "No"  # type: str

INF=10**20
def solve(K: int, X: int):
    print(YES if K*500 >= X else NO)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(K, X)



if __name__ == "__main__":
    main()


Measured memory_bytes: 61172
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;

//最小公倍数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}


int main(){
  string s;
  cin>>s;
  int n = s.length();
  ll ans = 0;
  for(int i = 0; i < (1<<(n-1)); i++){
    ll sum = 0;
    ll a = s[0] - '0';
    for(int j = 0; j < n-1; j++){
      if(i&(1<<j)){
        sum += a;
        a = 0;
      }
      a = a*10 + (s[j+1]-'0');
    }
    sum+=a;
    ans+=sum;
  }
  cout<<ans<<endl;
  return 0;
}


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
 *
 * @author Jaynil
 */
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);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String x = in.next();
            int c = 0;
            for (int i = 0; i < x.length() / 2; i++) {
                if (x.charAt(i) != x.charAt(x.length() - 1 - i)) c++;
            }
            out.println(c);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}



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

int main(){
  long long a=0,b=1;

  cin>>a>>b;

    if((a+b)%2!=0 &&  (a+b)%2 !=0){
      cout<<"IMPOSSIBLE"<<endl;
    }
    else {
      cout<<(a+b)/2<<endl;;
      }
    

  return 0;
}
      


Measured memory_bytes: 256
fun main(args:Array<String>) {
    val n:Int = readLine()!!.toInt()
    val s:String = readLine()!!
    if (n % 2 == 1) {
        println("No")
        return
    }
    if (s.substring(0, n/2) == s.substring(n/2, n)) {
        println("Yes")
        return
    }
    println("No")
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI)
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)

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

typedef long long ll;

void solve(long long n, std::vector<long long> p) {
  int ans = 0;
  for (int i = 1; i < n - 1; i++) {
    long long arr[] = {p[i - 1], p[i], p[i + 1]};
    sort(arr, arr + 3);
    if (arr[1] == p[i]) {
      ans++;
    }
  }
  cout << ans << endl;
}

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


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

const ll infll=9223372036854775806;
const int inf=2147483646;

int main()
{
	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(false); cin.tie(0);
	int i,n,a[10],s=0;
	cin>>n;
	for (i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	for (i=0;i<n-1;i++){
		s+=a[i];
	}
	if (s>a[n-1]){
		cout<<"Yes";
	}
	else {
		cout<<"No";
	}
	return 0;
}

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

int main(){
    int n, a, ans = 0; cin >> n;
    for(auto i = 0; i < n; i++) {
        cin >> a;
        if((i + 1) % 2 and a % 2) ans++;
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3592
'use strict'
function mergeSort(arr){
  var groups=[[]];
  var n=0;
  for(let i=0;i<arr.length;i++){
    groups[n].push([arr[i],i]);
    if(arr[i]>arr[i+1]){
      n++;
      groups[n]=[];
    }
    
  }
  while(groups.length>1){//大
    let newGroups=[];
    while(groups.length>=2){//中
      let g1=groups.pop();
      g1.push([Infinity]);
      let g2=groups.pop();
      g2.push([Infinity]);
      let merged=[];
      let j=0,k=0;
      while(j<g1.length-1||k<g2.length-1){//小
        if(g1[j][0]<g2[k][0]){
          merged[j+k]=g1[j];
          j++;
        }else{
          merged[j+k]=g2[k];
          k++;
        }
      }//小了
      newGroups.push(merged);
    }//中了
    if(groups.length)
      newGroups.push(groups[0]);
    groups=newGroups;
  }//大了
  var result=groups[0];
  return result;
}

function Main(input){
  input=input.trim().split(/\s+/).map(x=>x-0);
  var N=input.shift();
  var M=input.shift();
  var A=[],B=[];
  for(let i=0;i<N;i++){
    A[i]=input[2*i];
    B[i]=input[2*i+1];
  }
  var A_=mergeSort(A);
  var ID=A_.map(x=>x[1]);
  var i=0;
  var cost=0;
  var n=ID[0];
  while(M>B[n]){
    M-=B[n];
    cost+=A[n]*B[n];
    i++
    n=ID[i];
  }
  cost+=A[n]*M;
  console.log(cost);
}

Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 72260
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
using namespace std;

#define F(i, n) for(int i = 0; i < n; ++i)
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL) INF;

const int MAX = 100000 + 47;

int A[MAX];

int main()
{
    //freopen("in.txt", "r", stdin);
    int n, c, k;
    scanf("%d%d%d", &n, &c, &k);
    FOR(i, 0, n)
        scanf("%d", A + i);
    sort(A, A + n);
    int bus = 0;
    int l = 0;
    int r = 0;
    while(true)
    {
        if (l >= n)break;
        while(r < n && A[r]-A[l] <= k && r - l + 1 <= c)
            ++r;
        --r;
        bus++;
        l = r + 1;
    }
    cout << bus << endl;
        
}



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

int main()
{
        int S;
        std::cin >> S;

        int h, m, s;
        h = S/3600;
        m = (S-h*3600)/60;
        s = S%60;

        std::cout << h << ':' << m << ':' << s << std::endl;

        return 0;
}

Measured memory_bytes: 3096
#include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include<cassert>
    #include<cmath>
    #include<cstdint>
     
    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
    #define ALL(a)  (a).begin(),(a).end()
    #define chmin(a, b) a = min(a, b)
    #define chmax(a, b) a = max(a, b)
    #define pb push_back
    #define sz size()
     
    using namespace std;
    using ll = long long int;
    using Graph = vector<vector<int>>;
    using P = pair<ll, ll>;
    using Vl = vector<ll>;
     
const int MOD = 1e9 + 7;
const ll ZER = 0;

//bit全探索
vector<ll>bitSearch(int bit,int n){
    vector<ll>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    S.push_back(1e9);
    return S;
}

ll dp1[3010][2], dp2[3010][2];
int main(){
    int n;
    cin >> n;
    int f[n][10];
    rep(i, n)rep(j, 10)cin >> f[i][j];
    int p[n][11];
    rep(i, n)rep(j, 11)cin >> p[i][j];
    ll res = -INF;
    for(int bit = 1; bit < (1 << 10); bit++){
        auto S = bitSearch(bit, 10);
        ll sum = 0;
        vector<int> cnt(n, 0);
        rep(i, n){
            for(auto s : S){
                if(s == INF)break;
                if(f[i][s] == 1)cnt[i]++;
            }
        }
        rep(i, n){
            sum += p[i][cnt[i]];
        }
        chmax(res, sum);
    }
    cout << res << endl;
}



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

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

  int ans = 1;

  for(int i = 2; i*i <= x; i++){
    int cnt = i*i;

    while(cnt <= x) cnt *= i;

    cnt /= i;
    if(cnt > ans) ans = cnt;

  }

  cout << ans << endl;

  return 0;

}



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

using namespace std;
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

#ifdef _LOCAL
struct Tester {
    Tester() { freopen("sample.in", "r", stdin); }
    ~Tester() { fprintf(stderr, "\nTime: %d ms\n", int(1000.0 * clock() / CLOCKS_PER_SEC)); }
} _tester;
#endif

const int INF = 0x3F3F3F3F;
const LL INFLL = 0x3F3F3F3F3F3F3F3FLL;
const int N = 1e7 + 10;
const int Q = 1e5 + 10;

int main() {
    int k, x;
    cin >> k >> x;
    bool f = 0;
    for (int i = x - k + 1; i <= x + k - 1; ++i) {
        if (f) cout << ' ';
        cout << i;
        f = 1;
    }
    cout << '\n';
    return 0;
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

int n,x,num[200010];

int main()
{
	cin>>n;
	for(int i=2;i<=n;i++)
	{
		cin>>x;
		num[x]++;
	}
	repn(i,n) cout<<num[i]<<endl;
	return 0;
}

Measured memory_bytes: 4416
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define UINF 18446744073709551615
#define F first
#define S second
#define ll long long
#define N 15
using namespace std;
ll n,m,x,c[N],a[N][N],val[N],ans=LINF;
bool pos;
int main(){
	ll i,j,mask,cst;
	cin>>n>>m>>x;
	for(i=0;i<n;i++)
	{
		cin>>c[i];
		for(j=0;j<m;j++)
		{
			cin>>a[i][j];
		}
	}
	for(mask=0;mask<(1<<n);mask++)
	{
		memset(val,0,sizeof(val));
		cst=0;
		pos=true;
		for(i=0;i<n;i++)
		{
			if(mask&(1<<i))
			{
				cst+=c[i];
				for(j=0;j<m;j++)
				{
					val[j]+=a[i][j];
				}
			}
		}
		for(i=0;i<m;i++)
		{
			if(val[i]<x)
			{
				pos=false;
				break;
			}
		}
		if(pos)
		{
			ans=min(ans,cst);
		}
	}
	if(ans>=LINF)
	{
		puts("-1");
	}
	else
	{
		cout<<ans<<endl;
	}
	return 0;
}

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

int main(){
  	int t;
	long long n = 0;
	cin >> t;

  	for(int i = 1; i <= t ; i++) {
		if(i % 3 == 0 || i % 5 == 0)
          	continue;
      	n += (long long)i;
	}
  	cout << n << endl;
}


Measured memory_bytes: 3636
/**
*    created: 30.05.2020 20:52:23
**/

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

int main() {
    string t;
    cin >> t;
    int n = t.size();
    char ans[n];
    rep(i,n){
        if(t[i]=='?'){
            ans[i] = 'D';
        }else{
            ans[i] = t[i];
        }
    }
    rep(i,n)cout << ans[i] ;
    cout  << endl;
}

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

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }


int main() {
    string s, t; cin >> s >> t;

    cout << t + s << endl;

    return 0;
}



Measured memory_bytes: 256
while True:
    h,w = map(int,input().split())
    if h==0 and w==0:
        break
    else:
        for i in range(h):
            for j in range(w):
                if (i+j)%2==0:
                    print('#',end='')
                else:
                    print('.',end='')
            print()
        print()


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

void solve()
{
    string s, t;
    cin >> s >> t;
    sort(all(s));
    sort(all(t));
    reverse(all(t));
    if (s < t)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

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

Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
bool sortbysec(const pair<int, int>& a,
	const pair<int, int>& b)
{
	return (a.second < b.second);
}
int main() {
	int n; cin >> n;
	cout << n * n * n;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>
#include <locale>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define repsg(i,s,g) for(int i = s; i <g; i++)
#define name(x) #x
using namespace std;

const int INF = INT_MAX;
const long long INFL = 1LL<<40;
const double PI = atan(1)*4;
const long long MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}


int main() {
    int n;cin>>n;
    int a,b;cin>>a>>b;
    vector<int> P(n);cin>>P;
    int s=0;
    int t=0;
    int r = 0;
    rep(i,n){
        
        if(P[i]<=a)s++;
        else if(P[i]>=b+1)r++;
        else t++;
    }
    
    cout<<min(s,min(r,t))<<endl;
    return 0;
}





Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <utility>
#include <numeric>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <limits>
#include <cassert>
#include <bitset>
#include <list>
#include <iomanip>
#include <cctype>

#define for0(i, N)    for (long long i = 0  ; i <  (N); ++i)
#define for1n(i, N)   for (long long i = 1  ; i <= (N); ++i)
#define for1(i, N)    for (long long i = 1  ; i <  (N); ++i)
#define forn(i, N)    for (long long i = 0  ; i <= (N); ++i)
#define forx(i, N, x) for (long long i = (x); i <  (N); ++i)
#define forl(i, N, x, a) for (long long i = (x), a = 0; a < (N);    \
                              i = (i + 1) % (N), ++a)
#define int long long

template<size_t i>
std::bitset<i> operator++(std::bitset<i> b, signed){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    return b = (unsigned long long)b + 1;
}

template<size_t i>
std::bitset<i> operator++(std::bitset<i> b){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    auto temp = b;
    b++;
    return temp;
}

template<size_t i>
std::bitset<i> operator--(std::bitset<i> b, signed){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    return b = (unsigned long long)b - 1;
}

template<size_t i>
std::bitset<i> operator--(std::bitset<i> b){
    static_assert(i <= 64, "Cannot cast 64bit int.");
    auto temp = b;
    b--;
    return temp;
}

long long constexpr inf = std::numeric_limits<long long>::max();

using namespace std;

typedef long long ll;
typedef long double ld;
typedef priority_queue<ll> pq;
typedef priority_queue<ll,vector<ll>, greater<ll>> pql;
typedef stack<ll> stk;
typedef queue<ll> qu;
typedef pair<ll, ll> pll;
typedef map<ll, ll> mll;
typedef unordered_map<ll, ll> umll;
typedef set<ll> sll;
typedef unordered_set<ll> usll;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<vector<ll>> vvll;


signed main(void){
    cin.tie(0); ios::sync_with_stdio(false);cout<<fixed<<setprecision(10);
    ll x, y, z;
    cin >> x >> y >> z;

    cout << z << " " << x << " " << y;

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#else
#define DBG(X)
#define SAY(X)
#endif

#define M_PI       3.14159265358979323846

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

std::string pad(int num)
{
    char buffer[4];
    std::snprintf(buffer, sizeof(buffer), "%03d", num);
    return buffer;
}

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

int solve()
{
    string s, t;
    cin >> s >> t;

    cout << t << s;

    return 0;
}

int main()
{
    solve();

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
char s[11];
int main()
{
    gets(s);
    if(s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I') 
    cout<<"Yes"<<endl;
    else 
   cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256