akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
int n,a[2100];
int vis[2100],flag[2100][2100],ind[2100];
priority_queue<int> que;
vector<int> vec[2100];
inline int gcd(int a,int b){
	if (!b) return a;
	return gcd(b,a%b);
}
void dfs(int u){
    vis[u]=true;
    for (int i=1;i<=n;i++)
	    if (!vis[i]&&flag[u][i]){
	        ind[i]++;
	        vec[u].push_back(i);
	        dfs(i);
	    }
}
void bfs(){
    for (int i=1;i<=n;i++)
		if (!ind[i]) que.push(i);
    while (!que.empty()){
        int u=que.top(); que.pop();
        printf("%d ",a[u]);
        for (int i=0;i<(int)vec[u].size();i++) que.push(vec[u][i]);
    }
}
int main(){
    scanf("%d",&n);
    for (int i=1;i<=n;i++) scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    for (int i=1;i<=n;i++)
	    for (int j=i+1;j<=n;j++)
    		if (gcd(a[i],a[j])!=1)
				flag[i][j]=flag[j][i]=1;
    for (int i=1;i<=n;i++)
		if (!vis[i]) dfs(i);
	bfs();
    return 0;
} 


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

int cnt[5];
char s[100];
int main(){
	int Tn;cin>>Tn;
	while(Tn--){
		cin>>s;
		if(s[0]=='A')++cnt[1];
		if(s[0]=='W')++cnt[2];
		if(s[0]=='T')++cnt[3];
		if(s[0]=='R')++cnt[4];
	}
	printf("AC x %d\n",cnt[1]);
	printf("WA x %d\n",cnt[2]);
	printf("TLE x %d\n",cnt[3]);
	printf("RE x %d\n",cnt[4]);
	return 0;
}

Measured memory_bytes: 3768
#include <iostream>
#include <utility>

int main()
{
	int n; std::cin >> n;
	int* A = new int[n];
	for (int i=0; i<n; i++) std::cin >> A[i];
	
	int q; std::cin >> q;
	
	for (int i=0; i<q; i++) {
		int b, e, t;
		std::cin >> b >> e >> t;
		for (int k=0; k<e-b; k++) std::swap(A[b+k], A[t+k]);
	}
	
	std::cout << A[0];
	for (int i=1; i<n; i++) std::cout << " " << A[i];
	std::cout << std::endl;
	
	delete[] A;
	
	return 0;
}



Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int (i)=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1'000'000'007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }

template <class X>
class SegmentTree {
    int n;
    vector<X> dat;
    X identity;

    X query_sub(int a, int b, int i, int l, int r) {
        if (r <= a || b <= l) return identity;
        if (a <= l && r <= b)
            return dat[i];
        else {
            X vl = query_sub(a, b, i * 2 + 1, l, (l + r) / 2);
            X vr = query_sub(a, b, i * 2 + 2, (l + r) / 2, r);
            return op(vl, vr);
        }
    }

    X get_identity(){
        return std::numeric_limits<X>::max(); // Range Minimum Query
    }
    X op(X x, X y){
        return min(x, y); // Range Minimum Query;
    }
public:
    SegmentTree(int n_) {
        n = 1;
        while (n < n_) n *= 2;

        identity = get_identity();
        dat = vector<X>(2 * n - 1, identity);

    }
    void update(int i, X x) {
        i += n - 1;
        dat[i] = x;
        while (i > 0) {
            i = (i - 1) / 2;
            dat[i] = op(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }
    // [a, b)
    X query(int a, int b) { return query_sub(a, b, 0, 0, n); }
    X at(int i) { return dat[i + n - 1]; }
};

int main(){
    long long N, M;
    cin >> N >> M;
    vector<tuple<long long, long long, long long>> LRC(M);
    REP(i, M){
        long long l, r, c;
        cin >> l >> r >> c;
        l--; r--;
        LRC[i] = make_tuple(l, r, c);
    }
    sort(LRC.begin(), LRC.end());

    SegmentTree<long long> st(N+10);
    st.update(0, 0);

    for(auto lrc : LRC){
        long long l, r, c;
        tie(l, r, c) = lrc;
        long long mn = st.query(l, r);
        if(mn < (1LL<<60))
            st.update(r, min(mn+c, st.at(r)));
    }
    if(st.at(N-1) > (1LL<<60)){
        cout << -1 << endl;
    }else{
        cout << st.at(N-1) << endl;
    }
    return 0;
}

Measured memory_bytes: 4608
#include <iostream>
    #include<bits/stdc++.h>
    using namespace std;
     
    #define MAX 250002
    int n;
     
    char buf[MAX];
     
    __int128 mod1=1000000000000000003ll;
    __int128 mod2=1000000000000000031LL;
     
    inline __int128 mul(__int128 a,__int128 b){
    	return (a*b)%mod2;
    }
    inline __int128 add(__int128 a,__int128 b){
    	auto f=a+b;
    	if(f>=mod2)f%=mod2;
    	return f;
    }
    inline __int128 sub(__int128 a,__int128 b){
    	auto f=a-b;
    	if(f<0)f+=mod2;
    	f%=mod2;
    	return f;
    }
    __int128 ppow(__int128 a,__int128 b){
    	__int128 res=1;
    	while(b){
    		if(b&1LL)res*=a;
    		if(res>=mod2)res%=mod2;
    		b>>=1LL;
    	}
    	return res;
    }
    unordered_map<long long int,int> cnt;
    vector<pair<__int128,__int128> > v;
    int main() {
    	cin>>n;
    	scanf("%s",buf);
    	auto inv=821428571428571454ll;
    	//printf("%lld\n",inv);
    	__int128 cur=1;
    	__int128 hs=0;
    	int sz=strlen(buf);
    	v.push_back(make_pair(0,1));
    	for(int i=0;i<sz;i++){
    		if(buf[i]=='<'){
    			cur=mul(cur,inv);
    		}
    		if(buf[i]=='>'){
    			cur=mul(cur,mod1);
    		}
    		if(buf[i]=='+'){
    			hs=add(hs,cur);
    		}
    		if(buf[i]=='-'){
    			hs=sub(hs,cur);
    		}
    		v.push_back(make_pair(hs,cur));
    	}
    	__int128 acieve=v.back().first;
    	//(x-c)/second=acieve
    	//x-c=acieve/second
    	//x = c+ acieve/second
    	long long int way=0;
    	for(int i=v.size()-1;i>=0;i--){
    		__int128 want=add(v[i].first,mul(acieve,v[i].second));
    		way+=cnt[want];
    		cnt[v[i].first]++;
    		//cerr<<i<<" "<<way<<endl;
    	}
    	printf("%lld\n",way);
    	return 0;
    }


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

int main(){
    int n,b;
    scanf("%d",&n);
    int a[n];
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    for(int j=1;j<=n;j++){
        if (j>1) printf(" ");
        printf("%d", a[n-j]);
    }
    printf("\n");

    return 0;
}


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

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

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

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

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

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

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

const int MOD = (int)1e9 + 7;
const int MAXN = (int)1e6 + 77;

int add(int x, int y) {
	return (x + y >= MOD ? x + y - MOD : x + y);
}

int mult(int x, int y) {
	return (x * 1LL * y) % MOD;
}

int binpow(int x, int y) {
	if(x == 1 || y == 0) return 1;
	if(x == 0) return 0;

	int rez = binpow(x, y >> 1);
	rez = mult(rez, rez);

	if(y & 1) rez = mult(rez, x);
	return rez;
}

int f[MAXN], r[MAXN];

void init() {
	f[0] = 1;

	for(int i = 1; i < MAXN; ++i) {
		f[i] = mult(i, f[i - 1]);
	}

	r[MAXN - 1] = binpow(f[MAXN - 1], MOD - 2);

	for(int i = MAXN - 2; i >= 0; --i) {
		r[i] = mult(i + 1, r[i + 1]);
	}
}

int choose(int k, int n) {
	if(k > n) return 0;
	int rez = f[n];
	rez = mult(rez, r[k]);
	rez = mult(rez, r[n - k]);

	return rez;
}

void solve() {
	int x = fetch<int>();
	int y = fetch<int>();
	int answ = 0;

	if((x + y) % 3 == 0) {
		int cnt = (x + y) / 3;
		
		for(int i = 0; i <= cnt; ++i) {
			int j = cnt - i;
			
			if(i + 2 * j == x && 2 * i + j == y) {
				answ = add(answ, choose(i, cnt));
			}
		}
	}

	cout << answ << '\n';
}

int main() {
	fast_io();

	init();
	solve();

	return 0;
}


Measured memory_bytes: 8064
#include<stdio.h>
int main(){
    int a , b , c ,add ;
    scanf("%d%d%d",&a,&b,&c) ;
    if(a > b && a>c){

        add = b+c ;
    }else if(b>a && b>c)
    {
        add = a+c ;

    }else {

        add = b+a ;
    }

    printf("%d",add);



}


Measured memory_bytes: 128
n = int(input())
a = [int(int(x)/400) for x in input().split()]
b = [x if x <= 7 else 8 for x in a]

ans = len(set(b))
if (8 in b):
   ans -= 1
   ans2 = b.count(8) + ans
   if (ans == 0):
      print(1, ans2)
   else:
      print(ans, ans2)
else:
   print(ans, ans)


Measured memory_bytes: 3060
//https://atcoder.jp/contests/dp/tasks/dp_d

#include <bits/stdc++.h>
#include <limits.h>
#include <algorithm>  


#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;


using namespace std;

typedef long long int ll;

const int precision = 16;
const int modulo =  1000000007; // 10^9 + 7
using ll = long long;
const double EPS = 1e-9;


// ll recKS1(int ind, const vector<int> & w, const vector<int> & c, int W) 
// {
// 	if(ind >= (int)w.size()) return 0;
// 	if(W <= 0) return 0;

// 	if(w[ind] > W) {
// 		return recKS1(ind + 1, w, c, W);
// 	}

// 	auto r1 = c[ind] + recKS1(ind + 1, w, c, W - w[ind]);
// 	auto r2 = recKS1(ind + 1, w, c, W);
// 	return max(r1, r2);
// }

// auto h = std::hash<ll>();
// auto _hash = [&h](pair<int, int> p) ->ll {
// 	return h((ll)p.first | ((ll)p.second << 32));
// };



// ll recKS2(int ind, const vector<int> & w, const vector<int> & c, int W, gp_hash_table<pair<int, int>, ll,decltype(_hash)>  & memo) 
// {
// 	if(memo.find({ind, W}) != memo.end()) return memo[{ind, W}];
// 	if(ind >= (int)w.size()) return 0;
// 	if(W <= 0) return 0;
	
// 	if(w[ind] > W) {
// 		auto ret = recKS2(ind + 1, w, c, W, memo);
// 		memo[{ind, W}] = ret;
// 		return memo[{ind, W}];
// 	}

// 	auto r1 = c[ind] + recKS2(ind + 1, w, c, W - w[ind], memo);
// 	auto r2 = recKS2(ind + 1, w, c, W, memo);
// 	auto r = max(r1, r2);
// 	memo[{ind, W}]  = r;
// 	return r;
// }

ll recKS3(int ind, const vector<int> & w, const vector<int> & c, int W, vector<vector<ll>> & memo) 
{
	if(memo[ind][W] != -1) return memo[ind][W];
	if(ind >= (int)w.size()) return 0;
	if(W <= 0) return 0;
	
	if(w[ind] > W) {
		auto ret = recKS3(ind + 1, w, c, W, memo);
		memo[ind][W] = ret;
		return memo[ind][W];
	}

	auto r1 = c[ind] + recKS3(ind + 1, w, c, W - w[ind], memo);
	auto r2 = recKS3(ind + 1, w, c, W, memo);
	auto r = max(r1, r2);
	memo[ind][W]  = r;
	return r;
}


void solveKS1()
{
	int n, W; cin >> n >> W;
	vector<int> w(n), c(n);
	for(auto i = 0; i < n; ++i) {
		cin >> w[i] >> c[i];
	}

	//auto ret = recKS1(0, w, c, W);

	// gp_hash_table<pair<int, int>, ll, decltype(_hash)> memo(_hash);
	// auto ret = recKS2(0, w, c, W, memo);

	vector<vector<ll>> memo(n + 1, vector<ll> (W + 1, -1));
	auto ret = recKS3(0, w, c, W, memo);
	cout << ret <<endl;

}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cout.precision(precision);
	cout.setf(ios_base::fixed);

	solveKS1();
	return 0;
}



Measured memory_bytes: 80256
#include <iostream>  // cin,cout
#include <stdio.h>   // printf,scanf (standard input/output)
#include <cmath>     // abs(x),pow(x,2)
#include <string>
#include <string.h>  // strlen, strcmp
#include <algorithm> // min,max, sort(v.begin(),v.end())
#include <vector>
#include <time.h>
using namespace std;


int main(){
    int N;
    string A,B,C;
    
    cin >> N;
    cin >> A >> B >> C;
    
    int result = 2*N;
    int temp = 0;
    
    for (int i=0;i<N;i++) {
        if (A[i]==B[i]) {
            if (B[i]==C[i]) temp += 2;
            else temp += 1;
        }
        else {
            if (B[i]==C[i]) temp += 1;
            if (A[i]==C[i]) temp += 1;
        }
    }
    
    cout << result-temp << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <algorithm>

using namespace std;

int main(void)
{
    int h,w;

    cin >>h >>w;

    vector<string> cells;
    for(int i = 0; i < h; i++){
        string tmp;
        cin >>tmp;
        cells.push_back(tmp);
    }

    vector<vector<int> > hsum(h, vector<int>(w, 0));
    for(int i = 0; i < h; i++){
        int ct = 0;
        for(int j = 0; j < w; j++){
            if(cells[i][j] == '#'){
                ct = 0;
            }else{
                ct++;
            }
            hsum[i][j] = ct;
        }
        int now = hsum[i][w-1];
        for(int j = w-1; j >= 0; j--){
            if(hsum[i][j] == 0){
                if(j > 0){
                    now = hsum[i][j-1];
                }
            }else{
                hsum[i][j] = now;
            }
        }
    }
    vector<vector<int> > vsum(h, vector<int>(w, 0));

    for(int j = 0; j < w; j++){
        int ct = 0;
        for(int i = 0; i < h; i++){
            if(cells[i][j] == '#'){
                ct = 0;
            }else{
                ct++;
            }
            vsum[i][j] = ct;
        }
        int now = vsum[h-1][j];
        for(int i = h-1; i >= 0; i--){
            if(vsum[i][j] == 0){
                if(i > 0){
                    now = vsum[i-1][j];
                }
            }else{
                vsum[i][j] = now;
            }
        }
    }

    int ans = 0;
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(vsum[i][j] == 0 || hsum[i][j] == 0){
                ans = max(ans, hsum[i][j] + vsum[i][j]);
            }else{
                ans = max(ans, hsum[i][j] + vsum[i][j] -1);
            }
            //printf(" %d", vsum[i][j]);
        }
        //printf("\n");
    }
    printf("%d\n", ans);
    return 0;
}

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

class Solution{
	public:
		int getPP(int X){
			int maxNum = 1;
			for(int i = 2; i * i <= X; ++i){
				int j = i;
				for(; j * i <= X; j *= i);
				maxNum = max(maxNum, j);								
			}
			return maxNum;
		}
};

int main(){
	int N = 1;
	cin >> N;
	std::cout << Solution().getPP(N);
	return 0;
}

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

bool compair(pair<long long, long long> a, pair<long long, long long> b){
    return a.second > b.second;
}

int main(){
    long long n, m;
    cin >> n >> m;

    vector<long long> a(n);

    for(long long i = 0; i < n; i++){
        cin >> a[i];
    }

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

    vector<pair<long long, long long> > bc(m);

    for(long long i = 0; i < m; i++){
        cin >> bc[i].first >> bc[i].second;
    }

    sort(bc.begin(), bc.end(), compair);

    long long sum = 0;

    vector<long long> b;

    for(long long i = 0; i < n; i++){
        if(a[i] < bc[0].second){
            b.push_back(a[i]);
        }
        else{
            sum += a[i];
        }
    }

    vector<long long>::iterator it;
    for(long long i = 0; i < m; i++){
        

        long long count = 0;
        for(it = b.begin(); it != b.end();){
            if(count >= bc[i].first){
                break;
            }

            if(*it < bc[i].second){
                sum += bc[i].second;
                it = b.erase(it);
            }
            else{
                it++;
            }
            count++;
        }
    }

    for(long long i = 0; i < b.size(); i++){
        sum += b[i];
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 3704
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  string s;
  cin>>N>>s;
  for(int i=0;i<s.size();i++){
    s.at(i)=(s.at(i)-'A'+ N)%26 + 'A';
  }
  cout<<s<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string>
#define pii pair<int,int>
#define fr(j,n) for(int j=0;j<n;j++)
#define f(n) for(int i=0;i<n;i++)
#define rt return 0;
#define sc second
#define fi first
#define i(n) int n;cin>>n;
#define pb(i) push_back(i);
#define rt return 0;
#define sz(v) v.size()
#define allv v.begin(),v.end()
#define ff(i,in,fi) for(int i=in;i<fi;i++)
//#define df int n;cin>>n;int a[n];fr(n){cin>>a[i];}5 8 7 14 55 19 9 2
using namespace std;
#define trav(a, x) for(auto& a : x)
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl
#define invect(data,n,commands) for(int xxx = 0;xxx<n;xxx++){int tmp;cin>>tmp;data.pb(tmp);commands}
#define ll long long int
#define p(s) cout<<#s<<":"<<s<<'\n';
#define here(n) cout<<"here"<<n<<endl;
#define ios         ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

int main()
{
	ios;
	ll n;
	cin>>n;
	ll ans=n*(n-1)/2;
	cout<<ans;

}

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

public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        final int H = sc.nextInt();
        final int N = sc.nextInt();
        int accum = 0;
        for (int i = 0; i < N; i++)
            accum += sc.nextInt();
        if (accum < H)
            out.println("No");
        else
            out.println("Yes");
        out.flush();
    }
}

// FastScanner start
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}
// FastScanner end

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

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int dp[2][105], mp[2][105];

int main() {
	cin.sync_with_stdio(false); cin.tie(0);
	cin.exceptions(cin.failbit);

	int n; cin >> n;
	rep(i, 0, 2) rep(j, 0, n) cin >> mp[i][j];

	dp[0][0] = mp[0][0];
	rep(i, 1, n) dp[0][i] = dp[0][i - 1] + mp[0][i];
	rep(i, 0, n) dp[1][i] = max(i > 0 ? dp[1][i - 1] : 0, dp[0][i]) + mp[1][i];
	cout << dp[1][n - 1] << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000

int main(){
	
	string S;
	cin>>S;
	
	for(int i=0;i<S.size();i++){
		for(int j=i;j<S.size();j++){
			if(S[i]=='C'&&S[j]=='F'){
				cout<<"Yes"<<endl;
				return 0;
			}
		}
	}
	
	cout<<"No"<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int a,b;
  char op;

  for(;;){

  scanf("%d %c %d",&a,&op,&b);

  if(op == '+' ){
    printf("%d\n",a+b);
  }
  else if(op == '-' ){
    printf("%d\n",a-b);
  }
  else if(op == '*' ){
    printf("%d\n",a*b);
  }
  else if(op == '/' ){
    printf("%d\n",a/b);
  }
  else{
    break;
  }

 }

  return 0;
}

Measured memory_bytes: 600
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define int long long
#define x first
#define y second
#define pb push_back
#define inf 10000000000000000
#define N 1000000007
#define speed ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
template<class L,class R> ostream& operator<<(ostream& cout,pair<L, R> P)
{return cout<<'('<<P.x<<','<< P.y<<')';}
template<class T> ostream& operator<<(ostream& cout,vector<T> V)
{cout<<"[ ";for(auto v:V)cout<<v<<' ';return cout<<']';}

//edge cases when n=1 , m=1. wrong variable in loop. if<->while
signed main()
{ 
	speed
	int n,m;cin>>n>>m;
	cout<<(((n*(n-1))/2ll)+((m*(m-1))/2ll))<<"\n";
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int main()
{
    int N; cin >> N;
    vector<int> bukaNums(N, 0);
    for (int i = 2; i <= N; ++i)
    {
        int ai; cin >> ai;
        ++bukaNums[ai - 1];
    }
    for (int i = 0; i < N; ++i)
    {
        cout << bukaNums[i] << endl;
    }
}


Measured memory_bytes: 4052
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
#define arrprint(v,n) rep(i,0,n-1)cout << v[i] << " ";cout << endl;
#define matprint(v,n,m) rep(i,0,n-1){rep(j,0,m-1){cout << v[i][j] << " ";}cout << endl;}
#define SORT(v) sort(v.begin(), v.end())
#define REV(v) reverse(v.begin(), v.end())
using namespace std;
const int mod=1000000007;
const int INF=1001001001;
typedef long long ll;
typedef pair<int,int> P;
template<typename T>
using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>; //小さいものから取り出す

int main(){
    int n;
    cin >> n;
    set<string> s;
    rep(i,0,n-1){
        string ss;
        cin >> ss;
        s.insert(ss);
    }

    cout << s.size() << endl;
//  printf("%.10f\n",ans);

    return 0;
}

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

int f(int x,int y){
    if(y>x){
        return f(y,x);
    }else if(x%y!=0){
        return f(y,x%y);
    }else{
        return y;
    }
}

int main(){
    int a,b;
    cin >> a >> b;
    cout << f(a,b) << endl;
    return 0;
}


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

int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> s(M, vector<int>(10));
  vector<int> k(M), p(M);
  for(int i = 0; i < M; ++i) {
    cin >> k.at(i);
    for (int j = 0; j < k.at(i); ++j) cin >> s.at(i).at(j), s.at(i).at(j)--;
  }
  for (int i = 0; i < M; ++i) cin >> p.at(i);
  
  int cnt = 0;
  for (int i = 0; i < (1<<N); ++i) {
    int dcnt = 0;
    for (int j = 0; j < M; ++j) {
      int SWcnt = 0; 
      for (int l = 0; l < k.at(j); ++l) {
        if(i & (1 << s.at(j).at(l))) SWcnt++;
      }
      if(SWcnt % 2 == p.at(j)) dcnt++;
    }
    if (dcnt == M) cnt++;
  }
  //cout << (3 & (1<<0)) << endl;
  cout << cnt << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (ll i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;







int main() {
    ll n;
    cin >> n;
    map <ll, ll> mp;
    
    ll sum = 0;
    
    rep(i, n) {
        ll a, b;
        cin >> a >> b;
        mp[b] += a;
    }
    
    for (auto i: mp) {
        sum += i.second;
        if (sum > i.first) {
            mes("No");
            re0;
        }
    }
    
    mes("Yes");
    
    
    
    
    
}

Measured memory_bytes: 16132
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int LL;
typedef LL ll;
typedef string str;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef stringstream strs;
 
#define X first
#define Y second
#define PB push_back
#define For(i,a,b) for (int i=a;i<b;i++)
#define Ford(i,a,b) for (int i=a;i>=b;i--)
#define smax(a,b) a=max(a,b)
#define smin(a,b) a=min(a,b)
#define SZ(a) ((ll)a.size())
#define ER(a) cout << #a << ' ' << a << endl
#define LB(a,n,x) (lower_bound(a,(a)+(n),x)-(a))
 
const ll M=2e5+5,LG=19,SM=2000+5,inf=1e9+1;
ll mod=1e9+7;
 
ll n;
ll a[M]; 
ll b[M];
bool n1,n2,e1,e2;

int main()
{
	ios::sync_with_stdio(0);
    ll n;
    cin >> n;
    For(i,0,n)
    {
        ll x;
        cin >> x;
        a[i]=b[i]=x;       
    }
    sort(b,b+n);
    For(i,0,n) a[i]=LB(b,n,a[i]);
    ll khar=0;
    For(i,0,n) khar+=(a[i]^i)&1;
    cout << khar/2;
}

Measured memory_bytes: 1792
# https://atcoder.jp/contests/abc047/tasks/arc063_a
# C - 一次元リバーシ / 1D Reversi

S = input().split()[0]
before = S[0]
work_list = [S[0]]

for s in S[1:]:
    if s != before:
        work_list.append(s)
        before = s

ans = len(work_list) - 1
print(ans)


Measured memory_bytes: 4056
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
    int n,a[1000],answer=0;
    cin>>n>>a[0];
    for(int i=1;i<n;i++){
        cin>>a[i];
        
    }
    for(int i=1;i<n;i++){
        if(a[i-1]==a[i]){
            i++;
            answer++;
        }
        
    }
cout<<answer;
    /* code */
    return 0;
}


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

int main(){
	int a[10];
	for(int i=0;i<10;i++) cin>>a[i];
	sort(a,a+10);
	for(int i=9;i>=7;i--) cout<<a[i]<<endl;
	return 0;
}



Measured memory_bytes: 3040
#include <iostream>

using namespace std;

static const int N = 100;
static const int INF = 1000000;

struct Vertex {
    bool in_S;
    int min_cost;
    int parent;
};

class SSSP {
private:
    int matrix[N][N];
    Vertex vertex[N];
    int n;

public:
    SSSP()
    {
        cin >> n;

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                matrix[i][j] = INF;

        int u;
        int k;
        int v;
        int c;
        for (int i = 0; i < n; i++)
        {
            cin >> u;
            cin >> k;
            for (int j = 0; j < k; j++)
            {
                cin >> v >> c;
                matrix[u][v] = c;
            }
        }
    }

    void dijkstra(int start)
    {
        for (int i = 0; i < n; i++)
        {
            vertex[i].in_S = false;
            vertex[i].min_cost = INF;
        }
        vertex[start].min_cost = 0;
        vertex[start].parent = -1;

        while (true)
        {
            int u = -1;
            int mincost = INF;
            for (int i = 0; i < n; i++)
            {
                if (!vertex[i].in_S && vertex[i].min_cost < mincost)
                {
                    mincost = vertex[i].min_cost;
                    u = i;
                }
            }

            if (mincost == INF)
                break;

            vertex[u].in_S = true;

            for (int v = 0; v < n; v++)
            {
                if (!vertex[v].in_S && matrix[u][v] != INF)
                {
                    if (vertex[u].min_cost + matrix[u][v] < vertex[v].min_cost)
                    {
                        vertex[v].min_cost = vertex[u].min_cost + matrix[u][v];
                        vertex[v].parent = u;
                    }
                }
            }
        }
    }

    void print()
    {
        for(int i = 0; i < n; i++)
            cout << i << " " << vertex[i].min_cost << endl;
    }
};

int main()
{
    SSSP mst;
    mst.dijkstra(0);
    mst.print();
}


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

typedef long long int ll;
typedef string str;

int main ()
{
	// ios::sync_with_stdio(0);
 //    cin.tie(0);
 //    cout.tie(0);
	ll t,n,m,k,i,b,j;
	cin >> n >> k;
	ll arr[n+2],a[n+2]={0};
	for(i=1;i<=n;i++)
	{
		cin >> arr[i];
		a[i]=pow(10,11);
	}
	a[1]=0;
	for(i=2;i<=n;i++)
	{
		j=i-1,m=0;
		while(j>0 && m<k)
		{
			a[i]=min(a[i],a[j]+abs(arr[j]-arr[i]));
			m++;
			j--;
		}
	}
	cout << a[n] << "\n";
	return 0;
}

Measured memory_bytes: 5204
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = ll(1e15)+1;
const ll mod = ll(1e9)+7;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()

ll gcd(ll a,ll b){
    if(a < b)swap(a, b);
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}

ll factorial(ll n){
    ll t = 1;
    rep1(i, n){
        t *= i;
        t %= mod;
    }
    return t;
}

ll power(ll a, ll b){
    a %= mod;
    if(b == 0){
        return 1;
    }
    ll ans = power(a, b / 2);
    ans = ans * ans % mod;
    if(b % 2 == 1){
        ans = ans * a % mod;
    }
    return ans;
}

ll combination(ll a, ll b){
    if((a == b) || (b == 0)){
        return 1;
    }
    if(a < b) return 0;
    ll ans = 1;
    for(ll i = 0; i < b; i++) {
        ans *= (a - i);
        ans %= mod;
        ans *= power(i + 1, mod - 2);
        ans %= mod;
    }
    return ans;
}
int main(){
    int a,b;
    cin >> a >> b;
    rep0(i, 100000){
        double c = i;
        if(floor(c * 0.08) == a && floor(c * 0.10) == b){
            pf(i);
            return 0;
        }
    }
    pf(-1);
    return 0;
}


Measured memory_bytes: 256
/*
    Life Before Death, Strength Before Weakness, Journey Before Destination
    ------------------------------------------------------------------------
    You don't become great by trying to be great.
    You become great by wanting to do something,
    and then doing it so hard that you become great in the process.
    */

    //#pragma comment(linker, "/stack:200000000")
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
    #include <bits/stdc++.h>
    using namespace std;
    
    #define TRACE
    
    #ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
      cerr << name << " : " << arg1 << std::endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
      const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
    #else
    #define trace(...)
    #endif
    
    #define rep(i, n)    for(int i = 0; i < (n); ++i)
    #define repA(i, a, n)  for(int i = a; i <= (n); ++i)
    #define repD(i, a, n)  for(int i = a; i >= (n); --i)
    #define trav(a, x) for(auto& a : x)
    #define all(x) x.begin(), x.end()
    #define sz(x) (int)(x).size()
    #define fill(a)  memset(a, 0, sizeof (a))
    #define fst first
    #define snd second
    //#define mp make_pair
    #define pb push_back
    #define PI           3.141592653589793238462643383279502884197169399  /* pi */
    #define te  ll ti;   cin >> ti;  while(ti--) solve();  
    typedef long double ld;
    typedef long long ll;
    typedef pair<ll, ll> pii;
    typedef vector<ll> vi;
    const int maxN = 200500;

    ll dp[maxN];
    void solve() {
      ll n, k; string s;
      cin >> n >> k >> s;
      vector<ll> v;
      ll cnt = 1;
      rep(i, n-1) {
        if(s[i]!=s[i+1]) v.pb(cnt), cnt = 1;
        else cnt++;
      }  v.pb(cnt);
      
      if(s[0] == '0') v.insert(v.begin(), 0);
      ll m = v.size(), ma = 0;
      repA(i, 1, m) dp[i] = dp[i-1] + v[i-1];
       ma = max(ma, dp[min(m, 1 + 2*k)] - dp[0]);
      for(ll i = 2; i <= m; i+=2){
         // cout << i-2 << " " << i-1 + 2*k<< " " << dp[i-2] << " " << dp[min(m, i-1 + 2*k)]<<endl;
        ma = max(ma, dp[min(m, i-1 + 2*k)] - dp[i-2]);
      }
    cout << ma << endl;
    }

    int main() {
      cin.sync_with_stdio(0); cin.tie(0);
      cin.exceptions(cin.failbit);
      //te
      solve();
      return 0;
    }       

Measured memory_bytes: 2116
#include <stdio.h>

long long MIN(long long a, long long b){
	return a<b?a:b;
}

int main(){
	long long a, b, c;
	scanf("%lld %lld %lld", &a, &b, &c);

	printf("%lld\n", (a%2)*(b%2)*(c%2)?MIN(a*b, MIN(b*c, c*a)):0);

	return 0;
}


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

#include <atcoder/all>

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

using namespace std;
using namespace atcoder;

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

    rep(i, k) cout << "ACL";
    cout << endl;

    return 0;
}


Measured memory_bytes: 3660
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r#"12 4"# => r#"4"#,
r#"20 15"# => r#"0"#,
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        a: usize,
        b: usize,
    }

    (if a >= b * 2 { a - b * 2  } else { 0 }).to_string()
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define P pair<ll, ll>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define pp pair<ll, pair<ll, ll>> 
#define fi first
#define se second

void print(Vl vec){
    rep(i, 0, sz(vec)){
        if(i) cout << " ";
        cout << vec[i];
    }
    coel;
}

////////////////////////////////////////////////////////

int main() {
    ll h, w; cin >> h >> w;
    Vl y, x, Y, X;
    vector<Vl> a(h, Vl(w));
    rep(i, 0, h) rep(j, 0, w) cin >> a[i][j];
    rep(i, 0, h){
        rep(j, 0, w-1){
            if(a[i][j]%2 !=0){
                a[i][j+1]++;
                y.push_back(i+1);
                x.push_back(j+1);
                Y.push_back(i+1);
                X.push_back(j+2);
            }
        }
    }
    rep(i, 0, h-1){
        if(a[i][w-1]%2 != 0){
            a[i+1][w-1]++;
            y.push_back(i+1);
            x.push_back(w);
            Y.push_back(i+2);
            X.push_back(w);
        }
    }
    co(y.size());
    rep(i, 0, sz(y)){
        co(y[i] << " " << x[i] << " " << Y[i] << " " << X[i]);
    }

    return 0;
}


Measured memory_bytes: 8152
#include<iostream>
using namespace std;
int main()
{
  int n,g,ss,ee;
  cin>>n>>g;
  int s[g],e[g];
    
 for(int i=0;i<g;i++)
  {
    cin>>s[i]>>e[i];
  }
        ss=s[0];
        ee=e[0];
  for(int i=1;i<g;i++)
  {
    if(s[i] >ss)
    {
		ss=s[i];
    }
    if(e[i] <ee)
    {
		ee=e[i];
    }
}
  int count=0;
  for(int i=ss;i<=ee;i++)
  {
    count++;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007


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

    // input
    int N;
    cin >> N;
    vector<int> vec(N);
    REP(i, N) cin >> vec.at(i);
    
    // calculation
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());  // MUST sort before unique
    
    cout << vec.size() << "\n";
    
    return 0;
}


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

using namespace std;

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;
  int ans = 0;
  for (int i = 0; i <= A; ++i) {
    for (int j = 0; j <= B; ++j) {
      for (int k = 0; k <= C; ++k) {
	if (X == (500*i + 100*j + 50*k)) {
	  ans++;
	}
      }
    }
  }
  cout << ans << endl;
  return 0;
}



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

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

	int i = 0;
	int kari = 0;
	int answer = 0;

	while(i<n){
		int A;
		cin >> A;

		if(A == 1){
			kari++;
		}

		else{
			kari = 0;
		}

		if(answer < kari+1){
			answer = kari + 1;
		}
		i++;
	}

	cout << answer << endl;

	return 0;
}


Measured memory_bytes: 3100
a,b,h,m= map(int,input().split())
import math

th_h = (h+m/60)/12 *2*math.pi
th_m = m/60 *2*math.pi
c2 = a**2+b**2-2*a*b*math.cos(abs(th_h-th_m) )

print(math.sqrt(c2))

Measured memory_bytes: 62160
a,b,c = gets.split.map(&:to_i).sort.reverse

if a[0] == b[0] && a[0] == c[0]
  puts (a - b) / 2 + (a - c) / 2
elsif b[0] == c[0]
  puts (a - (b + 1)) / 2 + (a - (c + 1)) / 2 + 1
elsif a[0] == b[0]
  puts ((a + 1) - (b + 1)) / 2 + ((a + 1) - c) / 2 + 1
elsif a[0] == c[0]
  puts ((a + 1) - b) / 2 + ((a + 1) - (c + 1)) / 2 + 1
end


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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

//実行部
void Main()
{
  ll l, r; cin >> l >> r;
  ll ans = MAX;
  for(ll i = l;i <= r &&i - l <= 2019;i++)
  {
    for(ll j = i + 1;j <= r&&j - l <= 2019;j++)
    {
      ans = min(ans, i * j % 2019);
    }
  }
  fin(ans);
}

//前処理
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}

/*
//test時
  g++ test.cpp -o test;./test
*/


Measured memory_bytes: 256
import java.util.Scanner;

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

        int a,b;
        for(int i = 0; i < 3_000; i++){
            a = scanner.nextInt();
            b = scanner.nextInt();

            if(a == 0 && b == 0){
                break;
            }else if(a >= b){
                System.out.println(b + " " + a);
            }else{
                System.out.println(a + " " + b);
            }
        }
        scanner.close();
    }
}



Measured memory_bytes: 35740
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(void){
	while(1){
		int h, w; cin >> h >> w;
		if(!h && !w) break;

		string cell[55]; //与えられるセル
		for(int i=0; i<h; i++){
			cin >> cell[i];
		}
		string str; cin >> str; //入力したい文字列

		int ans = 0;
		int pos_x=0, pos_y=0; //最後に押した(強調されている)cellの位置
		for(int s=0; s<str.length(); s++){
			for(int y=0; y<h; y++){
				bool find = false; //二重ループを抜けるためのフラグ
				for(int x=0; x<w; x++){
					if(cell[y][x] == str[s]){
						ans += abs(y-pos_y) + abs(x-pos_x) + 1; //マンハッタン距離+1
						pos_x = x; 
						pos_y = y;
						find = true;
						break;
					}
				}
				if(find) break;
			}
		}
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 3176
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    int two = 0, four = 0;
    for(int i = 0; i < N; i++) {
        int a;
        cin >> a;
        if(a%4==0) four++;
        else if(a%2==0) two++;
    }
    
    string ans = "No";
    if(four>=N/2) ans = "Yes";
    else if(four*2+two>=N) ans = "Yes";
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int a[3];
  for(int i=0;i<3;++i) cin>>a[i];
  for(int i=0;i<2;++i){
    for(int j=i+1;j<3;++j){
      if(a[i]>a[j]) swap(a[i],a[j]);
    }
  }
  for(int i=0;i<3;++i){
    if(i!=0) cout<<" ";
    cout<<a[i];
  }
  cout<<endl;
  return 0;
}



Measured memory_bytes: 3100
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;

static int compare(const void*a,const void*b){
    int anum = *(int*)a;
    int bnum = *(int*)b;

    return anum - bnum;
}

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

    int h[N];
    for(int i=0;i<N;i++){
        cin >> h[i];
    }
    //sort
    qsort(h,N,sizeof(int),compare);

    int result=1000000000;
    for(int i=K-1;i<N;i++){
        int local = h[i] - h[i-K+1];
        if(local<result)result=local;
    }
    cout << result << endl;
}

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

#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i, m, n) for(int i = (int)m; i < (int)n; i++)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;


/*FUNCs=================================================*/


/*MAIN==================================================*/
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化

    int a,b; cin >>a >> b;
    cout << max({a+b, a-b, a*b}) << '\n';
}

Measured memory_bytes: 256