akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define Ans(f, y, n) if(f) cout << y << endl; else cout << n << endl;
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i, v.size()){ cout << v[i] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
//#define int long long
#define INF 1000000000000000000

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

template<typename T> void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readv_m1(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }

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

int mod = 1000000007;
//int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int N; cin >> N;
    vec a(N); readv(a);
    Sort(a);
    Reverse(a);

    bool f = false;
    REP(i, N + 1){
        if(i == N || i >= a[i]){
            i--;
            FOR(k, 1, N + 1){
                if(i + k == N || i >= a[i + k]){
                    if(k % 2 == 0) f = true;
                    break;
                }
            }
            if((a[i] - i) % 2 == 0) f = true;
            break;
        }
    }
    Ans(f, "First", "Second");

    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <algorithm>
#define N 400005
#define inf 0x7fffffff
using namespace std;

struct E {int next, to, dis;} e[N];
int n, m, num, flag, cnt;
int h[N], a[N], pos[N], obj[N];
bool vis[N];

int read()
{
    int x = 0; char c = getchar();
    while(c < '0' || c > '9') c = getchar();
    while(c >= '0' && c <= '9') {x = x * 10 + c - '0'; c = getchar();}
    return x;
}

void add(int u, int v, int w)
{
    e[++num].next = h[u];
    e[num].to = v;
    e[num].dis = w;
    h[u] = num;
}

void dfs(int x)
{
    if(flag) return;
    vis[x] = 1;
    for(int i = h[x]; i != 0; i = e[i].next)
    {
        int t = pos[x] + e[i].dis;
        if(pos[e[i].to] == inf) pos[e[i].to] = t, dfs(e[i].to);
        else if(t != pos[e[i].to]) {flag = 1; return;}
    }
}

int main()
{
    cin >> n >> m;
    for(int i = 1; i <= m; i++)
    {
        int a = read(), b = read(), c = read();
        add(a, b, c), add(b, a, -c);
        pos[a] = pos[b] = inf;
        obj[++cnt] = a, obj[++cnt] = b;
    }
    sort(obj + 1, obj + 1 + cnt);
    cnt = unique(obj + 1, obj + 1 + cnt) - obj - 1;
    for(int i = 1; i <= cnt; i++)
        if(!vis[obj[i]])
        {
            flag = 0;
            pos[obj[i]] = 0;
            dfs(obj[i]);
            if(flag) {cout << "No"; return 0;}
        }
    cout << "Yes";
    return 0;
}

Measured memory_bytes: 13184
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;

namespace Volume0015
{
    class Program
    {
        static void Main(string[] args)
        {
            int numOfSumple = int.Parse(Console.ReadLine());
            for (int i = 0; i < numOfSumple; ++i)
            {
                BigInteger input1 = BigInteger.Parse(Console.ReadLine());
                BigInteger input2 = BigInteger.Parse(Console.ReadLine());
                BigInteger answer = Calclation.SumOfTwoNums(input1, input2);
                int digits = 0;
                if ((digits = Check.DigitsCheck(answer)) > 80)
                {
                    Console.WriteLine("overflow");
                }
                else
                {
                    Console.WriteLine(answer);
                }
            }
        }
    }
    class Calclation
    {
        internal static BigInteger SumOfTwoNums(BigInteger operand1, BigInteger operand2)
        {
            return operand1 + operand2;
        }
    }
    class Check
    {
        internal static int DigitsCheck(BigInteger num)
        {
            int digits = 1;
            BigInteger nextNum = 0;
            while ((nextNum = num / 10) >= 1)
            {
                num = nextNum;
                ++digits;
            }
            return digits;
        }
    }
}


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

const int MOD = 1000000007;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;
  int N;
  cin >> N;
  long long all = 1;
  long long noNine = 1;
  long long neither = 1;
  for(int i = 0; i < N; i++){  
    all *= 10;
    all %= MOD;
    noNine *= 9;
    noNine %= MOD;
    neither *= 8;
    neither %= MOD;
    //cout << all << " " << noNine << " " << neither <<endl;
  }
  long long ans = all - noNine - noNine + neither;
  ans %= MOD;
  cout << (ans + MOD) % MOD <<endl;
}


Measured memory_bytes: 3588
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
using namespace std;

long long n, a, b;

int main()
{
  cin >> n >> a >> b;
  long long sum, blueNum;

  long long iteNum = n / (a + b);
  long long res = n - iteNum * (a + b);
  blueNum = a * iteNum;
  if (res > a)
  {
    blueNum += a;
  }
  else
  {
    blueNum += res;
  }

  // bool blue = true;
  // while (true)
  // {
  //   if (blue)
  //   {
  //     if (sum + a > n)
  //     {
  //       blueNum += n - sum;
  //       break;
  //     }
  //     sum += a;
  //     blueNum += a;
  //   }
  //   else
  //   {
  //     if (sum + b > n)
  //     {
  //       break;
  //     }
  //     sum += b;
  //   }
  //   blue = !blue;
  // }

  cout << blueNum << endl;
}

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

using namespace std;

#define umap std::unordered_map
#define uset std::unordered_set
#define _all(container) std::begin(container), std::end(container)
#define _in(container, value) (std::find(_all(container), value) != std::end(container))
#define _in_if(container, predicate) (std::find_if(_all(container), predicate) != std::end(container))
#define _odd(value) (value & 1)
#define _even(value) !(value & 1)
#define _for(i, n) for (int i = 0; i < n; ++i)
#define _FOR(i, k, n) for (int i = k; i <= n; ++i)
#define _FORR(i, k, n) for (int i = n; i >= k; --i)

using Integer = long long;
using vint = vector<int>;
using pint = pair<int, int>;
using vpint = vector<pint>;
using vdouble = vector<double>;
using cint = const int;
using cdouble = const double;

void solve()
{
    int N;
    cin >> N;
    vint A(N);

    _for(i, N)
    {
        cin >> A[i];
    }

    vpint AIndices;
    AIndices.reserve(N);
    _for(i, N)
    {
        AIndices.emplace_back(make_pair(A[i], i));
    }
    std::sort(AIndices.begin(), AIndices.end(), [](const auto& a, const auto& b) { return a.first < b.first; });

    for (const auto& pVal : AIndices) {
        cout << pVal.second + 1 << " ";
    }
    cout << "\n";
}

int main(int argc, char**)
{
    if (argc > 1) {
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(0);

    solve();
}


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

const int inf = 1e9;
const ll linf = 1e18;

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

    int n; cin >> n;
    string s; cin >> s;
    
    for (auto &c: s) {
        cout << ((c + n) > 'Z' ? (char)(c + n - 26) : (char)(c + n));
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<map>
#include<queue>
#include<utility>
using namespace std;
using ll = long long;
int main(){
    int n,m,a,b,c;
    priority_queue<pair<int,int>> p;
    cin >> n >> m;
    for(int i=0;i<n;i++){
        cin >> a;
        p.push(make_pair(a,1));
    }
    for(int i=0;i<m;i++){
        cin >> b >> c;
        p.push(make_pair(c,b));
    }
    ll ans = 0;
    for(int i=0;i<n;i++){
        auto q = p.top();
        p.pop();
        ans+=q.first;
        q.second--;
        if(q.second)    p.push(q);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2420
#include<iostream>
#include<vector>
#include<map>
#include<unordered_map>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;


int main(){
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    vector<int>dp(n);
    dp[0]=0;
    for(int i=1;i<v.size();i++){
        if(v[i-1]>=v[i]){
            
        }
        int a = (v[i-1]>=v[i]) ? dp[i-1]+1 : 0;
        dp[i] = (v[i-1]>=v[i]) ? dp[i-1]+1 : 0;
    }

    cout<<*max_element(dp.begin(),dp.end())<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;
typedef long long ll;

int main()
{
  string S;
  cin >> S;
  string t;
  int ans = 0;
  for( int i=0;i<S.size(); i++ )
    {
      if( t.size() == 0 )
	t.push_back(S[i]);
      else
	{
	  if( ( S[i] == '1' && t[t.size()-1] == '0' )
	      || ( S[i] == '0' && t[t.size()-1] == '1') )
	    {
	      t.pop_back();
	      ans++;
	    }
	  else
	    t.push_back(S[i]);	    
	}
    }
  cout << 2*ans << endl;
  return 0;
}


Measured memory_bytes: 640
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();
    int area = a * b;
    int length = 2 * (a + b);
    System.out.println(area + " " + length);
    sc.close();
    }
}


Measured memory_bytes: 26196
package main
import (
  "fmt"
)
func main() {
  var n int
  fmt.Scan(&n)
  var s string
  fmt.Scan(&s)
  leftW := make([]int, n)
  rightE := make([]int, n)
  for i := 0; i < n; i++ {
    if i != 0 {
      if s[i-1] == 'W' {
        leftW[i] = leftW[i-1]+1
      } else {
        leftW[i] = leftW[i-1]
      }
    }
  }
  for i := n-1; 0 <= i; i-- {
    if i != n-1 {
      if s[i+1] == 'W' {
        rightE[i] = rightE[i+1]
      } else {
        rightE[i] = rightE[i+1] + 1
      }
    }
  }

  
  result := n
  for i := 0; i < n; i++ {
    total := leftW[i]+rightE[i]
    if total < result {
      result = total
    }
  }
  fmt.Println(result)
}

Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef set <int> :: iterator sitr;
typedef set <ll> :: iterator sltr;
#define mset multiset
typedef mset <int> msi;
typedef mset <ll> msll;
typedef mset <int> :: iterator msitr;
typedef mset <ll> :: iterator msltr;
#define mp make_pair
#define pb push_back
#define pob pop_back
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
priority_queue <int> num;
int main(){
    for(int i=1;i<=3;i++){
        int temp;
        cin>>temp;
        num.push(temp);
    }

    int a,b,c;
    a = num.top();num.pop();
    b = num.top();num.pop();
    c = num.top();num.pop();

    cout<<10*a+b+c<<endl;


}


Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000000000000000000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
int main() {
	int ans = 0;
	int n;
	cin >> n;
	REP(i, n) {
		int a, b;
		cin >> a >> b;
		ans += b - a + 1;
	}
	cout << ans << endl;
	return 0;
}

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

int main() {
  int a,b,c; cin >> a >> b >> c;
  cout << ( (100*a+10*b+c)%4==0 ? "YES" : "NO") << endl;
  return 0;
}

Measured memory_bytes: 256
N,K = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*N
ans = int(0)
c = int(0)
if N < K:
    c = N-1
else:
    c = K
for i in range(c):
    dp[i+1] = abs(h[i+1]-h[0])

for i in range(2,N):
    if i<K:
        c = i
    else:
        c = K
    dpcandi = [0] * c
    for j in range(c):
        dpcandi[j] = dp[i-j-1] + abs(h[i]-h[i-j-1])
    dp[i] = min(dpcandi)

ans = dp[N-1]

print(ans)

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define Abs(x)((x) < 0 ? (x) * -1 : (x))

#define rep(x, y) for ((x) = 0; (x) < (y); (x)++)
#define repin(x, y) for ((x) = 0; (x) <= (y); (x)++)
#define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--)
#define nepi(x, y, z) for ((x) = (y) - 1; (z) <= (x); (x)--)
#define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++)
#define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++)
#define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z))
#define repis(x, y, z, s) for ((x) = (z); (x) < (y); (x) += (s))
#define repit(x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define nepit(x) for (__typeof((x).rbegin()) it = (x).rbegin(); it != (x).rend(); it++)

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

#define Mem0(x) memset(x, 0, sizeof(x))
#define Mem1(x) memset(x, -1, sizeof(x))

#define Unique(v) v.resize(unique(All(v)) - v.begin())

#define peq(p0, p1)(p0.first == p1.first && p0.second == p1.second)

#define End '\n'
#define Out(x) cout<<(x)<<End
#define OutP(p, sep, end) cout<<p.first<<sep<<p.second<<end

template<typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; }
template<typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; }
template<typename T> using V = vector<T>;
template<typename T> using VV = V<V<T> >;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define lb std::lower_bound
#define ub std::upper_bound

#define lbi(v, x) lb(All(v), (x))-v.begin()
#define ubi(v, x) ub(All(v), (x))-v.begin()

static const ll MOD = 1e9 + 7;
static const double PI = 3.141592653589793;

#define LOCAL 0

int main()
{
#if LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#endif

    cin.tie(0);
    ios::sync_with_stdio(false);
	//std::cout.precision(18);

    int x;

	cin >> x;

	if (x == 3 || x == 5 || x == 7) Out("YES");
	else Out("NO");
	
	return 0;
}


Measured memory_bytes: 256
W,H,x,y=gets.split.map &:to_i
if 2*x==W && 2*y==H
    puts "#{W*H/2} 1"
else #if 2*x==W or 2*y==H or x==W or y==H or x==0 or y==0
    puts "#{W*H*0.5} 0"
end


Measured memory_bytes: 1788
/******************************************
*    AUTHOR:         CHIRAG AGARWAL       *
*    INSTITUITION:   BITS PILANI, PILANI  *
******************************************/
#include <bits/stdc++.h>
using namespace std;
 
typedef long long LL; 
typedef long double LD;

int cnt[100005];

int main() 
{
	int n,m;
	scanf("%d %d",&n,&m);
	for(int i=1;i<=m;i++)
	{
		int a,b;
		scanf("%d %d",&a,&b);
		cnt[a]++;
		cnt[b]++;
	}
	for(int i=1;i<=n;i++)
	{
		if(cnt[i]%2)
		{
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	return 0;
}

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

const ll INF = (ll)(1e18)+100;

int main(){
    ll n,k;    cin >> n >> k;
    vector<ll>a(n);
    rep(i, n)   cin >> a[i];
    sort(a.begin(), a.end());
    ll count[3] = {0};  //0:- 1:0 2:+   負、0、正それぞれの個数
    rep(i, n){
        if(a[i] < 0)    count[0]++;
        else if(a[i] > 0)   count[2]++;
        else            count[1]++;
    }
    ll cdic[3] = {0};  //0:-  1:0  2:+ となるペアの個数、累積をとる
    cdic[0] = count[0]*count[2];
    cdic[1] = cdic[0] + count[1]*(count[0]+count[1]+count[2]) - count[1]*(count[1]+1)/2;
    cdic[2] = cdic[1] + count[0]*(count[0]-1) + count[2]*(count[2]-1);
    ll ans = 0;
    if(k <= cdic[0]){
        //ansが負
        vector<ll>pos;
        vector<ll>neg;
        rep(i, n){
            if(a[i] < 0)        neg.push_back(a[i]);
            else if(a[i] > 0)   pos.push_back(a[i]);
        }
        ll ok = -INF, ng = 0;
        while(ok + 1 < ng){
            ll x = (ok+ng)/2;   //x未満がk未満
            ll ck = 0;
            rep(i, pos.size()){ //正を固定して負を二分探索
                ll l = -1, r = neg.size();
                while(l + 1 < r){
                    ll t = (l+r)/2;
                    if(pos[i]*neg[t] < x)   l = t;
                    else                    r = t;
                }
                ck += r;
            }
            if(ck < k)  ok = x;
            else        ng = x;
        }
        ans = ok;
    }else if(k <= cdic[1]){
        //ansが0
    }else{
        //ansが正
        k -= cdic[1];
        vector<ll>pos;
        vector<ll>neg;
        rep(i, n){
            if(a[i] < 0)        neg.push_back(a[i]);
            else if(a[i] > 0)   pos.push_back(a[i]);
        }
        rep(i, neg.size())  neg[i] = 0 - neg[i];
        sort(neg.begin(), neg.end());
        ll ok = 0, ng = INF;
        while(ok + 1 < ng){
            ll x = (ok+ng)/2;   //x未満がk未満
            ll ck = 0;
            //pos
            rep(i, pos.size()){
                ll l = -1, r = pos.size();
                while(l + 1 < r){
                    ll t = (l+r)/2;
                    if(pos[i]*pos[t] < x)   l = t;
                    else                    r = t;
                }
                ck += r;
                if(pos[i]*pos[i] < x)   ck--;
            }
            //neg
            rep(i, neg.size()){
                ll l = -1, r = neg.size();
                while(l + 1 < r){
                    ll t = (l+r)/2;
                    if(neg[i]*neg[t] < x)   l = t;
                    else                    r = t;
                }
                ck += r;
                if(neg[i]*neg[i] < x)    ck--;
            }
            if(ck/2 < k)  ok = x;
            else        ng = x;
        }
        ans = ok;
    }
    cout << ans << endl;
}


Measured memory_bytes: 4084
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()

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

  vector<pair<int,int>> a;

  if(N % 2 == 0) {
    vector<pair<int,int>> vec;
    for(int i = 0;i < N && i < N - i - 1;i++) {
      vec.push_back({i, N - i  - 1});
    }
    for(int i = 0;i < vec.size();i++) {
      for(int j = i + 1;j < vec.size();j++) {
        int x = vec[i].first;
        int y = vec[i].second;
        int v = vec[j].first;
        int u = vec[j].second;
        a.push_back({x, v});
        a.push_back({x, u});
        a.push_back({y, v});
        a.push_back({y, u});
      }
    }
  }
  else {
    vector<pair<int,int>> vec;
    int cen = N - 1;
    N--;
    for(int i = 0;i < N && i < N - i - 1;i++) {
      vec.push_back({i, N - i  - 1});
    }
    for(int i = 0;i < vec.size();i++) {
      for(int j = i + 1;j < vec.size();j++) {
        int x = vec[i].first;
        int y = vec[i].second;
        int v = vec[j].first;
        int u = vec[j].second;
        a.push_back({x, v});
        a.push_back({x, u});
        a.push_back({y, v});
        a.push_back({y, u});
      }
    }
    for(int i = 0;i < N;i++) {
      a.push_back({cen , i});
    }
  }

  cout << a.size() << endl;
  for(auto p : a) {
    cout << p.first + 1 << " " << p.second + 1 << endl;
  }
}


Measured memory_bytes: 384
//HEX
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
using namespace std;
int main(){
    string X,Y;
    int a,b;
    cin >> X >> Y;
    if(X=="A"){
        a = 1;
    }
    else if(X=="B"){
        a = 2;
    }
    else if(X=="C"){
        a = 3;
    }
    else if(X=="D"){
        a = 4;
    }
    else if(X=="E"){
        a = 5;
    }
    else if(X=="F"){
        a = 6;
    }
    if(Y=="A"){
        b = 1;
    }
    else if(Y=="B"){
        b = 2;
    }
    else if(Y=="C"){
        b = 3;
    }
    else if(Y=="D"){
        b = 4;
    }
    else if(Y=="E"){
        b = 5;
    }
    else if(Y=="F"){
        b = 6;
    }

    if(a==b) cout << "=" << endl;
    else if(a>b) cout << ">" << endl;
    else if(a<b) cout << "<" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
using namespace std;
int n,m,a[100005],s=0;
vector<int> g[100005];
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	while(m--){
		int x,y;
		cin>>x>>y;
		g[x].push_back(y),g[y].push_back(x);
	}
	for(int i=1;i<=n;i++){
		int flag=0;
		for(int y:g[i]){
			if(a[y]>=a[i])flag=1;
		}
		s+=!flag;
	}
	cout<<s;
}


Measured memory_bytes: 9204
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  ll n,m;
  cin >> n >> m;
  vec a(n*m+1),b(n*m+1);
  for(ll i=0;i<n;i++) {
    ll tmp;
    cin >> tmp;
    a[tmp]++;
  }
  for(ll i=0;i<m;i++) {
    ll tmp;
    cin >> tmp;
    b[tmp]++;
  }
  ll ans=1;
  for(ll i=n*m;i;i--) {
    if(a[i]>1||b[i]>1) {
      cout << 0 << endl;
      return 0;
    }
    if(!(a[i]*b[i])) {
      ll f=0;
      if(a[i]) f=1;
      if(b[i]) f=2;
      if(i!=n*m) {
        a[i]+=a[i+1];
        b[i]+=b[i+1];
      }
      if(f==1) {
        (ans*=b[i])%=mod;
      }
      else if(f==2) {
        (ans*=a[i])%=mod;
      }
      else {
        (ans*=(a[i]*b[i]%mod-(n*m-i)+mod)%mod)%=mod;
      }
    }
    else {
      if(i!=n*m) {
        a[i]+=a[i+1];
        b[i]+=b[i+1];
      } 
    }
  }
  cout << ans << endl;
}

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

int main(void) {
  long long A, B, K;
  cin >> A >> B >> K;
  long long l=A, r=B;
  
  l = A - K;
  if(l<0) l=0;
  
  if(l <= 0)
  	r = B - (abs(A-K));
  if(r<0) r=0;
  
  cout << l << " " << r << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#define MAX 500010
int mem[MAX]={0};

using namespace std;
int main(){
	int n;
	long long sum=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		if(i%3 ==0 || i%5==0) continue;
		sum+=i;
	}
	printf("%lld",sum);
	return 0;
} 

Measured memory_bytes: 3784
#include<bits/stdc++.h>
using namespace std;
#define ms(x,y) memset(x, y, sizeof(x))
#define lowbit(x) ((x)&(-x))
#define sqr(x) ((x)*(x))
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;


void run_case() {
    LL n; cin >> n;
    LL x = n+1, y = n+1;
    for(LL i = 1; i*i <= n; ++i) {
        if(n % i == 0) {
            LL nx = i, ny = n / i;
            if(nx + ny < x + y) x = nx, y = ny;
        }
    }
    cout << (x+y-2);
}


int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    cout.flags(ios::fixed);cout.precision(9);
    //int t; cin >> t;
    //while(t--)
    run_case();
    cout.flush();
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  cin.ignore();
  vector<string> s(n);
  for (int i = 0; i < n; ++i) {
    getline(cin, s[i]);
  }

  for (int i = 0; i < n; ++i) {
    for (int a = 0; a < 26; ++a) {
      for (int b = 0; b < 26; ++b) {
        string s2 = s[i];
        for (int j = 0; j < s2.size(); ++j) {
          if (s2[j] == ' ') {
            continue;
          }
          s2[j] = (a * (s2[j] - 'a') + b) % 26 + 'a';
        }

        if (s2.find("this") != s2.npos || s2.find("that") != s2.npos) {
          s[i] = s2;
        }
      }
    }
  }

  for (int i = 0; i < n; ++i) {
    cout << s[i] << endl;
  }
}



Measured memory_bytes: 3188
#include <iostream>

int main()
{
  int n;
  std::cin >> n;
  int max_height = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int height;
    std::cin >> height;
    if (max_height <= height) {
      cnt++;
      max_height = height;
    }
  }
  std::cout << cnt << '\n';
  return 0;
}


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

using namespace std;

#define EACH(i,a) for (auto& i : a)
#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 ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "POSSIBLE" : "IMPOSSIBLE") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

int N, M;

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

  cin >> N >> M;

  set< int > from;
  set< int > to;

  int f, t;
  REP(i, M) {
    cin >> f >> t;
    if (f == 1) {
      from.erase(t);
      from.insert(t);
    }

    if (t == N) {
      to.erase(f);
      to.insert(f);
    }
  }

  bool ok = false;
  EACH(fi, from) {
    if (to.find(fi) != to.end()) ok = true;
  }

  OK(ok);

  return 0;
}



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

using namespace std;


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

	vector<int> v;
	v.reserve(100000);

	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		v.push_back(a);
	}

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

	int sum = 0;

	int prev = 0;
	int num = 0;

	for (int& item : v)
	{
		if (prev == item)
		{
			++num;
		}
		else
		{
			if (num % 2 != 0) ++sum;
			num = 1;
		}

		prev = item;
	}

	if (num % 2 != 0) ++sum;

	cout << sum << endl;

	return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>

using namespace std;

int main() {

	int N;
	long long int sum = 0, ans;
	cin >> N;
	vector<int> A(N+2);
	A[0] = 0;
	for (int i = 1; i <= N; i++) {
		cin >> A[i];
		sum += abs(A[i] - A[i-1]);
	}
	A[N + 1] = 0;
	sum += abs(A[N+1] - A[N]);
	for (int i = 1; i <= N; i++) {
		ans = abs(A[i] - A[i - 1]) + abs(A[i+1] - A[i]) - abs(A[i+1] - A[i-1]);
		cout << sum- ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <cassert>
#include <exception>
#include <numeric>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<ll, ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<P> vp;
typedef vector<bool> vb;
#define rep(i, a, n) for (ll i = (a); i < (n); ++i)
#define rrep(i, a, n) for (ll i = (a); i > (n); --i)
#define erep(i, a, n) for (ll i = (a); i <= (n); ++i)
#define rerep(i, a, n) for (ll i = (a); i >= (n); --i)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define sz(x) ((int)x.size())
#define print(X) cout << (X) << "\n"
#define _ << " " <<
static const int INF = 1e+9+7;

int main(){
  erep(i,1,10000){
    int x;
    cin >> x;
    if(x == 0) break;
    else cout << "Case " << i << ": " << x << "\n";
  }

  return 0;
}





Measured memory_bytes: 3032
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int w = scanner.nextInt();
        if (s <= w) {
            System.out.println("unsafe");
        } else {
            System.out.println("safe");
        }
    }
}

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

int main() {
  string s, t;
  cin >> s >> t;
  int x = s.length();
  int y = t.length();
  int ans = y;
  for (int i = 0; i < x-y+1; i++) {
    int temp = 0;
    string u = s.substr(i,y);
    for (int j = 0; j < y; j++) {
      if (u[j] != t[j]) temp++;
    }
    ans = min(ans, temp);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

const int N = 100100;
char s[N];
bool dp[N];
int n;

int main()
{
	scanf("%s", s);
	n = strlen(s);
	dp[0] = 1;
	for (int l = 0; l < n; l++)
	{
		if (!dp[l]) continue;
		if (l + 5 <= n && strncmp(s + l, "dream", 5) == 0) dp[l + 5] = 1;
		if (l + 7 <= n && strncmp(s + l, "dreamer", 7) == 0) dp[l + 7] = 1;
		if (l + 5 <= n && strncmp(s + l, "erase", 5) == 0) dp[l + 5] = 1;
		if (l + 6 <= n && strncmp(s + l, "eraser", 6) == 0) dp[l + 6] = 1;
	}
	if (dp[n])
		printf("YES\n");
	else
		printf("NO\n");


	return 0;
}

Measured memory_bytes: 384
var
	N,i,t:Longint;
	ans:int64;
	A,B:Array[1..100001]of Longint;
begin
	read(N);
	for i:=1 to N+1 do read(A[i]);
	for i:=1 to N do read(B[i]);
	for i:=1 to N do begin
		t:=A[i];
		if t>B[i] then t:=B[i];
		inc(ans,t);
		dec(B[i],t);
		t:=B[i];
		if t>A[i+1] then t:=A[i+1];
		inc(ans,t);
		dec(A[i+1],t);
	end;
	writeln(ans);
end.


Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n,p,a;
  char s;
  string q;
  cin>>n;
  while(true){
    if(n<=0) break;
    s='a';
    a=n%26;
    if(a==0) a=26;
    a--;
    s+=a;
    //cout<<(int)s<<"\n";
    n=(n-1)/26;
    q+=s;
  }
  for(int i=q.size()-1;i>=0;i--){
    cout<<q[i];
  }
  cout<<"\n";
}

Measured memory_bytes: 3624
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <limits.h>
#include <set>
#include <map>
#include <tuple>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rep(i,N) for (int i=0;i<N;i++)
#define loop(i,N,M) for(int i=N;i<M;i++)
#define MAX(v) *max_element(v.begin(),v.end())
#define MIN(v) *min_element(v.begin(),v.end())
#define SORTL2S(type,v) sort(v.begin(),v.end(),greater<type>())
#define SORTS2L(type,v) sort(v.begin(),v.end())
#define SORTMF(v,func) sort(v.begin(),v.end(),func)

//変数
ll N,M;
vector<int> vec;

//解法
void solve() {
	
	ll ans = 0;
	rep(i, M) {
		if (vec[i] == N) ans++;
	}

	cout << ans;

	return;
}

int main() {

	//入力
	cin >>N>>M;
	vec.resize(M, 0);
	rep(i, N) {
		int K;
		cin >> K;
		rep(j, K) {
			int a;
			cin >> a;
			vec[a-1]++;
		}
	}

	solve();
	cout << endl;
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (int)(n) - 1; i >= 0; i--)

using namespace std;
using ll = long long;
ll sl();

struct unionfind {
  vector<int> A;

  unionfind(int n) : A(n, -1) {}

  int find(int x) {
    if (A[x] < 0) return x;
    return A[x] = find(A[x]);
  }

  void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (A[x] > A[y]) swap(x, y);
    A[x] += A[y];
    A[y] = x;
  }

  int size(int x) {
    return -A[find(x)];
  }
};


int main() {
  int N;
  cin >> N;
  unionfind uf(200000);
  vector<int> X(N), Y(N);
  rep(i, N) {
    X[i] = sl() - 1;
    Y[i] = sl() - 1;
    uf.unite(X[i], Y[i] + 100000);
  }
  vector<set<int>> row(200000), col(200000);
  for (int i = 0; i < N; i++) {
    col[uf.find(X[i])].insert(X[i]);
    row[uf.find(X[i])].insert(Y[i]);
  }
  ll ans = -N;
  for (int i = 0; i < 200000; i++) {
    ans += row[i].size() * col[i].size();
  }
  cout << ans << endl;
}

ll sl() {
  ll x;
  cin >> x;
  return x;
}

struct init {
  init() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
  }
} init;


Measured memory_bytes: 25216
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int []a=new int[n];
        int index=0;
        int max=0;
        int nexmax=0;
        int inde2=0;
        for(int i=0;i<n;i++){
            a[i]=sc.nextInt();
            if(max<=a[i]){
                nexmax=max;
                inde2=index;
                max=a[i];
                index=i;
            }
            else if(nexmax<=a[i]){
                nexmax=a[i];
            }
        }
        for(int i=0;i<n;i++){
            if(i!=index){
                System.out.println(max);
            }
            else{
                System.out.println(nexmax);
            }
        }
        
    }
}


Measured memory_bytes: 87312
#include<bits/stdc++.h>
using namespace std;
bool pd;
int main(){
	string st;
	cin>>st;
	for(int i=0;i<st.size();++i){
		if(st[i]=='C'&&!pd)pd=1;
		if(st[i]=='F'&&pd){
		cout<<"Yes"<<endl;
		return 0;
		}
	}
	cout<<"No"<<endl;
	return 0;
}



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


int main(){
  while(true){
    int n,m;
    cin>>n>>m;
    if(n==0&&m==0){
      break;
    }
    int a[n][m];
    int q[m],p[m];
    for(int x=0;x<m;x++){
      q[x]=0;
      p[x]=x+1;
    }
    for(int i=0;i<n;i++){
      for(int j=0;j<m;j++){
	cin>>a[i][j];
	if(a[i][j]==1){
	  q[j]=q[j]+1;
	}
      }
    }
    for(int end=m-1;end>0;end--){
      for(int j=0;j<end;j++){
	if(q[j+1]>q[j]){
	  int tmq=p[j];
	  p[j]=p[j+1];
	  p[j+1]=tmq;
	  int tmp=q[j];
	  q[j]=q[j+1];
	  q[j+1]=tmp;
	}
      }
    }
    for(int l=0;l<m;l++){
      cout<<p[l];
      if(l!=m-1){
	cout<<" ";
      }
    }
      cout<<endl;
  }
  return 0;
}

Measured memory_bytes: 1548
#include <stdio.h>

int GetMinIndex(int *a, int start, int len) {
  int min = a[start], minIndex = start;
  for (int i = start + 1; i < len; i++) {
    if (min > a[i]) {
      min = a[i];
      minIndex = i;
    }
  }
  return minIndex;
}

void Swap(int *a, int *b) {
  int tmp = *a;
  *a = *b;
  *b = tmp;
}

void ReadArray(int *a, int len) {
  for (int i = 0; i < len; i++) {
    scanf("%d", &a[i]);
  }
}

void PrintArray(int *a, int len) {
  for (int i = 0; i < len; i++) {
    printf("%d%c", a[i], i + 1 == len ? '\n' : ' ');
  }
}

void InsertionSort(int *a, int len) {
  // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A
  PrintArray(a, len);
  for (int i = 1; i < len; i++) {
    int v = a[i];
    int j = i - 1;
    while (j >= 0 && a[j] > v) {
      a[j + 1] = a[j];
      j--;
      a[j + 1] = v;
    }
    PrintArray(a, len);
  }
}

void BubbleSort(int *a, int len) {
  // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_2_A
  int flg = 1;
  int swapCount = 0;
  while (flg) {
    flg = 0;
    for (int i = 0; i < len - 1; i++) {
      if (a[i] <= a[i + 1]) continue;
      flg = 1;
      swapCount++;
      Swap(&a[i], &a[i + 1]);
    }
  }
  PrintArray(a, len);
  printf("%d\n", swapCount);
}

void SelectionSort(int *a, int len) {
  int swapCount = 0;
  for (int i = 0; i < len - 1; i++) {
    int idx = GetMinIndex(a, i, len);
    if (idx == i) continue;
    swapCount++;
    Swap(&a[i], &a[idx]);
  }
  PrintArray(a, len);
  printf("%d\n", swapCount);
}

int main(int argc, char *argv[]) {
  int N;
  scanf("%d", &N);
  int a[N];
  ReadArray(a, N);
  // InsertionSort(a, N);
  // BubbleSort(a, N);
  SelectionSort(a, N);
  return 0;
}

Measured memory_bytes: 1744
// 以下のソースを勉強する.
// zscoder氏.
// https://atcoder.jp/contests/dp/submissions/3937208
#include <bits/stdc++.h>
using namespace std;
int h[123321];
int dp[123321];

int main(){
    
    // 1. 入力情報取得.
    // ios_base::sync_with_stdio(0); cin.tie(0);
    int N;
    scanf("%d", &N);
    for(int i = 0; i < N; ++i) scanf("%d", &h[i]);
    
    // 2. dp更新.
    dp[0] = 0;
    for(int i = 1; i < N; ++i){
        // i - 1 から ジャンプしてきた.
        dp[i] = dp[i - 1] + abs(h[i] - h[i - 1]);
        // i - 2 から ジャンプしてきた.
        if(i >= 2) dp[i] = min(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
    }
    // for(int i = 0; i < N; ++i) printf("dp[%d]=%d ", i, dp[i]);
    // printf("\n");
    
    // 3. 出力.
    printf("%d\n", dp[N - 1]);
    return 0;
    
}

Measured memory_bytes: 1024
#pragma GCC optimize("O3")
#pragma GCC target ("sse4")

#include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define f first
#define s second

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const 
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
ll n, k;
vector<ll> v;
multiset<ll, greater<ll>> m;
int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> k; n = (1LL << k);
    v.assign(n, 0);
    F0R(i, n) 
    {
        ll t; cin >> t;
        m.insert(t);
    }
    vector<ll> cur;
    cur.pb((*m.begin()));
    m.erase(m.begin());
    F0R(i, k)
    {
        ll s = sz(cur);
        F0R(j, s)
        {
            auto itx = m.upper_bound(cur[j]);
            if(itx != m.end())
            {
                cur.pb((*itx));
                m.erase(itx);
            } 
            else
            {
                cout << "No";
                return 0;
            }
        }
    }
    cout << "Yes";
    return 0;
}

Measured memory_bytes: 16756
# AOJ 0208 Room Numbers of a Hospital
# Python3 2018.6.23 bal4u
# 8進数に変換して、01234567を01235789に置き換える

dic = {'0':'0','1':'1','2':'2','3':'3','4':'5','5':'7','6':'8','7':'9'}
while 1:
	n = int(input())
	if n == 0: break
	s = format(n, 'o')
	ans = ''
	for i in range(len(s)): ans += dic[s[i]]
	print(ans) 



Measured memory_bytes: 5624
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;



int main(){
    int n, y;
    cin >> n >> y;
    bool ok = true;
    for(int i = 0; i <= n; i++){
        for (int j = 0; j <= n - i; j++){
            int k = n - i - j;
            int x = 10000*i + 5000*j + 1000*k;
            if (x == y){
                if(ok) {
                    cout << i << " " << j << " " << k << "\n";
                    ok = false;
                }
            }   
        }
    }
    if (ok) cout << "-1 -1 -1" << "\n";
}


Measured memory_bytes: 256
S = list(input())
S_o = []
S_e = []
for i in range(len(S)):
    if i%2 == 0:
        S_e.append(S[i])
    elif i%2 == 1:
        S_o.append(S[i])
if ('R' not in set(S_o)) and ('L' not in set(S_e)):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
s=list(input())

a=s.count(s[0])
b=s.count(s[1])
c=s.count(s[2])
d=s.count(s[3])

s=list(set(s))
#print(s)
ans1=0
if (a==3) or (b==3) or (c==3) or (d==3):
    #print("No")
    ans1=-1
if len(s)==2:
    #print("Yes")
    ans1=+1
else:
    ans1=-1
    #print("No")

if ans1==1:
    print("Yes")
else:
    print("No")

#print(a)
#print(b)
#print(c)
#print(d)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
     
    using namespace std;
     
    const int MaxN = 1e5 + 15;
     
    int n, h;
     
    pair<int, int> a[MaxN];
    long long c[MaxN];
     
    int main()
    {
        ios_base :: sync_with_stdio(false);
        cin.tie(NULL);
     
        cin >> n >> h;
     
        int mx = 0;
     
        for(int i = 1; i <= n; ++i)
        {
            cin >> a[i].second >> a[i].first;
            mx = max(mx, a[i].second);
        }
        sort(a + 1, a + n + 1);
        for(int i = n; i; --i)
            c[i] = c[i + 1] + a[i].first;
     
        long long ans = 1e9;
     
        for(int i = n + 1; i; --i)
        {
            if(c[i] >= h)
                ans = min(ans, n - i + 1ll);
            else
                ans = min(ans, n - i + 1 + (h - c[i]) / mx + ((h - c[i]) % mx ? 1 : 0));
        }
     
        cout << ans << '\n';
        return 0;
    }

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<tuple>
#include<iomanip>
#define int long 
using namespace std;

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

Measured memory_bytes: 1792
from collections import Counter
n,k=map(int,input().split())
A=list(map(int,input().split()))
s=len(set(A))
C=Counter(A).most_common()
if s>k:
	for i in range(k):
		n-=C[i][1]
	print(n)
else:
	print(0)

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

using namespace std;
int X,Y;
int S[4000];
int main()
{
  cin>>X>>Y;
  bool ans=true;
  if(Y%2!=0)ans=false;
  if(4*X>=Y&&2*X<=Y){

  }else{

    ans=false;
  }
  if(ans){
    cout<<"Yes";
  }else{
    cout<<"No";
  }
  return 0;
}





Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;

class MaxFlow {
	struct edge {
		int to, cap, rev;
		edge(int to_, int cap_, int rev_) : to(to_), cap(cap_), rev(rev_) {};
	};

	int V;
	vector<vector<edge>> G;
	vector<int> level;
	vector<int> iter;

	void BFS(int s) {
		fill(level.begin(), level.end(), -1);
		queue<int> que;
		level[s] = 0;
		que.push(s);
		while (!que.empty()) {
			int v = que.front(); que.pop();
			for (size_t i = 0; i < G[v].size(); i++) {
				edge &e = G[v][i];
				if (e.cap > 0 && level[e.to] < 0) {
					level[e.to] = level[v] + 1;
					que.push(e.to);
				}
			}
		}
	}

	int DFS(int v, int t, int f) {
		if (v == t) return f;
		for (int &i = iter[v]; i < (int)G[v].size(); i++) {
			edge &e = G[v][i];
			if (e.cap > 0 && level[v] < level[e.to]) {
				int d = DFS(e.to, t, min(f, e.cap));
				if (d > 0) {
					e.cap -= d;
					G[e.to][e.rev].cap += d;
					return d;
				}
			}
		}
		return 0;
	}

public:
	MaxFlow(int _V) : V(_V), G(_V), level(_V), iter(_V) {}
	void add(int from, int to, int cap) {
		G[from].push_back(edge(to, cap, G[to].size()));
		G[to].push_back(edge(from, 0, G[from].size() - 1));
	}
	int Dinic(int s, int t) {
		int flow = 0;
		while (true) {
			BFS(s);
			if (level[t] < 0) return flow;
			fill(iter.begin(), iter.end(), 0);
			int f;
			while ((f = DFS(s, t, INF)) > 0) {
				flow += f;
			}
		}
	}
};


int main()
{
	char c;
	int H, W;
	cin >> H >> W;
	MaxFlow mf(H + W + 2);
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			cin >> c;
			if (c == 'o') {
				mf.add(i, H + j, 1);
				mf.add(H + j, i, 1);
			}
			else if (c == 'S') {
				mf.add(H + W, i, INF);
				mf.add(H + W, H + j, INF);
			}
			else if (c == 'T') {
				mf.add(i, H + W + 1, INF);
				mf.add(H + j, H + W + 1, INF);
			}
		}
	}
	int res = mf.Dinic(H + W, H + W + 1);
	cout << (res >= INF ? -1 : res) << endl;
	return 0;
}


Measured memory_bytes: 896
#include <iostream>

using namespace std;

int main()
{
	int N;
	for(;cin>>N, N;)
	{
		int sum = 0;
		N /= 4;
		for (;N-->0;) { int c; cin >> c, sum += c; }
		cout << sum << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main() 
{ 
int a,b;
 cin>>a>>b;
 if(a==b==1)
    cout<<"Draw";
     else if (a == 1 )
    {
        cout<<"Alice";
    
    }
        else if(b==1){
		
		
        cout<<"Bob";
       
		} 
    else if(a>b)
	{
	
	 cout<<"Alice";
	 
}
         else if(b>a){
		 
        cout<<"Bob"; 
        		 }
    
    

   return 0; 
} 

Measured memory_bytes: 3588
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
    string S;
    long long K;
    cin >> S >> K;
    if (K == 1) {
        cout << S[0] << endl;
        return 0;
    }
    long long i = 0;
    while (1) {
        if (S[i] == '1') {
            ++i;
        } else {
            break;
        }
    }
    if (i >= K) {
        cout << '1' << endl;
    } else {
        cout << S[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 256