akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define m_k make_pair
#define inf 0x3f3f3f3f
#define int long long
using namespace std;
const int N=1e5+100;
int x,y,a,b,c,p[N],q[N],r[N];
int s[N*3],ans;
bool cmp(int a,int b)
{
	return a>b;
}
signed main()
{
	scanf("%lld%lld%lld%lld%lld",&x,&y,&a,&b,&c);
	for (int i=1;i<=a;i++) scanf("%lld",&p[i]);
	for (int i=1;i<=b;i++) scanf("%lld",&q[i]);
	for (int i=1;i<=c;i++) scanf("%lld",&r[i]);
	sort(p+1,p+1+a,cmp);
	sort(q+1,q+1+b,cmp);
	for (int i=1;i<=x;i++) s[i]=p[i];
	for (int i=x+1;i<=x+y;i++) s[i]=q[i-x];
	for (int i=x+y+1;i<=x+y+c;i++) s[i]=r[i-x-y];
	sort(s+1,s+1+x+y+c,cmp);
	for (int i=1;i<=x+y;i++) ans+=s[i];
	printf("%lld\n",ans);
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) (x).begin(), (x).end()
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
  #define debug(x) cerr << #x " => " << (x) << endl
#else
  #define debug(x) 0
#endif
using lint = long long;
constexpr int    INF  = 1 << 29;
constexpr lint   INFL = 1LL << 61;
constexpr int    MOD  = (int)1e9 + 7;
constexpr double EPS  = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

int main(void) {
  int a;
  cin >> a;
  string s;
  cin >> s;
  cout << (a >= 3200 ? s : "red") << endl;
  return 0;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
info = [list(map(int, input().split())) for i in range(n)]

def solve(num):
    res = 0
    for i in range(n):
        if (info[i][0] | num) == num:
            res += info[i][1]
    return res


k = bin(k)[2::]
ans = 0
num = int(k,2)
ans = solve(num)

for i in range(len(k)):
    if k[i] == "1":
        num = int(k[0:i]+"0"+(len(k)-i-1)*"1", 2)
        ans = max(ans, solve(num))
print(ans)

Measured memory_bytes: 29424
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input! {
        k: usize,
        s: Chars
    };

    if s.len() <= k {
        println!("{}", s.iter().collect::<String>());
    } else {
        println!("{}{}", s[0..k].iter().collect::<String>(), "...");
    }
}

Measured memory_bytes: 2164
def read():
    N = int(input().strip())
    S, T = input().strip().split()
    return N, S, T

def solve(N, S, T):
    U = ['*'] * (N * 2)
    for i in range(N):
        U[i*2] = S[i]
        U[i*2+1] = T[i]
    return ''.join(U)


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))


Measured memory_bytes: 3060
import bisect
n = int(input())
a = [- int(input()) for i in range(n)]
tmp = [a[0]]
for i in range(1,n):
  idx=bisect.bisect_right(tmp,a[i])
  if idx==len(tmp):
    tmp.append(a[i])
  else:
    tmp[idx] =a[i]
print(len(tmp))

Measured memory_bytes: 7836
#include <bits/stdc++.h>                                           
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define int long long
//#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
 
 
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define all(x) x.begin(), x.end()
#define sz(s) (int)s.size()
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define s second
#define f first
 
 
 
 
typedef pair < long long, long long > pll;    
typedef pair < int, int > pii;  
typedef unsigned long long ull;         
typedef vector < pii > vpii;                                   	
typedef vector < int > vi;
typedef long double ldb;  
typedef long long ll;  
typedef double db;
 
typedef tree < int, null_type, less < int >, rb_tree_tag, tree_order_statistics_node_update > ordered_set;
 
const int inf = 1e9, maxn = 2e5 + 48, mod = 998244353, N = 1e5 + 512;
const int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1}, block = 300;
const pii base = mp(1171, 3307), Mod = mp(1e9 + 7, 1e9 + 9);
const db eps = 1e-12, pi = acos(-1);
const ll INF = 1e18;
 
string s;
int ans;

main () {
	cin >> s;
	if (s == "RRR") {
		cout << 3 << endl;
		return 0;
	}

	if (s == "SSS") {
		cout << 0 << endl;
		return 0;
	}

	if (s == "RRS" || s == "SRR") {
		cout << 2 << endl;
		return 0;
	}

	cout << 1 << endl;
		
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;

vector<vector<int>> e;
vector<int> o;
int n;

void dfs(int r){
    o[r]=n;
    for(int i=0; i<e[r].size(); i++){
        if(o[e[r][i]]==0){
            n++;
            dfs(e[r][i]);
        }
    }
    return;
}

int main(){
    int N;
    cin>>N;
    vector<int> a(N-1),b(N-1),c(N);
    int ans=0,m=0;
    for(int i=0; i<N-1; i++){
        cin>>a[i]>>b[i];
        a[i]--;b[i]--;
    }
    for(int i=0; i<N; i++){
        cin>>c[i];
        ans+=c[i];
        m=max(m,c[i]);
    }
    cout<<ans-m<<endl;
    e.resize(N);
    for(int i=0; i<N; i++){
        vector<int> a(0);
        e[i]=a;
    }
    for(int i=0; i<N-1; i++){
        e[a[i]].push_back(b[i]);
        e[b[i]].push_back(a[i]);
    }
    o.resize(N,0);
    n=1;
    dfs(0);
    sort(c.rbegin(),c.rend());
    for(int i=0; i<N; i++)cout<<c[o[i]-1]<<" ";
    return 0;
}

Measured memory_bytes: 1280
#include <algorithm>
#include <cstdio>
#include <cstring>

const int N = 1e6, P = 998244353;

int p[N + 5], mu[N + 5], xmu[N + 5], cnt;
bool f[N + 5];

void init() {
	f[1] = true, mu[1] = 1;
	for (int i = 2; i <= N; i++) {
		if (!f[i]) p[++cnt] = i, mu[i] = -1;
		for (int j = 1; j <= cnt && i * p[j] <= N; j++) {
			f[i * p[j]] = true;
			if (i % p[j])
				mu[i * p[j]] = -mu[i];
			else {
				mu[i * p[j]] = 0;
				break;
			}
		}
	}
	for (int i = 1; i <= N; i++)
		for (int j = i; j <= N; j += i) xmu[j] = (xmu[j] + i * mu[i] + P) % P;
}

int n, x, ans, c[N + 5];
int main() {
	init();
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%d", &x), c[x]++, ans = (ans + P - x) % P;
	for (int T = 1; T <= N; T++) {
		int la = 0;
		for (int i = 1; i <= N / T; i++) la = (la + 1ll * c[i * T] * i) % P;
		la = 1ll * la * la % P;
		ans = (ans + 1ll * la * T % P * xmu[T]) % P;
	}
	printf("%d\n", ((ans + P) * 499122177ll) % P);
}

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

using namespace std;

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

int M[100][100];
int d[100];
int n;
static const int INFTY = (1 << 21);

void bfs(int x) {
    queue<int> q;
    q.push(x);
    REP (i, n) d[i] = INFTY;

    d[x] = 0;
    while (!q.empty()) {
        int u;
        u = q.front();
        q.pop();
        REP(i, n) {
            if (M[u][i] == 0) continue;
            if (d[i] != INFTY) continue;
            d[i] = d[u] + 1;
            q.push(i);
        }
    }

    REP(i, n) {
        cout << i + 1 << " ";
        if (d[i] == INFTY) {
            cout << -1 << endl;
        } else {
            cout << d[i] << endl;
        }
    }
}

int main() {
    cin >> n;
    int v, m, k;
    REP(i, n) {
        cin >> v >> m;
        v--;
        REP(j, m) {
            cin >> k;
            k--;
            M[v][k] = 1;
        }
    }

    bfs(0);
    return 0;
}


Measured memory_bytes: 3104
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>

#define                           int                         long long
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);




using namespace std;

const int inf=1e18;
const int mod=1e9+7;
const int M=200009;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}

int a[M+3];
int n;
vector<int>adj[M+4];
int ses[M+3];
vector<int>::iterator it;
void dfs(int u,vector<int>&v,int par)
{
    it=lower_bound(v.begin(),v.end(),a[u]);
    int idx=-1,old;
    if(it==v.end())
    {
        v.pb(a[u]);
    }
    else
    {
       idx=it-v.begin();
       old=v[idx];
       v[idx]=a[u];
    }
    ses[u]=v.size();
    int sz=adj[u].size();
    for(int i=0;i<sz;i++)
    {
        int x=adj[u][i];
        if(x==par)continue;
        dfs(x,v,u);
    }
    if(idx==-1 && v.size())v.pop_back();
    else v[idx]=old;
}
 main()

{
    fast
    cin>>n;
    f(i,1,n)cin>>a[i];
    f(i,1,n-1)
    {
        int u,v;
        cin>>u>>v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    vector<int>vec;
    dfs(1,vec,-1);
    f(i,1,n)
    {
        cout<<ses[i]<<" ";
    }
    cout<<endl;
    return 0;

}













Measured memory_bytes: 32100
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <set>
#include <complex>
#include <cmath>
#include <cstring>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59
using ld = long double;

const int MAX = 510000;

ll dp[100010][4];

ll pow_mod(ll n, ll x)
{
    ll res = 1;
    while (n > 0)
    {
        if ((n & 1) == 1)
        {
            res *= x;
            res %= MOD;
        }
        x = x * x;
        x %= MOD;
        n >>= 1;
    }
    return res;
}

ll a[100010], c[100010], q[100010];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(5);

    int N, K;
    cin >> N >> K;

    int idx = 0;
    for (int i = 0; i < N; ++i)
    {
        cin >> a[i];
        if (a[i] == 1)
            idx = i;
    }

    if ((N - 1) % (K - 1) != 0)
    {
        cout << (N - 1) / (K - 1) + 1 << endl;
    }
    else
        cout << (N - 1) / (K - 1) << endl;
    return 0;
}

Measured memory_bytes: 2816
s=list(input())
ans="WA"
if s[0]=='A' and s[2:len(s)-1].count("C")==1 and s.count('C')==1:
    s.remove("C")
    s.pop(0)
    a="".join(s)
    if a.islower():
        ans='AC'
print(ans)

Measured memory_bytes: 3060
use std::io::prelude::*;

fn input<T: std::str::FromStr>() -> T {
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn with_stdout_lock<F: FnOnce(std::io::BufWriter<std::io::StdoutLock>)>(f: F) {
    let out = std::io::stdout();
    let w = std::io::BufWriter::new(out.lock());
    f(w);
}

fn main() {
    let k: i32 = input();
    let x: i32 = input();

    let mn = std::cmp::max(-1000000, x - k + 1);
    let mx = std::cmp::min(1000000, x + k - 1);
    with_stdout_lock(|mut w| {
        for i in mn..mx + 1 {
            write!(w, "{}{}", i, if i == mx { '\n' } else { ' ' }).unwrap();
        }
    });
}


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

int main(){
  string S;
  cin >> S;
  //ここまで入力

  int count = 0;
  //今見ている文字と，次に見る文字
  char now, next;
  rep(i, S.size()-1){
    now = S[i];
    next = S[i+1];
    //文字が異なった瞬間石を置く操作をしてけばよい
    if(now != next)
      count++;
  }
  
  cout << count << endl;

  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define X first
#define Y second
using namespace std;

typedef pair<int,int> pii;

const int N = 100005, inf = 1e9;

int n, mn = inf, ans;
pii a[N], pre[N], suf[N], c;

pii gyo (pii A, pii B) {
	return {max(A.X, B.X), min(A.Y, B.Y)};
}

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++) {
		scanf("%d%d",&a[i].X,&a[i].Y);
		mn = min(a[i].Y, mn);
	}
	sort(a+1, a+1+n);
	c = {1, inf};
	pre[0] = {1, inf};
	suf[n+1] = {1, inf};
	for(int i=1;i<=n;i++) {
		pre[i] = gyo(pre[i-1], a[i]);
	}
	for(int i=n;i>=1;i--) {
		suf[i] = gyo(suf[i+1], a[i]);
	}
	for(int i=1;i<=n;i++) {
		pii T = gyo(pre[i-1], suf[i+1]);
		ans = max(ans, a[i].Y - a[i].X + 1 + max(0, T.Y - T.X + 1));
	}
	for(int i=n;i>=1;i--) {
		if(i != n && c.X <= c.Y && a[i].X <= mn) {
			ans = max(ans, (c.Y - c.X + 1) + (mn - a[i].X + 1));
		}
		c = gyo(c, a[i]);
	}
	printf("%d\n", ans);
}


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

// clang-format off
#define rep(i, n) for(int i=0; i< (n); i++)
#define reps(i, a, n) for(int i=a; i < (n); i++)

const int INF{1001001001};
const int MOD{(int)1e9 + 7};
const double EPS{1e-9};
const double PI{acos(-1)};
const int dx[]{0, 1, 0, -1, 1, -1, 1, -1}, dy[]{1, 0, -1, 0, 1, -1, -1, 1};

int main(){
    int a,b,h;
    cin >> a >> b;
    h = (b-a)*(b-a)/2 - ((a+b)/2);
    cout << h;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <climits>
#include <set>
#include <unordered_set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>
#include <locale>
#include <random>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

//_(＾～＾ ｣ ∠)_

using LL = long long;

LL gcd(LL x, LL y) {
    return y == 0 ? x : gcd(y, x % y);
}

int main() {

    int N;
    cin >> N;

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

    LL ans = A[0];
    for (int i = 0; i < N; i++) ans = gcd(ans, A[i]);
    cout << ans;

    return 0;
}






















Measured memory_bytes: 1024
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
int GCD(int a, int b) {
	return b ? GCD(b, a%b) : a;
}
//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

using ll = long long;
using namespace std;


int main() {
	int a, b;
	cin >> a >> b;
	if (a >= 13) cout << b;
	else if (a < 13 && a>5) cout << b / 2;
	else if (a < 6) cout << 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<ld> vld;
typedef map<ll,ll> mpll;
typedef set<ll> setll;
typedef multiset<ll> msetll;
 
#define F first
#define S second
#define pb push_back
#define mp make_pair 

const ll inf = ll(1e18);
const ll MOD = (1e9 + 7);

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifdef DEBUG_
		freopen("input.txt","r",stdin);
	#endif
	cout.setf(ios::fixed), cout.precision(20);
    ll n;
    cin >> n;
    if(n%2==1) 
        cout<<0<<"\n";
    else{
        ll xx = n/2;
        ll cnt = 0;
        ll num = 5;
        while(xx/num>0){
            cnt+=(xx/num);
            num*=ll(5);
        }
        cout<<cnt<<"\n";
    }
        
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(long long i=0; i<(n); i++)
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; }
vector<long long> compress(vector<long long> v) {
    vector<long long> val;
    for (long long i = 0; i < v.size(); i++) val.push_back(v[i]);
    sort(val.begin(), val.end());
    val.erase(unique(val.begin(), val.end()), val.end());

    vector<long long> res;
    for (long long i = 0; i < v.size(); i++) {
        long long id = lower_bound(val.begin(), val.end(), v[i]) - val.begin();
        res.push_back(id);
    }
    return res;
}

struct UnionFind {

	vector<long long> data;

	UnionFind(long long size): data(size, -1) {}
	
	void unite(long long x, long long y){
		x = root(x);
		y = root(y);
		if( x != y ){
			if( data[y] < data[x] ) swap(x, y);
			data[x] += data[y];
			data[y] = x;
		}
	}

	bool same(long long x, long long y){
		return root(x) == root(y);
	}

	long long root(long long x){
		return (data[x] < 0) ? x : data[x] = root(data[x]);
	}

	long long size(long long x){
		return -data[ root(x) ];
	}
};

int main(){
    ll n; cin>>n;
    vector<ll> x(n), y(n);
    rep(i,n) cin>>x[i]>>y[i];
    x=compress(x);
    y=compress(y);
    vector<pair<ll,ll>> p(n), pp(n);
    rep(i,n) p[i] = {x[i], y[i]};
    rep(i,n) pp[i] = {y[i], x[i]};
    sort(p.begin(), p.end());
    ll res=0;

    UnionFind tree1(100001);
    rep(i,n-1){
        if(p[i].first == p[i+1].first) tree1.unite(p[i].second, p[i+1].second);
    }

    UnionFind tree2(100001);
    rep(i,n-1){
        if(pp[i].first == pp[i+1].first) tree2.unite(pp[i].second, pp[i+1].second);
    }

    vector<bool> used(100001, false);
    for(pair<ll,ll> pt : p){
        if(used[tree2.root(pt.first)]) continue;
        used[tree2.root(pt.first)]=true;
        // if(tree1.size(pt.first) == 1 || tree2.size(pt.second) == 1) continue;
        res += tree2.size(pt.first) * tree1.size(pt.second);
    }
    cout<<res - n <<endl;
    
    return 0;
}

Measured memory_bytes: 6708
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int n,m,h,w,a,b,c,d;
string str;

signed main(){

  cin >>a >> b>> c;
  if(a==b&& b==c) cout <<1;
  else if(a==b&&b!=c) cout <<2;
  else if(a!=b&&b==c) cout <<2;
  else if(a==c&&a!=b) cout <<2;
  else cout <<3;
  cout fin;

  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;



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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x, n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair< int, int > P;
typedef pair< int, P > PP;

//------------------------------------------------

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

	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;
	cout << min(a, min(b, c)) + min(d, e) - 50 << endl;

	return 0;
}




Measured memory_bytes: 3236
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9+7,MAX = 1e5;

int dp[10][2][7];
/*
dp[i][j][0]3のみ
dp[i][j][1]5のみ
dp[i][j][2]7のみ
dp[i][j][3]35のみ
dp[i][j][4]37のみ
dp[i][j][5]57のみ
dp[i][j][6]357のみ

*/


int main()
{
	string s,t;
	s="0";
	cin >>t;
	s = t;
	int sn = s.size();
	if(s[0]=='3')
	{
		dp[0][0][0]++;
	}
	if(s[0]=='5')
	{
		dp[0][0][1]++;
	}
	if(s[0]=='7')
	{
		dp[0][0][2]++;
	}
	//cout<<';'<<endl;
	for(int i = 1;i<sn;i++)
	{
		for(int j = 0;j<3;j++)
		{
			dp[i][1][j]++;
		}
	}
	for(char i = '3';i<s[0];i+=2)
	{
		dp[0][1][(i-'3')/2]++;
	}


	for(int i = 0;i<sn-1;i++)
	{
		if(s[i+1]=='3')
		{
			dp[i+1][0][0]+=dp[i][0][0];
			dp[i+1][0][3]+=dp[i][0][3];
			dp[i+1][0][4]+=dp[i][0][4];
			dp[i+1][0][6]+=dp[i][0][6];
			dp[i+1][0][3]+=dp[i][0][1];
			dp[i+1][0][4]+=dp[i][0][2];
			dp[i+1][0][6]+=dp[i][0][5];
		}
		if(s[i+1]=='5')
		{
			dp[i+1][0][1]+=dp[i][0][1];
			dp[i+1][0][3]+=dp[i][0][3];
			dp[i+1][0][5]+=dp[i][0][5];
			dp[i+1][0][6]+=dp[i][0][6];
			dp[i+1][0][3]+=dp[i][0][0];
			dp[i+1][0][5]+=dp[i][0][2];
			dp[i+1][0][6]+=dp[i][0][4];
		}
		if(s[i+1]=='7')
		{
			dp[i+1][0][2]+=dp[i][0][2];
			dp[i+1][0][4]+=dp[i][0][4];
			dp[i+1][0][5]+=dp[i][0][5];
			dp[i+1][0][6]+=dp[i][0][6];
			dp[i+1][0][4]+=dp[i][0][0];
			dp[i+1][0][5]+=dp[i][0][1];
			dp[i+1][0][6]+=dp[i][0][3];
		}
		for(char c='3';c<s[i+1];c+=2)
		{
			if(c=='3')
			{
				dp[i+1][1][0]+=dp[i][0][0];
				dp[i+1][1][3]+=dp[i][0][3];
				dp[i+1][1][4]+=dp[i][0][4];
				dp[i+1][1][6]+=dp[i][0][6];
				dp[i+1][1][3]+=dp[i][0][1];
				dp[i+1][1][4]+=dp[i][0][2];
				dp[i+1][1][6]+=dp[i][0][5];
			}
			if(c=='5')
			{
				dp[i+1][1][1]+=dp[i][0][1];
				dp[i+1][1][3]+=dp[i][0][3];
				dp[i+1][1][5]+=dp[i][0][5];
				dp[i+1][1][6]+=dp[i][0][6];
				dp[i+1][1][3]+=dp[i][0][0];
				dp[i+1][1][5]+=dp[i][0][2];
				dp[i+1][1][6]+=dp[i][0][4];
			}
			if(c=='7')
			{
			dp[i+1][1][2]+=dp[i][0][2];
			dp[i+1][1][4]+=dp[i][0][4];
			dp[i+1][1][5]+=dp[i][0][5];
			dp[i+1][1][6]+=dp[i][0][6];
			dp[i+1][1][4]+=dp[i][0][0];
			dp[i+1][1][5]+=dp[i][0][1];
			dp[i+1][1][6]+=dp[i][0][3];
			}
		}
		
				dp[i+1][1][0]+=dp[i][1][0];
				dp[i+1][1][3]+=dp[i][1][0];
				dp[i+1][1][4]+=dp[i][1][0];

				dp[i+1][1][1]+=dp[i][1][1];
				dp[i+1][1][3]+=dp[i][1][1];
				dp[i+1][1][5]+=dp[i][1][1];

				dp[i+1][1][2]+=dp[i][1][2];
				dp[i+1][1][4]+=dp[i][1][2];
				dp[i+1][1][5]+=dp[i][1][2];

				dp[i+1][1][3]+=dp[i][1][3];
				dp[i+1][1][3]+=dp[i][1][3];
				dp[i+1][1][6]+=dp[i][1][3];

				dp[i+1][1][4]+=dp[i][1][4];
				dp[i+1][1][6]+=dp[i][1][4];
				dp[i+1][1][4]+=dp[i][1][4];

				dp[i+1][1][5]+=dp[i][1][5];
				dp[i+1][1][5]+=dp[i][1][5];
				dp[i+1][1][6]+=dp[i][1][5];

				dp[i+1][1][6]+=dp[i][1][6];
				dp[i+1][1][6]+=dp[i][1][6];
				dp[i+1][1][6]+=dp[i][1][6];
		}

	
	//for(int i = 0;i<7;++i)cout<<dp[2][1][i]<<endl;
	cout<<dp[sn-1][0][6]+dp[sn-1][1][6]<<endl;
	return 0;
}

Measured memory_bytes: 256
const main = stdin => {
  const input = stdin.trim().split('\n')
  const [a, b] = input[0].split(' ').map(x => parseInt(x))

  const diff = b - a
  let sum = 0
  for (let i = 1; i <= 499500; i++) {
    sum += i
    if (sum - i === sum - diff) {
      break
    }
  }

  const snow = sum - b
  console.log(snow)
}


// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))


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

//#define int long long

typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}

int M,N;
int S[2222],T[2222];

int dp[2222][2222][2];

signed main(){
    string SS,TT;
    cin>>M>>N>>SS>>TT;
    rep(i,M)S[i]=SS[i]=='O';
    rep(i,N)T[i]=TT[i]=='O';

    rep(i,M+1)rep(j,N+1)rep(k,2){
        if(k==0)dp[i][j][k]=INT_MIN;
        else dp[i][j][k]=0;

        if(i&&S[i-1]==k){
            chmax(dp[i][j][k],dp[i-1][j][1-k]+1);
        }
        if(j&&T[j-1]==k){
            chmax(dp[i][j][k],dp[i][j-1][1-k]+1);
        }
    }

    int ma=0;
    rep(i,M+1)rep(j,N+1)chmax(ma,dp[i][j][0]);
    cout<<ma<<endl;
    return 0;
}

Measured memory_bytes: 36040
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define all(x) begin(x),end(x)
#define msi map<string,int>
#define pii pair<int,int>
#include <bits/stdc++.h>
#define pll pair<ll,ll>
#define vll vector<ll>
#define vi vector<int>
#define ld long double
#define ll long long
#define sh short int
#define pb push_back
#define mid (l+r)/2
#define S second
#define F first
using namespace std;
const int inf = 1e9+9;
const int mod = 1e9+7;
const int shift = 2e6;
int n,mx;
string s[200009];
set < string > se;
vector < string > v;
map < string , int > mp;
int main(){
    fast,cin>>n;
    for(int i=0;i<n;i++){
        cin>>s[i];
        mp[s[i]]++;
        se.insert(s[i]);
        mx = max(mx,mp[s[i]]);
    }
    for(auto it=se.begin();it!=se.end();it++){
        if(mp[*it] == mx) v.pb(*it);
    }
    sort(all(v));
    for(auto u:v){
        cout<<u<<endl;
    }
}


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

int main(){ 
	map<string, string> mp;
	mp["Sunny"] = "Cloudy";
	mp["Rainy"] = "Sunny";
	mp["Cloudy"] = "Rainy";
	string str;
	cin >> str;
	cout << mp[str] << "\n";
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int main()
{
    int m,d,i=1,c=0,j;
    scanf("%d%d",&m,&d);
    for(j=1;j<=d;j++){
        i=1;
        if((j%10)>=2 && (j/10)>=2 ){
            while(i<=m){
            if((j%10)*(j/10)==i) {
                c++;
                break;
            }
            i++;
            }
        }
    }
    printf("%d",c);
    return 0;
}


Measured memory_bytes: 128
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <vector>
#include <cassert>

class C {
public:
	void solve(std::istream& in, std::ostream& out) {
		int n;
        in >> n;
        std::vector<int> a(n), b(n);
        for (int i = 0; i < n; i++)
            in >> a[i];
        for (int i = 0; i < n; i++)
            in >> b[i];

        std::vector<int> eq(n, -1);
        std::vector<int> lte(n, -1);

        int before = 0;
        for (int i = 0; i < n; i++) {
            if (a[i] != before) {
                eq[i] = a[i];
            } else {
                lte[i] = a[i];
            }
            before = a[i];
        }

        auto range = [](int eq, int lte) {
            assert(eq == -1 || lte == -1);
            if (eq != -1)
                return std::pair<int,int>{eq, eq};
            else
                return std::pair<int,int>{1, lte};
        };

        auto intersect = [&](int eq1, int lte1, int eq2, int lte2) {
            auto r1 = range(eq1, lte1);
            auto r2 = range(eq2, lte2);
            int l = std::max(r1.first, r2.first);
            int r = std::min(r1.second, r2.second);
            return std::max(0, r - l + 1);
        };

        int64_t result = 1;

        before = 0;
        for (int i = n - 1; i >= 0; i--) {
            int eq2 = -1, lte2 = -1;
            if (b[i] != before) {
                eq2 = b[i];
            } else {
                lte2 = b[i];
            }
            before = b[i];
            result *= intersect(eq[i], lte[i], eq2, lte2);

            constexpr int kMod = 1000000000 + 7;
            result %= kMod;
        }

        out << result << "\n";
	}
};


int main() {
	C solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N;
    cin >> N;

    for(int i=1; i<=9; i++){
        for(int j=1; j<=9; j++){
            if(i*j==N){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i,k,n) for(int i = k; i < (int)(n); i++)
using namespace std;
int main(){
        int N,A,B;
        cin >> N >> A >> B;
        string ans = "Alice";
        if((B-A+1)%2==0) ans="Borys";
        cout << ans << endl;
        return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
namespace Sample
{
  class Sample
  {
    static void Main(string[] args)
    {
   string str=Console.ReadLine();
      if(str=="Sunny"){
        Console.WriteLine("Cloudy");
      }else if(str=="Cloudy"){
        Console.WriteLine("Rainy");
      }else{
        Console.WriteLine("Sunny");
      }
     
    }
    
  }

}


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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

pll A[100005];
ll U[100005];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll K, N;
    cin >> N >> K;
    REP(i, N) {
        cin >> A[i].first >> A[i].second;
    }

    sort(A, A + N, [](pll a, pll b) { return a.second > b.second; });
    memset(U, 0, sizeof(U));
    ll ans = 0;

    priority_queue<pll, vector<pll>, function<bool(pll, pll)>> q([](pll a, pll b) { return a.second > b.second; });
    ll k = 0;
    ll x = 0;

    ll sum = 0;
    REP(i, N) {
        k++;
        if (k <= K) {
            sum += A[i].second;
            U[A[i].first]++;
            if (U[A[i].first] > 1) {
                q.push(A[i]);
            }
            else {
                x++;
            }
            ans = std::max(ans, sum + x * x);
            continue;
        }

        if (U[A[i].first] > 0)
            continue;

        if (!q.empty()) {
            pll t = q.top();
            q.pop();
            sum = sum - t.second + A[i].second;
            U[A[i].first]++;
            x++;
            ans = std::max(ans, sum + x * x);
        }
    }

    cout << ans << endl;

    return 0;
}

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


int main(void){
    // Your code here!
    int n, m, x, y;
    cin>>n>>m>>x>>y;
    
    vector<int> a(n), b(m);
    
    for(int i=0; i<n; i++){
        cin>>a[i];
    }
    for(int i=0; i<m; i++){
        cin>>b[i];
    }
    
    int mx=-101, my=101;
    
    for(int i=0; i<n; i++){
        mx=max(mx, a[i]);
    }
    for(int i=0; i<m; i++){
        my=min(my, b[i]);
    }
    
    
    if(my-mx>=1){
        bool bb=false;
        for(int j=mx+1; j<=my; j++){
            if(j>x&&j<=y){
                bb=true;
                break;
            }
        }
        
        if(bb){
            cout<<"No War"<<endl;
        }else{
            cout<<"War"<<endl;
        }
    }else{
        cout<<"War"<<endl;
    }
}


Measured memory_bytes: 256
n = int(input())
s1 = input()
s2 = input()
mod = 10**9+7
ans = 3
i = 0
j = -1
while i < n:
    if s1[i] == s2[i]:
        if j == 0:
            ans *= 2
        i += 1
        j = 0
    else:
        if j == 1:
            ans *= 3
        else:
            ans *= 2
        j = 1
        i += 2
    ans %= mod
print(ans)


Measured memory_bytes: 38464
#include <iostream>


int main(){
    int L,R,d,ans;
    std::cin >> L >> R >> d;
    ans=0;
    for (int i=L;i<=R;i++){
        
        if (i%d==0){
            ans++;
        }
    }
    
    std::cout << ans << std::endl;


}


Measured memory_bytes: 3632
#pragma GCC optimize (2)
#pragma G++ optimize (2)
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
#define inf (1ll<<61)
#define MAX 2015
using namespace std;
//char nc()
//{
//	static char buf[100000],*p1=buf,*p2=buf;
//	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
//}
char nc(){return getchar();}
int read()
{
	int x=0,y=1;
	char c=nc();
	while(!isdigit(c))
	{
		if(c=='-')y=-1;
		c=nc();
	}
	while(isdigit(c))
	{
		x=(x<<1)+(x<<3)+(c^48);
		c=nc();
	}
	return x*y;
}
int n,head[MAX],last[MAX],cnt=1,S,T,NUM;
struct edge{
	int next,to,flow;
	long long cost;
}a[MAX*24];
void add(int x,int y,int z,long long c)
{
	a[++cnt].next=head[x];
	a[cnt].to=y;
	a[cnt].flow=z;
	a[cnt].cost=c;
	head[x]=cnt;
	a[++cnt].next=head[y];
	a[cnt].to=x;
	a[cnt].flow=0;
	a[cnt].cost=-c;
	head[y]=cnt;
}
long long d[MAX],ANS=0;
int inqueue[MAX],vst[MAX];
bool spfa()
{
	queue<int> q;
	for(int i=1;i<=NUM;i++)
		d[i]=-inf;
	d[T]=0;inqueue[T]=1;
	q.push(T);
	while(!q.empty())
	{
		int x=q.front();
		q.pop();
		inqueue[x]=0;
		for(int i=head[x];i;i=a[i].next)
		{
			int t=a[i].to;
			if(a[i^1].flow&&d[t]<d[x]+a[i^1].cost)
			{
				d[t]=d[x]+a[i^1].cost;
				if(!inqueue[t])
				{
					inqueue[t]=1;
					q.push(t);
				}
			}
		}
	}
	return d[S]>-inf;
}
int dfs(int x,int maxf)
{
	vst[x]=1;
	if(x==T) return maxf;
	int used=0,dlt;
	for(int i=last[x];i;i=a[i].next)
	{
		int t=a[i].to;
		if(!vst[t]&&a[i].flow&&d[x]==d[t]+a[i].cost)
		{
			dlt=dfs(t,min(maxf-used,a[i].flow));
			ANS+=a[i].cost*dlt;
			a[i].flow-=dlt;
			a[i^1].flow+=dlt;
			used+=dlt;
			if(used==maxf)
			{
				vst[x]=0;
				break;
			}
		}
		last[x]=i;
	}
	return used;
}
int zkw()
{
	int ans=0;
	while(spfa())
	{
		memset(vst,0,sizeof(vst));
		memcpy(last,head,sizeof(head));
		vst[T]=1;
		while(vst[T])
		{
			vst[T]=0;
			ans+=dfs(S,INF);
		}
	}
	return ans;
}
int main()
{
	n=read();
	NUM=n*2;S=++NUM;T=++NUM;
	int x,y,z;
	for(int i=1;i<=n;i++)
	{
		x=read();y=read();z=read();
		add(S,i,z,0);
		add(i,NUM+1,INF,x+y);
		add(i,NUM+2,INF,-x+y);
		add(i,NUM+3,INF,x-y);
		add(i,NUM+4,INF,-x-y);
	}
	for(int i=1;i<=n;i++)
	{
		x=read();y=read();z=read();
		add(i+n,T,z,0);
		add(NUM+1,i+n,INF,-x-y);
		add(NUM+2,i+n,INF,x-y);
		add(NUM+3,i+n,INF,-x+y);
		add(NUM+4,i+n,INF,x+y);
	}
	NUM+=4;
	zkw();
	printf("%lld",ANS);
	return 0;
}


Measured memory_bytes: 4220
#include<bits/stdc++.h>
using namespace std;
const int N=5e5+5,inf=1e9+5;
int n,K;
int head[N],ce,deg[N];
struct edge{int to,nxt;} e[N<<1];
int p[N],a[N],ord[N],ans[N],cnt;
struct Segtree{int l,r,minx;} tr[N<<2];
void Build(int l,int r,int k)
{
	tr[k].l=l,tr[k].r=r,tr[k].minx=inf;
	if(l==r) return;
	int mid=(l+r)>>1;
	Build(l,mid,k<<1); Build(mid+1,r,k<<1|1);
}
void Insert(int x,int k)
{
	if(tr[k].l==tr[k].r)
	{
		tr[k].minx=p[x];
		return;
	}
	int mid=(tr[k].l+tr[k].r)>>1;
	if(mid>=x) Insert(x,k<<1);
	else Insert(x,k<<1|1);
	tr[k].minx=min(tr[k<<1].minx,tr[k<<1|1].minx);
}
int Query(int l,int r,int k)
{
	if(l>r) return inf;
	if(l<=tr[k].l && tr[k].r<=r)
		return tr[k].minx;
	int ret=inf,mid=(tr[k].l+tr[k].r)>>1;
	if(l<=mid) ret=min(ret,Query(l,r,k<<1));
	if(r>mid) ret=min(ret,Query(l,r,k<<1|1));
	return ret;
}
void topsort()
{
	priority_queue<pair<int,int> > Q;
	for(int i=1;i<=n;++i) if(!deg[i]) Q.push(make_pair(-a[i],i));
	while(!Q.empty())
	{
		int u=Q.top().second; Q.pop();
		ord[++cnt]=u;
		for(int i=head[u];i;i=e[i].nxt)
		{
			int v=e[i].to;
			if(!--deg[v]) Q.push(make_pair(-a[v],v));
		}
	}
}
void adde(int a,int b)
{ 
	e[++ce].to=b,e[ce].nxt=head[a],head[a]=ce,++deg[b];
}
int main()
{
	//freopen("permutation.in","r",stdin); freopen("permutation.out","w",stdout);
	scanf("%d%d",&n,&K);
	for(int i=1;i<=n;++i) scanf("%d",&p[i]);
	for(int i=1;i<=n;++i) a[p[i]]=i;
	Build(1,n,1);
	for(int i=n;i>=1;--i)
	{
		int x=Query(a[i]+1,min(a[i]+K-1,n),1);
		if(x<inf) adde(i,x);
		x=Query(max(a[i]-K+1,1),a[i]-1,1);
		if(x<inf) adde(i,x);
		Insert(a[i],1);
	}
	topsort();
	for(int i=1;i<=n;++i) ord[i]=a[ord[i]];
	for(int i=1;i<=n;++i) ans[ord[i]]=i;
	for(int i=1;i<=n;++i) printf("%d\n",ans[i]);
	return 0;
}

Measured memory_bytes: 38492
/*/ Author:amar1503/*/
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("Ofast")
#define fio ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ull unsigned long long
#define ll long long
#define inf INT_MAX
#define mninf INT_MIN
#define Mod 1000000007
#define endl "\n"
#define cp(x) cout<<(x)<<" "
#define cl(x) cout<<(x)<<endl
#define nl   cout<<endl
//const double PI=3.1415926535897932384626433832;
//looping
#define For(i,a,b) for(int i=a;i<b;i++)
#define test(t)  int (t); cin>>(t); while((t)--)
#define array(a,n) int (n); cin>>(n); int a[n]; for(int i=0;i<(n);i++) cin>>a[i];
#define trace(x) clog<<#x<<": "<<x<<" "<<endl
#define trace2(x,y) clog<<#x<<": "<<x<<"     "<<#y<<" "<<y<<endl
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define printa(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
#define printv(v)  for(int i=0;i<(v).size();i++) cout<<v[i]<<" "
//containers
#define F first
#define S second
#define pb emplace_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define all(v) (v).begin(),(v).end()
#define mp make_pair
#define itr(it, a) for(auto it = (a).begin(); it != (a).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ers(v)   sort(all(v)); (v).erase(unique(all(v)),(v).end())
#define printmatrix(a,n,m) for(int i=0;i<n;i++){ for(int j=0;j<m;j++) cout<<a[i][j]<<" "; cout<<endl;}
typedef vector<int> vi;
typedef vector< vector< int > > vvi;
typedef pair <int, int> pii;
typedef vector < pair <int, int> > vpii;
// cout<<"\nTime Elapsed : " << 1.0*clock() /CLOCKS_PER_SEC << " s\n";
//#define int long long
/*/-----------------------------Code begins----------------------------------/*/
int32_t main(){
int n;
cin>>n;
set<int> s;

int x;
For(i,0,n)
{
    cin>>x;
    s.insert(x);
}
if(s.size()==n)
    cout<<"YES\n";
else cout<<"NO\n";
}//2 3 2


























Measured memory_bytes: 9600
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	string S;
	int w;
	cin >> S >> w;
	int s = S.l_ength();
	int i = 0;
	while( i < s ){
		cout << S[i];
		i += w;
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,n,m;
    string str;
    cin>>str;
    if(str=="Cloudy")
    {
        cout<<"Rainy"<<endl;
    }
    else if(str=="Sunny")
    {
        cout<<"Cloudy"<<endl;
    }
    else if(str=="Rainy")
    {
        cout<<"Sunny"<<endl;
    }
    return 0;
}

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

#ifdef LOCAL
#include "../dump.hpp"
#else
#define dump(...)
#endif

#define rep(i,n) for(ll i=0,i##_cond=(n);i<i##_cond;i++)
#define FOR(i,a,b) for(ll i=(a),i##_cond=(b);i<i##_cond;i++)
#define ROF(i,a,b) for(ll i=(a)-1,i##_cond=(b);i>=i##_cond;i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;

const ll inf = 1ll<<62;
const ll mod = 1e9+7;

#define int ll

main()
{
  map<pii,int> mp;
  int n; cin >> n;
  rep(i,n){
    int x,y,w; cin >> x >> y >> w;
    rep(j,2) rep(k,2)
      mp[pii(x+j,y+k)] += w;
  }
  int maxv = 0;
  for(auto x : mp)
    maxv = max(maxv, x.snd);
  cout << maxv << " / 1\n";
}


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

int main(){
  int n,m;
  cin>>n>>m;
  char s[n+1][m+1];
  int f[n+1][m+1];
  for (int i = 1; i <=n; i++){
    for (int j = 1; j <=m; j++){ 
      cin>>s[i][j];
    }
  }
  for (int i = 1; i <=n; i++){
    for (int j = 1; j <=m; j++){ 
      f[i][j]=INT_MAX;
    }
  }  
  if(s[1][1]=='#'){
    f[1][1]=1;//スタート地点が黒なら初期値は1
  }else{
    f[1][1]=0;//白なら初期値は0
  }
  for (int i = 1; i <=n; i++){
	for (int j = 1; j <=m; j++){
      //右のマスには、今とマスの色が違ったら+1した数を入れる
      if(s[i][j]!=s[i][j+1]){
        f[i][j+1]=min(f[i][j+1],f[i][j]+1);
      }else{
        f[i][j+1]=min(f[i][j+1],f[i][j]);
      }
      //下のマスには、今とマスの色が違ったら+1した数を入れる
      if(s[i][j]!=s[i+1][j]){
        f[i+1][j]=min(f[i+1][j],f[i][j]+1);
      }else{
	    f[i+1][j]=min(f[i+1][j],f[i][j]);
      }
      //cout<<"確認i:"<<i<<" j:"<<j<<" f[i][j]:"<<f[i][j]<<" f[i+1][j]:"<<f[i+1][j]<<" f[i][j+1]:"<<f[i][j+1]<<endl;
    }
  }
  if(s[n][m]=='#'){
    cout<<(f[n][m]+1)/2<<endl;//ゴール地点が黒なら+1
  }else{
    cout<<f[n][m]/2<<endl;//ゴール地点が白なら0
  }
  return 0;
}

Measured memory_bytes: 256
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i, n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i, n) for(ll i=(ll)(n-1);i>=0;i--)
#define FOR(i, a, b) for(ll i=(ll)(a); i<=(ll)(b); i++)
#define RFOR(i, a, b) for(ll i=(ll)(a);i>=(ll)(b); i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

ll w[111];
ll v[111];
ll dp[111][111111];

signed main()
{
	int N, W;
	cin >> N >> W;
	REP(i, N){
		cin >> w[i] >> v[i];
	}
	REP(i, W+1){
		dp[0][i] = 0;
	}
	FOR(i, 1, N){
		REP(k, W+1){
			if(k-w[i-1]>=0){
				dp[i][k] = max(dp[i-1][k], dp[i-1][k-w[i-1]]+v[i-1]);
			}else{
				dp[i][k] = dp[i-1][k];
			}
		}
	}
	cout << dp[N][W] << endl;
}


Measured memory_bytes: 82740
import itertools
import copy

def main():
    N,K = map(int, input().split())
    a_list = [int(e) for e in input().split()]

    #見えるようにする建物を選ぶ
    #当該の建物まで左から見ていく
    #当該の建物より max((左の最大値+1 - 現状の高さ),0)が各建物に必要なコスト
    #各建物に必要なコストを合計する

    ans = 10**100

    l = [i for i in range(0,N)]

    for v in itertools.combinations(l,K): #最重で6435通り
        copied_a_list = copy.copy(a_list)
        
        v = set(v)
        left_max = copied_a_list[0]-1
        temp_ans = 0
        
        for i in range(N): #15
            if i in v:
                temp_ans += max(0,left_max+1 - copied_a_list[i])
                copied_a_list[i] = max(left_max+1,copied_a_list[i])
            
            if copied_a_list[i] > left_max:
                left_max = copied_a_list[i]
        
        #print(v,copied_a_list,temp_ans)
        
        if temp_ans < ans:
            ans = temp_ans
            
    print(ans)

main()

Measured memory_bytes: 9328
#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
  long long int n, m;
  while (cin >> n >> m) {
    if ((n|m) == 0)
      break;

    vector<long long int> p(m);
    for (int i = 0; i < m; ++i)
      cin >> p[i];

    long long int sum = (n+1) * n / 2, cnt = n;
    for (int i = 1; i < (1 << m); ++i) {
      long long int lcm = 1LL;
      for (int j = 0; j < m; ++j) {
	if (i & (1 << j))
	  lcm = lcm / __gcd(lcm, p[j]) * p[j];
      }
      if (__builtin_popcount(i) & 1) {
	sum -= lcm * ((n/lcm+1) * n/lcm / 2);
	cnt -= n / lcm;
      } else {
	sum += lcm * ((n/lcm+1) * n/lcm / 2);
	cnt += n / lcm;
      }
    }

    if (cnt == 0)
      printf("%.10f\n", 0.0);
    else
      printf("%.10f\n", sum / (cnt * 1.0));
  }
  return 0;
}

Measured memory_bytes: 956
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::*,
    std::{cmp::*, collections::*, convert::*, iter::*, marker::*, mem::*, ops::*},
};
fn main() {
    input! {//
        n:i64,
        x:i64,
        MOD:i64,
    }
    let mut a = x;
    let mut v = vec![];
    v.push(a);
    let mut dup = 0;
    for k in 2..=1234124111 {
        a = (a * a) % MOD;
        if v.contains(&a) {
            dup = a;
            break;
        }
        v.push(a);
    }
    let ln = v.len() as i64;
    let mut ans = 0i64;
    let mut tt = 0i64;
    let mut dd = 0i64;
    if n < ln {
        ans = v.iter().take(n as usize).fold(0, |sum, x| sum + x);
        println!("{}", ans);
        return;
    }
    dd = v.iter().fold(0, |sum, x| sum + x);
    ans += dd;
    let n = n - ln;
    let mut a = dup;
    let mut v = vec![];
    v.push(a);
    for ll in 1.. {
        a = (a * a) % MOD;
        if v.contains(&a) {
            break;
        }
        v.push(a);
    }
    // dbg!(&v);
    let ln = v.len() as i64;
    if n < ln {
        ans += v.iter().take(n as usize).fold(0, |sum, x| sum + x);
        println!("{}", ans);
        return;
    }
    for (i, &x) in v.iter().enumerate() {
        let i = (i) as i64;
        ans += x * ((n - i + ln - 1) / ln);
    }
    println!("{}", ans);
}


Measured memory_bytes: 2828
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <ios>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    cout << a + b + c - max({ a, b, c }) << "\n";
}

Measured memory_bytes: 256
s = int(input())
list = [int(n) for n in input().split()]

temp1 = []
temp2 = []
sorted_list = sorted(list)

for i in range(s//2):
    temp1.append(sorted_list[i])

for i in range(s//2, s):
    temp2.append(sorted_list[i])

if temp1[-1] >= temp2[0]:
    print(0)
else:
    print(temp2[0] - temp1[-1])


Measured memory_bytes: 14120
#include<iostream>

using namespace std;

int main(){
  int x,a,b,c,d;
  cin>>x>>a>>b;
  
  x>a ? c=x-a : c=a-x;
  x>b ? d=x-b : d=b-x;
  c<d ? cout<<'A'<<endl : cout<<'B'<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
	ll n;
	cin >> n;
	vector<ll> a(n);
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}

	ll ans = 0;
	for(int i = 0; i < n; i++){
		if(a[i] > 0){
			if(i>0 && a[i-1] == 1){
				ans += 1;
				a[i]--;
			}
			ans += a[i]/2;
			a[i] %= 2;
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1024
from heapq import heapify, heappop, heappush


def negative(str):
    return -1 * int(str)


def main():
    N, M = map(int, input().split(" "))
    A = list(map(negative, input().split(" ")))
    heapify(A)
    while M > 0:
        x = heappop(A)
        heappush(A, -1 * (-1 * x // 2))
        M -= 1
    print(sum(A) * -1)


if __name__ == '__main__':
    main()

Measured memory_bytes: 14252
#define _GLIBCXX_DEBUG //GCC環境での[]デバッグ
#include <bits/stdc++.h> //全ての標準ライブラリ
#define rep(i,n) for(int i = 0;i < n;i++)
#define FOR(i, a, b) for (int i = a; i < b; i++)
using namespace std;
using ll = long long;
int sumVector (const std::vector<int>& v){ //int配列計算
    int sum = 0;
    rep(i, v.size()) sum += v.at(i);
    return sum; 
}
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
     int s, w;
     cin >> s >> w;
     if(s <= w) cout << "unsafe";
     else cout <<"safe";
     

}

Measured memory_bytes: 3668