akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define MAX(X,Y) (*max_element(X,Y))
#define MIN(X,Y) (*min_element(X,Y))
#define NP(X,Y) next_permutation(X,Y)

struct UnionFind {
	vector<int> data;
 	UnionFind(int size):data(size, -1) {}
	bool unite(int x,int y){
		x=root(x);
		y=root(y);
 	   if(x!=y){
			if (data[y]<data[x]){
				swap(x, y);
			}
			data[x]+=data[y];
			data[y]=x;
		}
		return x!=y;
	}
	bool same(int x, int y){
		return root(x)==root(y);
	}
	int root(int x){
		return data[x]<0? x:data[x]=root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int N,K,L;
P A[200010];
map<P,int> H;

signed main(){
	cin>>N>>K>>L;
	UnionFind UF(N+10),UF2(N+10);
	REP(i,K){
		int a,b;
		cin>>a>>b;
		UF.unite(a-1,b-1);
	}
	REP(i,L){
		int a,b;
		cin>>a>>b;
		UF2.unite(a-1,b-1);
	}
	REP(i,N){
		A[i]=make_pair(UF.root(i),UF2.root(i));
		if(H.find(A[i])!=H.end())H[A[i]]++;
		else H[A[i]]=1;
		DEB(UF.root(i))DEB(UF2.root(i))END
	}
	REP(i,N){
		cout<<H[A[i]];
		if(i<N-1){
			cout<<" ";
		}
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 18048
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            while ((line = br.readLine()) != null) {
                String[] tokens = line.split(" ");
                int a = Integer.parseInt(tokens[0]);
                int b = Integer.parseInt(tokens[1]);
                int k = Integer.parseInt(tokens[2]);
                int i = 0;
                List<Integer> result = new ArrayList<>();
                while (i <= a && i <= b) {
                    i++;
                    if (a%i == 0 && b%i == 0) {
                        result.add(i);
                    }
                }
                System.out.println(result.get(result.size()-k));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}


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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define all(x) (x).begin(),(x).end()
//#define int long long
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF =0;

int ai[100050];
signed main(){
	string s;
	cin >> s;
	int n = s.size();
	int a=0,b=0;
	int cnta=0,cntb=0;
	int cnt = 0;
	int flg = 0,pnt;
	rep(i,n){
		if(flg==0){
			if(s[i] == 'R'){
				if(cnt % 2 == 0){
					a++;
				}
				else{
					b++;
				}
			}
			if(i != n-1 && s[i+1] == 'L'){
				flg = 1;
				pnt = i+1;
					ai[i] += a;
					ai[i+1] += b;
					a=0;
					b=0;
				cnt = 0;
			}
			if(flg == 0)++cnt;
		}
		else{
			if(s[i] == 'L'){
				if(cnt % 2 == 0){
					a++;
				}
				else{
					b++;
				}
			}
			if(i != n-1 && s[i+1] == 'R'){
				flg = 0;
					ai[pnt] += a;
					ai[pnt-1] += b;
					a=0;
					b=0;
				cnt=0;
			}
			if(flg == 1)++cnt;
		}
	}
	ai[pnt] += a;
	ai[pnt-1] += b;	
	rep(i,n){
		if(i==0) cout << ai[i];
		else cout << ' ' << ai[i];
	}
	cout << '\n';

	return 0;
}



Measured memory_bytes: 1024
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);
	static int N = sc.nextInt();
	static int M = sc.nextInt();
	static int X[] = new int[M];
	static int ans = 0;

	public static void main(String[] args) {
		if(N >= M) {
			System.out.println(ans);
			return;
		}

		for(int i = 0; i < M; i++) {
			X[i] = sc.nextInt();
		}
		Arrays.sort(X);
		ans = X[M - 1] - X[0];
		int dif[] = new int[M - 1];
		for(int i = 0; i < M - 1; i++) {
			dif[i] = X[i + 1] - X[i];
		}
		Arrays.sort(dif);
		for(int i = 0; i < N - 1; i++) {
			ans -= dif[M - 2 - i];
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 48972
/**************************************************************************
Coded by: Saba Karimi(_VINTAGE)
Institution: AIT PUNE
***************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back 
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define ld long double
#define int long long int 
#define F first 
#define S second
/**************************************************************************/
const int N = 1e5+5;
int mod = 1e9+7;
int mul(int a,int b)
{
    return ((a%mod)*(b%mod))%mod;
}
int add(int a,int b)
{
    return ((a%mod)+(b%mod))%mod;
}
int sub(int a,int b)
{
    return ((a%mod)-(b%mod)+mod)%mod;
}
int power(int a,int b)
{
    int res = 1;
    while(b>0)
    {
        if(b&1)
            res = mul(res,a);
        b = b/2;
        a = mul(a,a);
    }
    return res;
}
signed  main()
{
    fast;
    int n;
    cin>>n;
    int b[n+1];
    for(int i=1;i<=n;i++)
    {
        cin>>b[i];
    }
    int dp[n+1]={};
    dp[1] = b[1];
    for(int i=2;i<=n-1;i++)
    {
        if(b[i]>=b[i-1])
        {
            dp[i] = b[i-1];
        }
        else
        {
            dp[i] = b[i];
        }
    }
    dp[n] = b[n-1];
    int sum = 0;
    for(int i=1;i<=n;i++)
        sum+=dp[i];
    cout<<sum;
}   

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, l, r) for (int i = l; i <= (int)(r); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define all(v) v.begin(), v.end()
#define MOD (int) (1e9+7)
#define INF (int) 1e9
#define LLINF (ll) 1e18
#define MAX_N 1000005

int n;
vector<int> ida;
bool a[MAX_N];

int prime[MAX_N];
bool is_prime[MAX_N+1];

int sieve(int n){
    int p=0;
    for(int i=0;i<=n;i++){
        is_prime[i] = true;
    }
    is_prime[0] = false;
    is_prime[1] = false;
    for(int i=2;i<=n;i++){
        if(!a[i]) continue;
        if(is_prime[i]){
            prime[p++] = i;
            for(int j=2*i; j <= n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(){
    int nn;
    cin >> nn; 
    map<int, int> m;
    int aa[nn];
    rep(i, nn){
        cin >> aa[i];
        m[aa[i]]++;
    }

    for (auto mi : m){
        ida.emplace_back(mi.first);
    }

    rep(i, ida.size()){
        a[ida[i]]=true;
    }
    
    sieve(MAX_N);
    
    int ans = 0;
    if(m[1]==0){
        
        rep(i, nn){
            if(is_prime[aa[i]]){
                if(m[aa[i]]==1){
                    // printf("add: %d\n", aa[i]);
                    ans++;
                }
            }
        }
    }else{
        if(m[1]==1) ans = 1;
        else ans = 0;
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 16136
#include <bits/stdc++.h>
#define INF 2000000000000000000
#define ll long long
#define pb push_back
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N;
  cin >> N;
  vector<ll> X(N);
  for (ll i = 0; i < N; ++i) {
    cin >> X.at(i);
  }
  ll ans = INF;
  for (ll i = 0; i <= 100; ++i) {
    ll temp = 0;
    for (ll j = 0; j < N; ++j) {
      temp += pow(X.at(j) - i, 2);
    }
    ans = min(ans, temp);
  }
  cout << ans << "\n";
}


Measured memory_bytes: 3616
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>
#include<set>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define LOWER(a,x) lower_bound(ALL(a), x) - a.begin() - 1;
#define COUNT(a,x)  upper_bound(ALL(a), x) - lower_bound(ALL(a), x);
#define MCOUNT(a,x,y) upper_bound(ALL(a), y) - lower_bound(ALL(a), x);
#define SCAN(x) scanf("%lld",&x);
#define INF 5555555555555555555
#define MOD 1000000007
#define pb push_back
#define F first
#define S second
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef map<ll, ll> MAP;
typedef set<ll> SET;
ll n = 0, m = 0, ans = 0, sum = 0, cnt = 0, tmp = 0, ma = 0, mi = 0;
string s;
bool flag, ok;
ll dx[4] = { 1,-1,0,0 }, dy[4] = { 0,0,1,-1 };
ll ddx[9] = { 1,-1,0,0,1,1,-1,-1,0 }, ddy[9] = { 0,0,1,-1,1,-1,1,-1,0 };
#pragma endregion
#define MAX 111111



int main(void) {
  vll a;
  MAP mp;
  cin >> n;
  FOR(i, 0, n) {
	cin >> tmp;
	a.pb(tmp);
	mp[tmp]++;
  }
  sort(RALL(a));
  a.erase(unique(ALL(a)), a.end());
  ans = 1;
  FOR(i, 0, a.size()) {
	if (mp[a[i]] > 3) {
	  ans *= a[i];
	  cnt++;
	  if (cnt == 2) break;
	  ans *= a[i];
	  cnt++;
	}
	else if (mp[a[i]] > 1) {
	  ans *= a[i];
	  cnt++;
	}
	if (cnt == 2) break;
  }

  if (cnt < 2) ans = 0;
  cout << ans << endl;


  return 0;
}

Measured memory_bytes: 7284
#include <iostream>
#include <cstdio>

using namespace std;

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

Measured memory_bytes: 256
fun main(args :Array<String>) {
    val s = readLine()!!
    val rs = s.reversed()
    val last = (s.length - 1) / 2
    var ans = 0
    for (i in 0..last) {
        if (s[i] != rs[i]) {
            ans++
        }
    }
    println(ans)
}

fun readInteger() = readLine()!!.toInt()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)


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

int main()
{
	int n;
	string s;
	cin >> n >> s;
	int rw = 0, rb = 0, lw = 0, lb = 0;
	for (int i = 0; i < n; i++)
	{
		if (s.at(i) == '.')
			rw++;
		else
			rb++;
	}
	int ans = n;
	for (int i = 0; i <= n; i++)
	{
		int temp;
		temp = rw + lb;
		if (i < n)
		{
			if (s.at(i) == '.')
			{
				rw--;
				lw++;
			}
			else
			{
				rb--;
				lb++;
			}
		}
		if (temp < ans)
			ans = temp;
	}
	cout << ans << endl;
}

Measured memory_bytes: 640
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let n = Int(readLine()!)!
    let A = readInts().sorted(by: >)
    
    var alice = 0
    var bob = 0
    for i in 0..<n {
        if i % 2 == 0 {
            alice += A[i]
        } else {
            bob += A[i]
        }
    }
    
    print(alice - bob)
}

main()


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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}  
vector<string>ret;
void dfs(ll d,string s,char mx){
  if(d==0)ret.PB(s);
  else{
    rep(j,'a',mx){
      dfs(d-1,s+char(j),mx);
    }
    dfs(d-1,s+char(mx),mx+1);
  }
}
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n;cin>>n;
  dfs(n,"",'a');
  rep(i,0,ret.size())cout<<ret[i]<<endl;
  return 0;
}

Measured memory_bytes: 7796
require 'prime'
N,m = gets.split.map(&:to_i)
MOD = 1000000007
ds = Hash[m.prime_division.map{ |a,b| [a,b] }]
#p ds
def d(a,b)
  dp = Array.new(b+1, 0)
  dp[0] = 1
  (0...a).each{
    ndp = Array.new(dp.size, 0)
    ndp[0] = 1
    (1...dp.size).each{ |j|
      ndp[j] = (dp[j] + ndp[j-1]) % MOD
    }
    dp = ndp
  }
  dp[-1]
end
ans = 1
ds.each{ |k,d| 
  v = d(N,d)
  ans = (ans * v) % MOD
}
p ans


Measured memory_bytes: 3708
// ------------------
// author: MatsuTaku
// date  : 22/02/2020
// ------------------

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

  int N, K; cin>>N>>K;
  vector<int> A(N); for (auto& a : A) {
    cin>>a;
  }

  ll min_addh = numeric_limits<ll>::max();
  for (unsigned int mask = 0; mask < (1<<N); mask++) {
    int popcnt = 0;
    for (int t = 0; t < N; t++)
      if (mask & (1<<t))
        popcnt++;
    if (popcnt < K)
      continue;

    ll max_height = 0;
    ll cum_height = 0;
    for (int i = 0; i < N; i++) {
      if ((mask & (1<<i))) {
        if (i > 0 and max_height >= A[i]) {
          cum_height += max_height-A[i]+1;
          max_height++;
        } else {
          max_height = A[i];
        }
      } else {
        max_height = max(max_height, (ll)A[i]);
      }
    }
    min_addh = min(min_addh, cum_height);
  }
  cout << min_addh << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FASTIO  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define vi vector<ll>
#define all(a) (a).begin(), (a).end()
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define tr(it, a)   for(auto it=a.begin();it!=a.end();it++)
#define pb push_back
#define endl  "\n"
#define mem(a,b)  memset(a,b,sizeof(a))
const ll MAX=1e5+3;
const ll mod=1e9+7;
int main()
{
   FASTIO
   int t=1;
   //cin>>t;
   while(t--)
  {
      ll a,b;cin>>a>>b;
      ll c=(a*b)/__gcd(a,b);
      cout<<c;
   }
 return 0;
}



Measured memory_bytes: 256
using System;

namespace ConsoleApp1
{
    class ABC117B
    {
        static void Main(string[] args)
        {
            var S = Console.ReadLine().ToCharArray();
            var T = Console.ReadLine().ToCharArray();

            var max = 0;

            for (int i = 0; i < S.Length - T.Length + 1; i++)
            {
                int a = comp(S, T, i);
                if (a > max)
                {
                    max = a;
                }
            }

            Console.WriteLine(T.Length - max);
        }

        static int comp(char[] S, char[] T, int i)
        {
            var c = 0;

            for (int j = 0; j < T.Length; j++)
            {
                if (S[j + i] == T[j])
                {
                    c++;
                }
            }

            return c;
        }
    }
}


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

int64_t A1(int x,int y){
  int64_t n=1;
  for(int i=0; i<x; i++) n*=2;
  for(int i=0; i<y; i++) n*=10;
  return n;
}



int main() {
  int64_t a;
  cin>>a;
  int n=log10(a)+1;
  int64_t total=0;
  int s[n];
  
  for(int i=0; a>0; a/=10){
    s[i]=a%10;
    i++;
  }
  
  for(int i=0; i<n; i++){
    for(int j=0; j<=i; j++){
      if(j==i) total+=s[i]*A1(n-1-j,j);
      else total+=s[i]*A1(n-2-j,j);
    }
  }
  cout << (int64_t)total << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <deque>
#include <string>
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define fors(i, a, b) for(int i = a; i < b; i++)
#define fori(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pair<int, int> > vpi;
typedef vector<pair<string, int> > vpsi;
typedef map<string, int> msi;
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int x = n % 10;
    if(x == 2 || x == 4 || x == 5 || x == 7 || x == 9)
        cout << "hon" << endl;
    else if(x == 0 || x == 1 || x == 6 || x == 8)
        cout << "pon" << endl;
    else
        cout << "bon" << endl;
    return 0;
}


Measured memory_bytes: 3640
n = int(input())
a = [0] * (n+1)

for i in range(1, n+1):
    a[i] = int(input())

s = set()
temp = 1
ans = -1
count = 0
while temp not in s:
    s.add(temp)
    count += 1
    if a[temp] != 2:
        temp = a[temp]
    else:
        ans = count
print(ans)


Measured memory_bytes: 13164
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

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

    int q;
    cin >> q;
    list<int> a;
    auto itr = a.end();
    while (q--) {
        int t;
        cin >> t;
        if (t == 0) {
            int x;
            cin >> x;
            itr = a.insert(itr, x);
        } else if (t == 1) {
            int d;
            cin >> d;
            advance(itr, d);
        } else {
            itr = a.erase(itr);
        }
    }
    for (int x : a) cout << x << endl;
}



Measured memory_bytes: 18656
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a;
    cin>>a;
    if(a==24){
        cout<<"Christmas Eve"<<endl;
    }else if(a==25){
       cout<<"Christmas"<<endl;
    }else if(a==23){
       cout<<"Christmas Eve Eve"<<endl;
   }else if(a==22){
      cout<<"Christmas Eve Eve Eve"<<endl;
   }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
int h,w;
int memo[21][21][21][21];//semiopen
bool mark[20][20];
void init(){
    REP(ys,21) REP(yt,21) REP(xs,21) REP(xt,21){
        if(ys>yt || xs>xt) memo[ys][yt][xs][xt] = 0;
        else memo[ys][yt][xs][xt] = -1;
    }
    memset(mark, 0, sizeof(mark));
}

int grundy(int ys, int yt, int xs, int xt){
    if(memo[ys][yt][xs][xt] != -1){
        return memo[ys][yt][xs][xt];
    }
    vector<int> trans;
    for(int i=ys; i<yt; i++){
        for(int j=xs; j<xt; j++){
            if(mark[i][j]) continue;
            int gn = 0;
            gn ^= grundy(ys, i, xs, j);
            gn ^= grundy(i+1, yt, xs, j);
            gn ^= grundy(ys, i, j+1, xt);
            gn ^= grundy(i+1, yt, j+1, xt);
            trans.push_back(gn);
        }
    }
    sort(trans.begin(), trans.end());
    trans.erase(unique(trans.begin(), trans.end()), trans.end());
    int res = 0;
    for(int i=0; i<(int)trans.size(); i++){
        if(trans[i] != i) break;
        res++;
    }
    memo[ys][yt][xs][xt] = res;
    return res;
}

int main(){
    init();
    cin >> h >> w;
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            char c;
            cin >> c;
            if(c == 'X') mark[i][j] = true;
        }
    }
    if(grundy(0, h, 0, w) != 0){
        cout << "First" << endl;
    }else{
        cout << "Second" << endl;
    }
    return 0;
}



Measured memory_bytes: 3928
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#ifdef _DEBUG_
  #define debug(...) printf(__VA_ARGS__)
#else
  #define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

#define rank jaskdlfjasldfjlkasdjflksa

const int MAXN = 3000 + 100;
int N;
string S;
int a[MAXN], b[MAXN];
string bst[MAXN];
int nxt[MAXN];
int rank[MAXN];

void go(int id) {
  if (id == N)
    return;
  int ch = id;
  for (int i = id + 1; i < N; i++)
    if (rank[i] < rank[ch])
      ch = i;
  cout << bst[ch];
  go(nxt[ch]);
}

int main() {
  cin >> N;
  cin >> S;
  int cnta = 0, cntb = 0;
  for (int i = 0; i < SZ(S); i++) {
    if (S[i] == 'a')
      a[cnta++] = i;
    else if (S[i] == 'b')
      b[cntb++] = i;
    else
      assert(false);
  }
  assert(cnta == N);
  assert(cntb == N);
  for (int i = 0; i < N; i++) {
    int cover;
    if (a[i] < b[i])
      bst[i] = "ab", cover = b[i];
    else {
      cover = a[i];
      VI tmp;
      tmp.PB(a[i]);
      tmp.PB(b[i]);
      for (int j = i + 1; j < N; j++) {
        if (a[j] < b[j])
          continue;
        if (b[j] < cover) {
          cover = a[j];
          tmp.PB(a[j]);
          tmp.PB(b[j]);
        }
        else {
          break;
        }
      }
      sort(ALL(tmp));
      for (int id : tmp)
        bst[i] += S[id];
    }
    int next = i + 1;
    while (next < N && min(a[next], b[next]) < cover)
      next++;
    nxt[i] = next;
    debug("bst[%d] = %s\n", i, bst[i].c_str());
  }
  vector<pair<string, int>> vec;
  for (int i = 0; i < N; i++)
    vec.PB(MP(bst[i], -i));
  sort(ALL(vec));
  reverse(ALL(vec));
  for (int i = 0; i < N; i++)
    rank[-vec[i].S] = i;
  go(0);
  puts("");
  return 0;
}


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

long long gcd(long long a, long long b){
  if(a == 0) return b;
  return gcd(b % a, a);
}

long long lcm(long long a, long long b){
  return (a * b) / gcd(a, b);
}

int main(){
  int a, b;
  cin >> a >> b;
  cout << lcm(a, b) << endl;
}

Measured memory_bytes: 256
a, b, c, x, y = map(int, input().split())

d = abs(x - y)
price = 0
num = 0
if x > y:
    if a <= 2 * c:
        price += d * a
        num = y
    else:
        price += d * 2 * c
        num = y
else:
    if b <= 2 * c:
        price += d * b
        num = x
    else:
        price += d * 2 * c
        num = x



if (a+b) >= 2*c:
    price += 2 * c * num
else:
    price += (a+b) * num

print(price)

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



const int INF = 1e9 + 5;

int main()
{
    int t,k;
    scanf("%d%d", &t, &k);
    vector<int> heights(t);
    for(int& x : heights){
        scanf("%d", &x);
    }

    vector<int> dp(t, INF);
    dp[0] = 0;

    for (int i = 0; i < t; i++){
        for (int j = 1; j <= k; j++){
            if (j + i < t){
                dp[i + j] = min(dp[i + j], dp[i] + abs(heights[i] - heights[i + j]));
            }
        }
    }

    printf("%d\n", dp[t-1]);

    return 0;
}

Measured memory_bytes: 1024
#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10**7)


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h(typ) if m > 1 else typ(input()) for _ in range(n)]


def main():
    A, B, C, D = read_h()

    print(max(min(B, D) - max(A, C), 0))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    string s="No";
    cin >> N;

    for(int i=1; i<10; i++){
	for(int j=1; j<10; j++){
	    if(N == i*j)
		s="Yes";
	}
    }
    cout << s << endl;
}



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

int main(){
	int a,goukei;
	goukei=0;
	for(int i=0;i<5;i++){
		cin>>a;
		if(a<40){
			a=40;}
		goukei=goukei+a;
	}
	cout<<goukei/5<<endl;
    return 0;
}


Measured memory_bytes: 3096
#include <stdio.h>
#include <stdlib.h>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int n,ans=0;
void dfs(ll val,int flag){
    if(val > n) return;
    if(flag == 7) ans++;
    dfs(10*val+3,flag|1);
    dfs(10*val+5,flag|(1<<1));
    dfs(10*val+7,flag|(1<<2));
    return;
}


int main(){
    scanf("%d", &n);
    dfs(0,0);
    printf("%d\n", ans);
}

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n+1),b(n);
  rep(i,n+1) cin >> a[i];
  rep(i,n) cin >> b[i];
  ll cnt=0;
  rep(i,n) {
    cnt += min(a[i],b[i]);
    b[i] = max(b[i]-a[i], 0);
    cnt += min(a[i+1],b[i]);
    a[i+1] = max(a[i+1]-b[i],0);
  }
  cout << cnt << endl;
}

Measured memory_bytes: 1024
#include <cctype>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define pk putchar(' ')
#define ph puts("")
typedef long long ll;
using namespace std;
template <class T>
void rd(T &x)
{
    x = 0;
    int f = 1;
    char c = getchar();
    while (!isdigit(c)) {if (c == '-') f = -1; c = getchar();}
    while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
    x *= f;
}
template <class T>
void pt(T x)
{
    if (x < 0)
        putchar('-'), x = (~x) + 1;
    if (x > 9)
        pt(x / 10);
    putchar(x % 10 ^ 48);
}
int main() 
{
	char s[4];
	scanf("%s", s);
	if (s[1] == 'R')
		printf("ABC\n");
	else
		printf("ARC\n");
    return 0;
}

Measured memory_bytes: 1612
def readinput():
    n=input()
    return n

def main(n):
    sum=0
    j=len(n)-1
    while(j>=0):
        sum+=int(n[j])
        j-=1
    if sum%9==0:
        return 'Yes'
    else:
        return 'No'

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)


Measured memory_bytes: 9196
#C問題
L, R = map(int, input().split())
flg_len = R-L+1
if flg_len >= 2019:
    ans=0
else:
    R_mod = R%2019
    L_mod = L%2019
    if L_mod > R_mod:
        ans = 0
    else:
        ans = 2018
        for j in range(L_mod,R_mod):
            for i in range(j+1,R_mod+1):
                ij_mod =(i*j)%2019
                ans =min(ans,ij_mod)
print(ans)

Measured memory_bytes: 3060
n = int(input())
x = [0 for i in range(n)]
y = [0 for i in range(n)]
for i in range(n):
    x[i],y[i] = map(int,input().split())

a = [x[i]+y[i] for i in range(n)]
b = [x[i]-y[i] for i in range(n)]
ans1 = max(a)-min(a)
ans2 = max(b)-min(b)
print(max(ans1,ans2))

Measured memory_bytes: 100480
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};
constexpr int BASE = 4000;

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    string a[3];
    cin >> a[0] >> a[1] >> a[2];

    int n[3] = {int(a[0].length()), int(a[1].length()), int(a[2].length())};
    bool is_ok = true;

    // a (位置: 2000) に対する b の位置を i にしてよいか
    vector<bool> ab(2*BASE+1, true);
    for(int i=0;i<=2*BASE;++i) {
        is_ok = true;
        for(int j=0;j<n[1]&&is_ok;++j) {
            if(i+j-BASE < 0 || n[0] <= i+j-BASE) continue;
            if(a[0][i+j-BASE] != a[1][j] && a[0][i+j-BASE] != '?' && a[1][j] != '?') is_ok = false;
        }
        ab[i] = is_ok;
    }

    // a (位置: 2000) に対する c の位置を i にしてよいか
    vector<bool> ac(2*BASE+1, true);
    for(int i=0;i<=2*BASE;++i) {
        is_ok = true;
        for(int j=0;j<n[2]&&is_ok;++j) {
            if(i+j-BASE < 0 || n[0] <= i+j-BASE) continue;
            if(a[0][i+j-BASE] != a[2][j] && a[0][i+j-BASE] != '?' && a[2][j] != '?') is_ok = false;
        }
        ac[i] = is_ok;
    }


    //  // b (位置: 2000) に対する c の位置を i にしてよいか
    vector<bool> bc(2*BASE+1, true);
    for(int i=0;i<=2*BASE;++i) {
        is_ok = true;
        for(int j=0;j<n[2]&&is_ok;++j) {
            if(i+j-BASE < 0 || n[1] <= i+j-BASE) continue;
            if(a[1][i+j-BASE] != a[2][j] && a[1][i+j-BASE] != '?' && a[2][j] != '?') is_ok = false;
        }
        bc[i] = is_ok;
    }


    int ans = INF;
    for(int bi=0;bi<=2*BASE;++bi) {
        if(!ab[bi]) continue;
        for(int ci=0;ci<=2*BASE;++ci) {
            if(0 <= BASE+(ci-bi) && BASE+(ci-bi) <= 2*BASE) {
                if(!bc[BASE+(ci-bi)]) continue;
            }
            if(0 <= ci && ci <= 2*BASE) {
                if(!ac[ci]) continue;
            }
            ans = min(ans, max({BASE+n[0], bi+n[1], ci+n[2]}) - min({BASE, bi, ci}));
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
// ~/BAU/ACM-ICPC/Teams/Rampage/Corvus
// ~/sudo apt-get verdict Accpeted

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const int N = 301;
const ll MOD = 1e9+7;
const double eps = 1e-9;

int main() {
	int n,k;
	scanf("%d%d",&n,&k);
	printf("%d\n", (n%k ? 1 : 0));
 	return 0;
} 

Measured memory_bytes: 256
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;

void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int x;
    cin >> x;
    bool a = false;
    for(int i=x;i<100100;i++){
        a=false;
        for(int j=2;j<=sqrt(i);j++){
            if(i%j==0){
                a = true;
                break;
            }
        }
        if(!a){
            cout << i;
            return 0;         
        }
    }

    return 0;
}

Measured memory_bytes: 3668
def GCD(x, y):
    if y == 0:
        return x
    return GCD(y, x % y)


def CountBitFlag(T):
    T = (T & 0x55555555) + ((T >> 1) & 0x55555555)
    T = (T & 0x33333333) + ((T >> 2) & 0x33333333)
    T = (T & 0x0F0F0F0F) + ((T >> 4) & 0x0F0F0F0F)
    T = (T & 0x00FF00FF) + ((T >> 8) & 0x00FF00FF)
    T = (T & 0x0000FFFF) + ((T >> 16) & 0x0000FFFF)
    return T


N, M = map(int, input().split())
A = tuple(map(int, input().split()))
P = tuple(map(int, input().split()))

Prob = [1.0] * (1 << N)
LCM = [1] * (1 << N)
ans = 0

for bit in range(1, 1 << N):
    top = (bit & -bit).bit_length() - 1
    l = bit & (bit - 1)
    Prob[bit] = Prob[l] * P[top] / 100
    LCM[bit] = LCM[l] // GCD(LCM[l], A[top]) * A[top]
    if CountBitFlag(bit) % 2 == 1:
        ans += M // LCM[bit] * Prob[bit]
    else:
        ans -= M // LCM[bit] * Prob[bit]

print("{:.8f}".format(ans))


Measured memory_bytes: 155940
def solve():
    n = int(input())
    s = []
    for i in range(n):
        s.append(int(input()))

    s.sort()
    score = sum(s)

    i = 0
    flag = True
    if not score % 10 and n != 1:
        while 1:
            if s[i] % 10:
                score -= s[i]
                break
            i += 1
            if i == n - 1:
                flag = False
                break
    elif not score % 10 and n == 1:
        flag = False

    if flag:
        print(score)
    else:
        print(0)


solve()

Measured memory_bytes: 3064
N=int(input())
Ss = [input() for i in range(1,N+1)]
Cs=[]
Results=["AC","WA","TLE","RE"]
for st in Results:
    Cs.append(Ss.count(st))
for i in range(0,4):
    print(str(Results[i])+ " x " +str(Cs[i]))

Measured memory_bytes: 16220
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
typedef long long ll;
#define PB	push_back
#define REP(i,n) for (int i = 0; i < n; ++i)
#define REPR(i,n) for (int i = n; i >= 0; --i)
#define FOR(i,m,n) for (int i = m; i < n; ++i)
#define FORR(i,m,n) for (int i = n-1; i >= m; --i)
#define COUT(n)   cout << n << " " << flush
#define ALL(obj)  obj.begin(), obj.end()
using namespace std;

int main() {
	int n, f = 1;
	cin >> n;
	vector<int> v(n);
	REP(i,n)
		cin >> v[i];

	REPR(i,n-2)
		if (v[i] > v[i + 1]) v[i]--;

	REPR(i,n-2) {
		if (v[i] <= v[i + 1]) continue;
		f = 0;
	}

	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define FLASH cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
#define pb push_back
#define int long long
#define fr(i,a,b) for(int i=a;i<b;i++)
#define inf 1000000007
#define FILEIO freopen("/home/aman/Desktop/Kachda/input.txt", "r", stdin); freopen("/home/aman/Desktop/Kachda/output.txt", "w", stdout);
#define maxn 200000
#define pii pair<int, int>
using namespace std;

int n, m, d[maxn][3], s, t;
vector<int> v[maxn];
queue<int> q[3];

signed main()
{

 	FLASH

 	cin>>n>>m;

 	fr(i, 1, n + 1){
 		fr(j, 0, 3){
 			d[i][j] = inf;
 		}
 	}

 	fr(i, 1, m + 1){
 		int a, b;
 		cin>>a>>b;
 		v[a].pb(b);
 	}	
 	cin>>s>>t;

 	d[s][0] = 0;
 	q[0].push(s);

 	while(!q[0].empty() || !q[1].empty() || !q[2].empty()){
 		int node;
 		if(!q[0].empty()){
	 		node = q[0].front();
	 		q[0].pop();

	 		for(auto x: v[node]){
	 			if(d[x][1] > d[node][0] + 1){
	 				q[1].push(x);
	 				d[x][1] = d[node][0] + 1;
	 			}
	 		}
 		}

 		if(!q[1].empty()){
	 		node = q[1].front();
	 		q[1].pop();

	 		for(auto x: v[node]){
	 			if(d[x][2] > d[node][1] + 1){
	 				q[2].push(x);
	 				d[x][2] = d[node][1] + 1;
	 			}
	 		}
 		}

 		if(q[2].empty()) continue;
 		
 		node = q[2].front();
 		q[2].pop();

 		for(auto x: v[node]){
 			if(d[x][0] > d[node][2] + 1){
 				q[0].push(x);
 				d[x][0] = d[node][2] + 1;
 			}
 		}
 	}

 	if(d[t][0] == inf) cout<<-1;
 	else cout<<d[t][0]/3;
}

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

int n;
char s[15];
long long res;

void go(int id, int last = 0, long long cur = 0) {
	if (id == n - 1) {
		long long temp = 0ll;

		for (int i = last; i < n; i++) temp = (temp * 10 + (s[i] - '0'));

		res += cur + temp;

		return;
	}

	go(id + 1, last, cur);

	long long temp = 0ll;

	for (int i = last; i <= id; i++) temp = (temp * 10 + (s[i] - '0'));

	cur += temp;

	go(id + 1, id + 1, cur);
}
int main() {
	scanf("%s", s);

	n = strlen(s);

	go(0);

	printf("%lld\n", res);

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool eqchar(char c1, char c2) {
	if (c1 >= 'a' && c1 <= 'z') {
		c1 = 'A' + (c1 - 'a');
	}
	if (c2 >= 'a' && c2 <= 'z') {
		c2 = 'A' + (c2 - 'a');
	}
	return (c1 == c2);
}

int main(void) {
	string W,T;
	cin >> W;
	int res = 0;
	int wlen = W.length();
	while (cin >> T, T != "END_OF_TEXT") {
		if (wlen == T.length()) {
			bool seq = true;
			for (int i = 0; seq && i < wlen; ++i) {
				if (!eqchar(T[i],W[i])) {
					seq = false;
				}
			}
			if (seq) {
				++res;
			}
		}
	}
	cout << res << endl;
	return 0;
}



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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ASC(x) sort(ALL((x)))
#define DESC(x) sort(ALL((x)),greater<ll>())
#define REV(x) reverse(ALL((x)))
#define pb push_back
#define eb emplace_back

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

     PR((1000-N%1000)%1000);

    return 0;
}

/*



*/

Measured memory_bytes: 3620
#include <cmath>
#include <cstdio>
#include <iostream>

using namespace std;

#define EPS (1e-10)
#define equals(a,b) (fabs((a) - (b)) < EPS )

class Point {
public:
	double x, y;
	Point(double x = 0, double y = 0) :
			x(x), y(y) {
	}

	Point operator +(Point p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator -(Point p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator *(double a) {
		return Point(x * a, y * a);
	}
	Point operator /(double a) {
		return Point(x / a, y / a);
	}

	double abs() {
		return sqrt(norm());
	}
	double norm() {
		return x * x + y * y;
	}
	bool operator <(const Point& p) const {
		return x != p.x ? x < p.x : y < p.y;
	}
	bool operator ==(const Point& p) const {
		return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
	}
};

typedef Point Vector;

class Segment {
public:
	Point p1, p2;
};

double dot(Vector a, Vector b) {
	return a.x * b.x + a.y * b.y;
}

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

bool isOrthogonal(Vector a, Vector b) {
	return equals(dot(a, b), 0.0);
}

bool isOrthogonal(Point a1, Point a2, Point b1, Point b2) {
	return isOrthogonal(a1 - a2, b1 - b2);
}

bool isOrthogonal(Segment s1, Segment s2) {
	return equals(dot(s1.p1 - s1.p2, s2.p1 - s2.p2), 0.0);
}

bool isParallel(Vector a, Vector b) {
	return equals(cross(a, b), 0.0);
}

bool isParallel(Point a1, Point a2, Point b1, Point b2) {
	return isParallel(a1 - a2, b1 - b2);
}

bool isParallel(Segment s1, Segment s2) {
	return equals(cross(s1.p1 - s1.p2, s2.p1 - s2.p2), 0.0);
}

int main() {

	int q;
	scanf("%d", &q);

	for (int i = 0; i < q; ++i) {
		int p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y;
		scanf("%d %d %d %d %d %d %d %d", &p0x, &p0y, &p1x, &p1y, &p2x, &p2y, &p3x, &p3y);
		Point p1(p0x, p0y);
		Point p2(p1x, p1y);
		Point p3(p2x, p2y);
		Point p4(p3x, p3y);

		Segment s1;
		s1.p1 = p1;
		s1.p2 = p2;

		Segment s2;
		s2.p1 = p3;
		s2.p2 = p4;

		if (isOrthogonal(s1, s2)) {
			cout << 1 << endl;
		} else if (isParallel(s1, s2)) {
			cout << 2 << endl;
		} else {
			cout << 0 << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3244
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define int long long
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false),cin.tie(nullptr);
#endif
#define ff first
#define ss second
#define endl '\n'
#define all(c) c.begin(),c.end()
template<typename T>void print(T t){for(auto &it:t)cout<<it<<" "; cout<<endl;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve(){
  set<char> check={'a','b','c'};
  set<char> v;
  string s;
  cin>>s;
  for(auto it:s)v.insert(it);
  cout<<(check==v?"Yes":"No")<<endl;
  
}
int32_t main(){
  IOS;
  solve();
  //debug();
 #ifdef LOCAL_DEFINE
 cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl;
 #endif	
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

#define INF 999999999
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define pb(a) push_back(a)

typedef long long ll;
using namespace std;

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

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

vector<ll> d;

int main()
{
	ll x=0,y=0;
	ll cnt = 0;
	cin >> x>>y;
	d.push_back(x);
	
	while (1) {
		x = d[cnt] * 2;
		if (x > y) {
			break;
		}
		d.push_back(x);
		cnt++;
	}

	cout << d.size() << endl;
	
	return 0;
}


Measured memory_bytes: 256
/**
 *    author:  tourist
 *    created: 29.12.2018 16:10:26       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<string> s(2);
  cin >> s[0] >> s[1];
  vector<int> groups(2);
  vector<vector<int>> twos(2);
  for (int q = 0; q < 2; q++) {
    int i = 0;
    while (i < n) {
      if (i < n - 1 && s[q][i] == s[q][i + 1]) {
        twos[q].push_back(groups[q]);
        groups[q]++;
        i += 2;
      } else {
        groups[q]++;
        i += 1;
      }
    }
  }
  int match = (s[0][0] == s[1][0]);
  if (twos[0].empty() && twos[1].empty()) {
    cout << (match ? 0 : n) << '\n';
    return 0;
  }
  int ans = (int) 1e9;
  for (int rot = 0; rot < 2; rot++) {
    for (int x = 0; x <= (int) twos[0].size(); x++) {
      if ((match ^ (x % 2)) == 0) {
        continue;
      }
      vector<int> t0 = twos[0];
      vector<int> t1 = twos[1];
      int new_0 = (int) t0.size() - x;
      int new_1 = (int) t1.size();
      int drop_0 = 0;
      int drop_1 = 0;
      if (new_0 > new_1) {
        drop_0 = new_0 - new_1;
      }          
      if (new_0 < new_1) {
        drop_1 = new_1 - new_0;
      }
      int cur = 0;
      int g0 = groups[0];
      int g1 = groups[1];
      for (int i = 0; i < drop_0; i++) {
        cur += g0 - t0.back();
        t0.pop_back();
        g0++;
      }
      for (int i = 0; i < drop_1; i++) {
        cur += g1 - t1.back();
        t1.pop_back();
        g1++;
      }
      for (int i = 0; i < x; i++) {
        cur += t0[i] + 1 + i;
        g0++;
      }
      assert(g0 == g1);
      for (int i = x; i < (int) t0.size(); i++) {
        t0[i] += x;
      }
      assert((int) t0.size() - x == (int) t1.size());
      for (int i = 0; i < (int) t0.size() - x; i++) {
        cur += abs(t0[i + x] - t1[i]);
      }
      ans = min(ans, cur);
    }
    swap(s[0], s[1]);
    swap(groups[0], groups[1]);
    swap(twos[0], twos[1]);
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 384
#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stdio.h>

using namespace std;

const int maxa=300005;
int re=maxa;
int main()
{
    int n,sum=0;
    string s;
    cin>>n>>s;
    for(int i=0;i<n;i++)
    sum+=s[i]=='E';
    for(int i=0;i<n;i++)
    {
    sum-=s[i]=='E';
    re=min(sum,re);
    sum+=s[i]=='W';
    }
     cout<<re;
      
    return 0;
}  

Measured memory_bytes: 900
#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
using namespace std;
typedef long long ll;
// Welcome to my source code!

#define MAXV 10000

int main() {
    unsigned short *A, *B;
    int n, C[MAXV+1] = {};
    cin >> n;

    A = new short unsigned int[n+1];
    B = new short unsigned int[n+1];

    rep(i,n) {
        cin >> A[i+1];
        C[A[i+1]]++;
    }

    for (int i = 1; i <= MAXV; i++) C[i] += C[i-1];

    for (int j = 1; j <= n; j++) {
        B[C[A[j]]] = A[j];
        C[A[j]]--;
    }

    for (int i = 1; i <= n; i++) {
        if (i > 1) cout << ' ';
        cout << B[i];
    }
    cout << endl;
}


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

int main(){
    int N, D, count=0;
    cin >> N >> D;
    long x, y;
    for(int i=0; i<N; i++) {
        cin >> x >> y;
        if ((long)D*(long)D >= x*x+y*y) count++;
    }
    cout << count << endl;
}

Measured memory_bytes: 3632
#include <stdio.h>
int main() {
    int n, k, x, y, ans;
    scanf("%d %d %d %d", &n, &k, &x, &y);
    if (n > k) {
        ans = k * x + (n - k) * y;
    } else
        ans = n * x;
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 128
//Date and time of submission: 
 
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=1e5+5;

int main() {
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL);
	ll a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a,a+3);
	cout<<a[2]-a[0];
	return 0;
}


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

int N, M, A[100005], V[100005], ans;
vector<int> adj[100005];

void dfs(int cur, vector<int> &v, vector<int> &vv) {
        V[cur] = 1;
        v.push_back(cur);
        vv.push_back(A[cur]);

        for (int next : adj[cur]) if (V[next] == -1)
                dfs(next, v, vv);
}


int main() {
        scanf("%d%d", &N, &M);
        for (int i=0; i<N; ++i)  {
                scanf("%d", &A[i]);
                A[i]--;
        }

        for (int i=0; i<M; ++i) {
                int a, b;
                scanf("%d%d", &a, &b);
                --a, --b;

                adj[a].push_back(b);
                adj[b].push_back(a);
        }

        memset(V, -1, sizeof(V));
        for (int i=0; i<N; ++i) if (V[i] == -1) {
                vector<int> v, vv;
                dfs(i, v, vv);
                for (int it : v)
                        V[it] = i;
                for (int it : vv)
                        if (V[it] == i)
                                ++ans;
        }

        printf("%d\n", ans);
        return 0;
}


Measured memory_bytes: 11436
#ALDS1_1_D Maximum Profit
n=int(input())
A=[]
max_dif=-1*10**9
for i in range(n):
    A.append(int(input()))
min=A[0]
for i in range(n-1):
    if(A[i+1]-min>max_dif):
        max_dif=A[i+1]-min
    if(min>A[i+1]):
        min=A[i+1]
print(max_dif)

Measured memory_bytes: 15628
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;


int main(){
    string S; cin >> S;

    int N = S.length();
    bool flag = true;

    rep(i, N){
        if(S[i] != S[N-1-i]) flag = false;
    }

    rep(i, N/2){
        if(S[i] != S[N/2-1-i]) flag = false;
    }

    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
using namespace std;
int main()
{
    int n, m, x, y, z, a, b, c, d, s = 0;
    cin >> x >> y;
    int ara[x];
    for(int i = 0; i < x; i++){
        cin >> ara[i];
        s += ara[i];
    }
    int cnt = 0;
    for(int i = 0; i < x; i++)
    {
        if(s <= 4 * y * ara[i])
        {
            cnt++;
        }
    }
    if(cnt >= y)
    cout << "Yes" << endl;
    else
        cout << "No" << endl;
//    main();
}



Measured memory_bytes: 256