akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define LCIN(n) LL(n);cin >> (n)
#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

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

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<int,int>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define rmsame(a) sort(ALL(a)),a.erase(unique(ALL(a)), a.end())

typedef string::const_iterator State;
class PalseError {};
class Edge{
public:
    int from,to,value;
    Edge(int a,int b,int c){
        from = a;
        to = b;
        value = c;
    }
    Edge(int a,int b){
        from = a;
        to = b;
    }
};
class UnionFind{
private:
    vector<int> vec;
public:
    void init(int N){
        vec.resize(N);
        for(int a = 0;a < N;a++)
        {
            vec[a]=-1;
        }
    }
    int root(int a)
    {
        if(vec[a] < 0)return a;
        else return vec[a] = root(vec[a]);
    }
    bool connect(int a,int b)
    {
        a = root(a);
        b = root(b);
        if(a==b)return false;
        if(vec[a] > vec[b])swap(a,b);
        vec[a] += vec[b];
        vec[b] = a;
        return true;
    }
    bool check(int a,int b){
        a = root(a);
        b = root(b);
        if(a==b)return true;
        else return false;
    }
};
int main(){
    CIN(N);CIN(K);CIN(L);
    UnionFind Uni1,Uni2;
    Uni1.init(N+1);
    Uni2.init(N+1);
    REP(a,K){
        CIN(b);CIN(c);
        Uni1.connect(b,c);
    }
    REP(a,L){
        CIN(b);CIN(c);
        Uni2.connect(b,c);
    }
    map<pair<int,int>,int> mp;
    REP(a,N){
        Uni1.root(a+1);
        Uni2.root(a+1);
    }
    REP(a,N){
        mp[make_pair(Uni1.root(a+1),Uni2.root(a+1))]++;
    }
    REP(a,N){
        cout<<mp[make_pair(Uni1.root(a+1),Uni2.root(a+1))]<<" ";
    }
    return 0;
}


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

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

    long P[20];
    for (long i = 0; i < n; i++) {
        cin >> P[i];
    }

    long cnt = 0;
    for (long i = 2; i < n; i++) {
        if ((P[i - 2] < P[i - 1] && P[i - 1] < P[i]) || (P[i - 2] > P[i - 1] && P[i - 1] > P[i])) {
            cnt++;
        }
    }

    cout << cnt << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

long long a[100001], res;
int n;

long long llabs(long long x) {
	return x < 0 ? -x : x;
}

void solve() {
	long long sum = 0; res = 0;
	for(int i = 0; i < n; ++i) {
		if((i%2)) {
			if(sum + a[i] <= 0) {
				res += llabs(sum + a[i]) + 1;
				sum = 1;
			}else {
				sum += a[i];
			}
		}else {
			if(sum + a[i] >= 0) {
				res += llabs(sum + a[i]) + 1;
				sum = -1;
			}else {
				sum += a[i];
			}
		}
	}
}

int main() {
	cin >> n;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	solve();
	long long ress = res;
	for(int i = 0; i < n ; ++i) {
		a[i] = -a[i];
	}
	solve();
	cout << (ress < res ? ress : res) << endl;
	return 0;
}

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

int main() {
    string s, ans="None";
    cin >> s;
    bool finished = false;

    for(int i=0; i<='z'-'a'; i++) {
        for(int j=0; j<s.size(); j++) {
            if(s.at(j) == (char)((int)'a'+i)) {
            break;
            }
            if(j == s.size()-1) {
                ans = (char)((int)'a'+i);
                finished = true;
                break;
            }    
        }
        if(finished == true) break;
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include<iostream>
using namespace std;
int main()
{
    int c[3][3];
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            cin >> c[i][j];
        }
    }
    for(int i = 0; i < 2; i++){
        int c0 = c[i][0] - c[i+1][0], c1 = c[i][1] - c[i+1][1], c2 = c[i][2] - c[i+1][2];
        if(!(c0 == c1 && c1 == c2)){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);	
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll ,ll> 			pll;
typedef pair<ld,ld> 			pld;
typedef unordered_map<ll,ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5+7;
const ll 	MAX7 	= 	1e+7+7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9+7;
const ll 	N 		= 	2*1e6;

// <------------- Declare Variables Here ------------> //

ll T=1;
ll n,x,y,m;
string s,t;
vll a;

// <------------- Implement Functions Here ----------> //


// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>x;
	cout<<(1-x);
}

int main() {
	fastio;randomINT;
	//cin>>T;
	while(T--) {
		MAIN();
	}
	return 0;
}



Measured memory_bytes: 3644
#include<iostream>
#include<vector>
#include<sstream>
using namespace std;

string s,t;
vector<string> yaml;
vector<string> keys;
int n,l;

string parse(void){
  if(l==yaml.size())return "";

  int ind = 0;
  while(yaml[l][ind] == ' ')ind++;
  int c = yaml[l].find(":",ind);
  string key = yaml[l].substr(ind,c-ind);
  if(key == keys[n]){
    if(n+1==keys.size()){
      if(c+1==yaml[l].size())return "A";
      return yaml[l].substr(c+2);
    }
    if(c+1==yaml[l].size()){ n++; l++; return parse(); }
    return "";
  }else{
    while(++l<yaml.size()){
      int ind2 = 0;
      while(yaml[l][ind2] == ' ')ind2++;
      if(ind==ind2)break;
      if(ind>ind2)return "";
    }
    return parse();
  }
}     
  
int main(){
  cin >> s;
  for(int i=0;i<s.size();i++)if(s[i]=='.')s[i] = ' ';
  stringstream ss(s);
  while(ss >> s)keys.push_back(s);

  cin.ignore();
  while(getline(cin,t))yaml.push_back(t);
  n = l = 0;
  string res = parse();
  if(res.empty())cout << "no such property\n";
  else if(res == "A")cout << "object\n";
  else cout << "string \"" << res << "\"" << endl;
}

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

enum inf = 1_001_001_001;
enum infl = 1_001_001_001_001_001_001L;


void main() {
    int K;
    scan(K);

    long ans;
    foreach (i ; 1 .. K + 1) {
        foreach (j ; 1 .. K + 1) {
            foreach (k ; 1 .. K + 1) {
                ans += gcd(gcd(i, j), k);
            }
        }
    }
    writeln(ans);
}



void scan(T...)(ref T args) {
    auto line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront;
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;
    foreach (arg; args) if (x > arg) {
        x = arg;
        isChanged = true;
    }
    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;
    foreach (arg; args) if (x < arg) {
        x = arg;
        isChanged = true;
    }
    return isChanged;
}

void yes(bool ok, string y = "Yes", string n = "No") {
    return writeln(ok ? y : n);
}


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

int main(void){
	ll N, K;
	cin >> N >> K;
	if (K<=N) N = N - K*(N/K);
	while (1){
		ll NN = abs(K-N);
		if (NN < N) N = NN;
		else break;
	}
	cout << N << endl;
	return 0;
}


Measured memory_bytes: 3600
#!/usr/bin/python3
# -*- coding:utf-8 -*-

from collections import defaultdict

def main():
  count = defaultdict(lambda :defaultdict(int))
  n = int(input())
  for i in range(1, n+1):
    count[int(str(i)[0])][int(str(i)[-1])] += 1

  total = 0
  for i in range(10):
    for j in range(10):
      total += count[i][j] * count[j][i]
  print(total)

if __name__=='__main__':
  main()

Measured memory_bytes: 3316
#include <iostream>
#include <algorithm>
#include <math.h> 
#include <string>
#include <iomanip>
#include <vector>
using namespace std;
int main(){
    int r, d, x;
    cin >> r >> d >> x;
    int ans[20];
    ans[0] = x;
    for(int i = 1; i <= 10; i++){
        ans[i] = r*ans[i-1] - d;
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int> 


int main(){
  int n; cin >> n;
  int s;
  set<int> S;
  rep(i,n) {
    cin >> s;
    S.insert(s);
  }
  int q; cin >> q;
  int t;
  set<int> T;
  rep(i,q) {
    cin >> t;
    T.insert(t);
  }

  int cnt = 0;
  for (auto i:S){
    if (T.count(i)) cnt++;
  }

  cout << cnt << endl;

   
  return 0;
}



Measured memory_bytes: 3160
program yahoo_procon_B
    implicit none
    integer::A,B,t(4)
    integer::i
    t=0
    do i=1,3
        read*,A,B
        t(A)=t(A)+1
        t(B)=t(B)+1
    end do
    print"(A)",trim(merge("YES","NO ",maxval(t)==2))
end program yahoo_procon_B

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define INF 1e16
#define MAX_N 1000000
const long long MOD = 1e9 + 7;

long long extgcd(long long a, long long b, long long& x, long long& y) {
    long long d = a;
    if (b != 0) {
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    } else {
        x = 1;
        y = 0;
    }
    return d;
}
long long mod_inverse(long long a, long long m) {
    long long x, y;
    if (extgcd(a, m, x, y) == 1)
        return (m + x % m) % m;
    else
        return -1;
}
vector<long long> fact(MAX_N + 1, INF);
long long mod_fact(long long n, long long& e) {
    if (fact[0] == INF) {
        fact[0] = 1;
        if (MAX_N != 0) fact[1] = 1;
        for (int i = 2; i <= MAX_N; i++) {
            fact[i] = (fact[i - 1] * i) % MOD;
        }
    }
    e = 0;
    if (n == 0) return 1;
    long long res = mod_fact(n / MOD, e);
    e += n / MOD;
    if ((n / MOD) % 2 != 0) return (res * (MOD - fact[n % MOD])) % MOD;
    return (res * fact[n % MOD]) % MOD;
}
long long mod_comb(long long n, long long k) {
    if (n < 0 || k < 0 || n < k) return 0;
    long long e1, e2, e3;
    long long a1 = mod_fact(n, e1), a2 = mod_fact(k, e2),
              a3 = mod_fact(n - k, e3);
    if (e1 > e2 + e3) return 0;
    return (a1 * mod_inverse((a2 * a3) % MOD, MOD)) % MOD;
}

int main() {
    long long H, W, A, B;
    cin >> H >> W >> A >> B;

    long long ans = 0;
    for (int i = B + 1; i <= W; i++) {
        long long h, w, pattern;

        h = H - A - 1;
        w = i - 1;
        pattern = mod_comb(h + w, h);

        h = A - 1;
        w = W - i;
        pattern *= mod_comb(h + w, h);

        ans += pattern;
        ans %= MOD;
    }

    cout << ans << endl;
}

Measured memory_bytes: 8064
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include "bits/stdc++.h"

#define REP(i,x,y) for(int i=(x);i<(y);i++)
#define RREP(i,x,y) for(int i=(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
//#define int long long

using namespace std;

// conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

typedef long long ll;

const ll MOD = 1e9 + 7;

class DWaterBottle {
public:
	void solve(std::istream& in, std::ostream& out) {
	    double a, b, x;
	    in >> a >> b >> x;

	    if (a * a * b / 2 <= x) {
	        double tan = 2 * (a * a * b - x) / (a * a * a);
	        out << fixed << setprecision(10) << atan(tan) * 180.0 / M_PI << "\n";
	    } else {
	        double tan = a * b * b / (2 * x);
	        out << fixed << setprecision(10) << atan(tan)  * 180.0 / M_PI << "\n";
	    }
	}
};


signed main() {
	DWaterBottle solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

long long int N, M, K, Q, W, H, L, R;
long long int ans;


int main() {
	ios::sync_with_stdio(false);
	cin >> N;
	N++;
	int num[100001] = {};
	int fig[100001] = {};
	int box = 0;
	L = -1;
	R = -1;
	for (int i = 0; i < N; i++) {
		cin >> num[i];
		fig[num[i]]++;
		if (fig[num[i]] == 2)box = num[i];
	}
	for (int i = 0; i < N; i++) {
		if (num[i] == box) {
			if (L==-1)L = i;
			else R = i;
		}
	}
	long long int bag = N - R + L - 1;
	long long int a[100101] = {};
	long long int b[100101] = {};
	a[1] = N ;
	b[1] = 1;
	for (int i = 2; i <= N; i++) {
		a[i] = a[i - 1] * (N - i + 1);
		a[i] %= MOD;
		a[i] *= power(i, MOD - 2, MOD);
		a[i] %= MOD;
	//	cout << a[i] << endl;
	}
	for (int i = 2; i <= bag + 1; i++) {
		b[i] = b[i - 1] * (bag - i + 2);
		b[i] %= MOD;
		b[i] *= power(i - 1, MOD - 2, MOD);
		b[i] %= MOD;
	//	cout << b[i] << endl;
	}
	for (int i = 1; i <= N; i++)cout << (a[i] + MOD - b[i]) % MOD << endl;
	return 0;
}

Measured memory_bytes: 3584
using namespace std;
#include<bits/stdc++.h>
#define Ranger159 ios_base::sync_with_stdio(false);
#define PrintLater cin.tie(0);cout.tie(0);
#define ll long long
#define phb push_back
#define break break
#define pob pop_back()
#define continue continue
#define size size
#define insrt insert
#define fir first
#define true true
#define clear clear
#define vL vector<ll> 
#define resize resize
#define sec second
#define else else
#define reverse reverse
#define lbr1 cout<<"\n";
#define lbr2 cout<<"\n\n";
#define cin(v,n) for(ll i=0;i<n;i++) cin>>v[i];
#define cout(v,n) for(ll i=0;i<n;i++) cout<<v[i]<<" "; lbr1
const ll mod=1e9+7;

int main(int argc, char const *argv[])
{
	Ranger159
	// PrintLater
	ll test=1,n,a,b,c,k,i;
	// cin>>test;
	while(test--)
	{
		cin>>n>>k;
		vL v(n); cin(v,n);
		
		for(i=k;i<n;i++)
		{
			if(v[i]>v[i-k])
				cout<<"Yes";
			else cout<<"No";
			lbr1;
		}
		// lbr1
	}
	return 0;
}

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

typedef long long ll;
typedef long double ld;

#define pb push_back
#define sort(s) sort(s.begin(),s.end())
#define reverse(s) reverse(s.begin(),s.end())
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)

const ll mod = 1e9+7;

//最大公約数
ll gcd(ll a, ll b) {
    return b ? gcd(b, a%b) : a;
}

//最小公倍数
ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}

//素数判定
bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}

//桁和
int digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

//桁数
int dignum(ll n) {
    int res = 0;
    while(n > 0) {
        res++;
        n /= 10;
    }
    return res;
}

//文字列中の特定の文字カウント
ll stringcount(string s,char c){
    return count(s.cbegin(),s.cend(),c);
}

//階乗
ll ka(ll i){
    ll res=1;
    while(i>0){
        res=res*i;
        i--;
    }
    return res;
}
 
//ncr
ll ncr(ll x,ll y){
    ll a = x;
    ll b = 1;
    if(y>(x/2)){
        y=x-y;
    }
    for(ll i=1;i<y;i++){
        a*=x-i;
        b*=i+1;
    }
    return a/b;
}

//フィボナッチ数列
ll f(ll x){
    ll dp[x+1];
    dp[1]=1;
    dp[2]=1;
    for(ll i=3;i<=x;i++){
        dp[i]=dp[i-1]+dp[i-2];
    }
    return dp[x];
}

//char->int
int ctoi(char c){
    return c-'0';
}



int main(){
    ll x;
    cin >> x;
    ll a= 100;

    for(int i=1;;i++){
        a+=a*0.01;
        if(x<=a){
            cout << i << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 3636
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>

using namespace std;

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

	if (D == 25) {
		cout << "Christmas" << endl;
	}
	else if (D == 24) {
		cout << "Christmas Eve" << endl;
	}
	else if (D == 23) {
		cout << "Christmas Eve Eve" << endl;
	}
	else if (D == 22) {
		cout << "Christmas Eve Eve Eve" << endl;
	}
}






Measured memory_bytes: 3432
//
import java.math.*;
import java.util.*;
import java.io.*;

  
public class Main { 
  
    static BufferedReader in;
    static PrintWriter out = new PrintWriter(System.out);
    static String file = "../in";
    static int test = 10; // 0 for local testing, 1 for std input
    static int inf = 1_000_000;

    class Comb
    {
        long[] f, ff;
        int mod = 1_000_000_007;

        public Comb(int n)
        {
            f = new long[n + 10];
            f[0] = 1;
            for(int i = 1; i <= n; i++)
            {
                f[i] = (f[i - 1] * i) % mod;
            }
        }

        public long choose(int n, int m)
        {
            return f[n] * pow(f[m], mod - 2) % mod * pow(f[n - m], mod - 2) % mod;
        }

        long pow(long a, int b)
        {
            long re = 1;
            while(b > 0)
            {
                if(b % 2 != 0)
                {
                    re *= a;
                    re %= mod;
                }
                b /= 2;
                a = a * a;
                a %= mod;
            }
            return re;
        }

    }

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

    void swap(int[]ary, int i, int j)
    {
        int t = ary[i];
        ary[i] = ary[j];
        ary[j] = t;
    }
    
    String[] split() throws Exception
    {
        return in.readLine().split(" ");
    }

    int readInt() throws Exception
    {
        return Integer.valueOf(in.readLine());
    }

    int[] toIntArray() throws Exception
    {
        String[] sp = split();
        int n = sp.length;
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]);
        return ary;
    }

    String reverse(String str)
    {
        return new StringBuilder(str).reverse().toString();
    }

    public static void main(String[] args) throws Exception
    {
        int _k = Integer.valueOf("1");
        if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file));
        if(test < 0) {String[] str = in.readLine().split(" ");}
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/

        new Main().d();
        out.flush();
    }

    void d() throws Exception
    {
        int n = readInt();
        int[] ary = toIntArray();
        int[] f = new int[1_000_10];
        for(int k : ary)
        {
            f[k]++;
        }

        int c1 = 0, c2 = 0;

        for(int i = 0; i <= 100000; i++)
        {
            if(f[i] >= 3){
                if(f[i] % 2 == 0) f[i] = 2;
                else f[i] = 1;
            }
            if(f[i] == 2) c2++;
            else if(f[i] == 1) c1++;
        }

        c1 += c2;
        if(c2 % 2 != 0) c1--;

        out.println(c1);
    }

    
}


Measured memory_bytes: 38492
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    int r;
    cin >> r;
    cout << r * r << "\n";
    return 0;
}

Measured memory_bytes: 256
module Main (main) where

import qualified Data.ByteString.Char8 as C8
import Data.Bool

main :: IO ()
main =
  readStrings >>= print . showAnswer . solve

type Input  = [String]
type Output = String

solve :: Input -> Output
solve [b]
  | b == "A" = "T"
  | b == "T" = "A"
  | b == "C" = "G"
  | b == "G" = "C"

showAnswer :: Output -> Answer
showAnswer = String

-- utils
readStrings :: IO [String]
readStrings = map C8.unpack . C8.words <$> C8.getLine

data Answer
  = YesNo Bool
  | YESNO Bool
  | AB Bool
  | Number Int
  | String String
  | Compare Ordering
  | Compare2 Ordering

instance Show Answer where
  show (YesNo b)    = bool "No" "Yes" b
  show (YESNO b)    = bool "NO" "YES" b
  show (AB b)       = bool "B"  "A" b
  show (Number i)   = show i
  show (String s)   = s
  show (Compare o)  = ordering "<" "=" ">" o
  show (Compare2 o) = ordering "Right" "Balanced" "Left" o

ordering :: a -> a -> a -> Ordering -> a
ordering lt eq gt o = case o of
  LT -> lt
  EQ -> eq
  GT -> gt

Measured memory_bytes: 380
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n; cin >> n;
    string s; cin >> s;
    int ans = 0;
    rep(i, 1000) {
        string v = "";
        if (i < 100) {
            v += "0";
            if (i < 10) {
                v += "0";
            }
        }
        v += to_string(i);
        bool ok1 = false, ok2 = false, ok3 = false; 
        int index = 0;
        for (int i = 0; i < n; i++) {
            if (s[i] == v[index]) {
                index++;
            }
            if (index == 3) {
                break;
            }
        }
        if (index == 3) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  int p, q, h, m, s, t, u, c;
  int l = 17 * 60 + 30;
  int r = 19 * 60 + 30;
  bool b;
  int a[7][7] = {
    {0, 300, 500, 600, 700, 1350, 1650},
    {6, 0, 350, 450, 600, 1150, 1500},
    {13, 7, 0, 250, 400, 1000, 1350},
    {18, 12, 5, 0, 250, 850, 1300},
    {23, 17, 10, 5, 0, 600, 1150},
    {43, 37, 30, 25, 20, 0, 500},
    {58, 52, 45, 40, 35, 15, 0}
  };

  while (1) {
    cin >> p;
    if (!p) break;
    --p;
    cin >> h >> m;
    s = 60 * h + m;
    cin >> q;
    --q;
    cin >> h >> m;
    t = 60 * h + m;
    b = false;
    if (s>=l && s<=r) b = true;
    else if (t>=l && t<=r) b = true;
    if (p > q) {
      u = p;
      p = q;
      q = u;
    }
    if (a[q][p] > 40) b = false;
    c = a[p][q];
    if (b) {
      c /= 2;
      if (c % 50) {
        c += 50 - (c % 50);
      }
    }
    cout << c << endl;
  }

  return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#define lln long long int
#define llu unsigned lln
#define sc(n) scanf("%d",&n);
#define scl(n) scanf("%lld",&n);
#define scd(n) scanf("%lf",&n);
#define pf(res) printf("%d\n",res);
#define pfl(res) printf("%lld\n",res);
#define pfd(res) printf("%lf\n",res);
#define maxii 100005
using namespace std;
typedef pair<int,int> pii;
typedef pair<lln,lln> pll;
typedef vector<int> vi;
typedef vector<lln> vl;
typedef vector<pii> vii;
typedef vector<pll> vll;


int arr[maxii];
int arr2[maxii];
int gcd(int a,int b)
{
    if(b==0){
      return a;
     }
    return gcd(b,a%b);
}
int lcm(int a,int b)
{
    int res=(a*b)/gcd(a,b);
    return res;
}
int po(int a,int b)
{
    int res=1;
    while(b)
    {
        if(b%2!=0)
        {
            res*=a;
            b--;
        }
        else
        {
            a*=a;
            b/=2;
        }
    }
    return res;
}

lln modMul(lln  a, lln b,lln mod){
    lln ans = 0;
    a = a % mod;
    while (b > 0){
        if ( b % 2 )ans = (ans%mod+ a%mod) % mod;
        a = (a%mod * 2%mod) % mod;
        b /= 2;
    }
    return ans % mod;
}
lln powerMod(lln a,lln b,lln mod){
	if(b==0)return 1LL%mod;
	lln x=powerMod( a,b/2,mod );
	x = ( x%mod * x%mod ) % mod;
	if( b%2==1 )x = ( x%mod * a%mod ) % mod;
	return x%mod;
}

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(b-a==c-b)cout<<"YES";
        else cout<<"NO";


}






Measured memory_bytes: 3572
/*
*******************
2018-11-04 Sun
*******************
*/
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

using namespace std;
#define PI 3.14159265359
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORN(i,a,b) for(int i=a;i<=b;i++)
const int INF = 1<<31;
typedef unsigned long long ull;
typedef long long ll;
typedef long long int LL;

int n,m;
map<int,vector<pair<int,int>>> M;

int main(){
    ios_base::sync_with_stdio(false); //Fast I/O
    cin.tie(NULL);
    cout.tie(NULL);
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);	
    
    cin >> n >> m;

    FOR(i,0,m){
        int p,y;
        cin >> p >> y;

        if(M.find(p)==M.end())
            M[p]=vector<pair<int,int>>();
        M[p].pb(mp(y,i));
    }

    vector<pair<int,int>> res(m);

    for(pair<int,vector<pair<int,int>>> p: M){
        sort(p.ss.begin(),p.ss.end());
        int cc=0;
        for(pair<int,int> pp: p.ss){
            res[pp.ss]=mp(p.ff,cc++);
        }
    }

    FOR(i,0,m){
        //cout << res[i].ff << " " << res[i].ss+1 << endl;
        printf("%06lld%06lld\n",res[i].ff,res[i].ss+1);
    }

    return 0;
}


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

using namespace std;

#define ll long long
#define PI 3.14159265358979323846264338327950L

ll x;

void solve(){

    cin >> x;

    int ans = 0;
    ll cur = 100;
    while(x > cur){
        ans++;
        cur += cur/100;
    }

    cout << ans << endl;
}





int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);

    solve();

}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
using Graph = vector<vector<int>>;
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; }
const int INF = 1e9;
const LL LLINF = 1e16;
const int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

vector<int> ans(20, -1);
LL now = 0, k = 0;
void dfs(int prv, int d){
    ans[d] = prv;
    if(d == 0){
        now++;
        if(now == k){
            reverse(all(ans));
            rep(i, 20){
                if(ans[i] != -1) cout << ans[i];
            }
            cout<< endl;
        }
        return;
    }
    if(prv == -1){
        if(d > 1) dfs(-1, d-1);
        rep1(i, 10) dfs(i, d-1);
    }else{
        REP(i, max(0, prv-1), min(9, prv+1)+1) dfs(i, d-1);
    }
}

int main(){
    fastcin();

    cin >> k;
    dfs(-1, 12);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int sum=0,fushu=1;
	char c=getchar();
	while(!isdigit(c)){
		if(c=='-') fushu=-fushu;
		c=getchar();
	}
	while(isdigit(c)){
		sum=sum*10+(c^48);
		c=getchar();
	}
	return sum*fushu;
}
void write(int x){//只能输出非负整数！！！比赛的时候看清楚！！！ 
	if(x>=10) write(x/10);
	putchar(x%10+48);
}
inline void writeln(int x){
	write(x);
	putchar('\n');
}
char s[10];
int main(){
	scanf("%s",s+1);
	int tot1=(s[1]^48)*10+(s[2]^48);
	int tot2=(s[3]^48)*10+(s[4]^48);
	if(tot1>=1 && tot1<=12 && tot2>=1 && tot2<=12) puts("AMBIGUOUS");
	else if(tot1>=1 && tot1<=12) puts("MMYY");
	else if(tot2>=1 && tot2<=12) puts("YYMM");
	else puts("NA");
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
int s;
  int flag1=-1,flag2=0;
  int flag3=-1,flag4=0;
  cin>>s;
 if(s/100<100 &&s/100>-1){
flag1=1;
 }
  if(s%100<13&&s%100>0){
flag2=1;
  }
   if(s%100<100 &&s%100>-1){
flag3=1;
 }
   if(s/100<13&&s/100>0){
flag4=1;
  }
  if(flag1==flag2&&flag3==flag4){
cout<<"AMBIGUOUS"<<endl;
  }else if(flag1==flag2){
    cout<<"YYMM"<<endl;
  }else if(flag3==flag4){
cout<<"MMYY"<<endl;
  }else if(flag1!=flag2&&flag3!=flag4){
  cout<<"NA"<<endl;
  }
}


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

int main() {
  int N;
  cin >> N;
  
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  vector<int> ans(N);
  for (int i = 0; i < N; i++) {
    ans.at(vec.at(i) - 1) = i + 1;
  }
  
  for (int i = 0; i < N; i++) {
    if (i != N - 1)
      cout << ans.at(i) << " ";
    if (i == N - 1)
      cout << ans.at(i) << endl;
  }
}

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

int main () {
  int N, C, K;
  cin >> N >> C >> K;
  vector<int> t(N);
  for (int i = 0; i < N; i++) {
    cin >> t.at(i);
  }
  sort(t.begin(), t.end());
  vector<bool> s(N, false);
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (s.at(i)) continue;
    count++;
    int x = min(N, i+C);
    if (i != N-1) {
      for (int j = i+1; j < x; j++) {
        if (t.at(j) > t.at(i) + K) break;
        else s.at(j) = true;
      }
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N;
 cin >> N ;
 vector<int> Light(N);
 
 for(int i = 0; i < N; i++){
  cin >> Light.at(i);
 }   
  int NEXT = 1;
  int check = 0;
  int kai = 1;
  
  for(int i = 0; i < N; i++){
   if(Light.at(NEXT -1) == 2){
     check = 1;
     break;
   }else{
     NEXT = Light.at(NEXT - 1);
     kai++;
   }
  }
  
  if(check == 1){
    cout << kai <<endl;
  }else{
    cout << -1 <<endl;
  }
  


}

Measured memory_bytes: 3744
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,x,y;
	cin>>a>>b>>c>>x>>y;
	if(a+b<=2*c)
		cout<<a*x+b*y;
	else if(x>y)
		cout<<min(2*y*c+a*(x-y),2*c*max(x,y));
	else
		cout<<min(2*x*c+b*(y-x),2*c*max(x,y));
	return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n, a int
	fmt.Scanln(&n)
	ans := make([]int, n)
	for i := 1; i <= n; i++ {
		fmt.Scan(&a)
		ans[a-1] = i
	}
	for i := 0; i < n-1; i++ {
		fmt.Print(ans[i], " ")
	}
	fmt.Println(ans[n-1])
}


Measured memory_bytes: 6144
def main():
    N, M = map(int, input().split(' '))

    A = []; B = []; i = 0
    while i < N:
        a, b = map(int, input().split(' '))
        A.append(a); B.append(b)
        i += 1
    
    A, B = zip(*sorted(zip(A, B)))
    
    count = M; money = 0
    for a, b in zip(A, B):
        while b:
            if count == 0:
                break
            count -= 1
            money += a
            b -= 1
    
    print(money)


if __name__ == '__main__':
    main()


Measured memory_bytes: 25916
#include "bits/stdc++.h"
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define mFOR(i, a, b) for (int i = a; i > b; i--)
#define MP make_pair
#define PB push_back
#define ALL(v) v.begin(), v.end()
#define N 100007
#define INF 1000000007
using namespace std;

typedef long long ll;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll fceil(ll a, ll b) { return (a % b == 0 ? a / b : a / b + 1); }
int main()
{
   char c;
   cin >> c;
   cout << (char)(c + 1) << endl;
   return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
   long int a, b, k;
   scanf("%ld %ld %ld", &a, &b, &k);

   if( a-k < 0 ){
      if( (a+b)-k < 0 ){
         a=0;
         b=0;
      }else{
         b-=(k-a);
         a=0;
      }
   }else{
      a-=k;
   }
   printf("%ld %ld\n", a, b);
   return 0;
}


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

int main() {
    int N;
    cin >> N;
    vector<int> B(N);
    for (int i = 1; i < N; i++)
        cin >> B[i];
    B[0] = B[1];

    int res = B[N - 1];
    for (int i = N - 1; i >= 0; i--) {
        res += min(B[i], B[i - 1]);
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
// Ver19.02
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF 1 << 29
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }

int main()
{
  ll x;
  scanf("%lld", &x);
  ll b = sqrt(x);
  ll ans = 1;
  for (int i = 2; i < b + 1; i++)
  {
    ll t = i * i;
    while (t <= x)
    {
      ans = MAX(ans, t);
      t *= i;
    }
  }
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int h,w;
  cin >> h >> w;
  char C[h][w];
  for(int i=0; i<h; i++){
      for(int j=0; j<w; j++){
          cin >> C[i][j];
      }
  }
  
  for(int i=0; i<h; i++){
      for(int j=0; j<w; j++){
          cout << C[i][j];
      }
      cout << endl;
      for(int j=0; j<w; j++){
          cout <<C[i][j];
      }
      cout << endl;
  }
  return 0;
}

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

int getmd(int a,int b,int c,int d){
    return abs(a-c)+abs(b-d);
}

int main(){
    int d;
    cin >> d;
    if(d==1)    puts("Hello World");
    else{
        int a,b;
        cin >> a >> b;
        cout << a+b << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
class DICE{
    public:
        int rear,back,right,left,up,down,TNP;

        void North();
        void East();
        void West();
        void South();
};

//北に1回動くときのサイコロの目の変化を記述
void DICE::North(){
    TNP=up;
    up=rear;
    rear=down;
    down=back;
    back=TNP;
}
//東に1回動くときのサイコロの目の変化を記述
void DICE::East(){
    TNP=up;
    up=left;
    left=down;
    down=right;
    right=TNP;
}
//西に1回動くときのサイコロの目の変化を記述
void DICE::West(){
    TNP=up;
    up=right;
    right=down;
    down=left;
    left=TNP;
}
//南に1回動くときのサイコロの目の変化を記述
void DICE::South(){
    TNP=up;
    up=back;
    back=down;
    down=rear;
    rear=TNP;
}


int main(){
    int Up,Rear,Right,Left,Back,Down;
    DICE DICE_1;
    std::cin>>Up>>Rear>>Right>>Left>>Back>>Down;

    DICE_1.up=Up;
    DICE_1.rear=Rear;
    DICE_1.right=Right;
    DICE_1.left=Left;
    DICE_1.back=Back;
    DICE_1.down=Down;

    std::string NEWS;
    std::cin>>NEWS;

    int i;
    for(i=0;i<NEWS.size();i++){
        if(NEWS[i]=='N'){
            DICE_1.North();
        }else if(NEWS[i]=='E'){
            DICE_1.East();
        }else if(NEWS[i]=='W'){
            DICE_1.West();
        }else if(NEWS[i]=='S'){
            DICE_1.South();
        }else{
            std::cout<<"Error"<<std::endl;
        }
    }

    std::cout<<DICE_1.up<<std::endl;
    return 0;   
}



Measured memory_bytes: 3216
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] input = br.readLine().split(" ");
        int a = Integer.parseInt(input[0]);
        int b = Integer.parseInt(input[1]);
        int x = Integer.parseInt(input[2]);

        if(a <= x && x <= (a+b)){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
}

Measured memory_bytes: 22228
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

void print(){ std::cout << std::endl; }
template <typename Head> void print(Head&& head) { std::cout << head << std::endl; }
template <typename Head, typename... Tail> void print(Head&& head, Tail&&... tail)
{
  std::cout << head << " ";
  print(std::forward<Tail>(tail)...); // or print(tail...);
}

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

  ll N, K;
  std::cin >> N >> K;
  std::vector< std::pair<ll, ll> > vp(N);
  for (ll i = 0; i < N; i++) {
    ll a, b;
    std::cin >> a >> b;
    vp[i].first  = a;
    vp[i].second = b;
  }

  std::sort(vp.begin(), vp.end());
  ll ans = 0LL;
  ll step = 0;
  for (ll i = 0; i < N; i++) {
    if (step <= K-1 && K-1 < step + vp[i].second) {
      ans = vp[i].first;
      break;
    }
    step += vp[i].second;
  }

  print(ans);
  return 0;
}


Measured memory_bytes: 1792
//Author: gkashish

#include <set>
#include <map>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <iomanip>

using namespace std;

#define mod 1000000007
#define x first
#define y second

pair<int, int> points[10];
long double tot;

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

    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> points[i].x >> points[i].y;
    }
    tot = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            tot += sqrt((long double) (points[j].x - points[i].x) * (points[j].x - points[i].x)
                        + (long double) (points[j].y - points[i].y) * (points[j].y - points[i].y));

        }
    }
    cout << setprecision(20) << tot / n;
    return 0;
}


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


public class Main{
    static long MOD = 1000000007;
    static long dp[] = new long[1 << 21];
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        // Start writing your solution here. -------------------------------------
        long MOD = 1000000007;
        //int t = sc.nextInt();
        int t = 1;
        while(t -- > 0)
        {
            int res = 0;
            long n = sc.nextLong();
            HashSet<Long> set = new HashSet();
            set.add(n);
            set.add(n - 1);
            for(long i = 2; i * i <= n; i++)
            {
                if(n % i == 0) {
                    long tmp = n;
                    while (tmp % i == 0) tmp /= i;
                    if ((tmp - 1) % i == 0) set.add(i);
                }
                else if((n - 1) % i == 0){
                    set.add(i);
                    set.add((n - 1) / i);
                }
            }
            set.remove(1l);
            out.println(set.size());
            //for(int ii = 0; ii <= n; ii++) System.out.println(Arrays.toString(dp[ii]));
        }
        out.close();
    }
    public static int solve(int x, int[] a){
        int max = 0, n = a.length - 1;
        for(int i = 1; i <= n; i++)
            if(a[i] > max) max = a[i];
        return 0;
    }
    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;
    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    //--------------------------------------------------------
}


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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

#define MAXM 110000

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

  map<int, int>mm,mp;
  rep(i,n){
    mp[x[i]%m]++;
    mm[x[i]]++;
  }

  int result=0;
  rep(i, m){
    if(i==0 || m%2==0 && i==m/2){
      result += mp[i]/2;
      continue;
    }
    int j=m-i;
    int ip=mp[i];
    int jp=mp[j];
    mp[i]=mp[j]=0;
    int many = i;
    if(jp > ip){
      many=j;
      swap(ip, jp);
    }
    result += jp;
    ip -= jp, jp=0;
    for(int k=many; k<=MAXM; k+=m){
      int d = min(ip/2 , mm[k]/2);
      if(d){
        result += d;
        ip -= d*2;
      }
    }
  }

  cout<<result<<endl;

  return 0;
}

Measured memory_bytes: 13524
#include <stdio.h>

int main(void){
	long lun[100000];
	int k, d, idx = 9;

	scanf("%d", &k);

	for(int i=0; i < 9; i++)
		lun[i] = i + 1;
	if(k <= idx) {
		printf("%ld", lun[k-1]);
		return 0;
	}

	for(int i=0; idx < k; i++) {
		for(int j=-1; j <= 1; j++) {
			d = lun[i]%10 + j;
			if(d < 0 || d > 9)
				continue;
			lun[idx++] = 10*lun[i] + d;
		}
	}
	printf("%ld", lun[k-1]);

	return 0;
}

Measured memory_bytes: 896
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		int n = Integer.parseInt(br.readLine());
		String[] str = br.readLine().split(" ");

		for (int i = n - 1; i >= 0; i--) {
			sb.append(str[i]);
			if (i != 0) {
				sb.append(" ");
			}
		}

		System.out.println(sb);
	}
}

Measured memory_bytes: 24112
#include<bits/stdc++.h>
#define ll long long int 
#define w(x) int x; cin>>x; while(x--)
#define pb push_back
#define mp make_pair
#define mod 1000000007
using namespace std;
int main(){
#ifndef ONLINE_JUDGE 
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ll n,A,B,c=0,b=0;
	cin>>n>>A>>B;
	string s;
	cin>>s;
	for(ll i=0; i<n; i++){
		if(s[i]=='c')
			cout<<"No"<<endl;
		else if(s[i]=='a' && c<A+B){
			c++;
			cout<<"Yes"<<endl;
		}
		else if(s[i]=='b' && b<B && c<A+B){
			c++;
			b++;
			cout<<"Yes"<<endl;
		}
		else 
			cout<<"No"<<endl;
	}
}

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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int N;
vi arr;

bool check(int x) {
	vi narr (2 * N - 1);
	F0R(i, 2 * N - 1) {
		if (arr[i] < x) {
			narr[i] = 0;
		} else {
			narr[i] = 1;
		}
	}
	int mid = N - 1;
	int r = 0;
	while (mid + r < 2 * N - 1) {
		r++;
		if (narr[mid - r] == narr[mid - r + 1]) {
			return (narr[mid-r]);
		}
		if (narr[mid + r] == narr[mid + r - 1]) {
			return (narr[mid+r]);
		}
	}
	return narr[0];
}

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> N;
	arr.resize(2 * N - 1);
	F0R(i, 2 * N - 1) cin >> arr[i];
	int lo = 1;
	int hi = 2 * N - 1;
	while (lo < hi) {
		int mid = lo + (hi - lo + 1) / 2;
		if (check(mid)) {
			lo = mid;
		} else {
			hi = mid - 1;
		}
	}
	print(lo);
	
}

Measured memory_bytes: 1920
n = gets.to_i
if n % 4 == 0 || n % 7 == 0 || n % 11 == 0
  puts "Yes"
else
  (0..25).each do |c|
    (0..14).each do |d|
      if 4 * c + 7 * d == n
        puts "Yes"
        exit
      end
    end
  end
  puts "No"
end

Measured memory_bytes: 1788