akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> plll;
typedef pair<pll,pll> ppll;
typedef long double ld;

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fst first
#define snd second
#define ins insert
#define pb push_back
template< typename T,typename V>ostream &operator<< (ostream &out,const pair<T,V> x){ out << "{" << x.fst << " : " << x.snd << "}"; return out;}template< typename T>ostream &operator<< (ostream &out,const set<T> x){ for(auto &it : x){ out << it << " "; } return out;}template< typename T>ostream &operator<< (ostream &out,const multiset<T> x){ for(auto &it : x){ out << it << " "; } return out;}template< typename T,typename V>ostream &operator<< (ostream &out,const map<T,V> x){ for(auto &it : x){ out << "[" << it.fst << "]" << " = " << it.snd << "\n"; } return out;}template< typename T>ostream &operator<< (ostream &out,const vector<T> x){ for(int i = 0;i < x.size() - 1; ++i){ out << x[i] << " "; } out << x.back(); return out;}template< typename T>ostream &operator<< (ostream &out,const vector<vector<T> > x){ for(int i = 0;i < x.size() - 1; ++i){ out << "[" << i << "]" << " = {" << x[i] << "}\n"; } out << "[" << x.size() - 1 << "]" << " = {" << x.back() << "}\n"; return out;}

const int N = 1e6 + 5;
const int MOD = 1e9 + 7;
const int INF = 1e9;
ll a[N];
main(){;
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);
    ll n,k;
    cin >> n >> k;
    for(int i = 0;i < n; ++i)cin >> a[i];
    sort(a,a + n);
    ll ans = 0;
    for(int i = 0;i < n; ++i){
        if(i + k >= n)break;
        ans += a[i];
    }
    cout << ans;
    return 0;
}



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

int main() {
    ll N;
    cin >> N;
    ll res = 0;
    if(N >= 2) {
        for(ll i = 2; i*i <= N; i++) {
            ll z = i;
            while(N % z == 0) {
                N /= z;
                z *= i;
                res++;
            }
            while(N % i == 0) N /= i;
        }
        if(N > 1) res++;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3636
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    a = [LI() for _ in range(H)]

    ans = []
    # 奇数枚の山のコインを右の山に移動
    if W >= 2:
        for i in range(H):
            for j in range(W - 1):
                if a[i][j] % 2 == 1:
                    a[i][j] -= 1
                    a[i][j+1] += 1
                    ans.append((i + 1, j + 1, i + 1, j + 2))

    # 一番右の列の奇数枚の山のコインを下の山に移動
    if H >= 2:
        for i in range(H - 1):
            if a[i][-1] % 2 == 1:
                a[i][-1] -= 1
                a[i+1][-1] += 1
                ans.append((i + 1, W, i + 2, W))

    # for i in a:
    #     print(*i)

    print(len(ans))
    if ans:
        for i in ans:
            print(*i)

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 31456
S = input()
N = len(S)
d = [0,0,0,0]
s = ['N','W','S','E']
for i in range(N):
    for j in range(4):
        if S[i] == s[j]:
            d[j] += 1
            break

flag = True
if (d[0] == 0 and d[2] == 0) or (d[0] != 0 and d[2] != 0):
    pass
else:
    flag = False
if (d[1] == 0 and d[3] == 0) or (d[1] != 0 and d[3] != 0):
    pass
else:
    flag = False
    
if flag:
    print('Yes')
else:
    print('No')



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

unsigned int N;

vector<int> f(int n);

int main(){
    cin >> N;

    vector<int> ans = f(N);

    //for_each(ans.begin(), ans.end(), [](int x){cout << x << endl;});
    for(int i = 1; i<N+1; i++){
        cout << ans[i] << endl;
    }
    return 0;
}

vector<int> f(int n){
    int i = (int)(sqrt(n));
    vector<int> cnt(n+1);
    int val = 0;
    for(int x = 1; x < i+1; x++){
        for(int y = 1; y < i+1; y++){
            for(int z = 1; z < i+1; z++){
                val = pow(x+y+z, 2)-(x*y+y*z+z*x);
                if(val<n+1){
                    cnt[val]++;
                }
            }
        }
    }

    return cnt;
}

Measured memory_bytes: 3660
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int n,m;
vi in;
bool f(int a){
	int sum=0;
	rep(i,a-1)sum+=in[i];
	rep(i,n-a+1){
		sum+=in[i+a-1];
		if(sum>=m)return true;
		sum-=in[i];
	}
	return false;
}
int main(){
	cin>>n>>m;
	in=vi(n);
	rep(i,n)cin>>in[i];
	
	int sum=0;
	rep(i,n)sum+=in[i];
	
	int l=0,r=n+1;
	while(r-l>1){
		int h=(r+l)/2;
		if(f(h))r=h;
		else l=h;
	}
	if(sum<m)l=-1;
	cout<<l+1<<endl;
}

Measured memory_bytes: 3680
#include <bits/stdc++.h>
#define LL long long
#define PII pair<int, int>
#define f first
#define s second 
using namespace std;
const LL INF = (LL) 1e9 + 5;
const LL MOD = (LL) 1e9 + 7;
const int MAXN = 100005;

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

	int n, k, s;
	cin >> n >> k >> s;
	if (s != (int) 1e9) {
		for (int i = 0; i < k; i++) {
			cout << s << " \n"[i + 1 == n];
		}
		for (int i = k; i < n; i++) {
			cout << s + 1 << " \n"[i + 1 == n];
		}
	}
	else {
		for (int i = 0; i < k; i++) {
			cout << s << " \n"[i + 1 == n];
		}
		for (int i = k; i < n; i++) {
			cout << 1 << " \n"[i + 1 == n];
		}
	}
	

	return 0;
}

Measured memory_bytes: 1280
#include<stdio.h>

int main(void){
  int v,w,V,W;
  int e[101][101];
  int s,to;
  
  scanf("%d%d",&V,&W);
  for(v=1;v<=V;v++) {
    for(w=1;w<=W;w++){
      scanf("%d",&e[v][w]);
    }
  }
  
  for(v=1;v<=V;v++){
    s=0;
    for(w=1;w<=W;w++)s+=e[v][w];
      e[v][0]=s;
  }
  to=0;
  for(w=1;w<=W;w++){
    s=0;
    for(v=1;v<=V;v++) s+=e[v][w];
      e[0][w]=s;
      to += s;
    
    }
    for(v=1;v<=V;v++){
      for(w=1;w<=W;w++)	printf("%d ",e[v][w]);
	printf("%d\n",e[v][0]);
      
    }
      for(w=1;w<=W;w++)	printf("%d ",e[0][w]);
	printf("%d\n",to);
	
  return 0;
}  



Measured memory_bytes: 2100
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; i++ )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4]={1,0,-1,0} , dy[4]={0,1,0,-1} ;
typedef vector<vector<pli>> wgraph;

vector<ll> bfs(wgraph v,int x){
    priority_queue<pli,vector<pli>,greater<pli>> q;
    vector<ll> dist(v.size(),longinf);
    dist[x]=0;
    q.push({0LL,x});
    while(q.size()){
        pli p=q.top();q.pop();
        ll d=p.first,now=p.second;
        if(dist[now]<d)continue;
        for(auto to:v[now]){
            if(dist[to.second]>d+to.first){
                dist[to.second]=d+to.first;
                q.push({dist[to.second],to.second});
            }
        }
    }
    return dist;
}
int main(){
    int n,m,s,t;
    cin>>n>>m>>s>>t;
    s--;t--;
    wgraph v1(n),v2(n);  
    rep(i,m){
        int x,y,z1,z2;
        scanf("%d %d %d %d",&x,&y,&z1,&z2);
        x--;y--;
        v1[x].push_back({z1,y});
        v1[y].push_back({z1,x});
        v2[x].push_back({z2,y});
        v2[y].push_back({z2,x});
    }
    vector<ll> dist1=bfs(v1,s);
    vector<ll> dist2=bfs(v2,t);
    vector<ll> ans(n);
    rep(i,n)ans[i]=1e15-dist1[i]-dist2[i];
    rep(i,n-1)ans[n-i-2]=max(ans[n-i-2],ans[n-i-1]);
    rep(i,n)printf("%lld\n",ans[i]);
   return 0;
}

Measured memory_bytes: 26684
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

int a[10001];
int main(){
    int n;
    cin >> n;
    rep(i,n) cin>>a[i];

    ll cnt = 0;
    rep(i,n){
        ll t = 0;
        while(a[i]%2==0){
            t++;
            a[i] /= 2;
        }
        cnt += t;
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var dp = new int[n + 1];
        for (int i = 1; i < n + 1; i++)
        {
            dp[i] = 999999999;
            var p = 1;
            while (p <= n)
            {
                if (i - p >= 0)
                    dp[i] = Math.Min(dp[i], 1 + dp[i - p]);
                p *= 6;
            }
             p = 1;
            while (p <= n)
            {
                if (i - p >= 0)
                    dp[i] = Math.Min(dp[i], 1 + dp[i - p]);
                p *= 9;
            }
        }
        Console.WriteLine(dp[n]);
    }
}

Measured memory_bytes: 13216
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long


signed main(){
    int A,B;
    cin>>A>>B;
    int ans=0;
    for(int i=A;i<=B;i++){
        string S=to_string(i);
        string S1=S;
        reverse(S.begin(),S.end());
        if(S==S1)ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
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(std::io::BufReader::new(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)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

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,
    v: [isize; n]
    }
    println!("{}", calc(n, v));
}

fn calc(n: usize, v: Vec<isize>) -> isize {
    let location = f32::round(v.iter().sum::<isize>() as f32/(n as f32)) as isize;
    let mut s:isize = 0;
    // v.iter().for_each(|x| {s = s + (x-location)*(x-location)});
    for vv in v {
        s += (vv-location)*(vv-location);
    }
    s
}

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

int main()
{
    int k;
    cin >> k;
    string s;
    cin >> s;
    if ((int)s.size() > k) {
        for (int i = 0; i < k; i++)
            cout << s[i];
        cout << "..." << endl;
    }
    else
        cout << s << endl;
    return 0;
}



Measured memory_bytes: 3596
#include<iostream>
using namespace std;
 
int main()
{
    // get a integer
    int a, b, c, x;
    int max_a, max_b, max_c;
    int count = 0;
    cin >> a >> b >> c >> x;
    max_a = x/500 < a ? x/500 : a;
    max_b = x/100 < b ? x/100 : b;
    max_c = x/50 < c ? x/50 : c;
   
    for (int i = 0; i <= max_a; i++) {
        for (int j = 0; j <= max_b; j++) {
              for (int k = 0; k <= max_c; k++) {
                   if ((500 * i + 100 * j + 50 * k) == x) {
                       count++;
                   }
              }
        }
    }    
    cout << count;
    return 0;
}

Measured memory_bytes: 256
import sys
import re
sys.setrecursionlimit(10 ** 7)


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def SI(): return input()


def main():
    N = int(input())
    X = []
    A = {(0, 0): 0}
    for _ in range(N):
        x, y = LI()
        X.append((x, y))
    for i in range(N):
        for j in range(i+1, N):
            x, y = X[i]
            xi, yi = X[j]
            dx = x-xi
            dy = y-yi
            if (dx, dy) in A:
                A[(dx, dy)] += 1
            else:
                A[(dx, dy)] = 1
            if (-dx, -dy) in A:
                A[(-dx, -dy)] += 1
            else:
                A[(-dx, -dy)] = 1
    print(N-max(A.values()))


main()


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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if(A == B){
    cout << C << endl;
  }
  else if(B == C){
    cout << A << endl;
  }
  else{
    cout << B << endl;
  }
}


Measured memory_bytes: 256
"use strict"
const create = () => {
    const input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
    const res = {
        "list": input, "index": 0, "max": input.length,
        "hasNext": function() {return this.index < this.max},
        "next": function() { if (!this.hasNext()) {throw "ArrayIndexOutOfBoundsException";}else{return this.list[this.index++];}}
    };
    return res;
}
const o = create();
const next = () => o.next()
const nextInt = () => parseInt(o.next())
const nextStrArray = () => o.next().split(" ")
const nextIntArray = () => o.next().split(" ").map(el => parseInt(el))
const nextCharArray = () => o.next().split("")
const hasNext = () => o.hasNext()
const myout = (...x) => console.log(...x)
const Main = () => {
    let [n,l] = nextIntArray()
    let sum = 0
    let min = Number.POSITIVE_INFINITY
    for(let i = 0; i<n;i++){
        let taste = l + i
        sum += taste
        if(Math.abs(min) > Math.abs(taste)){
            min = taste
        }
    }
    console.log(sum - min)
}
Main()


Measured memory_bytes: 29688
#include <iostream>
using namespace std;
#include<string>
string x;
int main() {
    getline(cin,x);
    int n=0;
    n=x.length();
   for(int i=0;i<n;i++) {
       if (x[i] == ',')
           x[i] = ' ';
       cout << x[i];
   }
    return 0;
}


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

vector<pair<long long, long long> >vec;
long long memo[1000000];
long long N, K;
string S;

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

	if(S[0] == '0'){
		vec.push_back(make_pair(0, 1));
	}
	
	char ch =  '-';
	long long num = 0;
	for(long long i = 0; i < S.size(); i++){
		if(i == 0){
			ch = S[i];
			num = 1;
		}else{
			if(ch == S[i]){
				num++;
			} else {
				vec.push_back(make_pair(num, ch-'0'));
				ch = S[i];
				num = 1;
			}
		}
	}
	vec.push_back(make_pair(num, ch-'0'));
	if(ch == '0'){
		vec.push_back(make_pair(0, 1));
	}

	for(long long i = 0; i < vec.size(); i++){
		memo[i+1] = memo[i] + vec[i].first;
	}

	long long zerocount = 0;
	for(long long i = 0; i < vec.size(); i++){
		if(vec[i].second == 0){
			zerocount++;
		}
	}
	if(zerocount <= K){
		cout << memo[vec.size()] << endl;
		return 0;
	}


	long long ans = 0;
	for(long long i = 0; i < vec.size(); i+= 2){
		if(i + 2 * K < vec.size()){
			ans = max(ans, memo[i + 2*K + 1] - memo[i]);
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 2928
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<iostream>
using namespace std;
long long int lcm(long long int a,long long int b){
  long long int n;
  n=a*b/__gcd(a,b);
  return n;
}
using ll =long long int;
#define ci(a) cin>>a
#define co(a) cout<<a<<endl
#define gcd(a,b) __gcd(a,b)
#define vec vector<ll>
#define for(i,a,b) for(int i=a;i<b;i++)
#define sort(a,b) sort(a.begin(),b.end())
#define reverse(a,b) reverse(a.begin(),b.end())
//gcd 最大公約数
//lcm 最小公倍数
//double 少数（変数）
//string 文字列（変数）
//sqrt 平方根
//ceil 天井関数
//floor 床関数
//abs 絶対値
//pow 累乗
//cbrt  立方根
//hypot 平方和の平方根
//(string-'0') 文字列を数字に変換
//vector<vector<int>> data(a,vector<b>(b)) a×b行列
//for(int i=0;i<a;i++)
//for(int j=0;j<b;j++)
//cin>>data.at(i).at(j)  a×b行列の入力
//floor(log10(a)+1) aの10進法での桁数

int main() {
  ll a,b;
  ci(a>>b);
  vec c(a);
  for(i,0,a)
    ci(c[i]);
  sort(c,c);
  ll d=0;
  reverse(c,c);
  for(i,0,b)
    d+=c[i];
  co(d);
  }

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long a,b;
map< long long, long long> prime_factor(int64_t n) {
map< long long, long long> ret;
  for(long long i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

long long	gcd( long long a, long long	b ){
	return	!b ? a : gcd( b, a % b );
}
signed main(){
    cin>>a>>b;
    long long cnt=0;
    map<long long, long long> mp = prime_factor(gcd(a,b));
    for(auto it=mp.begin();it!=mp.end();++it)cnt++;
    cout<<cnt+1<<endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<=n;i++)
main()
{
    int n,y;
    cin>>n>>y;
    rep(i,n)
    {
        if(i*1000>y)continue;
        rep(j,n)
        {
            if(i+j>n)continue;
            if(i*1000+j*5000+10000*(n-i-j)==y)
            {
                printf("%d %d %d\n",n-i-j,j,i);
                return 0;
            }
        }
    }
    puts("-1 -1 -1");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define fi first
#define se second
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define MOD 1000000007
#define mod 1000000007
#define pie 3.14159265358979323846264338327950L
#define N 200009
#define M 1e6 + 9
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define vecl vector<ll>
#define umap unordered_map<ll, ll>
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define endl "\n"
#define int long long
using namespace std;
 
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};  
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll lcm(ll a, ll b) { return (a*b)/ gcd(a,b);}
 

 
void test_case()
{
    
    
    
    int a , b;
    cin>>a>>b;

    int sum = 6;

    cout<<sum-a-b<<endl;


      



 
    
}
 
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(20);
 
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
 
    int t = 1;
    // cin >> t;
    while (t--)
    {
        test_case();
    }
}

Measured memory_bytes: 3568
package main

import (
	"bufio"
	"fmt"
	"os"
	"reflect"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() (int, error) {
	scanner.Scan()
	return strconv.Atoi(scanner.Text())
}

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func bubbleSort(arrOrig []string) []string {
	n := len(arrOrig)

	arr := make([]string, n)
	copy(arr, arrOrig)

	for i := 0; i < n; i++ {
		for j := n - 1; j > i; j-- {
			if arr[j][1] < arr[j-1][1] {
				temp := arr[j]
				arr[j] = arr[j-1]
				arr[j-1] = temp
			}
		}
	}
	return arr
}

func selectionSort(arrOrig []string) []string {
	n := len(arrOrig)

	arr := make([]string, n)
	copy(arr, arrOrig)

	for i := 0; i < n; i++ {
		minj := i
		for j := i; j < n; j++ {
			if arr[j][1] < arr[minj][1] {
				minj = j
			}
		}
		temp := arr[i]
		arr[i] = arr[minj]
		arr[minj] = temp
	}
	return arr
}

func insertionSort(arrOrig []string) []string {
	n := len(arrOrig)

	arr := make([]string, n)
	copy(arr, arrOrig)

	for i := 1; i < n; i++ {
		v := arr[i]
		j := i - 1
		for j >= 0 && arr[j][1] > v[1] {
			arr[j+1] = arr[j]
			j--
		}
		arr[j+1] = v
	}
	return arr
}

func printArr(arr []string) {
	fmt.Println(strings.TrimRight(fmt.Sprintf("%+v", arr)[1:], "]"))
}

func printStableorNot(arr1, arr2 []string) {
	if reflect.DeepEqual(arr1, arr2) {
		fmt.Println("Stable")
	} else {
		fmt.Println("Not stable")
	}
}

func main() {
	scanner.Split(bufio.ScanWords)

	size, _ := nextInt()
	arr := make([]string, size)
	for i := 0; i < size; i++ {
		arr[i] = nextString()
	}

	//	fmt.Println(arr)
	arrInsertion := insertionSort(arr)
	//	printArr(arrInsertion)

	arrBubble := bubbleSort(arr)
	printArr(arrBubble)
	printStableorNot(arrInsertion, arrBubble)

	arrSelection := selectionSort(arr)
	printArr(arrSelection)
	printStableorNot(arrInsertion, arrSelection)
}



Measured memory_bytes: 1176
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
#define yes cout<<"YES"<<"\n"
#define no cout<<"NO"<<"\n"

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

	int n,m;
	cin>>n>>m;
	priority_queue<int>pq;
	vvi in(n,vi(2));
	rep(i,n)rep(j,2)cin>>in[i][j^1];
	sort(all(in));
	vi used(n);
	int sum=0;
	int out=0;
	int c=0;
	for(int i=n-1;i>=0;i--){
		if(n-i>m){
			if(pq.size()==0)break;
			sum+=pq.top();
			pq.pop();
		}
		if(used[in[i][1]-1])pq.push(-in[i][0]);
		else c++;
		sum+=in[i][0];
		used[in[i][1]-1]=1;
		cmax(out,sum+c*c);
	}
	cout<<out<<endl;
}






Measured memory_bytes: 7164
import copy

def discomfort(dic, n):
    global Pirates, expenses, c
    if expenses != None and sum(p_res) >= expenses:
        return
    if n == c:
        if n == g_n:
            c = s_n
            discomfort(l_dic, g_n)
            c = g_n
            return
        else:
            expenses = sum(p_res)
            Pirates = r-(sum(p_res)+p)
            return
    for v in dic[n]:
        c_l_dic = copy.deepcopy(dic)
        c_l_dic[n].remove(v)
        c_l_dic[v].remove(n)
        p_res.append(p_dic[(n,v)])
        load.append(v)
        discomfort(c_l_dic, v)
        del p_res[-1]
        del load[-1]

if __name__ == '__main__':
    t_c = int(raw_input())
    
    l_dic = {}
    p_dic = {}
    for i in range(input()):
        n1, n2, p1, p2 = map(int, raw_input().split(','))
        if not n1 in l_dic:
            l_dic[n1] = [n2]
            if not n2 in l_dic:
                l_dic[n2] = [n1]
            else:
                l_dic[n2].append(n1)
        else:
            l_dic[n1].append(n2)
            if not n2 in l_dic:
                l_dic[n2] = [n1]
            else:
                l_dic[n2].append(n1)
        p_dic[(n1,n2)] = p1
        p_dic[(n2,n1)] = p2
    
    s_n, g_n, r, p = map(int, raw_input().split(','))
    c = g_n
    Pirates = 0
    p_res = []
    load = [s_n]
    expenses = None
    discomfort(l_dic, s_n)
    print Pirates

Measured memory_bytes: 4408
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
ll mod=1000000007;
vector <int> vec[2000009];
int vis[200009];
int cnt;
void dfs(int cur)
{
  vis[cur]=1;
  cnt++;
  for(int i:vec[cur])
  {
    if(vis[i]!=1)
      dfs(i);
  }
}
int main()
{
  ll a,b,c,d,i,j,k,l,m,n,ans=0;
  cin>>n>>m;
  for(i=0;i<m;i++)
  {
    cin>>a>>b;
    vec[a].pb(b);
    vec[b].pb(a);
  }
  for(i=1;i<=n;i++)
  {
    if(vis[i]==0)
    {
      cnt=0;
      dfs(i);
      ans=max(ans,1LL*cnt);
    }
  }
  cout<<ans<<endl;


}

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

class Process
{
private:
  int time;

public:
  string name;

  Process():
    time(0),
    name("")
  {}

  Process(const string& str, const int& num):
    time(num),
    name(str)
  {}

  int excute(const int& quantum)
  {
    if (quantum < time)
    {
      time -= quantum;
      return quantum;
    }
    else
    {
      int temp = time;
      time = 0;
      return temp;
    }
  }

  bool is_complete()
  {
    return time == 0;
  }
};

class PsQueue
{
private:
  Process data[100000];
  int head;
  int tail;

public:
  PsQueue():
    head(0),
    tail(0)
  {}

  void enqueue(const Process& process)
  {
    data[tail] = process;
    if (tail == (100000 - 1))
    {
      tail = 0;
    }
    else
    {
      ++tail;
    }
  }

  Process dequeue()
  {
    Process ps_head = data[head];
    if (head == (100000 - 1))
    {
      head = 0;
    }
    else
    {
      ++head;
    }

    return ps_head;
  }

  bool is_empty()
  {
    return head == tail;
  }
};

int main()
{
  int n = 0;
  int quantum = 0;
  cin >> n >> quantum;

  string str = "";
  int num = 0;
  Process a_process;
  PsQueue ps_queue;
  for (int i = 0; i < n; ++i)
  {
    cin >> str >> num;
    a_process = Process(str, num);
    ps_queue.enqueue(a_process);
  }

  int total = 0;
  Process cur_process;
  while (true)
  {
    // All processes complete
    if (ps_queue.is_empty()) break;

    // Excute the head process and add excution time
    cur_process = ps_queue.dequeue();
    total += cur_process.excute(quantum);

    // If the process is complete, then output a line
    if (cur_process.is_complete())
    {
      cout << cur_process.name
           << ' '
           << total
           << endl;
    }
    // If the process is NOT complete, then add to queue again
    else
    {
      ps_queue.enqueue(cur_process);
    }
  }

  return 0;
}


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

m = 0
im = 0
for i, ai in enumerate(a):
  if abs(ai) >= abs(m):
    m = ai
    im = i
print(2*n-1)

for i in range(n):
  print(im+1, i+1)

if m > 0:
  for i in range(0, n-1):
    print(i+1, i+2)
else:
  for i in reversed(range(1, n)):
    print(i+1, i)
    


Measured memory_bytes: 9228
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define ld long double
#define pb push_back
const ll mod=1e9+7;
template<typename T> T pow(T a,T b, long long m){T ans=1; while(b>0){ if(b%2==1) ans=(ans*a)%m; b/=2; a=(a*a)%m; } return ans%m; }

const ll N=1e6+8;
const ll INF=1e18;
ll n;
ll a[26][26];
ll dp[21][1<<21];
ll add(ll a, ll b) {
	a += b;
	if(a >= mod) return a - mod;
	return a;
}
ll memo(int i, int msk) {
	if(i == n) return 1;
	if(dp[i][msk] != -1) return dp[i][msk];
	ll res = 0;
	for(int j=0; j<n; j++) {
		if(a[i][j] == 1 && (msk&(1<<j)) == 0) {
			res = add(res, memo(i+1, msk|(1<<j)));
		}
	}
	return dp[i][msk] = res;
}

int main() {
IOS;
	cin >> n;
	for(int i=0; i<n; i++) for(int j=0; j<n; j++) cin >> a[i][j];
	memset(dp, -1, sizeof dp);
	cout << memo(0, 0) << endl;
	return 0;
}

Measured memory_bytes: 344320
#include<bits/stdc++.h>
using namespace std;
int main(){
int a;
cin>>a;
if(a>=400 && a<600)
    cout<<'8'<<endl;
else if(a>=600 && a<800)
    cout<<'7'<<endl;
    if(a>=800 && a<1000)
    cout<<'6'<<endl;
    if(a>=1000 && a<1200)
    cout<<'5'<<endl;
    if(a>=1200 && a<1400)
    cout<<'4'<<endl;
    if(a>=1400 && a<1600)
    cout<<'3'<<endl;
    if(a>=1600 && a<1800)
    cout<<'2'<<endl;
    if(a>=1800 && a<2000)
    cout<<'1'<<endl;
return 0;}


Measured memory_bytes: 3632
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
/**
 *
 * @author arvin
 */
public class Main {
    
    static int a[][]=new int[23][23];
    static int n;
    static long ch[]=new long[42000000];
    static int women[]=new int[23];
    //static HashMap<Long,Long> hp=new HashMap<>();
    
    static long rec(int i,long k)
    {
        if(i==n)
            return 1l;
        //long val=hp.getOrDefault(k,-1l);
        long val=ch[(int)k];
        if(val!=-1l)
            return val;
        
        
        long x=0l;
        for(int z=1;z<=n;z++)
        {
            if(a[i+1][z]==1 && women[z]!=1)
            {
                //System.out.println((i+1)+" "+z);
                women[z]=1;
                
                long tm=((long)k|(long)(1<<z));
                //val=hp.getOrDefault(tm,-1l);
                val=ch[(int)tm];
                if(val!=-1l)
                    x+=val;
                else
                {
                    long v=rec(i+1,tm);
                    v=v%1000000007l;
                    x+=v;
                    ch[(int)tm]=v;
                    //hp.put(tm,v);
                }
                x=x%1000000007l;
                women[z]=0;
            }
        }
        x=x%1000000007l;
        return x;
    }
    
    public static void main(String args[]) throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        Arrays.fill(ch,-1l);
        n=Integer.parseInt(br.readLine());
        for(int i=1;i<=n;i++)
        {
            String ab[]=br.readLine().split(" ");
            for(int j=1;j<=n;j++)
                a[i][j]=Integer.parseInt(ab[j-1]);
        }
        
        long t=0l;
        for(int i=1;i<=n;i++)
        {
            if(a[1][i]==1)
            {
                women[i]=1;
                long tm=(long)1<<i;
                //long val=hp.getOrDefault(tm,-1l);
                long val=ch[(int)tm];
                if(val!=-1l)
                    t+=val;
                else
                {
                    long v=rec(1,tm);
                    v=v%1000000007l;
                    ch[(int)tm]=v;
                    //hp.put(tm,v);
                    t+=v;
                }
                t=t%1000000007l;
                women[i]=0;
            }
        }
        t=t%1000000007l;
        System.out.println(t);
    }
}


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


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

  vector<int> d;

  while(N--){
    int x;
    cin >> x;
    d.push_back(x);
  }

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

  int ans = 0;
  int a = 0;

  for(int i=0; i < d.size(); i++){
    if(a < d[i]){
      ans++;
    }
    a = d[i];
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define rep(i,m,n) for(int (i)=(int)(m);(i)<(int)(n);(i)++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;(i)>=(int)(m);(i)--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9+7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;


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;
}

struct Edge {
	int to, cap, rev;
	Edge(int _to, int _cap, int _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, int from, int to, int cap, bool revFlag, int revCap) {
	G[from].push_back(Edge(to, cap, G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, G[from].size() - 1));
}

void solve() {
	ll n, m;
	cin >> n >> m;

	ll ans = 0;
	ans += n * (n - 1)/2;
	ans += m * (m - 1)/2;
	cout << ans << en;
}

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

	solve();
	//int t; cin >> t; REP(i, t) solve();

	return 0;
}


Measured memory_bytes: 256
def dfs(i, f, sum):
    if i == 3:
        if sum == 7:
            # 答えは1つ出力すれば良いので =7 になれば終了
            print(f + "=7")
            exit()

    else:
        # 式 f の末尾に符号と次の数字を追加し、その分 sum に加減する
        dfs(i + 1, f + "-" + s[i + 1], sum - int(s[i + 1]))
        dfs(i + 1, f + "+" + s[i + 1], sum + int(s[i + 1]))


s = input()

dfs(0, s[0], int(s[0]))

Measured memory_bytes: 9100
#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#pragma comment(linker, "/STACK:400000000")

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(it=X.begin();it!=X.end();it++)
#define iss istringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sst stringstream
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int a,L,mem[1000011],p10[7]={1};

int main(){
	rep2(i,1,7)p10[i]=p10[i-1]*10;
	while(cin>>a>>L && L){
		fill(mem,mem+1000011,-1);
		int t=0;
		while(1){
			if(mem[a]!=-1){
				cout<<mem[a]<<" "<<a<<" "<<t-mem[a]<<endl;
				break;
			}
			mem[a]=t;
			vi v;
			rep(i,L)v.pb(a/p10[i]%10);
			sort(v.begin(),v.end());
			int mi=0,ma=0;
			rep(i,L)mi=mi*10+v[i];
			reverse(v.begin(),v.end());
			rep(i,L)ma=ma*10+v[i];
			a=ma-mi;
			t++;
		}
	}
}

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

int main() {
    using namespace std;
    constexpr unsigned long MOD = 1000000007;
    unsigned long N;
    cin >> N;
    vector<vector<unsigned long>> edge(N);
    for(unsigned long i = 0; i < N; ++i)edge[i].resize(N - i - 1);
    [&N, rec = [&edge](auto f, auto l, auto r, auto lower) -> void{
        if(l + 1 >= r)return;
        auto mid = (l + r) / 2;
        for(unsigned long i = l; i < mid; ++i)for(unsigned long j = mid; j < r; ++j)edge[i][j - i - 1] = lower;
        f(f, l, mid, lower + 1);
        f(f, mid, r, lower + 1);
    }]{rec(rec, 0, N, 1);}();
    for(const auto& i : edge){
        for(const auto& j : i)cout << j << " ";
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 1536
"""
python3 main.py < input.txt
"""
import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
m=min([a, b, c, d, e])
times=int(math.ceil(n/m))
print(times+4)

Measured memory_bytes: 3060
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int p = scan.nextInt();
        int m = scan.nextInt();
        int c = scan.nextInt();
        System.out.println(p+m+c);
        
        
        }
        
    }





Measured memory_bytes: 26152
#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use num_traits::clamp;
use ordered_float::OrderedFloat;
use proconio::{input, marker::*, fastout};
use superslice::*;

#[fastout()]
fn main() {
    input! {
        n: usize,
        ab: [(Usize1, Usize1); n-1]
    }

    let mut graph = vec![Vec::new(); n];
    for (a, b) in ab {
        graph[a].push(b);
        graph[b].push(a);
    }

    let mut route = vec![n; n];
    let mut que = VecDeque::new();
    que.push_back((0, 0));
    while let Some((node, prev)) = que.pop_front() {
        route[node] = prev;
        for &next in &graph[node] {
            if route[next] == n {
                que.push_back((next, node));
            }
        }
    }

    let mut trunk = VecDeque::new();
    let mut pos = n-1;
    while route[pos] != 0 {
        trunk.push_front(route[pos]);
        pos = route[pos];
    }

    let mut visited = vec![false; n];
    let mut lque = VecDeque::new();
    visited[0] = true;
    lque.push_back(0);
    let mut sque = VecDeque::new();
    visited[n-1] = true;
    sque.push_back(n-1);
    while let Some(node) = trunk.pop_front() {
        visited[node] = true;
        lque.push_back(node);
        if let Some(node) = trunk.pop_back() {
            visited[node] = true;
            sque.push_back(node);
        }
    }

    while let Some(node) = lque.pop_front() {
        for &next in &graph[node] {
            if !visited[next] {
                visited[next] = true;
                lque.push_back(next);
            }
        }
        if let Some(node) = sque.pop_front() {
            for &next in &graph[node] {
                if !visited[next] {
                    visited[next] = true;
                    sque.push_back(next);
                }
            }
        } else {
            println!("Fennec");
            return;
        }
    }
    println!("Snuke");
}


Measured memory_bytes: 11608
#include <unistd.h>
#include <cstdio>
#include <x86intrin.h>
#include <algorithm>

typedef long long ll;
int mat[3000][3000]; 
ll dp0[3000] __attribute((aligned(32)));

char buf[1048576];
int lim = 0;
int cur = 0;

void refill()
{
    lim = read(STDIN_FILENO, buf, sizeof buf);
    cur = 0;
}

int rd()
{
    while (true) {
        if (cur == lim) {
            refill();
            if (lim == 0) return -1;
        } else {
            if (buf[cur] >= '0' && buf[cur] <= '9') break;
            cur++;
        }
    }
    int acc = buf[cur++] - '0';
    while (true) {
        if (cur == lim) {
            refill();
            if (lim == 0) return acc;
        } else {
            if (buf[cur] < '0' || buf[cur] > '9') return acc;
            acc = acc * 10 + buf[cur++] - '0';
        }
    }
}

#pragma clang attribute push(__attribute__((target("avx512vl"))), apply_to=function)
int main(int argc, char **argv)
{
    int rr = rd();
    int cc = rd();
    int k  = rd();

    for (int i = 1; i <= k; i++) {
        int r = rd();
        int c = rd();
        int v = rd();
        mat[r - 1][c - 1] = v;
    }
    for (int y = 0; y < rr; y++) {
        __m256i work = _mm256_setzero_si256();
        for (int x = 0; x < cc; x++) {
            __m256i tmp = _mm256_maskz_set1_epi64(1, dp0[x]);
            work = _mm256_max_epi64(work, tmp);
            __m256i v = _mm256_set1_epi64x(mat[y][x]);
            __m256i s = _mm256_permutex_epi64(work, (2 << 6) + (1 << 4));
            s = _mm256_maskz_add_epi64(14, s, v);
            work  = _mm256_max_epi64(work, s);
            /*
            __m256i s2 = _mm256_permutex_epi64(work, (1 << 6) + (0 << 4) + (3 << 2) + (2 << 0));
            __m256i s3 = _mm256_max_epi64(work, s2);
            __m256i s4 = _mm256_permutex_epi64(s3, 5);
            __m256i s5 = _mm256_max_epi64(s3, s4);
            */
            __m128i s2 = _mm256_extractf128_si256(work, 0);
            __m128i s3 = _mm256_extractf128_si256(work, 1);
            __m128i s4 = _mm_max_epu64(s2, s3);
            ll s5 = _mm_extract_epi64(s4, 0);
            ll s6 = _mm_extract_epi64(s4, 1);

            dp0[x] = std::max(s5, s6);

        }
    }
    std::printf("%lld\n", dp0[cc - 1]);
    return 0;
}
#pragma clang attribute pop

Measured memory_bytes: 39376
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

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

  ll n;
  cin >> n;
  vl a(n);
  rep(i, n) {
    cin >> a[i];
  }

  ll ans = 0;
  rep(i, n) {
    while (i < n && a[i+1] > a[i]) {
      i++;
    }

    ans++;
  }

  cout << ans << endl << n << endl;
}



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

int main() {
    int N,M,C,sum;
    cin >> N >> M >> C;
    vector<int> B(M);
    sum = C;
    int number = 0;

    for (int i = 0; i < M; i++) {
        cin >> B.at(i);
    }

    for (int i = 0; i < N; i++) {
        vector<int> A(M);
        for (int j = 0; j < M; j++) {
            cin >> A.at(j);
            sum+= A.at(j)*B.at(j);
        }

        if (sum > 0) {
            number++;
        }

        sum = C;

    }

    cout << number << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin >> a >> b;
    if(a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0)
    {
        cout << "Possible";
    }
    else
    {
        cout << "Impossible";
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cfloat>
#define curr(P, i) P[(i) % P.size()]
#define next(P, i) P[(i+1) % P.size()]
#define prev(P, i) P[(i+P.size()-1) % P.size()]

using namespace std;

double EPS = 1e-10;
const double PI = acos(-1);

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }

  bool operator < (const point &p) const {
    if(p.y != y)return y<p.y;
    return x < p.x;
  }
};

typedef vector<point> Polygon;

double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}

Polygon convex_hull(Polygon ps, int n){
  sort(ps.begin(),ps.end());
  int k=0;
  Polygon qs(n*2);

  for(int i=0;i<n;i++){
    while(k>1&&cross(qs[k-1]-qs[k-2],ps[i]-qs[k-1])<0)k--;
    qs[k++]=ps[i];
  }

  for(int i=n-2,t=k;i>=0;i--){
    while(k>t&&cross(qs[k-1]-qs[k-2],ps[i]-qs[k-1])<0)k--;
    qs[k++]=ps[i];
  }
  qs.resize(k-1);
  return qs;
}

int main(void){

  int n;
  cin >> n;
  Polygon pol(n);

  for(int i=0;i<n;i++)cin >> pol[i].x >> pol[i].y;

  Polygon ans=convex_hull(pol,n);

  cout << ans.size() << endl;
  for(int i=0;i<ans.size();i++)
    cout << ans[i].x << " " << ans[i].y << endl;

  return 0;
}

Measured memory_bytes: 7340
#include <bits/stdc++.h>
using namespace std;
using ll= long long;
#define rep(i,x,n) for(int i=x; i<n; i++)
#define all(x) x.begin(), x.end()
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;}

int main(){
  int n;
  bool ok=0;
  cin >> n;
  rep(i,0,3){
    if(n%10==7){
      ok=1;
    }
    n/=10;
  }
  if(ok){
    cout << "Yes";
  }else{
    cout << "No";
  }
}


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

int n,m;
int d[1010];
int c[1010];
int dp[1010][1010];
int ans;

int main(){
	
	//????????°n/m??\
	cin>>n>>m;
	for(int i=0;i<n;i++)cin>>d[i];
	for(int i=0;i<m;i++)cin>>c[i];
	
	for(int i=0;i<1010;i++){
		for(int j=0;j<1010;j++){
			dp[i][j]=1145141919;
		}
	}
	
	dp[0][0]=0;
	
	for(int i=0;i<m;i++){
		for(int j=0;j<n;j++){
			if(dp[i][j]==1145141919)continue;
			dp[i+1][j]=min(dp[i][j],dp[i+1][j]);
			dp[i+1][j+1]=min(dp[i][j]+d[j]*c[i],dp[i+1][j+1]);
		}
	}
	
	ans=1145141919;
	for(int i=0;i<=m;i++){
		ans=min(ans,dp[i][n]);
	}
	cout<<ans<<endl;
	
	return 0;
}


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



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


  	string s;
  	cin>>s;
  	for(int i=0;i<s.size();i++)
  		cout<<'x';
   	

	
    return 0;
		
}

Measured memory_bytes: 3612