akhauriyash/Code-Regression huggingface dataset:
use std::collections::HashMap;
use std::collections::BTreeMap;
use std::cmp::Ordering;
use std::io::{ stdin, stdout, Write };


fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let s: Vec<usize> = read_vec();
    let (n, m, q) = (s[0], s[1], s[2]);

    let mut data: Vec<Vec<i64>> = vec![vec![0; n]; n];

    for i in 0..m {
        let s: Vec<usize> = read_vec();
        data[s[0] - 1][s[1] - 1] += 1;
    }
    let mut sums: Vec<Vec<i64>> = vec![vec![0; n]; n];
    for i in 0..n {
        sums[i][0] = data[i][0];
        for j in 1..n {
            sums[i][j] = sums[i][j-1] + data[i][j];
        }
    }
    let mut s: Vec<String> = Vec::new();

    for i in 0..q {
        let mut qq = read_vec::<usize>();
        qq[0] -= 1;
        qq[1] -= 1;
        let mut ans = 0i64;
        for j in qq[0]..qq[1] + 1 {
            if qq[0] == 0 {
                ans += sums[j][qq[1]];
            } else {
                ans += sums[j][qq[1]] - sums[j][qq[0] - 1];
            }
        }
        s.push(ans.to_string());
    }
    println!("{}", s.connect("\n"));
}


Measured memory_bytes: 14584
# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    s, w = input_to_int_map()

    if s <= w:
        return "unsafe"

    return "safe"


if __name__ == "__main__":
    print(main())


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

int main() {
    string s;
    cin >> s;
    int i = 0, run = 0;
    int ans = 0;
    while (i < s.length()) {
        int j = i + 1;
        run = 1;
        while (j < s.length() && s[j] == s[i]) {
            run++;
            j++;
        }
        ans += 2 * (run / 3);
        if (run % 3 == 1) {
            ans++;
        }
        else if (run % 3 == 2) {
            if (j == s.length()) {
                ans++;
            }
            else {
                ans += 2;
            }
            j++;
        }
        i = j;
    }
    cout << ans;
    return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long
#define rep(i, a, n) for(int i = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int i = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int i = (int)(a);(x);++(i))
#define repr(i, a, n) for(int i = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int i = (int)(a);(i) >= (int)(n);--(i))
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x), end(x)
#define RNG(x, a, n) &((x)[a]), &((x)[n])
#define ADD(a, b) (((a%MOD+MOD)%MOD+(b%MOD+MOD)%MOD)%MOD)
#define MUL(a, b) ((((a%MOD+MOD)%MOD)*((b%MOD+MOD)%MOD))%MOD)
#define CHADD(a, b) (a = ADD(a, b))
#define CHMUL(a, b) (a = MUL(a, b))
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define PI (acos(-1))
#define EPS (1e-10)
#define INF LLONG_MAX
#define MOD 1000000007LL
using namespace std;
using VI = vector<int>;
using PII = pair<int, int>;
using VPII = vector<PII>;
using Complex = complex<double>;
template<typename T, template<typename> typename C = less> using PQ = priority_queue<T, vector<T>, C<T>>;
template<typename T> bool chmax(T& a, const T& b){ if(a<b){ a=b; return true; } return false; }
template<typename T> bool chmin(T& a, const T& b){ if(a>b){ a=b; return true; } return false; }
template<typename I> int ACC(I f, I l, int i){ return accumulate(f, l, i); }


int N, M;
int a[1010];
int c[1010];
int dp[1<<12];


signed main(){
    cin >> N >> M;
    rep(i, 0, M){
        int b;
        cin >> a[i] >> b;
        int x;
        rep(j, 0, b){
            cin >> x;
            x--;
            c[i] |= 1<<x;
        }
    }

    fill(RNG(dp, 0, 1<<N), INT_MAX);
    dp[c[0]] = a[0];
    rep(i, 1, M){
        repr(j, 1<<N, 0) chmin(dp[j|c[i]], dp[j]+a[i]);
        chmin(dp[c[i]], a[i]);
    }

    if(dp[(1<<N)-1] != INT_MAX) cout << dp[(1<<N)-1] << endl;
    else cout << -1 << endl;

    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

// https://atcoder.jp/contests/abc158/tasks/abc158_a
func main() {
	var s string
	fmt.Scanf("%s", &s)
	if s == "AAA" || s == "BBB" {
		fmt.Println("No")
	} else {
		fmt.Println("Yes")
	}
}


Measured memory_bytes: 512
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1001001001;

int main() {
    int A, B;

    cin >> A >> B;

    if(A<10 && B<10) {
        cout << A*B << endl;
    } else {
        cout << -1 << endl;
    }

    return 0;
    
}

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

/*                    ॐ Shree ॐ                     */
/* ॐ ॐ ॐ
ॐ भूर् भुवः स्वः
तत् सवितुर्वरेण्यं
भर्गो देवस्य धीमहि
धियो यो नः प्रचोदयात्
*/
using namespace std;
typedef long long int ll;
int a, b, n, m, test;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
// online submission
#endif

	cin >> n >> m;
	vector<vector<int>> v(n + 1);
	bool flag=false;
	while (m--) {
		cin >> a >> b;
		v[a].push_back(b);
		v[b].push_back(a);
		if(a==1||b==1){
			flag=true;
		}
	}

	queue<int> q;
	vector<bool> visited(n + 1, false);
	vector<int> len(n + 1, INT_MAX);
	len[1] = 0;
	q.push(1);
	while (!q.empty()) {

		visited[q.front()] = true;
		for (int i :v[q.front()]) {
			if (!visited[i]) {
			
				len[i] = q.front();
				visited[i] = true;
				q.push(i);
			}
		}

		q.pop();
	}
	for (int i = 2; i <= n; i++) {
		if(len[i]==INT_MAX){
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes\n";
	for (int i = 2; i <= n; i++) {
		cout << len[i] << "\n";
	}

}

Measured memory_bytes: 10332
#include<cstring>
#include<string>
#include<vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<list>
#include<set>
#include<map>
#include<complex>
#include<sstream>
#include<climits>
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

const int MAX_N = 200000;
int N;
int A[MAX_N], B[MAX_N];

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

  bool same = true;
  for (int i = 0; i < N; ++i) same &= A[i] == B[i];
  if (same) {
    cout << 0 << endl;
    return 0;
  }

  ll sum = 0; 
  int remainder = 1e9+1;
  for (int i = 0; i < N; ++i) {
    sum += A[i];
    if (A[i] > B[i]) {
      remainder = min(remainder, B[i]);
    }
  }

  ll ans = sum - remainder;
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
 
signed main(){
bool n[50]{};
int s[50];
int a,b;
scanf("%d%d",&a,&b);
for(int c=0;c<b;c++){
    int d;
    cin>>d;
    for(int e=0;e<d;e++){
	int f;
	scanf("%d",&f);
	f--;
	s[f]=c;
	}
    }
    int h;
    cin>>h;
    int k=0;
    for(int p=0;p<h;p++){
	int x,z;
	cin>>x>>z;
	x--;z--;
	if(s[x]==s[z]){n[x]=n[z]=true;}
	}
	for(bool q:n){if(q)k++;}
	printf("%d\n",k);
}

Measured memory_bytes: 3204
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define o 200005
#define ll long long
using namespace std;
int n;
int a[o];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<=n;i++) if(a[i]>i-1){
		puts("-1");
		return 0;
	}
	int pp=n+1;
	for(int i=n;i>=1;i--){
		if(pp<=i-a[i]){
			puts("-1");
			return 0;
		}
		pp=min(pp,i-a[i]+1);
	}
	ll ans=0;
	for(int i=2;i<=n;i++){
		if(a[i]==a[i-1]+1) ans++;
		else ans+=(ll)a[i];
	}
	cout<<ans<<endl;
}

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


using namespace std;


typedef long long ll;

ll dp[50][1000];
ll ans[1000];
ll M=1e9+7;

int main(){
  ll n,m,K,p[10000];
  cin>>n>>m>>K;


  dp[0][0]++;
  for(int i=0;i<m;i++)cin>>p[i],dp[0][p[i]%n]++;
  
  ll i=0;


  ans[0]=1;
  
  while((1<<i)<=K){

    if((1<<i)&K){
      ll tmp[1000]={};
      
      for(int k=0;k<n;k++)
	for(int j=0;j<n;j++){
	  tmp[(k+j)%n]
	    =(tmp[(k+j)%n]+(ans[k]*dp[i][j]%M))%M;
	}

      for(int j=0;j<n;j++)ans[j]=tmp[j];
    }

    for(int k=0;k<n;k++)
      for(int j=0;j<n;j++)dp[i+1][(k+j)%n]=(dp[i+1][(k+j)%n]+dp[i][k]*dp[i][j]%M)%M;


    i++;

  }

  for(int i=0;i<n;i++)cout<<ans[i]<<endl;
  
  return 0;
}

Measured memory_bytes: 3400
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

N,K = map(int,readline().split())
p = list(map(int,readline().split()))
p.sort()

print(sum(p[:K]))

Measured memory_bytes: 9336
'use strict'

const main = (input) => {
    input = input.split(' ').map(v => parseInt(v))
    const N = input[0]
    const A = input[1]
    const B = input[2]
    console.log(Math.min(N * A, B))
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))

Measured memory_bytes: 7372
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;

int main() {
    int K, X;
    cin >> K >> X;
    const int min_x = -1000000;
    const int max_x =  1000000;
    // 
    int bx = X - K + 1;
    int ex = X + K;
    for (int i=bx; i<ex; ++i) {
        cout << i << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
//file_name:ABC43_A.cpp
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // int scan
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // matrix scan
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // string scan
    /*
    string s;
    cin >> s;
    */


int main() {
    int n;
    scanf("%d",&n);


    ll ans = n*(n+1)/2;

    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
string S;
int main() {
	while (getline(cin, S)) {
		for (int h = 0; h < 26; h++) {
			if (S.find("this") != string::npos) {
				goto E;
			}
			if (S.find("that") != string::npos) {
				goto E;
			}
			if (S.find("the") != string::npos) {
				goto E;
			}
			for (int i = 0; i < S.size(); i++) {
				if (S[i] >= 'a') {
					if (S[i] == 'z') {
						S[i] -= 25;
					}
					else {
						S[i]++;
					}
				}
			}
		}
	E:;
		cout << S << endl;
	}
}

Measured memory_bytes: 3128
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
//#define INF 9999999999
#define m0(x) memset(x,0,sizeof(x))
//#define fill(x,y) memset(x,y,sizeof(x))
#define print(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long


using namespace std;
typedef pair<int, int>P;

int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };


const int MAX = 500010;
const int MOD = 1000000007;
const ll INF = 10e17;

int B[100];
int A[101][101];
signed main() {
	int N, M, C; cin >> N >> M >> C;
	REP(i, M)cin >> B[i];
	REP(i, N) {
		REP(j, M) {
			cin >> A[i][j];
		}
	}
	int ans = 0;
	REP(i, N) {
		int res = C;
		REP(j, M) {
			res += A[i][j] * B[j];
		}
		if (res > 0)ans++;
	}
	print(ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k,a,ak,h;
    cin>>n>>k>>a;
    h=a;
    for(int i=2;i<=n;i++){
        cin>>ak;
        a=__gcd(a,ak);     
        h=max(ak,h);
    }
    if(k%a==0&&k<=h)cout<<"POSSIBLE"<<endl;
    else cout<<"IMPOSSIBLE"<<endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<cctype>
#include<vector>
#include<stack>
#include<queue>
#include<ctime>
#include<map>
#define ll long long
#define ld long double
#define ull unsigned long long
using namespace std;
int main(void)
{
    int n;
    while(~scanf("%d",&n)){
        if(n&1) n /= 2;
        else    n = n/2 - 1;
        printf("%d\n",n);
    }
    return 0;
}



Measured memory_bytes: 256
d,g=map(int,input().split())
l=[list(map(int,input().split())) for i in range(d)]

a=[]
for j in range(d):
  a.append([(j+1)*100*l[j][0]+l[j][1],l[j][0]])

b=[]
for k in range(2**d):
  b.append(format(k,'0'+str(d)+'b'))

c=[]
for m in range(len(b)):
  e=0;f=0;z=-1
  for n in range(d):
    if b[m][n]=='1':
      e+=a[n][0]
      f+=a[n][1]
    else:
      z=n+1
  c.append([e,f,z])

p=[]
for x in range(len(c)):
  if c[x][0]>=g:
    p.append(c[x][1])
  else:
    r=c[x][0];s=c[x][1]
    for y in range(a[c[x][2]-1][1]+1):
      r+=c[x][2]*100
      s+=1
      if r>=g:
        p.append(s)
        break

print(min(p))

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

int main()
{
    int n,r;
    cin>>n>>r;
    int ans=0;
    if(n>=10){
      ans=r;
    }else {ans=(100*(10-n));
    
      ans=r+ans;}
      cout<<ans;
    }


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

#define lli long long int

using namespace std;

lli n, m, s[2010], t[2010], memo[2010][2010], bigmod = 1000000007;

lli dp(lli a, lli b) {
	lli ret;
	if ((a == n) || (b == m))
		return 1;
	if (memo[a][b] != -1)
		return memo[a][b];
	ret = (dp(a + 1, b) + dp(a, b + 1)) % bigmod;
	if (s[a] != t[b])
		ret = (ret + bigmod -  dp(a + 1, b + 1)) % bigmod;
	memo[a][b] = ret;
	return ret;
}

int main() {
	lli ans;
	scanf("%lld %lld", &n, &m);
	for (lli i = 0; i < n; i++)
		scanf("%lld", &s[i]);
	for (lli i = 0; i < m; i++)
		scanf("%lld", &t[i]);
	memset(memo, -1, sizeof memo);
	ans = dp(0, 0);
	printf("%lld\n", ans);
	return 0;
}

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

using ll = long long;

int main(){
  int n, div_2 = 0, div_4 = 0, odd = 0;
  cin >> n;
  vector<ll> box(n);
  for(int i = 0; i < n; i++){
    cin >> box.at(i);
    if(box.at(i)%4 == 0) div_4++;
    else if(box.at(i)%2 == 0) div_2++;
    else odd++;
  }
  //4の倍数しか使わんでいいとき
  if(div_4 > box.size()/2-1){
    cout << "Yes" << endl;
    return 0;
  }
  //2の倍数しか使わんでいいとき
  else if(div_2 == box.size()){
    cout << "Yes" << endl;
    return 0;
  }
  //2の倍数と4の倍数の両方使うとき
  else if((double(box.size()-div_2)/2) <= div_4){
    cout << "Yes" << endl;
    return 0;
  }
  else{
    cout << "No" << endl;
    return 0;
  }
  
}

Measured memory_bytes: 4020
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,cnt=0;
	cin>>a;
	for (int i=0;i<a;i++)
	{
		cin>>b;
		if (b%2&&(i+1)%2)
			cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}


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

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

	int h,a;
	cin >> h >> a;
	int ans = (h%a) ? ceil(h*1.0/a) : (h/a);
	cout << ans ;
	return 0;

}


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

int main(){
    int x;
    cin >> x;
    while(x-- > 0){
        int p, q;
        cin >> p >> q;
        int sq = p*p+q*q;
        int cnt = 0;
        for(int m = -150; m <= 150; m++){
            for(int n = -150; n <= 150; n++){
                if(m*m+n*n==0 || sq%(m*m+n*n))    continue;
                int c = m*m+n*n;
                bool a = (m*p+n*q)%c == 0;
                bool b = (m*q-n*p)%c == 0;
                if(a && b)  cnt++;
            }
        }
        cout << (cnt==8 ? "P" : "C") << endl;
    }
    return 0;
}


Measured memory_bytes: 3092
#include<stdio.h>
int main()
{
    int i,k,w=0;
    int j;
    scanf("%d",&k);
    for(i=1;i<=k;i++){
        for(j=1;j<=k;j++){
                if(i%2==0&&j%2!=0){
                        w++;

                }
        }
        }
        printf("%d",w);

        return 0;
    }

Measured memory_bytes: 128
#include<stdio.h>
int main()
{
int distance,Time_minutes,displacement,calculation;
	scanf(" %d%d%d",&distance,&Time_minutes,&displacement);
	calculation=Time_minutes*displacement;
	if(calculation>=distance){
		printf("Yes\n");
	}
	else
	printf("No\n");
return 0;
}


Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  long c,k;
  cin >> n >> c >> k;
  vector<long>t(n);
  int i;
  for(i=0;i<n;i++){
    cin >> t[i];
  }
  sort(t.begin(),t.end());
  int busAmount = 1;
  int busMan = 1;
  int busTime = t[0];
  for(i=1;i<n;i++){
    if(busMan < c && t[i]<=busTime+k){
      busMan++;
    }else{
      busMan = 1;
      busAmount++;
      busTime = t[i];
    }
  }
  cout << busAmount << endl;

}


Measured memory_bytes: 1024
n = gets.chomp.to_i
#p n
s = readlines.map(&:chomp)
#p s
ac = 0
wa = 0
tle = 0
re = 0
n.times{ |i|
	if s[i] == 'AC'
		ac += 1
	elsif s[i] == 'WA'
		wa +=1
	elsif s[i] == 'TLE'
		tle += 1
	elsif s[i] == 'RE'
		re += 1
	end
}
puts "AC x #{ac}"
puts "WA x #{wa}"
puts "TLE x #{tle}"
puts "RE x #{re}"



Measured memory_bytes: 30756
#include<bits/stdc++.h>  
using namespace std;  
const int maxn=4e5;  
struct node  
{  
    int x,i;  
    bool operator < (const node &o) const  
    {  
        return x<o.x;  
    }  
}nd[maxn];  
int n,mp[maxn];  
int sz,lc[maxn],rc[maxn];  
vector<int> G[maxn];  
void init()  
{  
    for (int i=0;i<maxn;i++) G[i].clear();  
    sz=2*n;  
}  
void add(int u,int v)  
{  
    G[u].push_back(v);  
}  
void build(int l,int r)  
{  
    int o=sz++;  
    if (l==r)  
    {  
        lc[o]=rc[o]=0;add(o,mp[nd[l].i^1]);  
        return ;  
    }  
    int mid=(l+r)/2;  
    lc[o]=sz;build(l,mid);  
    rc[o]=sz;build(mid+1,r);  
    add(o,lc[o]);add(o,rc[o]);  
}  
int get1(int x)  
{  
    int l=0,r=2*n-1,mid,ret;  
    while (l<=r)  
    {  
        mid=(l+r)/2;  
        if (nd[mid].x>=x)  
        {  
            ret=mid;  
            r=mid-1;  
        }  
        else l=mid+1;  
    }  
    return ret;  
}  
int get2(int x)  
{  
    int l=0,r=2*n-1,mid,ret;  
    while (l<=r)  
    {  
        mid=(l+r)/2;  
        if (nd[mid].x<=x)  
        {  
            ret=mid;  
            l=mid+1;  
        }  
        else r=mid-1;  
    }  
    return ret;  
}  
void work(int o,int l,int r,int ql,int qr,int p)  
{  
    if (ql<=l&&r<=qr)  
    {  
        add(p,o);return ;  
    }  
    int mid=(l+r)/2;  
    if (ql<=mid) work(lc[o],l,mid,ql,qr,p);  
    if (qr>mid) work(rc[o],mid+1,r,ql,qr,p);  
}  
int dfs_clock,scc_cnt,sccno[maxn],pre[maxn],low[maxn];  
stack<int> S;  
void dfs(int u)  
{  
    pre[u]=low[u]=++dfs_clock;  
    S.push(u);  
    for (int i=0;i<G[u].size();i++)  
    {  
        int v=G[u][i];  
        if (!pre[v])  
        {  
            dfs(v);low[u]=min(low[u],low[v]);  
        }  
        else if (!sccno[v]) low[u]=min(low[u],pre[v]);  
    }  
    if (low[u]==pre[u])  
    {  
        scc_cnt++;  
        for (;;)  
        {  
            int x=S.top();S.pop();  
            sccno[x]=scc_cnt;  
            if (x==u) break;  
        }  
    }  
}  
void tarjan(int n)  
{  
    dfs_clock=scc_cnt=0;  
    memset(sccno,0,sizeof(sccno));  
    memset(pre,0,sizeof(pre));  
    for (int i=0;i<n;i++) if (!pre[i]) dfs(i);  
}  
bool check(int mid)  
{  
    init();  
    build(0,2*n-1);  
    for (int i=0;i<2*n;i++)  
    {  
        int i1=get1(nd[i].x-mid+1),i2=get2(nd[i].x+mid-1);  
        if (i1<i) work(2*n,0,2*n-1,i1,i-1,i);  
        if (i<i2) work(2*n,0,2*n-1,i+1,i2,i);  
    }  
    tarjan(sz);  
    for (int i=0;i<2*n;i++) if (sccno[i]==sccno[mp[nd[i].i^1]]) return 0;  
    return 1;  
}  
int main()  
{  
    cin>>n;  
    for (int i=0;i<2*n;i++) scanf("%d",&nd[i].x),nd[i].i=i;  
    sort(nd,nd+2*n);  
    for (int i=0;i<2*n;i++) mp[nd[i].i]=i;  
    int l=1,r=1e9,mid,ans=0;  
    while (l<=r)  
    {  
        mid=(l+r)/2;  
        if (check(mid))  
        {  
            ans=mid;  
            l=mid+1;  
        }  
        else r=mid-1;  
    }  
    cout<<ans;  
    return 0;  
}  

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

int main() {
    int x; cin >> x;
    if (x >= 30) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

const long long N = 1e5 + 17;
ll cnt, lnt, mn = N, mx, a[N], n, m,k, x, y, ans, sum;
pair<ll,ll>pr[N];
vector<ll>v,v2,v3;
map<ll,ll>mp;
bool used[N], t1, t2;
vector<string>sv;
vector<char>vi;

int main()
{
    cin >> n >> m;
    if(n <= 5)
    {
        cout << 0;
        return 0;
    }
    if(n >= 6 and n <= 12)
    {
        cout << m / 2;
        return 0;
    }
    cout << m;
}


Measured memory_bytes: 256
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
	int ans	= 0;
	for(int i = 0; i<N.length(); i++) {
            char c = N.charAt(i);
            if(c=='+')ans++;
            else ans--;
        }
	System.out.println(ans);
    }
}

Measured memory_bytes: 25172
#include <bits/stdc++.h>
#define repr(i,from,to) for(int (i)=(from);(i)<(to);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
#define vprint(x) for(auto a:(x)) cout << x << endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;
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(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ull h,w;cin>>h>>w;
    if (h==1 || w==1) {
        cout << 1 << endl;
    }
    else if(h%2 && w%2) {
        cout << (h*w-1)/2+1 << endl;
    }
    else {
        cout << h*w/2 << endl;
    }
    return 0;
}


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

#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 REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define MOD  1000000007
#define INF  0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
typedef long long ll;

int main() {
    
    ll A,B,C; cin >> A >> B >> C;
    
    if(A == B && B == C && A%2 == 0) {
        cout << -1 << endl;
        return 0;
    }
    
    ll ans = 0;
    while(true) {
        if(A%2 == 1)break;
        if(B%2 == 1)break;
        if(C%2 == 1)break;
        ll At = B/2 + C/2;
        ll Bt = A/2 + C/2;
        ll Ct = A/2 + B/2;
        A = At;
        B = Bt;
        C = Ct;
        ans++;
    }
    
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <typeinfo>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace std;

int main(){

    int n;
    cin >> n;

    vector<int> data(n);
    for(int i=0; i<n; i++){
        cin >> data[i];
    }

    int swapCount=0;
    for(int i=0; i<n; i++){
        int mini = i;
        for(int j=i; j<n; j++){
            if(data[j]<data[mini]){
                mini = j;
            }
        }
        int tmp = data[mini];
        data[mini] = data[i];
        data[i] = tmp;
        if(i != mini){
            swapCount += 1;
        }
    }

    for(int i=0; i<n; i++){
        if(i==n-1){
            cout << data[i] << endl;
            break;
        }
        cout << data[i] << " ";
    }

    cout << swapCount << endl;

    return 0;
}



Measured memory_bytes: 3092
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

int main()
{
	string S;

	cin >> S;

	vector<string> ss =
	{
		"eraser",
		"erase",
		"dreamer",
		"dream"
	};

	while (true)
	{
		bool flg = true;
		for (auto itr : ss)
		{
			if (S.length() < itr.length())continue;
			if (equal(S.end() - itr.length(), S.end(), itr.begin(), itr.end()))
			{
				auto Pos = S.rfind(itr);
				S.erase(Pos, itr.length());
				flg = false;
				break;
			}
		}
		if (flg)break;
	}

	if (S.size()==0)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;

	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) int(x.size())

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

const double PI=3.14159265358979323846;

int mod = 1e9+7;
const long long INF = 1LL<<60;

struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
};

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

  Sieve sieve(101);

  vector<int> cnt(101);
  for(int i=1; i<=N; i++){
    vector<P> res = sieve.factor(i);
    for(P p: res){
      int num = p.first;
      int freq = p.second;
      cnt[num] += freq;
    }
  }

  int ans = 0;

  int over2 = 0;
  int over4 = 0;
  int over14 = 0;
  int over24 = 0;
  int over74 = 0;
  rep(i, 101){
    if(cnt[i] >= 2) over2++;
    if(cnt[i] >= 4) over4++;
    if(cnt[i] >= 14) over14++;
    if(cnt[i] >= 24) over24++;
    if(cnt[i] >= 74) over74++;
  }
  // 1 * 75
  ans += over74;
  // 3 * 25
  ans += over24 * (over2 - 1);
  // 5 * 15
  ans += over14 * (over4 - 1);
  // 3 * 5 * 5
  ans += over4 * (over4-1) * (over2 - 2) / 2;


  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 256
#   ????????? str ?????????????????????????????????????????????????????????????????°??????

#   ?????\????±??????????str????¨??????\???????????????
str = list(input())
str = "".join(str)
#   ?????\???????????°p????¨??????\???????????????
p = int(input())
#   p??????????????????????????????????????????
orderList = [0 for i in range(p)]
for i in range(0, p):
    orderList[i] = list(input())
    orderList[i] = "".join(orderList[i]).split()
    if orderList[i][0] == "print":
        print("{0}".format(str[int(orderList[i][1]):int(orderList[i][2]) + 1]))
    elif orderList[i][0] == "reverse":
        str = str[0:int(orderList[i][1])] + str[-len(str) + int(orderList[i][2]):-len(str) + int(orderList[i][1]) - 1:-1] + str[int(orderList[i][2]) + 1:]
    elif orderList[i][0] == "replace":
        str = str[:int(orderList[i][1])] + orderList[i][3] + str[int(orderList[i][2]) + 1:]

Measured memory_bytes: 7748
#include<stdio.h>
#define N 500000

void Heapify(int);

int n,A[N];

int main(){
  int i;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&A[i]);
  }

  for(i=n/2;i>0;i--){
    Heapify(i);
  }

  for(i=1;i<=n;i++){
    printf(" %d",A[i]);
  }
  printf("\n");
  
  return 0;
}


void Heapify(int i){
  int l,r,largest,temp;
  l=2*i;
  r=2*i+1;

  if(l<=n && A[l]>A[i]){
    largest = l;
  }else{
    largest = i;
  }
  if(r<=n && A[r]>A[largest]){
    largest=r;
  }

  if(largest!=i){
    temp = A[i];
    A[i]= A[largest];
    A[largest] = temp;
    Heapify(largest);
  }
}




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

int main(){
  double x1,y1,x2,y2,x3,y3,xp,yp;
  while(cin >>x1>>y1>>x2>>y2>>x3>>y3>>xp>>yp){
    double a2,b2,a3,b3,ap,bp,s,t;
    a2=x2-x1; b2=y2-y1; a3=x3-x1; b3=y3-y1; ap=xp-x1; bp=yp-y1;
    s=(b3*ap-a3*bp)/(a2*b3-a3*b2);
    t=(-b2*ap+a2*bp)/(a2*b3-a3*b2);
    if(0.0<s+t && s+t<1.0 && 0.0<s && 0.0<t)
      cout << "YES\n";
    else
      cout <<"NO\n";
  }
  return 0;
}

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

double P(int N, int K){
  int i, r;
  double p, n;
  p = 0.;
  n = 1. / N;
  r = 0;
  for(i = N;i >= 1;i--){
    if(pow(2, r) < (double) K / i){
      r++;
      i++;
      continue;
    }
    p += pow(0.5, r) * n;
  }
  return p;
}   

int main(void){
  int N, K;
  scanf("%d %d", &N, &K);
  printf("%.12f\n", P(N, K));
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()

const int N = 2e5 + 5;
const int mod = 1e9 + 7;

int n;
string s;
int arr[N];

int main()
{
  cin >> n;
  n *= 2;
  cin >> s;
  for(int i = 0 ; i < n ; i++)
    arr[i] = s[i] == 'B';
  int prv = 0, acc = 0;
  int ans = 1;
  for(int i = 0 ; i < n ; i++){
    int cur = arr[i] ^ acc;
    if(cur){ // must start
      // cout << "start" << endl;
      prv++;
      acc ^= 1;
    }else{ // must end
      // cout << "end" << endl;
      ans = (1LL * ans * prv) % mod;
      prv--;
      acc ^= 1;
    }
  }
  if(prv) cout << 0 << endl;
  else{
    for(int i = 2 ; i <= n / 2 ; i++)
      ans = (1LL * ans * i) % mod;
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 1412
#include <iostream>
#include <cmath>
#include <string>
#include <cstdlib>
#include <iomanip>
#include <stdio.h>

using namespace std;

int main(){

        int h,w;

        scanf("%d %d",&h,&w);

        cout << h*w << " " << h*2+w*2 << endl;

        return 0;
}


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

int main(int argc, char const *argv[]) {
    int k, a, b;
    cin >> k >> a >> b;

    int temp = k;
    bool ok = false;
    while (true) {
        if (temp < a) temp += k;
        else if (a <= temp && temp <= b) {
            ok = true;
            break;
        }else{
            break;
        }
    }

    if (ok) {
        cout << "OK" << endl;
    }else{
        cout << "NG" << endl;
    }
    return 0;
}


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

public class Main {
	public static void main (String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s;
		try{
			while((s=br.readLine())!=null){ //読み取る行がnullになるまで繰り返す
				//スペースの位置で2つに分ける
				String s1 = s.substring(0, s.indexOf(" "));
				String s2 = s.substring(s.indexOf(" ")+1);
				//分けた2つの文字列を整数に変換して足す
				int n = Integer.valueOf(s1) + Integer.valueOf(s2);
				//足した結果を文字列に変換して長さを測る
				int m = Integer.toString(n).length();

				System.out.println(m);

			}
		}catch(IOException e){
			e.printStackTrace();
		}
	}
}

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

int main() {
    double r,l,s;
    int k;
    
    cin>>r;
    l = 2 * r * M_PI;
    s = r * r * M_PI;

    
    std::cout << std::setprecision(20);

    cout<<s<<" "<<l<<endl;
	return 0;
}



Measured memory_bytes: 3280
INF = float('inf')

N = int(input())
hs = list(map(int, input().split())) + [INF]

dp = [INF] * (N+1)
dp[0] = 0
for i in range(N-1):
    dp[i+1] = min(dp[i+1], dp[i] + abs(hs[i] - hs[i+1]))
    dp[i+2] = min(dp[i+2], dp[i] + abs(hs[i] - hs[i+2]))

print(dp[N-1])


Measured memory_bytes: 13908
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stack>
using namespace std;


int main()
{
    int n ,x ,t;
    cin>>n>>x>>t;
    int cookies=0,time=0;
    while(1)
    {
        cookies+=x;
        time+=t;
        if(cookies>=n)
            break;
    }
    cout<<time;
    
}







Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = Integer.valueOf(scn.next().replaceAll("/", ""));
		if (20190430 < n) {
			System.out.println("TBD");
		} else {
			System.out.println("Heisei");
		}
		scn.close();
	}
}

Measured memory_bytes: 21972
#include<iostream>
#include<string>
#include<algorithm>
  
using namespace std;
  
int main(){
    int a,b,n,c;
    int d[10000];
    int sorts;
    int best,bests;
    cin>>n;
    cin>>a>>b;
    cin>>c;
    for(int i=0;i<n;i++){
        cin>>d[i];
    }
    for (int i=0;i<n;i++) { 
        for (int j=i+1; j<n; ++j) { 
          if (d[j] > d[i]) { 
            sorts =  d[j]; 
            d[j] = d[i]; 
            d[i] = sorts;
          } 
        } 
    }
    best=a/c;
    for(int i=0;i<n;i++){
        bests=(c+d[i])/(a+b+(b*i));
        c+=d[i];
        if(bests>best)
            best=bests;
        if(bests<=best)
            bests=best;
    }
    cout<<best<<endl;
    return 0;
}

Measured memory_bytes: 1168
import java.util.*;

public class Main {
    public static void main(String[] args) {
        int N;
        int[] A;
        Scanner in = new Scanner(System.in);
        N = in.nextInt();
        A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = in.nextInt();
        }
        long ans = solve(N, A);
        System.out.println(ans);
        in.close();
    }

    static long solve(int N, int[] A) {
        long ans = 0;
        Map<Long, Long> cnt = new HashMap<>();
        //(i, j]
        long[] S = new long[N + 1];
        S[0] = 0;
        cnt.putIfAbsent(S[0], 1L);
        S[1] = A[0];
        for (int i = 1; i <= N; i++) {
            S[i] = A[i - 1] + S[i - 1];
            cnt.putIfAbsent(S[i], 0L);
            cnt.put(S[i], cnt.get(S[i]) + 1);
        }
        for (Map.Entry<Long, Long> e : cnt.entrySet()) {
            long v = e.getValue();
            ans += (v * (v - 1)) / 2L;
        }
        return ans;
    }
}


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

typedef long long ll;
typedef pair<ll, ll> P;

const ll MOD = 1e9 + 7;
const ll inf = 1LL<<60;
const int int_inf = 100000000;
const double eps = 1e-9;

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
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()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<pair<int,int>> a(n);
    for (int i = 0; i < n; i++) {
        int tmp;
        cin >> tmp;
        a[i] = make_pair(tmp, i+1);
    }
    sort(a.begin(), a.end());
    for (int i = 0; i < n; i++) {
        cout << a[i].second << " ";
    }
    cout << endl;
    return 0;
}



Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define pii pair<int,int> 
#define pb push_back
#define INF INT_MAX 
#define mod 1000000007ll
#define fi first
#define se second
#define f(i,p,q) for(int i=p;i<q;i++)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define siii(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pi(a) printf("%d\n",a)
#define psi(a) printf(" %d",a)
#define poi(a) printf("%d",a)
#define sl(a) scanf("%lld",&a)
#define pl(a) printf("%lld\n",a)
#define Nline() printf("\n")
#define sstr(str) scanf("%s",str)
#define pstr(str) printf("%s\n",str)
#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define vi vector<int>
#define vvi vector<vi>
#define all(v) (v).begin(),(v).end()
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())
#define ios ios::sync_with_stdio(false); cin.tie(0);cout.tie(NULL);
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(X) ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X) ( (X) * (X) )
#define SZ(V) (int )V.size()
#define FORN(i, n) for(i = 0; i < n; i++)
#define FORAB(i, a, b) for(i = a; i <= b; i++)
#define ALL(V) V.begin(), V.end()
#define IN(A, B, C)  (B) <= (A) && (A) <= (C)
#define AIN(A, B, C) assert(IN(A, B, C))
void solve(){
       string s;
       string ss;
       cin>>s>>ss;
       int c=0;
       f(i,0,s.length()){
       	if(s[i]!=ss[i])c++;
       }
       cout<<c;
       
}
int main() {
    ios;
	int t=1;
	//cin>>t;
	while(t--)solve();
 
    
}


Measured memory_bytes: 3780
import static java.util.Arrays.sort;
import java.util.Scanner;

/**
 *
 * @author cs18097
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char[] str = s.toCharArray();
        sort(str);
        char a = 'a';
        for(int i = 0;i < str.length;i++){
            if(str[i] == a)a++;
            if(a-1 == 'z'){
                System.out.print("None");
                return;
            }
        }
        System.out.print(a);
    }
    
}


Measured memory_bytes: 25840
#include <bits/stdc++.h>
#define MOD 1e9 + 7
#define PI 3.141592653589793238
#define pb push_back
#define ALL(V) (V).begin(), (V).end()
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long long int lint;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<int> VI;
typedef pair<ll, ll> P;
ll gcd(ll a, ll b) { return (a % b == 0 ? b : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
ll char_to_ll(char c) { return (int)(c - '0'); }
ll string_to_ll(string s) { return char_to_ll(atoi(s.c_str())); }
bool is_prime(ll x){ if(x <= 1) return false; for(ll i = 2; sqrt(i) <= x; i++) if(x % i == 0) return false; return true; }


int main() {
    int a,b;
    cin >> a >> b;
    if(a*500 >= b){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
  

    return 0;
}



Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<sstream>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<random>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())


int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	long long a, b, c;
	cin >> a >> b >> c;
	int d;
	if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0)cout << 0 << endl;
	else {
		int d = max({ a,b,c });
		if (a == d) {
			cout << b*c << endl;
		}
		else if (b == d) {
			cout << a*c << endl;
		}
		else {
			cout << a*b << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds; 
using namespace std;
#define int long long
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define mii map<int,int>
#define mp make_pair
#define pb push_back
#define rep(i,b) for(ll (i)=0;i<(b);i++)
#define all(c) (c).begin(), (c).end()
#define F first
#define S second
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define DEBUG true
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
//typedef long long int ll;
typedef tree<int, null_type, less<int>, rb_tree_tag, 
tree_order_statistics_node_update> new_data_set; 
const int MAX=1e6+5;
#define MOD 1000000007
/*std::cout << std::fixed;
std::cout << std::setprecision(6);*/
//(a%mod-b%mod+mod)%mod

// #define LOCAL 1

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


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

vector<int>par,dep,tin,tout;
vector<vector<int>>v;
vector<int>deg;
vector<pll>req;
bool visited[MAX];


ll power(int a,int b){
    int ans=1;
    while(b>0){
        if(b&1)
            ans = (ans%MOD*a%MOD)%MOD;
        b = b>>1;
        a= (a%MOD*a%MOD)%MOD;
    }
    return ans;
}

void bfs(int s,vector<int>&d){
    d[s]=0;
    queue<int>q;
    q.push(s);
    while(!q.empty()){
        int u = q.front();
        q.pop();
        // visited[u]=true;
        for(auto it:v[u]){
            if(d[it]==-1){
                // cout<<it<<" ";
                d[it]=d[u]+1;
                q.push(it);
            }
        }
    }
}


void solve(){
    int t=1;
    // cin>>t;
    while(t--){
        int n,m;
        cin>>n>>m;
        int ans=0;
        if(n>1){
            int a = n*(n-1);
            a/=2;
            ans+=a;
        }
        int a = m*(m-1);
        a/=2;
        ans+=a;
        cout<<ans<<endl;

    }
}


signed main() 
{ 
    boost;

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // while (cin.peek() != EOF) {
    //     solve();
    //     cout << endl << endl;
    //     string s;
    //     do getline(cin, s);
    //     while (!cin.eof() && !s.empty());
    //     while (isspace(cin.peek())) cin.get();
    // }
    // #else
    //     solve();
    // #endif

    solve();


    

    
	return 0; 
} 

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

int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int main(){
	int N, X, res;
	cin >> N >> X;
	vector<int> x(N+1);
	vector<int> dif(N);

	for(int i=0; i<N; i++){
		cin >> x[i];
	}
	x[N] = X;
	sort(x.begin(), x.end());

	for(int i=0; i<N; i++){
		dif[i] = x[i+1] - x[i];
	}

	res = dif[0];
	for(int i=1; i<N; i++){
		res = gcd(res, dif[i]);
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <sstream>
#include <queue> 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm> 
#include <numeric>  
#include <functional>
#include <cassert>
#include <bitset>
#include <cctype>  
#include <iomanip> 
#include <limits>  
#include <regex>
// std::numeric_limits<int>::max(), min()
// std::setprecision(X)
// std::islower(), std::isupper(), std::tolower, std::toupper
// std::accumulate(m.begin(), m.end(), 0LL);
// std::sort(begin(),end()) // 0, 1, 2, 3 ,4 (default, less);
// std::priority_queue<int, vector<int>, less<int>> que; // 4, 3, 2, 1 (defualt, less) : 
// if ( std::regex_match(S, std::regex("(dream|dreamer|erase|eraser)*")) ) std::cout << "YES" << std::endl;

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

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; }
typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<std::vector<int>> vvi;

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


int main (void) {
  std::cin.tie(0);  std::ios::sync_with_stdio(false);
  ll N, P; std::cin >> N >> P;
  std::string S; std::cin >> S;
  ll ans = 0;
  if (P == 2 || P == 5) {
    rep(i, N) if( (S[i]-'0') % P == 0 ) ans += 1LL*(i+1);
  }
  else {
    std::vector<ll> dp(2e5+7);
    ll d = 1, x = 0;
    for(int i = N-1; i>=0; i--) {
      x += (S[i]-'0') * d;
      x %= P;
      d *= 10;
      d %= P;
      ans += dp[x];
      dp[x]++;
      if(x == 0) ans++;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}



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

using namespace std;

using i64 = long long int;
using ui64 = unsigned long long int;

////////

int main(){
    int i,j,k;
    while(cin >> i >> j >> k,i){
        vector<int> a(i);
        for(int l=0;l<i;l++){
            cin >> a[l];
        }
        sort(a.begin(),a.end(),greater<int>());
        int g = -1,s = -1;
        for(int l=j;l<=k;l++){
            if(s <= a[l-1] - a[l]){
                s = a[l-1] - a[l];
                g = l;
            }
        }
        cout << g << endl;
    }
}



Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define mod 1000000007
#define pb push_back
#define inf 1000000000000000000
#define ff first
#define ss second
void checkpoint1()
{
	/******think more code less******/
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif*/
}
int main()
{
	checkpoint1();
	ll n;
	cin>>n;
	map< string,ll > m;
	m["AC"]=0;
	m["RE"]=0;
	m["WA"]=0;
	m["TLE"]=0;
	for(ll i=0;i<n;i++)
	{
		string s;
		cin>>s;
		m[s]++;
	}
	cout<<"AC x "<<m["AC"]<<"\n";
	cout<<"WA x "<<m["WA"]<<"\n";
	cout<<"TLE x "<<m["TLE"]<<"\n";
	cout<<"RE x "<<m["RE"]<<"\n";
	return 0;
}

Measured memory_bytes: 3656