akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string>
#include<stdexcept>
#include<stdio.h>
#include<queue>
#include <cmath>
#include<bits/stdc++.h>
#include<math.h>
//for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<n;i++) cin >> x[i];
#define pi pair<int,int> 
using namespace std;
using ll = long long;
int main(){
    string h; cin >> h;
    int r[100002]={},l[100002]={};
    int k=0;
    for(int i=0;i<h.size()-1;i++){
        if(h[i]=='R' && h[i+1]=='R') r[k]++; 
        else if(h[i]=='L' && h[i+1]=='L') l[k]++;
        else if(h[i]=='L' && h[i+1]=='R') k++;
    }
    for(int p=0;p<=k;p++){
        for(int i=0;i<r[p];i++) cout << '0' << ' ';
        if((r[p]+l[p]) % 2 == 0){
            cout << (r[p]+l[p]+2)/2 <<' '<< (r[p]+l[p]+2)/2 << ' ';
        }else if((r[p]+l[p]) % 2 != 0 && l[p] % 2 != 0){
            cout << (r[p]+l[p]+3)/2 <<' '<<(r[p]+l[p]+1)/2 << ' ';
        }else{
            cout << (r[p]+l[p]+1)/2 <<' '<< (r[p]+l[p]+3)/2 << ' ';
        }
        for(int i=0;i<l[p];i++) cout << '0' << ' ';
    }
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define MOD 1000000007
#define EPS (1e-10)
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

vector<int>v[40], u[40];
int main() {
	ll h, w, K; scanf("%lld%lld%lld", &h, &w, &K);
	rep(i, h) {
		rep(j, w) {
			int d; scanf("%1d", &d);
			v[j].push_back(d);
		}
	}
	rep(j, w)reverse(v[j].begin(), v[j].end());
	ll Max = 0;
	rep(i, h)rep(j, w) {
		rep(k, w)u[k] = v[k];
		ll sum = 0;
		u[j].erase(u[j].begin() + i);
		ll cnt = 0;
		bool update = true;
		while (update) {
			update = false;
			rep(k, h) {
				ll t, C = 0, back, s = 0;
				for (; u[s].size() <= k&&s < w; s++);
				if (s == w)continue;
				back = u[s][k];
				t = s;
				while (t < w) {
					if (u[t].size() > k&&back == u[t][k]) { C++; t++; }
					else {
						if (C >= K) {
							update = true;
							for (ll y = s; y < t; y++) {
								sum += (ll)pow(2, cnt)*u[y][k];
								u[y][k] = -1;
							}
						}
						s = t; C = 0;
						for (; u[s].size() <= k&&s < w; s++);
						if (s != w)back = u[s][k];
						t = s;
					}
				}
				if (C >= K) {
					update = true;
					for (ll y = s; y < t; y++) {
						sum += (ll)pow(2, cnt)*u[y][k];
						u[y][k] = -1;
					}
				}
			}
			rep(k, h)rep(t, u[k].size()) {
				if (u[k][t] == -1) {
					u[k].erase(u[k].begin() + t); t--;
				}
			}
			cnt++;
		}
		Max = max(Max, sum);
	}
	printf("%lld\n", Max);
}

Measured memory_bytes: 512
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (A[-1] + 2)
c = 0

for a in A:
    if B[a] != 0:
        B[a] = 2
    for i in range(a, A[-1] + 1, a):
        B[i] += 1
for a in A:
    if B[a] == 1:
        c += 1
print(c)

Measured memory_bytes: 32244
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	int a[n],s=0;
	for(int i = 0 ; i < n; i ++)
	{
		cin >> a[i];
		s+= a[i];
	}
	int k = 0;
	for(int i = 0 ; i < n ; i++)
	{
		if(a[i]*4*m>=s)
          k++;
	}

	cout << (k>=m?"Yes":"No") <<"\n";
	
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(100000000)
S = int(input())

mod = 10**9+7

def dfs_memo(n):
    memo = [0]*(n+1)
    memo[3] = 1

    def dfs(n):
        if n < 3:
            return 0
        elif memo[n] != 0:
            return memo[n]
        memo[n] = dfs(n-1)+dfs(n-3)
        return memo[n]
    return dfs(n)

if S <3:
    print(0)
else:
    print(dfs_memo(S)%mod)

Measured memory_bytes: 10732
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep2(i, m, n) for (int i = m; i < n; ++i)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
// vvi data(n, vi(m));
using vll = vector<long long>;
using vvll = vector<vll>;


int main() {
  int H, W, h, w;
  cin >> H >> W >> h >> w;
  cout << (H - h) * (W - w) << endl;
}


Measured memory_bytes: 256
import java.util.*;
class Main {
    public static void main(String[]args)throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int k = 0;
        for(; a <= b; a++) {
            if((c % a) == 0) k++;
        }
        System.out.println(k);
    }
}

Measured memory_bytes: 17348
N = int(input())
A = [int(i) for i in input().split()]

for i in range(N) :
  if A[i] % 2 == 0 :
    if A[i] % 3 != 0 and A[i] % 5 != 0 :
      print('DENIED')
      break
else :
  print('APPROVED')

Measured memory_bytes: 38384
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  int X,Y;
  X=e*a;
  Y=b;
  if(e>c)
    Y+=(e-c)*d;
  cout<<min(X,Y)<<endl;


}

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

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 

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

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

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

    cin>>h>>w>>n>>y>>x>>s>>t;
    ll xmi=1,xma=w,ymi=1,yma=h;
    rrrep(i,n-1,0){
        if(t[i]=='L'&&xma!=w)xma++;
        else if(t[i]=='R'&&xmi!=1)xmi--;
        else if(t[i]=='U'&&yma!=h)yma++;
        else if(t[i]=='D'&&ymi!=1)ymi--;
        if(s[i]=='L')xmi++;
        else if(s[i]=='R')xma--;
        else if(s[i]=='U')ymi++;
        else yma--;
        if(xmi>xma||ymi>yma){
            Cout("NO");
            return 0;
        }
         if(xmi==0||xmi==w+1){
            Cout("NO");
            return 0;
        }
        if(xma==0||xma==w+1){
            Cout("NO");
            return 0;
        }
        if(ymi==0||ymi==h+1){
            Cout("NO");
            return 0;
        }
        if(yma==0||yma==h+1){
            Cout("NO");
            return 0;
        }
        if(xmi>xma||ymi>yma){
            Cout("NO");
            return 0;
        }
        //cout<<xmi<<" "<<xma<<" "<<ymi<<" "<<yma<<"\n";
    }
    //cout<<xmi<<" "<<xma<<" "<<ymi<<" "<<yma<<"\n";
    if(xmi<=x&&x<=xma&&ymi<=y&&y<=yma&&xmi<=xma&&ymi<=yma)Cout("YES");
    else Cout("NO");
    return 0;
}


Measured memory_bytes: 920
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<functional>
#include<algorithm>
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;


struct Range{
	int s,e;
	Range(){}
	Range(int s,int e):s(s),e(e){}
	bool operator<(const Range &r)const{return e<r.e;}
};
vector<Range> merge_range(vector<Range> r){
	vector<Range> res;
	sort(r.begin(),r.end());
	for(int i=0;i<(int)r.size();i++){
		int mi=r[i].s;
		while(!res.empty()&&r[i].s<=res.back().e){
			mi=res.back().s;
			res.pop_back();
		}
		res.push_back(Range(min(mi,r[i].s),r[i].e));
	}
	return res;
}


int main(){
	int n,m;
	Range r[500];
	cin>>n>>m;
	rep(i,m)cin>>r[i].s>>r[i].e;
	int ans=n+1;
	vector<Range> vr(merge_range(vector<Range>(r,r+m)));
	rep(i,vr.size()){
		ans+=(vr[i].e-vr[i].s)*2;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1208
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <limits>
#include <sstream>
#include <map>
#include <string>
#include <vector>

size_t GetNum(std::map<size_t, size_t> &m) {
  size_t count = 0;

  for (std::map<size_t, size_t>::const_iterator it = m.begin(); it != m.end(); it++){
    size_t vv = it->second;
    count += vv * (vv - 1) / 2;
  }

  return count;
}

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

  std::cin >> n;

  std::vector<size_t> a;
  std::map<size_t, size_t> m;
  a.reserve(n);

  for (int i = 0; i < n; i++) {
    size_t v;
    std::cin >> v;
    a.push_back(v);
    m[v]++;
  }

  size_t count = GetNum(m);

  for (int i = 0; i < n; i++) {
    size_t vvv = m[a.at(i)];
    size_t vv = (m[a.at(i)] == 0) ? 0 : (m[a.at(i)] - 1);
    std::cout << count - (vvv * (vvv - 1) / 2 - vv * (vv - 1) / 2) << "\n";
  }

  return 0;
}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,K;
    cin >> N >> K;
    double ans = 0;
    rep(i,0,N){
        ll v = i+1;
        ll cnt = 0;
        while(v * pow(2,cnt) < K){
            cnt++;
        }
        double cd = cnt;
        double tt = 1 / pow(2,cd) / (double)N;
        ans += tt;
    }
    cout << setprecision(13) << ans << endl;



    
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

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

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

    int n;
    cin>>n;
    vector<int> xs(n), ys(n);
    rep(i, n) cin>>xs[i];
    rep(i, n) cin>>ys[i];

    double d, d1, d2, d3, di;
    vector<double> dif(n);
    d1 = 0; d2 = 0; d3 = 0; di = 0;
    rep(i, n) {
        d = fabs(xs[i] - ys[i]);
        d1 += d;
        d2 += pow(d, 2);
        d3 += pow(d, 3);
        dif[i] = d;
    }
    d2 = sqrt(d2);
    d3 = cbrt(d3);
    di = *max_element(dif.begin(), dif.end());
    printf("%.10f\n%.10f\n%.10f\n%.10f\n", d1, d2, d3, di);
}


Measured memory_bytes: 3444
N, M, Q = map(int, input().split())
 
a = [[0 for i in range(509)] for j in range(509)]
sum = [[0 for i in range(509)] for j in range(509)]
 
for i in range(M):
  p, q = map(int, input().split())
  a[p][q] += 1
 
for i in range(1,N+1):
  for j in range(i,N+1):
    sum[i][j] = sum[i][j-1] + a[i][j]
 
 
for i in range(Q):
  p, q = map(int, input().split())
  ans = 0
  for j in range(p,q+1):
    ans += sum[j][q] - sum[j][p-1]
  print(ans)

Measured memory_bytes: 57432
import java.util.Comparator;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		TreeSet<Interval> a = new TreeSet<Interval>(Comparator.comparing(Interval::getLeft).thenComparing(Interval::getId));
		TreeSet<Interval> b = new TreeSet<Interval>(Comparator.comparing(Interval::getRight).thenComparing(Interval::getId));
		TreeSet<Interval> c = new TreeSet<Interval>(Comparator.comparing(Interval::getLeft).thenComparing(Interval::getId));
		TreeSet<Interval> d = new TreeSet<Interval>(Comparator.comparing(Interval::getRight).thenComparing(Interval::getId));
		
		for (int i=0;i<n;i++) {
			Interval tmp = new Interval();
			tmp.setLeft(sc.nextInt());
			tmp.setRight(sc.nextInt());
			tmp.setId(i);
			a.add(tmp);
			b.add(tmp);
			c.add(tmp);
			d.add(tmp);
		}
		int pos = 0;
		long ans1 = 0;
		long ans2 = 0;
		if (a.last().getRight()>0) {
			for (int i=0;i<n;i++) {
				if(i%2==0) {
					Interval next = a.last();
					if (next.getLeft() > pos) {
						ans1 += next.getLeft()-pos;
						pos = next.getLeft();
					}
					a.remove(next);
					b.remove(next);
				} else {
					Interval next = b.first();
					if (next.getRight() < pos) {
						ans1 += pos-next.getRight();
						pos = next.getRight();
					}
					a.remove(next);
					b.remove(next);
				}
			}
			ans1 += Math.abs(pos);
		}
		
		pos = 0;
		
		if (d.first().getLeft()<0) {
			for (int i=0;i<n;i++) {
				if(i%2==1) {
					Interval next = c.last();
					if (next.getLeft() > pos) {
						ans2 += next.getLeft()-pos;
						pos = next.getLeft();
					}
					c.remove(next);
					d.remove(next);
				} else {
					Interval next = d.first();
					if (next.getRight() < pos) {
						ans2 += pos-next.getRight();
						pos = next.getRight();
					}
					c.remove(next);
					d.remove(next);
				}
			}
			ans2 += Math.abs(pos);
		}
		
		
		System.out.println(Math.max(ans1, ans2));

	}

}

class Interval {
	int left;
	int right;
	int id;

	
	public int getLeft() {
		return left;
	}
	public void setLeft(int left) {
		this.left = left;
	}
	public int getRight() {
		return right;
	}
	public void setRight(int right) {
		this.right = right;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}

}


Measured memory_bytes: 185504
N, K = list(map(int,input().split()))
S = str(input())
num_L = 0
num_R = 0
tmp = ""
count = 0
for i in range(len(S)):
    if S[i] == "L":
        if tmp == "L":
            count += 1
        else:
            num_L += 1
    else:
        if tmp == "R":
            count += 1
        else:
            num_R += 1
    tmp = S[i]
if K >= min(num_L, num_R):
    ans = N - 1
else:
    ans = count + 2*K
print(ans)

Measured memory_bytes: 3316
#include <iostream>

using namespace std;
int n,v[100001],i,cm,x;
int main()
{
    cin >> n;
    for(i = 1; i <= n; ++i)
        cin >> v[i];
    cm = v[1];
    for(i = 2; i <= n; ++i)
    {
        while(v[i])
        {
            x = cm % v [i];
            cm = v[i];
            v[i] = x;
        }
    }
    cout<<cm;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define sz(x) ((ll)(x).size())
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

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

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

struct mint {
  ll x;
  mint(ll x = 0) : x((x % MOD + MOD) % MOD) {
  }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD)
      x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD - a.x) >= MOD)
      x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  /* 変数名.pow(n) */
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // 以降はMODが素数のみ
  mint inv() const {
    return pow(MOD - 2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  rep(i, N) {
    cin >> A[i];
  }

  mint ans = 0;
  mint pow2 = 1;
  rep(b, 62) {
    ll cnt_0 = 0, cnt_1 = 0;
    rep(i, N) {
      if (A[i] % 2)
        cnt_1++;
      else
        cnt_0++;
    }

    mint temp = cnt_0 * cnt_1;
    ans += pow2 * temp;

    rep(i, N) {
      A[i] /= 2;
    }
    pow2 *= 2;
  }
  cout << ans.x << endl;
}

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

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

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


int main(){
  int n, t;
  scanf("%d %d", &n, &t);

  int ans = 1200;
  int c, t0;
  REP (i, n) {
    scanf("%d %d", &c, &t0);
    if (t0 <= t && ans > c) {
      ans = c;
    }
  }

  if (ans == 1200) printf("TLE\n");
  else printf("%d\n", ans);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> a(n);
  for(Int i=0;i<n;i++) cin>>a[i];
  sort(a.rbegin(),a.rend());
  Int p=0;
  while(p+1<n && a[p+1]>p+1) p++;
  Int x=(a[p]-p)&1;
  Int y=p;
  while(y<n && a[y]>p) y++;
  Int z=(y-p)&1;
  //cout<<(a[p]-p)<<" "<<(y-p)<<endl;
  if(!x || !z) cout<<"First"<<endl;
  else cout<<"Second"<<endl;
  return 0;
}


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

int main(){
  long long n,m,d;
  cin>>n>>m>>d;
  double ans=2.0*(n-d)/(n*n)*(m-1);
  if(d==0)ans=1.0*(n)/(n*n)*(m-1);
  printf("%.10f\n",ans);
  return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const long long INF = 1e18;
# define len(x) ((int)(x).size())
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define foreps(i, m, n) for(int i = m;i < n;i++)
# define ALL(x) (x).begin(), (x).end()
# define rall(x) (x).rbegin(), (x).rend()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    ll H, W; cin >> H >> W;
    vector<string> A(H);
    rep(i, H) cin >> A[i];

    vector<bool> row(H, false), col(W, false);
    rep(i, H) {
        rep(j, W) {
            if (A.at(i).at(j) == '#') {
                row[i] = true; col[j] = true;
            }
        }
    }

    rep(i, H) {
        if (row[i]) {
            rep(j, W) {
                if(col[j]) {
                    cout << A[i][j];
                }
            }
            cout << endl;
        }
    }
}

Measured memory_bytes: 3624
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
string s;
cin>>s;
int price=700;
for(int i=0;i<3;i++){
		if(s[i]=='o'){
		price +=100;
		}
	}
	cout<< price <<endl;
}


Measured memory_bytes: 256
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(dead_code)]

use itertools::Itertools;
use proconio::input;
use proconio::marker::{Chars, Usize1};

#[allow(unused_macros)]
#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

macro_rules! echo {
    ($($a:expr),*) => {
          $(println!("{}",$a))*
      }
}

use std::cmp::*;
use std::collections::*;
use std::ops::{Add, Div, Mul, Sub};

#[allow(dead_code)]
static INF_I64: i64 = 92233720368547758;
#[allow(dead_code)]
static INF_I32: i32 = 21474836;
#[allow(dead_code)]
static INF_USIZE: usize = 18446744073709551;
#[allow(dead_code)]
static M_O_D: usize = 1000000007;
#[allow(dead_code)]
static PAI: f64 = 3.1415926535897932;

trait IteratorExt: Iterator {
    fn toVec(self) -> Vec<Self::Item>;
}

impl<T: Iterator> IteratorExt for T {
    fn toVec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

trait CharExt {
    fn toNum(&self) -> usize;
    fn toAlphabetIndex(&self) -> usize;
    fn toNumIndex(&self) -> usize;
}
impl CharExt for char {
    fn toNum(&self) -> usize {
        return *self as usize;
    }
    fn toAlphabetIndex(&self) -> usize {
        return self.toNum() - 'a' as usize;
    }
    fn toNumIndex(&self) -> usize {
        return self.toNum() - '0' as usize;
    }
}

trait VectorExt {
    fn joinToString(&self, s: &str) -> String;
}
impl<T: ToString> VectorExt for Vec<T> {
    fn joinToString(&self, s: &str) -> String {
        return self
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(s);
    }
}

trait StringExt {
    fn get_reverse(&self) -> String;
}
impl StringExt for String {
    fn get_reverse(&self) -> String {
        self.chars().rev().collect::<String>()
    }
}

trait UsizeExt {
    fn pow(&self, n: usize) -> usize;
}
impl UsizeExt for usize {
    fn pow(&self, n: usize) -> usize {
        return ((*self as u64).pow(n as u32)) as usize;
    }
}

fn main() {
    input! {
       s: Chars,
       t:Chars,
    }

    let mut b = true;
    for i in 0..s.len() {
        if s[i] != t[i] {
            b = false;
            break;
        }
    }

    echo!(if b { "Yes" } else { "No" });
}


Measured memory_bytes: 2176
#include <stdio.h>

long long calc(long long x,long long y){
	if(y == 0){
		return x;
	}else{
		return calc(y,x%y);
	}
}

int main(){
	int n;
	long long tmp,number,r_1,r_2;

	scanf("%d",&n);

	for(int i=0; i < n; i++){
		scanf("%lld",&tmp);
		if(i == 0){
			number = tmp;
		}else{
			if(number >= tmp){
				r_1 = calc(number,tmp);
				number = (number*tmp)/r_1;
			}else{
				r_1 = calc(tmp,number);
				number = (number*tmp)/r_1;
			}
		}
	}

	printf("%lld\n",number);
}

Measured memory_bytes: 2720
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) (v).begin(),(v).end()
#define chmin(x,y) x = min(x,y)
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

int main() {
	int M;
    ll K;
	cin >> M >> K;

    ll x = 1;
    rep(i, M) x *= 2;   // 2**M
    if (!K) {   // K==0 -> 0 0 1 1 ... x-1 x-1
        rep(i, x) cout << i << ' ' << i << ' ';
        cout << endl;
        return 0;
    }
    if (K >= x) {   // K > x-1 -> -1
        cout << -1 << endl;
        return 0;
    }
    ll y = 0;
    rep(i, x) if(i != K) y ^= i;    // y(K以外の0...x-1をXOR)がKでなければ-1
    if (y != K) {
        cout << -1 << endl;
        return 0;
    }

    rep(i, x) if(i!=K) cout << i << ' ';
    cout << K << ' ';
    for (int i = x-1; i >= 0; i--) if(i!=K) cout << i << ' ';
    cout << K << ' ' << endl;
	return 0;
}


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

using namespace std;
using ll = long long;

//container util
#define SORT(c) sort((c).begin(),(c).end())
#define all(a) (a).begin(), (a).end()

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

//print
#define pv(val) cerr << #val << '=' << (val) << endl

const int INF = 1e9;

int main(void){

	int X, N; cin >> X >> N;
	map<int, int> mp;


	REP(i,N){
		int p; cin >> p;
		mp[p]++;
	}

	int ans = 0;
	int diff = INF;
	FOR(i,-101,102){
		if(mp[i] == 0){
			int now = abs(i-X);
			if(now < diff){
				ans = i;
				diff = now;
			}
		}
	}

	cout << ans << endl;



	return 0;

}


Measured memory_bytes: 3628
n = int(input())
h = list(map(int, input().split()))
dp = [10 ** 9 + 7 for i in range(100010)]
dp[0] = 0
for i in range(1,n):
  dp[i] = min(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
  if i > 1:
    dp[i] = min(dp[i], dp[i-2] + abs(h[i] - h[i-2]))
print(dp[n-1])


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

int main(){
int a,b,c;
cin>>a>>b>>c;
if(a!=b && a!=c && b!=c){
	cout<<"No";
}
  else if(a==b && a==c && b==c)
  {
    cout<<"No";
  }
  else
    cout<<"Yes";
    return 0;
}


Measured memory_bytes: 256
import numpy as np
from itertools import combinations
 
z = []
N = int(input())
for i in range(N):
    temp_x, temp_y = map(int, input().split())
    z = z + [temp_x] + [temp_y]
z = np.array(z).reshape(N,2)
 
d = 0
count = 0
for j, k in combinations(range(N),2):
    temp_d = np.sqrt((z[j,0] - z[k,0])**2 + (z[j,1] - z[k,1])**2)
    d += temp_d
    count += 1
print(d*(N-1)/count)

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

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

    auto result = 1;
    int previous; cin >> previous;
    auto existing_order = 0;
    for (auto i = 1; i < n; i++)
    {
        int x; cin >> x;
        if (x == previous) continue;

        const auto order = x > previous ? 1 : -1;
        if (existing_order == 0) existing_order = order;
        else if (existing_order != order)
        {
            result++;
            existing_order = 0;
        }

        previous = x;
    }
    cout << result << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(10);
    
    int T;
    // cin >> T;
    T = 1;
    
    while (T--) {
        solve();
    }
}

// youtube editorial
ll dp[55][55][55 * 55 + 1000]; // 保留の個数
void solve() {
    int n, K;
    cin >> n >> K;
    dp[0][0][0] = 1;
    rep(i, n) {
        rep(j, i + 1) rep(k, n * n + 1) {
            // .  . 両方保留
            add(dp[i + 1][j + 1][k + 2 * (j + 1)], dp[i][j][k]);
            // .--. 横でつなぐ
            add(dp[i + 1][j][k + 2 * j], dp[i][j][k]);
            
            if (j - 1 < 0) continue;
            // ./ . or . \.
            add(dp[i + 1][j][k + 2 * j], dp[i][j][k] * 2 * j % mod);
            // ./\.
            add(dp[i + 1][j - 1][k + 2 * (j - 1)], dp[i][j][k] * j * j % mod);
        }
    }
    cout << dp[n][0][K] << endl;
}



Measured memory_bytes: 88320
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = long long;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e2 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr << #x << ":" << (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

int dp[MAX_N][3 * MAX_N];

signed main() {
  INIT;
	VAR(int, n, W);
	vector< int > w(n), v(n), diff(n);
	REP(i, n) {
		cin >> w[i] >> v[i];
		diff[i] = w[i] - w[0];
	}

	int sm = 0;
	REP(i, n) {
		RREP(j, i + 1) {
			RREP(k, sm + 1) {
				dp[j + 1][k + diff[i]] = max(dp[j + 1][k + diff[i]],
																		 dp[j][k] + v[i]);
			}
		}
		sm += diff[i];
	}

	int ans = 0;
	REP(i, n + 1) {
		REP(j, MAX_N) {
			if (w[0] * i + j > W) continue;
			ans = max(ans, dp[i][j]);
		}
	}
	OUT(ans)BR;
  
  return 0;
}


Measured memory_bytes: 512
import java.util.*;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String str = sc.next();

        if (str.equals("A")) {
            System.out.println("T");
        }
        if (str.equals("C")) {
            System.out.println("G");
        }
        if (str.equals("G")) {
            System.out.println("C");
        }
        if (str.equals("T")) {
            System.out.println("A");
        }
    }

}

Measured memory_bytes: 24148
n = int(input())
cards = [[s+' '+str(n) for n in range(1, 14)] for s in ['S', 'H', 'C', 'D']]
for _ in range(n):
    suit, num = input().split()
    if suit == 'S':
        cards[0][int(num)-1] = 0
    elif suit == 'H':
        cards[1][int(num)-1] = 0
    elif suit == 'C':
        cards[2][int(num)-1] = 0
    elif suit == 'D':
        cards[3][int(num)-1] = 0
for s in cards:
    for n in s:
        if n != 0:
            print(n)


Measured memory_bytes: 5600
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
string i_t_s(int x){
	string t="";
	while(x){
		t+=x%10+'0';
		x/=10;
	}
	reverse(all(t));
	re t;
}
int s_t_i(string t){
	int x=0;
	rep(i,sz(t)){
		x=x*10+(t[i]-'0');
	}
	re x;
}
string s;
int main(){
	ios::sync_with_stdio(0);
	cin>>s;
	ll sum=0;
	rep(i,sz(s)){
		sum+=(s[i]-'0');
		sum%=9;
	}
	if(sum==0)
	cout<<"Yes";
	else
	cout<<"No";
	re 0;
}

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

int dp[100001];
int solve(int height[],int i,int n,int k)
{
    if(dp[i]!=-1)
    {
        return dp[i];
    }
    if(i==n-1)
    {
        return dp[i]= 0; 
    }
    
    // Modification
 int arr[k];
    for(int p=1;p<=k;p++)
    {
        if(i+p>n-1)
        {
           arr[p-1]=INT_MAX; 
        }
        else
        {
          arr[p-1]=  abs(height[i+p]-height[i])+solve(height,i+p,n,k);
        }
    }
    
    return dp[i]=*min_element(arr,arr+k);
    // if(i+2>n-1)
    // {
    //      return dp[i]= abs(height[i+1]-height[i])+solve(height,i+1,n);
    // }
    
    // return dp[i]= min((abs(height[i+1]-height[i])+solve(height,i+1,n)),(abs(height[i]-height[i+2])+solve(height,i+2,n)));
}
int main() {
    
    // For fast i/o
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    
    int tc,n,i,k,q,m;
    
cin>>n>>k;

int height[n];
memset(dp,-1,sizeof(dp));

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


cout<<solve(height,0,n,k)<<endl;
	
	
	return 0;
}


Measured memory_bytes: 55680
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T>using vv = vector<vector<T>>;
template<class T>vv<T> vvec(size_t n, size_t m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 28, MOD = 1e9 + 7; constexpr ll LINF = 1ll << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

int H, W;
vv<int> A;
vector<pair<int, int>> from, to;

int main() {
    cin >> H >> W;
    A = vvec(H, W, 0);
    rep(i, H) rep(j, W) cin >> A[i][j];

    rep(i, H) {
        rep(j, W - 1) {
            if (A[i][j] % 2) {
                A[i][j]--;
                A[i][j + 1]++;
                from.emplace_back(i + 1, j + 1);
                to.emplace_back(i + 1, j + 2);
            }
        }
    }
    rep(i, H - 1) {
        if (A[i][W - 1] % 2) {
            A[i][W - 1]--;
            A[i + 1][W - 1]++;
            from.emplace_back(i + 1, W);
            to.emplace_back(i + 2, W);
        }
    }

    write(from.size());
    rep(i, from.size()) {
        cout << from[i].first << " " << from[i].second << " " << to[i].first << " " << to[i].second << "\n";
    }
}

Measured memory_bytes: 5356
'use strict';
(function(stdin) {
  var line = stdin.split('\n');
  var param = line[0].split(' ').map(Number);
  var result = (function(data) {
    return data.sort(function(a,b){
        return a - b;
    })
    .join(' ');
  }(
    line[0].split(' ').map(Number)
  ));
  console.log(result);
}(require('fs').readFileSync('/dev/stdin', 'utf8')));

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

main() {
  int N, M;
  cin >> N >> M;
  if (N >= M) {
    cout << 0 << endl;
    exit(0);
  }
  vector<int> X(M);
  for (auto& x : X) {
    cin>>x;
  }
  sort(X.begin(), X.end());
  vector<int> dist;
  for (int i = 1; i < M; ++i) {
    dist.push_back(X[i] - X[i - 1]);
  }
  sort(dist.begin(), dist.end());
  vector<int> sum = dist;
  for (int i = 1; i < sum.size(); ++i) {
    sum[i] += sum[i - 1];
  }
  cout << sum[sum.size() - N] << endl;
}

Measured memory_bytes: 1528
#include<bits/stdc++.h>
using namespace std;
int m,d,ans;
int main(){
	scanf("%d%d",&m,&d);
	for(int i=1;i<=m;i++)
	for(int j=1;j<=d;j++)
	if(i==(j%10)*(j/10)&&(j%10)>1&&(j/10)>1)ans++;
	printf("%d",ans);
}

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

const int MAXN = 10e5+5;

int n;
int arr[MAXN][3];
long long dp[MAXN][3];

long long max(long long a, long long b) { return a > b ? a : b; }

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 3; j++) {
            cin >> arr[i][j];
        }
    }
    for (int i = 0; i < 3; i++) dp[0][i] = arr[0][i];
    for (int i = 1; i < n; i++) {
        for (int j = 0; j < 3; j++) {
            if (j == 0) dp[i][j] = max(dp[i-1][j+1]+arr[i][j], dp[i-1][j+2]+arr[i][j]);
            else if (j == 1) dp[i][j] = max(dp[i-1][j-1]+arr[i][j], dp[i-1][j+1]+arr[i][j]);
            else dp[i][j] = max(dp[i-1][j-1]+arr[i][j], dp[i-1][j-2]+arr[i][j]);
        }
    }
    int mx = 0;
    for (int i = 0; i < 3; i++) mx = max(mx, dp[n-1][i]);
    cout << mx << "\n";
    return 0;
}


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

int main() {
  int ans = 0;

  string s;
  while(cin >> s) {
    int len = s.size();
    bool b = true;
    for(int i = 0; i < len/2 && b; i++) {
      if(s[i] != s[len-i-1]) b = false;
    }

    ans += b;
  }
  
  cout << ans << endl;
}

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

using namespace std;



int main(){
	string s;
	cin>>s;
	int n = s.length();
	int ones = 0;
	for(int i=0; i<n; i++){
		if(s[i] == '1'){
			ones++;
		}
	}
	cout<<2*min(ones, n-ones);
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  cout << fixed << setprecision(10);
  ll n, c; cin >> n >> c;
  vll w(n), v(n);
  for(int i=0;i<n;++i) {
    cin >> w[i] >> v[i];
  }
  int vsz = 1000000;
  vvll dp(n+1, vll(vsz+1, INF+1));
  dp[0][0] = 0;
  for(int i=0;i<n;++i) {
    for(int j=0;j<=vsz;++j) {
      if(dp[i][j] != INF) {
        dp[i+1][j] = min(dp[i][j], dp[i+1][j]);
        dp[i+1][j+v[i]] = min(dp[i+1][j+v[i]], dp[i][j] + w[i]);
      }
    }
  }
  for(ll i=vsz;i>=0;--i) {
    if(dp[n][i] <= c) {
      cout << i << endl;
      break;
    }
  }
}


Measured memory_bytes: 797440
n, k = map(int, input().split())
p = list(map(int, input().split()))
s = 0
rs = sum(p[0:k])
ms = rs
for i in range(1, n - k + 1):
  rs = rs - p[i-1] + p[i+k-1]
  if rs > ms:
    s = i
    ms = rs

ans = 0.0
for pp in p[s:s+k]:
  ans += (1+pp)/2
print(ans)

#for i in range(len(p)-k+1):
#  s = sum(p[i:i+k])
#  if s>m: m=s  

#c = [sum(p[i:i+k]) for i in range(len(p)-k+1)]
#print(c)
#pn = np.array(p)
#v = np.array([1]*k)
#c = np.convolve(pn, v, mode='same')
#print((max(c)+k)/2)

Measured memory_bytes: 25060
#define _USE_NATH_DEFINES
#include <iostream>
#include<sstream>
#include<algorithm>
using namespace std;

int main() {
	string s;
	cin >> s;
	if (s[0] != s[1] && s[1] != s[2] && s[0] != s[2]) cout << "Yes" << endl;

	else cout << "No" << endl;
}

Measured memory_bytes: 256
/**
 * auther: moririn_cocoa
 */

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define fi first
#define se second

int main (void) {
  
  string S;
  
  cin >> S;
  
  if ( S == "ABC" ) {
    
    cout << "ARC" << endl;
  }
  
  else if ( S == "ARC" ) {
    
    cout << "ABC" << endl;
  }
  
  return 0;
}




Measured memory_bytes: 3604
#pragma GCC optimize("Ofast,fast-math,unroll-loops")
 
#include <bits/stdc++.h>
 
#define int ll
//#define double long double
#define endl '\n'
#define all(C) (C).begin(), (C).end()
#define rall(C) (C).rbegin(), (C).rend()
#define mp make_pair 
#define pb emplace_back
#define dbg(x) cerr << #x << " : " << x << endl
#define PI 3.1415926535
 
using namespace std;
        
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair <int, int>;
using pld = pair <ld, ld>;

/*
const ll MAX_MEM = 3e6;
char MEM[MAX_MEM];
ll MEM_POS = 0;
void* operator new(size_t x)
{
    auto ret = MEM + MEM_POS;
    MEM_POS += x;
    assert(MEM_POS < MAX_MEM);
    return ret;
}
void operator delete(void*)
{}
*/
        
template <class T>
istream& operator>> (istream &in, vector <T> &a)
{
    for (auto &i : a)
        in >> i;
    return in;
}
        
template <class T> 
ostream& operator<< (ostream &out, vector <T> a)
{
    for (auto &i : a)
        out << i << ' ';
    return out;
}
        
template <class T, class U>
istream& operator>> (istream &in, pair <T, U> &p)
{
    in >> p.first >> p.second;
    return in;
}
        
template <class T, class U>
ostream& operator<< (ostream &out, pair <T, U> p)
{
    out << p.first << " " << p.second << " ";
    return out;
}
        
inline void Start()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    //freopen("lol.in", "r", stdin);
    //freopen("lol.out", "w", stdout);
}

signed main()
{
    Start();
    int a, b, c;
    cin >> a >> b >> c;
    swap(a, b);
    swap(a, c);
    cout << a << " " << b << " " << c;
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
/*
CE
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>

*/
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define mem(a,b) memset(a,b,sizeof (a))
#define ios std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
// ios  can not be used with scanf,printf.  IF  ios MUST cin,cout.
typedef long long ll;
typedef vector<int> VI;
typedef pair<int,int> PII;
const ll mod=998244353;
const int INF=0x3f3f3f3f;
ll ksm(ll a,ll b){ll res=1;a%=mod;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

const int N=2e5+10;
int n,k;
ll sum[N],dp[N];
int L[N],R[N];
ll get(int l,int r){
    if(l<=1)l=1;
    if(l>r)return 0;
    return ((sum[r]-sum[l-1])%mod+mod)%mod;
}
int main(){
    scanf("%d%d",&n,&k);
    rep(i,1,k){
        scanf("%d%d",&L[i],&R[i]);
    }
    dp[1]=sum[1]=1;
    rep(i,1,n){
        rep(j,1,k){
            dp[i]=(dp[i]+get(i-R[j],i-L[j]))%mod;
        }
        sum[i]=sum[i-1]+dp[i];
    }
    printf("%lld\n",dp[n]);
    return 0;
}


Measured memory_bytes: 6920
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;


namespace Test1 {

    


    class ClassMain {

       
        public static void Main(String[] args) {
            string line;
            while ((line = Console.ReadLine()) != null) {
                int sum = int.Parse(line);
                for (int i = 0; i < 3; i++) {
                    sum += int.Parse(Console.ReadLine());
                }
                Console.WriteLine(sum / 60);
                Console.WriteLine(sum % 60);

                //break;
            }
        }

        
    }



    
}

Measured memory_bytes: 5604
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		if(a<b) {
			System.out.println("a < b");
		}else if(a>b) {
			System.out.println("a > b");
		}else {
			System.out.println("a == b");
		}

	}

}



Measured memory_bytes: 26040
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
using namespace std;
const int Maxn = 200010;
const int Mod = 1e9+7;
int X[Maxn], Y[Maxn];
struct lnode
{
	int x, y;
} list[Maxn];
int ll;
int b[Maxn], bl, c[Maxn], cl, p1[Maxn], p2[Maxn], f[Maxn];
int n, m;
vector <int> vec[Maxn];
int s[Maxn];
int lowbit(int x)
{
	return x & (-x);
}
void add(int x, int k)
{
	while(x <= cl)
	{
		s[x] = (s[x]+k)%Mod;
		x += lowbit(x);
	}
}
int qry(int x)
{
	int ret = 0;
	while(x > 0)
	{
		ret = (ret+s[x])%Mod;
		x -= lowbit(x);
	}
	return ret;
}
int main()
{
	int i, j, k;
	scanf("%d%d", &n, &m);
	for(i = 1; i <= n; i++) scanf("%d", &X[i]);
	for(i = 1; i <= m; i++) scanf("%d", &Y[i]);
	int p = 0;
	for(i = 1; i <= n; i++)
	{
		for(int i=1;i<=10;i++) int t;
		while(p+1 <= m && X[i] > Y[p+1]) p++;
		if(p != 0 && p != m)
		{
			ll++;
			list[ll].x = X[i]-Y[p];
			list[ll].y = Y[p+1]-X[i];
			b[++bl] = list[ll].x;
			c[++cl] = list[ll].y;
		}
	}
	sort(b+1, b+bl+1);
	bl = unique(b+1, b+bl+1) - (b+1);
	sort(c+1, c+cl+1);
	cl = unique(c+1, c+cl+1) - (c+1);
	for(i = 1; i <= ll; i++) vec[lower_bound(b+1, b+bl+1, list[i].x) - b].push_back(lower_bound(c+1, c+cl+1, list[i].y) - c);
	int ans = 1;
	for(i = 1; i <= bl; i++)
	{
		for(j = 0; j < vec[i].size(); j++)
		{
			if(p1[vec[i][j]] != i)
			{
				p1[vec[i][j]] = i;
				f[vec[i][j]] = qry(vec[i][j]-1)+1;
				ans = (ans+f[vec[i][j]])%Mod;
			}
		}
		for(j = 0; j < vec[i].size(); j++)
		{
			if(p2[vec[i][j]] != i)
			{
				p2[vec[i][j]] = i;
				add(vec[i][j], f[vec[i][j]]);
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}

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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define fi first
#define se second
#define setpre(x) cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ cout << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , ";
    logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 100005;

/* ...o(^-^)o... */

int main(){
    int n; cin >> n; lint t; cin >> t;
    vector<lint> a(n), m(n);
    rep(i, n) cin >> a[i];

    repr(i, n){
        if(i == n-1) m[i] = a[i];
        else m[i] = max(m[i+1], a[i]);
    }

    lint M = 0;
    rep(i, n){
        m[i] -= a[i];
        M = max(M, m[i]);
    }
    int ans = 0;
    rep(i, n){
        if(m[i] == M) ans++;
    }
    out(ans);
}


Measured memory_bytes: 1792