akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define CEIL(a,b) ((a) / (b) + ((a) % (b) == 0 ? 0 : 1))

using namespace std;
using ll = long long;
using pii = pair<int, int>;

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'000'000'001;
constexpr ll LLINF = 4'000'000'000'000'000'001;
// constexpr int INF = 2147483647; // 2 * 1e9
// constexpr ll LLINF = 9223372036854775807; // 9 * 1e18

const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1, 0};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int n;
    cin >> n;
    vector<int> a(n), b(n), c(n);
    for(int i = 0; i < n; ++i){
        cin >> a[i];
    }
    for(int i = 0; i < n; ++i){
        cin >> b[i];
    }
    for(int i = 0; i < n; ++i){
        cin >> c[i];
    }
    sort(begin(a), end(a));
    sort(begin(c), end(c));
    ll ans = 0;
    for(auto && i : b){
        ans += ll(lower_bound(begin(a), end(a), i) - begin(a)) * (end(c) - upper_bound(begin(c), end(c), i));
    }
    cout << ans << "\n";
    return 0;
}

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

signed main(){
  int N;
  cin>>N;
  string ans="Christmas";
  if(N==24)ans="Christmas Eve";
  if(N==23)ans="Christmas Eve Eve";
  if(N==22)ans="Christmas Eve Eve Eve";
  cout<<ans<<endl;
}

Measured memory_bytes: 256
# import itertools
# import math

# N = int(input())
# S = input()
N, M = map(int, input().split())
# A = list(map(int, input().split()))

ans_p = [0] * N
ans_s = [0] * N

for i in range(M):
    input_sp = input().split()
    P = int(input_sp[0]) - 1
    S = input_sp[1]

    if S == 'AC':
        ans_s[P] = 1
    elif S == 'WA' and ans_s[P] == 0:
        ans_p[P] += 1

for i in range(len(ans_p)):
    if ans_s[i] == 0 and ans_p[i] != 0:
        ans_p[i] = 0

print(str(sum(ans_s)) + " " + str(sum(ans_p)))


Measured memory_bytes: 45848
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, a[N];
int32_t main(){_

   string s;
   cin>>n;
   cin >> s;

   if (n >= 3200){
      cout<<s;
      // cout<<"red";
   }
   else{
      cout<<"red";
   }

   

   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;
LL p = 1000000007ll;

string s;
vector<LL> goal;

LL calg(LL i)
{
  if(goal[i]!=-1) return goal[i];
  LL answer = i;
  if(s[i] == 'R' && s[i+1] == 'R') answer = calg(i+2);
  if(s[i] == 'L' && s[i-1] == 'L') answer = calg(i-2);
  goal[i] = answer;
  return goal[i];
}

void setting(void)
{
  REP(i,s.size()) calg(i);
}

int main(void)
{
  cin >> s;
  goal.assign(s.size(),-1);
  setting();
  vector<LL> answers(s.size());
  REP(i,s.size()) answers[goal[i]]++;
  REP(i,s.size()) {
    if(i) cout << " ";
    cout << answers[i];
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3840
import java.util.*;

public class Main {
	public static void main(String[] args){
		int count = 0;
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		for(int i = a;i <= b;i++){
			if(c % i == 0)
				count++;
		}
		
		System.out.println(count);
	}
}

Measured memory_bytes: 17164
#define _CRT_SECURE_NO_WARNINGS
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream &operator << (ostream &os, const vector<T> &);
template<size_t n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, const tuple<T...> &){}
template<size_t n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream &os, const tuple<T...> &t){
    os << (n == 0 ? "" : " ") << get<n>(t); _ot<n+1>(os, t);
}
template<class...T> ostream &operator << (ostream &os, const tuple<T...> &t){
    _ot<0>(os, t); return os;
}
template<class T, class U> ostream & operator << (ostream &os, const pair<T,U> &p){
    return os << "(" << p.first << ", " << p.second << ") ";
}
template<class T> ostream &operator << (ostream &os, const vector<T> &v){
    for(size_t i = 0; i < v.size(); i++) os << v[i] << (i + 1 == v.size() ? "" : ", "); return os;
}
#ifdef DEBUG
#define dump(...) (cerr << #__VA_ARGS__ << " = " << make_tuple(__VA_ARGS__) \
                   << " (L : " << __LINE__ << ")" << endl)
#else
#define dump(...)
#endif
#define all(c) begin(c), end(c)
#define range(i,a,b) for(int i = a; i < (int)(b); i++)
#define rep(i,b) range(i,0,b)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
typedef long long ll;
// #define int ll
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
void fastios(){ ios_base::sync_with_stdio(0); cin.tie(0); }
int const mod = 1000000007;

using Weight = long long;
using Capacity = int;
struct Edge {
    int src, dst; Weight weight;
    Edge(int s, int d, int w) : src(s), dst(d), weight(w) {}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;

auto const inf = numeric_limits<Weight>::max()/8;
Matrix warshallFloyd(const Graph &g){
    int n = g.size(); Matrix d(n, Array(n, inf));
    rep(i,n) d[i][i] = 0;
    rep(i,n) for(auto &e : g[i])
        d[e.src][e.dst] = min(d[e.src][e.dst], e.weight);
    rep(k,n)rep(i,n)rep(j,n)if(d[i][k] != inf && d[k][j] != inf)
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
    return d;
}

int main(){
    int V,E;
    while(cin >> V >> E){
        Graph g(V);
        rep(i,E){
            int a,b,c;
            cin >> a >> b >> c;
            g[a].eb(a,b,c);
        }
        auto d = warshallFloyd(g);
        bool negCycle = false;
        rep(i,g.size()){
            negCycle |= d[i][i] < 0;
        }
        if(negCycle) cout << "NEGATIVE CYCLE" << endl;
        else {
            rep(i,V)rep(j,V){
                if(d[i][j] >= inf) cout << "INF";
                else cout << d[i][j];
                if(j != V-1) cout << ' ';
                else cout << endl;
            }
        }
    }
}

Measured memory_bytes: 3300
fun main() {
    val n = readLine()!!.toInt()

    val a = IntArray(n) { 0 }

    for (i in 0 until n) {
        a[i] = readLine()!!.toInt()
    }

    val grouped = a.toMutableList().groupBy { it }.mapValues { it.value.size }

    print(grouped.filterValues { it % 2 != 0}.entries.size)
}

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

int MIN(int A,int B){
    return A<B?A:B;
}

int MAX(int A,int B){
    return A>B?A:B;
}

int main(void){
    int p,q,r;
    scanf("%d%d%d",&p,&q,&r);
    int ans=MIN(p+q,q+r);
    ans=MIN(ans,r+p);
    printf("%d\n",ans);
    return 0 ;
}

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

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

  

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li n, q;

// time, {index, type(0:start 1;end)}
vector<tuple<li, li, li, li>> events;

li d[200200];

int main() {
    cin >> n >> q;
    events.reserve(n * 2);
    rin{
        li s, t, x;
        cin >> s >> t >> x;
        s -= x;
        t -= x;
        events.pb(make_tuple(s, 0, x, i));
        events.pb(make_tuple(t, 1, x, i));
    }
    sort(allof(events));
    rep(i, q) {
        cin >> d[i];
    }

    set<PI> happening_events;
    li now = 0;
    rep(i, q) {
        while (now < n * 2 && d[i] >= get<0>(events[now])) {
            if (get<1>(events[now]) == 0) {
                happening_events.insert({get<2>(events[now]), get<3>(events[now])});
            } else {
                happening_events.erase({get<2>(events[now]), get<3>(events[now])});
            }
            now++;
        }
        if (happening_events.empty()) {
            cout << -1 << endl;
        } else {
            cout << happening_events.begin()->F << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 27776
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    int n,m;    cin >> n >> m;
    int x;      cin >> x;
    vector<int>c(n);
    vector<vector<int>>a(n, vector<int>(m));
    rep(i, n){
        cin >> c[i];
        rep(j, m)   cin >> a[i][j];
    }
    const int INF = 1001001001;
    /*
     * bitで回す
     */
    int ans = INF;
    rep(i, 1 << n){
        int cost = 0;
        vector<int>geted(m);
        rep(j, n){
            if((1 << j) & i){
                cost += c[j];
                rep(k, m){
                    geted[k] += a[j][k];
                }
            }
        }
        bool flag = true;   //全部x以上:true
        rep(j, m)   if(geted[j] < x)    flag = false;
        if(flag)    ans = min(ans, cost);
    }
    if(ans == INF){
        cout << -1 << endl;
    }else{
        cout << ans << endl;
    }
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>
#include <numeric>
#include <iomanip>
#include <cstring> 
using namespace std;
using ll=long long;

#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define LLONG_MAXs 9223372036854775800

#define ALL(a) (a).begin(),(a).end()

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

 
bool isPrimeNum( ll x ){ // 素数である場合 true を返す
  if( x <= 1 ){ // 1以下である場合は素数でないことがすぐにわかる
    return false;
  }
  // sqrt( double型 ) は引数の平方根を double型で返すので、int型でキャスト
  int n = (int)sqrt( (double)x );
  for( int i = 2; i <= n; i++ ){
    if( x % i == 0 ){ // 割り切る整数がある場合、即判定終了
      return false;
    }
  }
  return true; // 割り切る整数がない場合、素数である
}

ll myPow(ll x, ll n, ll m){
  if(n == 0)
    return 1;
  if(n % 2 == 0)
    return myPow(x * x % m, n / 2, m);
  else
    return x * myPow(x, n - 1, m) % m;
}

constexpr ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
constexpr ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll abs(ll a,ll b){
if(a>=b)return a-b;
if(a<b)return b-a;
}
constexpr ll min(ll a,ll b){
if(a>=b)return b;
if(a<b)return a;
}

constexpr ll max(ll a,ll b){
if(a>=b)return a;
if(a<b)return b;
}

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>>que;

int main() {
  ll N,M;
  cin>>N>>M;
  ll x[N],y[N],z[N];
  FOR(i,0,N-1){
    cin>>x[i]>>y[i]>>z[i];
  }
  ll ans=-LLONG_MAX;

  FOR(flag,0,7){
    ll xflag= flag%2;
    ll yflag= (flag%4)/2;
    ll zflag= flag/4;

    if(xflag==0)xflag=-1;
    if(yflag==0)yflag=-1;
    if(zflag==0)zflag=-1;

    ll score[N];
    FOR(i,0,N-1){
      score[i]=x[i] * xflag+ y[i] * yflag + z[i] * zflag;
    }
    sort(score,score+N);
    ll sum=0;
    FOR(i,0,N-1){
      if(i+M>=N){
        sum=sum+score[i];
      }
    }

    ans=max(ans,sum);

  }


  cout<<ans<<endl;

return 0;
 
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
vector<ll> p(51),al(51);


int main(){
	ll n,x;
	cin>>n>>x;
	p[0] =al[0] = 1;
	for(int  i= 1;i<n+1;i++){
		p[i] = p[i-1]*2+1;
		al[i] = al[i-1]*2+3;
		//cout<<p[i]<<' '<<al[i]<<endl;
	}
	ll ans = 0;

	while(x>0&&n>=0){
		if(x>=al[n]){
		//cout<<n<<endl;
		x-=al[n];
		ans+=p[n];
			if(x>0){
				x--;
				ans++;
			}
		}else{
		x--;
		n--;
		}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=200005;
int n,a[N],tr[N<<2],ans[N];
vector<int>e[N],v;
void update(int k,int l,int r,int x,int v)
{
	if(l==r)
	{
		tr[k]=v;
		return;
	}
	int mid=l+r>>1;
	if(x<=mid) update(k<<1,l,mid,x,v);
	else update(k<<1|1,mid+1,r,x,v);
	tr[k]=max(tr[k<<1],tr[k<<1|1]);
}
int query(int k,int l,int r,int a,int b)
{
	if(a>b)
		return 0;
	if(l==a&&r==b)
		return tr[k];
	int mid=l+r>>1;
	if(b<=mid) return query(k<<1,l,mid,a,b);
	else if(a>mid) return query(k<<1|1,mid+1,r,a,b);
	else return max(query(k<<1,l,mid,a,mid),query(k<<1|1,mid+1,r,mid+1,b));
}
void dfs(int u,int f)
{
	int x=a[u];
	int zh=query(1,1,n,x,x),k=query(1,1,n,1,x-1);
	update(1,1,n,x,k+1);
	ans[u]=query(1,1,n,1,n);
	for(auto v:e[u])
		if(v!=f)
			dfs(v,u);
	update(1,1,n,x,zh);
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		v.push_back(a[i]);
	}
	sort(v.begin(),v.end());
	v.erase(unique(v.begin(),v.end()),v.end());
	for(int i=1;i<=n;i++)
		a[i]=lower_bound(v.begin(),v.end(),a[i])-v.begin()+1;
	for(int i=1;i<n;i++)
	{
		int u,v;
		scanf("%d%d",&u,&v);
		e[u].push_back(v);
		e[v].push_back(u);
	}
	dfs(1,0);
	for(int i=1;i<=n;i++)
		printf("%d\n",ans[i]);
	return 0;
}

Measured memory_bytes: 28208
n = int(input())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
cum1 = []
cum2 = []
a = 0
for i in range(n):
    a += l1[i]
    cum1.append(a)
a = 0
for i in range(n):
    a += l2[n - i - 1]
    cum2.append(a)
print(max(cum1[i] + cum2[n - i - 1] for i in range(n)))


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

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

int main() {
    {
        _time time(disable);
        string s, p; cin >> s >> p;
        _rep(i, _size(s)) {
            rotate(s.begin(), s.begin() + 1, s.end());
            if(s.find(p) != string::npos) { cout << "Yes" << endl; break; }
            if(i == _size(s) - 1) { cout << "No" << endl; break; }
        }
    }
    return 0;
}


Measured memory_bytes: 3228
parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n,a,b,c,d=parseMap(split(readline()))
    s=chomp(readline())
    ans="Yes"
    for i in a:c-1
        if s[i:i+1]=="##"
            ans="No"
        end
    end
    for i in b:d-1
        if s[i:i+1]=="##"
            ans="No"
        end
    end
    if c>d
        flg=false
        for i in b:min(d,n-1)
            if s[i-1:i+1]=="..."
                flg=true
            end
        end
        if !flg
            ans="No"
        end
    end
    println(ans)
end
main()

Measured memory_bytes: 155784
#include <iostream>
#include<algorithm>
#include<sstream>
#include<cmath>
#include<vector>
#include<iomanip>
#include<map>
#include<set>
#include<queue>
#include<deque>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(int i = 0; i < n;i++)
#define mod 1000000007
#define c(n) cout << fixed <<setprecision(10) << n << endl
int main() {
	ll l, r; cin >> l >> r;
	if (l / 2019 != r / 2019) cout << 0 << endl;
	else {
		int ans = 114514;
		for (int i = l % 2019; i < r % 2019; i++) {
			for (int j = i + 1; j <= r % 2019; j++) {
				ans = min(ans, (i * j) % 2019);
			}
		}
		cout << ans << endl;
	}
}

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


void solve(long long X){
    auto a = X / 500;
    auto b = X % 500;
    auto c = b / 5;
    cout << a * 1000 + c * 5 << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long X;
    scanf("%lld",&X);
    solve(X);
    return 0;
}


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

int main() {
	vector<bool>cnt(26, false);
	string s;
	cin >> s;
	for (int i = 0; i < s.length(); i++) {
		cnt[s[i] - 'a'] = true;
	}
	for (int i = 0; i < 26; i++) {
		if (!cnt[i]) {
			cout << (char)('a' + i) << endl;
			return 0;
		}
	}
	cout << "None" << endl;
	return 0;
}

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

int main(){
    int n,x,i,j,k,all=0;

    while(cin >> n >> x){
        if(n == 0 && x == 0) break;
        for(i=1;i<=n;i++){
            for(j=1+i;j<=n;j++){
                for(k=1+j;k<=n;k++){
                    if(i != j && j != k && i != k && i+j+k == x) all++;
                }
            }
        }
        cout << all << endl;
        all = 0;
    }
    return 0;
}



Measured memory_bytes: 3096
#include<iostream>
#include <cstdio>
#include<cctype>
#include<string>

using namespace std;

int main(){
	
	string s;
	
	while(1){
		cin >> s;
		
		if(s == "0") break;
		
		int l = s.length();
		
		int sum = 0;
		for(int i = 0; i < l; i++)
			sum += s[i] - '0';
		
		cout << sum << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1188
#include <stdio.h>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;

int c[200010];

int cmp(int a,int b){return a>b;}

long long mod=1e9+7;


int main()
{
    int n;scanf("%d",&n);
    for (int i=1;i<=n;++i) scanf("%d",&c[i]);
    sort(c+1,c+n+1,cmp);
    long long ans=0;
    for (int i=1;i<=n;++i){
        ans+=1LL*(i+1)*c[i];
        ans%=mod;
    }
    for (int i=1;i<=2*n-2;++i){
        ans*=2;
        ans%=mod;
    }
    printf("%lld\n",ans);
}


Measured memory_bytes: 896
N = int(input())
X_L = [[0] * 2 for i in range(N)]
for i in range(N):
    X, L = map(int, input().split())
    X_L[i][0] = X - L
    X_L[i][1] = X + L

X_L = sorted(X_L, key=lambda x:x[1],reverse=False)
#X_L = sorted(X_L, key=lambda x:x[0],reverse=False)

#print(X_L)

right = X_L[0][1]
Sum = 1

for i in range(1,N):
    if right <= X_L[i][0]:
        Sum += 1
        right = X_L[i][1]

print(Sum)

Measured memory_bytes: 58784
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    vi a(n);
    rep(i, n) cin >> a[i];
    vi cnt(20, 0);
    
    int r = 0;
    ll ans = 0;
    for (int l = 0; l < n; ++l) {
        while (r < n) {
            bool ok = true;
            rep(i, 20) {
                if (a[r]>>i&1 && cnt[i]) ok = false;
            }
            if (!ok) break;
            rep(i, 20) {
                if (a[r]>>i&1) cnt[i]++;
            }
            r++;
        }
        ans += r - l;
        rep(i, 20) {
            if (a[l]>>i&1) {
                cnt[i]--;
            }
        }
        if (r == l) r++;
    }
    cout << ans << endl;
}

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

using namespace std;
#define rep(i,n) for (int i =0;i<(n);++i)
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;
int main() {
    string S;
    cin >> S ;
    int a = S.length();
    rep(i, a)cout << "x"; 
}

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

int main(){
    int a,b,c,d,e,f,g,h,i,j,k,l,m,n,w,ii;
    vector<vector<int>> Vem(3,vector<int>(3));
    for(int ii = 0;ii < 3;ii++){
        for(int w = 0;w < 3;w++){
            cin >> Vem.at(ii).at(w);
            
        }
    }

    cin >> a;
    for(b = 0;b < a;b++){
        cin >> c;
        for(int ii = 0;ii < 3;ii++){
            for(int w = 0;w < 3;w++){
                if(c == Vem.at(ii).at(w)){
                    Vem.at(ii).at(w) = 199;
                }
            }
        }
    }
    d = 0;
    e = Vem.at(0).at(0);
    f = Vem.at(0).at(1);
    g = Vem.at(0).at(2);
    h = Vem.at(1).at(0);
    i = Vem.at(1).at(1);
    j = Vem.at(1).at(2);
    k = Vem.at(2).at(0);
    l = Vem.at(2).at(1);
    m = Vem.at(2).at(2);
    if((e == f&& f == g) || (h == i&& i == j) || (k == l && l == m) || (e == h&& h == k) || (f == i&& i == l)||(g == j&&j ==m) || (e == i&& i ==m) || (g == i && i == k)){
        d = 1;
    }
    if(d == 1){
        cout << "Yes" <<endl;
    }else{
        cout << "No" << endl;
    }
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		String s = sc.next();
		String ans[] = {"Yes", "No"};
		sc.close();
		int an = 0;
		int n = s.length();
		for(int i = 0; i < a; ++i) {
			if(s.charAt(i) < '0' || s.charAt(i) > '9') {
				an = 1;
				break;
			}
		}
		if(s.charAt(a) != '-')an = 1;
		if(an != 1) {
			for(int i = a + 1; i < n; ++i) {
				if(s.charAt(i) < '0' || s.charAt(i) > '9') {
					an = 1;
					break;
				}
			}
		}
		System.out.println(ans[an]);
	}
}


Measured memory_bytes: 22740
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n; cin >> n;
    vector<int> h(n+1, 0);
    for (int i = 0; i < n; i++) {
        cin >> h[i+1];
        if (h[i+1]-1 >= h[i]) h[i+1]--;
        if (h[i] > h[i+1]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using LL  = long long;
using VI  = vector<LL>;
using VVI = vector<VI>;
using VB  = vector<bool>;
using VS  = vector<string>;
using PII = pair<LL, LL>;
using VP  = vector<PII>;
#define PB           push_back
#define MP           make_pair
#define SZ(a)        LL((a).size())
#define EACH(x, c)   for (auto x : (c))
#define ALL(c)       (c).begin(), (c).end()
#define REVERSE(c)   reverse(ALL(c))
#define SORT(c)      stable_sort(ALL(c))
#define RSORT(c)     stable_sort((c).rbegin(), (c).rend())
#define FSORT(c)     stable_sort(ALL(c), [] (auto& x, auto& y) {return x.first < y.first;});
#define FRSORT(c)    stable_sort(ALL(c), [] (auto& x, auto& y) {return x.first > y.first;});
#define SSORT(c)     stable_sort(ALL(c), [] (auto& x, auto& y) {return x.second < y.second;});
#define SRSORT(c)    stable_sort(ALL(c), [] (auto& x, auto& y) {return x.second > y.second;});
#define FOR(i, a, b) for (LL i = (a); i < (b); ++i)
#define REP(i, n)    FOR(i, 0, n)
#define $(x) {cout << #x << " = " << (x) << endl;}


int main() {
	LL N, K;
    cin >> N >> K;
    VI a(N);
    REP(i, N) cin >> a[i];

    VB dp(K + 1);   // false: lose, true: win when k <= K stones remain
    REP(i, K + 1) {
        REP(j, N) {
            if (i - a[j] >= 0) {   // operation is valid
                dp[i] = dp[i] | !dp[i - a[j]];   // win if there is an operation going to false (opponent loses)
            }
        }
    }
    cout << (dp[K] ? "First" : "Second") << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int main()
{
    ll n;
    cin>>n;
    vector<long long> arr(n);
    for(ll i=0;i<n;i++)
        cin>>arr[i];
    vector<long long> dp1(n);
    vector<long long> dp2(n);
    vector<long long> ans(n);
    dp1[0]=arr[0];
    dp2[n-1]=arr[n-1];
    for(int i=1;i<n;i++)
    {
        dp1[i]=dp1[i-1]^arr[i];
    }
    for(int i=n-2;i>=0;i--)
    dp2[i]=dp2[i+1]^arr[i];
    ans[0]=dp2[1];
    ans[n-1]=dp1[n-2];
    for(ll i=1;i<=n-2;i++)
    {
        ans[i]=dp1[i-1]^dp2[i+1];
    }
    for(ll i=0;i<n;i++)
    cout<<ans[i]<<" ";
    return 0;
}

Measured memory_bytes: 9560
#include<iostream>
#include<algorithm>
#include<vector>
#include <cmath>
#include <limits>
#include <iomanip>
using namespace std;
const long long INF=20000000000;

int main(){
	int N,K,Q;
	cin>>N>>K>>Q;
	int A[Q];
	for(int i=0;i<Q;i++){
		cin>>A[i];
	}
	vector<long long>ans(N+1,K);
	for(int i=1;i<=N;i++){
		ans[i]-=Q;
	}
	for(int i=0;i<Q;i++){
		ans[A[i]]+=1;
	}
	for(int i=1;i<=N;i++){
		if(ans[i]>0)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}

	
}
	


Measured memory_bytes: 1792
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    s=STR()
    ct=0
    for i in range(n-2):
        if s[i:i+3]=='ABC':
            ct+=1
    print(ct)
            
if __name__ == '__main__':
    do()

Measured memory_bytes: 3064
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define fo(i,n) for(int i=0;i<(n);i++)
#define inp(a) int a;cin>>a;
#define inpa(a,n)vector<int> a(n);fo(i,n)cin>>a[i];
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
using namespace std;
#define int ll
// #define MAX 20
#define INF (int)1e18

template<class T> ostream& operator<<(ostream& cout,vector<T> V)
{cout<<"[ ";for(auto v:V)cout<<v<<' ';return cout<<']';}
template<class L,class R> ostream& operator<<(ostream& cout,pair<L, R> P)
{return cout<<'('<<P.F<<','<< P.S<<')';}


signed main()
{
	fio
	inp(n)
	set<string> s;
	fo(i,n)
	{
		string c;
		cin>>c;
		s.insert(c);
	}
	cout<<s.size()<<'\n';
	printclock;
}

Measured memory_bytes: 19400
#include <iostream>
#include <string>
#include <set>
#include <map>
#include<bits/stdc++.h>
using namespace std;
int main(){
   int N;
   cin >> N;
   map<int,int>mp;
   for(int i=0;i<N;i++){
       int a;
       cin >> a;
       mp[a-1] +=1;
       mp[a  ] +=1;
       mp[a+1] +=1;
   }
   int ans = 0;
   for(auto &x : mp){
       ans = max(ans, x.second);
   }
   cout << ans << endl;
}

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

#define ll long long
#define ull unsigned long long 
#define endl '\n'
#define pii pair<int, int>
#define all(a) a.begin(),a.end()

int main(){
    int n, m;
    cin >> n >> m;
    int mn=0, mx=10000000;
    for(int i=0; i<m; ++i){
        int a, b;
        cin >> a >> b;

        mx = min(mx, b);
        mn = max(mn, a);
    }

    cout << max(mx-mn+1, 0);
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define check system("pause")
#define all(x) (x).begin(),(x).end()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 0x3f3f3f3f
const ll mod = 1e9+7;
const int N = 1e6+20;
#define dep(i,a,b) for(int i=(a);i>=(b);i--)
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define mes(p,b) memset(p,b,sizeof(p))
#define sz(x) int(x.size())
inline __int128 read()
  {
      __int128 x=0,f=1;
     char ch=getchar();
     while(ch<'0'||ch>'9')
      {
          if(ch=='-')
             f=-1;
         ch=getchar();
     }
     while(ch>='0'&&ch<='9')
     {
         x=x*10+ch-'0';
         ch=getchar();
     }
     return x*f;
 }
 
 inline void write(__int128 x)
 {
     if(x<0)
     {
         putchar('-');
         x=-x;
     }
     if(x>9)
         write(x/10);
     putchar(x%10+'0');
 }

__int128 a,b,n,ans=1;
int main()
{
  	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	n=read();
	int flag=1;
	rep(i,1,n){
		a=read();
		ans=ans*a;
		
		if(ans>(ll)(1e18)||ans<0){
		
			flag=-1;
		
		}
		if(a==0) flag=0;
	}
	if(flag==0) cout<<0;
	else if(flag==-1) cout<<-1;
	else write(ans);
	
  	return 0;
}



Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
pair<int,bool> A[16][16];
int a[16];
int main()
{
  int n;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
    for(int j=0;j<a[i];j++)
      cin>>A[i][j].first>>A[i][j].second,
    A[i][j].first--;
  }
  int ans=0;
  for(int i=0;i<(1<<n);i++)
  {
    bool ok=true;
    for(int j=0;j<n;j++)
      if(i&(1<<j))
        for(int k=0;k<a[j];k++)
          if(((i>>A[j][k].first)&1)!=A[j][k].second)
            ok=false;
    if(ok)
      ans=max(ans,__builtin_popcount(i));
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<utility>
using namespace std;
int main () {
  int N;
  cin >> N;
  vector<pair<long long, long long>>work(N);
  for (int i = 0; i < N; i ++) {
    long long A, B;
    cin >> A >> B;
    work[i] = make_pair(B, A);
  }
  sort(work.begin(), work.end());
  long long A = 0;
  long long B = 0;
  for (int i = 0; i < N; i ++) {
    A += work[i].second;
    B = work[i].first;
    if (A > B) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}



Measured memory_bytes: 3328
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける
 
ll a,b,k;
 
int main(){
  ll ans=0;
  cin >> a>>b>>k;
  if (a<k){
    k-=a;
    a=0;
  }else{
    a-=k;
    k=0;
  }
 
  if (a==0){
    if (b<k){
      b=0;
      k-=b;
    }else{
      b-=k;
      k=0;
    }
  }
 
 
  cout<<a<<" "<<b<<endl;
  return 0;
}

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

//毒入りを食べたとき、回復しないといけない
//回復するときはおいしいものを優先
int A,B,C;

int main(){
    cin>>A>>B>>C;
    bool poison=0;
    int ans=0;
    while(1){
        if(!poison&&C>0){
            poison=1;
            ans++;
            C--;
            continue;
        }
        if(C==0){
            ans+=B;
            break;
        }
        if(poison&&A+B>0){
            if(B>0){
                B--;
                poison=0;
                ans++;
                continue;
            }else {
                A--;
                poison=0;
                continue;
            }
        }
        if(poison&&A+B==0)break;
    }
    cout<<ans<<endl;
    
    return 0;
}

Measured memory_bytes: 256
# ABC166 B
n,k = map(int, input().split())
# お菓子を持っているすぬけ君かを判断する配列d 1ならもってる 0はもってない
d = [0] * n
# お菓子iを持っているのはどのすぬけ君か？
for i in range(k):
    # お菓子iを持っている人数m人
    m = int(input())
    # お菓子iを持っているすぬけ君のリスト
    a = list(map(int, input().split()))
    for j in a:
        # すぬけ君a[j]は少なくとも一つ以上のお菓子を持っている
        d[j-1] = 1 
        
#いたずらされる人数ans人
ans = 0
for i in range(n):
    if d[i] == 0:
        ans += 1

print(ans)

Measured memory_bytes: 9084
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

typedef pair<int, int> P;
typedef tuple<int, int, int> T;

class UnionFind {
  vector<int> par, rank, potential;
public:
  UnionFind(int n) {
    par.resize(n, -1);
    rank.resize(n, 0);
    potential.resize(n, 0);
  }
  int root(int x) {
    if (par[x] < 0)
      return x;
    int r = root(par[x]);
    potential[x] += potential[par[x]];
    return par[x] = r;
  }
  int size(int x) {
    return -par[root(x)];
  }
  int weight(int x) {
    root(x);
    return potential[x];
  }
  bool same(int x, int y) {
    return root(x) == root(y);
  }
  bool unite(int x, int y, int w = 0) {
    w += weight(x);
    w -= weight(y);
    x = root(x);
    y = root(y);
    if (x == y) {
      return false;
    }
    if (rank[x] < rank[y]) {
      swap(x, y);
      w = -w;
    }
    if (rank[x] == rank[y])
      rank[x]++;
    par[x] += par[y];
    par[y] = x;
    potential[y] = w;
    return true;
  }
  int diff(int x, int y) {
    return weight(y) - weight(x);
  }
};

int main() {
  int N;
  cin >> N;
  vector<P> x(N), y(N);
  rep(i, N) {
    cin >> x[i].first >> y[i].first;
    x[i].second = y[i].second = i;
  }
  sort(x.begin(), x.end());
  sort(y.begin(), y.end());
  priority_queue<T, vector<T>, greater<T>> que;
  rep(i, N-1) {
    int cost = x[i+1].first-x[i].first;
    int idx1 = x[i].second;
    int idx2 = x[i+1].second;
    que.push(tie(cost, idx1, idx2));
  }
  rep(i, N-1) {
    int cost = y[i+1].first-y[i].first;
    int idx1 = y[i].second;
    int idx2 = y[i+1].second;
    que.push(tie(cost, idx1, idx2));
  }
  UnionFind uf(N);
  ll ans = 0;
  while (!que.empty()) {
    int cost, a, b;
    tie(cost, a, b) = que.top();
    que.pop();
    if (uf.unite(a, b))
      ans += cost;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 6388
n =  int(input())
p = list(map(int, input().split()))
cnt = 0

for i in range(n-2):
    P = p[i:i+3]
    if P[0] < P[1] < P[2]:
        cnt += 1
    elif P[2] < P[1] < P[0]:
        cnt += 1
        
print(cnt)

Measured memory_bytes: 61976
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  string S;
  cin >> N;
 
  int b = 0;
  int i;
  for (i = 0; i < N; i++){
    cin >> S;   
     if (S == "Y"){
      b = 1; 
     }
  }
  
  if (b == 0){
    cout << "Three";
  }
  else {
    cout << "Four";
  }
}


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

int main(){
  string s,t;
  cin >> s >> t;
  int ans=s.length();

  for(int i=0;i<s.length()-t.length()+1;i++){
    int cnt=0;
    string tmp=s.substr(i,t.length());
    for(int j=0;j<t.length();j++){      
      if(tmp.at(j)!=t.at(j)) cnt++;
    }
    ans=min(ans,cnt);
  }

  cout << ans << endl;

}

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

int main(){
  int N,K,M,s;
  cin>>N>>K;
  s=0;
 if(K>(N-2)*(N-1)/2){
   cout<<-1<<endl;
 }
  else{
    M=N-1-K+(N-1)*(N-2)/2;
    cout<<M<<endl;
        M=(N-1)*(N-2)/2-K;
   for(int i=1;i<N;i++){
cout<<1<<" "<<i+1<<endl;
   }
    if(M==0){
      return 0;
    }
    for(int j=2;j<N+1;j++){
    for(int i=j+1;i<N+1;i++){
      cout<<j<<" "<<i<<endl;
      s++;
      if(s==M){
        return 0;
      }
    }
  }
}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;
 
int main(){
    int N, M;
    cin >> N >> M;
    if (N == M) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
	int n		= 0;
	int curR	= 0;
	int maxR	= 0;
	int minR	= 1000000000;
	int difR	= 0;
	int difRmax = maxR - minR;

	scanf("%d", &n);
	scanf("%d", &minR);
	for (int i = 1; i < n; ++i)
	{
		scanf("%d", &curR);
		difR = curR - minR;
		if (difR > difRmax)
			difRmax = difR;

		if (curR < minR)
			minR = curR;
	}
	printf("%d\n", difRmax);
	return 0;
}

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

int main(){
    string n;
    cin >> n;
    for(int i = 0; i < 3; i++) {
        if(n[i] == '1') {
            n[i] = '9';
        }
        else {
            n[i] = '1';
        }
    }
    cout << n << endl;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"io"
	"log"
	"os"
	"strconv"
)

func main() {
	n := readInt()
	for i := 0; i < n; i++ {
		a := readInt()
		if a%2 == 1 {
			continue
		}
		if a%3 != 0 && a%5 != 0 {
			fmt.Println("DENIED")
			return
		}
	}

	fmt.Println("APPROVED")
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

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

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	log.SetFlags(log.Lshortfile)
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 640
/**
 *    author:  tourist
 *    created: 29.12.2018 15:24:41       
**/
#include <bits/stdc++.h>

using namespace std;

const int md = (int) 1e9 + 7;

inline void add(int &a, int b) {
  a += b;
  if (a >= md) a -= md;
}

inline void sub(int &a, int b) {
  a -= b;
  if (a < 0) a += md;
}

inline int mul(int a, int b) {
#if !defined(_WIN32) || defined(_WIN64)
  return (int) ((long long) a * b % md);
#endif
  unsigned long long x = (long long) a * b;
  unsigned xh = (unsigned) (x >> 32), xl = (unsigned) x, d, m;
  asm(
    "divl %4; \n\t"
    : "=a" (d), "=d" (m)
    : "d" (xh), "a" (xl), "r" (md)
  );
  return m;
}

inline int power(int a, long long b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}

inline int inv(int a) {
  a %= md;
  if (a < 0) a += md;
  int b = md, u = 0, v = 1;
  while (a) {
    int t = b / a;
    b -= t * a; swap(a, b);
    u -= t * v; swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, tt;
  cin >> n >> tt;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<vector<int>> b(n, vector<int>(n, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      b[i][j] = (a[i] < a[j]);
    }
  }
  int inv2 = inv(2);
  int final_coeff = power(2, tt);
  while (tt--) {
    int x, y;
    cin >> x >> y;
    x--; y--;
    for (int i = 0; i < n; i++) {
      if (i != x && i != y) {
        {
          int sum = b[i][x];
          add(sum, b[i][y]);
          sum = mul(sum, inv2);
          b[i][x] = b[i][y] = sum;
        }
        {
          int sum = b[x][i];
          add(sum, b[y][i]);
          sum = mul(sum, inv2);
          b[x][i] = b[y][i] = sum;
        }
      }
    }
    {
      int sum = b[x][y];
      add(sum, b[y][x]);
      sum = mul(sum, inv2);
      b[x][y] = b[y][x] = sum;
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      add(ans, b[i][j]);
    }
  }
  ans = mul(ans, final_coeff);
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 35584
#include<iostream>
#include<stdio.h>
#include<vector>
using namespace std;

typedef pair<int,int> P;

int w,n;
P yoko;	//データは高さ昇順
int pos[32];	//縦棒iからスタートしたとき、今pos[i]番目の縦棒にいる。

int seach(int *p,int num,int size){
	for(int i = 0;i < size;i++){
		if(p[i] == num)
			return i;
	}
	return -1;
}
int main(){
	int i;
	cin >> w >> n;
	for(i = 1;i <= w;i++){
		pos[i] = i;
	}
	for(i = 0;i < n;i++){
		int t1,t2;
		scanf("%d,%d",&yoko.first,&yoko.second);
		t1 = seach(pos,yoko.first,w+1);t2 = seach(pos,yoko.second,w+1);
		//cout << pos[t1] << pos[t2] << endl;
		pos[t1] = yoko.second;
		pos[t2] = yoko.first;
		//cout << pos[t1] << pos[t2] << endl;
	}
	int sita[32];
	for(i = 1;i <= w;i++){
		sita[pos[i]] = i;
	}
	for(i = 1;i <= w;i++)
		cout << sita[i] << endl;
	return 0;
}

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

int main(){
    int x,a,b;cin >> x >> a >> b;

    if (b-a >= x + 1){
        cout << "dangerous" << endl;
    } else if (0 < (b-a) && (b-a) <= x ){
        cout << "safe" << endl;
    } else {
        cout << "delicious" << endl;
    }

	return 0;
}

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

int main()
{
    long long A,B,C,K;
    cin >> A >> B >> C >> K;

    long long count = 0;

    if (A >= K) {
        cout << K << endl;
    }
    else {
        count = count + A;
        K = K - A;
        if (B >= K) {
            cout << count << endl;
        }
        else {
            K = K - B;
            count = count - K;
            cout << count << endl;
        }
    }
}

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

#define ll long long
#define endl "\n"

int main(void)
{
    int a, n, i, val, sum = 0;
    cin >> a >> n;
    for(i = 0; i < n; i++)
    {
        cin >> val;
        sum = sum + val;
    }
    if(a <= sum)
        cout<<"Yes\n";
    else
        cout<<"No\n";

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<string>
#include<iostream>
using namespace std;
#define LL long long
#define db(x) cout<<#x<<"="<<x<<endl
int n,Ans,Cnt;
int H[100005],a,b;
int main() {
	scanf("%d",&n);
	for(int i=1; i<=n; ++i)scanf("%d",H+i);
	for(int i=1; i<n; ++i) {
//		db(Cnt);
		if(H[i]>=H[i+1])++Cnt;
		else Ans=max(Ans,Cnt),Cnt=0;
	}
	Ans=max(Ans,Cnt);
	printf("%d",Ans);
}

Measured memory_bytes: 640
N = int(input())
import math
n = int(math.sqrt(N)) + 1
p = []
for i in range(2,n):
  if N % i == 0:
    a = 0
    while N % i == 0:
      N //= i
      a += 1
    p.append([i,a])
if N != 1:
  p.append([N,1])
ans = 0
l = len(p)
for i in range(l):
  a = p[i][1]
  j = 1
  while a-j >= 0:
    a -= j
    j += 1
    ans += 1
print(ans)

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

int main()
{
    int a, b, c, d, cost=0;

    cin>>a>>b>>c>>d;

    if(a<b)
        cost = cost + a;
    else
        cost = cost + b;

    if(c<d)
        cost = cost + c;
    else
        cost = cost + d;

    cout<<cost;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

double dst(int x[], int y[], int d, int n)
{
    long long ld=0;
    for(int i=0; i<n; i++){
        ld+=pow(abs(x[i]-y[i]), d);
    }
    return (double)pow(ld, (double)1/d);
}

int main()
{
    int n;
    scanf("%d", &n);
    int x[n], y[n], max = -1000;
    for (int i = 0; i < 2; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (i){
                scanf("%d", &y[j]);
                if (abs(x[j] - y[j]) > max){
                    max = abs(x[j] - y[j]);
                    // printf("max: %d\n", max);
                }
            }
            else
            {
                scanf("%d", &x[j]);
            }
        }
    }
    printf("%.7lf\n", dst(x, y, 1, n));
    printf("%.7lf\n", dst(x, y, 2, n));
    printf("%.7lf\n", dst(x, y, 3, n));

    printf("%.7lf\n", (double)max);
}


Measured memory_bytes: 2100