akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
 
typedef struct Node* NodePointer;
 
typedef struct Node {
  int key;
  NodePointer next, pre;
} Node;
 
NodePointer head, last;
 
NodePointer make_node(int key) {
  NodePointer tmp = malloc(sizeof(Node));
  tmp->next = tmp->pre = NULL;
  tmp->key = key;
  return tmp;
}
 
void init() {
  head = malloc(sizeof(Node));
  last = malloc(sizeof(Node));
  head->next = last;
  last->pre = head;
}
 
void insert(NodePointer s, int key) {
  NodePointer node = make_node(key);
  NodePointer t = s->next;
  s->next = node;
  node->pre = s;
  node->next = t;
  t->pre = node;
}
 
void delete(NodePointer p) {
  NodePointer s = p->pre;
  NodePointer t = p->next;
  s->next = t;
  t->pre = s;
  free(p);
}
 
int main() {
  int N, num;
  char str[30];
  NodePointer p;
  init();
  scanf(" %d ", &N);
  while(N--) {
    scanf(" %s ", str);
    if(!strcmp(str,"insert")) {
      scanf(" %d ", &num);
      insert(head,num);
    } else if(!strcmp(str,"delete")) {
      scanf(" %d ", &num);
      for(p = head->next; p != last; p = p->next) {
        if(p->key == num) {
          delete(p);
          break;
        }
      }
    } else if(!strcmp(str,"deleteFirst")) {
      delete(head->next);
    } else if(!strcmp(str,"deleteLast")) {
      delete(last->pre);
    }
  }
 
  for(p = head->next; p != last; p = p->next) {
    printf(p == head->next? "%d":" %d", p->key);
  }
  printf("\n");
 
  return 0;
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

void solve() {
  f80 v;
  while (cin >> v) {
    int n = ceil((4.9 * v * v / 9.8 / 9.8 + 5) / 5);
    cout << n << '\n';
  }
}



Measured memory_bytes: 3260
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int a[1000009];
main(){
    int n;
    cin >> n;
    int o = 0;
    for(int i = 1; i <= n; i++){
       char c;
       cin >> c;
       a[i] = c - '1';
       if(a[i] == 1) o = 1;

    }
    if(!o){
        for(int i = 1 ;i <= n; i++){
            a[i] /= 2;
        }
    }
    int x = 0;
    for(int i = 0; i < n; i++){
        if((i & (n - 1 - i)) == 0) x ^= (a[i+1]&1);
    }
    if(!o) cout << 2*x << endl;
    else cout << x << endl;
}


Measured memory_bytes: 4096
#include<iostream>
#include<cfloat>
#include<cassert>
#include<cmath>
#include<vector>
 
using namespace std;
 
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS )
#define dle(a, b) (equals(a, b) || a < b )
static const double PI = acos(-1);
 
class Point{
    public:
    double x, y;
     
    Point ( double x = 0, double y = 0): x(x), y(y){}
     
    Point operator + ( Point p ){ return Point(x + p.x, y + p.y); }
    Point operator - ( Point p ){ return Point(x - p.x, y - p.y); }
    Point operator * ( double a ){ return Point(x*a, y*a); }
    Point operator / ( double a ){ return Point(x/a, y/a); }
 
    double abs() { return sqrt(norm());}
    double norm() { return x*x + y*y; }
 
    bool operator < ( const Point &p ) const {
    return x != p.x ? x < p.x : y < p.y;
    }
 
    bool operator == ( const Point &p ) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
    }
};
 
typedef Point Vector;
 
double norm( Vector a ){ return a.x*a.x + a.y*a.y; }
double abs( Vector a ){ return sqrt(norm(a)); }
Point polar( double a, double r ){ return Point(cos(r)*a, sin(r)*a);}
double getDistance( Vector a, Vector b ){ return abs(a - b); }
double dot( Vector a, Vector b ){ return a.x*b.x + a.y*b.y; }
double cross( Vector a, Vector b ){ return a.x*b.y - a.y*b.x; }
 
static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;
 
// EPS can be 0
// need to check for 920, 833, 866
int ccw( Point p0, Point p1, Point p2 ){
    Vector a = p1 - p0;
    Vector b = p2 - p0;
    if ( cross(a, b) > EPS ) return COUNTER_CLOCKWISE;
    if ( cross(a, b) < -EPS ) return CLOCKWISE;
    if ( dot(a, b) < -EPS ) return ONLINE_BACK;
    if ( norm(a) < norm(b) ) return ONLINE_FRONT;
    return ON_SEGMENT;
}
 
bool isConvex( Point P[4] ){
    int c = ccw(P[0], P[1], P[2]);
    for ( int i = 1; i < 4; i++ ){
    if ( c != ccw(P[i], P[(i+1)%4], P[(i+2)%4] )) return false;
    }
    return true;
}
 
main(){
    char ch;
    Point P[4];
    while( cin >> P[0].x >> ch >> P[0].y ){
    for ( int i = 1; i < 4; i++ ) cin >> ch >> P[i].x >> ch >> P[i].y;
    if ( isConvex(P) ) cout << "YES" << endl;
    else cout << "NO" << endl;
    }
    return 0;
}

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

using ll=long long;

int main() {
    ll x,r,a;
    cin >> x;

    a = x/11*2+1;
    r = x%11;
    if(r > 6)
        a++;
    else if(r == 0)
        a--;
    
    cout << a << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
#define all(obj) (obj).begin(), (obj).end()
static const int dx[4] = {0, 1, 0, -1};
static const int dy[4] = {1, 0, -1, 0};
static const char dir[4] = {'u', 'r', 'd', 'l'};
static const ll INF = 1 << 21;
static const ll MOD = 1e9 + 7;
int N, M;

struct UnionFind {
  vector<int> par;

  UnionFind(int n) : par(n, -1) {}
  void init(int n) { par.assign(n, -1); }

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

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

  bool merge(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) {
      return false;
    }
    if (par[x] > par[y]) {
      swap(x, y);
    }
    par[x] += par[y];
    par[y] = x;
    return true;
  }

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

signed main() {
  cin >> N >> M;
  UnionFind uf(N + M);
  rep(i, N) {
    int k;
    cin >> k; // i番目の人が話す言語
    rep(j, k) {
      int l;
      cin >> l; // 言語l
      --l;
      uf.merge(M + i, l); // 言語lとi番目の人を繋げる(M+iとすることで言語と被らない)
    }
  }

  bool flag = true;
  rep(i, N - 1) {
    if (!uf.issame(M + i, M + i + 1)) { // 人が同じグループかどうか
      flag = false;
      break;
    }
  }
  if (flag) {
    puts("YES");
  } else {
    puts("NO");
  }
  return 0;
}

Measured memory_bytes: 1024
while True:
    R0, W0, C, R = map(int, input().split())
    if R0 == W0 == C == R == 0:
        break
    X = 0
    while True:
        tmp = R0 + X * R - C * W0
        if tmp >= 0:
            print(X)
            break
        else:
            X += 1

Measured memory_bytes: 7528
//Apparat : drobucs, aleonov, vit_72
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <iomanip>
#include <algorithm>
#include <string>
#include <queue>
#include <numeric>
#include <stack>

//#pragma warning(disable : 4996)
//#pragma GCC optimize("O3")

using namespace std;

#define nptr nullptr
#define all(x) (x).begin(), (x).end()
#define drobucs ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
#define ff first
#define ss second
#define pb push_back
#define sz(x) (int)(x).size()

typedef  long long ll;

const int maxn = (int)1e6 + 13;
const ll INFL = (1ll << 62ll) - 1 + (1ll << 62ll);
const ll INF = (1ll << 30ll) - 1ll + (1ll << 30ll);
const ll MOD = (int)1e9 + 7, MOD2 = 998244353;//1e9 + 21, 1e9 + 33, 1e9 + 87, 1e9 + 93
const ll base = 101, base2 = 37;



int main() {
	drobucs;
	int n;
	cin >> n;
	string s;
	cin >> s;
	// r - 1, g - 2, b - 3
	vector<ll> a;
	vector<ll> col[4];
	for (int i = 0; i < n; ++i) {
		if (s[i] == 'R')a.push_back(1), col[1].push_back(i);
		if (s[i] == 'G')a.push_back(2), col[2].push_back(i);
		if (s[i] == 'B')a.pb(3), col[3].push_back(i);
	}
	ll ans = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; ++j) {
			if (a[i] != a[j]) {
				int c = a[i] ^ a[j];
				ll l = -1, r = sz(col[c]);
				while (r - l > 1) {
					ll m = (l + r) / 2;
					if (col[c][m] >= j + 1)r = m;
					else l = m;
				}
				if (r == sz(col[c]))continue;
				ans += sz(col[c]) - r;
				if (2 * j - i < n && a[2 * j - i] == c)ans--;
			}
		}
	}
	cout << ans << "\n";
	return 0;
}

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

#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<(int)n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fill(a,v) memset(a,v,sizeof(a))
#define d1(a) cout << a << "\n"
#define d2(a,b) cout << a << " " << b << "\n"
#define d3(a,b,c) cout << a << " " << b << " " << c << "\n"
#define d4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << "\n"
#define fast ios:: sync_with_stdio(false),cin.tie(nullptr);

typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;

const int N = 2e3 + 5;
int dis[N];
vi g[N];
int vis[N];
int ans[N];

void dfs(int node){
	queue<int>q;
	q.push(node);
	vis[node] = 1;
	while(!q.empty()){
		int u = q.front();
		q.pop();
		for(auto v : g[u]){
			if(vis[v] == 0){
				vis[v] = 1;
				dis[v] = dis[u] + 1;
				q.push(v);
			}
		}
	}
}

int32_t main(){
	fast;
	int n,x,y;
	cin >> n >> x >> y;
	f(i,1,n){
		g[i].pb(i+1);
		g[i+1].pb(i);
	}
	
	g[x].pb(y);
	g[y].pb(x);

	for(int i=1 ; i<=n ; i++){
		for(int j=1 ; j<=n ; j++)  vis[j] = dis[j] = 0;
		dfs(i);
		for(int j=1 ; j<=n ; j++)  ans[dis[j]]++;
	}
	
	for(int i=1 ; i<=n-1 ;i++){
		cout << ans[i]/2 << "\n";
	}
}


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

int main()
{
	string s;
	cin >> s;
	int n = s.size();
	int ans = (1 << 30);
	for (int i = 0; i < n; i++)
	{
		int x = stoi(s.substr(i, 3));
		ans = min(ans, abs(753 - x));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<cstdio>

#include<vector>
#include<map>
using namespace std;
int a[233333];
map<long long,long long> mp;
map<long long,long long> ok;
vector<int> v;
long long all_sum;
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(mp[a[i]]==0){
			v.push_back(a[i]);
		}
		mp[a[i]]++;
	}
	for(int i=0;i<v.size();i++){
		ok[v[i]]=mp[v[i]]*(mp[v[i]]-1)/2;
		all_sum+=ok[v[i]];
	}
	for(int i=0;i<n;i++){
		long long num=ok[a[i]]-ok[a[i]]*(mp[a[i]]-2)/mp[a[i]];
		cout<<all_sum-num<<endl;
	}
	return 0;
}

Measured memory_bytes: 18680
N_1=int(input())
a={}
for i in range(N_1):
    fruit=input()
    count=0
    if fruit in a:
        a[fruit] +=1
    else:
        a[fruit]=1
        
N_2=int(input())
b={}
for i in range(N_2):
    fruit=input()
    count=0
    if fruit in b:
        b[fruit] +=1
    else:
        b[fruit]=1
c=[]
d=[]
max_num=0
for j,fruit_1 in a.items():
    for k,fruit_2 in b.items():
        if j == k:
            total=fruit_1-fruit_2
            c.append(total)
    if not j in b:            
        d.append(fruit_1)

if len(c) == 0 :
    max_num=max(d)
    

if len(d) == 0:
    max_num=max(c)

if len(c) !=0 and len(d) !=0:
    if max(c) > max(d) :
        max_num=max(c)
    else:
        max_num=max(d)
    
if max_num <0:
    max_num=0

print(max_num)

Measured memory_bytes: 38256
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        //int[] lines = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

        int count = 1;

        while (true)
        {
            int num = int.Parse(Console.ReadLine());

            if (num == 0) break;

            Console.WriteLine("Case {0}: {1}", count, num);

            count++;
        }
    }
}

Measured memory_bytes: 9152
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>  
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
using namespace std;
int a[12];
int main(){
  int n,k,mk=0,s=0,p=0,tm=0,h=0,low=0,sci=0;
  cin>>n>>k;
  for (int i=0;i<k;i++)
    cin>>a[i];
  for (int j=n;j<j+1;j++){
  if (j >= 10000) mk = j / 10000;
  if (j >= 1000)s=j % 10000 / 1000;
  if (j >= 100)p=j % 1000 / 100;
  if (j >= 10)tm=j % 100 / 10;
  h = j % 10;
  for (int aq = 0;aq < k;aq++){
  if (j > 9999)
  if (a[aq] == mk)
  sci++;
  if (j > 999)
  if (a[aq] == s)
  sci++;
  if (j > 99)
  if (a[aq] == p)
  sci++;
  if (j > 9)
  if (a[aq] == tm)
  sci++;
  if (h == a[aq])
  sci++;
    }
  if (sci == 0){
  cout<<j;
  system ("pause");
  return 0;
  }
  sci=0;
  }
  }

Measured memory_bytes: 504
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    A,B,C = inputMap()
    
    if C >= A and C <= B:
        print("Yes")
    else:
        print("No")
    
if __name__ == "__main__":
	main()


Measured memory_bytes: 38640
// https://atcoder.jp/contests/abc166/tasks/abc166_d

fun main() {
    abc166d()
}

fun abc166d() {
    val x = readLine()!!.toLong()
    for (a in -119L..120L) {
        for (b in -119L..120L) {
            if (a == b) continue
            if (a * a * a * a * a - (b * b * b * b * b) == x) {
                println("$a $b")
                return
            }
        }
    }
}


Measured memory_bytes: 34500
#include <bits/stdc++.h>
using i64 = long long;

int main() {
    i64 k, n;
    std::cin >> k >> n;
    std::vector<i64> a(n);
    for (auto &e : a) std::cin >> e;

    i64 ret = a.front() + k - a.back();
    for (int i = 1; i < n; i++) ret = std::max(ret, a[i] - a[i - 1]);

    std::cout << k - ret << std::endl;

    return 0;
}


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

int main() {
  int H,W;
  cin >>H >>W ;
  vector<string> A(110);
  for(int i=0;i<H;i++)cin >> A.at(i);
  for(int i=0;i<W+2;i++){
    cout << '#';
  }
  cout <<endl;
  for(int i=0;i<H;i++)cout << '#' << A.at(i) << '#' <<endl;
  for(int i=0;i<W+2;i++){
    cout << '#';
  }
  cout <<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long M=2e10; set<long> S{M}, T{M}, Sm{0}, Tm{0};
long nearestS(long x){
long y=*S.lower_bound(x); long z=*Sm.lower_bound(-x); z=-z;
if(y>1e10){ return x-z; }else if(z<1){ return y-x; }
else{ long w=min(x-z, y-x); return w; }
}
long nearestT(long x){
long y=*T.lower_bound(x); long z=*Tm.lower_bound(-x); z=-z;
if(y>1e10){ return x-z; }else if(z<1){ return y-x; }
else{ long w=min(x-z, y-x); return w; }
}
int main(){
long A, B, Q, i, s, t, x, y, ans; cin >> A >> B >> Q;
for(i=0; i<A; i++){ cin >> s; S.insert(s); Sm.insert(-s); }
for(i=0; i<B; i++){ cin >> t; T.insert(t); Tm.insert(-t); }
for(i=0; i<Q; i++){ cin >> x; ans=M;
y=*S.lower_bound(x); if(y<=1e10){ ans=y-x+nearestT(y); }
y=*Sm.lower_bound(-x); y=-y; if(y>0){ ans=min(ans, x-y+nearestT(y)); }
y=*T.lower_bound(x); if(y<=1e10){ ans=min(ans, y-x+nearestS(y)); }
y=*Tm.lower_bound(-x); y=-y; if(y>0){ ans=min(ans, x-y+nearestS(y)); }                  
cout << ans << "\n";
}
}

Measured memory_bytes: 20096
import sys
sys.setrecursionlimit(10**9)
N=int(input())

tree=[[] for _ in range(N+1)]
for _ in range(N-1):
  a,b=map(int,input().split())
  tree[a].append(b)
  tree[b].append(a)
#print(tree)

def dfs(u,par,depth):
  dist_list[u]=depth
  for v in tree[u]:
    if v!=par:
      dfs(v,u,depth+1)
  
dist_list=[-1]*(N+1)
dfs(1,0,0)
#print(dist_list)

num_even=num_odd=0
for i in range(1,N+1):
  if dist_list[i]%2==0:
    num_even+=1
  else:
    num_odd+=1
#print(num_even,num_odd)

num_3m0=3
num_3m1=1
num_3m2=2
answer_list=[0]*(N+1)
if num_even<=N//3:
  for i in range(1,N+1):
    if dist_list[i]%2==0:
      answer_list[i]=num_3m0
      num_3m0+=3
    else:
      if num_3m1<=N:
        answer_list[i]=num_3m1
        num_3m1+=3
      elif num_3m2<=N:
        answer_list[i]=num_3m2
        num_3m2+=3
      else:
        answer_list[i]=num_3m0
        num_3m0+=3
elif num_odd<=N//3:
  for i in range(1,N+1):
    if dist_list[i]%2==1:
      answer_list[i]=num_3m0
      num_3m0+=3
    else:
      if num_3m1<=N:
        answer_list[i]=num_3m1
        num_3m1+=3
      elif num_3m2<=N:
        answer_list[i]=num_3m2
        num_3m2+=3
      else:
        answer_list[i]=num_3m0
        num_3m0+=3
else:
  for i in range(1,N+1):
    if dist_list[i]%2==0:
      if num_3m1<=N:
        answer_list[i]=num_3m1
        num_3m1+=3
      else:
        answer_list[i]=num_3m0
        num_3m0+=3
    else:
      if num_3m2<=N:
        answer_list[i]=num_3m2
        num_3m2+=3
      else:
        answer_list[i]=num_3m0
        num_3m0+=3
        
print(*answer_list[1:])

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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;}
template<class T> inline bool chmax(T& a,T b){ if(a<b){a=b;return 1;}return 0; }
template<class T> inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; }
//end



int main(){
   int a,b; scanf("%d%d",&a,&b);
   if(a<=0&&0<=b)puts("Zero");
   else{
      if(b<0&&((b-a)%2==0))puts("Negative");
      else puts("Positive");
   }
   return 0;
}

Measured memory_bytes: 256
/**
   Solution by Abil
**/
# include <bits/stdc++.h>

# define fr first
# define sc second
# define pb push_back
# define mk make_pair
# define sz(s) s.size()
# define all(s) s.begin(),s.end()
# define int long long

using namespace std;

const long long N = (1e6 + 10);
const long long mod = (1e9 + 7);
const long long inf = (1e9 + 7);

main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);

    string s, t;
    cin >> s >> t;
    int dp[s.size() + 1][t.size() + 1];
    memset(dp,0,sizeof(dp));

    for(int i = 1;i <= s.size(); i++){
        for(int j = 1;j <= t.size(); j++){
            if(s[i - 1] == t[j - 1]){
                dp[i][j] = dp[i - 1][j - 1] + 1;
            }
            dp[i][j] = max(dp[i][j],max(dp[i - 1][j],dp[i][j -  1]));
        }
    }
    string ans = "";
    /*for(int i = 0;i <= s.size(); i++){
        for(int j = 0;j <= t.size(); j++){
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }*/

    int i = s.size(),j = t.size();
    while(dp[i][j] != 0){
        if(dp[i - 1][j] == dp[i][j] || dp[i][j - 1] == dp[i][j]){
            if(dp[i - 1][j] == dp[i][j]){
                i--;
            }
            else
            if(dp[i - 1][j] == dp[i][j - 1]){
                i--;
            }
            else{
                j--;
            }
        }
        else{
            ans += s[i - 1];
            i--;
            j--;
        }
    }
    reverse(all(ans));
    cout << ans;
}


Measured memory_bytes: 70656
#include <iostream>
#include <array>

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

    std::array<int64_t, 200005> v;
    for (int i = 0; i < n; ++i)
    {
        int64_t temp;
        std::cin >> temp;
        v[i] = temp;
    }

    int64_t count = 0;
    int64_t sum = v[0];
    int64_t temp = v[0];
    for (int i = 0, j = 1; i < n; i++)
    {
        for (;(j < n) && (temp & v[j]) == 0; ++j)
        {
            temp ^= v[j];
        }
        temp ^= v[i];
        count += j - i;
    }
    std::cout << count << std::endl;
    return 0;
}

Measured memory_bytes: 1792
d[4],e[9],f,k;
char s[30];
z(){
	int a,b,c;
	a=e[f++];
	a>9?s[k++]=40,
		b=z(),
		s[k++]=a,
		c=z(),
		s[k++]=41,
		a=a-43?a-45?b*c:b-c:b+c:
		(s[k++]=a+48);
	return a;
}
y(o,n,i,j){
	if(i==7){
		f=k=0;
		if(z()==10){
			s[k]=0;
			puts(s);
			return 1;
		}
		return 0;
	}
	if(o)
		for(;j<3;j++){
			e[i] = "+-*"[j];
			if(y(o-1,n+1,i+1,0))return 1;
		}
	if(n|i==6)
		for(j=0;j<4;j++)
			if(e[i]=d[j]){
				d[j]=0;
				if(y(o,n-1,i+1,0))return 1;
				d[j]=e[i];
			}
	return 0;
}

int main(void){
	for(;scanf("%d%d%d%d",d,d+1,d+2,d+3),f=*d;)
		y(3,0,0,0)||puts("0");
}

Measured memory_bytes: 0
#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-04-21 16:17:12
**/

#include <iostream>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
#include <bitset>
#include <cassert>
#include <cctype>
#include <iomanip>
#include <random>
#include <utility>
#include <chrono>

using namespace std;

using int64 = long long;

template <class T> using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T, class U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) { return os << '(' << p.first << ", " << p.second << ')'; }
template <class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) { int flag = 0; for (auto e : vec) os << (flag++ ? ", " : "{") << e; return os << '}'; }
template <class T> std::ostream& operator<<(std::ostream& os, const std::set<T>& st) { int flag = 0; for (auto e : st) os << (flag++ ? ", " : "{") << e; return os << '}'; }
template <class T, class U> std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) { int flag = 0; for (auto e : mp) os << (flag++ ? ", " : "{") << e; return os << '}'; }
template <class T> std::istream& operator>>(std::istream& is, std::vector<T>& vec) { for (T& e : vec) is >> e; return is; }

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

inline unsigned long long fast_gcd(unsigned long long x, unsigned long long y) {
  int shift;
  if (x == 0) return y;
  if (y == 0) return x;
  shift = __builtin_ctzll(x | y);
  x >>= __builtin_ctzll(x);
  do {
    y >>= __builtin_ctzll(y);
    if (x > y) {
      /*
      unsigned long long t = y;
      y = x;
      x = t;
      */
      std::swap(x, y);
    }
    y -= x;
  } while (y);
  return x << shift;
}

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

  int k; cin >> k;

  int64 ans = 0;
 
  for (int a = 1; a <= k; ++a) {
    for (int b = 1; b <= k; ++b) {
      for (int c = 1; c <= k; ++c) {
        ans += fast_gcd(a, fast_gcd(b, c));
      }
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <cmath>

using namespace std;
typedef long long ll;

int main(void)
{
    ll a,b,c;

    cin >> a >> b >> c;

    ll d = c - a - b;
    if(d > 0 && d * d > 4 * a * b)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cctype>
#include <string>
#include <cstring>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std ;
#define rep(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define per(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define clr(a) memset(a, 0, sizeof(a))
#define ass(a, sum) memset(a, sum, sizeof(a))
#define lowbit(x) (x & -x)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define enter cout << endl
#define siz(x) ((int)x.size())
typedef long long ll ;
typedef unsigned long long ull ;
typedef vector <int> vi ;
typedef pair <int, int> pii ;
typedef map <int, int> mii ;
typedef map <string, int> msi ;
const int N = 410 ;
const int INF = 0x3f3f3f3f ;
const int iinf = 1 << 30 ;
const ll linf = 1e15 ;
const int MOD = 1000000007 ;
void print(int x) { cout << x << endl ; exit(0) ; }
void PRINT(string x) { cout << x << endl ; exit(0) ; }
void douout(double x){ printf("%lf\n", x + 0.0000000001) ; }

int n ;
ll a[N], s[N], f[N][N] ;

int main(){
	scanf("%d", &n) ;
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]) ;
		s[i] = s[i - 1] + a[i] ;
	}
	for (int len = 2; len <= n; len++)
	for (int i = 1; i <= n - len + 1; i++){
		int j = i + len - 1 ;
		f[i][j] = linf ;
		for (int k = i; k < j; k++) f[i][j] = min(f[i][j], f[i][k] + f[k + 1][j] + s[j] - s[i - 1]) ;
	}
	printf("%lld\n", f[1][n]) ;
}

/*
写代码时请注意：
	1.ll？数组大小，边界？数据范围？
	2.精度？
	3.特判？
	4.至少做一些
思考提醒：
	1.最大值最小->二分？
	2.可以贪心么？不行dp可以么
	3.可以优化么
	4.维护区间用什么数据结构？
	5.统计方案是用dp？模了么？
*/


Measured memory_bytes: 1536
N = int(input())
A = list(map(int,input().split()))
even = 0
odd = 0
for i in range(N):
  if A[i]%2 == 0:
    even += 1
  else:
    odd += 1
if odd%2 == 0:
  print("YES")
else:
  print("NO")

Measured memory_bytes: 14108
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Comparator;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BATCoder solver = new BATCoder();
        solver.solve(1, in, out);
        out.close();
    }

    static class BATCoder {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());
            int cnt = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == 'A' ||
                        s.charAt(i) == 'C' ||
                        s.charAt(i) == 'G' ||
                        s.charAt(i) == 'T') cnt++;
                else {
                    pq.add(cnt);
                    cnt = 0;
                }
            }
            pq.add(cnt);
            out.println(pq.poll());
        }

    }
}



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

int main() {
  int a, b;
  cin >> a >> b;
  if (a * b % 2){
    cout << "Odd" << endl;
  }else{
    cout << "Even" << endl;
  }
  return 0;
}

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

int main(){
    ll a,b,c,d,ans;
    cin >> a >> b >> c >> d;
    cout << max(a*c,max(a*d,max(b*c,b*d))) << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define int long long
using namespace std;

int32_t main() {
    int x;
    cin>>x;
    if(x>=400 && x<=599) 
        cout<<8<<endl;
    else if(x>=600 && x<=799) 
        cout<<7<<endl; 
    else if(x>=800 && x<=999)
        cout<<6<<endl;
    else if(x>=1000 && x<=1199) 
        cout<<5<<endl;
    else if(x>=1200 && x<=1399) 
        cout<<4<<endl;
    else if(x>=1400 && x<=1599) 
        cout<<3<<endl; 
    else if(x>=1600 && x<=1799)
        cout<<2<<endl;
    else if(x>=1800 && x<=1999)
        cout<<1<<endl;
}

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

int main() {
  vector<vector<int>> c;
  for(int i=0;i<3;i++){
    vector<int> tmpvec;
    for(int j=0;j<3;j++){
      int tmp;
      cin >> tmp;
      tmpvec.push_back(tmp);
    }
    c.push_back(tmpvec);
  }
  bool result = true;
  vector<int> a = {c.at(0).at(0), c.at(1).at(0), c.at(2).at(0)};
  vector<int> b = {0, c.at(0).at(1) - a.at(0), c.at(0).at(2) - a.at(0)};
  
  for(int i=1;i<3;i++){
    for(int j=1;j<3;j++){
      if(c.at(i).at(j) != a.at(i) + b.at(j)){
        result = false;
        break;
      }
    }
    if(!result) break;
  }
  if(result){
    cout << "Yes";
  }else{
    cout << "No";
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>

int main()
{
    int a, b, c, d;

    std::cin >> a >> b >> c >> d;

    while (true) {
        c -= b;
        if (c <= 0) {
            std::cout << "Yes" << std::endl;
            return 0;
        }
        a -= d;
        if (a <= 0) {
            std::cout << "No" << std::endl;
            return 0;
        }
    }
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  ll n, a, m1, ans = 0;
  cin >> n;
  map<ll, ll, greater<ll>> mp;

  rep(i, n) cin >> a, mp[a]++;

  bool flg = true;
  for (auto m : mp) {
    if (m.second >= 4) {
      if (flg)
        cout << m.first * m.first << endl;
      else
        cout << m1 * m.first << endl;
      return 0;
    } else if (m.second >= 2) {
      if (flg) {
        m1 = m.first;
        flg = false;
      } else {
        cout << m1 * m.first << endl;
        return 0;
      }
    }
  }

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


Measured memory_bytes: 6528
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x[1005],y[1005],z[1005];

ll b[1005];
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    int i,j;
    for(i=0;i<n;i++)
    {
        scanf("%lld%lld%lld",&x[i],&y[i],&z[i]);
    }
    int aa,bb,cc;
    ll ans=0;
    int mask;
    ll cur;
   
    for(mask = 0; mask < 8; mask++)
    {
        for(i=0;i<n;i++)
        {
             cur = 0;
            if(mask & 1)cur += x[i]; else cur -= x[i];
            if(mask & 2)cur += y[i]; else cur -= y[i];
            if(mask & 4)cur += z[i]; else cur -= z[i];
            b[i] = cur;
        }
        sort(b, b+n);
        reverse(b, b+n);
        cur = 0;
                 for(i=0;i<m;i++)
            {
                cur += b[i];
            }
           
    ans = max(ans, cur);
    }
    printf("%lld\n",ans);
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int long long

template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
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;
}

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

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

    int N;
    cin >> N;

    vector<pii> pi(N);
    REP(i, N) {
        int a;
        cin >> a;
        pi[i] = make_pair(a, i);
    }
    
    sort(ALL(pi), greater<>());

    vvi dp(N+1, vi(N+1, 0));

    REP(i, N) REP(j, N-i) {
        chmax(dp[i+1][j], dp[i][j] + pi[i+j].first*(pi[i+j].second-i)); //left
        chmax(dp[i][j+1], dp[i][j] + pi[i+j].first*((N-1-j)-pi[i+j].second)); //right
    }

    int ans = 0;
    REP(i, N) ans = max(ans, dp[i][N-i]);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 34620
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using namespace boost::adaptors;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

int main() {
    ll n, m;
    cin >> n;
    unordered_map<string, ll> um{};
    for (auto &&i: boost::irange(0LL, n)){
        string s;
        cin >> s;
        if (!(um.insert(make_pair(s, 1LL)).second)){
            um.at(s)++;
        }
    }
    cin >> m;
    for (auto &&i: boost::irange(0LL, m)){
        string s;
        cin >> s;
        if (!(um.insert(make_pair(s, -1LL)).second)){
            um.at(s)--;
        }
    }
    ll maximum{0LL};
    for (auto &&p: um){
        maximum = max(maximum, p.second);
    }
    cout << maximum;
    return 0;
}

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

void winter_is_coming()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL );
}

int main()
{
    winter_is_coming();

    long long n,w,h,a,b,ans;
    cin>>n>>w>>h;
    a=n-w,b=n-h;
    ans=1+a*b+a+b;
    cout<<ans<<"\n";


   return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;


typedef long long i64;
const int inf = (int)1.05e9;


int main()
{
	vector<vector<int>> chs, pars;
	int n, m;

	scanf("%d%d", &n, &m);
	chs.resize(n);
	pars.resize(n);
	for(int i = 0; i < n - 1 + m; ++i) {
		int a, b;
		scanf("%d%d", &a, &b);
		a -= 1; b -= 1;
		chs[a].push_back(b);
		pars[b].push_back(a);
	}

	vector<int> rem(n);
	queue<int> q;

	for(int i = 0; i < n; ++i) {
		rem[i] = pars[i].size();
		if(rem[i] == 0) {
			q.push(i);
		}
	}

	vector<int> ord(n, -1);
	vector<int> ans(n, -1);
	int pos = 0;

	while(!q.empty()) {

		int v = q.front();
		q.pop();

		ord[v] = pos;
		pos += 1;

		int x = -1;
		for(auto w : pars[v]) {
			if(x == -1 || ord[w] > ord[x]) {
				x = w;
			}
		}

		ans[v] = x;

		for(auto w : chs[v]) {

			rem[w] -= 1;
			if(rem[w] == 0) {
				q.push(w);
			}
		}
	}

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

	return 0;
}

/* waffle */


Measured memory_bytes: 12928
#include <bits/stdc++.h>
using namespace std;
#define R(i,n) for(int i=0;i<(n);i++)
#define R1(i,n) for(int i=1;i<(n);i++)
#define Int(x) int x; scanf("%d",&x);
#define PS(x,c) printf("%d",x); if(c) printf(" ");
#define NL printf("\n")

int main() {
  Int(n);
  int arr[n], v, j;
  R(i,n) cin >> arr[i];

  R1(i,n) {
    R(k,n) { PS(arr[k], k<n-1); }
    NL;

    v = arr[i];
    j = i-1;
    while(j>=0 && arr[j]>v) {
      arr[1+j] = arr[j];
      j--;
    }
    arr[1+j] = v;
  }
  R(i,n) { PS(arr[i], i < n-1); }
  NL;

  return 0;
}

Measured memory_bytes: 1232
#include "bits/stdc++.h"
using namespace std;
#define int long long int
float distance(int x1, int y1, int x2, int y2) 
{ 
    // Calculating distance 
    return sqrt(pow(x2 - x1, 2) +  
                pow(y2 - y1, 2) * 1.0); 
} 
int factorial(int n) 
{ 
    // single line to find factorial 
    return (n==1 || n==0) ? 1: n * factorial(n - 1);  
}

signed main()
{
  int n;
  cin>>n;
   double x[n],y[n];

  for(int i=0;i<n;i++)
  {
  	cin>>x[i]>>y[i];
  }
  vector<int> vec(n);
  for(int i=0;i<n;i++)
  	vec[i]=i;
  double sum=0;
  do 
  {
    for(int i=0;i<n-1;i++)
    {
    	sum+=distance(x[vec[i+1]],y[vec[i+1]],x[vec[i]],y[vec[i]]);//linearly caluculating next permutations and summing the distance
    }

  }while(next_permutation(vec.begin(), vec.end()));
  double ans=sum/factorial(n);
  cout<<setprecision(10)<<ans<<endl;


	return 0;

}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        int[] asort = new int[n];
        int[] s = new int[n+1];
        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
            asort[i] = a[i];
        }
        sc.close();

        Arrays.sort(asort);

        int l = 0, r = n;
        long mans = 0;
        long m = ((long)n*(long)(n+1))%4 == 0 ? (long)n*(long)(n+1)/4 : (long)n*(long)(n+1)/4;

        while(r > l+1){
            int mid = (l+r)/2;
            int amid = asort[mid];
            for(int i=0; i<n; i++){
                if(a[i] >= amid){
                    s[i+1] = 1;
                }else{
                    s[i+1] = -1;
                }
            }
            for(int i=1; i<n+1; i++){
                s[i] = s[i-1] + s[i];
            }
            BinaryIndexTree bit = new BinaryIndexTree(2*n+1);
            mans = 0;
            for(int i=0; i<n+1; i++){
                mans += bit.sum(s[i] + n);
                bit.add(s[i]+n, 1);
            }
            if(mans >= m){
                l = mid;
            }else{
                r = mid;
            }
        }

        System.out.println(asort[l]);
    }
}

class BinaryIndexTree{
    private long[] bit;
 
    public BinaryIndexTree(int size){
        bit = new long[size];
    }

    public long sum(int i){
        long s = 0;
        while(i > 0){
            s += bit[i];
            i -= i & -i;
        }
        return s;
    }

    public void add(int i, long x){
        while(i < bit.length){
            bit[i] += x;
            i += i & -i;
        }
    }
}

Measured memory_bytes: 64732
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <random>

using namespace std;

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

    string s, t;
    cin >> s >> t;
    cout << t << s << endl;
}   


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm/sort.hpp>

using namespace std;
using boost::sort;
using boost::adaptors::reversed;

int main() {
    int x;
    cin >> x;
    cout << (x == 0) << endl;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 1ll<<59

int main(){
  ll i,j;
  vector<ll> v(3);

  cin>>v[0]>>v[1]>>v[2];
  
  sort(v.begin(),v.end());
  cout<<v[0]+v[1]<<endl;
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;
using static System.Math;


class Program
{
    static int N;
    static int K;
    static long[] a;

    static void Main()
    {
        string[] s = Console.ReadLine().Split();
        N = int.Parse(s[0]);
        K = int.Parse(s[1]);
        a = Console.ReadLine().Split().Select(long.Parse).ToArray();

        long ans = long.MaxValue;
        for (int f = 0; f < Pow(2, N); f++)
        {
            int c = 0;
            for (int i = 0; i < N; i++)
                c += ((f >> i) & 1) > 0 ? 1 : 0;
            if (c != K) continue;

            long high = 0;
            long cost = 0;
            for (int i = 0; i < N; i++)
            {
                if (((f >> i) & 1) == 0)
                {
                    high = Max(high, a[i]);
                    continue;
                }
                if (high < a[i])
                {
                    high = a[i];
                    continue;
                }
                else
                {
                    cost += high + 1 - a[i];
                    high++;
                }
            }

            ans = Min(ans, cost);
        }

        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 11348
n,a,b,c=map(int,input().split())
s=[""]*n
abc=dict()
abc["A"]=a
abc["B"]=b
abc["C"]=c

for i in range(n):
    s[i]=input()

t=[""]*n
yn=""
for i in range(n):
    if abc[s[i][0]]==abc[s[i][1]] and i<n-1:
#        print("1:　s:",s[i],"a:",abc["A"],"b:",abc["B"],"c:",abc["C"])
        if s[i][1] in s[i+1]:
#            print("2:　s:",s[i],"s[i+1]:",s[i+1],"i+1:",i+1)
            t[i]=s[i][1]
            abc[s[i][0]]-=1
            abc[s[i][1]]+=1
            if abc[s[i][0]]<0:
                yn="No"
                break            
        else:
#            print("3:　s:",s[i],"s[i+1]:",s[i+1],"i+1:",i+1)
            t[i]=s[i][0]
            abc[s[i][0]]+=1
            abc[s[i][1]]-=1
            if abc[s[i][1]]<0:
                yn="No"
                break
    elif abc[s[i][0]]>=abc[s[i][1]]:
        t[i]=s[i][1]
        abc[s[i][0]]-=1
        abc[s[i][1]]+=1
        if abc[s[i][0]]<0:
            yn="No"
            break
    else:
        t[i]=s[i][0]
        abc[s[i][0]]+=1
        abc[s[i][1]]-=1
        if abc[s[i][1]]<0:
            yn="No"
            break

#    print(t[i],"a:",abc["A"],"b:",abc["B"],"c:",abc["C"])
#print(t[i],"a:",abc["A"],"b:",abc["B"],"c:",abc["C"])
            
if yn=="No":
    print("No")
else:
    print("Yes")
    for i in range(n):
        print(t[i])
        

Measured memory_bytes: 17028
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>
#include <sstream>
#include <queue>
using namespace std;
typedef long long ll;

int main() {
  int d, t, s;
  cin >> d >> t >> s;

  if ((float(d) / float(s)) <= t) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
long long x,y;

long long n,t;

long long ans=0;
long long tt;
int main(){
    cin>>n>>t;
    ans+=t;
    ans+=n-t;
    x=t;
    y=n-t;
    while(x!=y){
        if(x<y){
            tt=(y-1)/x;
            y-=x*tt;
            ans+=2*x*tt;

        }
        else{
            tt=(x-1)/y;
            x-=y*tt;
            ans+=2*y*tt;

        }
    }
    ans+=x;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i ,n) for(int i = 1 ; i <(n) ; i ++ )
#define all(x) (x).begin(),(x).end()
using ll = long long;
using namespace std;

int main() {
 int n;
  cin>>n;
  string s;
  cin>>s;
  int ans=n;
  rep(i,n){
    if(s[i]==s[i-1]){ ans--;}

  }
  cout<<ans<<endl;
}

Measured memory_bytes: 512
//
//  first.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
#define ALL(x) (x).begin(), (x).end()
#define INF 1000000



int main()
{
    int N;
    cin >> N;
    int A;
    for (int i=0; i<N; i++) {
        cin >> A;
        if(A % 2 == 0){
            if (A % 3 != 0 && A % 5 != 0) {
                cout << "DENIED" << endl;
                return 0;
            }
        }
    }
    
    cout << "APPROVED" << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long ans;
int main()
{
	long long n,x,k;
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&x);
		k+=x;
		if(x==0)
		{
			ans+=k/2;
			k=0;
		}
	}
	ans+=k/2;
	k=0;
	printf("%lld",ans);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin>>s;
    if(s[2]==s[3]&&s[4]==s[5])cout<<"Yes";
    else
    cout<<"No";
    return 0;
}

Measured memory_bytes: 256
using System;

class main{
  static void Main (string[] args){
    string[] s = Console.ReadLine().Split(" ");
    int cnt = int.Parse(s[0]);
    int dist = int.Parse(s[1]);
    int ans = 0;
    
    for(int i = 1; i <= cnt; i++){
      string[] s2 = Console.ReadLine().Split(" ");
      double x = int.Parse(s2[0]);
      double y = int.Parse(s2[1]);
      
      if(CalcSqrt(x, y) <= dist)
        ans++;
    }
  　Console.WriteLine(ans);
  }
  
  public static double CalcSqrt (double x, double y){
    return Math.Sqrt(Math.Pow(x, 2) + Math.Pow(y, 2));
  }
}

Measured memory_bytes: 40664
import math
from sys import stdin

def length(u,v):
    x0=u[0]
    y0=u[1]
    x1=v[0]
    y1=v[1]
    return(math.sqrt(((x1-x0)**2+(y1-y0)**2)))

def s(a,b,c):
    l=length(a,b)
    m=length(b,c)
    n=length(c,a)
    o = (l+m+n)/2.0
    p=o*(o-l)*(o-m)*(o-n)
    q=math.sqrt(p)
    return(q)

if __name__ == "__main__": 
   eps=1e-5
   for line in stdin:
        v=list(map(float,line.split()))
        a=(v[0],v[1])
        b=(v[2],v[3])
        c=(v[4],v[5])
        p=(v[6],v[7])
        s0=s(a,b,c)
        s1=s(p,a,b)
        s2=s(p,b,c)
        s3=s(p,c,a)
        if abs(s0 - (s1+s2+s3))< eps:
            print("YES")
        else:
            print("NO")

Measured memory_bytes: 7704