akhauriyash/Code-Regression huggingface dataset:
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef int64_t ll;
typedef long double ld;
const ll INF=(1LL<<60);
const ld pi=acosl((ld)1);
const ll mod = 1000000007;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};

bool solve(){
  ll n,m;cin>>n>>m;
  vector<ll>x(m);
  rep(i,m)cin>>x[i];
  sort(all(x));

  if(n>=m){
    cout<<0<<endl;
    return false;
  }
  
  vector<ll>dis(m-1,0);
  rep(i,m-1){
    dis[i]=x[i+1]-x[i];
  }
  sort(all(dis),greater<ll>());
  ll ans=x.back()-x.front();
  rep(i,n-1)ans-=dis[i];
  cout<<ans<<endl;
  return false;
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout<<fixed;
	cout<<setprecision(30);
	return solve();
}


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

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

  int64_t a[3*N];
  for (int i = 0; i < 3*N; i++) cin >> a[i];

  sort(a, a + 3*N, greater<int64_t>());

  int64_t power[N];
  for (int i = 0; i < N; i++) power[i] = a[2*(i + 1) - 1];

  int64_t max_sum = 0;
  for (int i = 0; i < N; i++) max_sum += power[i];

  cout << max_sum << endl;
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define inlld(x) scanf("%lld", &x)
#define ind(x) scanf("%d", &x)
#define inlld2(x, y) scanf("%lld%lld", &x, &y)
#define inlld3(x, y, z) scanf("%lld%lld%lld", &x, &y, &z)
#define ind2(x, y) scanf("%d%d", &x, &y)
#define ind3(x, y, z) scanf("%d%d%d", &x, &y, &z)

const int N=2e5+5;
const int MOD=1e9+7;

typedef long long ll;
typedef long double ld;

using namespace std;

ll n, ans;

int main()
{
    inlld(n);
    for(ll a = 1; a <= n; a++) {
        ll here = n / a;
        ll toadd = (here*(here + 1) / 2) * a;
        ans += toadd;
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 3828
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

template <int64_t MOD>
class Modint {
  using Self = Modint<MOD>;

  int64_t m_value;

 public:
  explicit Modint(int64_t value) : m_value((value % MOD + MOD) % MOD) {}
  Self pow(int64_t e) const {
    if (e == 0) {
      return (Self)1;
    } else if (e % 2 == 0) {
      return ((*this) * (*this)).pow(e / 2);
    } else {
      return (*this).pow(e - 1) * (*this);
    }
  }
  Self inv() const { return pow(MOD - 2); }
  Self& operator=(const Self& rh) {
    m_value = rh.m_value;
    return *this;
  }
  Self operator-() const { return Self(-m_value); }
  Self operator+(const Self& other) const {
    return Self(m_value + other.m_value);
  }
  Self operator-(const Self& other) const {
    return Self(m_value - other.m_value);
  }
  Self operator*(const Self& other) const {
    return Self(m_value * other.m_value);
  }
  Self operator/(const Self& other) const { return (*this) * other.inv(); }
  Self& operator+=(const Self& rh) { return (*this) = (*this) + rh; }
  Self& operator-=(const Self& rh) { return (*this) = (*this) - rh; }
  Self& operator*=(const Self& rh) { return (*this) = (*this) * rh; }
  int64_t value() const { return m_value; }
};

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

  using Mint = Modint<998244353>;
  vector<vector<Mint>> dp(N + 1, vector<Mint>(S + 1, (Mint)0));

  rep(i, N) irep(j, S) {
    dp[i + 1][j] = dp[i][j];
    if (j - a[i] == 0) {
      dp[i + 1][j] += Mint(i + 1);
    } else if (j - a[i] > 0) {
      dp[i + 1][j] += dp[i][j - a[i]];
    }
  }

  Mint result = (Mint)0;
  rep(i, N) { result += (dp[i + 1][S] - dp[i][S]) * Mint(N - i); }
  cout << result.value() << endl;

  return 0;
}

Measured memory_bytes: 70784
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int aa[] = new int[n];
    for(int i = 0;i<n;i++){
      aa[i] = sc.nextInt();
    }
    Arrays.sort(aa);
    int a = 0;
    int b = 0;
    int count = 0;
    for(int i = n-1;i>=0;i--){
      if(count % 2 == 0){
        a += aa[i];
      }else{
        b += aa[i];
      }
      count++;
    }
    System.out.println(a-b);
  }
}


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

int main() {

    string S;
    cin >> S;

    if(S == "SUN") {
        cout << 7 << endl;
    } else if(S == "MON") {
        cout << 6 << endl;
    } else if(S == "TUE") {
        cout << 5 << endl;
    } else if(S == "WED") {
        cout << 4 << endl;
    } else if(S == "THU") {
        cout << 3 << endl;
    } else if(S == "FRI") {
        cout << 2 << endl;
    } else if(S == "SAT") {
        cout << 1 << endl;
    }


	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define debug(a) cout<<a<<endl
#define pii pair<ll,ll>
#define INF (int) 1e9+7
#define maxn 209
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,l;
    cin>>n>>l;
    int vet[maxn];
    int ori=0;
    for(int i=0;i<n;i++){
        ori+=l+i;
    }
    int ans=-1;
    int menordif=(int)1e9+7;
    for(int i=0;i<n;i++){
        int actans=0;
        for(int j=0;j<n;j++){
            if(j==i)continue;
            actans+=l+j;
        }
        if(abs(actans-ori)<menordif){
            menordif=abs(actans-ori);
            ans=actans;
        }
    }
    cout<<ans<<'\n';
    return 0;
}
///usar double sempre ou long double
///pensar em casos que coisas dao negativas
///N esquecer de limpar as coisas em quest de varios testes
///OLHAR A COMPLEXIDADE PRA VER SE N PASSA POR BRUTE FORCE OU BRUTE FORCE COM ALGUMAS OTIMIZACOES



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

ans = sum(b)

for i in range(n - 1):
  if a[(i + 1) % n] == a[i] + 1:
    ans += c[a[i] - 1]
    
print(ans)

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

int main()
{
	int k, s;
	cin >> k >> s;
	int x, y, z;
	int ans = 0;
	for (x = 0; x <= k; x++)
	{
		for (y = 0; y <= k; y++)
		{
			if (s - x - y >= 0 && s - x - y <= k)
			{
					ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include "stdio.h"
#include "iostream"
#include "string"
using namespace std;
int main(){
  string s;
  cin>>s;
  if(s=="abc"||s=="acb"||s=="bac"||s=="bca"||s=="cab"||s=="cba"){
    cout<<"Yes";
  }else{
    cout<<"No";
  }
  return 0;
}

Measured memory_bytes: 256
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N)]
CD=[list(map(int,input().split())) for j in range(M)]
for i in range(N):
    d=(10**8)*4
    ans=0
    for j in range(M):
        if abs(AB[i][0]-CD[j][0])+abs(AB[i][1]-CD[j][1])<d:
            d=abs(AB[i][0]-CD[j][0])+abs(AB[i][1]-CD[j][1])
            ans=j+1
    print(ans)

Measured memory_bytes: 3064
n = int(input())
d = [list(map(int, input().split())) for _ in range(n)]

exist = False
for i in range(n-2):
    for j in range(3):
        if d[i+j][0] != d[i+j][1]:
            break
    else:
        exist = True
if exist:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9176
#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int dight(int n){
  return n==0?1:int(log10(n))+1;
}
int dif(int a,int b){
  if(a<b) return b-a;
  else return a+b;
}
int m(char c){
  if(c=='I') return 1;
  else if(c=='V') return 5;
  else if(c=='X') return 10;
  else if(c=='L') return 50;
  else if(c=='C') return 100;
  else if(c=='D') return 500;
  else return 1000;
}
int main(){
  string s;
  while(cin>>s){
    int ans = 0,a[100],count=0;
    a[0] = m(s[0]);
    for(int i=1;i<s.size();i++){
      if(s[i]==s[i-1]) a[count] += m(s[i]);
      else{
	count++;
	a[count] = m(s[i]);
      }
    }
    if(count==0) ans = a[0];
    for(int i=1;i<=count;i++){
      if(a[i-1]>a[i]&&dight(a[i-1])>dight(a[i])){
	ans += a[i-1];
	if(i==count) ans += a[i];
      }
      else{
	ans += dif(a[i-1],a[i]);
	if(i+1==count) ans += a[i];
	i++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1224
import std.conv;
import std.stdio;
import std.array;
import std.range;
import std.string;
import std.algorithm;

void main()
{
	switch(readln().chomp()) {
	case "1 0 0" : writeln("Close"); break;
	case "0 1 0" : writeln("Close"); break;
	case "1 1 0" : writeln("Open"); break;
	case "0 0 1" : writeln("Open"); break;
	case "0 0 0" : writeln("Close"); break;
	default : stderr.writeln("Invalid Input"); break;
	}
}

Measured memory_bytes: 1064
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

ll N,M;

int main(){
    cin >> N >> M;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];
    rep(i,N-1) A[i+1] += A[i];
    rep(i,N) A[i] %= M;

    ll ans = 0;
    map<ll,ll> cnt;
    rep(i,N){
        ans += cnt[A[i]];
        if(A[i] == 0) ans++;
        cnt[A[i]]++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 4992
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()

int main() {
    long sum = 0;
    int cnt = 0;
    int pcs = 0;
    int val, p;
    char c;
    while(cin >> val >> c >> p) {
        sum += val * p;
        cnt++;
        pcs += p;
    }
    cout << sum << endl;
    cout << round((double) pcs / cnt) << endl;
    return 0;
}

Measured memory_bytes: 1248
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define print(x) cout<<(x)<<'\n'
#define print_vec(v) rep(i,v.size()){if(i!=0)cout<<" ";cout<<v[i];}cout<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<'\n'
#define pb push_back
#define mp make_pair
#define MOD 1000000007 //10^9+7
#define fi first
#define sc second
using ll=long long;
using pi=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
using vstr=vector<string>;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
void yes(bool c) { if (c)print("Yes"); else print("No"); };

void solve() {
    ll x; cin >> x;
    ll ans = (x / 11) * 2;
    x %= 11;
    if(x>=7) ans += 2;
    else if(x>=1) ans += 1;
    print(ans);
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
	cout<<fixed<<setprecision(20);
    //int q; cin >> q;
	//while (q--)
		solve();
    return 0;
}


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

bool isEvenString(string s) {
    int size = s.size();
    if (size % 2 != 0) {
        //cout << "Size is Not Even\n";
        return false;
    }
    for (int i = 0; i < size/2; i++)
    {
        if (s[i] != s[size/2 + i]) {
            return false;
        }
    }
    return true;
}

int main() {
    string s; cin >> s;
    while (s.size() > 0)
    {
        s.pop_back();
        // cout << s << endl;
        if (isEvenString(s))
        {
            cout << s.size() << endl;
            return 0;
        }
    }
    cout << s.size() << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
from collections import deque

N, M = tuple(map(int, input().split()))
adj = [[] for n in range(N)]

for _ in range(M):
    inp = tuple(map(int, input().split()))
    adj[inp[0]].append(inp[1])
    adj[inp[1]].append(inp[0])

unsearched = set(range(N))
colors = {n:-1 for n in range(N)}
color = -1

for n in range(N):
    if colors[n] != -1:
        continue
    color += 1
    start = n
    
    que = deque([start])
    while len(que):
        q = que.pop()
        next_ = [i for i in adj[q] if colors[i] == -1]
        que.extendleft(next_)
        colors[q] = color
    
Q = int(input())

for i in range(Q):
    question = tuple(map(int, input().split()))
    if colors[question[0]] == colors[question[1]]:
        print("yes")        
    else:
        print("no")

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

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

  set<pair<int64_t,vector<int>>> S;
  S.insert(make_pair(7,vector<int>({1,0,0})));
  S.insert(make_pair(5,vector<int>({0,1,0})));
  S.insert(make_pair(3,vector<int>({0,0,1})));
  int count=1;
  while(count<9){
    for(auto s:S){
      if(s.second[0]+s.second[1]+s.second[2]==count){
      S.insert(make_pair(s.first+7*pow(10,count),vector<int>({s.second[0]+1,s.second[1],s.second[2]})));
      S.insert(make_pair(s.first+5*pow(10,count),vector<int>({s.second[0],s.second[1]+1,s.second[2]})));
      S.insert(make_pair(s.first+3*pow(10,count),vector<int>({s.second[0],s.second[1],s.second[2]+1})));
    }
    }
    ++count;
  }


  int ans=0;
  for(auto s:S){
  if(s.first>N){break;}
    else{
      if(s.second[0]*s.second[1]*s.second[2]!=0){
      ++ans;}
    }
  }

  cout<<ans<<endl;
}

Measured memory_bytes: 3456
from collections import deque

h, w = [int(i) - 1 for i in input().split()]
ans = 0
maze = []
for i in range(h + 1):
    s = list(input())
    maze.append(s)
    ans += s.count(".")

pos = deque([[0, 0, 0]])

while pos:
    y, x, b = pos.popleft()
    if y == h and x == w:
        print(ans - b - 1)
        exit()
    for ny, nx in [[1, 0], [-1, 0], [0, 1], [0, -1]]:
        if 0 <= y + ny <= h and 0 <= x + nx <= w and maze[y + ny][x + nx] == ".":
            pos.append([y + ny, x + nx, b + 1])
            maze[y + ny][x + nx] = "#"
print(-1)


Measured memory_bytes: 73700
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner scan_ = new Scanner(System.in);
        int a_ = scan_.nextInt();
        int b_ = scan_.nextInt();
        int c_ = scan_.nextInt();
        int[]ints = {a_ , b_ , c_};
      Arrays.sort(ints);
      System.out.println(ints[0] + " " + ints[1] + " " + ints [2]);
    }
}



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

using namespace std;

int N;
int a[100];

void solve() {
  int swap_cnt = 0;

  for (int i = 0; i < N; i++) {
    int mini = i;
    for (int j = i; j < N; j++) {
      if(a[j] < a[mini]) {
        mini = j;
      }
    }
    if(mini != i) {
      swap_cnt++;
      swap(a[i],a[mini]);
    }
  }

  for (int i = 0; i < N; i++) {
    cout << a[i] << (i == N-1 ? "\n" : " ");
  }
  cout << swap_cnt << endl;
}

int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }

  solve();
}



Measured memory_bytes: 3092
n,m=map(int,input().split())
s=[]
for i in range(m):
    x=list(map(int,input().split()))
    s.append(x)
p=list(map(int,input().split()))

ans=0

for i in range(2**n):
    pat=[]
    t=0
    for j in range(n):
        if (i>>j)&1:
            pat.append(True)
        else:
            pat.append(False)
    for k in range(m):
        cnt=0
        for l in s[k][1:]:
            if pat[l-1]:
                cnt+=1
        if cnt%2==p[k]:
            t+=1
    if t==m:
        ans+=1

print(ans)

Measured memory_bytes: 3064
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include<iostream>
using namespace std;
int a[100][100],sum,n;
int b[100];
int c[100];
int vis[100];
int dfs(int x)
{
     int i,j;
     vis[x]=1;
     for(i=1;i<=n;i++)
     {
          if(a[x][i]==1&&vis[i]==0)
          {
               sum++;
               dfs(i);
          }
     }
}
int main(void)
{
     int i,j,k=0,m,x,y;
     scanf("%d%d",&n,&m);
     memset(vis,0,sizeof(vis));
     memset(a,0,sizeof(a));
     for(i=0;i<m;i++)
     {
          scanf("%d%d",&x,&y);
          b[i]=x;
          c[i]=y;
          a[x][y]=a[y][x]=1;
     }
     for(i=0;i<m;i++)
     {
          a[b[i]][c[i]]=a[c[i]][b[i]]=0;
          sum=1;
          dfs(1);
          if(sum!=n)
               k++;
          a[b[i]][c[i]]=a[c[i]][b[i]]=1;
          memset(vis,0,sizeof(vis));
     }
     printf("%d\n",k);
     return 0;
}


Measured memory_bytes: 256
n = int(input())
w = [str(input()) for _ in range(n)]
set_w = set(w)
checker = True
if len(set_w) == n:
    for i in range(n-1):
        if w[i][-1] == w[i+1][0]:
            continue
        else:
            checker = False
            break
    if checker:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Measured memory_bytes: 3064
# E - Red and Green Apples

X, Y, A, B, C = map(int, input().split())
P = list(int(x) for x in input().split())
Q = list(int(x) for x in input().split())
R = list(int(x) for x in input().split())

P.sort(reverse=True)
Q.sort(reverse=True)

ans = []
ans.extend(P[0:X])
ans.extend(Q[0:Y])
ans.extend(R)
ans.sort(reverse=True)

print(sum(ans[0:(X+Y)]))

Measured memory_bytes: 22560
#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=5e18;

int main() {
  ll n;
  cin >> n;
  vec a(n);
  for(ll i=0;i<n;i++) {
    cin >> a[i];
  }
  ll ans=0;
  while(1) {
    ll count=0;
    for(ll i=0;i<n;i++) {
      count+=a[i]/n;
    }
    for(ll i=0;i<n;i++) {
      a[i]=a[i]%n+count-a[i]/n;
    }
    ans+=count;
    if(count==0) break;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main() { int a,b,i,j; while(1) { scanf("%d%d",&a,&b); if(a==0&&b==0){break;} for(i=1;i<=a;i++) { for(j=1;j<=b;j++) { if(j%2==1) { if(i%2==1)printf("#"); else printf("."); } else { if(i%2==1)printf("."); else printf("#"); } } printf("\n"); } printf("\n"); } return 0; } 


Measured memory_bytes: 2056
using System;

namespace AOJ
{
  public class Data
  {
    public int Value { get; set; }
    public Data Next { get; set; }
  }

  public class Stack
  {
    Data Head;

    public void Push(int value)
    {
      Data data = new Data();
      data.Value = value;
      data.Next = this.Head;
      this.Head = data;
    }
    public int Pop()
    {
      int value = this.Head.Value;
      this.Head = this.Head.Next;

      return value;
    }

  }
  class Program
  {
    static void Main()
    {
      string[] data = Console.ReadLine().Split(' ');

      int n = data.Length;
      Stack stack = new Stack();

      int a, b;
      for (int i = 0; i < n; i++)
      {
        switch (data[i])
        {
          case "+":
            a = stack.Pop();
            b = stack.Pop();
            stack.Push(a + b);
            break;
          case "-":
            a = stack.Pop();
            b = stack.Pop();
            stack.Push(b - a);
            break;
          case "*":
            a = stack.Pop();
            b = stack.Pop();
            stack.Push(a * b);
            break;
          default:
            stack.Push(int.Parse(data[i]));
            break;
        }
      }
      Console.WriteLine(stack.Pop());
    }
  }
}

Measured memory_bytes: 9204
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>
#include <cassert>
#include <bitset>

using namespace std;

/* template */

using ll = long long;

void debug_out() { std::cout << std::endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "debug: "; debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

#define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define rrep(i, a, n) for (int i = ((int)(n-1)); i >= (int)(a); i--)
#define Rep(i, a, n) for (long long i = (long long)(a); i< (long long)(n); i++)
#define RRep(i, a, n) for (long long i = ((long long)(n-1ll)); i>=(long long)(a); i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}

struct Edge{
    int to;
    ll weight;
    Edge(int t, ll w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    ll weight;
    edge(int f,int t,ll w) : from(f), to(t), weight(w){ }
};


using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

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

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

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

bool isPalindrome(string s){
    string t = s;
    reverse(all(t));
    return s==t;
}

constexpr ll LNF = 1LL<<60;

constexpr int INF = 1e9+7;

const double PI=3.14159265358979323846;


vector<int> dx = {-1,0,1,0,-1,1,-1,1};
vector<int> dy = {0,-1,0,1,1,-1,-1,1};

/* template */

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll h,w; cin >> h >> w;
    ll ans = LNF;
    if(h%3==0){
        ans = 0;
    } else{
        chmin(ans,w);
    }
    if(w%3==0){
        ans = 0;
    } else{
        chmin(ans,h);
    }
    ll x = h/2;
    ll y = (h+1)/2;
    Rep(i,0,w){
        ll p = max(y*i,h*(w-i));
        ll q = min(x*i,h*(w-i));
        chmin(ans,p-q);
    }
    x =w/2;
    y = (w+1)/2;
    Rep(i,0,h){
        ll p = max(y*i,w*(h-i));
        ll q = min(x*i,w*(h-i));
        chmin(ans,p-q);
    }
    cout << ans << endl;
} 

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <limits>
#include <map>
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define IREP(i,j,n) for(int (i)=(j);(i)<(n);(i)++)
#define INF numeric_limits<double>::infinity()
constexpr long MOD = 1e9 + 7;
using namespace std;

bool cmp(string s, string t) {
    bool f = true;
    REP(i,s.size()) {
        if (s[i] != '?' && s[i] != t[i]) f = false;
    }
    return f;
}

int main() {
    string s, t;
    cin >> s >> t;
    if (s.size() < t.size()) {
        cout << "UNRESTORABLE" << endl;
        return 0;
    }
    for (int i = s.size() - t.size(); i >= 0; i--) {
        if (cmp(s.substr(i,t.size()),t)) {
            REP(j,i) {
                if (s[j] == '?') cout << "a";
                else cout << s[j];
            }
            REP(j,t.size()) cout << t[j];
            for (int j = i + t.size(); j < s.size(); j++) {
                if (s[j] == '?') cout << "a";
                else cout << s[j];
            }
            cout << endl;
            return 0;
        }
    }
    cout << "UNRESTORABLE" << endl;
}


Measured memory_bytes: 256
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

int compare_f(const void *a, const void *b) {
	return *((int64_t *)a) < *((int64_t *)b) ? -1 : 1;
}

int compare_f2(const void *a, const void *b) {
	return *((uint64_t *)a) > *((uint64_t *)b) ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
	size_t result = 1;

	for (size_t i = 0; i < r; i++) {
		result *= n - i;
		result /= i + 1;
	}

	return result;
}

static uint64_t combU64(const uint64_t n, const uint64_t r) {
	uint64_t result = 1;

	for (uint64_t i = 0; i < r; i++) {
		result *= n - i;
		result /= i + 1;
	}

	return result;
}

static uint64_t gcd(uint64_t m, uint64_t n)
{
	uint64_t temp;

	while (m%n != 0) {
		temp = n;
		n = m % n;
		m = temp;
	}

	return n;
}

int main(void) {
	size_t A, B, C, D;

	scanf("%zu %zu %zu %zu", &A, &B, &C, &D);

	printf("%zu\n", MAX(A*B, C*D));

	return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <string.h>

int main(){
  int X,Y;
  int ans=0;
  scanf("%d %d",&X,&Y);
  if(X<4) ans+=100000*(4-X);
  if(Y<4) ans+=100000*(4-Y);
  if(X==1 && Y==1) ans+=400000;
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <cassert>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <vector>

using namespace std;


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin>>n;
    cout<<n*n;
}

Measured memory_bytes: 256
#define M 32768
p[M+1];main(i,j,n){p[1]=1;for(;i<=M;i++)if(!p[i])for(j=i*2;j<=M;j+=i)p[j]=1;for(;scanf("%d",&n),n;printf("%d\n",j))for(i=2,j=0;i<=n/2;i++)if(!p[i]&&!p[n-i])j++;return 0;}

Measured memory_bytes: 0
#include<stdio.h>
int main(){
  int n,x,i,j,k=1,a=0;
  while(1){
    scanf("%d %d",&n,&x);
    if(n==0&&x==0)break;
    for(i=1;i<=n;i++){
      for(j=i+1;j<=n;j++){
	for(k=j+1;k<=n;k++){
	  if(i!=j&&j!=k&&k!=i){
	    if(i+j+k==x){
	      a++;
	    }
	  }
	}
      }
    }
    printf("%d\n",a);
    a=0;
  }
  return 0; 
}
  



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

const vector<int> s={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

int main(){
  int K;
  cin >> K;
  --K;
  cout << s[K] << endl;
}

Measured memory_bytes: 3624
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
typedef pair<int,int > P;

bool Less(P a,P b)
{
  return a.second> b.second;
}
int main()
{
  vector<P> qu;
  int a,b;
  for(;scanf("%d,%d",&a,&b);)
    {
      if(a==0&&b==0)
	break;
      qu.push_back(P(a,b));
    }
  sort(qu.begin(),qu.end(),Less);
  int count=1;
  map<int,int> rank;
  for(int i=0;i<qu.size();i++)
    {
      if(i!=0 && qu[i-1].second!=qu[i].second)
	count++;
      rank[qu[i].first]=count;
    }
  /*
  for(int i=0;i<qu.size();i++)
    {
      printf("%d %d rank:%d\n",qu[i].first,qu[i].second,rank[qu[i].first]);
    }
  */
  for(;~scanf("%d",&a);)
    {
      printf("%d\n",rank[a]);
    }
}

Measured memory_bytes: 1036
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

using static Input;
using static Util;
class Program
{
    static int[] N;
    static void INPUT()
    {
        NextInt();
        N = LineInt();
    }
    static void OUT()
    {
        var b = new bool[8];
        var c = 0;
        foreach (var r in N)
        {
            if (r >= 3200)
                c++;
            else
                b[r / 400] = true;
        }

        var n = b.Where(__ => __).Count();
        Console.WriteLine(Math.Max(1,n));
        Console.WriteLine(n + c);
    }
    static void Main(string[] args)
    {
#if DEBUG  
        TESTINPUT();
#else
        INPUT();
#endif
        OUT();
    }

    static void TESTINPUT()
    {
       // N = 1000003;
    }

}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

class Util
{
}




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

typedef struct{int color; int point;}QUEUE;
 
int N, C;
vector<vector<int>> D(31, vector<int>(31));
vector<vector<int>> grid(3);
vector<priority_queue< QUEUE, vector<QUEUE>, std::greater<QUEUE> >> que(3);
int pat[6][3] = {{0, 1, 2},{0, 2, 1},{1, 0, 2},{1, 2, 0},{2, 0, 1},{2, 1, 0}};

bool operator> (const QUEUE &que1, const QUEUE &que2){ return que1.point > que2.point; }
 
int main(void){
    
    cin >> N >> C;
    for(int i = 1; i <= C; ++i){ for(int j = 1; j <= C; ++j){ cin >> D[i][j]; }}
    for(int i = 1; i <= N; ++i){
        for(int j = 1; j <= N; ++j){
            int num, mod = (i + j) % 3;
            cin >> num;
            grid[mod].push_back(num);
        }
    }
    
    QUEUE buf;
    for(int c = 1; c <= C; ++c){
        buf.color = c;
        for(int m = 0; m < 3; ++m){
            int p = 0;
            for(int i = 0; i < grid[m].size(); ++i) p += D[grid[m][i]][c];
            buf.point = p, que[m].push(buf);
        }
    }
    
    int result = INT_MAX;
    auto v = que;
    for(int i = 0; i < 6; ++i){
        int a, b, p, sum = 0;
        
        p = pat[i][0];
        sum += que[p].top().point;
        a = que[p].top().color;
        
        p = pat[i][1];
        while(que[p].top().color == a) que[p].pop();
        sum += que[p].top().point;
        b = que[p].top().color;
        
        p = pat[i][2];
        while(que[p].top().color == a || que[p].top().color == b) que[p].pop();
        sum += que[p].top().point;
        
        result = min(result, sum);
        que = v;
    }
    
    cout << result << endl;
    
    return 0;
    
}

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

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

    vector<int> a(n+1);
    vector<int> b(n+1);
    for(int i = 1; i <= n; i++){
        cin>>a[i];
    }


    vector<int> ans;
    
    for(int i = n; i>0; i--){
        int t = a[i];
        for(int j = i; j <= n; j+=i){
            t^=b[j];
        }
        b[i] = t;
        if(t) ans.push_back(i);
    }
    cout<<(int)ans.size()<<endl;
    for(int i = 0; i < (int)ans.size(); i++) cout<<ans[i]<<" ";
}


Measured memory_bytes: 3064
# Parallelism
for _ in range(int(input())):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().split())
    if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < 1e-10:
        print('YES')
    else:
        print('NO')


Measured memory_bytes: 7612
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
#include <random>
#include <cstdint>
#include <bitset>
#include <iomanip>
#include <utility>
#include<map>
#include<functional>
#include<climits>
#include<regex>
#include<numeric>
using namespace std;
typedef long long ll;
const int mod = 1000000007;

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



Measured memory_bytes: 256
#include<cstdio>
const long long mod = 1e9+7;
long long f[100005], invf[100005];
int a[100005];
int vis[100005];

long long power(long long a,long long b){
    long long res = 1;
    while(b){
        if(b%2) res = res*a%mod;
        a = a*a%mod;
        b /= 2;
    }
    return res;
}

long long inv(long long u){ return power(u,mod-2); }

void preWork(int n){
    f[0] = invf[0] = 1;
    for(int i = 1; i <= n; i++){
        f[i] = f[i-1]*(long long)i%mod;
        invf[i] = inv(f[i]);
    }
}

long long comb(int n,int m){
    if(m>n || m<0 || n<0) return 0;
    else return f[n]*invf[m]%mod*invf[n-m]%mod;
}

int main(){
    preWork(100001);
    int n;
    scanf("%d",&n);
    int find = -1;
    for(int i = 1; i <= n+1; i++){ 
        scanf("%d",&a[i]);
        if(!vis[a[i]]) vis[a[i]] = 1;
        else find = a[i];
    }
    int l = -1, r = -1;
    for(int i = 1; i <= n+1; i++){
        if(a[i]==find){
            if(l==-1) l = i;
            else r = i;
        }
    }
    int mid = r-l-1;
    for(int i = 1; i <= n+1; i++){
        if(i!=1){
            long long ans = comb(n-1,i)+comb(n-1,i-2)+2ll*comb(n-1,i-1)%mod-comb(n-1-mid,i-1);
            ans %= mod;
            if(ans<0) ans += mod;
            printf("%lld\n",ans);
        }
        else printf("%d\n",n);
    }
    
    return 0;
}


Measured memory_bytes: 4056
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        if (a == b){
            System.out.println(2 * a);
        } else {
            if (a > b){
                System.out.println(2 * a - 1);
            }else {
                System.out.println(2 * b - 1);
            }
        }
    }
}

Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,b,n) for(int i=b;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
const int mod=1e9+7;
ll a[200005];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;cin>>n>>k;
    rep(i,200005)a[i]=0;
    ll ss=0;
    ll tt=0;
    REP(i,1,n+2){
        ss+=i-1;
        tt+=n+1-i;
        a[i]=tt-ss+1;
    }
    ll tot=0;
    REP(i,k,n+2){
      tot+=a[i];
      tot%=mod;
    }
    cout<<tot<<endl;
    return 0;
}


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

int main() {
  char A;
 cin >> A;
 
  if(A== 'a'  || A=='i' || A=='u' || A=='e' || A=='o'){
  cout<<"vowel" <<endl;
  }
  else{
  cout<<"consonant" <<endl;
  }
}


Measured memory_bytes: 384
h,w = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
l = []
for i,m in enumerate(a,1):
    l += [i]*m
for i in range(h):
    k = l[:w]
    l = l[w:]
    if i&1:
        k.reverse()
    print(*k)


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

const int N = 1e6 + 100;

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++) {
        if(s[i] == '?') s[i] = 'D';
    }
    int ans = 0;
    for(int i = 0; i < s.size(); i++) {
        ans += (s[i] == 'D');
    }
    for(int i = 0; i+1 < s.size(); i++) {
        ans += (s[i] == 'P' && s[i+1] == 'D');
    }
    cout << s << endl;

    return 0;
}



Measured memory_bytes: 3768
from sys import stdin
n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
point = 0
for i in range(n):
    if i%2 == 0:
        point += li[i]
    else:
        point -= li[i]
lin = [point]
for i in range(n-1):
    lin.append((li[i]-lin[i]//2)*2)
print(*lin)

Measured memory_bytes: 14032
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
namespace mp = boost::multiprecision;
#define ll long long
#define cpp mp::cpp_int
#define dequeue deque
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = 1; i <= n; i++)
#define drep(i, n) for(int i = n-1; i >= 0; i--)
#define srep(i, s, t) for (int i = s; i < t; i++)
#define vi vector<int>
#define P pair<ll, ll>
int mod = 1'000'000'000 + 7;
struct edge {
	int to;
	ll cost;
};

void COME_LET_THE_GAMES_BEGIN() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << setprecision(20);
}
void reverse(string* s) {
	reverse((*s).begin(), (*s).end());
}
int main() {
	COME_LET_THE_GAMES_BEGIN();
	int N, X;
	cin >> N >> X;
	int D = 0;
	int ans = 1;
	rep(i, N) {
		int L;
		cin >> L;
		D += L;
		if (D <= X) {
			ans++;
		}
		else {
			cout << ans << endl;
			return 0;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <utility>

using namespace std;

const int MAX_N = 40;
pair<char, int> cardB[MAX_N], cardS[MAX_N];
int N;
pair<char, int> pattern[MAX_N];

void show(pair<char, int> *C) {
	for (int i = 0; i < N; i++) {
		printf("%c%d", C[i].first, C[i].second);
		if (i != N - 1) {
			printf(" ");
		}
	}
	printf("\n");
}

void input() {
	/*char c;
	scanf("%d", &N);
	c = getc(stdin);
	for (int i = 0; i < N; i++) {
		scanf("%c%d", &cardB[i].first, &cardB[i].second);
		c = getc(stdin);
		cardS[i] = cardB[i];
		pattern[i] = cardB[i];
	}*/
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> cardB[i].first >> cardB[i].second;
		cardS[i] = cardB[i];
		pattern[i] = cardB[i];
	}
}

void BubbleSort(pair<char, int> *C, int n) {
	pair<char, int> temp;

	for (int i = 0; i < n; i++) {
		for (int j = n - 1; j >= 0; j--) {
			if (C[j].second < C[j - 1].second) {
				temp = C[j];
				C[j] = C[j - 1];
				C[j - 1] = temp;
			}
		}
	}
}

void SelectionSort(pair<char, int> *C, int n) {
	pair<char, int> temp;

	for (int i = 0; i < n; i++) {
		int minj = i;
		for (int j = i; j < n; j++) {
			if (C[j].second < C[minj].second) {
				minj = j;
			}
		}
		if (i != minj) {
			temp = C[i];
			C[i] = C[minj];
			C[minj] = temp;
		}
	}
}

void isStable(pair<char, int> *C) {
	bool f = true;

	for (int i = 0; i < N - 1; i++) {
		if (C[i].second == C[i + 1].second) {
			for (int j = 0; j < N; j++) {
				for (int k = 0; k < N; k++) {
					if (pattern[j] == C[i] && pattern[k] == C[i + 1]) {
						if (j > k) {
							f = false;
						}
					}
				}
			}
		}
	}
	if (f) {
		printf("Stable\n");
	}
	else {
		printf("Not stable\n");
	}
}

void solve() {
	input();
	BubbleSort(cardB, N);
	show(cardB);
	isStable(cardB);
	SelectionSort(cardS, N);
	show(cardS);
	isStable(cardS);
}

int main() {
	solve();
}

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

using namespace std;

#define ll long long

const ll mod  = 1e9 + 7;
const ll INF = 1e14;


void solve(){

    ll n; cin >> n;
    vector<ll> arr (n);
    for(ll& it : arr) cin >> it;
    vector<ll> dp (n, 0);
    for(ll i = 0; i < n; ++i)
        if(i - arr[i] >= 0) dp[i-arr[i]]++;
    ll ans = 0;
    for(ll i = 0; i < n; ++i)
        if(i + arr[i] < n) ans += dp[i+arr[i]];
    cout << ans;
}


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

    //int test; cin >> test;
    //for(int t = 1; t <= test; ++t){
        solve();    
    //}

	return 0;
}



Measured memory_bytes: 6380
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int MOD = 998244353;

int main() {
  int n, k;
  cin >> n >> k;
  vector<pair<int, int>> s(k);
  for (auto &e : s) {
    cin >> e.first >> e.second;
    e.second++;
  }

  vector<ll> dp(n + 2), d(2 * n + 2);
  d[1] = 1, d[2] = -1;
  for (int i = 1; i <= n; i++) {
    (dp[i] = dp[i - 1] + d[i]) %= MOD;
    for (auto e : s) {
      (d[i + e.first] += dp[i]) %= MOD;
      (d[i + e.second] += MOD - dp[i]) %= MOD;
    }
  }
  cout << dp[n] << endl;
}


Measured memory_bytes: 7996
#include<bits/stdc++.h>
#define ALL(c) (c).begin(),(c).end()
#define EACH(i,c) for(auto i=(c).begin();i!=(c).end();++i)
using namespace std;
#define int long long


void solve(long long N, long long T, std::vector<long long> c, std::vector<long long> t){
	int d = 100000;
	for(int i = 0; i < N; ++i) {
		if (t[i] <= T) {
			d = min(c[i], d);
		}
	}
	if (d == 100000) {
		cout << "TLE" << endl;
	} else {
		cout << d << endl;
	}
}

signed main(){
    long long N;
    scanf("%lld",&N);
    long long T;
    scanf("%lld",&T);
    std::vector<long long> c(N);
    std::vector<long long> t(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&c[i]);
        scanf("%lld",&t[i]);
    }
    solve(N, T, std::move(c), std::move(t));
    return 0;
}


Measured memory_bytes: 256
from heapq import heappush, heappop
import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
    M, N = map(int, readline().split())
    if M == N == 0:
        return False
    G = [[] for i in range(N)]
    INF = 10**18
    def solve(s, t, u):
        dist = [INF]*N
        dist[s] = 0
        que = [(0, s)]
        while que:
            cost, v = heappop(que)
            if dist[v] < cost:
                continue
            for e in G[v]:
                w = e[0]
                if cost + e[u] < dist[w]:
                    dist[w] = d = cost + e[u]
                    heappush(que, (d, w))
        return dist[t]
    for i in range(M):
        a, b, c, t = map(int, readline().split()); a -= 1; b -= 1
        G[a].append((b, c, t))
        G[b].append((a, c, t))
    K = int(readline())
    for i in range(K):
        p, q, r = map(int, readline().split())
        write("%d\n" % solve(p-1, q-1, r+1))
    return True
while solve():
    ...



Measured memory_bytes: 6364
#include <stdio.h>

int N;
int A[1000000]={0};

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

  for(int i=0;i<N;i++)
    printf("%d\n",A[i]);
}


Measured memory_bytes: 2512
from math import floor, ceil
S = input()
N = len(S)
ans = [0] * N

lastR = 0
r, l = 0, 0
skip = False
for i in range(N-1):
    if skip:
        skip = False
        continue
    if S[i] == "R" and S[i+1] == "L":
        ans[lastR] += ceil(l/2)
        ans[lastR+1] += floor(l/2)
        ans[i] += floor(r/2) + 1
        ans[i+1] += ceil(r/2) + 1
        r, l = 0, 0
        lastR = i
        skip = True
    else:
        if S[i] == "R":
            r += 1
        if S[i] == "L":
            l += 1

if S[i] == "R":
    r += 1
if S[i] == "L":
    l += 1
ans[lastR] += ceil(l/2)
ans[lastR+1] += floor(l/2)
print(*ans)


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

using namespace std;
/**
********************************************************************
******************* Author:Bisnu sarkar ****************************
********************************************************************
**/

#define ull            unsigned long long
#define ll             long long
#define vi             vector<int>
#define pb             push_back
#define mp             make_pair
#define pii            pair<int,int>
#define vit            vector<int> :: iterator
#define sit            set<int> :: iterator
#define vrit           vector<int> :: reverse iterator
#define ff             first
#define ss             second

#define what_is(x)     cerr << #x << " is " << x << endl;

///*....Debugger....*/

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it)
{
    cout << endl ;
}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << ' ' ;
    err(++it, args...);
}

int dx[8]= {1,0,-1,0,-1,-1,1,1};
int dy[8]= {0,1,0,-1,-1,1,-1,1};
int ini()
{
    int x;
    scanf("%d",&x);
    return x;
}
long long inl()
{
    long long x;
    scanf("%lld",&x);
    return x;
}

int set_1(int n,int pos){return n = (n | (1<<pos));}
int reset_0(int n,int pos){return n= n & ~(1<<pos);}
bool check_bit(int n,int pos){return n = n & (1<<pos);}

const int N = (int) 1e6 + 5;
const int M = (int) 1e9 + 7;
const double pi=2* acos(0.0);

int main()
{
  int a,b;

  cin>>a>>b;

  if(a<b)cout<<0<<endl;
  else{
    cout<<10<<endl;
  }


    return 0;
}


Measured memory_bytes: 256