akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REREASE
#define PI 3.141592653589793238462643383279

#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define REPR(i, n) for(ll i = n; i >= 1; i--)
#define FOR(i, m, n) for(ll i = m; i <= n; i++)
#define INF 1e9+123
#define VEC(type,A,N) vector<type> A(N+10)
#define VECi(type,A,N,i) vector<type> A(N+10,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N+10,vector<type>(M+10))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N+10,vector<type>(M+10,i))
#define ALL(v) v.begin()+1, v.end()-9
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
int main(){
    long double A,B,H,M;
    cin>>A>>B>>H>>M;
    
    long double Hdeg,Mdeg;
    Hdeg=(H+M/60)*PI/6;
    Mdeg=M*PI/30;
    
    long double t1=A*sin(Hdeg)-B*sin(Mdeg);
    long double t2=A*cos(Hdeg)-B*cos(Mdeg);
    sl(Hdeg,Mdeg,A*sin(Hdeg),A*cos(Hdeg),B*sin(Mdeg),B*cos(Mdeg))
    cout<<fixed << setprecision(25)<<sqrt(t1*t1+t2*t2);
    
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 4168
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
    int x, counter;
    x = 1;
    counter = 1;
    while ( x > 0 ) { 
        cin >> x;
        if (x > 0){
            cout << "Case " << counter++ << ": " << x << endl;
        }

    }
    return 0;
}



Measured memory_bytes: 3000
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <limits.h>

int main(void){
    int n,ans=0;
    scanf("%d",&n);
    for (int i=1; i<=n; i++){
        if (i%2!=0){
            int count=0;
            for (int j=1; j<=n; j++){
                if (i%j==0){
                    count++;
                }
            }
            if (count==8){
                ans++;
            }
        }
    }
    printf("%d\n",ans);
	return 0 ;
}

Measured memory_bytes: 128
# frozen_string_literal: true

n = gets.to_i
rate = n.times.map { gets.to_i }
# max_{j>i} (R_j-R_i) = max_i (max_{j>i} (R_j) - R_i)
max_later = Array.new(n - 1, 0)
max_later[n - 2] = rate[n - 1]
(n - 3).downto(0) do |i|
  max_later[i] = [max_later[i + 1], rate[i + 1]].max
end
puts((0...(n - 1)).map { |i| max_later[i] - rate[i] } .max)



Measured memory_bytes: 11696
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <cmath>
#include <cstdio>

using namespace std;

typedef long long ll;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)

int main(int argc, char **argv)
{
    int N;
    cin >> N;
    ll A[N], B[N];
    REP(i, N) cin >> A[i] >> B[i];

    pair<ll, ll> p[N];
    REP(i, N) p[i] = make_pair(B[i], A[i]);
    sort(p, p + N);

    ll cur = p[N - 1].first;
    for (int i = N - 1; i >= 0; --i) {
        if (cur > p[i].first) cur = p[i].first;
        cur -= p[i].second;
    }
    if (cur >= 0) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 6528
/*
    Author      : Dinesh Verra
    College     : ABV-IIITM
    Date        : 02/08/2020
    Source		: 
    Explanation : 
*/
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp> 
// using namespace boost::multiprecision; 
using namespace std;
typedef long long ll;
// typedef unsigned long long ll;
#define cu continue
#define br break
#define pb push_back
#define eb emplace_back
#define mod 1000000007
#define inf INT_MAX
#define pll pair <ll,ll>
#define min_pq priority_queue <pll> ,vector <pll>, greater <pll> > > 
#define F first
#define S second
#define vll vector <ll>
#define vpll vector <pll>
#define dbg(n) cout<<#n<<' '<<n<<endl;
#define all(v) v.begin(),v.end()
#define nl cout<<'\n'

template <typename A1>
void prn(A1&& arg)
{
	cout<<arg<<'\n';
}
template <typename A1, typename... A>
void prn(A1&& arg, A&&... args)
{
	cout<<arg<<' ';
	prn(args...);
}

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


	ll x;
	cin>>x;
	if(x>=30) prn("Yes");
	else prn("No");
}

Measured memory_bytes: 3636
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [h,w] <- getIntList
    board <- replicateM h getLine
    putStrLn $ if solve 0 board then "Possible" else "Impossible"

solve _ [] = True
solve p (as:ass) | s == [p..smax] = solve smax ass
                 | otherwise = False
    where s = elemIndices '#' as
          smax = maximum s

Measured memory_bytes: 508
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FR first
#define SC second
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;


signed main(){
  int n,a;
  cin>>n>>a;
  cout<<(a>=n%500?"Yes":"No")<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();
		if ((n == 1 && a != b) || a > b) {
			System.out.println(0);
		} else if (n == 2) {
			System.out.println(1);
		} else {
			System.out.println(b * (n - 1) + a - (a * (n - 1) + b) + 1);
		}
	}
}

Measured memory_bytes: 22996
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
    long long a, b, k, a_h, b_h;
    cin >> a >> b >> k;
    if(a + b < k){
        a_h = 0;
        b_h = 0;
    }else if(a < k){
        a_h = 0;
        b_h = b-(k-a);
    }else{
        a_h = a - k;
        b_h = b;
    }

    cout << a_h << " " << b_h;
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair 
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;

template<class T> inline bool chmin(T& a, T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b;return true;}return false;}

int main(){
	//input
	string s; 
    ll K;
    cin>>s>>K;

    char mem=s[0];
    ll L=0;
    vector<ll>X;
    rep(i,sz(s)){
        if(mem==s[i]) L++;
        else{
            mem=s[i];
            X.pb(L);
            L=1;
        }
    }
    X.pb(L);

    if(sz(X)==1){
        cout<<(sz(s)*K)/2;
    }
    else{
        if(s[0]==s[sz(s)-1]){
            ll ans=0;
            ans+=X[0]/2;
            ans+=X[sz(X)-1]/2;
            ans+=((X[0]+X[sz(X)-1])/2)*(K-1);
            ll tmp=0;
            rep1(j,sz(X)-2){
                tmp+=X[j]/2;
            }
            ans+=tmp*K;

            cout<<ans;
        }
        else{
            ll tmp=0;
            rep(j,sz(X)){
                tmp+=X[j]/2;
            }
            cout<<tmp*K;
        }

    }
}

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

#include <string>
#include <vector>
#include <map>
int main(){
    int n; cin >> n;
    map<int,int> dates;
    long long sum = 0;
    for(int i=0; i<n; i++){
        int x; cin >> x;
        dates[x]++;
        sum += x;
    }
    int Q; cin >> Q;
    while(Q--){
        int b,c; cin >> b >> c;
        sum += (c-b)*dates[b];
        dates[c] += dates[b];
        dates[b] = 0;
        cout << sum << endl;
    }
}

Measured memory_bytes: 8040
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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

        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list1 = new ArrayList<>();

        int k = sc.nextInt();
        for (int i = 0; i < k; i++) {
            int a = sc.nextInt();
            list1.add(a);
        }

        for (int i = 1; i < n; i++) {
            if (list1.isEmpty()) {
                break;
            }
            k = sc.nextInt();
            List<Integer> list2 = new ArrayList<>();

            for (int j = 0; j < k; j++) {
                int a = sc.nextInt();
                if (list1.contains(a))
                    list2.add(a);
            }
            list1 = list2;
            list2 = null;
        }

        System.out.println(list1.size());
    }
}


Measured memory_bytes: 21892
if isfile("mystdin.txt");mystdin=open("mystdin.txt","r");redirect_stdin(mystdin);end
pI(x)=parse(BigFloat,x)
pM(x::Array{SubString{String},1})=map(pI,x)
function main()
  a,b=pM(split(readline()))
  print(Int(floor(a*b)))
end
main()
if isdefined(Base, :mystdin);close(mystdin);end

Measured memory_bytes: 174440
/*input

*/

#include<bits/stdc++.h>
using namespace std;
//#define int 					ll
#define ios	    				ios_base::sync_with_stdio(false); cin.tie(0)

// Data Structures //
#define ll 						long long
#define vi          			vector<ll>

// Functions //
#define pb 						push_back

int visited[100005];
ll dp[100005];
vi v[100005];

void visit(ll node)
{
	dp[node] = 0;
	visited[node] = 1;
	for(ll child : v[node] )
	{
		if(visited[child]==0) visit(child);
		dp[node] = max(dp[node],1+dp[child]);
	}
	
	return;		
}



void solve()
{
	ll n,m,x,y,k=0,t,cnt=0;
	cin>>n>>m;
	for(int i=0;i<m;i++) 
	{
		cin>>x>>y;
		v[x].pb(y);
	}
	
	for(ll i=1;i<=n;i++) 
	{
		if(visited[i]==0) 
		{
			visit(i);
		}
	}
	
	for(int i=1;i<=n;i++)	
	{
		cnt = max(cnt,dp[i]);
	}

	
	cout<<cnt<<endl;
}


signed main()
{
	ios;
	ll tests=1;
	memset(visited,0,sizeof(visited));
	//cin>>tests;
	while(tests--)
	{
		solve();
	}
	return 0;
}


Measured memory_bytes: 12988
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

ll modfac(ll n, ll mod) {
	ll res = 1LL;
	for(ll i = 2LL; i <= n; i++) {
		res *= i;
		res %= mod;
	}
	
	return res;
}
	
int main(void) {
	int n, m;
	cin >> n >> m;
	
	if( abs(n - m) >= 2 ) {
		cout << 0 << endl;
		return 0;
	}
	
	ll ans = 1LL;
	ans *= modfac(n, MOD_LL);
	ans %= MOD_LL;
	ans *= modfac(m, MOD_LL);
	ans %= MOD_LL;
	
	if( n == m ) {
		ans *= 2LL;
		ans %= MOD_LL;
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using P = pair<ll, ll>;
const long double PI = acos(-1.0L);
ll GCD(ll a, ll b) { return b?GCD(b, a%b):a; }
ll LCM(ll a, ll b) { return a/GCD(a, b)*b; }

string s;
vector<int> alp(26, 0);

int main() {
    alp['y'-'a']++;
    alp['u'-'a']++;
    alp['i'-'a']++;
    alp['o'-'a']++;
    alp['p'-'a']++;
    alp['h'-'a']++;
    alp['j'-'a']++;
    alp['k'-'a']++;
    alp['l'-'a']++;
    alp['n'-'a']++;
    alp['m'-'a']++;
    while(1) {
        cin >> s;
        if(s == "#") break;
        int slen = s.length();
        int now = 0;
        int cnt = 0;
        for(int i = 0; i < slen; ++i) {
            if(i == 0) now = alp[s[i]-'a'];
            else {
                int ch = alp[s[i]-'a'];
                if(now != ch) cnt++;
                now = ch;
            }
        }
        cout << cnt << endl;
    }
}


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

int main(){
  int n;
  string s,t;
  cin >>n >>s >>t;
  int ans = 0;
  for(int i = n; 0<=i; i--){
    if(s.substr(n-i)==t.substr(0, i)) {
      ans = 2*n-i;
      break;
    }
  }
  cout << ans << endl;
  return 0; 
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define substr(s,f,t) (s.substr(f-1,t-f+1))
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{ll x,y,t;};
struct Edge{ll to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=201010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(ll from,ll to,ll cost){E[from].pb({to,cost});}
};
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,a,b;cin>>n>>a>>b;
  vi x(n);
  ll ans=0;
  for(int i=0;i<n;i++){
    cin>>x[i];
    if(i!=0){
     
      ans+=min(a*(x[i]-x[i-1]),b);
    }
  }
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) ((int)(x).size())
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N; cin>>N;
    int ans=0;
    REP(i,N){
        int a; cin>>a;
        while(a%2==0) a/=2,ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
//#include <stack>
#include <climits>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
using namespace std;
typedef long long ll;
//typedef unsigned long long ull;
typedef pair<int, int> P;

int h,w,n;
int b[110][110];

vector<int> cor(int c){
    vector<int> rtn(2);
    int _h = c/w;
    int _w;
    if(_h%2==0){
        _w =c%w;
    }else{
        _w = w-c%w-1;
    }
    rtn[0] = _h;
    rtn[1] = _w;
    return rtn;
}

void fill(int start,int a,int color){
    vector<int> c(2);
    c = cor(start);
    REP(i,a){
        c = cor(start+i);
        b[c[0]][c[1]] = color;
    }
}


int main(void){
    cin >> h >> w >> n;
    vector<int> a(n);
    REP(i,n){
        cin >> a[i];
    }
    int cnt = 0;
    REP(i,n){
        fill(cnt,a[i],i);
        cnt += a[i];
    }
    REP(i,h){
        REP(j,w-1){
            cout << b[i][j]+1 << " ";
        }
        cout << b[i][w-1]+1 << endl;
    }
    return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
int n,p,m,i,r=1;
int main(){
    scanf("%d",&n);
    scanf("%d",&m);
    for(i=1;i<n;i++){
        scanf("%d",&p);
        if(p<m){
            m=p;
            r++;
        }
    }
    printf("%d",r);
    return 0;
}

Measured memory_bytes: 128
n, m = map(int, input().split())
a = sorted(list(map(int, input().split())))
li = []
for i in range(m):
    b, c = map(int, input().split())
    li.append((c, b))
li = sorted(li, reverse = True)

count = 0 #li[num][1]
num = 0  #index

for i in range(n):
    if a[i] < li[num][0]:
        a[i] = li[num][0]
        count += 1
    if count == li[num][1] :
        num += 1
        count = 0
    if num == m:
        break

print(sum(a))

Measured memory_bytes: 21836
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>

using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
const int INF = 1e9;
const double PI = acos(-1.0);

bool dp[110][10010] = { false };
int main() {
	int n;
	cin >> n;
	vector<int> s(n);
	rep(i, n)cin >> s[i];
	dp[0][0] = true;

	rep(i, n) {
		rep(j, 10001) {
			dp[i + 1][j] |= dp[i][j];
			if (j + s[i] > 10000)continue;
			dp[i + 1][j + s[i]] |= dp[i][j];
		}
	}

	for (int i = 10000; i >= 0; i--) {
		if (i%10!= 0 && dp[n][i]) {
			cout << i << endl;
			return 0;
		}
	}
	cout << 0 << endl;
	return 0;
}

Measured memory_bytes: 1280
n = int(input())
d = [list(map(int,input().split())) for i in range(n)]
cnt=[]
ans=0
for a in range(n):
  if d[a][0]==d[a][1]:
    cnt.append(1)
    if a>1:
      if cnt[a-2]==cnt[a-1]==cnt[a]:
        ans+=1
  else:
    cnt.append(0)

if ans >0:
  print('Yes')
else:
  print('No')
  

Measured memory_bytes: 9216
#include<stdio.h>

int main(void) {
	int n;
	int c, i, k;
	int cont = 0;
	int mod;
	scanf("%d", &n);
	for (i = 1; i<n + 1; i++) {
		c = i;
		mod = 0;
		if (c % 2 == 1) {
		    for (k = 1; k<c + 1; k++) {
				if (c%k == 0) {
					mod++;
				}
			}
			if (mod ==8) {
				cont++;
			}
		
		}
	}
	printf("%d", cont);
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 0;

		if(B < A){
			sum = sum + A;
			A--;
		}else{
			sum = sum + B;
			B--;
		}

		if(B < A){
			sum = sum + A;
			A--;
		}else{
			sum = sum + B;
			B--;
		}

		System.out.println(sum);

		sc.close();
	}
}


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


int main() {

	long long n = 0;
	cin >> n;

	long long* s = new long long[n];
	long long* t = new long long[n];
	
	for (int i = 0; i < n; i++)
		cin >> s[i];

	t[0] = 0;

	for (int i = 0; i < n-1; i++) {
		if (s[i] <= s[i + 1])
			t[i + 1] = 0;
		else{
			t[i + 1] = (s[i] - s[i + 1]);
			s[i + 1] += t[i + 1];
		}
	}

	long long sum = 0;
	for (int i = 0; i < n; i++)
		sum += t[i];

	cout << sum << endl;

}

Measured memory_bytes: 6736
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
# define ALL(x) (x).begin(), (x).end()
using namespace std;
int main()
{
    int p;
  cin>>p;
  string t;
  cin>>t;
  if(p>=t.size()){cout<<t<<endl;}
  else{string b;
    for(int k=0;k<p;k++){b+=t.at(k);}
      cout<<b+"..."<<endl;}
}

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

int main()
{
	set <string> v;
	int n,i;
	cin>>n;
	for(i=1; i<=n; i++)
	{
		string x;
		cin>>x;
		v.insert(x);
	}
	
	cout<<v.size();
	return 0;
}

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

bool sortx(pair<int, int> first, pair<int, int> second) {
  return first.first > second.first;
};

bool sorty(pair<int, int> first, pair<int, int> second) {
  return first.second < second.second;
};

int main() {
  int N;
  cin >> N;
  vector<pair<int, int>> red(N);
  vector<pair<int, int>> blue(N);

  for (int i = 0; i < N; i++) {
    cin >> red[i].first >> red[i].second;
  }
  sort(red.begin(), red.end(), sortx);

  for (int i = 0; i < N; i++) {
    cin >> blue[i].first >> blue[i].second;
  }
  sort(blue.begin(), blue.end(), sorty);

  int pairs = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < red.size(); j++) {
      if ((blue[i].first > red[j].first) && (blue[i].second > red[j].second)) {
        pairs += 1;
        red.erase(red.begin() + j);
        break;
      }
    }
  }
  cout << pairs << endl;
};


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

int n, k;
long p, t, m;
long c[200002];

int main(){
    cin >> n >> k;
    c[0] = 0;
    for (int i = 0; i < n; ++i){
        cin >> p;
        c[i+1] = c[i] + p + 1;
    }
    for (int i = 0; i < n - k + 1; ++i){
        t = c[i+k] - c[i];
        if (m < t) m = t;
    }
    cout << (m/2) << ((m % 2 == 0) ? "" : ".5");
    return 0;
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int ans = n*n*n;
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

int main() {
  int n;
  while (cin >> n, n) {
    vector<vector<int>> vec(n + 1, vector<int>(n + 1, 0));
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        cin >> vec[i][j];
        vec[i][n] += vec[i][j];
        vec[n][j] += vec[i][j];
      }
    }
    vec[n][n] = accumulate(vec[n].begin(), vec[n].end(), 0);

    for (auto &seq : vec) {
      for (auto &v : seq)
        cout << setw(5) << v;
      cout << endl;
    }
  }
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, n) for(double i = 1; i < n; i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define P pair<int, int>
typedef long long ll;
const ll mod = 1e9+7;

//繰り返し自乗法による累乗計算
//a**n
ll pow(ll a, ll n){
  if(n == 0) return 1;
  if(n%2 == 0){
    ll res = pow(a, n/2);
    return res * res;
  }
  return a * pow(a, n-1);
}
//繰り返し自乗法によるmod累乗計算
//a**n (mod)
ll modpow(ll a, ll n){
  if(n == 0) return 1;
  if(n%2 == 0){
    ll res = modpow(a, n/2);
    return res * res % mod;
  }
  return a * modpow(a, n-1) % mod;
}
//組み合わせ
//nCa
ll com(ll n, ll a){
  ll x = 1, y = 1;
  rep(i,a){
    x *= n-i;
    y *= i+1;
  }
  ll res = x / y;
  return res;
}
//組み合わせ(mod)
//nCa (mod)
ll modcom(ll n, ll a){
  ll x = 1, y = 1;
  rep(i, a){
    x = x * (n-i) % mod;
    y = y * (i+1) % mod;
  }
  ll ans = x * modpow(y, mod-2) % mod;
  return ans;
}
//gcd 最大公約数
ll gcd(ll x, ll y){
  if(x % y == 0) return y;
  return gcd(y, x%y);
}
//lcm 最小公倍数
ll lcm(ll x, ll y){
  return x * y / gcd(x, y);
}
//ngcd n個の最大公約数
ll ngcd(vector<ll> a){
  ll res;
  res = a[0];
  for(ll i = 1; i < a.size() && res != 1; i++) {
    res = gcd(a[i], res);
  }
  return res;
}
//nlcm n個の最小公倍数
ll nlcm(vector<ll> a) {
  ll res;
  res = a[0];
  for (ll i = 1; i < a.size(); i++) {
    res = lcm(res, a[i]);
  }
  return res;
}
// 素数判定
bool isprime(ll x){
  ll i;
  if(x < 2) return false;
  else if(x == 2) return true;
  if(x % 2 == 0) return false;
  for(i = 3; i*i <= x; i += 2){
    if(x % i == 0) return false;
  }
  return true;
}
// 桁和
ll digsum(ll x){
  ll res = 0;
  while(x > 0){
    res += x % 10;
    x /= 10;
  }
  return res;
}


int main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int x = c-a;
  int y = d-b;
  printf("%d %d %d %d\n", c-y, d+x, a-y, b+x);
}



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

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; ++i) cin >> a[i];
  int q;
  cin >> q;
  while(q--) {
    int b, e, t;
    cin >> b >> e >> t;
    swap_ranges(a.begin()+b, a.begin()+e, a.begin()+t);
  }
  for(int i = 0; i < n; ++i) cout << a[i] << " \n"[i==n-1];

  return 0;
}



Measured memory_bytes: 3100
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

ll n,m;

int main(){
	cin>>n>>m;
	cout<<(n-1)*(m-1)<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6;
const ll LINF = 1e18;
using namespace std;

#define rep(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (int i = (a); i < (b); i++)
#define rrrep(i, a, b) for (int i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl

ll n, cnt, ans, a, b, c, d, tmp, tmpp, m, h, x, y, sum, pos, k, w[ohara],
    v[ohara], W, dp[3000][8000];
ld doua;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};
// int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
bool fl;
struct edge {
  int to, cost;
};
pair<ll, ll> p[ohara];

//-------------------------↓↓↓↓↓↓------------------------

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

  cin >> n >> W;
  rep(i, n) {
    cin >> a >> b;
    p[i] = make_pair(a, b);
    // cin >> w[i] >> v[i];
  }
  sort(p, p + n);
  rep(i, n) {
    w[i] = p[i].first;
    v[i] = p[i].second;
  }
  dp[0][0] = 0;
  rrep(i, 1, n + 1) {
    rep(j, W + 3000 + 2) { dp[i][j] = max(dp[i - 1][j], dp[i][j]); }
    rep(j, W) {
      dp[i][j + w[i - 1]] = max({dp[i - 1][j] + v[i - 1], dp[i][j + w[i - 1]]});
    }
  }
  ans = dp[n][W - 1];
  rrep(i, W, W + 3000 + 2) { ans = max(ans, dp[n][i]); }
  Cout(ans);
  return 0;
}


Measured memory_bytes: 192768
a = int(input())
b = int(input())
c = int(input())
v = int(input())

ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i + 100*j + 50*k == v:
        ans += 1

print(ans)


Measured memory_bytes: 3060
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( stdin . lock ( ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

fn main() {
    input! {
        n: usize,
        mut l: [u64; 2*n]
    }
    l.sort();
    let mut ret = 0;
    for i in 0..n {
        ret += std::cmp::min(l[2*i], l[2*i+1]);
    }
    println!("{}", ret);
}

Measured memory_bytes: 4352
import java.util.Scanner;

class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		long a=sc.nextLong(),b=sc.nextLong(),c=sc.nextLong();
		if(a%2==0 || b%2==0 || c%2==0) {
			System.out.println(0);
		}else {
			System.out.println(Math.min(a*b, Math.min(a*c, b*c)));
		}
	}
}


Measured memory_bytes: 21844
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/

#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
#include <stack>
#include <bitset>

////多倍長整数, cpp_intで宣言
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;

#pragma gcc target ("avx2")
#pragma gcc optimization ("Ofast")
#pragma gcc optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a) //少数出力
#define printLdb(a) printf("%.50Lf\n", a) //少数出力
#define printdbd(a) printf("%.16lf\n", a) //少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str()) //string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2LL) //等差数列の和、初項,末項,項数
#define pb push_back
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0L)*2.0L*PI)
#define rad_to_deg(rad) (((rad)/2.0L/PI)*360.0L)
#define Please return
#define AC 0
#define manhattan_dist(a, b, c, d) (abs(a - c) + abs(b - d)) /*(a, b) から (c, d) のマンハッタン距離 */
#define inf numeric_limits<double>::infinity();
#define linf numeric_limits<long double>::infinity()

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1e9 + 7;
constexpr long double eps = 1e-6;
const long double PI = acosl(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1 && c != ' ') {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	int d;
	scanf("%d", &d);
	vector<ll> c(26);
	rep(i, 26)scanf("%lld", &c[i]);
	vector<vector<ll>> s(d, vector<ll>(26));
	rep(i, d)rep(j, 26)scanf("%lld", &s[i][j]);
	vector<ll> last(26);
	ll ans = 0;

	rep(i, d) {
		int t;
		scanf("%d", &t);
		ans += s[i][t - 1];
		last[t - 1] = i + 1;
		rep(j, 26)ans -= (c[j] * (i + 1 - last[j]));
		printf("%lld\n", ans);
	}

	Please AC;
}

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

int main() {
  int k;
  cin >> k;
  string s;
  cin >> s;

  if(s.length() <= k){
      cout << s << endl;
  }

  else{
      for(int i=0;i<k;i++){
          cout << s[i];
      }
      cout << "..." << endl;
  }
}

Measured memory_bytes: 3620
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include <queue>
#include <utility>
#include <map>
#include <set>
using namespace std;

int main() {
    int A1, A2, A3;
    cin >> A1 >> A2 >> A3;

    int ans = min({ abs(A1 - A2) + abs(A2 - A3), abs(A1 - A3) + abs(A3 - A2)
        , abs(A2 - A1) + abs(A1 - A3), abs(A2 - A3) + abs(A3 - A1)
        , abs(A3 - A1) + abs(A1 - A2) , abs(A3 - A2) + abs(A2 - A1) });

    cout << ans << endl;

    return 0;

}

Measured memory_bytes: 256
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
#define ll long long
#define INFTY 1 << 21
int x[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y[8] = {1, 0, -1, 1, -1, 1, 0, -1};

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

  int A[N];
  int max_I = 0;
  int max_next = 0;

  // maxのI
  int I;
  bool maxSome = false;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    if (max_I == A[i]) {
      maxSome = true;
      max_next = max(max_next, A[i]);
    } else if (max_I < A[i]) {
      maxSome = false;
      max_next = max(max_next, max_I);
      max_I = A[i];
      I = i;
    } else {
      max_next = max(max_next, A[i]);
    }
  }

  if (maxSome == true) {
    for (int i = 0; i < N; i++) {
      cout << max_I << endl;
    }
  } else {
    for (int i = 0; i < N; i++) {
      if (i == I) {
        cout << max_next << endl;
      } else {
        cout << max_I << endl;
      }
    }
  }

  return 0;
}


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

#define mp make_pair
typedef long long ll;
typedef pair<int,int>pii;
const int N = 1e5;
vector<int>graph[2*N+100];
vector<int>comp1,comp2;
int vis[2*N+100];
void dfs(int u)
{
	vis[u] = 1;
	if(u<=N){
		comp1.push_back(u);
	}
	else comp2.push_back(u);
	for(auto it:graph[u])
	{
		if(!vis[it]){
			dfs(it);
		}
	}
}
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		graph[x].push_back(y+N);
		graph[y+N].push_back(x);
	}
	ll ans = 0;
	for(int i=1;i<=2*N;i++){
		if(!vis[i]){
			comp1.clear();
			comp2.clear();
			dfs(i);
			ll cnt = 0;
			for(auto it:comp1)
			{
				cnt += graph[it].size();
			}
			for(auto it:comp2)
			{
				cnt += graph[it].size();
			}
			cnt /= 2;
			ans += (1ll*comp1.size()*comp2.size()-cnt);
		}
	}
	printf("%lld\n",ans);
}


Measured memory_bytes: 12416
#include<iostream>
#include<algorithm>
#include<functional>
#include <string>
#include<iomanip>
#include<cstdio>
#include<math.h>
#include<set>
#include<stack>
#include<map>
#include<queue>
#include<cstring>
#include<vector>
#include <type_traits>
typedef long long int ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EREP(i,n) for(int i=(n-1);i>=0;--i)
#define D(n,retu) REP(i,n){cin>>retu[i];}
#define mod 1000000007
#define MIN -93193111451418101
#define INF 931931114518101
using namespace std;
typedef pair<ll, ll>P;
template<typename T, typename U>
std::enable_if_t<std::rank<T>::value == 0> fill_all(T& arr, const U& v) {
	arr = v;
}
template<typename ARR, typename U>
std::enable_if_t<std::rank<ARR>::value != 0> fill_all(ARR& arr, const U& v) {
	for (auto& i : arr) {
		fill_all(i, v);
	}
}
#define MAX_NUM 50
long long comb[MAX_NUM + 1][MAX_NUM + 1];

static void calc_comb()
{
	for (uint32_t i = 0; i <= MAX_NUM; i++) {
		for (uint32_t j = 0; j <= i; j++) {
			if ((j == 0) || (i == j)) {
				comb[i][j] = 1;
			}
			else {
				comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
			}
		}
	}
}
typedef pair<double, double> dop;
//------------------変数-----------------------//
long double x, y, N, m;

//-------------------関数----------------------//
int main() {
	cin >> N;
	REP(i, 3600) {
		REP(j, 3600) {
			long double h = i + 1, n = j + 1, w;
			long double hoge = w = 1.0 / (4 / N - 1 / h - 1 / n);
			if (hoge < 0) { continue; }
			ll cnt = 0;
			cnt = round(hoge);
			hoge = hoge - round(hoge);
			hoge = abs(hoge);
			if (hoge < 0.0000000001) {
				if (cnt <= 0) { continue; }
				cout << (ll)h << " " << (ll)n << " " << cnt << endl; return 0;
			}

		}
	}
	return 0;
}

Measured memory_bytes: 512
#include <cmath>
#include <iostream>
#include <string>
#include <unordered_map>

const int MOD = 1000000007;

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

	std::string S;
	std::cin >> S;

	std::unordered_map<char, int> numChar;
	for(const char &c : S) {
		numChar[c];
		numChar.at(c)++;
	}

	long long result = 1;
	for(const auto &pair : numChar) {
		result = result * (pair.second + 1) % MOD;
	}
	result -= 1;

	std::cout << result << std::endl;

	return 0;
}


Measured memory_bytes: 512
/// Kazuki Hoshino


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<pi> vpi;
#define inf 1000000000
#define mod 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define f first
#define ss second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define endl '\n'
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

ll n, x, a[101010], gc, ans;
vi v;

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

//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);


cin >> n >> x;

rep(i, 1 ,n){
cin >> a[i];
}
n++;
a[n]=x;

sort(a+1, a+n+1);

rep(i, 1, n-1){
v.pb(a[i+1]-a[i]);
}

sort(all(v));

rep(i, 0, n-1){

    ans = __gcd(ans, (ll)v[i]);
}

cout << ans << endl;









return 0;}
///....


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

int main(){
    int n; cin >> n;
    vector<int> tlis(n), alis(n);
    ll ans = 0;
    for(int i = 0; i < n; i++){
        cin >> tlis[i] >> alis[i];
    }
    ll tpre = 1, apre = 1;
    for(int i = 0; i < n; i++){
        if(tpre <= tlis[i] && apre <= alis[i]){
            tpre = tlis[i];
            apre = alis[i];
        }else{
            ll k1 = apre / alis[i], k2 = tpre / tlis[i];
            if(apre % alis[i] != 0){
                k1++;
            }
            if(tpre % tlis[i] != 0){
                k2++;
            }
            ll k = max(k1, k2);
            apre = alis[i] * k;
            tpre = tlis[i] * k;
        }
    }
    cout << apre + tpre << endl;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <ctime>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
#define For(i, x, y) for(int i=x;i<=y;i++)  
#define _For(i, x, y) for(int i=x;i>=y;i--)
#define Mem(f, x) memset(f,x,sizeof(f))  
#define Sca(x) scanf("%d", &x)
#define Sca2(x,y) scanf("%d%d",&x,&y)
#define Sca3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define Scl(x) scanf("%lld",&x);  
#define Pri(x) printf("%d\n", x)
#define Prl(x) printf("%lld\n",x);  
#define CLR(u) for(int i=0;i<=N;i++)u[i].clear();
#define LL long long
#define ULL unsigned long long  
#define mp make_pair
#define PII pair<int,int>
#define PIL pair<int,long long>
#define PLL pair<long long,long long>
#define pb push_back
#define fi first
#define se second 
typedef vector<int> VI;
const double eps = 1e-9;
const int maxn = 110;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7; 
int N,M,K;
int main(){
	int a,b;
	cin >>a >> b; //123
	cout << max(max(a + b,a * b),a - b);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <climits>
#include <bitset>
#include <list>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

#define mod ((ull)(1e9)+7)
#define MAX ((ull)(1e9)+1)

int main(){
	int n, m, c;
	cin >> n >> m >> c;
	int b[m];
	for(int i=0; i<m; i++) cin >> b[i];
	int ans=0;
	for(int i=0; i<n; i++){
		int s=0;
		for(int j=0; j<m; j++){
			int a;
			cin >> a;
			s+=a*b[j];
		}
		s+=c;
		if(s>0) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <ios>
#include <iomanip>
#include <algorithm>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<(n))
#define bit_check(bit, i) (bit>>(i)) & 1
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REP(i, a.size()) cin >> a[i];
#define INPUTP(a) REP(i, a.size()) cin >> a[i].first >> a[i].second;
#define ENDL cout << endl;
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using VPII = vector<PII>;
using PLL = pair<LL, LL>;
using VPLL = vector<PLL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
using VD = vector<double>;
const LL INF = 1e18;
const LL MOD = 1e9 + 7;

template<class T> inline bool chmin(T &a, T b){if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){if (a < b) {a = b; return true;} return false;}

void END(){cout << 1 << endl; exit(0);}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b, c;
  cin >> a >> b >> c;
  if (a+b+c >= 22) cout << "bust" << endl;
  else cout << "win" << endl;

  return 0;
}


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

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

const int N = 100005;

int n, x0;

int main() {
  scanf("%d%d", &n, &x0);
  int g = 0;
  for (int i = 1, x; i <= n; ++i) {
    scanf("%d", &x);
    g = __gcd(g, abs(x - x0));
  }
  printf("%d\n", g);
  
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <stdlib.h>
#include <stdio.h>      /* printf */
#include <math.h>       /* pow */
#include <vector>
#include <algorithm>


typedef std::vector<int> liste;

bool solve(int i,int m,liste& list) {
    if(m==0) {
        return true;
    }
    if(i>=list.size()||m<0) {
        return false;
    }
    bool res = (solve(i+1,m,list)||solve(i+1,m-list[i],list));
    return res;
} 
    
int main(void){
        
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    int value;
    int n;
    std::cin >> n;
    liste list(n);
    for(int i=0; i<n; i++) {
        std::cin >> list[i];
    } 
    std::cin >> n;
    for(int i=0; i<n; i++) {
        std::cin >> value;
        std::cout << (solve(0,value,list) ? "yes" : "no") << std::endl;
    } 
    
    return 0;
}

Measured memory_bytes: 1188
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
using namespace std;

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

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
int n;
int a[200005];
int ans[500000];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> n;
  REP(i, n) cin >> a[i];

  int l = 250000, r = l + 1;
  REP(i, n) {
    if((i + 1) % 2 == n % 2) {
      ans[l--] = a[i];
    } else {
      ans[r++] = a[i];
    }
  }

  FOR(i, l + 1, r) cout << ans[i] << endl;
}


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


typedef long long ll;
typedef long double ld;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;


#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ub upper_bound
#define lb lower_bound
#define asd cout << "ok" << endl;


#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define trav(it, m) for(auto it = m.begin(); it!= m.end(); it++)

const int MOD = 1e9 + 7;
const ll INF = 1e19;
const ld PI = acos((ld)-1);
const int MX = 2e5 +5;
const char nl = '\n';


int main(){

  string s; cin >> s;
  int ok1 = 0, ok2 = 0, ok3 = 0;
  if(s[0] == 'A')
    ok1= 1;
  int cnt = 0;
  for(int i =2; i < s.size()-1; i++)
  {
    if(s[i] == 'C')
      cnt++;
  }
  if(cnt == 1)
    ok2 = 1;
  if(s[1] < 'a' || s[1] > 'z')
  {
    cout << "WA" <<nl;
    return 0;
  }
  if(s[s.size() -1] < 'a' || s[s.size()-1] > 'z')
  {
    cout << "WA" <<nl;
    return 0;
  }

  for(int i = 1; i < s.size(); i++)
  {
    if(s[i] >= 'a' && s[i] <= 'z' || s[i] == 'C')
      ok3 = 1;
  }
  if(ok1 && ok2 && ok3)
    cout << "AC" << nl;
  else
    cout << "WA" << nl;


  return 0;
}


Measured memory_bytes: 3540