akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
// #define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};

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; }

struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};



signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
    
    string s;
    cin>>s;
    ll n=s.size();
    rep(i,n){
        if(s[i]=='1') s[i]='9';
        else if(s[i]=='9') s[i]='1';
    }
    cout<<s<<endl;

    return 0;
}


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

class Vector2 {
public:
	int x;
	int y;
	Vector2(int a, int b) {
		x = a;
		y = b;
	}
};

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

	int x, y;
	cin >> x >> y;
	Vector2 v1(x, y);
	cin >> x >> y;
	Vector2 v2(x, y);
	
	Vector2 v12(v2.x - v1.x, v2.y - v1.y);
	Vector2 v23(-v12.y, v12.x);
	
	Vector2 v3(v2.x + v23.x, v2.y + v23.y);
	Vector2 v4(v1.x + v23.x, v1.y + v23.y);

	cout << v3.x << " " << v3.y << " " << v4.x << " " << v4.y << "\n";
	return 0;
}

Measured memory_bytes: 256
//VS2015エラー回避用
#define _CRT_SECURE_NO_WARNINGS 0 
//include
#include<stdio.h>
//関数プロトタイプ宣言
void probremA(void);
void probremB(void);
void probremC(void);
void probremD(void);

//メイン関数
int main(void) {
	//A問題
	probremA();

	//B問題
	//probremB();

	//C問題
	//probremC();

	//D問題
	//probremD();

//	getchar();
//	getchar();
	//終了
	return 0;
}
//A問題
void probremA(void) {
	
	char s[1001];	//入力文字列
	int pos[4] = {0,0,0,0};		//場所：N,S,E,W
	int count = 0;	//ループ用カウンタ
	//入力処理
	scanf("%s", s);

	//個数の計算
	while(s[count]!='\0') {
		//
		if (s[count] == 'N') {
			pos[0]=1;
		}else if (s[count] == 'S') {
			pos[1]=1;
		}else if (s[count] == 'E') {
			pos[2]=1;
		}else if (s[count] == 'W') {
			pos[3]=1;
		}
		//カウンタを増やす
		count++;
	}
	//出力処理
	if (pos[0] == 1 && pos[1] == 1 && pos[2] == 1 && pos[3] == 1) {
		printf("Yes");
	}else if (pos[0] == 1 && pos[1] == 1 && pos[2] == 0 && pos[3] == 0) {
		printf("Yes");
	}else if (pos[0] == 0 && pos[1] == 0 && pos[2] == 1 && pos[3] == 1) {
		printf("Yes");
	}else {
		printf("No");
	}
	
	return;
}
//B問題
void probremB(void) {
	return;
}
//C問題
void probremC(void) {
	return;
}
//D問題
void probremD(void) {
	return;
}


Measured memory_bytes: 128
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N)]
KOSU=0
money=0
flag=False
AB.sort()
for i in range(N):
  KOSU+=AB[i][1]
  money+=AB[i][0]*AB[i][1]
  if KOSU>=M:
    KOSU-=AB[i][1]
    money-=AB[i][0]*AB[i][1]
    money+=(M-KOSU)*AB[i][0]
    break
print(money)

Measured memory_bytes: 27880
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
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;

signed main()
{
    int N;
    string S, T;
    cin >> N;
    cin >> S >> T;
    rep(i, N)
    {
        cout << S[i] << T[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0, -1, 1, 0 };
const ll dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
using Graph = vector<vector<int>>;
ll mypow(ll x, ll n, ll m) {
	if (n == 0) {
		return 1;
	}
	if (n % 2 == 0) {
		return mypow(x*x%m, n / 2, m);
	}
	else {
		return x * mypow(x, n - 1, m) % m;
	}
}
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
///////////////////////////////////////


int main() {
	ll n, a, b; cin >> n >> a >> b;
	if (n == 2)cout << '0' << endl;
	else {
		ll key = mypow(2, n, INF) - (ll)1;
		key += INF;
		key%=INF;
		ll x = 1;
		ll y = 1;
		for (ll i = 1; i <= a; ++i) {
			x *= (n + 1 - i);
			x %= INF;
			x *= modinv(i, INF);
			x %= INF;
		}
		for (int i = 1; i <= b; ++i) {
			y *= (n + 1 - i);
			y %= INF;
			y *= modinv(i, INF);
			y %= INF;
		}
		cout << ((key-x+INF)%INF-y+INF)%INF << endl;
	}
	return 0;
}


Measured memory_bytes: 256
import java.lang.Math

fun main(args: Array<String>) {
    val (A, B, M) = readInputLine().split(" ").map { it.toInt() }
    val aArr = readInputLine().split(" ").map { it.toInt() }.toIntArray()
    val bArr = readInputLine().split(" ").map { it.toInt() }.toIntArray()

    var ans = aArr.min()!! + bArr.min()!!

    repeat(M) {
        val (x, y, c) = readInputLine().split(" ").map { it.toInt() }
        ans = Math.min(ans, aArr[x - 1] + bArr[y - 1] - c)
    }

    println(ans)
}

fun readInputLine(): String {
    return readLine()!!
}


Measured memory_bytes: 102172
#include <iostream>
#include <string>
#include <vector>
#include <tuple>
#include <algorithm>
#include <cassert>
#define REP(i,k,n) for(int(i)=(k);(i)<(n);++(i))
using namespace std;
 
string s;
int K;
 
int main()
{
  cin >> s >> K;
  int N = s.length();           // |s|
 
  // sの長さKまでの部分文字列
  vector<string> vec;
 
  REP(j,1,K+1) {
    REP(i,0,N) {
 
      string t = s.substr(i,j);
      if (t.length() == j) vec.push_back(t);
      else break;               // iからj文字取れなかった
 
    }
  }
 
  sort(vec.begin(), vec.end());
  unique(vec.begin(), vec.end());
 
  assert(vec.size() >= K);
  cout << vec[K - 1] << endl;
 
  return 0;
}

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

int main() {
    int n;
    cin >> n;
    string ans = "";
    rep(i,9)rep(j,9) {
        if ((i+1)*(j+1) == n) {
            ans = "Yes";
            goto TMP;
        } else ans = "No";
    }
    TMP:
    cout << ans << endl;
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

void print(const vector<int> &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  VI v(n);
  rep(i, n) cin >> v[i];
  map<int, int> mp1, mp2;
  for(int i = 0; i < n; i += 2) mp1[v[i]]++;
  for(int i = 1; i < n; i += 2) mp2[v[i]]++;
  int a1, a2, b1, b2;
  a1 = a2 = v[0];
  b1 = b2 = v[1];
  for(auto it : mp1) {
    if(mp1[a1] <= it.second) {
      a2 = a1;
      a1 = it.first;
    }
    else if(mp1[a2] <= it.second) a2 = it.first;
  }

  for(auto it : mp2) {
    if(mp2[b1] <= it.second) {
      b2 = b1;
      b1 = it.first;
    }
    else if(mp2[b2] <= it.second) b2 = it.first;
  }
  if(a1 == b1) {
    if(a1 == a2 && b1 == b2) out(n / 2);
    else if(a1 == a2) out(n - (mp1[a1] + mp2[b2]));
    else if(b1 == b2) out(n - (mp1[a2] + mp2[b1]));
    else mp1[a2] > mp2[b2] ? out(n - (mp1[a2] + mp2[b1])) : out(n - (mp1[a1] + mp2[b2]));
  }
  else out(n - (mp1[a1] + mp2[b1]));
  return 0;
}


Measured memory_bytes: 5376
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

vector<vector<long long int>> m;

long long int myc(int a, int b) {
    if (a < b) return 0;
    if (b == 1) return a;
    if (a == b) return 1;
    if (m[a][b] == -1) {
        m[a][b] = myc(a - 1, b - 1) + myc(a - 1, b);
    }
    return m[a][b];
}

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    m = vector<vector<long long int>> (n + 1, vector<long long int>(n + 1, -1));
    vector<long long int> v(n, 0);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    sort(v.begin(), v.end(), greater<long long int>());
    int flag = 1;
    for (int i = 1; i < n; i++) {
        if (v[i] == v[i - 1]) {
            flag++;
        } else{
            break;
        }
    }
    if (flag >= a) {
        cout << v[0] << endl;
        long long int res = 0;
        for (int i = a; i <= min(b, flag); i++) {
            res += myc(flag, i);
        }
        cout << res << endl;
        return 0;
    }
    int c1 = 0, c2 = 0;
    long long int s = 0;
    for (int i = 0; i < n; i++) {
        if (i < a) s += v[i];
        if (i < a && v[i] == v[a - 1]) c1++;
        if (i >= a && v[i] == v[a - 1]) c2++;
    }
    cout << setprecision(15) << s * 1.0 / a << endl;
    // c(c1 + c2, c1);
    cout << myc(c1 + c2, c1) << endl;
}


Measured memory_bytes: 3824
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    if(((a<0)&&(b>0))||a==0||b==0){
        cout<<"Zero"<<endl;
        return 0;
    }
    if(a>0){
        cout<<"Positive"<<endl;
        return 0;
    }
    if((b-a)%2){
        cout<<"Positive"<<endl;
        return 0;
    }else{
        cout<<"Negative"<<endl;
        return 0;
    }
    
    return 0;
}


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

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

  vector<int> data(N);
  for(int i=0; i<N; i++){
    cin >> data.at(i);
  }

  vector<int> dp(N, INT_MAX);
  dp.at(0)= 0;
  for(int n=1; n<N; n++){
    int sz_step= min(n,K);
    for(int s=1; s<=sz_step; s++){
      dp.at(n)= min(dp.at(n), dp.at(n-s)+ abs(data.at(n)- data.at(n-s)));
    }
  }

  cout << dp.back() << endl;
}

Measured memory_bytes: 3952
import numpy as np
N, D = map(int, input().split(" "))

X = [list(map(int, input().split(" "))) for _ in range(N)]

count = 0
for i in range(N):
    for j in range(i+1, N):
        x1 = X[i]
        x2 = X[j]
        dist = np.sqrt(sum([(x1[i] - x2[i]) ** 2 for i in range(D)]))
        if dist == int(dist):
            count += 1

print(count)

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

int f(int x) {
    int res = 0;
    while (x%2 == 0) {
        x /= 2;
        res++;
    }
    return res;
}

ll gcd(ll a, ll b)
{
    if (a < b) {
        a ^= b;
        b ^= a;
        a ^= b;
    }
    
    return b ? gcd(b, a % b) : a;
}

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

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

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

    // a -> a'
    rep(i, n) {
        if (a[i]%2 == 1) {
            cout << 0 << endl;
            return 0;
        }
        a[i] /= 2;
    }

    int t = f(a[0]);
    rep(i, n) {
        if (f(a[i]) != t) {
            cout << 0 << endl;
            return 0;
        }
        a[i] >>= t; // a[i] /= 2^t
    }
    m >>= t;

    ll l = 1;
    rep(i, n) {
        l = lcm(l, a[i]);
        if (l > m) {
            cout << 0 << endl;
            return 0;
        }
    }

    m /= l;
    int ans = (m+1)/2;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 640
class Tree():
    def __init__(self):
        self.nodes = {}
        self.root = None
        self.nodes[-1] = None

    def add_node(self, id):
        if id not in self.nodes:
            self.nodes[id] = Node(id)

    def add_child(self, parent_id, left_id, right_id):
        self.add_node(parent_id)
        self.add_node(left_id)
        self.add_node(right_id)
        self.nodes[parent_id].add_child(self.nodes[left_id], self.nodes[right_id])

    def set_root(self):
        for id in self.nodes:
            if id == -1:
                continue
            if self.nodes[id].parent is None:
                self.root = self.nodes[id]


class Node():
    def __init__(self, id):
        self.id = id
        self.parent = None
        self.right = None
        self.left = None

    def add_child(self, left, right):
        self.left = left
        self.right = right
        # -1ならNoneが代入される
        for c in [left, right]:
            if c:
                c.parent = self

    def pre_walk(self, ans):
        ans.append(self.id)
        if self.left:
            self.left.pre_walk(ans)
        if self.right:
            self.right.pre_walk(ans)

    def in_walk(self, ans):
        if self.left:
            self.left.in_walk(ans)
        ans.append(self.id)
        if self.right:
            self.right.in_walk(ans)

    def post_walk(self, ans):
        if self is None:
            pass
        else:
            if self.left:
                self.left.post_walk(ans)
            if self.right:
                self.right.post_walk(ans)
            ans.append(self.id)


n = int(input())
tree = Tree()
for i in range(n):
    tmp = list(map(int, input().split()))
    id = tmp[0]
    left, right = tmp[1:]
    tree.add_node(id)
    tree.add_child(id, left, right)

tree.set_root()
for i in range(3):
    ans = []
    if i == 0:
        print('Preorder')
        tree.root.pre_walk(ans)
    if i == 1:
        print('Inorder')
        tree.root.in_walk(ans)
    if i == 2:
        print('Postorder')
        tree.root.post_walk(ans)

    print('', *ans)



Measured memory_bytes: 5616
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define ld long double
#define mod 1000000007LL
#define eps 1e-13
// #define PI 3.141592653589793238L
#define INF 1000000011
#define INFLL 1000000000000000011LL
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define mp make_pair
#define F first
#define S second
#define pb push_back
#define fo(i,a,n) for(i = (a); i < (n); i++)
#define gtl(x) getline(cin, (x))
#define flsh fflush(stdout)
#define sws ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define gcd __gcd
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)((a).size())
#define io_file freopen("D:/Coding Problems/Contest/input_file.in", "r", stdin); freopen("D:/Coding Problems/Contest/output_file.out", "w", stdout)

ll modx(ll Base, ll exponent)
{
	ll ans = 1;
	if(Base == 1)
		return Base;
	while(exponent)
	{
		if(exponent & 1)
			ans = (ans * Base)%mod;
		Base = (Base * Base)%mod;
		exponent = exponent >> 1;
	}
	return ans;
}

ll inmodx(ll num)
{
	return (modx(num, mod-2LL));
}

bool cmp(pii a, pii b)//true for a before b
{
	if(a.S < b.S)
		return 1;
	if(a.S > b.S)
		return 0;
	if(a.F <= b.F)
		return 1;
	return 0;
}

const int N = (2e2) + 9;
const int M = (672*672) + 9;
const int LOGN = ((int)log2(N)) + 3;
const int LOGM = ((int)log2(M)) + 3;
const int BUCK = 900;



void solve()
{
	int n, l, i, j, sum = 0, val, ans = -1, VAL = INF;
	cin >> n >> l;
	fo(i,1,n+1)
		sum += (l+i-1);
	fo(i,1,n+1)
	{
		val = 0;
		fo(j,1,n+1)
			if(j != i)
				val += (l+j-1);
		if(abs(val-sum) < abs(VAL-sum))
		{
			VAL = val;
			ans = i;
		}
	}
	cout << VAL << '\n';
	return;
}

int main()
{
	sws;
	clock_t clk;
	clk = clock();
	// io_file;
	// srand(clock());

	//Code here
	int t = 1, cs;
	cout << fixed << setprecision(15);
	// cin >> t;
	fo(cs,1,t+1)
	{
		// cout << "Case #" << cs << ": ";
		solve();
	}
	// Code ends here

	clk = clock() - clk;
	cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int change[30][30];
	int saki[30];
	int i,j,max;
	int a,b;
	int maxyoko;
	int now;
	for(i=0;i<30;i++) {
		for(j=0;j<30;j++) {
			change[i][j]=i;
		}
	}
	scanf("%d",&max);
	scanf("%d",&maxyoko);
	for(i=0;i<maxyoko;i++) {
		scanf("%d,%d",&a,&b);
		change[a-1][i]=b-1;
		change[b-1][i]=a-1;
	}
	for(i=0;i<max;i++) {
		now=i;
		for(j=0;j<maxyoko;j++)now=change[now][j];
		saki[now]=i;
	}
	for(i=0;i<max;i++)printf("%d\n",saki[i]+1);
	return 0;
}

Measured memory_bytes: 0
#include <stdio.h>
int main(){
  int n;
  scanf("%d",&n);
  for(int i=1;i<=9;i++){
     for(int j=1;j<=9;j++){
       if(n==i*j){
         printf("Yes\n");
         return 0;
       }
  	}
  }
  printf("No\n");
  return 0;
}

Measured memory_bytes: 128
using System;
class _0010
{
    public static void Main()
    {
        char[] splitChar = {' '};
        int n = int.Parse(Console.ReadLine());
        string str;
        double calcAB, calcAC, det;
        for (int i = 0; i < n; i++)
        {
            str = Console.ReadLine();
            string[] dataSet = str.Split(splitChar);
            vector2 a = new vector2(double.Parse(dataSet[0]), double.Parse(dataSet[1]));
            vector2 b = new vector2(double.Parse(dataSet[2]), double.Parse(dataSet[3]));
            vector2 c = new vector2(double.Parse(dataSet[4]), double.Parse(dataSet[5]));
            vector2 ab = new vector2((b - a).getX, (b - a).getY);
            vector2 ac = new vector2((c - a).getX, (c - a).getY);
            vector2 mab = new vector2(((b + a) / 2.0).getX, ((b + a) / 2.0).getY);
            vector2 mac = new vector2(((c + a) / 2.0).getX, ((c + a) / 2.0).getY);
            calcAB = ab.getX * mab.getX + ab.getY * mab.getY;
            calcAC = ac.getX * mac.getX + ac.getY * mac.getY;
            det = ab.getX * ac.getY - ab.getY * ac.getX;
            vector2 O = new vector2((ac.getY * calcAB - ab.getY * calcAC) / det, (ab.getX * calcAC - ac.getX * calcAB) / det);
            vector2 aO = new vector2((O - a).getX, (O - a).getY);
            Console.WriteLine(O.getX.ToString("f3") + " " + O.getY.ToString("f3") + " " + aO.size.ToString("f3"));
        }
    }
}
class vector2
{
    private double x, y;
    public vector2() { x = 0.0; y = 0.0; }
    public vector2(double i, double j) { x = i; y = j; }
    public static vector2 operator +(vector2 op1, vector2 op2)
    {
        vector2 result = new vector2();
        result.x = op1.x + op2.x;
        result.y = op1.y + op2.y;
        return result;
    }
    public static vector2 operator -(vector2 op1, vector2 op2)
    {
        vector2 result = new vector2();
        result.x = op1.x - op2.x;
        result.y = op1.y - op2.y;
        return result;
    }
    public static vector2 operator /(vector2 op1, double op2)
    {
        vector2 result = new vector2();
        result.x = op1.x / op2;
        result.y = op1.y / op2;
        return result;
    }
    public double size
    {
        get
        {
            return Math.Sqrt(Math.Pow(x, 2.0) + Math.Pow(y, 2.0));
        }
    }
    public double getX{
        get{
            return x;
        }
    }
    public double getY{
        get{
            return y;
        }
    }
}

Measured memory_bytes: 5760
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(){
    int k;
    vector<int> hoge(5);
    for(int i=0;i<5;i++) cin>>hoge.at(i);
    
    cin>>k;
    
    bool ans=true;
    
    for(int i=0;i<5;i++){
        for(int j=0;j<5;j++){
            if(hoge[i]-hoge[j]>k) ans=false;
        }
    }
    
    if(ans) cout<<"Yay!"<<endl;
    else cout<<":("<<endl;
        
 return 0;   
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <string>
#define SIZE 200005
#define BT 256*1024*2

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

struct Q
{
	int mn,cnt;
	Q(int mn=0,int cnt=0):mn(mn),cnt(cnt){}
};
Q merge(Q l,Q r)
{
	Q ret;
	ret.mn=min(l.mn,r.mn);
	if(ret.mn==l.mn) ret.cnt+=l.cnt;
	if(ret.mn==r.mn) ret.cnt+=r.cnt;
	return ret;
}
struct segtree
{
	Q seg[BT];
	int add[BT];
	int mum;
	
	void init(int n)
	{
		mum=1;
		while(mum<n) mum<<=1;
		for(int i=0;i<n;i++) seg[i+mum-1]=Q(0,1);
		for(int i=n;i<mum;i++) seg[i+mum-1]=Q(BT,0);
		for(int i=mum-2;i>=0;i--)
		{
			seg[i]=merge(seg[i*2+1],seg[i*2+2]);
		}
		memset(add,0,sizeof(add));
	}
	void update(int a,int b,int k,int l,int r,int v)
	{
		if(b<=l||r<=a) return;
		if(a<=l&&r<=b)
		{
			add[k]+=v;
			seg[k].mn+=v;
		}
		else
		{
			update(a,b,k*2+1,l,(l+r)/2,v);
			update(a,b,k*2+2,(l+r)/2,r,v);
			seg[k]=merge(seg[k*2+1],seg[k*2+2]);
			seg[k].mn+=add[k];
		}
	}
	void update(int a,int b,int v)
	{
		update(a,b,0,0,mum,v);
	}
	int get()
	{
		return seg[0].mn==0?seg[0].cnt:0;
	}
};
segtree seg;
int C[SIZE];
int A[SIZE];

void ins(int c)
{
	int l=max(0,c-C[c]+1),r=c;
	if(l<=r) seg.update(l,r+1,1);
}
void rem(int c)
{
	int l=max(0,c-C[c]+1),r=c;
	if(l<=r) seg.update(l,r+1,-1);
}
int main()
{
	int n,m;
	scanf("%d %d",&n,&m);
	for(int i=0;i<n;i++)
	{
		int a;
		scanf("%d",&a);a--;
		C[a]++;
		A[i]=a;
	}
	seg.init(n);
	for(int i=0;i<n;i++) ins(i);
	for(int i=0;i<m;i++)
	{
		int x,y;
		scanf("%d %d",&x,&y);x--,y--;
		rem(A[x]);
		C[A[x]]--;
		ins(A[x]);
		rem(y);
		C[y]++;
		ins(y);
		A[x]=y;
		printf("%d\n",seg.get());
	}
	return 0;
}


Measured memory_bytes: 9088
import java.util.*;

public class Main {
  public static ArrayList[] edge;
  public static HashMap[] c;
  public static int K;
  public static int[] used;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    edge = new ArrayList[n];
    c = new HashMap[n];
    K = 0;
    int[] seen = new int[n];
    used = new int[n];
    int[] a = new int[n - 1];
    int[] b = new int[n - 1];
    for(int i = 0; i < n; i++) {
      edge[i] = new ArrayList<Integer>();
      c[i] = new HashMap<Integer, Integer>();
    }
    for(int i = 0; i < n - 1; i++) {
      a[i] = sc.nextInt() - 1;
      b[i] = sc.nextInt() - 1;
      edge[a[i]].add(b[i]);
      edge[b[i]].add(a[i]);
    }
    for(int i = 0; i < n; i++) {
      K = Math.max(K, edge[i].size());
    }
    Queue<Integer> q = new LinkedList<Integer>();
    q.add(0);
    seen[0] = 1;
    while(!q.isEmpty()) {
      int t = q.poll();
      int p = 1;
      for(int i = 0; i < edge[t].size(); i++) {
        int u = (int)(edge[t].get(i));
        if(seen[u] == 0) {
        seen[u] = 1;
        q.add(u);
        for(int j = p; j <= K; j++) {
          if(j != used[t]) {
            used[u] = j;
            p = j + 1;
            c[t].put(u, j);
            c[u].put(t, j);
            break;
          } 
        }
        }
      } 
    }
    System.out.println(K);
    for(int i = 0; i < n - 1; i++) {
      System.out.println(c[a[i]].get(b[i]));
    }
  }
}

Measured memory_bytes: 109084
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


class Mod:
    def __init__(self, m):
        self.m = m

    def add(self, a, b):
        return (a + b) % self.m

    def sub(self, a, b):
        return (a - b) % self.m

    def mul(self, a, b):
        return ((a % self.m) * (b % self.m)) % self.m

    def div(self, a, b):
        return self.mul(a, pow(b, self.m-2, self.m))

    def pow(self, a, b):
        return pow(a, b, self.m)


@mt
def slv(L):
    M = Mod(10**9 + 7)
    dp = [[0] * (len(L)+1) for _ in range(2)]
    dp[0][0] = 1
    dp[1][0] = 0

    for i, l in enumerate(map(int, L)):
        if l == 1:
            dp[0][i+1] = M.mul(dp[0][i], 2)
            dp[1][i+1] = M.add(M.add(dp[0][i], dp[1][i]), M.mul(dp[1][i], 2))
        else:
            dp[0][i+1] = dp[0][i]
            dp[1][i+1] = M.mul(dp[1][i], 3)
    return M.add(dp[0][len(L)], dp[1][len(L)])


def main():
    L = read_str()
    print(slv(L))


if __name__ == '__main__':
    main()


Measured memory_bytes: 13876
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
using namespace std;
typedef long long LL;
const int N=2e5;
int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}
int a[N],b[N],c[N];
int suf[N],d[N],f[N];
pair<int,int>p[N];
int head[N],nxt[N];
bool side[N];
#define x first
#define y second
int main()
{
	int n=gi(),m,i,j,s,l,r,all=0,cur=0;
	priority_queue< pair<int,int> >q;
	for (i=1;i<=n;i++) a[i]=gi(),b[i]=gi();
	for (i=1;i<=n+1;i++) c[i]=gi();
	sort(c+1,c+1+n+1);
	for (i=1;i<=n;i++) {
		a[i]=lower_bound(c+1,c+1+n+1,a[i])-c;
		b[i]=lower_bound(c+1,c+1+n+1,b[i])-c;
		d[a[i]-1]--;
		if (b[i]<a[i])
			nxt[i]=head[a[i]-1],head[a[i]-1]=i;
		side[i]=true;
	}
	for (s=-1,i=n+1;i;i--,s++) {//一开始多了一个,每一轮可以抵消一个
		s+=d[i];
		for (j=head[i];j;j=nxt[j]) q.push(make_pair(-b[j],j));
		while (s<-1) //如果<-1则必须把某一个变小
			if (q.empty()||-q.top().x>i) { for (m=gi();m--;) puts("-1"); return 0; }
			else side[q.top().y]=false,s++,d[i]++,d[-q.top().x-1]--,all++,q.pop();
	}
	m=gi();
	for (i=n+1;i>=0;i--) d[i]=0;
	for (i=1;i<=n;i++) d[side[i]?a[i]:b[i]]++;
	for (i=2;i<=n+1;i++) d[i]+=d[i-1];
	while (!q.empty()) q.pop();
	for (i=n+1;i;i--) head[i]=0;
	for (i=1;i<=n;i++) if (side[i]) nxt[i]=head[b[i]],head[b[i]]=i;
	for (i=1;i<=n+1;i++) {
		for (j=head[i];j;j=nxt[j]) q.push(make_pair(a[j]-1,j));
		f[i]=f[i-1];
		if (d[i]-i==-1&&cur<i) {
			if (q.empty()||q.top().x<i) f[i]=1<<30;
			else cur=q.top().x,f[i]++,q.pop();
		}
	}
	while (m--) {
		l=lower_bound(c+1,c+1+n+1,gi())-c;
		r=lower_bound(c+1,c+1+n+1,gi())-c;
		l=f[l-1]+all;
		r=f[r-1]+all;
		l=min(l,r+1);
		if (l>n+1) puts("-1");
		else printf("%d\n",n+1-l);
	}
	return 0;
}


Measured memory_bytes: 7540
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		while (sc.hasNext()) {
			String str = sc.next();
			String str2 = "";
			
			for (int i = 0; i < str.length(); i++) {
				if (str.charAt(i) == '@') {
					i++;
					int n = str.charAt(i) - '0';
					i++;
					for (int j = 0; j < n; j++) {
						str2 += str.charAt(i);
					}
				} else {
					str2 += str.charAt(i);
				}
			}
			System.out.println(str2);
		}
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
#define rep(i,l,r) for(int i=l; i<(int)(r); i++)
#define rep_eq(i,l,r) for(int i=l; i<=(int)(r); i++)
#define all(vec) vec.begin(),vec.end()
using namespace std;

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

using ll=long long;

using vb=vector<bool>;
using vi=vector<int>;
using vll=vector<ll>;
using vvi=vector<vi>;
using vs=vector<string>;

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

  int MAX=101010;
  vb is_prime(MAX, true);
  is_prime[0]=false, is_prime[1]=false;
  rep(i,2,MAX) {
    if (!is_prime[i]) {continue;}
    for (int j=i*2; j<MAX; j+=i) {is_prime[j]=0;}
  }

  vi a(MAX);
  rep(i,0,MAX) {
    if (i%2==0) {continue;}
    if (is_prime[i] && is_prime[(i+1)/2]) {a[i]=1;}
  }

  vi s(MAX+1);
  rep(i,0,MAX) {s[i+1]=s[i]+a[i];}

  int Q; cin >>Q;
  rep(q,0,Q) {
    int l,r; cin >>l >>r;
    cout <<s[r+1]-s[l] <<'\n';
  }

  return 0;
}


Measured memory_bytes: 3852
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9+7;
//const long long MOD = ;
const long long INF_LL = 1e18+3; const int INF_int = 1e9+3;
#define ll long long
#define rep(i,n) for(int i = 0;i<n;i++)
#define lrep(i,n) for(long long i = 0;i<n;i++)
#define All(a) a.begin(),a.end()
#define Debug_Output_ALL(a) for(auto itr = a.begin();itr!=a.end();itr++) cout << *itr << " ";cout << endl;
int main(){
    int n;
    cin >> n;
    vector<ll> a(n+1);
    rep(i,n+1) cin >> a[i];
    ll ans = 0;
    if(n==0){
        if(a[0]==1){
        cout << 1 << endl;
        return 0;            
        }
        else{
            cout << -1 << endl;
            return 0;
        }
    }
    if(a[0]!=0){
        cout << -1 << endl;
        return 0;
    }
    vector<ll> acc_a(n+2);
    acc_a[n+1]=0;
    for(int i = n;i>=0;i--){
        acc_a[i]=acc_a[i+1]+a[i];
    }
    ll now = 1;
    for(int i = 0;i<=n;i++){
        ans+=now;
        now-=a[i];
        if(now==0 && i!=n){
            cout << -1 << endl;
            return 0;
        }
        if(now<0){
            cout << -1 << endl;
            return 0;
        }
        if(now!=0 && i==n){
            cout << -1 << endl;
            return 0;
        }
        ll possible = min(2*now,acc_a[i+1]);
        now = possible;
    }
    cout << ans << endl;

}

Measured memory_bytes: 4844
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <cmath>
using namespace std;
typedef long long ll;
const int maxn = 45;



int main() {
#ifdef suiyuan2009
  freopen("in.cpp","r",stdin);
#endif // suiyuan2009
  string s;
  cin>>s;
  bool sign=0;
  for(int i=0;i+1<s.size(); i++)
    if(s[i]=='A'&&s[i+1]=='C') {
      sign=1;
      break;
    }
  if(sign)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}



Measured memory_bytes: 256
import math
from itertools import permutations

def calc_distance(p1,p2):
    return  math.sqrt((p2[0]-p1[0])**2+(p2[1]-p1[1])**2)

def calc_distance_sum(position_arr,idx_arr):
    distance_sum = 0
    for i in range(len(idx_arr)-1):
        distance_sum += calc_distance(position_arr[idx_arr[i]],position_arr[idx_arr[i+1]])
    return distance_sum

if __name__ == "__main__":
    N = int(input())
    idx_list = [i for i in range(N)]
    idx_pattern_arr = list(permutations(idx_list))
    position_arr = [tuple(map(int,input().split())) for i in range(N)]
    distance_sum = 0
    for idx_pattern in idx_pattern_arr:
        distance_sum += calc_distance_sum(position_arr,idx_pattern)
    print(distance_sum/len(idx_pattern_arr))
    

Measured memory_bytes: 13816
#include <stdio.h>

double mk_func(double x, double x1, double y1, double x2, double y2) {
	return (y1 - y2) / (x1 - x2) * (x - x1) + y1;
}

int main() {
	double x1, x2, x3, x4, y1, y2, y3, y4;

	while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4) != EOF) {
		if((mk_func(x2, x1, y1, x3, y3) - y2) * (mk_func(x4, x1, y1, x3, y3) - y4) > 0)
			printf("NO\n");
		else if((mk_func(x1, x2, y2, x4, y4) - y1) * (mk_func(x3, x2, y2, x4, y4) - y3) > 0)
			printf("NO\n");

		else
			printf("YES\n");
	}

	return 0;
}

Measured memory_bytes: 604
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 300

enum Type{
	IN,
	OUT,
};

struct Edge{
	Edge(int arg_to,int arg_capacity,int arg_rev_index){
		to = arg_to;
		capacity = arg_capacity;
		rev_index = arg_rev_index;
	}
	int to,capacity,rev_index;
};

struct Info{
	int from,to;
};

int V;

vector<Edge> G[NUM];
int dist[NUM];
int cheked_index[NUM];
Info info[6000];

void add_edge(int from,int to,int capacity){
	G[from].push_back(Edge(to,capacity,G[to].size()));
	G[to].push_back(Edge(from,0,G[from].size()-1));
}

void bfs(int source){
	for(int i = 0; i < V; i++)dist[i] = -1;
	queue<int> Q;
	dist[source] = 0;
	Q.push(source);

	while(!Q.empty()){
		int node_id = Q.front();
		Q.pop();
		for(int i = 0; i < G[node_id].size(); i++){
			Edge &e = G[node_id][i];
			if(e.capacity > 0 && dist[e.to] < 0){
				dist[e.to] = dist[node_id]+1;
				Q.push(e.to);
			}
		}
	}
}

int dfs(int node_id,int sink,int flow){
	if(node_id == sink)return flow;

	for(int &i = cheked_index[node_id]; i < G[node_id].size(); i++){
		Edge &e = G[node_id][i];
		if(e.capacity > 0 && dist[node_id] < dist[e.to]){
			int tmp_flow = dfs(e.to,sink,min(flow,e.capacity));
			if(tmp_flow > 0){
				e.capacity -= tmp_flow;
				G[e.to][e.rev_index].capacity += tmp_flow;
				return tmp_flow;
			}
		}
	}
	return 0;
}

int max_flow(int source,int sink){
	int flow = 0,add;
	while(true){
		bfs(source);
		if(dist[sink] < 0)break;
		for(int i = 0; i < V; i++)cheked_index[i] = 0;
		while((add = dfs(source,sink,BIG_NUM)) > 0){
			flow += add;
		}
	}
	return flow;
}

int main(){

	int N,M;
	scanf("%d %d",&N,&M);

	int source = 0,sink = 2*N;
	int index_table[100][2];
	for(int i = 0; i < N; i++){
		index_table[i][IN] = 2*i;
		index_table[i][OUT] = 2*i+1;
	}

	V = 2*N+1;

	for(int i = 0; i < M; i++){
		scanf("%d %d",&info[i].from,&info[i].to);
		info[i].from--;
		info[i].to--;

		if(i == 0){
			printf("No\n");
			continue;
		}

		for(int k = 0; k < NUM; k++)G[k].clear();

		add_edge(index_table[0][IN],index_table[0][OUT],2); //行きと帰りで流量2
		for(int k = 1; k < N; k++){
			add_edge(index_table[k][IN],index_table[k][OUT],1); //各町の入次ノードと出次ノードを結ぶ
		}

		for(int k = 0; k < i; k++){
			add_edge(index_table[info[k].from][OUT],index_table[info[k].to][IN],1);
			add_edge(index_table[info[k].to][OUT],index_table[info[k].from][IN],1);
		}

		add_edge(index_table[info[i].from][OUT],sink,1);
		add_edge(index_table[info[i].to][OUT],sink,1);

		if(max_flow(source,sink) == 2){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}

	return 0;
}



Measured memory_bytes: 3336
#if 0

#endif

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int Q;
int L[1000+10][1000+10];

int main() {
  cin >> Q;
  string X, Y;
  for (int i = 0; i < Q; i++) {
    for (int j = 0; j < 1000+10; j++) {
      L[0][j] = 0; L[j][0] = 0;
    }
    cin >> X >> Y;
    for (int x = 1; x <= X.length(); x++) {
      for (int y = 1; y <= Y.length(); y++) {
        if (X[x-1] == Y[y-1])
          L[x][y] = L[x-1][y-1] + 1;
        else
          L[x][y] = max(L[x-1][y], L[x][y-1]);
      }
    }
    cout << L[X.length()][Y.length()] << endl;
  }
}



Measured memory_bytes: 7212
//専用ライブラリ
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll>P;
#define INF 10e12
#define MOD 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define fi first
#define se second
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define PI acos(-1.0)
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/GCD(a,b)*b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int cmp(P a,P b){
        if(a.fi!=b.fi)
        return a.fi>b.fi;
        else
        return a.se<b.se;
}
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    int k;
    cin>>k;
    int dp[5];
    dp[0]=a;
    dp[1]=b;
    dp[2]=c;
    dp[3]=d;
    dp[4]=e;
    bool abc=true;
    for(int i=0;i<4;i++)
        for(int j=i+1;j<5;j++)
        {
            if(dp[j]-dp[i]>k)
                abc=false;
        }
    if(abc==true)
        cout<<"Yay!"<<endl;
    else
        cout<<":("<<endl;
    return 0;
}



Measured memory_bytes: 256
N, M = map(int, raw_input().split())
D = [map(int, raw_input().split()) for _ in range(M)]

score = [None for _ in range(N+1)]
score[1] = 0

for _ in range(N):
    for a, b, c in D:
        if score[a] != None:
            score[b] = max(score[b], score[a] + c)
v1 = score[-1]
for _ in range(N):
    for a, b, c in D:
        if score[a] != None:
            score[b] = max(score[b], score[a] + c)
v2 = score[-1]

if v1 != v2:
    print "inf"
else:
    print v2


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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"

// イテレータ要素のインデックス
distance(A.begin(), itr);
*/

int main()
{
    string s; cin >> s;
    int n = s.size();
    string t = "";
    rep(i,n) t += 'x';
    cout << t << endl;
}

Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
const lint MOD = pow(10, 9) + 7;

int main() {
	int N;
	cin >> N;
	vector<int>V(N);
	rep(i, N) {
		cin >> V[i];
	}
	vector<int>m(N);
	m[0] = V[0];
	for (int i = 1; i < N; i++) {
		m[i] = min(m[i - 1], V[i]);
	}
	int ans =INT_MAX*(-1);
	for (int i = 1; i < N;i++) {
		ans = max(ans, V[i] - m[i-1]);
	}
	cout << ans << endl;
}


Measured memory_bytes: 4380
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1LL << 60;
template<class T> inline bool chmin(T& a,T b){
    if( a > b) {a = b; return 1; } return 0;
}
int dp[100001];
int h[100001];
signed main(){
    int n,k;
    cin >> n >> k;
    for(int i = 0; i < n; i++){
        cin >> h[i];
    }
    for(int i = 0; i < 100001; i++){
        dp[i] = INF;
    }
    dp[0] = 0;
    for(int i = 0; i < n; i++){
        for(int j = 1; j <= k; j++){
            chmin(dp[i + j],dp[i] + abs(h[i] - h[i + j]));
        }
    }
    cout << dp[n - 1] << endl;
}


Measured memory_bytes: 1792
<?php

class Scanner
{
    private $arr = [];
    private $count = 0;
    private $pointer = 0;

    public function next()
    {
        if ($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(' ', $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        ++$this->pointer;

        return $result;
    }

    public function hasNext()
    {
        return $this->pointer < $this->count;
    }

    public function nextInt()
    {
        return (int) $this->next();
    }

    public function nextDouble()
    {
        return (float) $this->next();
    }
}

$sc = new Scanner();
$n = $sc->nextInt();
$k = $sc->nextInt();
$sum = 0;

for($i=0;$i<$n;$i++){
    $height = $sc->nextInt();
    if($height >= $k){
        ++$sum;
    }
}

echo $sum.PHP_EOL;

Measured memory_bytes: 22552
#include <bits/stdc++.h>
#define rep(i, a) for(int i = 0; i < a; i++)
#define all(v) v.begin(), v.end()
#define dcout cout << fixed << setprecision(15)
#define arep(i, a) for(auto i : a)
#define F first
#define S second
#define VE vector<int>
#define pb(x) push_back(x)
#define MOD 1000000007
#define INF 10000000000
#define int long long
#define KETA(n) floor(log10(n) + 1)
using namespace std;
signed main() {
    int n;
    cin >> n;
    cout << "ABC" << n << endl;
    return 0;
}

Measured memory_bytes: 256
//
// UVA 1627
// 思路：
// 每一个人都可以讲所有人分为两组，认识的和不认识的。
// 认识的可能不在一个组中，但不认识的必然不在一组中。
//
// 所以第一步，如果可以生成二分图，则统计每部分的数量，求差。
// 利用差，转换为 0 1 背包问题，进行计算。
//
// 类似的问题可以看一下 Uva 323（更难）
//
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <vector>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int maxx = 105;


int main() {
    //freopen("../input.txt", "r", stdin);
    //freopen("../output.txt", "w", stdout);
    string s;
    int x;
    while (cin >> x) {
        cin >> s;
        if (x < 3200) cout << "red" << endl;
        else cout << s;
    }
    return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define EPS 0.0000000001

int main(){
  
  cout << fixed;
  cout << setprecision(10);
  
  long double a, b;
  long double x, y;
  cin >> a >> b >> x;
  y = a * a * b;
  
  long double xx, yy;
  xx = x / a;
  yy = y / a;
  
  long double h, w, theta;
  h = b - x / (a * a);
  
  if (h > b / 2.0) {
    long double d = 0.0, u = 90.0;
    int i = 0;
    while (i < 10000000) {
      theta = (d + u)/ 2.0;
      if (abs(xx - b / tan(theta * M_PI / 180.0) * b / 2.0) < EPS) break;
      if (b / tan(theta * M_PI / 180.0) * b / 2.0 < xx) u = theta;
      else d = theta;
      i++;
    }
    //w = 2.0 * xx / h;
    //theta = atan2(w , h);
    //cout << (M_PI / 2.0 - theta) / M_PI * 180.0;
    cout << theta;
    return 0;
  } else {
    w = a;
    theta = atan2(2.0 * h, w);
    cout << theta / M_PI * 180.0;
    return 0;
  }
  
  return 0;
}


Measured memory_bytes: 256
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.bigint, std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static File _f;
void file_io(string fn) { _f = File(fn, "r"); }
static string[] s_rd;
T _RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T _RD(T = long)(File f) { while(!s_rd.length) s_rd = f.readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T[] _RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[] _RDA(T = long)(File f, T fix = 0) { auto r = f.readln.chomp.split.to!(T[]); r[] += fix; return r; }
T RD(T = long)() { if (_f.isOpen) return _RD!T(_f); else return _RD!T; }
T[] RDA(T = long)(T fix = 0) { if (_f.isOpen)  return _RDA!T(_f, fix); else return _RDA!T(fix); }

size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

void chmin(T)(ref T x, T y) { x = min(x, y); } void chmax(T)(ref T x, T y) { x = max(x, y); }
bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
T lcm(T)(T x, T y) { return x * (y / gcd(x, y)); }

long mod = 10^^9 + 7;
//long mod = 998_244_353;
//long mod = 1_000_003;
void moda(T)(ref T x, T y) { x = (x + y) % mod; }
void mods(T)(ref T x, T y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(T)(ref T x, T y) { x = (x * y) % mod; }
void modpow(T)(ref T x, T y) { if (!y) { x = 1; return; } auto t = x; x.modpow(y>>1); x.modm(x); if (y&1) x.modm(t); }
void modd(T)(ref T x, T y) { y.modpow(mod - 2); x.modm(y); }

void main()
{
	auto K = RD;

	auto seven = 7 % K;
	auto ten = 10 % K;

	auto used = new bool[](K);
	long x = seven;
	long ans = 1;
	while (true)
	{
		if (x == 0) break;
		used[x] = true;
		x = (x * ten + seven) % K;
		if (used[x])
		{
			ans = -1;
			break;
		}
		++ans;
	}

	writeln(ans);
	stdout.flush;
	debug readln;
}

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod =(1e9)+7;
using P = pair<ll,ll>;

ll calc(ll x){
    ll ans;
    if(x%2==0){
        ans=(x/2)%2==0?0:1;
    }
    else {
        ans=calc(x-1)^(x-1);
    }
    return  ans;
}

int main(){
    ll a,b;cin >>a>>b;
    ll ans=calc(b+1)^calc(a);
    cout <<ans <<endl;
    return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;

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

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

#define fa(x,v) for(auto x:v)
#define f(i,a,b) for(ll i=(ll)a;i<=(ll)b;i++)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i--)
#define spc " "
#define endl '\n'
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(s) (ll)int(s.length())
#define sz(v) (ll)int(v.size())
#define MOD 1000000007

void Fast_IO() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.in","r",stdin);
    freopen("output.out","w",stdout);
    freopen("debug.out","w",stderr);
    #endif
} 

// Code Here

int main()
{
    // Fast_IO();
    ll n; cin >> n;
    ll ac = 0, tle = 0, wa = 0, re = 0;
    f(_,1,n) {
    	string s; cin >> s;
    	if(s == "AC") ac++;
    	if(s == "TLE") tle++;
    	if(s == "WA") wa++;
    	if(s == "RE") re++;
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re;
    return 0;
}

Measured memory_bytes: 3632