akhauriyash/Code-Regression huggingface dataset:
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <cstdint>
#include <tuple>
#include <numeric>
#define M_PI       3.14159265358979323846


using namespace std;

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FILL(a, x) memset(a, x, sizeof(a))

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)

#define MOD 1000000007

const int N = 200005;
LL dp[N];
LL memo[N];
int c[N];

int main() {
	int n, k=0;
	cin >> n;
	REP(i, n) {
		int x;
		scanf("%d", &x);
		if (c[k] != x) {
			c[k + 1] = x;
			k++;
		}
	}
	dp[0] = 1;
	REP(i, k) {
		dp[i + 1] = (dp[i] + memo[c[i+1]]) % MOD;
		memo[c[i+1]] = (memo[c[i+1]]+dp[i])%MOD;
	}
	cout << dp[k] << endl;
	return 0;
}    

Measured memory_bytes: 4096
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    vector<int> a(N);
    REP(i, N) { cin >> a.at(i); }

    int now = 1;
    REP(i, N) {
        if (now == a[i]) {
            now++;
        }
    }

    if (now > 1) {
        cout << N - now + 1 << endl;
    } else {
        cout << -1 << endl;
    }

    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>

using namespace std;

void ABC057C()
{
	long long int N;
	cin >> N;
	double d = static_cast<double>(N);
	long long int M = static_cast<long long int>(sqrt(d)-1e-10) + 1;
	for (long long int i = M; i > 0; --i)
	{
		if (N % i == 0)
		{
			long long int A = max(i, N / i);
			long long int B = i;

			int n = 0;
			long long int x = 10;
			for (int j = 1; j <= 10; ++j)
			{
				if (A < x)
				{
					n = j;
					break;
				}
				x *= 10;
			}
			cout << n << endl;
			break;
		}
	}
}
int main()
{
	ABC057C();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;
typedef pair<P,int> PP;

void Main() {
  ll n;
  R n;
  vector<PP> a(n);
  rep(i,n) {
    int x,y,z;
    cin >> x >> y >> z;
    a[i]=PP(P(x,y),z);
  }
  rep(x,101) {
    rep(y,101) {
      set<int> s;
      rep(i,n) if(a[i].S) s.in(abs(x-a[i].F.F)+abs(y-a[i].F.S)+a[i].S);
      if(s.size()==1) {
        ll d=*s.begin(),cnt=0;
        rep(i,n) {
          ll c=max(d-abs(x-a[i].F.F)-abs(y-a[i].F.S),0LL);
          cnt+=c==a[i].S;
        }
        if(cnt!=n) continue;
        pr(x,y,*s.begin());
        return;
      }
    }
  }
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


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

using ll = long long;
using namespace std;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
ll MOD=1e9+7;


int main(){
  int N;
  cin>>N;
  vector<ll> A(N);
  for(int i(0);i<N;i++) cin>>A[i];
  ll now(0);
  ll ans(0);
  for(int i(0);i<N;i++){
    if(A[i] < now){
      ans += now - A[i];
    }else{
      now = A[i];
    }
  }
  cout << ans << endl;
  return 0;
}



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

int main(){
    int a,b;
    cin >> a >> b;
    int ans;
    if(a>=13){
        ans=b;
    }
    else if(a>=6){
        ans=b/2;
    }
    else{
        ans=0;
    }
    cout << ans << endl;
    

    return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = LLONG_MAX;
/****** define constant end ********/
/****** define variable start ******/
ll n, c, k;
vl t;
/******* define variable end *******/
int solve() {
	cin >> n >> c >> k;
	t.resize(n);
	vl tp(n);
	REP(i, n){
		cin >> t[i];
		tp[i] = t[i] + k;
	}
	ll ans = 0;
	sort(t.begin(), t.end());
	ll count = 0;
	ll top = t[0];
	for(ll i = 0; i < n; i++){
		if(i == 0){
			count++;
			continue;
		}
		if(count == c){
			ans++;
			count = 0;
			top = t[i];
		}
		if(t[i] - top <= k){
			count++;
		}else{
			ans++;
			count = 1;
			top = t[i];
		}
	}
	ans++;
	cout << ans << endl;
	return 0;
}

int main() {
	// clock_t start = clock();
	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int end_solve = solve();
	/*
	clock_t end = clock();
	const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
	1000.0; printf("time %lf[ms]\n", time);
	*/

	return end_solve;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define LL long long
using namespace std;
inline int read(){
	int x=0,z=1;char y=getchar();
	while(y<'0'||y>'9'){if(y=='-')z=-1;y=getchar();}
	while(y>='0'&&y<='9')x=x*10+y-'0',y=getchar();
	return x*z;
}
int main(){
    int a=read(),b=read(),c=read();
    a-=c;
    printf("%d",a/(b+c));
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string s;
    int a,b;
    a = 0;
    b = 0;
    cin >> s;
    
    for (int i = 0; i < s.size(); i++){
        if (s[i] == 'A'){
            break;
        }
        else{ a ++; 
        }
    }
    for (int j = s.size(); j > 0; j--){
        if (s[j] == 'Z'){
            break;
        }
        else{ b ++;
        }
    }
    cout << s.size () - (a + b) + 1 << endl;
}


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

int main() {
  int a,b,c,d,e,f;
  cin >> a>>b>>c>>d>>e>>f;
  vector<int> w(900);
  int k=0;
  for(int i=0;i<=30;i++){
    for(int j=0;j<=30;j++){
      if(f>=100*a*i+100*b*j){
        w[k] = 100*a*i+100*b*j;
        //cout<<w[k]<< " "<<k<<endl;
        k++;

      }
    }
  }

  int l=0;
  vector<int> s(9000000);
  for(int i=0;i<=f/c+1;i++){
    for(int j=0;j<=f/d+1;j++){
      if(f>c*i+d*j){
          s[l] = c*i+d*j;
          //cout<<s[l]<< " "<<l<<endl;
          l++;
        }
    }
  }
  //cout<<s[1]<<endl;
  int memw=100*a,mems=0;
  float sat = 100*float(e)/(100+float(e));
  float maxd=0;
  //cout<<sat<<endl;
  for(int i=0;i<k;i++){
    for(int j=0;j<l;j++){
      if(f>=w[i]+s[j] && w[i]!=0){
        float dense=100.0*float(s[j])/(float(w[i])+float(s[j]));
        if(dense>maxd && sat>=dense){
          memw=w[i];
          mems=s[j];
          maxd =dense;
          //cout<<maxd<<endl;
        }
      }
    }
  }

cout << memw+mems << " "<< mems<<endl;

}


Measured memory_bytes: 35456
import java.util.Arrays;
import java.util.Scanner;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int[] d = new int[n];
        for(int i = 0; i < n; i++) {
            d[i] = Integer.parseInt(sc.next());
        }
        Arrays.sort(d);
        System.out.println(d[n / 2] - d[n / 2 - 1]);
    }
}

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

int main(){
  int n;
  cin>>n;
  vector<char> v(n);
  for(int i=0;i<n;i++) cin>>v[i];
  sort(v.begin(),v.end());
  if(n%2==0){
    int cent=n/2;
    if(v[cent-1]=='R'&&v[cent]=='R') cout<<"Yes"<<endl;
    else if(v[cent-1]=='R'&&v[cent]=='B') cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  else {
    int cent=n/2;
    if(v[cent]=='R') cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	double n,d;cin>>n>>d;
	int cnt = 0;
	for(int i = 0; i < n; i++) {
		double x,y;cin>>x>>y;
		if (sqrt(x*x + y * y) <= d)cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 3804
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
long long MOD = 11411411419191919LL;

vector<long long>C; string S, T;
long long modpow[320000];
bool find(long long E) {
	long long V = lower_bound(C.begin(), C.end(), E) - C.begin();
	if (C[V] == E)return true; return false;
}
int main() {
	modpow[0] = 1; for (int i = 1; i < 320000; i++) { modpow[i] = modpow[i - 1] * 127; modpow[i] %= MOD; }
	cin >> T >> S; long long p = 0; for (int i = 0; i < S.size(); i++) { p += modpow[S.size() - 1 - i] * S[i]; p %= MOD; }
	for (int i = 0; i < S.size(); i++) {
		for (int j = 0; j < 127; j++) {
			if (S[i] == j)continue;
			if (j < 65)continue;
			if (j > 122)continue;
			if (j >= 91 && j < 97)continue;
			long long sa = modpow[S.size() - i - 1] * (j - S[i]); sa %= MOD;
			long long P = (p + MOD + sa) % MOD;
			C.push_back(P);
		}
	}
	sort(C.begin(), C.end());
	long long W = 0; for (int i = 0; i < S.size(); i++) { W += modpow[S.size() - i - 1] * T[i]; W %= MOD; }
	int OK = 0;
	if (find(W) == true) { OK++; }
	for (int i = S.size(); i < T.size(); i++) {
		W -= modpow[S.size() - 1] * T[i - S.size()]; W = (W + MOD * 127) % MOD;
		W *= 127; W += T[i]; W %= MOD;
		if (find(W) == true)OK++;
	}
	cout << OK << endl;
	return 0;
}

Measured memory_bytes: 71888
N=int(input())
A = list(map(int, input().split()))
dp=[100000]*N
dp[0]=0
dp[1]=abs(A[1]-A[0])

for i in range(2,N):
    dp[i]=min(dp[i-1]+abs(A[i-1]-A[i]),dp[i-2]+abs(A[i-2]-A[i]))
#print(dp)
print(dp[N-1])

Measured memory_bytes: 13976
//#define _GLIBCXX_DEBUG
//#pragma GCC optimize "trapv"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
// #pragma optimization_level 3
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


#define pb push_back 
#define f first
#define s second
#define min3(a, b, c) min(min(a, b), c)
#define max3(a, b, c) max(max(a, b), c)
#define all(v) v.begin(), v.end()

typedef long long ll;
typedef double ld;
typedef long double lld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

template <class T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;

const int INF = 1e9;
//const ll INF = 1e18;
const ll mod = 1000000007;
// const ll mod = 998244353;


void solve(int tc){
    int x;
    cin >> x;
    cout << (x^1) << "\n";
}

int main(){
    ios_base::sync_with_stdio(NULL);
    cin.tie(NULL);
    
    int tc = 1;
    //cin >> tc;
    for (int t = 0; t < tc; t++) solve(t);

    return 0;
}

Measured memory_bytes: 3640
use std::cmp::Ordering;
use std::collections::BinaryHeap;

#[derive(PartialEq)]
struct Flt(f64);

impl Eq for Flt {}

impl PartialOrd for Flt {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        self.0.partial_cmp(&other.0)
    }
}

impl Ord for Flt {
    fn cmp(&self, other: &Self) -> Ordering {
        self.partial_cmp(other).unwrap()
    }
}

fn solve(aa: Vec<f64>, m: usize) -> usize {
    let mut heap = BinaryHeap::from(aa.iter().map(|&v| Flt(v)).collect::<Vec<Flt>>());

    for _ in 0..m {
        let Flt(n) = heap.pop().unwrap();
        heap.push(Flt(n / 2.0));
    }

    let mut ans: usize = 0;

    while let Some(Flt(n)) = heap.pop() {
        ans += n as usize;
    }

    ans
}

#[test]
fn solve_test() {
    assert_eq!(solve(vec![1f64, 9f64, 3f64, 5f64], 4), 6);
}

#[allow(unused_macros)]
macro_rules! parse_line {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            iter.next().unwrap().parse::<$t>().unwrap()
        }
    );

    ( $( $t:ty), +) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ( $(iter.next().unwrap().parse::<$t>().unwrap()),* )
        }
    );
}

#[allow(unused_macros)]
macro_rules! read_line {
    () => {{
        let mut line = String::new();
        ::std::io::stdin().read_line(&mut line).unwrap();
        line.pop();
        line
    }};
}

#[allow(unused_macros)]
macro_rules! parse_vec {
    ( $t:ty ) => {{
        let mut line = String::new();
        ::std::io::stdin().read_line(&mut line).unwrap();
        let iter = line.split_whitespace();
        iter.map(|v| v.parse::<$t>().unwrap()).collect::<Vec<_>>()
    }};
}

fn main() {
    let (n, m) = parse_line!(usize, usize);
    let aa = parse_vec!(f64);

    println!("{}", solve(aa, m));
}


Measured memory_bytes: 8444
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define MOD 1000000007
#define INF 1 << 30

using namespace std;
typedef long long ll;

int main(void) {
	int num, k, i, j, ans = 0, ok;
	string s, t = "spr";
	vector<int> a(3);
	cin >> num >> k >> a[0] >> a[1] >> a[2] >> s;
	vector<vector<int>> dp(num, vector<int>(3, 0));
	for (i = 0; i < k; i++) {
		for (j = i; j < num; j += k) {
			if (j < k || s[j] != s[j - k] || ok) {
				ans += a[t.find(s[j])];
				ok = false;
			}
			else
				ok = true;
		}
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 5760
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;

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

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

using namespace std;

// gcd
int gcd(int a, int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

// sort big to small
// sort(A,A+N, greater<int>());

// v.front() = -BOUND;
// v.back() = BOUND;

// Iterator
// v.begin
// v.end

int main() {
    unsigned int N;

    cin >> N;

    vector<int> m(N,0);
    rep(i,N){
        cin >> m[i];
    }

    cout << accumulate(m.begin(),m.end(),0)
    - *max_element(m.begin(),m.end()) / 2
    << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<utility>
#include<tuple>
#include<algorithm>
#include<cmath>
using namespace std;

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

int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  rep(i, N) cin >> x[i];
  vector<vector<vector<ll>>> dp(N+1, vector<vector<ll>>(N+1, vector<ll>(N*50+1)));
  dp[0][0][0] = 1;
  for(int i=1; i<=N; i++) {
    for(int j=0; j<=N; j++) {
      for(int k=0; k<=N*50; k++) {
        dp[i][j][k] += dp[i-1][j][k];
        if(j && k-x[i-1]>=0)
          dp[i][j][k] += dp[i-1][j-1][k-x[i-1]];
      }
    }
  }
  ll ans = 0;
  rep(i, N+1) {
    rep(j, N*50+1) {
      if((double)j/i == A)
        ans += dp[N][i][j];
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 52224
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

class Stream{
public:
    Stream(){

    }
    //配列以外の入力を受け取る
    void read(){

    }
    template<typename First, typename... Rest>
    void read(First& first, Rest&... rest){
        cin >> first;
        read(rest...);
    }
    //配列を区切って出力する
    template<typename T>
    void write_vec(vector<T>& v, char divider){
        for(size_t i = 0; i < v.size(); i++){
            cout << v[i] << divider;
        }
    }
};

struct UF{
    const int node_num;
    vector<int> parent;
    vector<int> size;

    UF(int N) : node_num(N), parent(N), size(N, 1) {
        for(int i = 0; i < N; ++i) parent[i] = i;
    }

    //xの根を得る
    int root(int x){
        if(parent[x] == x) return x;
        return parent[x] = root(parent[x]);
    }

    //xが属する木とyが属する木を一つに合わせる
    void unite(int x, int y){
        int root_x = root(x);
        int root_y = root(y);
        if(root_x == root_y) return;
        parent[root_y] = root_x;
        size[root_x] += size[root_y];
    }

    //xとyが属する木が同じならtrueを返す
    bool same(int x, int y){
        int root_x = root(x);
        int root_y = root(y);
        return root_x == root_y;
    }

    //xと同じ木に属する要素の数を返す
    int same_size(int x){
        int root_x = root(x);
        return size[root_x];
    }
};

int main(){
    Stream io;
    
    int A, B;
    io.read(A, B);
    cout << (A + B) % 24;
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var buff []byte

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func nextFloat64() float64 {
	sc.Scan()
	f, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}
	return f
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func nextInts(n int) (r []int) {
	r = make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt64

func maxInt(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func minInt(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func absInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buff, bufio.MaxScanTokenSize*1024)
	log.SetFlags(log.Lshortfile)
}

func main() {
	D := nextInt()
	T := nextInt()
	S := nextInt()
	if S*T >= D {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 1772
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)

char buf[100000+10];
int main(void) {
  scanf("%s", buf);
  int len = strlen(buf);
  while(len > 0) {
    if(len >= 5 && strcmp(buf+len-5, "dream") == 0) {
      len -= 5;
    } else if(len >= 7 && strcmp(buf+len-7, "dreamer") == 0) {
      len -= 7;
    } else if(len >= 6 && strcmp(buf+len-6, "eraser") == 0) {
      len -= 6;
    } else if(len >= 5 && strcmp(buf+len-5, "erase") == 0) {
      len -= 5;
    } else {
      puts("NO");
      return 0;
    }
    buf[len] = 0;
  }
  puts("YES");
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define F first
#define S second
#define nl cout<<"\n"
//cout<<fixed<<setprecision(11);
const ll MOD=1e9+7;
const ll ARR_MAX = 1e5+1;
const ll VAL_MAX = 1e3+1;
const ll INF=1e14;


ll pow_5(ll x){
    ll ans=x;
    for(ll i=1;i<5;i++){
        ans*=x;
    }
    return ans;
}

void solve(){
    ll x;cin>>x;
    for(ll a=-1*VAL_MAX;a<=VAL_MAX;a++){
        for(ll b=a+1;b<=VAL_MAX;b++){
            ll a1=pow_5(a);
            ll b1=pow_5(b);
            if(b1-a1==x){
                cout<<b<<" "<<a,nl;
                return ;
            }
        }
    }
}

int main(){
    fastio();
    #ifndef ONLINE_JUDGE
    freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);
    #endif
    solve();
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
random_device rnd;
mt19937 mt(rnd());

const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 998244353;

const int MAX = 510000;
ll mpow(ll base, ll num)
{
  	assert(num>=0);
    if (num == 0)
        return 1;
    ll prev = mpow(base, num / 2);
    if (num % 2 == 0)
    {
        return (prev * prev) % MOD;
    }
    else
    {
        return ((prev * prev)%MOD * base) % MOD;
    }
}
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main()
{
    COMinit();

    ll n, m, k;
    cin >> n >> m >> k;
    ll ans = 0;
    rep(i, k + 1)
    {
        ll cur = COM(n - 1, i);
        cur %= MOD;
        cur *= mpow(m - 1, n - 1 - i);
        cur %= MOD;
        cur *= m;
        cur %= MOD;
        ans += cur;
        ans %= MOD;
    }
    cout << ans << endl;

    return 0;
}


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

int main()
{
	string s;
	cin >> s;
	for (auto a : s) {
		if (a == '1')
			cout << '9';
		else
			cout << '1';
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>

using ll = long long;
typedef unsigned long long ull;
typedef std::pair<int, int>p;

ll min(ll a, ll b) {
	if (a >= b)return b;
	else return a;
}
ll max(ll a, ll b) {
	if (a >= b)return a;
	else return b;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

const ll Z = 1000000007;
const ll INF = 1 << 30;
const ll INF2 = 9000000000000000000LL;
const ull INF3 = 18000000000000000000LL;
bool flag = true;
bool fl = false;
bool f = false;
bool used[210];
bool graph[100][100];
bool visited[8];
int abc[26] = { 0 };

int main() {
	ll n, k, a[101000], b[101000], c[101000], ans = 0;
	std::cin >> n >> k;
	for (int i = 0;i < n;i++) {
		std::cin >> a[i];
	}
	for (int i = 0;i < n;i++) {
		if (i) {
			b[i] = b[i - 1] + a[i];
			c[i] = c[i - 1] + (a[i] > 0 ? a[i] : 0);
		}
		else c[i] = (a[i] > 0 ? a[i] : 0), b[i] = a[i];
	}
	for (int i = 0;i < n - k + 1;i++) {
		ll sum = c[n - 1] - c[i + k - 1] + c[i - 1];
		ll s = max(sum, sum + b[i + k - 1] - b[i - 1]);
		ans = max(s, ans);
	}
	std::cout << ans << std::endl;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define ll long long
int main(){
  ll X;
  cin>>X;
  if(X%2) cout<<2*X<<endl;
  else cout<<X<<endl;
}

Measured memory_bytes: 384
from collections import defaultdict
n = int(input())
A = list(map(int, input().split()))
L = defaultdict(int)
R = defaultdict(int)
for i, a in enumerate(A):
    L[a+i] += 1
    R[i-a] += 1
ans = 0
for k, v in L.items():
    ans += v*R[k]
print(ans)


Measured memory_bytes: 73748
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <sstream>
#include <fstream>

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

using namespace std;
typedef long long unsigned int ll;


int main() {
  int N;
  cin >> N;
  vector<int> hs(N);
  rep (i, N) cin >> hs[i];
  int ans = 0;
  for (;;) {
    bool didIncrement = false;
    rep(i, N) {
      if (!hs[i]) continue;
      int y = i;
      while (y < N && hs[y]) y++;
      for (int j = i; j < y; j++ ) hs[j]--;
      ans++;
      didIncrement = true;
      i = y;
    }
    if (!didIncrement) break;
  }
  cout << ans << endl;
  return 0;
}

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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

typedef pair< int, int > pii;

const int dx[8] = {0,1,1,1,0,-1,-1,-1}, dy[8] = {-1,-1,0,1,1,1,0,-1};

int H, W, counter[1010][1010];
string grid[1010];

int main() {
	cin >> H >> W;
	for_(i,0,H) cin >> grid[i];
	
	queue< pii > cur_que;
	
	for_(y,0,H) for_(x,0,W) {
		counter[y][x] = -1;
		if (grid[y][x] == '.') continue;
		counter[y][x] = grid[y][x] - '0';
		
		for_(d,0,8) {
			int xx = x + dx[d], yy = y + dy[d];
			if (grid[yy][xx] == '.') --counter[y][x];
		}
		
		if (counter[y][x] <= 0) cur_que.push(pii(x, y));
	}
	
	queue< pii > nxt_que;
	
	int ans = 0;
	
	while (!cur_que.empty()) {
		while (!cur_que.empty()) {
			pii p = cur_que.front(); cur_que.pop();
			int x = p.first, y = p.second;
			
			for_(d,0,8) {
				int xx = x + dx[d], yy = y + dy[d];
				--counter[yy][xx];
				if (counter[yy][xx] == 0) nxt_que.push(pii(xx, yy));
			}
		}
		
		++ans;
		swap(cur_que, nxt_que);
	}
	
	cout << ans << endl;
}

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

#define REPU(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (a); i > (b); --i)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
#define DEBUG(x) cerr << #x << " = " << x << endl

typedef long long ll;
const int MOD = 1000000007;

template<class T, class U> inline T tmin(T a, U b) { return (a < b) ? a : b; }
template<class T, class U> inline T tmax(T a, U b) { return (a > b) ? a : b; }
template<class T, class U> inline void amax(T &a, U b) { if (b > a) a = b; }
template<class T, class U> inline void amin(T &a, U b) { if (b < a) a = b; }
template<class T> inline T tabs(T a) { return (a > 0) ? a : -a; }
template<class T> T gcd(T a, T b) { while (b != 0) { T c = a; a = b; b = c % b; } return a; }

int main(int argc, char *argv[]) {
	ios_base::sync_with_stdio(false);
	
	int N;

	cin >> N;
	vector<int> L(N + N);
	REPU(i, 0, N + N) cin >> L[i];
	sort(ALL(L));
	int ans = 0;
	for (int i = 0; i < N + N; i += 2) {
		ans += L[i];
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007 

int main() {
	string s;
	cin>>s;
	bool ans=true;
	for(int i=0;i<s.size();i++){
		char now=s[i];
		if((i+1)%2!=0){
			if(now=='R'||now=='D'||now=='U'){
				continue;
			}
			ans=false;
		}
		else {
			if(now=='L'||now=='U'||now=='D'){
				continue;
			}
			ans=false;
		}
	}
	cout << (ans?"Yes":"No");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;}


int main() {
    ll n;
    cin >> n;
    ll ans = 1e18;
    ll tmp = 0;
    for(ll i = 1;i<=1000000;i++) {
        if(n%i==0) {
            ll j = n/i;
            tmp += (i-1)+(j-1);
            ans = min(ans,tmp);
        }
        tmp = 0;
    }
    cout << ans << endl;
}

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

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

    long long ans = 0;
    long long tmp = 1;
    while (H > 0){
        H = H / 2;
        ans += tmp;
        tmp = tmp*2;
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
 
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3") 
// #pragma GCC optimization ("unroll-loops")
 
#define ll long long int
#define ld long double
#define all(v) v.begin(),v.end()
#define pb push_back
#define S second
#define F first
#define die() return 0;
 
#define md         1000000007
#define M           100011
#define N 			12
vector<int> va;
ll dp[100][2][2][2];
ll f(ll x,ll c,ll t1,ll t2){
	if(x<0){
		return c==0;
	}
	if(dp[x][c][t1][t2]!=-1)return dp[x][c][t1][t2];
	ll m1=1,m2=1;
	if(t1)m1=va[x];
	if(t2)m2=va[x];
	ll p=0;
	for(int u=0;u<=m1;++u){
		for(int v=0;v<=m2;++v){
					int flg=0;
			for(int a=0;a<=1;++a){
				if(flg)continue;
				for(int b=0;b<=1;++b){
					if(a^b!=u||flg)continue;
					if((a+b)%2==v&&(a+b)/2==c){
						flg=1;
						ll n1=t1,n2=t2;
						if(u!=va[x])n1=0;
						if(v!=va[x])n2=0;
						p=p+f(x-1,0,n1,n2);
						if(p>md)p-=md;

					}
					if((a+b+1)%2==v&&(a+b+1)/2==c){
						flg=1;
						ll n1=t1,n2=t2;
						if(u!=va[x])n1=0;
						if(v!=va[x])n2=0;
						p=p+f(x-1,1,n1,n2);
						if(p>md)p-=md;


					}


				}
			}
		}
	}
		dp[x][c][t1][t2]=p;
	return p;

}

int solve(){
 
		ll n,i,j,k,m;
		cin>>n;
		while(n){
			va.pb(n%2);n/=2;
		}
		memset(dp,-1,sizeof(dp));
		ll p=f(va.size()-1,0,1,1);
		cout<<p<<"\n";



		

}
 
 
int main(){
 
 
     
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t,i,j;
    t=1;
    // prec();
    // cin>>t;
 
    while(t--){
    	solve();
    }
 
 
 
 
 
    die();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define MAX 128
#define fst first
#define sec second
#define pb push_back
#define mp make_pair
#define ALL(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define bit(n) (1LL << (n))
#define int long long
const double PI = 3.141593;
const int MOD = (int)1e9 + 7;
const int INF = 100100100;
const double EPS = 1e-9;
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;}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } //最大公約数
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }     //最小公倍数
ll combination(ll n, ll r){if (r * 2 > n)r = n - r;ll dividend = 1;ll divisor = 1;for (ll i = 1; i <= r; ++i){dividend *= (n - i + 1);divisor *= i;}return dividend / divisor;}


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

  int n;
  cin >> n;
  int fizzbuzz, fizz, buzz;
  fizzbuzz = n / 15;
  fizz = n / 3;
  buzz = n / 5;
  int sum = n * (1 + n) / 2;
  int ans = sum - 3 * (1 + fizz) * fizz / 2 - 5 * (1 + buzz) * buzz / 2 + 15 * (1 + fizzbuzz) * fizzbuzz / 2;
  cout << ans << endl;
}


Measured memory_bytes: 3648
import math

a,b,x = map(int,input().split())
if x > (b*(a**2))/2:
    c = (2*(((a**2)*b)-x))/(a**3)
    ans = math.degrees(math.atan(c))
else:
    d = (a*(b**2))/(x*2)
    ans = math.degrees(math.atan(d))
print(ans)

Measured memory_bytes: 3060
#include <stdio.h>

int main() {
	int i, j, temp, in[3000][2];

	for (i = 0; i < 3000; i++) {
		scanf("%d %d", &in[i][0], &in[i][1]);
		if (in[i][0] == 0 && in[i][1] == 0) break;
	}

	for (j = 0; j < i; j++) {
		if (in[j][0] > in[j][1]) {
			temp = in[j][0];
			in[j][0] = in[j][1];
			in[j][1] = temp;
		}
		printf("%d %d\n", in[j][0], in[j][1]);
	}

	return 0;
}


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

#define vec                vector<int>
#define vecll              vector<ll>
#define vecd               vector<double>
#define vecst              vector<string>
#define vecb               vector<bool>
#define vec2(var, n, m)    vector<vector<int>> var(n, vector<int>(m, 0))
#define vecll2(var, n, m)  vector<vector<ll>> var(n, vector<ll>(m, 0))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define f_sum(var)       accumulate(all(var), 0)
#define f_sumll(var)     accumulate(all(var), 0LL)
#define chmin(v1, v2)    v1 = min(v1, v2)
#define chmax(v1, v2)    v1 = max(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << (var) << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << (var);
#define prt2(v1, v2)     cout << (v1) << " " << (v2) << "\n"
#define prt3(v1, v2, v3) cout << (v1) << " " << (v2) << " " << (v3) << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
void prtok(bool ok){prt(ok ? "Yes" : "No");}
//----------------------------------------------------------------

int main(void) {
  int n;
  cin >> n;
  int dp[50];
  dp[0]=1;
  dp[1]=1;
  rep(i,47){
    dp[i+2]=dp[i+1]+dp[i];
  }
  prt(dp[n]);
}



Measured memory_bytes: 3104
#include <stdio.h>
 
int main(void)
{
  int y, m, d, data;
 
  while(1){
    if(scanf("%d %d %d", &y, &m, &d)==EOF) break;
 
    data=y*10000+m*100+d;
 
    if(data<18680908)	printf("pre-meiji\n");
    
    else if(data<19120730)	printf("meiji %d %d %d\n", y-1867, m, d);
    
    else if(data<19261225)	printf("taisho %d %d %d\n", y-1911, m, d);
    
    else if(data<19890108)	printf("showa %d %d %d\n", y-1925, m, d);
    
    else printf("heisei %d %d %d\n", y-1988, m, d);
  }
  
  return 0;
}

Measured memory_bytes: 608
import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    const N = readln.chomp.to!long;
    const S = readln.chomp;

    auto whiteCount = new long[N+1];
    auto blackCount = new long[N+1];

    foreach (i; 0..N) {
        whiteCount[i+1] = S[i] == '.' ? 1 : 0;
        blackCount[i+1] = S[i] == '#' ? 1 : 0;
    }
    foreach (i; 0..N) {
        whiteCount[i+1] += whiteCount[i];
        blackCount[i+1] += blackCount[i];
    }

    // 0..i番目までが全部白、i..n番目までが全部黒にする
    iota(N+1).map!(i => blackCount[i] + whiteCount[N] - whiteCount[i]).reduce!min.writeln;
}



Measured memory_bytes: 4476
/******************************************************************************

                #DaRkSouL OP in the chat Guyzzz... :):):)

*******************************************************************************/

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s,t;
    cin>>s>>t;
    int ans=0;
    for(int i=0; i<s.size(); i++){
        if(s[i]!=t[i]){
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3916
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdarg.h>
#include<malloc.h>

int main()
{
	double v;
	while(scanf("%lf", &v) != EOF){
		printf("%d\n", (int)ceil(pow(v,2)/(10*9.8))+1);
	}
	return 0;
}

Measured memory_bytes: 632
#include<iostream>

using namespace std;

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

	int n;
	cin >> n;
	int p[n];
	for(int i=0; i<n; i++) cin >> p[i];
	int k = 0;
	for(int i=0; i<n; i++){
		if(p[i] != i+1)
			k++;
	}
	if(k<=2) cout << "YES";
	else cout << "NO";
	return 0;
}

Measured memory_bytes: 3608
N,M,X=map(int,input().split())
C=[0]*N
a=[0]*N
for i in range(N):
  CA=list(map(int,input().split()))
  C[i]=CA[0]
  a[i]=CA[1:M+1]
cost_min = 100000000000000000000
def dfs(A):
    global cost_min
    # 終端条件 --- N 重ループまで回したら処理して打ち切り
    if len(A) == N:
        cost=sel(A)
        if cost<cost_min:
          cost_min=cost
        return
    for v in range(2):
        A.append(v)
        dfs(A)
        A.pop()

#選択するかしないか
def sel(A):
  d=[0]*M
  cost=0
  for i in range(N):
    if A[i]==1:
      cost+=C[i]
      for j in range(M):
        d[j]+=a[i][j]
  if min(d)>=X:
    return cost
  return 100000000000000000000

dfs([])
if cost_min==100000000000000000000:
  print(-1)
else:print(cost_min)

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

#define ll long long
#define F(i,m,n) for(ll i=m;i<n;i++)
#define Fr(j,n,m) for(ll j=n;j>=m;j--)
#define vll vector<ll>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vpll vector< pll >
#define tlll tuple < ll ,ll,ll >
/*-------------------------------------*---------------------------------------*/

#define godspeed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define deb(x) cout << #x << "=" << x << endl
#define cout_array(a) cout<<#a<<"=";for(auto x: a){ cout<<x<<" ";}cout<<endl

ll gcd(ll a,ll b){
    return (b?gcd(b,a%b):a);
}
const ll MAX_PRIME = 1e9+7;
const ll INF = 1e18;


/*I NEED YOU TO WORK FOR TWO HOURS ON THIS NO MATTER WHAT....THE RESULT DOESN'T MATTER.....ITS ALL ABOUT YOUR EFFORTS.
---------------------------------------------------------------------------------------------------------------------*/

ll fast_pow(ll x,ll y,ll z){
    if(y==0)return 1%z;
    else if(y==1)return x%z;
    if(y%2==0){
        ll res = fast_pow(x,y/2,z);
        return (res*res)%z;
    }
    else{
        ll res = fast_pow(x,y/2,z);
        ll temp = (res*res)%z;
        return ((x%z)*temp)%z;
    }
}
int main() {
    godspeed
    ll t;
    cin>>t;
    cout<<!(t)<<endl;
    return 0;
}


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

int main() {
	long long T1, T2, A1, A2, B1, B2;
	cin >> T1 >> T2 >> A1 >> A2 >> B1 >> B2;
	if (T1 * A1 + T2 * A2 == T1 * B1 + T2 * B2) {
		cout << "infinity" << endl;
		return 0;
	}
	if (A1 < B1) swap(A1, B1), swap(A2, B2);
	if (T1 * A1 + T2 * A2 > T1 * B1 + T2 * B2) {
		cout << 0 << endl;
		return 0;
	}
	long long SA1 = T1 * A1, SA2 = T2 * A2, SB1 = T1 * B1, SB2 = T2 * B2;
	long long ANS = (SA1 - SB1 - 1) / (SB1 + SB2 - SA1 - SA2) * 2 + 1;
	long long ANS2 = (ANS + 1) / 2;
	if (ANS2 * (SB1 + SB2 - SA1 - SA2) == SA1 - SB1) cout << ANS2 * 2 << endl;
	else cout << ANS << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
#define MOD 1000000007

class SegmentTree {
    long long n;
    vector<long long> dat;

    // i は接点の番号、l, rはその接点が[l, r)に対応していることを示す
    long long query_sub(long long a, long long b, long long i, long long l, long long r) {
        if (r <= a || b <= l) return 0;
        if (a <= l && r <= b)
            return dat[i];
        else {
            long long vl = query_sub(a, b, i * 2 + 1, l, (l + r) / 2);
            long long vr = query_sub(a, b, i * 2 + 2, (l + r) / 2, r);
            return max(vl, vr);
        }
    }

public:
    // 葉がn個のセグメント木
    // 実際の葉の数は完全二分木にしているので少し増える
    SegmentTree(long long n_) {
        n = 1;
        while (n < n_) n *= 2;
        dat = vector<long long>(2 * n - 1, 0);
    }
    // i に x を入れる
    void update(long long i, long long x) {
        i += n - 1;
        dat[i] = x;
        while (i > 0) {
            i = (i - 1) / 2;
            dat[i] = max(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }
    // [a, b) の最小値を求める
    long long query(long long a, long long b) { return query_sub(a, b, 0, 0, n); }
    // 配列にアクセス
    long long at(long long i) { return dat[i + n - 1]; }
};

int main(){
    long long N;
    cin >> N;
    vector<long long> h(N), a(N);
    for(int i=0;i <N; i++) cin >> h[i];
    for(int i=0;i <N; i++) cin >> a[i];

    SegmentTree st(N+1);
    for(int i=0; i<N; i++){
        long long mx = st.query(0, h[i]);
        st.update(h[i], mx+a[i]);
    }
    cout << st.query(0, N+1) << endl;
    return 0;
}

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

int main()
{
    vector<int> haiku(3);
    for (int i = 0; i < 3; i++)
    {
        cin >> haiku.at(i);
    }

    int count5 = 2, count7 = 1;
    bool flag = true;
    for (int j = 0; j < 3; j++)
    {
        if (haiku.at(j) == 5)
        {
            count5--;
            if (count5 < 0)
            {
                flag = false;
                break;
            }
        }
        else if (haiku.at(j) == 7)
        {
            count7--;
            if (count7 < 0)
            {
                flag = false;
                break;
            }
        }
        else
        {
            flag = false;
            break;
        }
    }
    if (flag)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
#pragma warning (disable: 4996)

long long N, A[1 << 19], B[1 << 19], cnt, ret = (1 << 30);
long long Q, X[1 << 19], Y[1 << 18];

int main() {
	scanf("%lld", &N);
	for (int i = 1; i <= N; i++) {
		scanf("%lld", &A[i]);
		B[i] = A[i];
	}
	sort(B + 1, B + N + 1);
	for (int i = 1; i <= N; i++) { if (A[i] == B[i]) cnt++; }
	if (cnt == N) ret = 0;

	scanf("%lld", &Q);
	for (int i = 1; i <= Q; i++) {
		scanf("%lld%lld", &X[i], &Y[i]);
		if (A[X[i]] == B[X[i]]) cnt--;
		if (A[Y[i]] == B[Y[i]]) cnt--;
		swap(A[X[i]], A[Y[i]]);
		if (A[X[i]] == B[X[i]]) cnt++;
		if (A[Y[i]] == B[Y[i]]) cnt++;
		if (cnt == N) ret = min(ret, 1LL * i);
	}
	if (ret == (1 << 30)) ret = -1;
	printf("%lld\n", ret);
	return 0;
}


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

int i=2;

void R(unsigned long long int a,unsigned long long int b,int n){
    
    if(n < 2){
        cout << 1 << endl;
        return;
    }
    else{
        unsigned long long int l = b;
        unsigned long long int r = a+b;
        
        if(i == n){
            cout << r << endl;
            return;
        }
        else{
            i++;
            R(l,r,n);
        }
    }

}

int main(void){
  
  int N;
  cin >> N;
  R(2,1,N);
}

Measured memory_bytes: 3608
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>

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

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

typedef long long ll;

using namespace std;

const int MAX_N = 50;
int N, P;
int A[MAX_N];

ll solve() {
    int even = 0, odd = 0;
    ll answer = 0;
    REP(i, 0, N){
        if(A[i] % 2 == 0) even += 1;
        else odd += 1;
    }
    if(odd == 0){
        if(P == 0) answer = pow(2, even);
        else answer = 0;
    }else {
        answer = pow(2, even) * pow(2, odd - 1);
    }
    return answer;
}

int main() {
    // to shorten execution time for iostream
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> N >> P;
    REP(i,0,N) cin >> A[i];
    cout << solve() << "\n";
    return 0;
}



Measured memory_bytes: 512
use v5.18; # strict say state
use warnings;
use List::Util qw(reduce first max min sum0);

chomp (my ($n, $m) = split / /, <STDIN>);
my (@k, @t);
for my $i (1..$m) {
  my $s = '0' x $n;
  chomp (my @in = split / /, <STDIN>);
  shift @in;
  for my $j (0..$#in) {
    substr($s, $in[$j]-1, 1) = 1;
  }
  $k[$i] = $s;
}
chomp (my @p = split / /, <STDIN>);
my $ans = 0;
for my $i (0..2**$n-1) {
  my $s = sprintf "%0".$n."b", $i;
  my $f = 1;
  for my $j (1..$m) {
    $f = 0 if ((grep {$_ == 1} split('', ($s & $k[$j]))) % 2 != $p[$j-1]);
    last if $f == 0;
  }
  $ans += $f;
}
say $ans;

Measured memory_bytes: 896