akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
int Max(long long(a), long long(b), long long(c)) {
	return max(max(a,b), c);
}
int Min(long long(a), long long(b), long long(c)) {
	return min(min(a, b), c);
}

int cnt(ll N) {
	int digits = 0;

	while (N > 0) {
		N /= 10;
		digits++;
	}

	return digits;
}



int main() {
	int K,A,B;
	cin >> K>>A>>B;
	string s = "NG";
	for (int i = A; i <= B; i++) {
		if (i % K == 0) {
			s = "OK";
		}
	}



	cout << s << endl;

}


Measured memory_bytes: 3632
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var a int
	var b string
	fmt.Scan(&a, &b)
	s := strings.Replace(b, ".", "", -1)
	c, _ := strconv.Atoi(s)
	fmt.Println(a * c / 100)
}


Measured memory_bytes: 1824
n=gets.to_i
n.times{
  x1,y1,x2,y2,x3,y3,x4,y4 = gets.split(" ").map(&:to_r)
  a1 = (y2-y1)*(x4-x3)
  a2 = (y4-y3)*(x2-x1)
  if a1 == a2
    puts "YES"
  else
    puts "NO"
  end
}


Measured memory_bytes: 6896
#include"bits/stdc++.h"
#include<unordered_set>
#include<unordered_map>
#include<random>
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

int N, K;
ll x[50], y[50];
vector<ll> zX, zY;

int sum[100][100] ={};

signed main(){
	cin >> N >> K;
	rep(i, N){
		cin >> x[i] >> y[i];
		zX.pb(x[i]);
		zY.pb(y[i]);
	}
	zX.pb(LLONG_MIN);
	sort(all(zX));
	zX.erase(unique(all(zX)), zX.end());
	zY.pb(LLONG_MIN);
	sort(all(zY));
	zY.erase(unique(all(zY)), zY.end());

	rep(i, N){
		sum[lower_bound(all(zX), x[i])-zX.begin()][lower_bound(all(zY), y[i])-zY.begin()]++;
	}
	rep(i, zX.size()){
		if(i == 0) continue;
		rep(j, zY.size()){
			sum[i][j] += sum[i-1][j];
		}
	}
	rep(i, zX.size()){
		rep(j, zY.size()){
			if(j == 0) continue;
			sum[i][j] += sum[i][j-1];
		}
	}

	ll ans = LLONG_MAX;
	rep(i, zX.size()){
		if(i == 0) continue;
		rep(j, zY.size()){
			if(j == 0) continue;
			for(int k=i; k<zX.size(); k++){
				for(int l=j; l<zY.size(); l++){
					if(sum[k][l]-sum[i-1][l]-sum[k][j-1]+sum[i-1][j-1] >= K){
						ans = min(ans, (zX[k]-zX[i])*(zY[l]-zY[j]));
					}
				}
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	//#ifndef ONLINE_JUDGE
    //	freopen("C:\\Users\\HP\\Documents\\input.txt", "r", stdin);
    	//freopen("C:\\Users\\HP\\Documents\\output.txt", "w", stdout);
	//#endif
	
	int n,i,j;
	cin>>n;
	double p[n+1];
	for(i=1;i<=n;i++)
	{
		cin>>p[i];
	}
	double dp[n+1][n+1],sum=0;
	memset(dp,0.0,sizeof(dp));
	dp[0][0]=1;
	for(i=1;i<=n;i++)
	{
		for(j=0;j<=i;j++)
		{
			if(j==0)
			{
				dp[i][j]=dp[i-1][j]*(1-p[i]);
			}
			else
			{
				dp[i][j]=dp[i-1][j]*(1-p[i])+dp[i-1][j-1]*p[i];
			}
		}
	}
	for(i=(n+1)/2;i<=n;i++)
	{
		sum+=dp[n][i];
	}
	printf("%0.9lf",sum);
}

Measured memory_bytes: 70528
#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;

int main(){
	int a,b,c,d;
	cin >> a >> b >>c >>d;
	if (a + b == c+d){
		cout << "Balanced" << endl;
	}
	else if(a+b> c+d){
		cout << "Left" << endl;
	}
	else{
		cout << "Right" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
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; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  int N = 3;
  vector<vector<int>> v(N, vector<int>(N)); 
  REP(i, N) REP(j, N) cin >> v[i][j];

  bool flag = false;
  vector<int> A(N);
  REP(a, 101) REP(b, 101) REP(c, 101){
    A[0] = a; A[1] = b; A[2] = c;
    [&]{
      REP(i, N-1){
        if(v[i][0]-A[i] != v[i+1][0]-A[i+1]) return;
        if(v[i][1]-A[i] != v[i+1][1]-A[i+1]) return;
        if(v[i][2]-A[i] != v[i+1][2]-A[i+1]) return;
      }
      flag = true;
    }();
  }

  flag? Yes: No;

  return 0;
}

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

#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define ACC(c) (accumulate(ALL(c), 0LL))
#define PRINT(x) cout << (x) << "\n"

using namespace std;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;

inline int std_in(int& a) {return scanf("%d", &a);}
auto pint_compare = [](pint x, pint y) -> bool{return (x.first < y.first);};
const int MOD = 1000000007;

int N;
vector<string> v[20];

void solve(int n){
    for(string s : v[n - 1]){
        int m = 0;
        REP(i, s.length()){
            m = max(m, s[i] - 'a' + 1);
        }
        REP(i, m + 1){
            string str(s);
            str.push_back('a' + i);
            v[n].push_back(str);
            if(n == N - 1) PRINT(str);
        }
    }
}

signed main(){
    cin >> N;
    v[0].push_back("a");
    if(N == 1) PRINT("a");
    FOR(i, 1, N) solve(i);
    return 0;
}

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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
ll MOD = 1e9+7;
//ll MOD = 998244353;
ll INF = 1e18;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x, ll y, ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}   


int main(){
  ll i,j,o;
  ll result=0,buf=0,buf1=0,buf2=0,buf3=0,buf4=0;
  bool judge = true;
  ll n;cin>>n;
  for(i=0;i<n;i++){
    cin>>buf>>buf1;
    result+=buf1-buf+1;

  }
  cout<<result<<endl;


  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)





int main() {
    ll n;
    cin >> n;
    vector<ll> x(n), y(n);
    cin >> x[0] >> y[0];
    ll c = abs(x[0] + y[0]) % 2;
    REP(i, n - 1){
        cin >> x[i + 1] >> y[i + 1];
        if(abs(x[i + 1] + y[i + 1]) % 2 != c){
            cout << -1 << endl;
            return 0;
        }
    }
    
    vector<ll> d;
    for(ll i = 30; i >= 0; i--){
        d.push_back(1LL << i);
    }
    if(c == 0){
        d.push_back(1);
    }
    
    ll m = d.size();
    cout << m << endl;
    REP(i, m){
        cout << d[i] << ' ';
    }
    cout << endl;
    REP(i, n){
        string w;
        ll dx = 0, dy = 0;
        REP(j, m){
            if(abs(x[i] - dx) >= abs(y[i] - dy)){
                if(x[i] < dx){
                    w += 'L';
                    dx -= d[j];
                }
                else{
                    w += 'R';
                    dx += d[j];
                }
            }
            else{
                if(y[i] < dy){
                    w += 'D';
                    dy -= d[j];
                }
                else{
                    w += 'U';
                    dy += d[j];
                }
            }
        }
        cout << w << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)  for(long long i=0;i<n;++i)
#define rep1(i,n) for(long long i=1;i<=n;++i)
#define deb(x) cerr << #x <<": " << x << '\n';
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
typedef long double ld;
typedef long long ll;

int main(){
    ios;
    int n; cin >> n;
    if ( n % 10 == 2 || n % 10 == 4 ||n % 10 == 5 ||n % 10 == 7 || n % 10 == 9)
        cout << "hon";
    if(n % 10 == 0 ||n % 10 == 1 ||n % 10 == 6 ||n % 10 == 8)
        cout << "pon";
    if(n % 10 == 3)
        cout << "bon";
    
    return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

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

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

int N, M, Q;
bool table[1010][40];
int ans[1010];

signed main() {
    while(cin >> N >> M >> Q, N) {
        memset(table, true, sizeof(table));
        memset(ans, -1, sizeof(ans));
        string prev(M, '0');
        rep(i,0,Q) {
            string S, B; cin >> S >> B;
            bool switches[40] = {};
            rep(k,0,N) if(S[k] == '1') switches[k] = true;
            rep(k,0,M) {
                rep(x,0,N) {
                    if(!table[k][x]) continue;
                    table[k][x] = switches[x] ^ (prev[k] == B[k]);
                }
            }
            prev = B;
        }

        bool used[40] = {};
        bool ok = true;
        while(ok) {
            ok = false;
            vector<int> temp;
            rep(i,0,M) {
                if(ans[i] != -1) continue;
                int cnt = 0, rec = 0;
                rep(k,0,N) {
                    if(table[i][k] && !used[k]) {
                        // printf("bulb: %lld, switch: %lld\n", i, k);
                        cnt++;
                        rec = k;
                    }
                }
                if(cnt == 1) {
                    ok = true;
                    ans[i] = rec;
                    temp.push_back(rec);
                }
            }
            rep(i,0,temp.size()) used[ temp[i] ] = true;
        }
        rep(i,0,M) {
            if(ans[i] == -1) cout << "?";
            else {
                if(ans[i] < 10) cout << ans[i];
                else cout << (char)('A' + ans[i] - 10);
            }
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3280
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main() {
  int A, B;
  cin >> A >> B;
  cout << max({A+B,A-B,A*B}) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<numeric>
using namespace std;
int main(){
	int a[3], n, cnt = 0;
	cin >> a[0] >> a[1] >> a[2] >> n;
	sort ( a, a + 3 );
	for (int x = 0; x <= n / a[2]; ++x) {
		for (int y = 0; y <= (n - x * a[2])/a[1]; ++y) {
			if ((((n - x * a[2] )- y * a[1]) % a[0]) == 0) cnt = cnt + 1;
		}
	}
	cout << cnt << endl;

}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var a int
	fmt.Scan(&a)

	var b int
	fmt.Scan(&b)

	res := a*b

	if (res%2 == 1) {
		fmt.Println("Odd")
	} else {
		fmt.Println("Even")
	}
}

Measured memory_bytes: 512
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
        long c = sc.nextLong();
        long d = sc.nextLong();       
		System.out.println(Math.max(Math.max(a*c,a*d),Math.max(b*c,b*d)));
	}
}

Measured memory_bytes: 35556
#include<bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define INF 1000000000000000
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265
#define F first
#define S second
#define PB push_back
#define EB emplace_back
void init(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int n,a,b,s;

void dfs(int x,int y,int ban){
  if(__builtin_popcount(ban^s)==1){
    cout<<y<<' '<<(x^y)<<" ";
    return;
  }

 
  rep(i,n){

    if(((~ban>>i)&1)&&((x>>i)&1)){
    
      rep(j,n){
        if(((~ban>>j)&1)&&i!=j){
          dfs(1<<j,y,ban|1<<i);
          dfs(x^(1<<i)^(1<<j),y^(1<<i)^(1<<j),ban|1<<i);
          return;
        }
      }
    }
  }
}



main(){
  
  cin>>n>>a>>b;
  s = (1<<n)-1;
  if(__builtin_popcount(a^b)%2){
    cout<<"YES"<<endl;
    dfs(a^b,a,0);
    cout<<endl;
  }else{
    cout<<"NO"<<endl;
  }

}


Measured memory_bytes: 1152
using System;
using System.Linq;
using System.Collections.Generic;
namespace mytest
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var S= Console.ReadLine();
            var T = 1;
            for(int i = 0; i<N-1;i++)
            {
                if(S[i] != S[i + 1] ) T++;
            }
            Console.WriteLine(T.ToString());
        }
    }
}


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



void solve(long long N, std::vector<long long> A){

    sort(A.begin(),A.end());
    reverse(A.begin(),A.end());
    

    ll ans = A[0];
    for(ll i=1; i<N-1; i++) {
        ans += A[(i+1)/2];
    }
    cout << ans << endl;
    
}

signed main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Measured memory_bytes: 4864
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

//const MAX:usize = 100006;
//const INF:u64 = u64::max_value();

fn main() {
    let s:Vec<char> = read::<String>().chars().collect();
    let n = s.len();

    let mut ans:i32 = 753;
    for i in 0..n-3+1 {
        let i = i as usize;
        let mut val:i32 = 0;
        let mut k:i32 = 100;
        for j in 0..3 {
            let e = s[i+j] as u8 - b'0';
            val += e as i32 *k;
            k /= 10;
        }
        //debug!(i,val);
        ans = min(ans, (753-val).abs());
    }

    println!("{}", ans);

}


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

int main(void){
  int n,x,point = 0;
  cin >> n >> x;
  vector<int> l(n);
  for(int i = 0; i != n; i++)cin >> l[i];

  for(int i = 0; i != n; i++){
    point += l[i];
    if(point > x){
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << n + 1 << endl;
  return 0;
}

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

int main(){
    int N;
    cin >> N;
    vector<int> p(N);
    rep(i,N){
        cin >>p[i];
        p[i]--;
    }
    int cnt=0;
    for(int i=0;i<N-1;i++){
        if(p[i]==i){
            swap(p[i],p[i+1]);
            cnt++;
        }
    }
    rep(i,N){
        if(p[i]==i){
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}

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

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

int bubble_Sort(int cnt){
    
    int sort_Already = 0;
    
    // 毎回、最後の位置からスタートして確認
    for(int i = N-1; i > sort_Already;){
        // 最後の位置からソート済まで入れ替えるか確認
        for(int j = i; j > sort_Already; j--){
            if(A[j] < A[j-1]){
            swap(A[j], A[j-1]);
            cnt++;
            }
        }
        sort_Already++;
    }
    
    return cnt;
}


int main(void){
    
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    
    int count = 0;
    
    count = bubble_Sort(count);
    
    for(int i = 0; i < N; i++){
        cout << A[i] << (i != N-1 ? " " : "\n");
    }
    cout << count << endl;
    
}



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

using namespace std;

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define deb(x) cout << x << endl
#define done(x) {cout << x << endl;return;}
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//const int mod = 998244353;
const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;


const int N = 2e5+5;

void solve() {

  string s,t;
  cin>>s>>t;
  int ans=0;
  rep(i,0,sz(s))
    ans+=s[i]!=t[i];
  cout<<ans;
}


signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(15);
    int t = 1;
   //cin >> t;

    while (t--)
        solve();
#ifdef aa
    cout << endl << endl << endl << endl << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}




int powm(int a, int b) {
    int res = 1;
    while (b) {
        if (b & 1)
            res = (res*a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return res;
}


int divide(int a, int b) {
    return (a % mod) * powm(b, mod - 2) % mod;
}

int norm(int a) {
    while (a >= mod) a -= mod;
    while (a < 0) a += mod;
    return a;
}


int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}

Measured memory_bytes: 3736
n = int(input())
a = list(map(int,input().split()))
cnt = 0
ans = 0
st = set()
for j in range(60)[::-1]:
  num = 0
  for i in range(n):
    if a[i]&1<<j:
      num += 1
  if num%2:
    ans += 1<<j
    for i in range(n):
      if a[i]&1<<j:
        a[i] ^= 1<<j
for j in range(60)[::-1]:
  for i in range(cnt,n):
    if a[i]&1<<j:
      for k in range(n):
        if i != k and a[k]&1<<j:
          a[k] ^= a[i]
      a[i],a[cnt] = a[cnt],a[i]
      cnt += 1
      break
tmp = 0
for i in range(n):
  tmp ^= a[i]
print(ans+tmp*2)

Measured memory_bytes: 77216
import java.util.Scanner;

class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        String data, input;
        int ans = 0;
        data = scan.next();
        while (true) {
            input = scan.next();
            if (input.equalsIgnoreCase(data))
                ans++;
            else if (input.equals("END_OF_TEXT"))
                break;
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 26380
N=int(input());S=input();
SL=S[:N];SR=S[N:];SR=SR[::-1]
MR={};ans=0
for i in range(2**N):
  R="";B="";
  for j in range(N):
    if(i%2):
      R+=SL[j]
    else:
      B+=SL[j]
    i//=2
  if R+"_"+B in MR: 
    MR[R+"_"+B]+=1
  else:
    MR[R+"_"+B]=1
for i in range(2**N):
  R="";B="";
  for j in range(N):
    if(i%2):
      R+=SR[j]
    else:
      B+=SR[j]
    i//=2
  if R+"_"+B in MR: 
    ans+=MR[R+"_"+B]
print(ans)

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

using namespace std;

int main()
{
    int m,d;
    int ans=0;
    cin>>m>>d;
    for(int i=1;i<=m;i++)
    {
        for(int j=11;j<=d;j++)
        {
            if(j%10>=2&&j/10>=2&&j%10*(j/10)==i)
                ans++;
        }
    }
    cout<<ans<<'\n';
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int t[10005];
int main(){
	int n;
	int a,b,c;
	int i,j,k;
	while(cin>>n){
		if(!n)break;
		a=0;
		for(i=0;i<n;i++){
			cin>>t[i];
			a+=t[i];
		}
		a/=n,b=0;
		for(i=0;i<n;i++){
			if(t[i]<=a)b++;
		}
		cout<<b<<endl;
	}
}



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

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

long long lcm(long long a, long long b)
{
    return a * b / gcd(a, b);
}

void solve(long long A, long long B)
{
    cout << lcm(A, B) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iomanip>
#include <float.h>
#include <math.h>
using namespace std;
using ll = long long;


unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    ll n, k;
    cin >> n >> k;
    vector<ll> z(n);
    for (int i = 0; i < n; i++) {
        cin >> z[i];
    }
    sort(z.begin(), z.end());
    ll ans = 0;
    for (int i = 0; i < k; i++) {
        ans += z[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632
#https://tjkendev.github.io/procon-library/python/graph/dijkstra.html
# V: 頂点数
# g[v] = {(w, cost)}:
#     頂点vから遷移可能な頂点(w)とそのコスト(cost)
# r: 始点の頂点

from heapq import heappush, heappop
INF = 10**10
def dijkstra(N, G, s):
    dist = [INF] * N
    que = [(0, s)]
    dist[s] = 0
    while que:
        c, v = heappop(que)
        if dist[v] < c:
            continue
        for t, cost in enumerate(G[v]):
            if dist[v] + cost < dist[t]:
                dist[t] = dist[v] + cost
                heappush(que, (dist[t], t))
    return dist

xs,ys,xt,yt = map(int, input().split( ))
n = int(input())

p = [(xs,ys,0)]+[tuple(map(int, input().split( ))) for _ in range(n)] + [(xt,yt,0)]

def d(pj,pk):
    dis = (pj[0]-pk[0])**2+(pj[1]-pk[1])**2
    return(max(dis**(1/2)-pk[2]-pj[2],0))

D = [[d(p[i],p[j]) for i in range(n+2)] for j in range(n+2)]
#頂点間の距離-円半径で最短距離求める
ans = dijkstra(n+2,D,0)
print(ans[-1])


Measured memory_bytes: 118748
#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

N, M = map(int, raw_input().split())
X = sorted(map(int, raw_input().split()))

ls = []

for i in range(M - 1):
    ls.append(X[i + 1] - X[i])

ls.sort()

ans = 0

for i in range(M - N):
    ans += ls[i]

print ans

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

int P,Q,R;
int main(void){
    cin >> P >> Q >> R ;
    int ans = P+Q;
    ans = min(ans,Q+R);
    ans = min(ans,R+P);
    cout << ans << endl;
}


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

int main() {
  int N;
  cin >> N;
  int A[N];
  cin >> A[0];
  int lower = A[0], upper = A[0];
  for (int i = 1; i < N; ++i) {
    cin >> A[i];
    if (A[i] < lower) lower = A[i];
    else if (A[i] > upper) upper = A[i];
  }
  cout << upper - lower << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int search(int A[], int n, int key)
{
  int i = 0;
  A[n] = key;
  while(A[i] != key ) i++;
  return i != n;
}

int main()
{
  int i, n, A[10000+1], q, key, sum = 0;

  scanf("%d", &n);
  for(i=0; i<n; i++) scanf("%d", &A[i]);

  scanf("%d", &q);
  for(i=0; i<q; i++){
    scanf("%d", &key);
    if( search(A, n, key) ) sum++;
  }
  printf("%d\n", sum);

  return 0;
}

Measured memory_bytes: 636
#include <iostream>
#include <unordered_map>
#include <vector>

using namespace std;

int main(){
    int n, k;
    cin >> n >> k;
    unordered_map<int, int> m;
    for(int i=0; i<n; ++i){
        int a;
        cin >> a;
        ++m[a];
    }
    int lim=200000;
    auto t=vector<int>(lim+1, 0);
    int total=0;
    for(auto& p : m){
        ++t[p.second];
        ++total;
    }
    int diff=total-k;
    int res=0;
    for(int i=1; i<=lim && diff>0; ++i){
        int d;
        if(t[i]>diff) d=diff;
        else d=t[i];
        res+=d*i;
        diff-=d;
    }
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 9288
#include<iostream>

int main(){
	int a,b,c,n,i;
	std::cin>>n;
	for(i=0;i<n;i++){
	std::cin>>a>>b>>c;
	if (a*a==b*b+c*c)std::cout<<"YES"<<std::endl;
	else if (b*b==a*a+c*c)std::cout<<"YES"<<std::endl;
	else if (c*c==a*a+b*b)std::cout<<"YES"<<std::endl;
	else    std::cout<<"NO"<<std::endl;
	}
	

	return 0;
}

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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}

#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i <= (b); i++)
#define FORD(i, a, b) for(int i = (a); i >= (b); i--)
#define A first
#define B second
#define MOD 1000000007

typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef long long ll;

int mulmd(ll a, ll b){
    ll ret = (a * b) % MOD;
    return (int)ret;
}

inline int power(ll x, ll y, int p)
{
    ll res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = mulmd(res, x);
        y = y >> 1;
        x = mulmd(x, x);
    }
    return (int)res;
}

int submd(ll a, ll b){
    ll ret = a - b;
    if(ret < 0){
        ret += MOD;
    }
    return (int)ret;
}

int addmd(ll a, ll b){
    ll ret = (a + b) % MOD;
    return (int)ret;
}

int invPow(ll a){
    return power(a, MOD - 2, MOD);
}

const int N = 1e5 + 5;

int arr[N];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int ans = n * n * n;
    cout << ans;


}

/**
    Check out for boundary cases, (n = 1 or n = 0)
    check for integer overflow

**/



Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main() {
	int w, h, x, y, r;
	bool p;
	cin >> w >> h >> x >> y >> r;
	p = x >= r && y >= r && w - r >= x && h - r >= y;
	if(p) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}

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

int main(void)
{
  int n;

  
  while(1)
    {
      cin >> n;
      if(cin.eof()) 
	break;

      int count = 0;
      
      for(int a=0;a<10;a++)
	{
	  for(int b=0;b<10;b++)
	    {
	      for(int c=0;c<10;c++)
		{
		  for(int d=0;d<10;d++)
		    {
		      if(a+b+c+d==n)
			count++;
		    }
		}
	    }
	}

      cout << count << endl;
    }

  return 0;
}

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

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
const int inf = 1000000001;
const ll INF = 1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<<fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

#define N 52
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n;
vi d(N, -1), color(N, WHITE);
vii M(N, vi(N, 0));

void bfs(int r) {
	fill(d.begin(), d.end(), -1);
	fill(color.begin(), color.end(), WHITE);
	queue<int> q;
	int v;
	q.push(r);
	d[r] = 0;
	while (!q.empty()) {
		int u = q.front();
		for (v = 1; v <= n; v++) {
			if (M[u][v] && color[v] == WHITE) {
				q.push(v);
				color[v] = GRAY;
				d[v] = d[u] + 1;
			}
		}
		color[u] = BLACK;
		q.pop();
	}
}

int main() {
	int m, i, j;
	cin >> n >> m;
	vi cnt(n + 1);
	for (i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		M[a][b] = M[b][a] = 1;
	}
	int ans = 0;
	for (i = 0; i < n; i++) {
		for (j = i + 1; j < n; j++) {
			if (M[i][j] == 1) {
				M[i][j] = M[j][i] = 0;
				bfs(0);
				int i2;
				for (i2 = 0; i2 < n; i2++) {
					if (d[i2] == -1) {
						ans++;
						break;
					}
				}
				M[i][j] = M[j][i] = 1;
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

struct Combination {
    vector<ll> fac, finv, inv;

    Combination(ll maxN) {
        maxN += 100; // for safety
        fac.resize(maxN + 1);
        finv.resize(maxN + 1);
        inv.resize(maxN + 1);
        fac[0] = fac[1] = 1;
        finv[0] = finv[1] = 1;
        inv[1] = 1;
        for (ll i = 2; i <= maxN; ++i) {
            fac[i] = fac[i - 1] * i % MOD;
            inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
            finv[i] = finv[i - 1] * inv[i] % MOD;
        }
    }
    ll operator()(ll n, ll 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() {
    int n, k;
    cin >> n >> k;
    Combination cb(n);
    for (int i = 1; i <= k; ++i) {
        ll divB = cb(k - 1, i - 1);
        ll divR = cb(n - k + 1, i);
        cout << (divB * divR) % MOD << endl;
    }
    return 0;
}

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

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

int main(){
    int a;
    int ans = 0;
    cin>>a;
    ans += a;
    cin>>a;
    ans += a;
    cin>>a;
    ans += a;

    if (ans>=22)
    {
        cout<<"bust";
    }else{
        cout<<"win";
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint(), M = getint();
	if (M > N / 2) co(0);
	else {
		int A[100001];
		rep(i, M) {
			int a = getint();
			A[a] = 1;
		}

		ll dp[100002];
		dp[0] = 0;
		dp[1] = 1;
		ll mod = 1e9 + 7;
		int meyasu = 0;
		rep1(i, N) {
			if (A[i] != 1) {
				dp[i + 1] = dp[i] + dp[i - 1];
				meyasu++;
				if (meyasu >= 30) {
					dp[i] %= mod;
					dp[i + 1] %= mod;
					meyasu = 0;
				}
			}
			else dp[i + 1] = 0;
		}
		co(dp[N + 1] % mod);
	}

	Would you please return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;

int main() {
  int N, K, i;
  cin >> N >> K;
  vector<long long> H(N);
  long long result = 0;
  for (i = 0; i < N; i++) {
    cin >> H[i];
  }
  sort(H.begin(), H.end(), greater<long long>());
  for (i = K; i < N; i++) {
    result += H[i];
  }
  cout << result << endl;
  return 0;
}


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

int main(){
    int N;
    cin >> N;
    ll sum = 0;
    for (int i=1; i<=N; i++) {
        if (i%3 != 0 && i%5 != 0) sum += i;
    }
    cout << sum << endl;
}

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

int main(void){
    int a,b,c; cin >> a >> b >> c;
    
    if (a==b){
        cout << c << endl;
    } else {
        if (b == c){
            cout << a << endl;
        } else {
            cout << b << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
while number = gets.to_i
  exit if number == 0

  a = gets.split.map(&:to_i).each_with_object(Hash.new(0)) { |o, h| h[o] += 1 }
  b = a.sort_by { |k, v| -v }
  if b[0][1] > number / 2
    puts b[0][0]
  else
    puts 'NO COLOR'
  end 
end

Measured memory_bytes: 98528
#include <bits/stdc++.h>
 
 using namespace std;
 
 int main() {
 	int n;
 	int a[111];
 	memset(a, 0, sizeof(a));
 	scanf("%d", &n);
 	int ans = 0;
 	while (n--) {
 		int x;
 		scanf("%d", &x);
 		a[x]++;
 		if (a[x] == 1)
 			ans++;
	 }
	 printf("%d\n", ans);
	 return 0;
 }

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static HashMap<String,Boolean> map = new HashMap<String,Boolean>();
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int m = stdIn.nextInt();
		for(int i = 0; i < m; i++) {
			map = new HashMap<String,Boolean>();
			String in = stdIn.next();
			int ans = sorv1(in);
			System.out.println(ans);
			
		}
	}
	
	public static int sorv1(String a) {
		//--分ける---//
		int ans = 0;
		for(int i = 0; i < a.length(); i++) {
			String tp1 = a.substring(0, i);
			String tp2 = a.substring(i, a.length());
			if(check(tp1 + tp2)) {
				ans++;
			}
			if(check(rev(tp1) + tp2)) {
				ans++;
			}
			if(check(tp1 + rev(tp2))) {
				ans++;
			}
			if(check(rev(tp1) + rev(tp2))) {
				ans++;
			}
			if(check(tp2 + tp1)) {
				ans++;
			}
			if(check(rev(tp2) + tp1)) {
				ans++;
			}
			if(check(tp2 + rev(tp1))) {
				ans++;
			}
			if(check(rev(tp2) + rev(tp1))) {
				ans++;
			}
		}
		return ans;
	}
	
	public static String rev(String a) {
		String ra = "";
		for(int i = a.length()-1; i >= 0; i--) {
			ra += String.valueOf(a.charAt(i));
		}
		return ra;
	}
	
	public static boolean check(String a) {
		if(map.containsKey(a)) {
			return false;
		}
		else {
			map.put(a, true);
			return true;
		}
	}
}

Measured memory_bytes: 181116
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {s: String, t: String, a: usize, b: usize, u: String};

    if u == s {
        println!("{} {}", a - 1, b)
    } else {
        println!("{} {}", a, b - 1)
    }
}


Measured memory_bytes: 2164
#include<stdio.h>
//累乗(power)a^n(mod10^9+7)
long long power(long long a,long long n){
  long long count=a,sum=1;
  while(n>0){
    if(n%2==1)
      sum*=count;
    count*=count;
    count%=1000000007;
    sum%=1000000007;
    n/=2;
  }
  return sum;
}

//nCr(mod10^9+7)
long long int comb(long long int n,long long int r){
  long long x=1,y=1,i;
  for(i=0;i<r;i++){
    x*=n-i;
    y*=r-i;
    x%=1000000007;
    y%=1000000007;
  }
  y=power(y,1000000005);
  return (x*y)%1000000007;
}

int main(){
  long long n,a,b,count;
  scanf("%lld%lld%lld",&n,&a,&b);
  count=power(2,n)-comb(n,a)-comb(n,b)-1;
  while(count<0){
    count+=1000000007;
  }
  printf("%lld\n",count);
  return 0;
}


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

template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
    
const int MOD = 1000000007;
using mint = Fp<MOD>;

mint calc(long long N,long long K){
    mint res = 1;
    for(long long n = 0; n < K;++n){
        
        res *= (N-n);
        res /= (n+1);
    
    }
    
    return res;

}

int main(){
    long long N,A,B;
    cin >> N >> A >> B;
    mint res = modpow(mint(2),N) - 1;
    res -= calc(N,A) + calc(N,B);
    cout << res << endl;
    
    
    
    
    
}


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

using namespace std;

int main() {
	int n, q; cin >> n >> q;
	string s; cin >> s;
	vector<int> dp(n, 0);
	for (int i = 1; i < n; ++i) {
		dp[i] += dp[i - 1];
		if (s[i - 1] == 'A' && s[i] == 'C') dp[i]++;
	}
	int l, r;
	for (int i = 0; i < q; ++i) {
		cin >> l >> r;
		cout << dp[r - 1] - dp[l - 1] << endl;
	}

	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;

int main(){
	int N;
	cin>>N;
	int array[N];
	int Carray[N];
	for (int i = 0; i < N; i++){
		cin>>array[i];
		Carray[i] = array[i];
	}
	sort(array,array+N,greater<int>());
	int max=array[0];
	int second=array[1];
	for(int i=0;i<N;i++){
		if(Carray[i]==max){
			cout<<second<<endl;
		}
		else{
			cout<<max<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3200
program ap                                                                                                                 
  implicit none
  integer :: ans, larg
  integer :: h, w , n

  read(*,*) h
  read(*,*) w
  read(*,*) n

  if(h.gt.w)then
     larg=h
  else
     larg=w
  endif

  ans=n/larg
  if (mod(n,larg).ne.0) ans=ans+1
  print *, ans

end program ap

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main() {
    int A[3]; for (auto &a : A) cin >> a;
    set<int> S(begin(A), end(A));
    if (S.size() == 2) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    return 0;
}


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

#define fi first
#define se second
#define sc scanf
#define pr printf
#define pb push_back
#define ll long long
#define fin(s) freopen( s, "r", stdin );
#define fout(s) freopen( s, "w", stdout );

const long long N = 440;
const long long MX = sqrt(N);
const long long H = 17;
const long long MAGIC = 1000;
const long long mod = 1e9 + 7;

using namespace std;

int n;
int a[N];

void solve()
{
        cin >> n;
        int s = 0;
        for(int i = 1; i <= n; i++){
                cin >> a[i];
                s += a[i];
        }
        int ans = 0;
        if(s % 10){
                ans = s;
        }
        for(int i = 1; i <= n; i++){
                if((s - a[i]) % 10){
                        ans = max(ans, s - a[i]);
                }
        }
        cout << ans << endl;
}

bool mtest = false; int main()
{
        //fin("input.txt");
        //fout("output.txt");
        //fin("landscape.in");
        //fout("landscape.out");
        ios_base::sync_with_stdio(0);
        int TE = 1;
        if(mtest)
                cin >> TE;
        while(TE--)
                solve();
        return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = ReadInt();
            var H = ReadInt();
            var W = ReadInt();

            Console.WriteLine((N - H + 1) * (N - W + 1));
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 11092