akhauriyash/Code-Regression huggingface dataset:
N=int(input())
mylist=list(map(int,input().split()))
numberlist=[]

for i in range(1,N+1):
    numberlist.append(i)
mydic=dict(zip(mylist,numberlist))
#print(mydic)
#print(numberlist)
#print(mydic)
anslist=sorted(mydic.items())
#print(anslist)

for i in range(N):
    print(anslist[i][1],end=" ")

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

using namespace std;

int main(){

    // int a[]={56,25,67,88,100,61,55,67,76,55};
    int n;
    // n=10;
    cin >> n;
    int a[n];
    int b[n];
    int max=0;
    for(int i=0; i<n; ++i){
        cin >> a[i];
        b[i] = a[i];
        if(a[i]>max) max = a[i];
    }
    stable_sort(b,b+n);
    for(int i=0; i<n; ++i){
        if(a[i]==max){
            cout << b[n-2] << endl;
        }else{
            cout << b[n-1] << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3192
//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const int MOD=1e9+7;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

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

int a[10][10];
int board[10][10];
int b[110];

bool bingo() {
  REP(i, 3) {
    if (board[i][0] == 1 && board[i][1] == 1 && board[i][2] == 1) {
      return true;
    }
    if (board[0][i] == 1 && board[1][i] == 1 && board[2][i] == 1) {
      return true;
    }    
  }
  if (board[0][0] == 1 && board[1][1] == 1 && board[2][2] == 1) {
    return true;    
  }
  if (board[0][2] == 1 && board[1][1] == 1 && board[2][0] == 1) {
    return true;
  }
  return false;
}

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

  int n, k;
  REP(i, 3) {
    REP(j, 3) {
      cin >> a[i][j];
    }
  }
  cin >> n;
  REP(i, n) {
    cin >> b[i];    
  }
  REP(i, 3) {
    REP(j, 3) {
      REP(k, n) {
        if (a[i][j] == b[k]) {
          board[i][j] = 1;
        }
      }
    }
  }

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

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    vint s(n),r(n);
    rep(i,n) cin >> s[i] >> r[i];
    vp a(n);
    rep(i,n){
        a[i].F=s[i]+r[i];
        a[i].S=s[i]-r[i];
    }
    sort(all(a));

    int res=0, end=-1*INF;
    rep(i,n){
        if(a[i].S>=end){
            res++;
            end=a[i].F;
        }
    }
    //cout<<n-res<<endl;
    cout<<res<<endl;
}

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

using namespace std;
using ll = long long;

template <typename K,typename V>
using umap = unordered_map<K,V>;
template <typename V>
using uset = unordered_set<V>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define REP(i,n) for(int i=0;i<n;i++)
#define REPD(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define ALL(v) v.begin(),v.end()

#define INF 1'000'000'000'000 //10^12
#define MOD 1'000'000'007
bool range_validation(int y,int x,int h,int w){
    return y>=0 && y<h && x>=0 && x < w;
}
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int n ;
  cin >> n;
  int a[n];
  REP(i,n){
    cin >> a[i];
  }
  ll money = 1000;
  ll stock = 0;
  
  int idx = 0;
  int now ;
  while(idx < n){
    now = a[idx];
    int idx2 = idx + 1;
    while(idx2 < n && a[idx2] >= now){
      now = a[idx2];
      idx2++;
    }
    if(idx2 < n || a[idx2-1] > a[idx]){
      stock += money/a[idx];
      money = money - stock*a[idx];
      money += stock * a[idx2-1];
      stock = 0;
    }else{
      break;
    }
    idx = idx2;
  }
  
  cout << money << endl;
  
  return 0;
}


Measured memory_bytes: 3580
#include<iostream>
#include<string>
using namespace std;
int main(){
string x;
cin>>x;
if(x=="SUN") printf("7");
if(x=="MON") printf("6");
if(x=="TUE") printf("5");
if(x=="WED") printf("4");
if(x=="THU") printf("3");
if(x=="FRI") printf("2");
if(x=="SAT") printf("1");
return 0;
}

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

int main()
{
int a,b,c,d,e,k;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
scanf("%d",&e);

scanf("%d",&k);

     if(b-a > k) {printf(":(");return 0;}
     if(c-a > k) {printf(":(");return 0;}
     if(d-a > k) {printf(":(");return 0;}
     if(e-a > k) {printf(":(");return 0;}
     if(c-b > k) {printf(":(");return 0;}
     if(d-b > k) {printf(":(");return 0;}
     if(e-b > k) {printf(":(");return 0;}
     if(d-c > k) {printf(":(");return 0;}
     if(e-c > k) {printf(":(");return 0;}
     if(e-d > k) {printf(":(");return 0;}

  printf("Yay!");

    return 0;
}

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

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

  int v=1, tmp=1;
  rep(i, N){
    tmp = v*2;
    if(tmp-v>K) v += K;
    else v = tmp;
  }

  cout << v << endl;
}


Measured memory_bytes: 256
N, L = gets.chomp.split.map(&:to_i)

azi = Array.new(N)

N.times do |i|
  azi[i] = L + i
end

n_py = azi.inject(:+)
min = nil
min_i = nil
N.times do |i|
  eat_py = n_py - azi[i]
  abs = (n_py - eat_py).abs
  if (min.nil? || min > abs)
    min = abs
    min_i = i
  end
end

puts n_py - azi[min_i]

Measured memory_bytes: 1788
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>

#include <algorithm>
#include <numeric>
#include <cmath>

using namespace std;
typedef long long ll;
const long double PI = (acos(-1));
const long long MOD = 1000000007;

static const int  MAX_INT = std::numeric_limits<int>::max();
static const long MAX_LONG = std::numeric_limits<long>::max();
static const ll   MAX_LL = std::numeric_limits<long long>::max();

#define rep(i,n) REP(i,0,n)
#define REP(i,x,n) for(int i=x;i<n;++i)


///////////////////////////////////////////////////
// ------------------- utils ------------------- //
///////////////////////////////////////////////////
// change min/max
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; }

// initalisation of the binominal coefficient
void COMBinit(std::vector<long long>& fac, std::vector<long long>& finv, std::vector<long long>& inv, int n, int MOD) {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < n; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// binominal coefficient: nCk
// http://drken1215.hatenablog.com/entry/2018/06/08/210000
long long COMB(int n, int k, int MOD) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    std::vector<long long> fac(n + 1), finv(n + 1), inv(n + 1);
    COMBinit(fac, finv, inv, n + 1, MOD);
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

///////////////////////////////////////////////////
// ------------------- main -------------------- //
///////////////////////////////////////////////////
void Main() {
    ll S; cin >> S;
    if (S < 3) {
        cout << 0 << endl;
        return;
    }
    
    ll maxN = S / 3;
    ll cnt = 1;
    for (ll i = 2; i <= maxN; ++i) {
        ll slot = S - 3 * i;
        cnt = (cnt + COMB(slot + i - 1, i - 1, MOD)) % MOD;
    }

    cout << cnt << endl;
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout << std::fixed << std::setprecision(15);
    Main();

    double tmp;
    cin >> tmp;

    return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <fstream>
#include <queue>
#include <map>
#include <set>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef __int128 lll;
constexpr ll mod = 1000000007;

int n, k[2], a[200000][2], p, q;

queue<int> v;

int root(int node, int tr) {
    int c = node;
    while (a[c][tr] != -1) {
        v.push(c);
        c = a[c][tr];
    }
    while (!v.empty()) {
        a[v.front()][tr] = c;
        v.pop();
    }
    return c;
}

int main() {
    cin >> n >> k[0] >> k[1];
    for (int i = 0; i < n; i++) a[i][0] = a[i][1] = -1;
    for (int j = 0; j < 2; j++) {
        for (int i = 0; i < k[j]; i++) {
            cin >> p >> q;
            if (root(p - 1, j) != root(q - 1, j)) a[root(p - 1, j)][j] = root(q - 1, j);
        }
    }
    map<pair<int, int>, int> w;
    for (int i = 0; i < n; i++) w[make_pair(root(i, 0), root(i, 1))]++;
    for (int i = 0; i < n; i++) cout << w[make_pair(root(i, 0), root(i, 1))] << endl;
}

Measured memory_bytes: 13568
#include "bits/stdc++.h"

#ifdef PRINTERS
#include "printers.hpp"
using namespace printers;
#define tr(a)		cerr<<#a<<" : "<<a<<endl;
#else
#define tr(a)    
#endif

#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b)	for(int i=a;i<b;i++)
using namespace std;

void solve(){
	int N;
	cin>>N;
	vi temp(N);
	rep(i,0,N)cin>>temp[i],temp[i]--;
	int ans=0;
	rep(i,0,N){
		if(i!=temp[i])continue;
		if(i<N-1 and i==temp[i] and i+1==temp[i+1]){
			swap(temp[i],temp[i+1]);
			ans++;
		}
	}
	rep(i,0,N){
		if(i==temp[i])ans++;
	}
	cout<<ans;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
namespace FAST_IO
{
	template<typename T> void read(T &a)
	{
		a=0;
		int f=1;
		char c=getchar();
		while(!isdigit(c))
		{
			if(c=='-')
			{
				f=-1;
			}
			c=getchar();
		}
		while(isdigit(c))
		{
			a=a*10+c-'0';
			c=getchar();
		}
		a=a*f;
	}
	template <typename T> void write(T a)
	{
		if(a<0)
		{
			a=-a;
			putchar('-');
		}
		if(a>9)
		{
			write(a/10);
		}
		putchar(a%10+'0');
	}
	template <typename T> void writeln(T a)
	{
		write(a);
		puts("");
	}
}
int main()
{
	long long n, a, b, c, d, e;
	cin >> n >> a >> b >> c >> d >> e;
	cout << max((n+(a-1))/a,max((n+(b-1))/b,max((n+(c-1))/c,max((n+(d-1))/d,(n+(e-1))/e))))+4;
}

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

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

int h, w;
char s[25][25];
int vis[25][25];

int bfs(int x0, int y0){
	queue<int> qx, qy;
	qx.push(x0);
	qy.push(y0);
	memset(vis, 0, sizeof(vis));
	vis[x0][y0] = 1;
	while(!qx.empty()){
		int x = qx.front(); qx.pop();
		int y = qy.front(); qy.pop();
		for(int k = 0; k < 4; k++){
			int nx = x + dx[k];
			int ny = y + dy[k];
			if(nx < 0 || ny < 0 || nx >= h || ny >= w || s[nx][ny] == '#' || vis[nx][ny])continue;
			vis[nx][ny] = vis[x][y] + 1;
			qx.push(nx);
			qy.push(ny);
		}
	}
	int ans = 0;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			ans = max(ans, vis[i][j]);
		}
	}
	return ans - 1;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	cin>>h>>w;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			cin>>s[i][j];
		}
	}
	int ans = 0;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			if(s[i][j] != '#')ans = max(ans, bfs(i, j));
		}
	}
	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++)
const int mx = 100005;
int n, a[mx], b;
long long ans;
int main(){
	scanf("%d", &n);
	rep(i,n+1) scanf("%d", a+i);
	rep(i,n){
		scanf("%d", &b);
		if(a[i] + a[i+1] >= b){
			ans += b;
			a[i+1] = min(a[i] + a[i+1] - b, a[i+1]);
		}else{
			ans += a[i] + a[i+1];
			a[i+1] = 0;
		}
	}
	printf("%lld\n", ans);
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
const ll INF = 114514810;
const ll MOD = 1000000007;
const double EPS = 1e-8;
const double PI = acos(-1.0);
struct edge
{
	int to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
int dx[] = { -1, 0, 0, 1 }; int dy[] = { 0, -1, 1, 0 };
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
bool valid(int x, int y, int h, int w) { return (x >= 0 && y >= 0 && x < h&&y < w); }
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///


int main()
{
	int n, a;
	cin >> n;
	if (n == 0 || n == 2) a = 1;
	else if (n == 1) a = 2;
	else a = 0;
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 1164
s = list(input())
min = 10000
#print(s)
for i in range(1,len(s)-1):
    li = list(map(int,s[i-1:i+2]))
  #  print(li)
    num = li[0]*100+li[1]*10+li[2]
 #   print(num)
    if abs(753-num) < min:
        min = abs(753-num)

print(min)

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

int main(){
    int n, m;
    cin >> n >> m;
    if(m == 1){
        cout << "IMPOSSIBLE" << endl;
        return 0;
    }

    bool flag = false;
    vector<int> b, ans;
    for(int i = 0; i < m; i++){
        int x, y;
        cin >> x >> y;
        if(x == 1){
            b.push_back(y);
            flag = true;
        }
        if(y == n){
            ans.push_back(x);
            flag = true;
        }
    }

    sort(ans.begin(), ans.end());
    sort(b.begin(), b.end());
    decltype(ans)::iterator v1 = unique(ans.begin(), ans.end());
    decltype(b)::iterator v2 = unique(b.begin(), b.end());
    ans.erase(v1, ans.end());
    b.erase(v2, b.end());

    if(flag){
        for(int i = 0; i < b.size(); i++){
            auto result = find(ans.begin(), ans.end(), b[i]);
            if(result != ans.end()){
                cout << "POSSIBLE" << endl;
                return 0;
            }
            if(i > 25000){
                cout << "IMPOSSIBLE" << endl;
                return 0;
            }
        }
    }

    cout << "IMPOSSIBLE" << endl;

    return 0;
}

Measured memory_bytes: 1276
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <ctime>
#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=(n);i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define rsort(x) sort(all(x));reverse(all(x))
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
 
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

bool debug=false;
/*---------------------------------------------------*/

int main(){
  int a,b,c;
  cin>>a>>b>>c;
  cout<<((a<=c&&c<=b)?"Yes":"No")<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		bubbleSort(A, N);
		sc.close();
	}

	public static void bubbleSort(int[] A, int N) {
		int count = 0;
		for (int i = 0; i <= N; i++) {
			for (int j = N - 1; j >= i + 1; j--) {
				if (A[j] < A[j - 1]) {
					int tmp = A[j];
					A[j] = A[j - 1];
					A[j - 1] = tmp;
					count++;
				}
			}
		}
		for (int i = 0; i < N; i++) {
			if (i > 0) {
				System.out.print(" ");
			}
			System.out.print(A[i]);
		}
		System.out.printf("\n");
		System.out.println(count);
	}
}



Measured memory_bytes: 26364
// ALDS_1_2_C Stable Sort

#include <cstdio>
#include <array>
#define NMAX	36

struct trump{
	char	mark;
	int 	value;
};

void swap(std::array<trump, NMAX> &array, int a, int b){
	trump tmp;

	tmp = array[a];
	array[a] = array[b];
	array[b] = tmp;

	return;
}

void bubbleSort(std::array<trump, NMAX> &array, int N){
	bool is_sorted = false;
	for(int j=0 ; (j<=N-1)&&(!is_sorted) ; j++){
		is_sorted = true;
		for(int i=N-1 ; i>j ; i--){
			if(array[i].value < array[i-1].value){
				is_sorted = false;
				swap(array, i, i-1);
			}
		}
	}

	return;
}

void selectionSort(std::array<trump, NMAX> &array, int N){
	for(int i=0 ; i<N ; i++){
		int jmin = i;
		for(int j=i+1 ; j<N ; j++){
			if(array[jmin].value > array[j].value){
				jmin = j;
			}
		}
		if(jmin != i){
			swap(array, jmin, i);
		}
	}

	return;
}

int main(int argc, char *argv[]){
	int N;
	std::array<trump, NMAX> C;

	std::scanf("%d",&N);
	for(int i=0 ; i<N ; i++){
		std::scanf(" %c%d", &C[i].mark, &C[i].value);
	}

	std::array<trump, NMAX> C_bubble(C);
	std::array<trump, NMAX> C_selection(C);

	bubbleSort(C_bubble, N);
	selectionSort(C_selection, N);

	for(int i=0 ; i<N-1 ; i++){
		std::printf("%c%d ", C_bubble[i].mark, C_bubble[i].value);
	}
	std::printf("%c%d\n", C_bubble[N-1].mark, C_bubble[N-1].value);
	std::printf("Stable\n");

	for(int i=0 ; i<N-1 ; i++){
		std::printf("%c%d ", C_selection[i].mark, C_selection[i].value);
	}
	std::printf("%c%d\n", C_selection[N-1].mark, C_selection[N-1].value);

	bool is_stable = true;
	for(int i=0 ; i<N ; i++){
		if((C_bubble[i].mark != C_selection[i].mark) || (C_bubble[i].value != C_selection[i].value)){
			is_stable = false;
			break;
		}
	}

	if(is_stable){
		std::printf("Stable\n");
	}
	else{
		std::printf("Not stable\n");
	}

	return 0;
}



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

int main(void) {
	int i,j;
	char S[200],flag=0;
	scanf("%s",S);
	for(i=1;i<strlen(S);i++){
		for(j=0;j<(strlen(S)-i)/2;j++){
			if((strlen(S)-i)%2==1) break;
			if(S[j]!=S[(strlen(S)-i)/2+j])break;
			if(j==(strlen(S)-i)/2-1) flag=1;
		}
		if(flag==1) break;
	}
	printf("%d\n",strlen(S)-i);
	return 0;
}


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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int n;
  cin >> n;
  vint a(n);
  vint asum(n+1);
  rep(i, n) {
    cin >> a[i];
    asum[i+1] = asum[i]+a[i];
  }
  map<int, int> mp;
  int ans = 0;
  rep(i, n+1) {
    if(mp.count(asum[i])) ans += mp[asum[i]];
    mp[asum[i]]++;
  }
  cout << ans << endl;

  return 0;
}


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

int main () {
  int N, l, r; // 組数N、座り始めの席l、最後尾席rを定義
  int a = 0; // r-l+1(座る人数)をカウントするための変数
  cin >> N; // 組数を読み込む
  
  for (int i = 0; i < N; i++) {
    cin >> l >> r; // 1組目からlとrを繰り返し読み込む
    a += r - l + 1;
    
  }
  cout << a << endl; // 全員足し終わったら合計人数を出力
}

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


int main(){
    int H, W, A, B;
    cin >> H >> W >> A >> B;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (i < B && j < A) {
                printf("0");
            }
            else if (i >= B && j < A) {
                printf("1");
            }
            else if (i < B && j >= A) {
                printf("1");
            }
            else {
                printf("0");
            }
            
        }
        cout << "\n";
    }
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  double result=0;
  for(int i=1;i<=n;i++)
  {
    double a;
    cin>>a;
    result+=(1/a);
  }
  result=(1/result);
  cout<<setprecision(20)<<result<<endl;
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
	int a,b,c,d,e,k,mn,mx;
	cin>>a>>b>>c>>d>>e>>k;
	mn=min(a,min(b,min(c,min(d,e))));
	mx=max(a,max(b,max(c,max(d,e))));
	if(mx-mn>k){
		cout<<":(";
	}
	else 
	cout<<"Yay!";
}
//FELAROSSO 2019

Measured memory_bytes: 256
#ifdef ONLINE_JUDGE

#include "bits/stdc++.h"
using namespace std;

#define ui unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double

#define all(v) v.begin(), v.end()

#define speed ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

const ld PI = 3.1415926535897932384626;
ll MOD = 1000000007;
const ld EPS = 1e-9;
const int N = 3e5 + 7;

inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline ui setBits(ui v) { ui c; for(c = 0 ; v; ++c) v &= (v - 1); return c; }
inline bool isPowerOfTwo(ui v) { return (v && !(v & (v - 1))); }
ll power(ll base, ull exp, ll mod = MOD) { 
	ll res = 1; base %= mod; 
	while(exp) { 
		if(exp & 1) res = (res * base)%mod; 
		exp >>= 1; base = (base * base)%mod; 
	} 
	return res; 
}
ll modInv(ll a, ll mod = MOD) { 
	if(mod == 1) return 0; 
	ll x = 1, y = 0, m = mod; 
	while(a > 1) { 
		ll q = a/m, t = m; m = a%m; a = t; t = y; y = x - q * y; x = t; 
	} 
	if(x < 0) x += mod; 
	return x; 
}
inline ui iabs(int x) { ui y = x; return (y > 0) ? y : -y; }
inline ll add(ll a, ll b, ll mod = MOD) { ll res = (a%mod + b%mod)%mod; return res; }
inline ll sub(ll a, ll b, ll mod = MOD) { ll res = (a%mod - b%mod + mod)%mod; return res; }
inline ll mult(ll a, ll b, ll mod = MOD) { ll res = (a%mod * b%mod)%mod; return res; }
inline ll div(ll a, ll b, ll mod = MOD) { ll res = (a%mod * modInv(b, mod))%mod; return res; }

#else

#include "custom.h"
using namespace std;

#endif

void openf() {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif	
}

int getIndex(vector<ll>& barr, ll targ, int M) {
	int l = 0, r = M, ans = 0;
	while(l <= r) {
		int mid = l + (r - l)/2;
		if(barr[mid] <= targ) {
			ans = mid;
			l = mid + 1;
		}
		else {
			r = mid - 1;
		}
	}
	return ans;
}

int main() {
	speed;
	openf();
	int N, M, K, nbooks = INT_MIN, a;
	cin >> N >> M >> K;
	vector<ll> aarr(N + 1), barr(M + 1);
	for(int i = 1 ; i <= N ; ++i) {
		cin >> a;
		aarr[i] = a;
		aarr[i] += (i > 1) ? aarr[i - 1] : 0;
	}
	for(int i = 1 ; i <= M ; ++i) {
		cin >> a;
		barr[i] = a;
		barr[i] += (i > 1) ? barr[i - 1] : 0;
	}
	for(int i = 0 ; i <= N ; ++i) {
		if(K - aarr[i] < 0) {
			break;
		}
		nbooks = max(nbooks, i + getIndex(barr, K - aarr[i], M));
	}
	cout << nbooks << endl;
	return 0;
}  
  

Measured memory_bytes: 6336
using Yorukatsu026.Questions;
using Yorukatsu026.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Yorukatsu026.Questions
{
    /// <summary>
    /// ABC082 B
    /// </summary>
    public class QuestionC : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var s = inputStream.ReadLine().ToCharArray();
            var t = inputStream.ReadLine().ToCharArray();
            Array.Sort(s);
            Array.Sort(t);
            Array.Reverse(t);

            yield return new string(s).CompareTo(new string(t)) < 0 ? "Yes" : "No";
        }
    }
}


namespace Yorukatsu026
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionC();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace Yorukatsu026.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace Yorukatsu026.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

Measured memory_bytes: 13524
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=998244353;
const llint big=2.19e17+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	int n,K;cin>>n>>K;
	if(K==1){cout<<0<<endl;}
	else{cout<<n-K<<endl;}
	return 0;
}

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    for(int i=1;i<=9;i++)
        for(int j=1;j<=9;j++)
            cout << i << "x" << j << "=" << i*j << "\n";
    return 0 ;
}



Measured memory_bytes: 3160
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

class Atcoder_nA{
  public static void Main(){

    int n = int.Parse(Console.ReadLine());
    int[] a = new int[n];
    int[] b = new int[100010];
    var input = Console.ReadLine().Split();
    for (int i = 0; i < n; i++){
        a[i] = int.Parse(input[i]);
        b[a[i]]++;
    }

    int m = 0;
    //int index = 0;
    for(int i=1; i<100005; i++){
      if(b[i-1] + b[i] + b[i+1] > m){
        m = b[i-1] + b[i] + b[i+1];
        //index = i;
      }
    }

    Console.WriteLine(m);
  }
}

Measured memory_bytes: 17248
#include<stdio.h>
#include<set>
#include<vector>
#include<map>

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

using namespace std;

int main(){
  int n,a,m1=0,m2=0;
  scanf("%d",&n);
  set<int> si;
  multiset<int> array;
  REP(i,n){
    scanf("%d",&a);
    if(!si.insert(a).second) array.insert(a);
  }
  map<int,int> mp;
  for(int b:array){
    if(b == m1){
      auto itr = mp.find(b);
      if(itr == mp.end()) mp[b] = 3;
      else ++mp[b];
      if(mp[b] >= 4) m2 = m1 = b;
    }else if(b > m1){
      m2 = m1;
      m1 = b;
    }
  }
  printf("%ld\n",(long)m1*m2);
  return 0;
}


Measured memory_bytes: 6400
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define show(x) cerr<<#x<<"="<<x<<"\n"
using namespace std;

int n,m;
string s;
set<char> st;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;
#ifdef LOCAL_DEFINE
    FILE *stream1;
    //FILE *stream2;
    stream1=freopen("in","r",stdin);
    //stream2=freopen("out","w",stdout);
    if(stream1==NULL)return 0;
    //if(stream2==NULL)return 0;
#endif
    cin>>n;
    for(int i=0;i<n;i++){
      char a;cin>>a;
      st.insert(a);
    }
    if(st.size()==3)cout<<"Three"<<endl;
    else cout<<"Four"<<endl;
#ifdef LOCAL_DEFINE
    cerr<<"Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC<<"s.\n";
    fclose(stream1);
    //fclose(stream2);
#endif
    return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	long double a, b;
	cin >> a;
	cin >> b;

	if (a > b) {
		cout << "GREATER" << endl;
	}
	else if (a < b) {
		cout << "LESS" << endl;
	}
	else {
		cout << "EQUAL" << endl;
	}

	return 0;
}

Measured memory_bytes: 384
/*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
	  	  	- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
#ifndef LOCAL
#define cerr if(0)cout
#endif
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
inline string getstr(string &s,int l,int r){string ret="";for(int i=l;i<=r;i++)ret.push_back(s[i]);return ret;}
int modpow(int x,int y,int md=mod){if(y==0)return 1;int ret=modpow(x,y>>1,md);ret=(ll)ret*ret%md;if(y&1)ret=(ll)ret*x%md;return ret;}
vector<int>g[2005],Tree[2005];
int nn,n;
int a[2005],used[2005];
void dfs(int x){
	used[x]=1;
	for(auto to:g[x])if(!used[to]){
		Tree[x].push_back(to);
		dfs(to);
	}
}
int main(){
	cin>>nn;n=nn;
	for(int i=1;i<=nn;i++)cin>>a[i];
	sort(a+1,a+nn+1);reverse(a+1,a+nn+1);
	while(n&&a[n]==1)n--;
	reverse(a+1,a+n+1);
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			if(__gcd(a[i],a[j])>1){
				g[i].push_back(j);
				g[j].push_back(i);
			}
		}
	}
	priority_queue<int>q;
	for(int i=1;i<=n;i++){
		if(!used[i]){
			q.push(i);dfs(i);
		}
	}
	while(!q.empty()){
		cout<<a[q.top()]<<" ";int v=q.top();q.pop();
		for(auto x:Tree[v])q.push(x);
	}
	for(int i=n+1;i<=nn;i++)cout<<1<<" ";
	return 0;
}

Measured memory_bytes: 17792
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<random>

//使い方がよくわからない
#include<stack>
#include<queue>
#include<bitset>
#include<sstream>

#define rep(i,n) for(int i=0;i<(n);i++) 
#define rep1(i,n) for(int i=1;i<(n);i++)
#define co(x) cout << x << endl
#define cosp(x) cout << x << " "

using namespace std;
using ll = long long;

int main(int argc, const char *argv[]){
    int n;
    cin >> n;
    rep1(i,10){
        rep(j,10){
            if((i*j)==n){
                co("Yes");
                return 0;
            }
        }
    }
    co("No");
    return 0;
}

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

using namespace std;

typedef long long int ll;
typedef pair<int,int> P;

#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define repr(i,b,a) for(int i=int(b);i>=(a);i--)
#define all(x) x.begin(),x.end()

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

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool valid(int lx,int ux,int ly,int uy,int x,int y){
	return lx<=x&&x<ux&&ly<=y&&y<uy; 
}
ll power(ll x,ll p){
	if(p==0)return 1;
	ll res=power(x*x%mod,p/2);
	if(p%2==1)res=res*x%mod;
	return res;
}

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

	cout<<(accumulate(all(a),0)>=h?"Yes":"No")<<endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

char s[4];
int main(){
	scanf("%s", s);
	if(s[0] == s[1] && s[1] == s[2]) printf("No\n");
	else printf("Yes\n");
}


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

using namespace std;

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

int main(void) {
	int N, K;
	cin >> N >> K;

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

	int GCD = A[0];
	int MAX = A[0];
	for (int i = 1; i < N; i++) {
		GCD = gcd(GCD, A[i]);
		MAX = max(MAX, A[i]);
	}
	if (K <= MAX && (MAX - K) % GCD == 0) cout << "POSSIBLE" << endl;
	else cout << "IMPOSSIBLE" << endl;

	system("pause");
	return 0;
}

Measured memory_bytes: 888
n,w=map(int,input().split())
vw=[list(map(int,input().split())) for i in range(n)]
dp=[[-1]*(w+1) for i in range(n)]

for i in range(n):
    for j in range(w+1):
        if i==0 and vw[i][1]<=w:
            dp[i][0]=0
            dp[i][vw[i][1]]=vw[i][0]
            break
        #入れない場合
        dp[i][j]=max(dp[i][j],dp[i-1][j])
        #入れる場合
        if not (0<=j-vw[i][1]<=w and dp[i-1][j-vw[i][1]]>=0):continue
        dp[i][j]=max(dp[i-1][j-vw[i][1]]+vw[i][0],dp[i][j])

print(max(dp[-1]))


Measured memory_bytes: 21788
#include<bits/stdc++.h>
using namespace std;
int x,y,z,k;
long long a[1001],sb[1000001],sc[3000001];
int main()
{
	cin >> x >> y >> z >> k;
	for(int i = 0; i < x; i++)
		cin >> a[i];
	sort(a,a + x,greater<long long>());
	for(long long i = 0; i < y; i++)
	{
		long long b;
		cin >> b;
		for(int j = 0; j < x; j ++)
		{
			sb[ x*i + j ] = a[j] + b;
		}
	}
	sort(sb,sb + x*y,greater<long long>());
	for(int i = 0; i < z; i++)
	{
		long long c;
		cin >> c;
		for(int j = 0; j < x*y && j < k; j ++)
		{
			sc[ k*i + j ] = sb[j] + c;
		}
	}
	sort(sc,sc + k*z,greater<long long>());
	for(int i = 0; i < k; i ++)
		cout << sc[i] << endl;
	return 0;
}

Measured memory_bytes: 31488
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

pub trait InputValue {
    fn parse(s: &str) -> Self;
}

pub fn read<T: InputValue>() -> T {
    let mut buf = String::new();
    let _ = stdin().read_line(&mut buf);
    T::parse(&buf.trim())
}

pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
    let mut vec = vec![];
    for _ in 0..n {
        vec.push(read());
    }
    vec
}

pub fn readnc<T: InputValue>() -> Vec<T> {
    let mut vec = vec![];
    let line: String = read();
    for token in line.split_whitespace() {
        vec.push(T::parse(token));
    }
    vec
}

macro_rules! parse_single_value {
    ($($t:ty),*) => {
        $(
            impl InputValue for $t {
                fn parse(s: &str) -> $t { s.parse().unwrap() }
            }
        )*
	}
}
parse_single_value!(i32, i64, f32, f64, usize, String);

macro_rules! parse_tuple {
	($($t:ident),*) => {
		impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
			fn parse(s: &str) -> ($($t),*) {
				let mut tokens = s.split_whitespace();
				let t = ($($t::parse(tokens.next().unwrap())),*);
				t
			}
		}
	}
}
parse_tuple!(A, B, C);

// ===

fn main() {
    let (a, b, c): (i32, i32, i32) = read();
    println!("{}", if a+b >= c { "Yes" } else { "No" });
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const ll MOD = (ll) (1e9 + 7);
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

void finish() {
    cout << -1 << endl;
    exit(0);
}

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

class UnionFind {
private:
    vector<int> par, sizes;

public:

    UnionFind(int n = 100010) : par(n), sizes(n, 1) {
        rep(i, n) par[i] = i;
    }

    int root(int x) {
        if (x == par[x]) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return;
        if (sizes[x] < sizes[y]) swap(x, y);
        par[y] = x;
        sizes[x] += sizes[y];
    }

    bool same(int x, int y) {
        return root(x) == root(y);
    }

    int size(int x) {
        return sizes[root(x)];
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    UnionFind uf(100010);
    vector<pair<pii, int> > v(n);

    rep(i, n) {
        cin >> v[i].first.first >> v[i].first.second;
        v[i].second = i;
    }
    sort(all(v));

    rep(i, n - 1) {
        if (v[i].first.first == v[i + 1].first.first) uf.unite(v[i].second, v[i + 1].second);
    }

    rep(i, n) swap(v[i].first.first, v[i].first.second);
    sort(all(v)); 

    rep(i, n - 1) {
        if (v[i].first.first == v[i + 1].first.first) uf.unite(v[i].second, v[i + 1].second);
    }
    
    vector<int> num[100010];
    rep(i, n) num[uf.root(v[i].second)].push_back(i);
    ll ans = 0;

    rep(i, 100010) {
        if (num[i].empty()) continue;
        set<int> x, y;
        for (auto t : num[i]) {
            x.insert(v[t].first.first);
            y.insert(v[t].first.second);
        }
        if (x.size() == 1 || y.size() == 1) continue;
        ans += (ll) x.size() * (ll) y.size() - (ll) num[i].size();
    }

    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 9592
import sys

N, M, C = map(int, sys.stdin.readline().split())
B = list(map(int, sys.stdin.readline().split()))

ans = 0
for _ in range(N):
    A = list(map(int, sys.stdin.readline().split()))
    tmp = 0
    for i in range(M):
        tmp += A[i] * B[i]
    if tmp + C > 0:
        ans += 1

print(ans)

Measured memory_bytes: 9164
#include <cstdio>

int main (){
    int a,b,plus,minus,cross;
    scanf("%d %d",&a,&b);
    plus = a+b;
    minus = a-b;
    cross = a*b;
    if(plus>=minus && plus>=cross) printf("%d",plus);
    else if(minus>=plus && minus>=cross) printf("%d",minus);
    else printf("%d",cross);
}

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

using namespace std;

#define IO ios_base::sync_with_stdio(0);cin.tie(0);

int main()
{
  IO;
  int n; cin >> n;
  vector <int> a(n);

  for (int i = 0; i < n; ++i)
    cin >> a[i];

  int count = 0;

  for (int i = 0; i < n; ++i)
  {
    if (a[i] == i + 1) {
    bool check = false, check1 = false;
    if (i - 1 >= 0)
    if (a[i - 1] == i) check = true;
    if (i + 1 < n)
    if (a[i + 1] == i + 2) check1 = true;

    if (check)
    swap(a[i - 1], a[i]);
    else
    if (check1)
    swap(a[i], a[i + 1]);
    else {
    if (i - 1 >= 0) {
      if (a[i - 1] != i + 1)
      swap(a[i - 1], a[i]);
    }
    if ((i - 1 >= 0 && a[i - 1] != i + 1) || i - 1 < 0)
    if (i + 1 < n) {
      if (a[i + 1] != i + 1)
      swap(a[i], a[i + 1]);
    }
    }
    ++count;
  }
  }

  cout << count << endl;

  return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;


int main() {
    int N; cin >> N;
    vector<int> A(N);
    double sum = 0;
    for(int &a:A){
        cin >> a;
        sum += a;
    }
    
    double ave = sum/N;
    
    int ans = 0;
    double mn = 1<<30;
    
    for(int i=0; i<N; i++){
        if(abs(ave - A[i]) < mn){
            ans = i;
            mn = abs(ave - A[i]);
        }
    }
    
    cout << ans << endl;
    return 0;
}





Measured memory_bytes: 256
n, k = map(int, input().split())
p = list(map(int, input().split()))
q = [0]
acc = 0
for i in p:
    acc += (1+i)/2
    q.append(acc)

ma = 0
for i in range(n-k+1):
    ma = max(q[i+k] - q[i], ma)
print(ma)

Measured memory_bytes: 24804
#include<stdio.h>

int main(){
  int i,j,N,count=0,minj=0,temp;
  scanf("%d",&N);
  int A[N];
  for(i=0;i<=N-1;i++)
    {
      scanf("%d",&A[i]);
    }
  for(i = 0;i<=N-1;i++)
    {
      minj = i;
      for(j=i;j<=N-1;j++)
	{
	  if(A[j] < A[minj])
	    {
	      minj =j;
	    }
	}
      if(minj != i)
	{
      temp = A[i];
      A[i]=A[minj];
      A[minj]=temp;
      count++;
	}
  }
  for(j=0;j<N-1;j++)
    {
      printf("%d ",A[j]);
    }
 printf("%d\n",A[j]);
  printf("%d\n",count);
  return 0;
}

Measured memory_bytes: 600
#include <deque>
#include <iostream>
#include <string>
#include <utility>
using namespace std;

template <typename Iter, typename C>
inline decltype(auto) getIndexfromIter(const Iter &i, const C &container) {
  return i - begin(container);
}

int main() {
  string str;
  cin >> str;
  deque<int> index;
  deque<pair<int, int>> puddle;
  for (auto i = str.begin(), e = str.end(); i != e; i++) {
    if ('\\' == *i) {
      index.push_back(getIndexfromIter(i, str));
    } else if ('/' == *i && !index.empty()) {
      auto j = index.back();
      auto area = getIndexfromIter(i, str) - j;
      index.pop_back();
      while (!puddle.empty() && puddle.back().first > j) {
        area += puddle.back().second;
        puddle.pop_back();
      }
      puddle.emplace_back(j, area);
    }
  }

  auto sum = 0;
  for (auto &&var : puddle) {
    sum += var.second;
  }
  cout << sum << '\n';
  cout << puddle.size();
  for (auto &&var : puddle) {
    cout << ' ' << var.second;
  }
  cout << '\n';

  return 0;
}



Measured memory_bytes: 3260
s1 = list(input())
N = len(s1)
s1_r = s1[::-1]
ans = "No"
cnt = 0
if s1 == s1_r:
    cnt += 1
s2 = s1[:(N-1)//2:]
s2_r = s2[::-1]
if s2 == s2_r:
    cnt += 1
s3 = s1[(N+3)//2-1:]
s3_r = s3[::-1]
if s3 == s3_r:
    cnt += 1
if cnt == 3:
    ans = "Yes"
print(ans)

Measured memory_bytes: 3064
h = []
high = [0, 0, 0]

10.times do |i|
  h[i] = gets.chomp.to_i
end

10.times do |i|
  if high[2] < h[i]
    high[2] = h[i]
    if high[1] < h[i]
      high[2] = high[1]
      high[1] = h[i]
      if high[0] < h[i]
        high[1] = high[0]
        high[0] = h[i]
      end
    end
  end
end

3.times do |i|
  puts high[i]
end



Measured memory_bytes: 6872
N,K=map(x->parse(Int,x),split(readline()))
V=map(x->parse(Int,x),split(readline()))
ans=0
for i=0:N,j=N+1:-1:i+1
	v=Array{Int}(0)
	now=0
	for k=1:i
		now+=V[k]
		push!(v,V[k])
	end
	for k=N:-1:j
		now+=V[k]
		push!(v,V[k])
	end
	sort!(v)
	k=K-i-(N+1-j)
	if k<0;continue;end
	for l=1:min(k,length(v))
		if v[l]>0;break;end
		now-=v[l]
	end
	ans=max(ans,now)
end
println(ans)


Measured memory_bytes: 117836
#include <stdio.h>
#define N 100
int main()
{
  int m[N][N];
  int n,k,u,v,i,j;    /*uは頂点、kはuの接点、vはuに隣接する頂点*/
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      for(j=0;j<n;j++)
	{
	
	m[i][j]=0;
	}
    }
  
  for(i=0;i<n;i++)
    {
      scanf("%d%d",&u,&k);
      u--;
      for(j=0;j<k;j++)
	{
	  scanf("%d",&v);
	  v--;
	  m[u][v]= 1;
	}
    }
  for(i=0; i<n;i++)
    {
      for(j=0;j<n; j++)
	{
	  printf("%d",m[i][j]);
	  if(j!=n-1)printf(" ");
	}
      printf("\n");
    }
  return 0;

}



Measured memory_bytes: 2052