akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var a, b int
	con.Scan(&a, &b)
	con.Println((a + b) % 24)
	return nil
}


Measured memory_bytes: 640
/*
    2020.6.11
    Ве№И 1379
    LTC
*/
#include <bits/stdc++.h>
#define mem(f, x) memset( f, x, sizeof(f) )
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mk(x, y) make_pair(x, y)
#define fi first
#define se second
#define pk push_back
typedef long long LL;
using namespace std;
const int M = 2*1e5+50;
const int N = 2*1e5+50;
int n;
int a[N];

int main( ){
    while( scanf( "%d", &n ) != EOF ){
        int sum = 0, x;
        for( int i = 0; i < n; i++ ){
            scanf( "%d", &x );
            sum ^= x;
            a[i] = x;
        }
        for( int i = 0; i < n; i++ ){
            if( i ) printf( " " );
            printf( "%d", sum^a[i] );
        }
        printf( "\n" );
    }
    return 0;
}


Measured memory_bytes: 4572
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
 
#define mp make_pair
#define sz(x) (int)((x).size())
#define all(x) (x).begin(),(x).end()
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define eb emplace_back
 
typedef pair< int, int > pii;
typedef pair< long long, long long > pll;
typedef long long ll;
typedef unsigned long long ull;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vll;
typedef vector< vll > vvll;
typedef vector< pii > vpii;
typedef vector< vpii > vvpii;
typedef vector< pll > vpll;
typedef long double ld;
typedef vector< ld > vld;
typedef unsigned int uint;
 
template <uint MD> struct ModInt {
    using M = ModInt;
    const static M G;
    uint v;
    ModInt(ll _v = 0) { set_v(uint(_v % MD + MD)); }
    M& set_v(uint _v) {
        v = (_v < MD) ? _v : _v - MD;
        return *this;
    }
    explicit operator bool() const { return v != 0; }
    M operator-() const { return M() - *this; }
    M operator+(const M& r) const { return M().set_v(v + r.v); }
    M operator-(const M& r) const { return M().set_v(v + MD - r.v); }
    M operator*(const M& r) const { return M().set_v(uint(ull(v) * r.v % MD)); }
    M operator/(const M& r) const { return *this * r.inv(); }
    M& operator+=(const M& r) { return *this = *this + r; }
    M& operator-=(const M& r) { return *this = *this - r; }
    M& operator*=(const M& r) { return *this = *this * r; }
    M& operator/=(const M& r) { return *this = *this / r; }
    bool operator==(const M& r) const { return v == r.v; }
    const bool operator<(const M& o) const {return v < o.v; }
    M pow(ll n) const {
        M x = *this, r = 1;
        while (n) {
            if (n & 1) r *= x;
            x *= x;
            n >>= 1;
        }
        return r;
    }
    M inv() const { return pow(MD - 2); }
    friend ostream& operator<<(ostream& os, const M& r) { return os << r.v; }
};
 
using Mint = ModInt<(int)1e9 + 7>;

int main() { 
    #ifdef BLAT
        freopen("stdin", "r", stdin);
        freopen("stderr", "w", stderr);
    #endif

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

    int n;
    cin >> n;

    int ans = 0;

    for(int i = 1; i <= n; ++i) {
        int x;
        cin >> x;

        ans += (i&x&1);
    }


    cout << ans << '\n';
    return 0; 
}

Measured memory_bytes: 3604
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//Abdulhamid Han
//Bismillahirrahmanirrahim
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long int lo;
typedef pair< int,int > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(lo i=0;i<n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 4005;
const lo mod = 1000000007;

lo n,m,b[li],a[li],k,flag,dp[li];
lo cev;
string s;
vector<int> v;

inline lo add(lo x,lo y){
	if(x+y>=mod)return x+y-mod;
	return x+y;
}

int main(void){
	scanf("%lld %lld",&n,&m);
	FOR{
		scanf("%lld",&a[i]);
	}
	for(lo i=0;i<m;i++){
		scanf("%lld",&b[i]);
	}
	for(lo i=0;i<=n+m+1;i++){
		dp[i]=1;
	}
	for(lo i=n;i>=1;i--){
		for(lo j=i;j<m+i;j++){
			//~ if ((i & 7) || (j & 7)) {
				if(a[n-i]==b[j-i]){
					dp[j]=(add(dp[j-1],dp[j+1]))%mod;
				}
				else{
					dp[j]=(add(dp[j-1],dp[j+1])-dp[j])%mod;
				}
			//~ }
			//~ else{
				//~ if(a[n-i]==b[j-i]){
					//~ dp[j]=((dp[j-1]+dp[j+1]));
				//~ }
				//~ else{
					//~ dp[j]=(dp[j-1]+dp[j+1]-dp[j]);
				//~ }
			//~ }
		}
	}
	printf("%lld\n",(dp[m]%mod+mod)%mod);
	return 0;
}


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

string in;

void init(){
  in = "";
}
bool input(){
  return !!(cin>>in);
}

string solve(){
  string ans("");
  for(int i=0;i<in.size();i++){
    if(in[i]=='@'){
      int tmp = in[i+1]-'0';
      for(int j=0;j<tmp;j++){
        ans += in[i+2];
      }
      i+=2;
    }else{
      ans += in[i];
    }
  }
  return ans;
}

int main(){
  while(init(),input()){
    cout<<solve()<<endl;
  }
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
#define ll long long int
#define endl '\n'
#define M 1000000007
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define f first
#define s second
#define b begin
#define e end
#define pb push_back
#define mp make_pair
#define FOR(i,a,b) for(i=a;i<b;i++)
#define RFOR(i,a,b) for(i=a;i>=b;i--)
#define all(x) x.begin(),x.end()
#define itfr(it,x) for(it=x.begin();it!=x.end();it++)
#define flash ios_base::sync_with_stdio(false); cin.tie(NULL)
using namespace std;

int main()
{
    flash;
    //sieve();
    ll a,b,c,d,e,n,mx;
    cin>>n>>a>>b>>c>>d>>e;
    mx = min(a,min(b,min(c,min(d,e))));
    cout<<4+(ll)ceil((double)n/mx);
}

Measured memory_bytes: 3748
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

a = inp()
b = inp()
c = inp()
print((a+b)*c//2)


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

bool solve(const string &s) {
	vector<vector<bool>> dp(1 << 10, vector<bool>(10, false));
	set<pair<int, int>> states;

	int S = 0;
	for(const auto &c : s) {
		if(c == 'u') {
			S = 0;
		} else {
			const int x = c - '0';
			if(S) {
				if(S & (1 << x)) return false;
				dp[S][x] = true;
				states.emplace(S, x);
			}
			S |= 1 << x;
		}
	}

	for(int lock = 1; lock < (1 << 10); ++lock) {
		for(int want = 0; want < 10; ++want) {
			if(!dp[lock][want]) continue;

			const int S_want = 1 << want;
			if(lock & S_want) return false;

			for(const auto &e : states) {
				if((lock & e.first) == 0 && (S_want & e.first)) {
					dp[lock | e.first][e.second] = true;
				}
			}
		}
	}
	return true;
}

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

	for(int n; cin >> n && n;) {
		string s;
		cin >> s;
		cout << (solve(s) ? "SAFE" : "UNSAFE") << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 3372
use io::*;
use std::*;

const MOD: i64 = 1000000007;
fn solve(N: i64, M: i64) {
    if N == M {
        println!("{}",2 * stair_m(N,MOD) * stair_m(M,MOD) % MOD);
    } else if N == M + 1 || N + 1 == M {
        println!("{}",stair_m(N,MOD) * stair_m(M,MOD) % MOD);
    } else {
        println!("0");
    }
}

fn stair_m(n: i64, m: i64) -> i64 {
    (1..n+1).fold(1, |ac,x| ac * x % m)
}

fn main() {
    let con = read_string();
let mut scanner = Scanner::new(&con);
let mut N: i64;
N = scanner.next();
let mut M: i64;
M = scanner.next();
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(move || solve(N, M)).unwrap().join().unwrap();
}

pub mod io {
    use std;
    use std::str::FromStr;

    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T: FromStr>(&mut self) -> T {
            let s = self.iter.next().unwrap();
            if let Ok(v) = s.parse::<T>() {
                v
            } else {
                panic!("Parse error")
            }
        }

        pub fn next_vec_len<T: FromStr>(&mut self) -> Vec<T> {
            let n: usize = self.next();
            self.next_vec(n)
        }

        pub fn next_vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }
    }

    pub fn read_string() -> String {
        use std::io::Read;

        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }

    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}


Measured memory_bytes: 8572
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define mod 1000000007
#define MAX 1000000000000000
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revrep(i,a,b) for(i=(ll)a;i>=(ll)b;i--)
#define ii pair<ll,ll>
#define MP make_pair
#define pb push_back
#define f first
#define se second
#define ll long long int
#define vi vector<ii>
ll modexp(ll a,ll b){ ll res = 1; while(b > 0){  if(b & 1) res = (res * a)%mod;  a = (a * a)%mod;  b/=2;  }  return res; }
#define rs resize
typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

const ll N = 3;
ll i,cnt;
string s,t;
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>s>>t;
    rep(i,0,N) cnt += s[i] == t[i];
    cout<<cnt;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int h,m1,m2,m3,w;
	m1=0;
	m2=0;
	m3=0;
	for(int i=0;i<10;i++){
		scanf("%d",&h);
		if(m3<h){
			m3=h;
			if(m2<m3){
				w=m2;
				m2=m3;
				m3=w;
				if(m1<m2){
					w=m1;
					m1=m2;
					m2=w;
				}
			}
		}
	}
	printf("%d\n%d\n%d\n",m1,m2,m3);
	return 0;
}


Measured memory_bytes: 2076
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

// Acknowledgement: Special thanks to kyomukyomupurin, who developed this
// template.
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

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

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

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

int main() {
  int64 N;
  cin >> N;
  vector<pair<int64, int64>> p(N);
  int64 x, l;
  for (int i = 0; i < N; i++) {
    cin >> x >> l;
    p[i].first = x - l;
    p[i].second = x + l;
  }

  sort(p.begin(), p.end(),
       [](const auto& x, const auto& y) { return x.second < y.second; });
  debug(p);

  int64 ans = 0;
  int64 cur = -1e10;
  for (int i = 0; i < N; i++) {
    if (cur <= p[i].first) {
      ans++;
      cur = p[i].second;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4756
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
string S, T;
bool comp(string S, string T) {
	if (S.size() < T.size())return true;
	if (S.size() > T.size())return false;
	for (int i = 0; i < S.size(); i++) {
		if (S[i] < T[i])return true;
		if (S[i] > T[i])return false;
	}
	return true;
}
int main() {
	cin >> S >> T;
	if (S == T) { cout << "EQUAL" << endl; }
	else if (comp(S, T) == true) { cout << "LESS" << endl; }
	else { cout << "GREATER" << endl; }
	return 0;
}

Measured memory_bytes: 256
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define RALL(x) (x).rbegin(), (x).rend()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define debug(x) std::cerr<<#x<<": "<<(x)<<endl;
using namespace std;
using lint = long long;
template<class T> using grid = vector<vector<T>>;
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; }
static const lint MOD = (lint)1e9+7;

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

    int num = (K - 1) * 2 + 1;
    for (int i = 0; i < num; ++i)
    {
        if (i < num - 1)
        {
            cout << X - K + 1 + i << " ";
        }
        else
        {
            cout << X - K + 1 + i;
        }
    }
    cout << "\n";

    return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for (int i = 0; i < (int)c; i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int,int>;
const int inf = 1000000000; //10^9
const ll MOD = 1e9 + 7;
//加算代入演算子は+=！！！！！
//int 2^31 10^9まで
int main() {
    int x, y, z; //y x z -> z x y
    cin >> x >> y >> z;
    cout << z << " " << x << " " << y << endl;
return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
int main()
{
ll n;
cin>>n;
vector<pair<ll,ll> > vc;
ll x,y;
for(ll i=0;i<n;i++)
{
cin>>x>>y;
vc.push_back({y,x});
}
sort(vc.begin(),vc.end());
ll s=0;
string ans="Yes";
for(ll i=0;i<n;i++)
{
if(s+vc[i].second>vc[i].first)
{
ans="No";
break;
}
s+=vc[i].second;
}
cout<<ans<<endl;
}

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

int main() {
    double T;
    int A,B;
    int count =0;
    cin >>A>>B>>T;
    int t = A;
    while(t<=T){
        count +=B;
        t +=A;
    }
    cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define int long long
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
using namespace std;
signed main(){
    int n; cin>>n;
    deque<int> a(n);
    rep(i,n) cin>>a.at(i);
    if(a.front()>0){
        cout<<-1<<endl;
        return 0;
    }
    int cnt=-1,ans=0;
    a.push_back(-1);
    rep(i,n){
        cnt++;
        if(a.at(i+1)>a.at(i)+1){
            cout<<-1<<endl;
            return 0;
        }
        if(a.at(i+1)<=a.at(i)){
            ans+=cnt;
            cnt=a.at(i+1)-1;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
#define rep(i, s, n) for(int i = s; i < n; i++)
#define rrep(i, s, n) for(int i = s; i > (s)-(n); i--)
#define pr(s) std::cout << s << std::endl
#define prb(s) std::cout << s
using namespace std;



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


  int a, b, c, d;
  cin >> a >> b >> c >> d;

  pr(min(a, b) + min(c, d));

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repd(i,a,b) for (int i = (a); i < (b); i++)
typedef long long ll;
int main(void)
{
	int w, n;
	cin >> w;
	cin >> n;
	vector<int> l(w);
	rep(i, w)
	{
		l[i] = i+1;
	}
	
	rep(i, n)
	{
	    int a, b;
	    cin >> a;
	    cin.ignore();
	    cin >> b;
	    swap(l[a-1], l[b-1]);
	}
	
	rep(i, w)
	{
	    cout << l[i] << endl;
	}
}


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

constexpr long long inf = numeric_limits<long long>::max()/10;
struct edge{
    long long to,cost;
    edge(){}
    edge(long long to_,long long cost_) : to(to_),cost(cost_){}
};

vector<long long> dijkstra(int s,const vector<vector<edge>>& g){
    using P = pair<long long,long long>;
    long long V = g.size();
    vector<long long> d(V,inf);
    priority_queue<P,vector<P>,greater<P>> que;
    d[s] = 0;
    que.push(P(0,s));
    while(!que.empty()){
        P p=que.top();que.pop();
        long long v=p.second;
        if(d[v]<p.first) continue;
        for(int i=0;i<g[v].size();i++){
            edge e=g[v][i];
            if(d[e.to]>d[v]+e.cost){
                d[e.to]=d[v]+e.cost;
                que.push(P(d[e.to],e.to));
            }
        }
    }
    return d;
}

int main(){
    int n;
    cin>>n;
    vector<vector<edge>> g(n);
    for(int i=0;i<n;i++){
        int u,k;
        cin>>u>>k;
        for(int j=0;j<k;j++){
            long long v,c;
            cin>>v>>c;
            g[u].push_back(edge(v,c));
        }
    }
    auto dist = dijkstra(0,g);
    for(int i=0;i<n;i++){
        cout << i << " " << dist[i] << endl;
    }
}

Measured memory_bytes: 3148
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder {
    class Program {
        static void Main(string[] args) {
            //var N = int.Parse(Console.ReadLine());
            //var inputList = new List<int>();
            //foreach (var i in Enumerable.Range(0, N))
            //    inputList.Add(int.Parse(Console.ReadLine()));

            var first = Console.ReadLine().ToCharArray();
            var second = Console.ReadLine().ToCharArray();
            var third = Console.ReadLine().ToCharArray();

            Console.WriteLine("{0}{1}{2}",first[0],second[1],third[2]);
            return;
        }
    }
}


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

void decodeOneChar(string& str) {
    for (int i = 0; i < (int)str.length(); i++) {
        if ('a' <= str[i] && str[i] < 'z') {
            str[i]++;
        } else if (str[i] == 'z') {
            str[i] = 'a';
        }
    }
}

int main() {
    string input;
    while (getline(cin, input)) {
        while (input.find("the") == string::npos && input.find("this") == string::npos && input.find("that") == string::npos) {
            decodeOneChar(input);
        }
        cout << input << endl;
    }
}

Measured memory_bytes: 0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.ABC.ABC120
{
    class B
    {
        public static void Solve()
        {
            var input = Console.ReadLine().Split(' ');
            var a = int.Parse(input[0]);
            var b = int.Parse(input[1]);
            var k = int.Parse(input[2]);


            List<int> list = new List<int>();
            for (int i = 1; i < 200; i++)
            {
                if (a % i == 0 && b % i == 0)
                {
                    list.Add(i);
                }
            }

            var ll = list.OrderByDescending(x => x).ToList();
            Console.WriteLine(ll[k-1]);

        }

        static void Main(string[] args)
        {
            Solve();
        }
    }
}


Measured memory_bytes: 13268
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

class AtCoder{
  public static void Main(){

    int n = int.Parse(Console.ReadLine());
    var input = Console.ReadLine().Split();
    int[] a = new int[n];
    int x4 = 0;
    int x2 = 0;
    for (int i = 0; i < n; i++)
    {
        a[i] = int.Parse(input[i]);
        if(a[i] % 4 == 0) x4++;
        else if(a[i] % 2 == 0) x2++;
    }

    bool b = false;
    if(x2 > 0 && 2 * x4 + x2 >= n) b = true;
    if(x2 == 0 && 2 * x4 + 1 >= n) b = true;

    if(b) Console.WriteLine("Yes");
    else Console.WriteLine("No");

  }
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int H, A;
    cin >> H >> A;
    if (H % A == 0){
        cout << H / A << endl;
    } else {
        cout << (H / A) + 1 << endl;
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


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

int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<ll, ll>> drink(N);
  for (int i = 0; i < N; i++) cin >> drink[i].first >> drink[i].second;
  sort(drink.begin(), drink.end());
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    if (drink[i].second < M) {
      ans += drink[i].first * drink[i].second;
      M -= drink[i].second;
    }
    else {
      ans += drink[i].first * M;
      break;
    }
  }
  cout << ans << endl;
}


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

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define int long long
#define pb push_back
#define pii pair<int,int>
#define fr(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
int dp[int32_t(1e5)+5];
int dfs(int root , map<int , vector<int>>&mp)
{
    if(dp[root] != -1) return dp[root];
    if(mp[root].size() == 0)return 0;
    int cnt=0;
    for(auto x:mp[root])
    {
        //cout<<"For Loop for Root "<<root<<endl;
        cnt=max(1+dfs(x , mp) , cnt);
    }
    return dp[root]=cnt;
}
int32_t main()
{   fastio;
    int n , m;
    cin>>n>>m;
    for(int& i:dp)i=-1;
    map<int , vector<int>>mp;
    for(int i=0; i<m; i++)
    {
        int u , v;
        cin>>u>>v;
        mp[u].pb(v);
    }
    for(int i=1; i <= n; i++)
    {
        dfs(i , mp);
        //cout<<endl;
    }
    /*for(int i=1; i <= n; i++)cout<<dp[i]<<" ";
    cout<<endl;*/
    cout<<*max_element(dp+1 , dp+n+1)<<"\n";
}

Measured memory_bytes: 20080
using System;
using System.Collections.Generic;

namespace ConsoleApp1
{
    class Program
    {
        public static void Main()
        {
            string l = Console.ReadLine();
            double L = double.Parse(l);
            double longth = L / 3; 

            Console.WriteLine(longth*longth*longth);
        }
    }
}

Measured memory_bytes: 13268
#include <iostream>
#include <cstdio>
#include <string.h>
using namespace std;



int main(){
    char N[1000];

    string n;

    scanf("%s", N);

    n = N;

    int i;
    //strlen(N);

    //printf("%s\n", n.c_str());
   

    i = n.find_first_of('7');

    if(i != string::npos){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }

    return 0;
    
}


Measured memory_bytes: 3684
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
    ll n;
    cin>>n;
    ll a[5];
    for(int i=0;i<5;i++)cin>>a[i];
    sort(a,a+5);
    //first number;
    ll d=n/a[0];
    ll rem=n%a[0];
    if(rem==0)cout<<d+4;
    else cout<<d+5;
	return 0;
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define all(a) (a).begin(),(a).end()
int cnt;

void buble_sort(pair<int, char> a[], int n){
    rep(i,n)for(int j=n-1;j>i;j--)if(a[j].first < a[j-1].first)swap(a[j], a[j-1]);
}

void select_sort(pair<int, char> a[], int n){
    rep(i,n){
        int minj = i;
        REP(j,i,n)if(a[j].first < a[minj].first)minj = j;
        swap(a[i], a[minj]);
    }
}

int main(){
    int n;
    cin >> n;
    pair<int, char> b[n], s[n];
    rep(i,n){
        string t;
        cin >> t;
        b[i] = make_pair(t[1]-'0', t[0]);
        s[i] = make_pair(t[1]-'0', t[0]);
    }

    buble_sort(b, n);
    select_sort(s, n);

    bool same = true;
    rep(i,n)if(b[i].second != s[i].second)same = false;

    rep(i,n){
        cout << b[i].second << b[i].first;
        if(i < n-1)printf(" ");
        else printf("\n");
    }
    printf("Stable\n");
    
    rep(i,n){
        cout << s[i].second << s[i].first;
        if(i < n-1)printf(" ");
        else printf("\n");
    }
    cout << ((same)? "Stable": "Not stable") << endl;
    
    return 0;
}


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

int a[300];

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

  int H; cin >> H;
  for(int i = 1; i <= H; i++){
    cin >> a[i];
  }

  for(int i = 1; i <= H; i++){
    cout << "node " << i << ": ";
    cout << "key = " << a[i] << ", ";
    if(i != 1) cout << "parent key = " << a[i/2] << ", ";
    if(i*2 <= H) cout << "left key = " << a[i*2] << ", ";
    if(i*2+1 <= H) cout << "right key = " << a[i*2+1] << ", ";
    cout << '\n';
  }

  return 0;
}



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

int main(){
    int n,count;
    cin >> n;
    int ans = 0;
    for(int i=1;i<=n;i+=2){
        count = 0;
        for(int j=1;j<=n;j++){
            if(i%j==0) count++;            
        }
        if(count==8)ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3600
import java.util.Scanner;

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

        int num = scan.nextInt();	//入力
        int sumt= 0;
        int sumh =0;
        
        //-が入力されたらbreak
        for(int i=0; i<num; i++) {

            String taro = scan.next();	//動物名の入力
            String hana = scan.next();	//動物名の入力
            
            if(taro.compareTo(hana) < hana.compareTo(taro)) {
            	
            	sumh += 3;
            	
            }else if(taro.compareTo(hana) > hana.compareTo(taro)){
            	
            	sumt += 3;
            	
            }else if(taro.compareTo(hana) == hana.compareTo(taro)) {
            	
            	sumh += 1;
            	sumt += 1;
            	
            }
        }
        
        System.out.println(String.format("%d %d",sumt, sumh));
    }
}


Measured memory_bytes: 30604
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// gp_hash_table<int, int> mapka;

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); }
template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

const int MAX = 1000010;
int n;
string t;
int i2[MAX];
int sp[MAX];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> n >> t;
  bool cz = 0;
  R(i,n){
    t[i] -= '1';
    if(t[i] == 1)cz = 1;
  }
  if(cz){
    R(i,n)t[i]%=2;
  }else{
    R(i,n)t[i]/=2;
  }
  i2[1] = 0;
  for(int i = 2; i <= n; i++){
    if(i&1){
      i2[i] = 0;
    }else{
      i2[i] = i2[i/2] + 1;
    }
  }
  sp[0] = 0;
  R(i,n){
    sp[i + 1] = sp[i] + i2[i + 1];
  }
  int res = 0;
  n--;
  R(i,n + 1){
    if(sp[n] == sp[i] + sp[n-i]){
      debug(n,i);
      if(t[i]){
        res ++;
      }
    }
  }
  if((res&1) == 0){
    cout << "0\n";
  }else{
    if(cz){
      cout << "1\n";
    }else{
      cout << "2\n";
    }
  }

}


Measured memory_bytes: 16924
#include<iostream>
#include<math.h>
#include<vector>
#include<set>
#include<algorithm>
#include<ctype.h>
#include<unordered_set>
#include<string>
#include<iomanip>
#include<queue>
#include<limits>
 
using namespace std;
int gcd(int a, int b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}
#define MOD 1000000007
#define INF 99999999999 
#define pb push_back
#define mt make_tuple
#define ll long long
ll ncr(ll n, ll r)
{
	ll i, ans = 1, k = 0;
	if (r == 0)
		return 1;
	else if (n < r)
		return 0;
	for (i = n; i >= n - r + 1; i--)
	{
		ans *= i;
		ans /= n - i + 1;
	}
 
 
	return ans;
 
}
bool visited[6] = { false };
int n = 6;
vector<int> adj[6];
 
 
void max_heapify(int a[100], int i)
{
	int l, r, largest = i;
	l = 2 * i + 1;
	r = 2 * i + 2;
	if (l<n && a[l]>a[i])
		largest = l;
	if (r<n && a[r]>a[l])
		largest = r;
	if (largest != i)
	{
		int k;
		k = a[i];
		a[i] = a[largest];
		a[largest] = k;
		max_heapify(a, largest);
	}
 
}
int power(ll x, ll y, ll p)
{
	int res = 1;
	x = x % p;
 
	while (y > 0)
	{
 
		if (y & 1)
			res = (res * x) % p;
 
 
		y = y >> 1;
		x = (x * x) % p;
	}
	return res;
}
 
bool square(ll n)
{
	double x;
	x = sqrt(n);
	if (x == floor(x))
		return true;
	else return false;
}
 
 
bool prime(ll n)
{
	ll i;
	for (i = 2; i * i <= n; i++)
	{
		if (n % i == 0)
			return false;
	}
	return true;
}
void dfs(ll a, ll b, vector<pair<ll, ll>>adj[][1001], bool visited[][1001])
{
	visited[a][b] = true;
	for (auto u : adj[a][b])
	{
		if (!visited[get<0>(u)][get<1>(u)])
		{
			visited[get<0>(u)][get<1>(u)] = true;
			dfs(get<0>(u), get<1>(u), adj, visited);
		}
	}
}
ll modi(ll a, ll m)
{
	return power(a, m - 2, m);
 
}
 
int main()
{
	ll n, i, w, j;
	ll wt[1000], v[1000];
	wt[0] = 0, v[0] = 0;
	cin >> n >> w;
	for (i = 1; i <= n; i++) {
		cin >> wt[i] >> v[i];
	}
	ll dp[101][100001] = { 0 };
	for (i = 1; i <= n; i++) {
		for (j = 1; j <= w; j++) {
			if (wt[i] <= j) {
				dp[i][j] = max(v[i] + dp[i - 1][j - wt[i]], dp[i-1][j]);
			}
			else
				dp[i][j] = dp[i - 1][j];
		}
	}
	cout << dp[n][w];
	return 0;
}

Measured memory_bytes: 79104
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <iomanip>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#define ls x*2
#define rs x*2+1
#define fi first
#define se second
#define ll long long
#define pb push_back
#define vi vector<int>
#define lowbit(x) x&(-x)
#define pii pair<int,int>
#define umap unordered_map
#define uset unordered_set
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);

using namespace std;

const int INF = 0x3f3f3f3f;

ll get(ll a) {
	if(a%4==1)
		return 1;
	else if(a%4==2)
		return a+1;
	else if(a%4==3||a==0)
		return 0;
	else
		return a;
}

int main() {
	IOS;
#ifdef xiaofan
	freopen("in.txt","r",stdin);
#endif

	ll a,b;
	cin>>a>>b;
	ll ans=get(b)^get(a-1);
	if(a==0){
		if(b==0)ans=0;
		else ans=get(b);
	}
	cout<<ans<<endl;



#ifdef xiaofan
	cerr<<"Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC<<"s.\n";
#endif
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  vector<int> x(n), y(n);
  for (ll i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
  }
  int a = INT_MIN;
  int c = INT_MIN;
  int b = INT_MAX;
  int d = INT_MAX;
  for (int i = 0; i < n; ++i) {
    a = max(a, x[i] + y[i]);
    b = min(b, x[i] + y[i]);
    c = max(c, x[i] - y[i]);
    d = min(d, x[i] - y[i]);
  }
  cout << max(a - b, c - d) << '\n';
  return 0;
}



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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

class Combination{
	vector<ll> fac,finv,inv;
public:
	Combination(ll N){
		fac.resize(N+1);
		finv.resize(N+1);
		inv.resize(N+1);
		fac[0] = fac[1] = 1;
		finv[0] = finv[1] = 1;
		inv[1] = 1;
		for(int i=2;i<=N;i++){
			fac[i] = fac[i-1] * i % atcoder_mod;
			inv[i] = atcoder_mod - inv[atcoder_mod%i] * (atcoder_mod/i) % atcoder_mod;
			finv[i] = finv[i-1] * inv[i] % atcoder_mod;
		}
	}
	ll Caluclation(ll n,ll r){
		if(n < r) return 0;
		if (n < 0 || r < 0) return 0;
		return fac[n] * (finv[r] * finv[n-r] % atcoder_mod) % atcoder_mod;
	}

};
ll BallBoxCombination5(ll n,ll k){
	Combination comb(k);
	return comb.Caluclation(k,n);
}

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

	ll N=in<ll>(),K=in<ll>();
	
	ll ans = BallBoxCombination5(N,K);
	out(ans);
	return 0;
}



Measured memory_bytes: 3212
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
Alice = 0
Bob = 0
b = 1
for i in range(N):
  if b: # Aliceのターン
    Alice += a[i]
  else: # Bobのターン
    Bob += a[i]
  b = 0 if b == 1 else 1

print(Alice-Bob)

Measured memory_bytes: 3064
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		String s=sc.next();
		s=s.replace('?', 'D');		
		print(s);
	}
	
	private static void print(Object o) {
		System.out.println(o.toString());
	}
}

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

Measured memory_bytes: 35448
# coding: utf-8
# Your code here!

X, Y = map(int, input().rstrip().split())

# nを素因数分解
# 各素因数を数え上げる場合はcounterを使うとよい
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
    
print(1 + len(set(prime_factorize(X)) & set(prime_factorize(Y))))
        


Measured memory_bytes: 38512
namespace Test
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Test
    {
        public static void Main(string[] args)
        {
            var test = new Test();
            var input = test.ReadInput();
            var s = input[0];
            var t = input[1];
            var input2 = test.ConvertIntArray(test.ReadInput());
            var a = input2[0];
            var b = input2[1];
            var temp = Console.ReadLine();
            if(temp == s)
            {
                a--;
            }
            else
            {
                b--;
            }

            Console.WriteLine(a + " " + b);
        }


        public string[] ReadInput()
        {
            return Console.ReadLine().Split(' ');
        }

        public int[] ConvertIntArray(string[] x)
        {
            var convertedArray = new int[x.Length];
            for (var i = 0; i < x.Length; i++)
            {
                convertedArray[i] = int.Parse(x[i]);
            }

            return convertedArray;
        }

        public double[] ConvertDoubleArray(string[] x)
        {
            var convertedArray = new double[x.Length];
            for (var i = 0; i < x.Length; i++)
            {
                convertedArray[i] = int.Parse(x[i]);
            }

            return convertedArray;
        }

        public long[] ConvertLongArray(string[] x)
        {
            var convertedArray = new long[x.Length];
            for (var i = 0; i < x.Length; i++)
            {
                convertedArray[i] = long.Parse(x[i]);
            }

            return convertedArray;
        }

        public int CountContainWords(string source, string word)
        {
            var count = 0;
            var loopCount = source.Length - (word.Length - 1);
            for (var i = 0; i < loopCount; i++)
            {
                if (source.Substring(i, word.Length) == word)
                {
                    count++;
                }
            }
            return count;
        }
    }
}

Measured memory_bytes: 11092
#include <stdio.h>

int main(void) {
    int r, g, b ,n, i, j;
    int count = 0;

    scanf("%d%d%d%d", &r, &g, &b, &n);
    for (i=0; i<=n/r; i++){
        for (j=0; j<=(n-i*r)/g; j++){
            if ((n - i*r - j*g) % b == 0) count += 1;
        }
    }

    printf("%d\n", count);

    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef vector<float> vf;

int main() {
  int N;

  cin >> N;;
  vf A(N);
  float ans = 0;
  rep(i,N) {
    cin >> A[i];
    ans += 1/A[i];
  }

  cout << 1/ans << endl;


  return 0;
}

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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int n, a, b, c, d;
  cin >> n >> a >> b >> c >> d;
  cout << min((n+a-1)/a * b, (n+c-1)/c * d) << endl;

  return 0;
}



Measured memory_bytes: 3196
#include <iostream>
#include <vector>
using namespace std;
#define rep(n) for (int i = 0; i < (n); ++i)

bool isSecond(int a, int b, int c)
{
    if (a < b && b < c)
        return true;
    else if (a > b && b > c)
        return true;
    else
        return false;
}
int main()
{
    int n;
    cin >> n;
    vector<int> p(n);
    rep(n)
    {
        cin >> p.at(i);
    }
    int cnt = 0;
    rep(n - 2)
    {
        if (isSecond(p[i], p[i + 1], p[i + 2]))
            cnt++;
    }
    cout << cnt;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
static const ll MOD = 1e9 + 7;

bool pairCompare(const pair<int, int>& firstElof, const pair<int, int>& secondElof) {
    return firstElof.first > secondElof.first;
}

int main(void) {
    ll H, N;
    cin >> H >> N;

    vector<ll> A(N);
    ll sum=0;
    for(int i=0;i<N;i++) {
        cin >> A.at(i);
        sum += A.at(i);
    }
    if(sum>=H) cout << "Yes" << endl;
    else cout << "No" << endl;

    return (0);
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int m[101];
int main()
{
	int i,n,x,s=0,min=0xfffff;
	scanf("%d %d",&n,&x);
	for(i=0;i<n;i++)
	{
		scanf("%d",&m[i]);
		if(m[i]<min)
			min=m[i];
		s+=m[i];
	}
	printf("%d",n+((x-s)/min));
	return 0;
}


Measured memory_bytes: 256
#include<set>
#include<cstdio>
#include<vector>
#include<cstring>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int n,d[190];
vector<int> buc[401]; // buc[a] := { i | d[i]==a }

bool used[190];
int x[20];

set< vector<int> > ans;
void dfs(int i){
	if(i==n){
		int xx[20];
		memcpy(xx,x,sizeof x);
		sort(xx,xx+n);
		vector<int> a(n-1);
		rep(j,n-1) a[j]=xx[j+1]-xx[j];
		ans.insert(a);
		return;
	}

	int k;
	for(k=0;used[k];k++);

	rep(t,2){
		if(t==0){ // 左端の町から右に d[k] の場所に町 i を置く
			x[i]=x[0]+d[k];
		}
		else{ // 右端の町から左に d[k] の場所に町 i を置く
			x[i]=x[1]-d[k];
		}

		bool ok=true,tmp[190];
		memcpy(tmp,used,sizeof used);
		rep(j,i){
			int dd=abs(x[i]-x[j]);
			bool ok2=false;
			rep(l,buc[dd].size()) if(!used[buc[dd][l]]) { used[buc[dd][l]]=true; ok2=true; break; }
			if(!ok2){ ok=false; break; }
		}
		if(ok) dfs(i+1);
		memcpy(used,tmp,sizeof used);
	}
}

int main(){
	for(;scanf("%d",&n),n;){
		rep(i,n*(n-1)/2) scanf("%d",d+i);

		if(n==2){ printf("%d\n-----\n",d[0]); continue; }

		rep(a,401) buc[a].clear();
		rep(i,n*(n-1)/2) buc[d[i]].push_back(i);

		x[0]=0;
		x[1]=d[0];
		rep(i,n*(n-1)/2) used[i]=(i==0);
		ans.clear();
		dfs(2);

		set< vector<int> >::iterator it;
		for(it=ans.begin();it!=ans.end();++it) rep(i,n-1) printf("%d%c",(*it)[i],i<n-2?' ':'\n');
		puts("-----");
	}

	return 0;
}

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

int n;
double dp[10][10] = {0};
double sum = 0;

int fat(int n){
    int fat = 1;
    for (int i = n; i >= 1; i--){
        fat = fat * i;
    }
    return fat;
}

double dist(int x, int y, int x2, int y2){
    return sqrt(pow(x - x2, 2) + pow(y - y2, 2));
}

int main(){
    cin >> n;
    int times;
    int xs[10];
    int ys[10];
    for (int i = 1; i <= n; i++){
        cin >> xs[i] >> ys[i];
    }

    // num of times to multiply 
    times = fat(n-1) * 2;
    // cout << "times to multiply: " << times << endl;
    // we got all the coordinates
    // for each i, calculate every distance
    for (int i = 1; i <= n; i++){
        for (int j = i+1; j <= n; j++){
            // calculate the distance
            // cout << "x, y = " << xs[i] << " " << ys[i] << " and x2, y2 = " << xs[j] << " " << ys[j] << endl;
            dp[i][j] = dp[j][i] = dist(xs[i], ys[i], xs[j], ys[j]);
            // cout << "dist: " << dp[i][j] << endl;
            sum += dp[i][j] * times;
            // cout << "sum: " << sum << endl;
        }
    }
    // cout << "fat of " << n << " = " << fat(n) << endl; 
    // for (int i = 1; i <= n; i++){
    //     cout << "\n";
    //     for (int j = 1; j <= n; j++){
    //         cout << dp[i][j] << " ";
    //     }
    // }
    cout.precision(10);
    cout << fixed << sum/fat(n) << endl;

}

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

int main() {
  string s;
  cin >> s;
  bool ac = true;
  if (s[0] != 'A') ac = false;
  if (count(s.begin() + 2, s.end() - 1, 'C') != 1) ac = false;
  int upper = 0;
  for (char& c: s) {
    if (c != tolower(c)) ++upper;
  }
  if (upper != 2) ac = false;
  cout << (ac ? "AC" : "WA") << endl;
}


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

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int a, b; cin >> a >> b;
	long double sum = ((a + b) * 1.0) / 2;
	if (sum == (int)sum)
	{
		cout << (int)sum << endl;
	}
	else
		cout << "IMPOSSIBLE" << endl;
	return 0;
}

Measured memory_bytes: 3592