akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;

using ld=long double;

long long int gcd(long long int l, long long int r) {
	if (l > r)return gcd(r, l);
	else {
		if (r%l) {
			return gcd(l, r%l);

		}
		else {
			return l;
		}
	}
}

int main() {
	int N; long long int M;cin>>N>>M;
	vector<long long int>as(N);
	vector<ld>pers(N);
	for(int i=0;i<N;++i)cin>>as[i];
	for (int i = 0; i < N; ++i) {
		int p;cin>>p;
		pers[i]=(ld)(p)/100.0l;
	}

	ld ans=0;
	for (int i = 1; i < (1 << N); ++i) {
		bitset<18>use;
		for (int j = 0; j < N; ++j) {
			if(i&(1<<j))use[j]=true;
		}
		long long int num=1;
		ld aper=1;
		for (int j = 0; j < N; ++j) {
			if (use[j]) {
				long long int agcd(gcd(num, as[j]));
				ld val = ld(num)*ld(as[j]) / ld(agcd);
				if (val > 1e18 + 1e17) {
					num = 1e18 + 1e17;
				}
				else {
					num = num / agcd*as[j];
				}
				aper*=pers[j];
			}
		
			
		}
		if (use.count() % 2) {
			ans+=aper*(M/num);
		}
		else {
			ans-=aper*(M/num);
		}
	}
	cout<<setprecision(10)<<fixed<<ans<<endl;
	return 0;
}

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

class Main {

	Scanner in;
	PrintWriter out;

	int[] hh;
	int[] cc;

	public static void main(String... args) {
		new Main().solve();
	}

	void solve() {
		in = new Scanner(new InputStreamReader(System.in));

		int n = in.nextInt();
		int k = in.nextInt();
		hh = new int[n];
		cc = new int[n];
		Arrays.fill(cc, Integer.MAX_VALUE);

		for (int i = 0; i < n; ++i) {
			hh[i] = in.nextInt();
		}

		System.out.println(calc_cost2(k));
	}

	int calc_cost2(int k) {
		int len = hh.length;
		cc[len-1] = 0;
		cc[len-2] = Math.abs(hh[len-1]-hh[len-2]);
		for (int i = len-3; i >= 0; --i) {
			int maxJump = k;
			while (i+maxJump >= len) --maxJump;
			for (int j = 1; j <= maxJump; ++j)
				cc[i] = Math.min(cc[i], cc[i+j]+Math.abs(hh[i]-hh[i+j]));
		}

		return cc[0];
	}
}


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

using namespace std;

int main(int argc, char* argv[]) {
  long long N, A, B, C, D, E;
  cin >> N >> A >> B >> C >> D >> E;

  long long ret = 5;
  //do {
  //  if (N / A)
  //  ret += (long long)ceil((double)N / A) - 1;
  //  ret += (long long)ceil((double)A / B) - 1;
  //  ret += (long long)ceil((double)B / C) - 1;
  //  ret += (long long)ceil((double)C / D) - 1;
  //  ret += (long long)ceil((double)D / E) - 1;
  //} while (false);

  if (A <= B && A <= C && A <= D && A <= E) {
    ret += (long long)ceil((double)N / A) - 1;
  } else if (B <= A && B <= C && B <= D && B <= E) {
    ret += (long long)ceil((double)N / B) - 1;
  } else if (C <= A && C <= B && C <= D && C <= E) {
    ret += (long long)ceil((double)N / C) - 1;
  } else if (D <= A && D <= B && D <= C && D <= E) {
    ret += (long long)ceil((double)N / D) - 1;
  } else if (E <= A && E <= B && E <= C && E <= D) {
    ret += (long long)ceil((double)N / E) - 1;
  }

  cout << ret << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <queue>
#include <math.h>
#include <assert.h>
#include <set>
#include <map>
#include <bitset>
#include <ctime>
#include <time.h>
#include <algorithm>
#include <cstdio>
#include <fstream>
#include <stack>
#include <ctype.h>
#include <numeric>
#include <sstream>
#include <unistd.h>
#include <unordered_map>
#include <unordered_set>
#include <limits>
#include <random>
#include <chrono>
#include <iomanip>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
#define endl '\n'
#define debug(name) DEBUG(#name, (name))
template<typename T>
void DEBUG(string label, T value) {
    cerr << "[" << label << " = " << value << "]\n";
}

void solve(){
    int ans, a;
    for(int i = 0; i < 5; ++i){
        cin >> a;
        if(a == 0){
            ans = i + 1;
        }
    }
    cout << ans << endl;
}
int main(int argv, char **argc){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int t;
    t  = 1;
    while(t--)
        solve();

}


Measured memory_bytes: 3600
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int main() {
    int N, l, r, ans = 0;
    cin >> N;
    REP(i, N) {
        cin >> l >> r;
        ans += r - l + 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] a = new int[4];
		
		for(int i = 0; i < 4; i++) a[i] = sc.nextInt();
		
		if((Math.abs(a[0]-a[1]) <= a[3] && Math.abs(a[1]-a[2]) <= a[3]) || Math.abs(a[0]-a[2]) <= a[3]) System.out.println("Yes"); else System.out.println("No");
		
	}
}

Measured memory_bytes: 21588
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>
#include <queue>
#include <set>
#include <bitset>
#include <map>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<long long> vll;
typedef queue<int, int> qii;
typedef pair<int, int> pii;
typedef pair<string, int> psi;

#define PI 3.14159265359
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repz(i,n) rep(i,0,n)

//int型を受け取ってその桁数を返す
int check_digits(int n) {
	int digits = 0;
	while (n != 0) {
		n /= 10;
		digits++;
	}
	return digits;
}

//int型を受け取ってその各桁の和を返す
int sum_digits(int n) {
	int sum=0;
	int N = n;
	while (N) {
		sum += N % 10;
		N /= 10;
	}
	return sum;
}


//最大公約数を返す関数
int gcd(int n, int m) {
	while (n != 0) {
		if (n < m) swap(n, m);
		n = n % m;
	}
	return m;
}


//2点間の距離を返す
float dis(int x1, int y1, int x2, int y2) {
	return sqrt(pow(abs(x1 - x2), 2) + pow(abs(y1 - y2), 2));
}


int main() {
	int n, k, count = 0;
	cin >> n>>k;
	int temp;
	repz(i, n) {
		cin >> temp;
		if (temp >= k)count++;
	}

	cout << count << endl;

	system("pause");
	return 0;
}


Measured memory_bytes: 504
#include<bits/stdc++.h>
using namespace std;
#define FasterIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef unsigned long long ull;
typedef long long ll;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))
#define pb push_back
#define ff first
#define ss second
#define mk make_pair
#define pi pair<int,int>
#define vi vector<int>
#define pL pair<ll,ll>
#define vL vector<ll>
#define vp vector<pi>
#define vpL vector<pL>

const int MX=1000000;
const ll inf=1e9;
const ll mod=998244353;


vector<pi>edge;

int n;

void solve(int d)
{
    for(int u=n; u>=1; u--)
    {
        for(int v=u-1; v>=1; v--)
        {
            if(u+v!=d)
            {
                edge.push_back({u, v});
            }
        }
    }
}

int main()
{

    FasterIO;

    cin>>n;

    int d=n*(n-1); d/=2;

    int x=n*(n+1); x/=2;

    if(n&1) solve(x-d);
    else    solve(x-d+1);

    cout<<edge.size()<<endl;
    for(auto pr:edge) cout<<pr.ff<<' '<<pr.ss<<endl;

    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=1e9+7;

int find(string S[],int h,int w,int X,int Y){
	queue<pair<int,pair<int,int>>> q;
	pair<int,pair<int,int>> p;
	set<pair<int,int>> s;
	q.push({0,{X,Y}});
	s.insert({X,Y});
	int ans=0;
	while(q.size()>0){
		p=q.front();
		q.pop();
		int res=p.ff;
		int x=p.ss.ff;
		int y=p.ss.ss;
		ans=max(ans,res);
		if(x-1>=0&&s.find({x-1,y})==s.end()&&S[x-1][y]=='.'){q.push({res+1,{x-1,y}});s.insert({x-1,y});}
		if(x+1<h&&s.find({x+1,y})==s.end()&&S[x+1][y]=='.'){q.push({res+1,{x+1,y}});s.insert({x+1,y});}
		if(y-1>=0&&s.find({x,y-1})==s.end()&&S[x][y-1]=='.'){q.push({res+1,{x,y-1}});s.insert({x,y-1});}
		if(y+1<w&&s.find({x,y+1})==s.end()&&S[x][y+1]=='.'){q.push({res+1,{x,y+1}});s.insert({x,y+1});}
	}
	return(ans);
}

int32_t main(){
	IOS;
	int h,w;
	cin>>h>>w;
	string s[h];
	int ans=0;
	for(int i=0;i<h;i++) cin>>s[i];
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(s[i][j]=='.'){ans=max(ans,find(s,h,w,i,j));}
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int i, j, x, y, z, a, b, c;
	cin >> a >> b >> c;
	if (a < b && a < c && b < c) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}
}

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <map>
#include <complex>
#include <cmath>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define X real()
#define Y imag()
using namespace std;
typedef complex<int> cld;
typedef pair<int,int> pr;
typedef vector<cld> vcl;
typedef vector<int> vi;
typedef vector<pr> vpr;
typedef long long ll;
typedef map<pr,bool> mlb;
mlb existar;
vpr consil,star;
bool center(pr s){
	int x=s.first,y=s.second;
	REP(i,consil.size())
		if(!existar[pr(consil[i].first+x,consil[i].second+y)])
		return false;
	return true;
}
int main() {
	int n,m,fx,fy,tmp,tmpb;
	while(cin >> n && n){
		existar.clear();
		consil.clear();
		star.clear();
	cin >> fx >> fy;
	REP(i,n-1){
		cin >> tmp >> tmpb;
		consil.push_back(pr(tmp-fx,tmpb-fy));
	}
	cin >> m;
	REP(i,m){
		cin >> tmp >> tmpb;
		star.push_back(pr(tmp,tmpb));
		existar.insert(mlb::value_type(pr(tmp,tmpb),true));
	}
	REP(i,m){
		if(center(star[i]))
		cout << star[i].first-fx << " " <<star[i].second-fy << endl;
	}
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 1336
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
signed main() {
    int N; cin >> N;
    int ans = 0;
    for(int i=1; i*i<=N; i++) {
        // fprintf(stderr, "mod = %lld\n", i);
        int mod = i;
        if((N - mod) % mod == 0) {
            int div = (N - mod) / mod;
            if(div <= mod) continue;
            ans += (N - mod) / mod;
        }
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main(){
	string w;
	cin>>w;
	
	int count[200]={0};
	bool check=true;
	
	for(int i =0;i < w.length() ;++i)
	count[w[i]]+=1;
	
	for(int i=0;i<200;++i){
	    if(count[i]%2 !=0)check=false;
	}
	
	check?cout<<"Yes"<<endl:cout<<"No"<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define int long long
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

signed main() {
  int q,h,s,t,n;cin>>q>>h>>s>>t>>n;n *= 4;
  int a = min(t,min(s*2,min(h*4,q*8))),
      b = min(s,min(h*2,q*4)),
      c = min(h,q*2),
      d = q;
  int ans = 0;
  ans += a * (n / 8);
  n %= 8;
  ans += b * (n/4);
  n %= 4;
  ans += c * (n/2);
  n %= 2;
  ans += d * n;
  cout << ans << endl;
}


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

signed main(){
    string s,t;cin>>s>>t;
    cout<<t<<s<<endl;
}

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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef double ld;
#define int ll
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;
typedef pair<int, int> pii;
typedef pair<pii, pii> piii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cerr << (#x) << " = " << (x) << endl;

#ifdef RUS_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif

const double PI = 2 * acos(0.0);
#define rand shittttty_shit
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1>
inline istream & operator >> (istream &in, pair<T0, T1> &a) {
    return in >> a.first >> a.second;
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " <<  get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}


void smain();



signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#ifdef RUS_HOME
    freopen("input", "r", stdin);
    clock_t start = clock();
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef RUS_HOME
    cout << "\n\n\n\nTOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
    return 0;
}


void smain() {

    map<int,int>mp;
    for(int i=0;i<6;i++){
        int a;
        cin>>a;
        mp[a]++;
    }
    for(int i=1;i<=4;i++){
        if(mp[i]==3){
            cout<<"NO";
            return;
        }
    }
    cout<<"YES";



}

Measured memory_bytes: 3608
//package reedeka;
import java.util.*;
import java.math.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n;
		n = sc.nextInt();
		//System.close();
		long t1 = 2, t2 = 1;
		int i;
		long s = t2;
		if(n==0) {
			s = t1;
		}
		else {
		for(i=2; i<=n; i++) {
			s = t1 + t2;
			t1 = t2;
			t2 = s;
		}
		}
		System.out.println(s);
	}
}


Measured memory_bytes: 35600
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <assert.h>
#include <sys/time.h>
#include <fstream>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define REP(i,n)  FOR(i,0,n)
#define each(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define deb(x) cerr << #x << " = " << (x) << " , ";
#define debl cerr << " (L" << __LINE__ << ")"<< endl;
#define sz(s) (int)((s).size())


#define clr(a) memset((a),0,sizeof(a))
#define nclr(a) memset((a),-1,sizeof(a))
#define pb push_back
#define INRANGE(x,s,e) ((s)<=(x) && (x)<(e))
#define MP(x,y) make_pair((x),(y))

double pi=3.14159265358979323846;

using namespace std;
typedef long long ll;
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;

template<typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& z){
	os << "[ ";
	REP(i,z.size())os << z[i] << ", " ;
	return ( os << "]" << endl);
}

template<typename T> std::ostream& operator<<(std::ostream& os, const set<T>& z){
	os << "set( ";
	EACH(p,z)os << (*p) << ", " ;
	return ( os << ")" << endl);
}

template<typename T,typename U> std::ostream& operator<<(std::ostream& os, const map<T,U>& z){
	os << "{ ";
	EACH(p,z)os << (p->first) << ": " << (p->second) << ", " ;
	return ( os << "}" << endl);
}

template<typename T,typename U> std::ostream& operator<<(std::ostream& os, const pair<T,U>& z){
	return ( os << "(" << z.first << ", " << z.second << ",)" );
}

double get_time(){
	struct timeval tv;
	gettimeofday(&tv, NULL);
	return tv.tv_sec + tv.tv_usec*1e-6;
}

typedef unsigned int uint32_t;
struct RND{
	uint32_t x;
	uint32_t y;
	uint32_t z;
	uint32_t w;
	RND(){
		x=123456789;
		y=362436069;
		z=521288629;
		w=88675123;
	}
	void init(int seed){
		x=123456789;
		y=362436069;
		z=521288629;
		w=seed+100;
		REP(i,10)get();
	}
	uint32_t get(){
		uint32_t t;
		t=x^(x<<11);
		x=y;y=z;z=w;
		w=(w^(w>>19))^(t^(t>>8));
		return w;
	}
};
RND rnd;

void _main(istream &inp){
	ll N;
	inp >> N;
	vl a(N);
	rep(i,N) inp >> a[i];
	a.push_back(0);
	sort(a.begin(), a.end());
	a.push_back(0);
	reverse(a.begin(), a.end());
	//rep(i,a.size())debug(a[i]);
	ll i=1;
	while(a[i+1]>=i+1)i+=1;
	ll r1 = a[i]-i;
	ll r2 = 0;
	while(a[i+r2+1]==i)r2++;
	//debug(i);debug(r1);debug(r2);
	if(r1%2==0 && r2%2==0)cout << "Second" << endl;
	else cout << "First" << endl;

}

int main(){
	if(0){
		ifstream ifs("test.txt");
		_main(ifs);
	}
	else{
		_main(cin);
	}
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define PI 3.141592653589
#define ll long long
using namespace std;

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

  string s;
  cin >> s;
  int cnt = 0;

  for(int i=0; i<n; ++i){
    if(s[i] == s[i+1]) cnt++;
  }

  cout << n - cnt;

}

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

int64_t solve(const string & s) {
    int n = s.length();
    vector<array<int64_t, 2> > dp(n + 1);
    REP_R (i, n) {
        int c = s[i] - '0';
        int d = 9 - c + (i == n - 1);
        dp[i][0] = min(c + dp[i + 1][0], c + 1 + dp[i + 1][1]);
        dp[i][1] = min(d + 1 + dp[i + 1][0], d + dp[i + 1][1]);
    }
    return min(dp[0][0], dp[0][1] + 1);
}

int main() {
    string s; cin >> s;
    cout << solve(s) << endl;
    return 0;
}


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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair

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

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


int main() {
    i64 N, A, B; cin >> N >> A >> B;
    vector<i64> X(N);
    REP(i, N) cin >> X[i];

    i64 minc = 0;
    REP(i, N - 1) {
        minc += min((X[i + 1] - X[i]) * A, B);
    }
    cout << minc << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
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 {
        cout << "Christmas Eve Eve Eve" << endl;
    }
    return 0;
}

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

int main() {
	int N;
	cin>>N;
	vector<long long> X(101,0);
	for(int i=1; i<=N; i++){
		long long x; cin>>x;
		X[x]++;
	}
	long long res=1000000000;
	for(int  i=1; i<=100; i++){
		long long sum=0;
		for(int j=1; j<=100; j++){
		  if(X[j]!=0){
           // cout<<"aa"<<endl;
            sum+=pow((j-i),2)*X[j];
          }
          
		}
       // cout<<sum<<endl;
		res=min(res,sum);
        
	}
	cout<<res<<endl;
}

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

#define ll long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long,long long>

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

#define Debug(x) cout<<(#x)<<" >> "<<(x)<<endl

using namespace std;

ll fastpow(ll angka,ll pangkat,ll MOD){
	ll res=1;
	while(pangkat){
		if(pangkat&1) res=(res*angka)%MOD;
		angka=(angka*angka)%MOD;
		pangkat=pangkat>>1;
	}
	return res;
}

ll fastpow(ll angka,ll pangkat){
	ll res=1;
	while(pangkat){
		if(pangkat&1) res=(res*angka);
		angka=(angka*angka);
		pangkat=pangkat>>1;
	}
	return res;
}

ll gcd(ll angka1,ll angka2){
	while(angka2){
		swap(angka1,angka2);
		angka2=angka2%angka1;
	}
	return angka1;
}

ll lcm(ll angka1,ll angka2){
	return (angka1/gcd(angka1,angka2))*angka2;
}


void solve(){
	string s,t;
	cin>>s>>t;
	
	int minVal=s.size();
	for(int i=0;i<(int)s.size()-(int)t.size()+1;i++){
		int cur=0;
		for(int j=0;j<t.size();j++){
//			cout<<i+j<<" "<<j<<endl;
			if(s[i+j]!=t[j]){
				cur++;
			}
		}
		minVal=min(cur,minVal);
	}
	cout<<minVal<<endl;
}

int main(){
	
	fastio();

	int t=1;
//	cin>>t;
	
	for(int tt=0;tt<t;tt++){
//		cout<<"Case "<<tt+1<<":\n";solve();
		solve();
	}
	
	return 0;
}

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

int main(){
  int H, W, K;
  cin >> H >> W >> K;
  
  vector<string> grid;
  string row;
  for (int i = 0; i < H; i++){
    cin >> row;
    grid.push_back(row);
  }
  
  int score = 0;
  bool cond1, cond2, cond3;
  
  for (int h = 0; h < (1 << H); h++){
    for (int w = 0; w < (1 << W); w++){
      int black = 0;
      for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++){
          cond1 = ((h >> i) & 1) == 1;
          cond2 = ((w >> j) & 1) == 1;
          cond3 = grid[i][j] == '#';
          
          if ((cond1 && cond2) && cond3) black += 1;
        }
      }
      if (black == K) score += 1;
    }
  }
  
  cout << score;

  return 0;
}

Measured memory_bytes: 3136
#include<iostream>
#include<cstring>
#include<cstdio>
#define N (200000+1000)
using namespace std;
long long n,m,a[N],b[N],ans,s1[N],s2[N];
int main()
{
	scanf("%lld%lld",&n,&m);
	for (int i=1; i<=n; ++i)
		scanf("%lld%lld",&a[i],&b[i]);
	
	long long last=0,sum=0;
	for (int i=1; i<=n; ++i)
	{
		sum=sum-(a[i]-last)+b[i];
		last=a[i];
		s1[i]=max(s1[i-1],sum);
		ans=max(ans,sum);
	}
	
	last=m,sum=0;
	for (int i=n; i>=1; --i)
	{
		sum=sum-(last-a[i])+b[i];
		last=a[i];
		s2[i]=max(s2[i+1],sum);
		ans=max(ans,sum);
	}
	
	last=0,sum=0;
	for (int i=1; i<=n-1; ++i)
	{
		sum=sum-(a[i]-last)*2+b[i];
		last=a[i];
		ans=max(ans,sum+s2[i+1]);
	}
	
	last=m,sum=0;
	for (int i=n; i>=2; --i)
	{
		sum=sum-(last-a[i])*2+b[i];
		last=a[i];
		ans=max(ans,sum+s1[i-1]);
	}
	printf("%lld",ans);
}

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

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver {
 public:
  int n;
  Solver(LL n) : n(n){};

  void solve() {
    for (int i = 1; i <= n; ++i) {
      int tmp = (int)floor(i * 1.08);
      if (tmp == n) {
        cout << i << endl;
        return;
      }
    }
    cout << ":(" << endl;
  }
};

}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(12);
  long long n = 0;
  std::cin >> n;

  Problem::Solver sol(n);
  sol.solve();
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define BUF_SIZE 15
int main(void) {
  char line[BUF_SIZE];
  FILE *fp = stdin;
  if(!fgets(line, BUF_SIZE, fp)) return 0;
  int num, a, b;
  sscanf(line, "%d %d %d", &num, &a, &b);
  int res = !((b - a)&1);
  // if(num >= 3 && b==num && a == num-2) res = 1;
  // if(num==2) res = 0;
  printf("%s\n", res ? "Alice" : "Borys");
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
 #define ll long long
 #define ui unsigned int
 #define f first
#define s second
using namespace std;
const int MAX=1e5+30;
const int mod=1e9+7;
const double eps = 1e-7;
bool cmp(pair<int ,int> &a , pair<int , int > &b){
  return (a.f>b.f);
}
int main(){
//  ios_base::sync_with_stdio(0);
 // cin.tie(0);
  int n,k;
  cin>>n>>k;
  if(k==1)
    cout<<0;
  else
    cout<<(n-k);

}
        
    


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

int main(){
    int n;
    cin >> n;
    ll a[n], b[n];
    ll sa = 0, sb = 0;
    rep(i,n) {
        cin >> a[i];
        sa += a[i];
    }
    rep(i,n) {
        cin >> b[i];
        sb += b[i];
    }
    if(sa < sb){
        cout << "-1" << endl;
        return 0;
    }
    ll c = 0;
    int ans = 0;
    rep(i,n){
        if(a[i] < b[i]){
             c += b[i] - a[i];
             ans++;
        }
    }
    ll d[n];
    rep(i,n) d[i] = a[i] - b[i];
    sort(d,d+n,greater<ll>());
    int i = 0;
    while(c > 0){
        c -= d[i];
        i++;
    }
    cout << ans + i << endl;
    return 0;
}

Measured memory_bytes: 2560
use proconio::input;
use num_integer::gcd;
fn main() {
    input! {
        k: u32,
    }
    let mut s=0;
    for a in 1..=k { for b in 1..=k { for c in 1..=k {
        s+=gcd(a,gcd(b,c));
    }}}
    println!("{}",s);
}

Measured memory_bytes: 2096
#include "bits/stdc++.h"
using namespace std;

static const int MOD = 1000000007;

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 inv(long long a) {
        long long x, y;
        extgcd(a, MOD, x, y);
        return (x % MOD + MOD) % MOD;
}

long long fact[101010];
 
long long nCr(long long n, long long r){
        long long ans = fact[n] * inv(fact[r]) % MOD * inv(fact[n - r]) % MOD;
        return ans;
}

void init() {
        fact[0] = 1;
        for (int i = 1; i < 101010; i ++) fact[i] = fact[i - 1] * i % MOD;
}

int main() {
        init();
        int i, j;
        int n;
        cin >> n;
        vector<int> a(n + 1);
        vector<int> cnt(n, 0);
        for (int i = 0; i < n + 1; i ++) {
                cin >> a[i];
                cnt[a[i]] ++;
        }
        bool first = true;
        int l, r;
        for (int i = 0; i < n + 1; i ++) if (cnt[a[i]] == 2) {
                if (first) {
                        l = i;
                        first = false;
                } else r = i;
        }
        int sum = l + n - r;
        for (int k = 1; k <= n + 1; k ++) {
                long long ans;
                if (sum >= k - 1) ans = (nCr(n + 1, k) - nCr(sum, k - 1) % MOD + MOD) % MOD;
                else ans = nCr(n + 1, k) % MOD;
                cout << ans << endl;
        }
        return 0;
}


Measured memory_bytes: 2816
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <iomanip>
#include <sys/time.h>
#include <random>
#include <cassert>


#define fs first
#define sc second
#define endl "\n"

using namespace std;

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

/**
 *
 * @tparam T 配列の型
 */
template <typename T>
class ZetaTransformSubset{
public:
    using F = function<T(T, T)>;
    vector<T> w;


    vector<T> operator ()(vector<T> v, int n, F f){
        assert(v.size() == (1 << n));

        w.resize((1 << n));
        for(int i = 0; i < (1 << n); i++){
            w[i] = v[i];
        }

        for(int k = 0; k < n; k++){
            for(int s= 0; s < (1 << n); s++){
                if((s >> k) & 1){
                    w[s] = f(w[s], w[s ^ (1 << k)]);
                }
            }
        }

        return w;
    }
};


int main(){
    int n;  cin >> n;
    vector<ll> a(1 << n);
    for(int i = 0; i < (1 << n); i++){
        cin >> a[i];
    }

    vector<P> v(1 << n);
    for(int i = 0; i < (1 << n); i++){
        v[i].fs = a[i];
        v[i].sc = 0;
    }
    auto f = [](P x, P y){
        vector<ll> tmp;
        tmp.push_back(x.fs);
        tmp.push_back(x.sc);
        tmp.push_back(y.fs);
        tmp.push_back(y.sc);

        sort(tmp.begin(), tmp.end());
        P res = P(tmp[2], tmp[3]);

        return res;
    };

    vector<P> w = ZetaTransformSubset<P>()(v, n, f);
    vector<ll> cum(1 << n, 0);
    for(int i = 1; i < (1 << n); i++){
        cum[i] = max(cum[i-1], w[i].fs + w[i].sc);
    }

    for(int i = 1; i < (1 << n); i++){
        cout << cum[i] << endl;
    }


    return 0;
}


Measured memory_bytes: 21712
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9+7;

string s;

int main(){
  cin >> s;
  int ans = 0;
  rrep(i, s.size()-1){
    if(s[i] != s[i-1]) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 512
#include<stdio.h>
#include<math.h>

int main(void) {
  int n;
  scanf("%d", &n);
  int c, count=0, tmpcount, i, q;
  for(c=1; c<n; c++) {
    tmpcount=0;
    // 1..sqrt(n-c)でn-cを割り，余り0ならば割り切れる
    q = (int)sqrt(n-c);
    //printf("%d\n", q);
    // n-cをa*bにした時の(a,b)の数
    for(i=1; i<=q; i++) {
      //printf("%d, %d\n", n-c, i);
      if((n-c) % i == 0) {
        //printf("fuck\n");
        tmpcount++;
      }
    }
    // n-cが平方数でなければtmpcountの2倍，
    // 平方数ならば2倍から1引く
    if(q*q != (n-c)) {
      count += (tmpcount*2);
    }
    else {
      count += (tmpcount*2 - 1);
    }
  }
  printf("%d\n", count);
  return 0;
}

Measured memory_bytes: 2152
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int n, d;
	cin >> n >> d;
	vector < vector<int>>x(n, vector<int>(d));
	int i, j;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < d; j++)
		{
			cin >> x.at(i).at(j);
		}
	}
	int cnt=0;
	int k,l;
	int sum;
	for (i = 0; i < n - 1; i++)
	{
		for (l = i + 1; l < n; l++)
		{
			sum = 0;
			for (j = 0; j < d; j++)
			{
				sum += (abs(x.at(i).at(j) - x.at(l).at(j))) * (abs(x.at(i).at(j) - x.at(l).at(j)));
				//cout <<i<<" "<<l<<" "<<j<<" "<< x.at(i).at(j) <<" "<< x.at(l).at(j)<< " "<<sum << endl;
			}
			//cout << sum << endl;
			
			for (k = 1; k <= 1000; k++)
			{
				if (sum == k * k)
					cnt++;
			}
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 3612
import Control.Monad

main :: IO ()
main = do
  n       <- read <$> getLine
  ratios  <- replicateM n ((map read . words) <$> getLine)
  let [r1, r2]:rs = ratios
  print $ uncurry (+) $ minVote rs (r1, r2)

getMult :: Int -> Int -> Int
getMult x y
  | x `mod` y == 0  = mult
  | otherwise       = mult + 1
    where
      mult = x `div` y

minVote :: [[Int]] -> (Int, Int) -> (Int, Int)
minVote [] x = x
minVote ([r1, r2]:rs) (v1, v2) = minVote rs cv
  where
    m1    = getMult v1 r1
    m2    = getMult v2 r2
    m     = max m1 m2
    cv    = (r1 * m, r2 * m)

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll n=0;
    cin>>n;
    ll ans=0;
    if(n>=500){
        ll q=n/500;
        n-=(q*500);
        ans+=(1000*q);
    }
    ans+=((n/5)*5);
    cout<<ans;
   	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define maxn 5050
using namespace std;
typedef long long ll;
int n;
int ga,sa,ca;
int gb,sb,cb;
ll f[30000000];
int main()
{
    cin>>n;
    cin>>ga>>sa>>ca;
    cin>>gb>>sb>>cb;

    f[0]=0;
    for(int i=0;i<=n;i++)
    {
        if(i+ga<=n)  f[i+ga]=max(f[i+ga],f[i]+gb);
        if(i+sa<=n)  f[i+sa]=max(f[i+sa],f[i]+sb);
        if(i+ca<=n)  f[i+ca]=max(f[i+ca],f[i]+cb);
    }

    ll nowmax=n;
    for(int i=n;i>=0;i--)  nowmax=max(nowmax,f[i]+n-i);
    for(int i=0;i<=n;i++)  f[i]=0;
    n=nowmax;

    for(int i=0;i<=n;i++)
    {
        if(i+gb<=n)  f[i+gb]=max(f[i+gb],f[i]+ga);
        if(i+sb<=n)  f[i+sb]=max(f[i+sb],f[i]+sa);
        if(i+cb<=n)  f[i+cb]=max(f[i+cb],f[i]+ca);
    }

    ll ans=n;
    for(int i=0;i<=n;i++)  ans=max(ans,f[i]+n-i);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 196864
a,b,c,x=int(input()),int(input()),int(input()),int(input())
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            tmp=i*500+j*100+k*50
            if tmp==x:
                ans+=1
print(ans)

Measured memory_bytes: 3064
/*====Corycle====*/
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<cstdio>
#include<vector>
#include<cmath>
#include<ctime>
#include<stack>
#include<queue>
#include<map>
#define ll long long
#define pii pair<ll,ll>
#define fst first
#define scd second
#define mp make_pair
using namespace std;
const ll inf=0x3f3f3f3f;
const ll N=2e5+5;
ll read(){
	ll s=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){s=s*10+c-'0';c=getchar();}
	return s*f;
}
ll n,m,k,ans,a[N],b[N];
int main(){
	n=read(),m=read(),k=read();
	for(ll i=1;i<=n;i++)a[i]=read()+a[i-1];
	for(ll i=1;i<=m;i++)b[i]=read()+b[i-1];
	for(ll i=0;i<=n;i++){
		if(k>=a[i]){
			ll j=upper_bound(b+1,b+m+1,k-a[i])-b;
			ans=max(ans,i+j-1);
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()

using ll = long long;
using P = pair<int,int>;
using mp =  map<int,int>;

const int MOD = 1e9 + 7;

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

    int n;
    cin >> n;
    vector<int> p(n);
    rep(i, n) {
        cin >> p[i];
    }

    ll ans = 0;
    rep(i, n-1) {
        if(i+1 == p[i]){
            swap(p[i], p[i+1]);
            ans ++;
        }
    }

    for (int i = n-1; i > 0; --i) {
        if(i+1 == p[i]){
            swap(p[i], p[i-1]);
            ans++;
        }
    }
    
    cout << ans << endl;
    return 0;
}


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

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

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

bool Judge(int a){
	double b = a;
	//sqrt()???int?????\?????????
	for(int i = 2; i <= sqrt(b); i++){
		if(a % i == 0) return false;
	}
	return true;
}

int main(){
	int n;
	cin >> n;
	int Count = 0;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		if(Judge(a) == true) Count++;
	}
	cout << Count << endl;
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define yn(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YN(ans) if(ans)printf("YES\n");else printf("NO\n")
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}

int main(){
    ll n,a,b,c,d,e;
    in(n,a,b,c,d,e);
    vector<ll> vec={a,b,c,d,e};
    ll minv=a;
    ll mini=0;
    for(int i=1;i<5;i++){
        if(vec[i]<minv){
            minv=vec[i];
            mini=i;
        }
    }
    if(n<=minv){
        out(5);
        return 0;
    }
    ll ans=0;
    ans+=5;
    ans+=n/minv;
    if(n%minv==0)ans--;
    out(ans);
}

Measured memory_bytes: 3772
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
const lli mod=1e9+7;
const lli pINF=LLONG_MAX;
const lli nINF=-LLONG_MAX;
void fast() {std::ios::sync_with_stdio(false);cin.tie(NULL);}
lli power(lli a,lli b){lli ans=1;while(b!=0){ if(b%2==1){ans*=a;}b/=2;a*=a;} return ans;}
lli invmod(lli a) {return pow(a,mod-2);}
#define vi vector<int>
#define vlli vector<lli>
#define pb push_back
#define mp make_pair
#define F first
const int INF=0x3f3f3f3f;
#define PII pair<int,int>
#define S second
#define si(n) scanf("%d",&n)
#define sli(n) scanf("%lld",&n)
#define printi(n) printf("%d\n",n)
#define printli(n) printf("%lld\n",n)
#define all(v) v.begin(),v.end()
#define forn(i,n) for(int i=0;i<n;i++)
#define ld long double
void print(int a[],int n){for(int i=0;i<n;i++) cout<<a[i]<<" ";}

int main()
{
    lli n;
    sli(n);

    for(lli i=1;i<=3500;i++){
        for(lli j=i+1;j<=3500;j++){
            lli num=(1LL*i*j*n);
            lli den=(lli)((4*i*j)-(j*n)-(i*n));
            //cout<<"num and den is "<<num<<" "<<den<<endl;
            if(den>0 && num%den==0){
                cout<<i<<" "<<j<<" "<<(num/den)<<endl;
                return 0;
            }
        }
    }
	return 0;
}

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

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    string ans = a + b + c >= 22 ? "bust" : "win";
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
 
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;
 
#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second
 
int main(int argc, char **argv) {
	ll n, y;
	cin >> n >> y;
	REP(i, n+1) REP(j, n-i+1) if (i * 10000 + j * 5000 + (n-i-j) * 1000 == y) {
		cout << i << " " << j << " " << (n-i-j) << endl;
		return 0;
	}
	cout << "-1 -1 -1" << endl;
	return 0;
}
 

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

int n;
string s;

void scan()
{
    cin >> n;
    cin >> s;
}

int solve()
{
    auto count = 0;
    auto last = ' ';
    for(auto i = 0; i != n; ++i){
        if(s[i]==last) continue;

        ++count;
        last = s[i];
    }
    return count;
}

int main()
{
    scan();
    cout << solve() << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <limits>
#include <math.h>
#include <cmath>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int> ;
using vi = vector<int> ;
using vll = vector<long long>;
#define PI 3.141592653
#define rep(i, n) for(ll i = 0; i < n; i++)

int main(){
  ll n, x;
  cin >> n >> x;

  vll v(n);
  vll w(n);
  rep(i, n) { cin >> v[i]; w[n-1-i] = v[i];}

  ll cnt1 = 0;
  rep(i, n-1){
    ll k = v[i] + v[i+1] - x;
    if(k > 0){
      if(v[i+1] > k){cnt1 += k; v[i+1] -= k; continue;}
      else{cnt1 += k; v[i] -= k - v[i+1]; v[i+1] = 0; continue;}
    }
  }

  ll cnt2 = 0;
  rep(i, n-1){
    ll k = w[i] + w[i+1] - x;
    if(k > 0){
      if(w[i+1] > k){cnt2 += k; w[i+1] -= k; continue;}
      else{cnt2 += k; w[i] -= k - w[i+1]; w[i+1] = 0; continue;}
    }
  }
  

  cout << min(cnt1, cnt2) << endl;
  

}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>
#include <cassert>

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (a) - 1;i >=(b);--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())
#define ASSERT(cond,mes) assert(cond && mes)

using namespace std;
using ll = long long;

constexpr int mod = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u * v / gcd(u, v);
}

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

    int N;
    cin >> N;
    vector<int> A(N);
    cin >> A;

    vector<int> c(N);
    copy(ALL(A), c.begin());

    SORT(c);
    int max = c[N - 1];
    int max2 = c[N - 2];

    REP(i, N) {
        if (A[i] == max)cout << max2 << endl;
        else cout << max << endl;
    }
    return 0;
}

Measured memory_bytes: 3200