akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define DeltaCube23 ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define minimum(a) *min_element(a.begin(), a.end())
#define maximum(a) *max_element(a.begin(), a.end())
#define MOD 1000000007
#define forf(i,a,b) for(int i = (a); i < (b); i++)
#define forr(i,a,b) for(int i = (a); i >= (b); i--)

typedef long long int lli;

using namespace std;

const int mx=2e6+5;

int main()
{
    DeltaCube23
	int t=1;
	//cin>>t;
	while(t--)
	{
	    int n;
	    cin>>n;
	    if(n>=30)
	    cout<<"Yes\n";
	    else
	    cout<<"No\n";
	}
	return 0;
}

Measured memory_bytes: 3648
def main():
    S = input()
    N = len(S)
    ans = 'Yes'
    a = S[:(N-1)//2]
    b = S[(N+3)//2 - 1:]
    if S != S[::-1]:
        ans = 'No'
    if a != a[::-1]:
        ans = 'No'
    if b != b[::-1]:
        ans = 'No'
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
while True:
    l = input().split()
    a =int(l[0])
    op = (l[1])
    b = int(l[2])
    
    if op == "+":
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op =='/':
        print(a // b)
    else:
       break


Measured memory_bytes: 5592
//code by lynmisakura.wish to be accepted!
/****************************/
#include<iostream>
#include<iomanip>
#include<math.h>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<bitset>
#include <climits>
#include<set>
#include<bitset>
using namespace std;
/***************************/
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int, int> pi;
typedef vector<pair<int, int>> vpi;

const long long INF = 1LL << 55;

#define itn int
#define endl '\n'
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define dup(x,y) ((x) + (y) - 1)/(y)
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(int i = 0;i < n;i++)
#define rep(i,n) for(int i = 0;i < n;i++)
#define rrep(i,n) for(int i = n - 1;i >= 0;i--)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, int mo) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }

#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int s[100010];
int main(void){
   int n;cin >> n;
   rep(i,n){
      int a;cin >> a;
      s[a] = i + 1;
   }
   rep(i,n){
      cout << s[i+1] << endl;
   }
   return 0;
}

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

namespace _0228
{
    class Program
    {
        static void Main(string[] args)
        {
            bool t = true;
            bool f = false;
            bool[,] Segments = new bool[,]{
                { t, t, t, t, t, t, f },
                { f, t, t, f, f, f, f },
                { t, t, f, t, t, f, t },
                { t, t, t, t, f, f, t },
                { f, t, t, f, f, t, t },
                { t, f, t, t, f, t, t },
                { t, f, t, t, t, t, t },
                { t, t, t, f, f, t, f },
                { t, t, t, t, t, t, t },
                { t, t, t, t, f, t, t }
            };
            while (true)
            {
                int n = int.Parse(Console.ReadLine());
                if (n == -1) break;
                bool[] now = new bool[7];
                for (int j = 0; j < n; j++)
                {
                    int x = int.Parse(Console.ReadLine());
                    string s = null;
                    for (int i = 0; i < 7; i++)
                    {
                        s += now[i] == Segments[x, i] ? 0 : 1;
                        now[i] = Segments[x, i];
                    }
                    char[] c = s.ToCharArray();
                    Array.Reverse(c);
                    Console.WriteLine(new string(c));
                }
            }
        }
    }
}

Measured memory_bytes: 9128
#include<bits/stdc++.h>
#define fi first
#define se second

using namespace std;
typedef pair<int,int>pi;

const int N=805,M=640005;

char s[N][N];
int n,m,K,ans,dis[N][N],ql,qr;
pi qu[M];

void bfs(int ux,int uy){
	memset(dis,-1,sizeof(dis));
	qu[ql=qr=1]={ux,uy};dis[ux][uy]=0;
	while(ql<=qr&&dis[qu[ql].fi][qu[ql].se]<=K){
		int x=qu[ql].fi,y=qu[ql].se;
		for(int dx:{-1,0,1})for(int dy:{dx?0:-1,dx?0:1})
			if(s[x+dx][y+dy]=='.'&&!~dis[x+dx][y+dy])
				dis[x+dx][y+dy]=dis[x][y]+1,qu[++qr]={x+dx,y+dy};
		ql++;ans=min(ans,min(min(x-1,n-x),min(y-1,m-y)));
	}
}

int main(){
	scanf("%d%d%d",&n,&m,&K);ans=min(n,m);
	for(int i=1;i<=n;i++)scanf("%s",s[i]+1);
	for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)if(s[i][j]=='S'){bfs(i,j);break;}
	printf("%d\n",1+(ans+K-1)/K);
	return 0;
}

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

class Edge {
 public:
  int source, target, cost;
  Edge(int source = 0, int target = 0, int cost = 0) :
    source(source), target(target), cost(cost) {
  }
  bool operator < (const Edge &e) const {
    return cost < e.cost;
  }
};

class DisjointSet {
 public:
  vector<int> rank, p;

  DisjointSet() {}
  DisjointSet(int size) {
    rank.resize(size, 0);
    p.resize(size, 0);
    for (int i = 0; i < size; ++i) {
      makeSet(i);
    }
  }

  void makeSet(int x) {
    p[x] = x;
    rank[x] = 0;
  }

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

  void unite(int x, int y) {
    link(findSet(x), findSet(y));
  }

  void link(int x, int y) {
    if (rank[x] > rank[y]) {
      p[y] = x;
    } else {
      p[x] = y;
      if (rank[x] == rank[y]) {
        rank[y]++;
      }
    }
  }

  int findSet(int x) {
    if (x != p[x]) {
      p[x] = findSet(p[x]);
    }
    return p[x];
  }
};


int kruskal(int n, vector<Edge>& edges) {
  int totalCost = 0;
  sort(edges.begin(), edges.end());
  DisjointSet dset = DisjointSet(n);

  for (int i = 0; i < edges.size(); i++) {
    Edge e = edges[i];
    if (!dset.same(e.source, e.target)) {
      totalCost += e.cost;
      dset.unite(e.source, e.target);
    }
  }
  return totalCost;
}

int main() {
  int n, e_num;
  cin >> n >> e_num;
  vector<Edge> edges;
  int source, target, cost;
  for (int i = 0; i < e_num; i++) {
    cin >> source >> target >> cost;
    edges.push_back(Edge(source, target, cost));
  }
  cout << kruskal(n, edges) << endl;
}



Measured memory_bytes: 4472
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        if(A > B*2){
            System.out.println(A - B*2);
        }else{
            System.out.println(0);
        }
    }
}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
int GCD(int x, int y) { return x ? GCD(y % x, x) : y; }


int main() {
    int N;
    long long sum = 0;
    cin >> N;
    vector<int> A(N);
    REP(i, N){
        REP(j, N){
            REP(k, N) {
                sum += GCD(GCD(i+1, j+1), k+1);
            }
        }
    }

    cout << sum << endl;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define ll int  
#define mp make_pair
#define pb push_back
#define INF LONG_MAX
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define Ma 1000000007 
#define PI 3.14159265
int main()
{
    ll x,y;
    cin>>x>>y;
    cout<<x+y/2<<endl;
    return 0;
}

Measured memory_bytes: 256
import numpy as np
import itertools

def check():
    N,M,X = map(int, input().split())
    A = np.array([[int(i) for i in input().split()] for _ in range(N)])
    total = np.sum(A,axis=0)
    flag = True if all((a>=X  for a in total[1:])) else False
    ans = total[0]

    if flag:
        for i in range(1,N+1):
            for v in itertools.combinations([i for i in range(N)], i):
                B = np.array([A[j] for j in v])
                total2 = np.sum(B, axis=0)
                sabun = total-total2
                if all(a>=X for a in sabun[1:]):
                    ans = min(ans, sabun[0])
    print(ans if flag else -1)
    
check()

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

int op(int a, int b){
    return max(a, b);
}

int e(){
    return 0;
}


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

    int n, k;
    cin >> n >> k;

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

    segtree<int, op, e> dp(330000);
    rep(i, n){
        int range_mx = dp.prod(max(0, a[i]-k), min(330000, a[i]+k+1));
        dp.set(a[i], max(dp.get(a[i]), range_mx+1));
    }

    cout << dp.all_prod() << endl;

    return 0;
}

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

using namespace std;
using ll = long long;
using v1 = vector<int>;
using vl = vector<long long>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

int main(){
	ll n;
	cin >> n;
	ll on = n;
	cout << n << ":";
	ll a = static_cast<ll>(sqrt(n));
	for(ll i = 2; i <=a; i++){
		while(n%i == 0){
			n /= i;
			cout << " " << i;
		}
		if(n == 1) break;
	}
	if(n != 1) cout << " " << n;
	cout << endl;
}



Measured memory_bytes: 3096
(defun split (x str)
  (let ((pos (search x str))
        (size (length x)))
    (if pos
      (cons (subseq str 0 pos)
            (split x (subseq str (+ pos size))))
      (list str))))

(setq *n* (read))
(setq *ai* (mapcar #'parse-integer (split " " (read-line))))

(defun my-denominator (n l)
  (if (equal (car l) nil)
    0
    (+ (/ n (car l)) (my-denominator n (cdr l)))
    ))

(defun my-numerator (l)
  (apply #'* l))

;(print (my-numerator *ai*))
;(print (my-denominator (my-numerator *ai*) *ai*))
(print (float (/ (my-numerator *ai*) (my-denominator (my-numerator *ai*) *ai*))))


Measured memory_bytes: 4328
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define all(a) (a).begin(), (a).end()


int main() {
    int A, B, C;
    cin >> A >> B >> C;
    cout << min(C, B / A) << endl;
}


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

using namespace std;
int n, ans = 0;
vector<int> a;
vector<int> b;
vector<int> c;
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		x--;
		a.push_back(x);
	}
	for (int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		b.push_back(x);
	}
	for (int i = 0; i < n - 1; i++)
	{
		int x;
		cin >> x;
		c.push_back(x);
	}
	for (int i = 0; i < n; i++)
	{
		ans += b[a[i]];
		if (i > 0 && a[i - 1] + 1 == a[i])
		{
			ans += c[a[i - 1]];
		}
	}
	cout << ans << "\n";
	return 0;
}

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

int main(){
    
    int L, R, d;
    cin >> L >> R >>d;

    int cnt = 0;
    for(int i=L; i<= R; i++){
        if(i%d == 0) cnt++;
    }

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

Measured memory_bytes: 3620
#include <bits/stdc++.h> 
#define int long long
#define quickie ios_base::sync_with_stdio(false); cin.tie(NULL);
#define rep(i, a, b) for(int i=a; i<b; i++)
#define rep1(i, a, b) for(int i=a; i<=b; i++)
#define repp(i, a, b) for(int i=b-1; i>=a; i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define db double
#define mi map<int, int>
#define mc map<char, int>
#define ms map<string, int>
#define vi vector<int>
#define qi queue<int>
#define MI(x) power(x, mod-2)
#define test int t; cin >> t;
//#define mod 1000000007LL
#define mod 998244353 
using namespace std;
int power(int x, int y) ;
int gcd(int a, int b) ;
#define pi 3.141592653589
 
signed main() {
    quickie
    int n ;
    cin >> n ;
    db g = 2*n*pi ;
    cout << fixed << setprecision(9) << g << "\n" ;
}
 
int power(int x, int y) {
    int res = 1; x %= mod;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % mod;
        y = y>>1;
        x = (x*x) % mod;
    }
    return res%mod;
}
 
int gcd(int a,int b){
    if(a==0) return b;
    return gcd(b%a,a);
}

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

using namespace std;

bool is_pow2(int n){
    for(int i=0;i<=sqrt(n)+1;i++){
        if (i*i==n) return true;
    }   
    return false;
}

int main() {
    string a,b;
    cin>>a>>b;
    int n=atoi((a+b).c_str());
    if(is_pow2(n))cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
	return 0;
}


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

#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define pii pair<int,int>

int N, X, Y;
int ans[2010];

signed main()
{
    cin >> N >> X >> Y;
    for(int i = 1; i <= N; i++)
    {
        vector<int> v(N + 1, -1);
        queue<pii> q;
        q.push({i, 0});
        while(!q.empty())
        {
            pii ele = q.front();
            q.pop();
            if(v[ele.first] == -1)
            {
                v[ele.first] = ele.second;
                if(ele.first != N)q.push({ele.first + 1, ele.second + 1});
                if(ele.first != 1)q.push({ele.first - 1, ele.second + 1});
                if(ele.first == X)q.push({Y, ele.second + 1});
                if(ele.first == Y)q.push({X, ele.second + 1});
                ans[ele.second]++;
            }
        }
    }

    for(int i = 1; i < N; i++)cout << ans[i] / 2 << endl;

    return 0;
}


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

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<pii> vpii;


#define MOD 1000000007
#define MAX 700010

long long int f[MAX] = {};
long long int rf[MAX] = {};

long long int pw(long long int x, long long int y) {
    long long ret = 1LL;

    for(long long int mask = 0; mask < 50; ++mask) {
        if(y >> mask & 1)
            ret = ret * x % MOD;
        x = x * x % MOD;
    }
    return ret % MOD;
}

long long int getComb(int n, int k) {
    if(k > n)
        return 0;
    long long int ret = f[n];
    ret = ret * rf[k] % MOD;
    ret = ret * rf[n - k] % MOD;
    return ret;
}

long long int initComb(int n) {
    rf[0] = f[0] = 1;
    for(int i = 1; i < n + 1; i++) {
        f[i] = f[i - 1] * i % MOD;
        rf[i] = pw(f[i], MOD - 2);
    }
    return 1;
}

const int mod = 1e9 + 7;

int main() {

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int x, y;
    cin >> x >> y;

    int z = (x + y);
    if (z % 3 != 0 or x < z / 3 or 2 * z / 3 < x or y < z / 3 or 2 * z / 3 < y) {
        cout << 0 << endl;
        return 0;
    }

    initComb(7e5);

    int l = x - z / 3;

    cout << getComb(z / 3, l) << endl;;

    return 0;
}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
 
using namespace std;
 
const long long MOD=1e9+7;
const double PI=3.14159265359;



int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin>>n;
    vector<vector<int>> v(2,vector<int>(n,0)), dp=v;
    
    
    
    for(int i=0; i<2; i++){
        for(int &j: v[i]){
            cin>>j;
        }
    }
    
    dp[0][0]=v[0][0];
    dp[1][0]=v[1][0]+v[0][0];
    for(int i=1; i<n; i++){
        dp[0][i]=dp[0][i-1]+v[0][i];
    }
    
    for(int i=1; i<n; i++){
        dp[1][i]=max(dp[0][i], dp[1][i-1])+v[1][i];
    }
    
    cout<<dp[1][n-1];
    
    
    
   
    
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>

int main()
{
  int n;
  scanf("%d", &n);
  int odd = 0;
  for (int i = 0; i < n; ++i)
  {
    int a;
    scanf("%d", &a);
    if (a & 1) ++odd;
  }
  puts(odd & 1 ? "NO" : "YES");
  return 0;
}

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

int main(){
    int N;
    long long K;
    int Q;
    cin >> N >> K >> Q;
    vector<int> A(Q);
    vector<long long> P(N);
    vector<int> num(N);
    int i;
    for(i=0;i<Q;i++){
        cin >> A[i];
        num[A[i]-1]++;
    }
    for(i=0;i<N;i++){
        P[i] = K - Q + num[i];
        if(P[i] > 0) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;

}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
#define MOD 1e9 + 7
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<ll, ll> P;
ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll char_to_ll(char c) { return (int)(c - '0'); }
ll string_to_ll(string s) { return char_to_ll(atoi(s.c_str())); }
bool is_prime(ll x){ if(x <= 1) return false; for(ll i = 2; sqrt(i) <= x; i++) if(x % i == 0) return false; return true; }


int main() {
    string a;
    cin >> a;
    int co = 0;
    FOR(i,0,a.size()){
        int j = a.size()-i-1;
        if(a.at(i) != a.at(j) && i < j) ++co;

    }
    cout << co << endl;

    

    return 0;
}



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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back

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

int cnt[5];

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    string s = "NWSE";
    string t;
    cin >> t;
    for(int i = 0;i < t.length();i++){
        for(int j = 0;j < s.length();j++){
            if(t[i] == s[j]){
                cnt[j]++;
            }
        }
    }
    if((cnt[0] > 0) != (cnt[2] > 0)){
        cout << "No" << endl;
        return 0;
    }
    if((cnt[1] > 0) != (cnt[3] > 0)){
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
    return 0;
}


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

#define dump(n) cout<<"# "<<#n<<'='<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

const int INF=1e9;
const int MOD=1e9+7;
const double EPS=1e-9;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
	os<<'[';
	rep(i,a.size()) os<<(i?" ":"")<<a[i];
	return os<<']';
}

bool ok(int w,const vi& sum,int sp)
{
	int n=sum.size()-1;
	
	//vi dp(n+1); dp[0]=1;
	static int dp[50001];
	dp[0]=1;
	
	int l=0,r=0,cnt=0;
	rep(i,n){
		for(;l<i;cnt-=!!dp[l++]) if(sum[i+1]-sum[l]+(i-l)<=w) break;
		for(;r<i;cnt+=!!dp[r++]) if(sum[i+1]-sum[r]+(i-r)*sp<w) break;
		dp[i+1]=!!cnt;
	}
	
	int res=dp[n];
	for(int i=n;i--;){
		if(sum[n]-sum[i]+(n-i-1)>w) break;
		res|=dp[i];
	}
	
	return res;
}

int main()
{
	for(int w,n;~scanf("%d%d",&w,&n) && w|n;){
		vi xs(n);
		rep(i,n) scanf("%d",&xs[i]);
		
		vi sum(n+1);
		rep(i,n) sum[i+1]=sum[i]+xs[i];
		
		int lo=1,hi=w;
		while(lo<hi){
			int mi=(lo+hi)/2;
			if(ok(w,sum,mi))
				hi=mi;
			else
				lo=mi+1;
		}
		printf("%d\n",lo);
	}
}

Measured memory_bytes: 1612
n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3 = list(map(float, input().split()))
    a = 2*(x1-x2)
    b = 2*(y1-y2)
    c = x1**2 - x2**2 + y1**2 - y2**2
    d = 2*(x1-x3)
    e = 2*(y1-y3)
    f = x1**2 - x3**2 + y1**2 - y3**2

    y = (c*d - a*f) / (b*d - a*e)
    if a==0:
        x = (f - e*y) / d
    else:
        x = (c - b*y) / a
    
    r = ((x1 - x)**2 + (y1 - y)**2)**0.5
    print('{:.3f}'.format(round(x, 3)), end=" ")
    print('{:.3f}'.format(round(y, 3)), end=" ")
    print('{:.3f}'.format(round(r, 3)))


Measured memory_bytes: 5672
#include<stdio.h>
#include<math.h>
 
int main(){
 
     int x,a,b,c;
     scanf("%d", &x);
     a = floor(x/3600);
     b = floor((x-(a*3600))/60);
     c = x-(b*60)-(a*3600);
     printf("%d:%d:%d\n", a, b, c);
     return 0;
}


Measured memory_bytes: 2072
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1<<30;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};


int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(11);
    int n,k;
    cin>>n>>k;
    vector<int> a(n,0);
    rep(i,n) cin>>a.at(i);
    vector<bool> dp(k+1,false);
    rep(i,k)rep(j,n){
        if(a[j]+i<k+1 && !dp[a[j]+i]) dp[a[j]+i]=(!dp[i]);
    }
    if(dp[k]) cout<<"First";
    else cout<<"Second";
    cout<<endl;
}

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

using ll = long long;

using namespace std;
#define int ll

//0 -> a-1
#define rep(i, a) for (int i = 0; (i) < (int)(a); (i)++)
//a -> b-1
#define reps(i, a, b) for (int i = (int)(a); (i) < (int)(b); (i)++)
//a-1 -> 0
#define rrep(i, a) for (int i = (int)a - 1; (i) >= 0; (i)--)
//a-1 -> b
#define rreps(i, a, b) for (int i = (int)(a)-1; (i) >= (int)(b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
//next_permutation(all(v))
#define PERM(v) next_permutation(all(v))
/*sort(all(v));
(v).erase(unique(all(v)), v.end())*/
#define UNIQUE(v) \
	sort(all(v)); \
	(v).erase(unique(all(v)), v.end())
#define CIN(type, x) \
	type x;          \
	cin >> x
#define YES(f) if ((f)) {cout << "YES" << endl;} else {cout << "NO" << endl;}
#define Yes(f) if ((f)) {cout << "Yes" << endl;} else {cout << "No" << endl;}
#define MINV(v) min_element(all(v))
#define MAXV(v) max_element(all(v))
#define MIN3(a, b, c) min(min(a, b), c)
#define MIN4(a, b, c, d) min(MIN3(a, b, c), d)
#define MIN5(a, b, c, d, e) min(MIN4(a, b, c, d), e)
#define MIN6(a, b, c, d, e, f) min(MIN5(a, b, c, d, e), f)
#define MAX3(a, b, c) max(max(a, b), c)
#define MAX4(a, b, c, d) max(MAX3(a, b, c), d)
#define MAX5(a, b, c, d, e) max(MAX4(a, b, c, d), e)
#define MAX6(a, b, c, d, e, f) max(MAX5(a, b, c, d, e), f)
//b is [a, c)
#define RANGE(a, b, c) ((a) <= (b) && (b) < (c))
//c is [a, e) && d is [b, f)
#define RANGE2D(a, b, c, d, e, f) (RANGE((a), (c), (e)) && RANGE((b), (d), (f)))
#define chmin(a, b) a = min(a, (b))
#define chmin3(a, b, c) a = MIN3(a, (b), (c))
#define chmin4(a, b, c, d) a = MIN4(a, (b), (c), (d))
#define chmin5(a, b, c, d, e) a = MIN5(a, (b), (c), (d), (e))
#define chmin6(a, b, c, d, e, f) a = MIN6(a, (b), (c), (d), (e), (f))
#define chmax(a, b) a = max(a, (b))
#define chmax3(a, b, c) a = MAX3(a, (b), (c))
#define chmax4(a, b, c, d) a = MAX4(a, (b), (c), (d))
#define chmax5(a, b, c, d, e) a = MAX5(a, (b), (c), (d), (e))
#define chmax6(a, b, c, d, e, f) a = MAX6(a, (b), (c), (d), (e), (f))
#define fcout cout << fixed << setprecision(12)
#define RS resize
#define CINV(v, N)             \
	do                         \
	{                          \
		v.RS(N);               \
		rep(i, N) cin >> v[i]; \
	} while (0);

#define RCINV(v, N)             \
	do                          \
	{                           \
		v.RS(N);                \
		rrep(i, N) cin >> v[i]; \
	} while (0);
#define MOD 1000000007

template <class T>
inline T GET()
{
	T x;
	cin >> x;
	return x;
}

void init();
void solve();

signed main()
{
	init();
	solve();
}

void init()
{
	int N;
	string s;
	cin >> N >> s;
	vector<int> a(N+1, 0), b(N+1, 0);
	rep(i, N) {
		a[i+1] = a[i] + (s[i] == '#');
	}
	rrep(i, N) {
		b[i] = b[i+1] + (s[i] == '.');
	}
	int res = 1000000000;
	rep(i, N+1) {
		chmin(res, a[i] + b[i]);
	}
	cout << res << endl;
}

void solve()
{
}


Measured memory_bytes: 4224
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};


int main() {
  int H, W;
  cin >> H >> W;
  vector<string> A(H);
  int cnt = 0;
  for (int i = 0; i < H; i++) {
    cin >> A[i];
    for (int j = 0; j < W; j++) {
      if (A[i][j] == '#') cnt++;
    }
  }
  if (cnt != H + W - 1) {
    cout << "Impossible" << endl;
  } else {
    cout << "Possible" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
const long long INF = 1LL << 60;

int main() {
  int N, K;
  while (cin >> N >> K) {
    if (N == 0) break;

    // 数列読み込み
    vector<long long> a(N);
    for (int i = 0; i < N; ++i) cin >> a[i];

    // 累積和を前計算
    vector<long long> s(N+1, 0);
    for (int i = 0; i < N; ++i) s[i + 1] = s[i] + a[i];

    long long res = -INF;
    for (int i = 0; i <= N - K; ++i) {
      long long val = s[K+i] - s[i];
      res = max(res, val);
    }

    cout << res << endl;
  }

  return 0;
}


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

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 100005;
const int mod = 1000000007;
/* struct for mod Calculation*/
struct mint {
    ll x;
    mint(ll x = 0):x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
/* global variables */
/* function */
/* main */
int main(){
    string L;
    cin >> L;
    int N = L.size();
    vector<vector<mint>> dp(2, vector<mint>(N+1, 0));

    // (a[i], b[i]) = (0, 0), (0, 1), (1, 0), (1, 1);
    // a[i] + b[i] = a[i] xor b[i]
    // <=> (a[i], b[i]) = (0, 0), (0, 1), (1, 0);
    // L[i] == 0
    // dp[0][i+1] += dp[0][i] * 3
    // dp[1][i+1] += dp[1][i]
    // l[i] == 1
    // dp[0][i+1] += dp[0][i] * 3 + dp[1][i] * 1
    // dp[1][i+1] += dp[1][i] * 2
    dp[1][0] = 1;
    for (int i = 0; i < N; i++) {
        if (L[i] == '0') {
            dp[0][i+1] += dp[0][i] * 3;
            dp[1][i+1] += dp[1][i];
        }
        else {
            dp[0][i+1] += dp[0][i] * 3 + dp[1][i] * 1;
            dp[1][i+1] += dp[1][i] * 2;
        }
    }

    mint ans = dp[0][N] + dp[1][N];
    cout << ans << '\n';
}

Measured memory_bytes: 2816
#include<iostream>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#define ll long long int
using namespace std;
int main(void) {
  int a, b;
  cin>>a>>b;
  if(a+b>=10) cout<<"error"<<endl;
  else cout<<a+b<<endl;
  return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include<algorithm>
#include<climits>
#include<numeric>
#include<cmath>
#include<cstring>
#include<deque>
#include<map>
#include<iomanip>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define VSORT(v) sort(v.begin(), v.end());
#define VE vector<int>
#define VEP vector<pair<int,int>>
#define llong long long
#define pb(a) push_back(a)
using namespace std;
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
const vector<VE> DIR{ {-1,0},{1,0},{0,-1},{0,1} };
int main() {

	int town;
	cin >> town;
	VEP vec(town);
	REP(i, town) {
		cin >> vec[i].first >> vec[i].second;
	}
	double all_dist = 0;
	int cnt = 0;
	REP(i, town) {
		for (int k = i + 1; k < town; ++k) {
			all_dist += sqrt(pow(vec[i].first - vec[k].first, 2) + pow(vec[i].second - vec[k].second, 2));
			cnt++;
		}
	}

	double ans = all_dist * (town - 1) / (town * (town - 1) / 2);
	cout << std::setprecision(20) << ans << endl;

	return 0;
}



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

int main() {
    int n, m; cin >> n >> m;
    vector<int> ps;
    for(int i = 1; i * i <= m; ++i) {
        if(m % i == 0) {
            ps.push_back(i);
            if(i * i != m) ps.push_back(m / i);
        }
    }
    int ans = 0;
    for(auto& p : ps) {
        if(m / p >= n) ans = max(ans, p);
    }
    cout << ans << endl;
}


Measured memory_bytes: 384
import numpy as np
H, N = map(int, input().split())
A = []
B = []
for _ in range(N):
  ai, bi = map(int, input().split())
  A.append(ai)
  B.append(bi)

A = np.array(A)
B = np.array(B)
# process
dp = np.zeros(H+1, dtype=np.int64)
dp[0] = 0

for i in range(1, H + 1):
    dp[i] = np.amin(dp[np.maximum(i - A, 0)] + B)

# output
print(dp[H])



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

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define LL long long

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}

int main()
{
    string s;
    cin >> s;
    string s1 = s.substr(0,2);
    string s2 = s.substr(2,2);
    int a,b;
    stringstream ss(s1);
    stringstream ss2(s2);
    ss >> a; ss2 >> b;
    int cnt = 0;
    if(a >= 1 && a <= 12){
        if(b >= 1 && b <= 12){
            printf("AMBIGUOUS\n");
        }
        else{
            printf("MMYY\n");
        }
    }
    else{
        if(b >= 1 && b <= 12){
            printf("YYMM\n");
        }
        else{
            printf("NA\n");
        }
    }

    return 0;
}


Measured memory_bytes: 256
while 1:
  n = int(input())
  if n == 0:
    break
  A = list(map(int, input().split()))
  A.sort()
  m = 1000000
  t=0
  for i in range(n):
    for j in range(1+i,n):
      t=abs(A[i]-A[j])
      if t<= m:
        m = t
  print(m)
  


Measured memory_bytes: 5624
// 

#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

int main()
{
    int R;
    cin >> R;
    float l = 2.0000 * 3.14159265 * R;
    cout << l << endl;
    return 0;
}


Measured memory_bytes: 3788
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;

typedef vector<int> L;
typedef pair<int,int> P;

class Node
{
public:
	L to;
	vector<double> co;
};

class Trl
{
public:
	int p;
	double c;
	L ord;
	Trl(int p, double c, L ord) : p(p), c(c), ord(ord) {}

	bool operator<(const Trl& t) const {
		return c > t.c;
	}
};

Node node[1000];
L dic;
vector<P> p;

pair<double, L> dijkstra(int s, int d)
{
	bool v[1000] = {0};
	priority_queue<Trl> q;
	q.push(Trl(s, 0.0, L()));
	while (!q.empty())
	{
		Trl t=q.top(); q.pop();
		if (v[t.p]) continue;
		v[t.p] = true;
		t.ord.push_back(t.p);

		if (t.p == d) 
			return pair<double, L>(t.c, t.ord);

		for (int i=0; i<node[t.p].to.size(); i++)
		{
			int next = node[t.p].to[i];
			if (v[next]) continue;

			q.push(Trl(next, t.c+node[t.p].co[i], t.ord));
		}

	}
	return pair<double, L>(-1.0, L());
}

int twd(P p1, P p2)
{
	return (p1.first-p2.first)*(p1.first-p2.first) + (p1.second-p2.second)*(p1.second-p2.second);
}

int rdic(int n)
{
	return find(dic.begin(), dic.end(), n) - dic.begin();
}

int main()
{
	int n;
	while (cin >> n, n)
	{
		dic.clear(); p.clear();
		memset(node, 0, sizeof(node));
		for (int i=0; i<n; i++)
		{
			int b, x, y;
			cin >> b >> x >> y;
			dic.push_back(b);
			p.push_back(P(x, y));
		}

		for (int i=0; i<n; i++)
		for (int j=i+1; j<n; j++)
		{
			int dd = twd(p[i], p[j]);
			if (dd > 2500) continue;
			node[i].to.push_back(j);
			node[i].co.push_back(sqrt((double)dd));
			node[j].to.push_back(i);
			node[j].co.push_back(sqrt((double)dd));
		}

		int m;
		cin >> m;

		while (m--)
		{
			int s, g;
			cin >> s >> g;
			pair<double,L> res = dijkstra(rdic(s), rdic(g));
			
			if (res.second.empty())
			{
				cout << "NA" << endl;
			}
			else
			{
				int s = res.second.size()-1;
				for (int i=0; i<s; i++)
					cout << dic[res.second[i]] << ' ';
				cout << dic[res.second[s]] << endl;
			}
		}
	}
	return 0;
}

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

int main() {
  int n;
  cin >>n;
  vector<long> s(n+1);
  s.at(0)=2;
  s.at(1)=1;
  for( int i=2;i<=n;i++){
    s.at(i) = s.at(i-1)+s.at(i-2);
  }
  cout << s.at(n);
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

long long int n, a, b;

int main(){
  scanf("%lld%lld%lld", &n, &a, &b);
  if(a > b) std::swap(a, b);
  if(!((a^b)&1)){
    printf("%lld\n", (b - a) / 2);
  }
  else {
    long long int x = a + (b - a) / 2;
    a = n - a + 1;
    b = n - b + 1;
    long long int y = b + (a - b) / 2;
    printf("%lld\n", std::min(x, y));
  }

  return 0;
}


Measured memory_bytes: 128
#![allow(unused_macros)]

// cf. [Rustで競技プログラミングの入力をスッキリ記述するマクロ - Qiita](https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8)
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        N: usize,
    }
    println!("{}", N * (N - 1) / 2);
}


Measured memory_bytes: 4352
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;

int main(){
    int n,a,b;
    cin >> n >> a >> b;
    int ans;
    if(n*a>=b) ans=b;
    else ans=n*a;

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
   int k; cin >> k;
   int p = 7, ans = 1;
   if(k%2==0 || k%5==0) cout << -1 << endl;
   else if(k==7 || k==1) cout << 1 << endl;
   else{
       while(p!=0){
           p = (10*p+7)%k;
           ans++;
       } 
       cout << ans << endl;
   }
}

Measured memory_bytes: 3636
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
typedef long long int ll;
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define EREP(i,n) for (int i=1;i<=(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define EVEL 1

#ifndef EVEL
#define DEB(X) cout << #X << ":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {}
#define TF(f) {}
#define END {}
#endif
const int MOD = 1000000007;
const int INF = 2000000000;

    string A,B,C;
    int N,M,K,X,Y,W,H;
    int ans;
    string S;
    int temp[100]={0};
    bool f=true;
    bool fir=true;

int main(){
    cin>>A>>B;
    if(A.size()<B.size()){
        cout<<"LESS";
    }
    else if(A.size()>B.size()){
        cout<<"GREATER";
    }
    else{
        REP(i,(signed)A.size()){
            if(A[i]>B[i]){
                cout<<"GREATER";
                break;
            }else if(A[i]<B[i]){
                cout<<"LESS";
                break;
            }else if(i==(signed)A.size()-1){
                cout<<"EQUAL";
            }
        }
    }
    return 0;

}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;

class Main{
    public static void main(String[] args){
        FastScanner fsc=new FastScanner();
        int a=fsc.nextInt(), b=fsc.nextInt();
        fsc.close();
        int max=Math.max(Math.max(a-b, a*b), a+b);
        System.out.println(max);
    }
    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte(){
            if(ptr<buflen) return true;
            else{
                ptr = 0;
                try{
                    buflen = in.read(buffer);
                }
                catch(IOException e){
                    e.printStackTrace();
                }
                if(buflen<=0) return false;
            }
        return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) throw new NumberFormatException();
            while(true){
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                }
                else if(b == -1 || !isPrintableChar(b)) return minus ? -n : n;
                else throw new NumberFormatException();
                b = readByte();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
        public void close(){
            try{in.close();}
            catch(IOException e){e.printStackTrace();}
        }
    }
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define ri register
#define int long long
#define E (n+1)
using namespace std; const int N=200010;
inline int read()
{
    int s=0, w=1; ri char ch=getchar();
    while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }
    while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48), ch=getchar();
    return s*w;
}
int n,a[N];
signed main()
{
    n=read();
    for(ri int i=1;i<=n;i++) a[i]=read();
    sort(a+1,a+1+n);
    int pp=unique(a+1,a+1+n)-a-1;
    printf("%lld\n",pp-(pp%2==0));
    return 0;
}

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

const ll MOD = 1e9 + 7;
const ll f_MAX = 500000;

ll fac[f_MAX];
ll finv[f_MAX];
ll inv[f_MAX];

ll fast_pow(ll n, ll r){
  ll ret = 1;
  while(r > 0){
    if(r % 2 == 1){
      ret *= n;
      ret %= MOD;
    }
    n *= n;
    n %= MOD;
    r /= 2;
  }
  return ret;
}

ll inv_MOD(ll x){
  return fast_pow(x, MOD - 2);
  
}

void com_init(){
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < f_MAX; i++){
      fac[i] = fac[i - 1] * i % MOD;
      inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
      finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

ll com(int n, int k){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
com_init();
  ll n, k;
  cin >> n >> k;

  ll ans = com(2 * n - 1, n);

  if(k < n - 1){
    ll sub = 0;
    for(int i = 1; i < n - k; i++){
      sub += (com(n, i) * com(n-1, i-1)) % MOD;
      sub %= MOD;
    }
    ans -= sub;
    ans %= MOD;
    while(ans < 0) ans += MOD;
  }

  cout << ans << endl;
}

Measured memory_bytes: 11904
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  string S, T; cin >> S >> T;
  vector<int> start(26, -1); // -1 で埋めるように初期化
  vector<int> goal(26, -1);
  for(int i = 0; i < S.size(); i++) {
    int a = S[i] - 'a'; // char から int に変換
    int b = T[i] - 'a';

    if(start[a] != -1 || goal[b] != -1) {
      if(start[a] != b || goal[b] != a) {
        cout << "No" << endl;
        return 0;
      }
    } else {
      start[a] = b;
      goal[b] = a;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 776
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);

		while(true){
			int n = stdIn.nextInt();
			if(n==0){
				return;
			}
			
			int sum = 1;
			int[] dice = {1,3,6,4,2,5};
			for(int i=0;i<n;i++){
				String cmd = stdIn.next();
				if(cmd.compareTo("North")==0){
					int tmp = dice[0];
					dice[0] = dice[4];
					dice[4] = dice[2];
					dice[2] = dice[5];
					dice[5] = tmp;
				}
				else if(cmd.compareTo("East")==0){
					int tmp = dice[0];
					dice[0] = dice[3];
					dice[3] = dice[2];
					dice[2] = dice[1];
					dice[1] = tmp;
				}
				else if(cmd.compareTo("West")==0){
					int tmp = dice[0];
					dice[0] = dice[1];
					dice[1] = dice[2];
					dice[2] = dice[3];
					dice[3] = tmp;
				}
				else if(cmd.compareTo("South")==0){
					int tmp = dice[0];
					dice[0] = dice[5];
					dice[5] = dice[2];
					dice[2] = dice[4];
					dice[4] = tmp;
				}
				else if(cmd.compareTo("Right")==0){
					int tmp = dice[4];
					dice[4] = dice[1];
					dice[1] = dice[5];
					dice[5] = dice[3];
					dice[3] = tmp;
				}
				else if(cmd.compareTo("Left")==0){
					int tmp = dice[4];
					dice[4] = dice[3];
					dice[3] = dice[5];
					dice[5] = dice[1];
					dice[1] = tmp;
				}
				sum+=dice[0];
			}
			System.out.println(sum);
		}
	}
}

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

int main() {
    long mod = 1e9+7;
    int N;
    cin>>N;
    string s1, s2;
    cin>>s1;
    cin>>s2;
    long ans;
    int index;
    if(s1[0]==s2[0]){
        ans = 3;
        index = 1;
    }
    else{
        ans = 6;
        index = 2;
    }
    while(index <= s1.size()-1){
        if(s1[index] == s2[index]){
            if(s1[index-1] == s2[index-1]) ans *= 2;
            else ans *= 1;
            ans %= mod;
            index++;
        }
        else {
            if(s1[index-1] == s2[index-1]) ans *= 2;
            else ans *= 3;
            ans %= mod;
            index += 2;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
// g++ -std=c++14

#include<bits/stdc++.h>

typedef long long ll;
typedef long double lld;
using namespace std;

#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define endl "\n"
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(c) (c.begin(),c.end())
#define LET(x, a)  __typeof(a) x(a)
#define foreach(it, v) for(LET(it, v.begin()); it != v.end(); it++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define inf 1000000000000000001

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
ll l=v.size();for(ll i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

#define int ll
int32_t main(){ _
  int n, k;
  cin >> n >> k;
  vector<int> dp(n, INT_MAX), h(n, 0);
  for(int i = 0; i < n; i++)
    cin >> h[i];
  dp[0] = 0;
  for(int i = 1; i < n; i++){
    for(int j = i - 1; j >= max((long long)0, i - k); j--)
      dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]));
  }
  cout << dp[n - 1] << endl;
}


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

int main(){
    int N;
    vector<int> a(110);
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        cin >> a[i];
    }
    sort(a.begin(), a.end(), greater<int>());
    int Alice = 0;
    int Bob = 0;
    for (int i = 0; i < N; i++)
    {
        if(i%2 == 0){
            Alice += a[i];
        }
        else {
            Bob += a[i];
        }
    }
    cout << Alice - Bob << endl;
}

Measured memory_bytes: 3580