akhauriyash/Code-Regression huggingface dataset:
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
    n: usize,
    a: [i64; n]
    }
    let aa = a.iter().map(|x| x.abs()).collect::<Vec<_>>();
    let mut ans = aa.iter().sum::<i64>();
    if a.iter().filter(|&&x| x < 0).count() % 2 == 1 {
        ans -= 2 * aa.iter().min().unwrap()
    }
    println!("{}", ans);

}



Measured memory_bytes: 6396
// be name khoda
#include<bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define int long long
#define mpr make_pair 
typedef long long ll;
#pragma GCC optimize("Ofast")

const int maxn = 1e6+10;
const int mod = 998244353;
const int inf = 1e18+10;

int n;
int a[maxn];

signed main()
{
    //ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    cin>> n;
    int sm = 0, m = n*(n+1)/(2ll);
    for(int i = 1; i <= n; i++)
    {
        cin>> a[i];
        sm += a[i];
    }
    if(sm%m != 0) return cout<<"NO", 0;
    int k = sm/m;

    a[0] = a[n];
    for(int i = 1; i <= n; i++)
        if((((a[i]-a[i-1])%n+n)%n != k%n) || (a[i]-a[i-1]-k) > 0)
            return cout<<"NO", 0;
    cout<<"YES";
}




Measured memory_bytes: 1024
// Author : Mohamed Sameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
#define Flush fflush(stdout);
using namespace std ;
int n;
int a[100];
int ans =1e9 ;
void check (int cur )
{
    int tot =0 ;
    for (int i =0 ; i < n ;i++)
    {
        tot += (a[i] - cur)*(a[i] - cur);
    }
    ans = min (ans , tot );
}
int main()
{
    cin >> n ;
    for (int i =0 ; i < n ;i++)
        cin >> a[i];
    for (int i = 1 ; i <= 100 ;i++)
    {
        check(i);
    }
    cout << ans <<"\n";

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  string T;
  
  cin >> S >> T;
  
  long long s,t;
  s=S.size();
  t=T.size();
  
  
  int count=0;
  for(int i=0;i<s;i++){
    if(S.at(i)!=T.at(i)){
      count++;
    }
  }
  
  cout << count << endl;
  
}




Measured memory_bytes: 3928
#include <iostream>
#include <vector>

using namespace std;

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

inline int next(int d)
{
    return (d + 1) % 4;
}

int main()
{
    int dataset, n;

    cin >> dataset;
    for (int cnt = 0; cnt < dataset; ++cnt) {
        if (cnt != 0)
            cout << "\n";
        cin >> n;

        if (n == 1) {
            cout << "#\n";
            continue;
        }
        else if (n == 2) {
            cout << "##\n# \n";
            continue;
        }
        else if (n == 3) {
            cout << "###\n# #\n# #\n";
            continue;
        }

        vector<vector<bool> > map(n, vector<bool>(n, false));
        int d = 0, x = 0, y = n - 1;
        bool flag = true;

        while (flag) {
            map[y][x] = true;

            int nx = x + dx[d];
            int ny = y + dy[d];

            if (nx < 0 || nx >= n || ny < 0 || ny >= n) {
                d = next(d);
                x += dx[d];
                y += dy[d];
                continue;
            }

            for (int i = 0; i < 4; ++i) {
                if ((i + 2) % 4 == d)
                    continue;
                int nnx = nx + dx[i];
                int nny = ny + dy[i];

                if (nnx < 0 || nnx >= n || nny < 0 || nny >= n)
                    continue;
                if (map[nny][nnx]) {
                   d =  next(d);
                   break;
                }
            }
            x += dx[d];
            y += dy[d];

            for (int i = 0; i < 4; ++i) {
                if ((i + 2) % 4 == d)
                    continue;
                nx = x + dx[i];
                ny = y + dy[i];

                if (nx < 0 || nx >= n || ny < 0 || ny >= n)
                    continue;
                if (map[ny][nx]) {
                    flag = false;
                    break;
                }
            }
        }

        // Output
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                if (map[i][j])
                    cout << "#";
                else
                    cout << " ";
            }
            cout << "\n";
        }
    }

    return 0;
}

Measured memory_bytes: 1184
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int N,K;
string S;

vector<int> ze;

bool judge(int len){
  int res=N+1;
  for(int i=len-1;i<N;i++){
    int c=0;
    if(i>len-1&&S[i-(len-1)-1]=='0'&&S[i-(len-1)]=='0') c=1;
    res=min(res,ze[i+1]-ze[i-len+1]+c);
  }
  //cout<<len<<" "<<res<<endl;
  if(res<=K) return true;
  else return false;
}

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

  ze.resize(N+1,0);
  if(S[0]=='0') ze[1]=1;
  for(int i=1;i<N;i++){
    if(S[i]!=S[i-1]){
      if(S[i]=='0') ze[i+1]++;
    }
    ze[i+1]+=ze[i];
  }

  int ng=N+1,ok=1;
  while(ng-ok>1){
    int mid=(ok+ng)/2;
    if(judge(mid)) ok=mid;
    else ng=mid;
  }
  cout<<ok<<endl;

  return 0;
}


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

int main(){
    int a, b, h, m;
    cin >> a >> b >> h >> m;
    double pi = 3.141592653589793238;
    double hour[2], minute[2];
    minute[0] = b*cos(m * pi / 30.0);
    minute[1] = b*sin(m * pi / 30.0);
    hour[0] = a*cos(h * pi / 6.0 + m * pi / 360);
    hour[1] = a*sin(h * pi / 6.0 + m * pi / 360);
    double vec[2];
    vec[0] = hour[0] - minute[0];
    vec[1] = hour[1] - minute[1];
    double ans = pow(vec[0] * vec[0] + vec[1] * vec[1] , 0.5);
    cout << fixed<<setprecision(10) << ans <<endl;
    return 0;
}

Measured memory_bytes: 4228
#include<stdio.h>
int main()
{
	int i,j,a,b,c;
	for(c=1;;)
	{
		scanf("%d %d",&a,&b);
		if(a==0 && b==0)break;
		for(j=1;j<=a;j++)
		if(j%2==0)
	{
		for(i=1;i<=b;i++)
			{
				if(i%2==0)
					printf("#");
				else
					printf(".");
		}
			printf("\n");
		}
		else
		{
				for(i=1;i<=b;i++)
				{
				if(i%2==0)
					printf(".");
				else
					printf("#");
				}
					printf("\n");
		}	
			printf("\n");
	}
	return 0;
}



Measured memory_bytes: 2120
/*
 
 * This code is written by Sanskar Agarwal
 
*/
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define VPLL vector<PLL>
#define VPII vector<PII>
#define PQ priority_queue<PLL,VPLL, greater<PLL> > 
#define PQI priority_queue<PII,VPII,greater<PII> >
#define UMLL unordered_map<ll,ll>
#define UMII unordered_map<int,int>
#define VI vector<int>
#define VL vector<ll>
#define S second
#define F first
#define PB push_back


int main()
{


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

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

    return 0;
}

Measured memory_bytes: 3640
#include <vector>
#include <sstream>
#include <algorithm>
#include <fstream>
#include <list>
#include <map>
#include <istream>
#include <bitset>
#include <sstream>
#include <unordered_map>
#include <stack>
#include <set>
#include <cmath>
#include <random>
#include <iostream>
#include <bitset>
#include <iomanip>
#include <queue>
#include <string>

#define int long long
#define endl "\n"
#define all(x) x.begin(),x.end()
#define rr return 0
#define xx first
#define yy second
#define pii pair<int,int>

using namespace std;

typedef long long ll;
typedef long double ld;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, k, q;
    cin >> n >> k >> q;
    map<int, int> mp;
    int p = q;
    while(q--){
        int x;
        cin >> x;
        mp[x]++;
    }
    for(int i = 1;i <= n;i++){
        if((k + mp[i]) > p){
            cout << "Yes\n";
        }else{
            cout << "No\n";
        }
    }
    rr;
}


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

using namespace std;
using llong = long long;
using ldbl = long double;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e9)+7;
const llong mod = 1e9+7;

int main(){
	llong N, A, B;
	vector<llong> h;

	cin >> N >> A >> B;
	h.resize(N);
	llong maxi = 0;
	for(int i = 0; i < N; i++){
		cin >> h[i];
		maxi = max(maxi, h[i]);
	}

	llong ng = 0, ok = inf;
	while(abs(ng - ok) > 1){
		llong middle = (ng+ok+1)/2;
		llong ans = 0;
		for(int i = 0; i < N; i++){
			llong check = max(0ll, h[i] - B*middle);
			ans += check/(A-B) + (check%(A-B) ? 1 : 0);
		}
		// cerr << middle << " " << ans << endl;
		if(ans <= middle)
			ok = middle;
		else
			ng = middle;
	}

	cout << ok << endl;

	return 0;
}

Measured memory_bytes: 1024
def func(n):
    i = 1
    dst = ""

    def include3(x, i):
        local_dst = ""

        if x % 10 == 3:
            local_dst += " " + str(i)
        else:
            if x // 10:
                local_dst += include3(x // 10, i)

        return local_dst

    while i <= n:
        x = i
        if x % 3 == 0:
            dst += " " + str(i)
        else:
            dst += include3(x, i)
        i += 1

    return dst

print(func(int(input())))

Measured memory_bytes: 7676
A,B=map(int,input().split())
G=[[0]*100 for i in range(100)]
for i in range(50,100):
    G[i]=[1]*100
A-=1
B-=1
i=0
j=0
while(B):
    G[i][j]=1
    B-=1
    if j==98:
        j=0
        i+=2
    else:
        j+=2
i=51
j=0
while(A):
    G[i][j]=0
    A-=1
    if j==98:
        j=0
        i+=2
    else:
        j+=2
S=[]
print(100,100)
for i in range(100):
    s=""
    for j in range(100):
        if G[i][j]==0:
            s+="."
        else:
            s+="#"
    print(s)


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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            int sum=0;
            String s=br.readLine();
            if(s.equals("0")){
                break;
            }
            for (int c : s.toCharArray()) {
                sum+=c-48;
            }
            System.out.println(sum);

        }
    }
}

Measured memory_bytes: 24252
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define FOR(i,a,b) for (int i = a; i < b; i++)
#define F0R(i,a) for (int i = 0; i < a; i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i>=0; i--)
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(x) int((x).size())
#define f first
#define s second 
#define newl '\n'
#define mp make_pair


int main(){
   // ios::sync_with_stdio(0);
   // cin.tie(0);
   
    
	int a, b;
	char ch;
	cin >> a >> ch >> b;
	if (ch == '+') cout << a + b << newl;
	else cout << a - b << newl;
    
    
    
    return 0;
}


Measured memory_bytes: 256
#data????§???????[y???][x???]??§??????

if __name__ == "__main__":
    while 1:
        w,h = list(map(int,input().strip().split()))
        if w == h == 0:break
        data = []
        data = []
        for _ in range(h):data.append(list(input()))
        visited = []
        for i in range(h):
            if '@'in data[i]:stack= [(i,data[i].index('@'))]
        count = 0
        while len(stack) !=0:
            y,x= stack.pop()
            count +=1
            if y-1 >= 0 and not (y-1,x)in visited and data[y -1][x] == '.':
                visited.append((y-1,x))
                stack.append((y-1,x))
            if x -1 >= 0 and not (y,x-1)in visited and data[y][x-1] == '.':
                visited.append((y,x-1))
                stack.append((y,x-1))
            if y +1 < h and not (y+1,x)in visited and data[y +1][x] == '.':
                visited.append((y+1,x))
                stack.append((y+1,x))
            if x + 1 < w and not (y,x+1)in visited and data[y][x +1] == '.':
                visited.append((y,x+1))
                stack.append((y,x+1))

        print(count)

Measured memory_bytes: 7736
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

int main()
{
  string S;
  cin >> S;
  ll N = S.size();
  ll ans = 0;
  ll cnt = 0;
  for (ll i = 0; i < N; ++i) {
    if (S[i] == 'B') {
      ans += N - i - cnt - 1;
      cnt += 1;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<stdio.h>
#include<stdlib.h>
using namespace std;

#define MAX 2000000

int H, i, A[MAX+1];

void maxHeapify(int a){
    int l, r, largest;
    l = a*2;
    r = a*2 + 1;
    
    if(l <= H && A[l] > A[a]){largest = l;
    }else{largest = a;}
    if(r <= H && A[r] > A[largest]){largest = r;}
    
    if(largest != a){
        swap(A[a], A[largest]);
        maxHeapify(largest);
    }
}

int main(){
    
    cin >> H;
    for(i=1 ; i<=H ; i++){
        cin >> A[i];
    }
    
    for(i=H/2 ; i>=1 ; i--){
        maxHeapify(i);
    }
    
    for(i=1 ; i<=H ; i++){
        cout << " " << A[i];
    }
    cout << endl;
    
    return 0;
}


Measured memory_bytes: 5056
import java.util.ArrayList;
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 AtCoder = sc.next();
        String[] text = AtCoder.split("");
        int count = 0;
        int answer = 0;
        for (int i = 0; i < AtCoder.length(); i++) {
            if (text[i].equals("A") || text[i].equals("C") || text[i].equals("G") || text[i].equals("T")) {
                count++;
            } else {
                if (answer < count) {
                    answer = count;
                }
                count = 0;
            }
        }
        if (answer < count) {
                    answer = count;
                }

        System.out.print(answer);
    }

}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef double db;
typedef vector<ll> VI;
typedef vector<pair<ll,ll> > VII;
typedef map<ll,ll> mll;
typedef pair<ll,ll> pll;
//
#define M 1000000007
#define INF (ll)0x3f3f3f3f3f3f3f3f
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define itr iterator
#define GO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
void fileioe(){
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout); 
	freopen("error.txt","w",stderr);
}

void error_out() { cerr << endl; }
template <typename Head, typename... Tail>
void error_out(Head H, Tail... T) {
  cerr << " " << H;
  error_out(T...);
}
void time_elapsed(){
  cerr<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s\n";
}
#ifndef ONLINE_JUDGE
#define error(...) cerr << "[" << #__VA_ARGS__ << "]:", error_out(__VA_ARGS__)
#define fioe() fileioe()
#define time() time_elapsed()
#else
#define error(...) 1
#define fioe() 1
#define time() 1
#endif
ll dp[1002][10002];
ll ways(ll arr[][2],ll ind,ll size,ll h){
	if(ind==size){
		if(h<=0){
			return 0;
		}
		return INF;
	}
	if(h<=0){
		return 0;
	}
	ll &ans=dp[ind][h];
	if(ans>-1){
		return ans;
	}
	ll ans1=ways(arr,ind+1,size,h);
	ll ans2=ways(arr,ind,size,h-arr[ind][0])+arr[ind][1];
	ans=min(ans1,ans2);
	return ans;
}
//
int main()
{
	GO
	//fioe();
	ll h,n;
	cin>>h>>n;
	ll arr[n+2][2];
	for(ll i=0;i<n;i++){
		cin>>arr[i][0]>>arr[i][1];
	}
	memset(dp,-1,sizeof(dp));
	ll ans=ways(arr,0,n,h);
	cout<<ans<<endl;
	time();
	return 0;
}

Measured memory_bytes: 79488
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int N;
string S[50];
long C[50];
long dp[50][2][22];
main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>S[i]>>C[i];
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<=S[i].size();j++)dp[i][0][j]=dp[i][1][j]=9e18;
	}
	priority_queue<pair<long,pair<int,pair<int,int> > > >P;
	for(int i=0;i<N;i++)
	{
		dp[i][0][0]=C[i];
		P.push(make_pair(-C[i],make_pair(i,make_pair(0,0))));
		dp[i][1][S[i].size()]=C[i];
		P.push(make_pair(-C[i],make_pair(i,make_pair(1,S[i].size()))));
	}
	while(!P.empty())
	{
		long c=-P.top().first;
		int i=P.top().second.first,f=P.top().second.second.first,j=P.top().second.second.second;
		P.pop();
		int len=S[i].size();
		if(f==0)
		{
			bool ok=true;
			for(int k=0;k<len-j;k++)if(S[i][j+k]!=S[i][len-k-1])ok=false;
			if(ok)
			{
				cout<<c<<endl;
				return 0;
			}
			for(int k=0;k<N;k++)
			{
				int lenk=S[k].size();
				if(len-j>=lenk)
				{
					bool now=true;
					for(int l=0;l<lenk;l++)if(S[i][j+l]!=S[k][lenk-l-1])now=false;
					if(now)
					{
						long cost=c+C[k];
						if(dp[i][0][j+lenk]>cost)
						{
							dp[i][0][j+lenk]=cost;
							P.push(make_pair(-cost,make_pair(i,make_pair(0,j+lenk))));
						}
					}
				}
				else
				{
					bool now=true;
					for(int l=0;l<len-j;l++)if(S[i][j+l]!=S[k][lenk-l-1])now=false;
					if(now)
					{
						long cost=c+C[k];
						if(dp[k][1][lenk-(len-j)]>cost)
						{
							dp[k][1][lenk-(len-j)]=cost;
							P.push(make_pair(-cost,make_pair(k,make_pair(1,lenk-(len-j)))));
						}
					}
				}
			}
		}
		else
		{
			bool ok=true;
			for(int k=0;k<j;k++)if(S[i][k]!=S[i][j-k-1])ok=false;
			if(ok)
			{
				cout<<c<<endl;
				return 0;
			}
			for(int k=0;k<N;k++)
			{
				int lenk=S[k].size();
				if(j>=lenk)
				{
					bool now=true;
					for(int l=0;l<lenk;l++)if(S[i][j-l-1]!=S[k][l])now=false;
					if(now)
					{
						long cost=c+C[k];
						if(dp[i][1][j-lenk]>cost)
						{
							dp[i][1][j-lenk]=cost;
							P.push(make_pair(-cost,make_pair(i,make_pair(1,j-lenk))));
						}
					}
				}
				else
				{
					bool now=true;
					for(int l=0;l<j;l++)if(S[i][j-l-1]!=S[k][l])now=false;
					if(now)
					{
						long cost=c+C[k];
						if(dp[k][0][j]>cost)
						{
							dp[k][0][j]=cost;
							P.push(make_pair(-cost,make_pair(k,make_pair(0,j))));
						}
					}
				}
			}
		}
	}
	cout<<-1<<endl;
}


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

int a[100];
 
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
	}
	int najduza = a[0];
	for (int i = 0; i < n; ++i)
	{
		if (najduza < a[i])
		najduza = a[i];
	}
	int sum = 0;
	for (int i = 0; i < n; ++i)
	{
		sum = sum + a[i];
	}
	sum = sum - najduza;
	if (najduza < sum)
	cout << "Yes";
	else
	cout << "No";	
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		int n = sc.nextInt();
		int b = (int) Math.pow(100, d);
		int result = b * n;
		if(n % 100 == 0) result += b;
		System.out.println(result);
	}
}

Measured memory_bytes: 21844
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
#include <iomanip>  // std::setprecision()
using namespace std;
using ll = long long;
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define pai 3.14159265358979323846
ll gcd(ll a, ll b){if (a%b == 0)  return(b);else  return(gcd(b, a%b));}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
/* map<string,int> */
/* 大文字を小文字に変換 tolower*/
/* 小文字を大文字に変換 toupper*/
/* 辞書順 next_permutation(a.begin(),a.end()) */
 
int main() {
    string s;
    string t;
    cin >> s>>t;
    ll count =0;
    for(ll i =0 ; i < s.size();i++) {
        if (s[i] != t[i]) {
            count++;
        }
    }
    cout << count <<endl;
}

Measured memory_bytes: 3468
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a[110];
    memset(a,0,sizeof(a));
    int x,n;
    cin>>x>>n;
    int i;
    for(i=0; i<n; i++)
    {
        int p;
        cin>>p;
        a[p]=1;
    }
    if(n==0)
        cout<<x;
    else
    {
        for(i=0; i<110; i++)
        {
            if(x-i<0)
            {
                cout<<x-i;
                break;
            }
            else
            {
                if(a[x-i]==0)
                {
                    cout<<x-i;
                    break;
                }

                else if(a[x+i]==0)
                {
                    cout<<x+i;
                    break;
                }
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <set>
#include <string>

int main() {
    int n;
    std::cin >> n;
    std::set<std::string> str_set;
    for (auto i = 0; i < n; ++i) {
        std::string tmp;
        std::cin >> tmp;
        str_set.insert(tmp);
    }
    std::cout << ((str_set.size() == 3) ? "Three" : "Four") << std::endl;
    return 0;
}

Measured memory_bytes: 256
//ＧＯＥＭＯＮ＃Iridium今日 16:24
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,N,X;
  cin >> N >> A;
  for (int X=0; X<=N; X+=500)
  if(N-X<=A){
    cout << "Yes" <<endl;
    return 0;
  }
 	cout<<"No"<<endl;
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn main() {
	let (n, k): (usize, usize) = (read(), read());
	let mut hn = Vec::new();
	let mut temp: u64;
	for _ in 0..n {
		temp = read();
		hn.push(temp);
	}
	hn.sort();
	let mut sum: u64 = 0;
	let m = if n >= k { n-k } else { 0 };
	for i in &hn[0..m] {
		sum += *i;
	}
	println!("{}", sum);
}

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")
}



Measured memory_bytes: 6396
# AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

EPS = 1e-11

def dot(a, b):
	return a.real*b.real + a.imag*b.imag

def cross(a, b):
	return a.real*b.imag - a.imag*b.real
	
def norm(a):
	return a.real**2 + a.imag**2
	
def project(line, p):
	base = line[1]-line[0]
	r = dot(p-line[0], base) / norm(base)
	return line[0] + base*r
	
def symmetric_Point(line, p):
	return p + 2*(project(line, p)-p)

def isParallelLL(line1, line2):
	t = cross(line1[1]-line1[0], line2[1]-line2[0])
	return -EPS <= t and t <= EPS


for _ in range(int(input())):
	p = list(map(float, input().split()))
	p1 = complex(p[0], p[1])
	p2 = complex(p[2], p[3])
	p3 = complex(p[4], p[5])
	p4 = complex(p[6], p[7])
	print('YES' if isParallelLL([p1,p2], [p3,p4]) else 'NO')


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

int main (void) {
    int N;
    cin >> N;
    
    vector<pair<pair<string, int>, int>> eval(N);

    for (int i = 0; i < N; i++){
        string s;
        int p;
        cin >> s >> p;
        eval.at(i) = make_pair(make_pair(s, -p), i + 1);
    }
    
    sort(eval.begin(), eval.end());
    
    for (auto e : eval) {
        cout << e.second << endl;
    }
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <tuple>
#include <vector>

using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define INF (1e9)

int N, M;

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

    vvi A(M, vi(2, 0));
    for (int i = 0; i < M; i++) {
        cin >> A[i][0] >> A[i][1];
    }

    sort(A.begin(), A.end(), [](vi l, vi r) {
        if (l[1] == r[1])
            return l[0] < r[0];
        return l[1] < r[1];
    });

    int ans = 0;
    int lastBridge = -1;
    for (int i = 0; i < M; i++) {
        if (lastBridge < A[i][0]) {
            lastBridge = A[i][1] - 1;
            ans++;
        }
    }

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


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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long  ll; typedef vector<int> VI; typedef pair<int,int> pii; typedef vector<ll> VL; const int MD = 1e9 + 7;
void dbg(){cerr<<"\n";} template <class F,class ...S> void dbg(const F& f, const S&...s){cerr <<f <<": "; dbg(s...);}


int main()
{
	//cin.tie(0); ios_base::sync_with_stdio(false);
	ll a,b,c,d;
	cin >>a >>b >>c >>d;
	
	ll w1= b*d;
	ll w2= a*c;
	ll w3= a*d;
	ll w4= b*c;
	cout << max<ll>({w1, w2, w3, w4})<<"\n";
	
	return 0;
}



Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define int long long
#define ts cout<<"ok"<<endl
#define hh puts("")
#define pc putchar
#define mo 1000000007
using namespace std;
const int N=10000005;
int n,k,jc[N],ny[N];
inline int read(){
	int ret=0,ff=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-') ff=-1;ch=getchar();}
	while(isdigit(ch)){ret=ret*10+(ch^48);ch=getchar();}
	return ret*ff;
}
void write(int x){if(x<0){x=-x,pc('-');}if(x>9) write(x/10);pc(x%10+48);}
void writeln(int x){write(x),hh;}
int C(int x,int y){
	if(y>x||y<0) return 0;
	return jc[x]*ny[y]%mo*ny[x-y]%mo;
}
int ksm(int x,int y){
	int res=1;
	while(y){
		if(y&1) res=res*x%mo;
		y>>=1;
		x=x*x%mo;
	}
	return res;
}
signed main(){
	n=read(),k=read();
	jc[0]=1;
	for(int i=1;i<=n;i++) jc[i]=jc[i-1]*i%mo;
	ny[n]=ksm(jc[n],mo-2);
	for(int i=n-1;i>=0;i--) ny[i]=ny[i+1]*(i+1)%mo;  
	for(int i=1;i<=k;i++){
		if(n==k&&i==1) puts("1");
		else{
			int ans=C(k-1,i-1);
			ans=ans*((C(n-k-1,i-2)+C(n-k-1,i-1)*2+C(n-k-1,i))%mo)%mo;
			writeln(ans);
		}
	}
	return 0;
}

Measured memory_bytes: 2304
import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int m = sc.nextInt();
                m = sc.nextInt();
                int x = sc.nextInt();
                int[] a = new int[m];
                for(int i = 0 ; i < m ; i++){
                        a[i] = sc.nextInt();
                }
                sc.close();
                int yono = 0;
                int pct = 0;
                for(int i = 0 ; i < m ; i++){
                        if(a[i] < x){
                                yono++;
                        }else{
                                pct++;
                        }
                }
                System.out.println(Math.min(yono , pct));
        }
}
//nいらんやん

Measured memory_bytes: 35756
#include<stdio.h>
#define MAX 100
#define INFTYtw 1000000
#define WHITEtw 0
#define GRAYtw 1
#define BLACKtw 2

int n,Mtw[MAX][MAX];

void dijkstra(){
  int i,v,minv;
  int d[MAX],color[MAX];

  for(i=0;i<n;i++){
    d[i]=INFTYtw;
    color[i]=WHITEtw;
  }

  d[0]=0;
  color[0]=GRAYtw;
  while(1){
    minv=INFTYtw;
    int u=-1;
    for(i=0;i<n;i++){
      if(minv>d[i]&&color[i]!=BLACKtw){
	u=i;
	minv=d[i];
      }
    }
    if(u==-1)break;
    color[u]=BLACKtw;
    for(v=0;v<n;v++){
      if(color[v]!=BLACKtw&&Mtw[u][v]!=INFTYtw){
	if(d[v]>d[u]+Mtw[u][v]){
	  d[v]=d[u]+Mtw[u][v];
	  color[v]=GRAYtw;
	}
      }
    }
  }
  for(i=0;i<n;i++){
    printf("%d ",i);
    if(d[i]==INFTYtw)printf("-1\n");
    else printf("%d\n",d[i]);
  }
}

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

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      Mtw[i][j]=INFTYtw;
    }
  }

  int k,c,u,v;
  for(i=0;i<n;i++){
    scanf("%d %d",&u,&k);
    for(j=0;j<k;j++){
      scanf("%d %d",&v,&c);
      Mtw[u][v]=c;
    }
  }

  dijkstra();

  return 0;
}



Measured memory_bytes: 2112
const MOD: usize = 1e9 as usize + 7;

fn main() {
    let sc = std::io::stdin();
    let mut sc = Scanner { reader: sc.lock() };

    let n = sc.read();
    let k: usize = sc.read();

    let mut graph: Vec<Vec<usize>> = vec![vec![0; n]; n];
    for i in 0..n {
        for j in 0..n {
            graph[i][j] = sc.read();
        }
    }

    let mut k = k;
    let mut result = (0..n)
        .map(|i| (0..n).map(|j| if i == j { 1 } else { 0 }).collect())
        .collect();
    let mut cur = graph;
    while k > 0 {
        if (k & 1) != 0 {
            result = matrix_mul(&result, &cur);
        }
        cur = matrix_mul(&cur, &cur);
        k >>= 1;
    }

    let v = mul(vec![1; n], &result);
    let ans: usize = v.iter().sum();
    println!("{}", ans % MOD);
}

fn matrix_mul(m1: &Vec<Vec<usize>>, m2: &Vec<Vec<usize>>) -> Vec<Vec<usize>> {
    let n = m1.len();
    let mut result = vec![vec![0; n]; n];
    for i1 in 0..n {
        for i2 in 0..n {
            for k in 0..n {
                result[i1][i2] += m1[i1][k] * m2[k][i2];
                result[i1][i2] %= MOD;
            }
        }
    }
    result
}

fn mul(v: Vec<usize>, m: &Vec<Vec<usize>>) -> Vec<usize> {
    let n = v.len();
    let mut result = vec![0; n];
    for i in 0..n {
        for j in 0..n {
            result[j] += v[i] * m[i][j];
        }
    }
    result
}

pub struct Scanner<R> {
    reader: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 4352
#include <iostream>
  #include <math.h>
  using namespace std;
  int main() {
    int n;
    int k;
    cin >> n;
    cin >> k;
    int sum = 1;
    for(int i = 0; i < n; i++){
      if(k>pow(2,i)){
        sum = sum*2;
      }
      else{
        sum = sum +k;
      }
    }
    cout << sum << endl;

  }

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N=200005;
int n,m;
struct qq{int x,y;}s[N];
int ans=0;
bool cmp (qq x,qq y){return x.y<y.y;}
struct qt
{
	int l,r;
	int s1,s2;
	int c;
	int lzy;
}tr[N*2];int num;
void update (int now)
{
	int s1=tr[now].s1,s2=tr[now].s2;
	tr[now].c=max(tr[s1].c,tr[s2].c);
}
void bt(int l,int r)
{
	int a=++num;
	tr[a].l=l;tr[a].r=r;
	if (l==r)	{tr[a].c=l;return ;}
	int mid=(l+r)>>1;
	tr[a].s1=num+1;bt(l,mid);
	tr[a].s2=num+1;bt(mid+1,r);
	update(a);
}
void push_down (int now)
{
	int s1=tr[now].s1,s2=tr[now].s2;
	int lzy=tr[now].lzy;tr[now].lzy=0;
	tr[s1].lzy+=lzy;tr[s1].c+=lzy;
	tr[s2].lzy+=lzy;tr[s2].c+=lzy;
}
void change (int now,int l,int r,int x)
{
	if (l>r) return ;
	if (tr[now].l==l&&tr[now].r==r)
	{
		tr[now].lzy+=x;tr[now].c+=x;
		return ;
	}
	push_down (now);
	int s1=tr[now].s1,s2=tr[now].s2;
	int mid=(tr[now].l+tr[now].r)>>1;
	if (r<=mid) change(s1,l,r,x);
	else if (l>mid) change(s2,l,r,x);
	else change(s1,l,mid,x),change(s2,mid+1,r,x);
	update(now);
}
int main()
{
	scanf("%d%d",&n,&m);
	for (int u=1;u<=n;u++)	scanf("%d%d",&s[u].y,&s[u].x);
	sort(s+1,s+1+n,cmp);
	bt(0,m+1);
	int now=1;
	for (int u=0;u<=m;u++)
	{
		while (now<=n&&s[now].y<=u)
		{
			change(1,1,s[now].x,1);
			now++;
		}
		ans=max(ans,-m-u-1+tr[1].c);
	}
	printf("%d\n",max(ans,n-m));
	return 0;
}

Measured memory_bytes: 11136
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <queue>
#include <map>
using namespace std;
typedef long long LL;

LL prs[500005];
LL query(LL l,LL r){
	return prs[r] - prs[l - 1];
}

LL n,k,c;
LL pre[500005],ls[500005],lis[500005],lic = 0;
LL ans[500005],anc = 0;
string s;

int main(){
	ios::sync_with_stdio(false);
	cin >> n >> k >> c;
	cin >> s; s = ' ' + s;
	for(LL i = 1;i <= n;i ++){
		prs[i] = prs[i - 1] + (s[i] == 'o');
		pre[i] = (s[i] == 'o' ? i : pre[i - 1]);
		ls[i] = (i - c - 1 > 0 ? pre[i - c - 1] : 0);
	}
	LL tmp;
	for(LL i = n;i >= 1;i --){
		tmp = i;
		if(s[i] == 'o') break;
	}
	while(tmp){
		lis[++ lic] = tmp;
		tmp = ls[tmp];
	}
	sort(lis + 1,lis + 1 + lic); lis[0] = -c; lis[lic + 1] = n + c + 1;
//	for(LL i = 1;i <= lic;i ++) cout << lis[i] << (i == lic ? '\n' : ' ');
	if(lic == k){
		for(LL i = 1;i <= lic;i ++){
//			cout << lis[i] << ' ' << lis[i - 1] + c + 1 << ' ' << lis[i + 1] - c - 1 << endl;
			if(query(lis[i - 1] + c + 1,lis[i + 1] - c - 1) == 1) ans[++ anc] = lis[i];
			for(LL j = lis[i - 1] + c + 1;j <= lis[i];j ++){
				if(s[j] == 'o'){
					lis[i] = j;
					break;
				}
			}
		}
		for(LL i = 1;i <= anc;i ++) cout << ans[i] << '\n';
	}
//	for(LL i = 1;i <= lic;i ++) cout << lis[i] << (i == lic ? '\n' : ' ');
	return 0;
}

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

typedef long long int ll;
const int mod = 1e9+7;
const ll inf = 1e18;
const double pi = 3.1415926535897932384626;

void solve(){
	//code
	string s,t;
	cin>>s;
	cin>>t;
	int c=0;
	for(int i=0;i<s.length();i++){
		if(s[i]!=t[i])
			c++;
	}
	cout<<c;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	solve();
 	return 0;
}


Measured memory_bytes: 3796
#include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define LL long long int
using namespace std;
 
const int N = 2e5 + 5;
const int oo = 1e9;
 
int movex[4] = {-1, 1, 0, 0};
int movey[4] = {0, 0, -1, 1};
 
void solve() {
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> v(h);
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1--; y1--; x2--; y2--;
    for (auto &it : v) cin >> it;
    vector<vector<int>> reach(h, vector<int>(w, oo));
    queue<pair<int, int>> bfs;
    bfs.push({x1, y1});
    reach[x1][y1] = 0;
    while(!bfs.empty()) {
        auto now = bfs.front(); bfs.pop();
        int xx = now.first, yy = now.second;
        for (int move=0;move<4;++move) {
            for (int d=1;d<=k;++d) {
                int x = xx + movex[move] * d;
                int y = yy + movey[move] * d;
                if (x < 0 || x >= h || y < 0 || y >= w) break;
                if (v[x][y] != '.') break;
                if (reach[x][y] < reach[xx][yy] + 1) break;
 
                if (reach[x][y] > reach[xx][yy] + 1) {
                    bfs.push({x, y});
                    reach[x][y] = min(reach[xx][yy] + 1, reach[x][y]);
                }
            }
        }
    }
    int ans = reach[x2][y2];
    if (ans >= oo) ans = -1;
    cout << ans << '\n';
} 
int main() {
    FASTIO;
 //   int t = 1;
    // cin >> t;
     solve();
    return 0;
}

Measured memory_bytes: 12064
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	m := make(map[int]bool)
	for i := 1; i <= 9; i++ {
		for j := 1; j <= 9; j++ {
			m[i*j] = true
		}
	}

	if m[n] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();

		int count = 0;

		for(int i = 0; i <= A; i++) {
			for(int j = 0; j <= B; j++) {
				for(int k = 0; k <= C; k++) {
					int result = 0;
					result = 500 * i + 100 * j + 50 * k;

					if(result == X) {
						count++;
					}

				}
			}
		}

		System.out.println(count);

	}

}


Measured memory_bytes: 23636
#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr ll MOD = 1e9 + 7;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x, y;
    cin >> x >> y;
    int t = 0;
    int a[3] = {300000, 200000, 100000};
    if (x <= 3) {
        t += a[x - 1];
    }
    if (y <= 3) {
        t += a[y - 1];
    }
    if (x == 1 && y == 1) {
        t += 400000;
    }
    cout << t << endl;
}

Measured memory_bytes: 256
n = int(input())


buf = []
while True:
    # print(n)
    if n >= 26:
        tp = n%26
        if tp == 0:
            buf.append(tp)
            n = n // 26-1
            if n == 0:
                break
        else:
            buf.append(tp)
            n = n // 26

    else:
        buf.append(n)
        break
# print(buf)
buf.reverse()
# print(buf)

ans = ""
for b in buf:
    if b == 0:
        ans += chr(26 + 96)
    else:
        ans += chr(b+96)
print(ans)


Measured memory_bytes: 61876
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int sum = 0;
    int K; cin >> K;
    REP(i, 1, K) {
        REP(j, 1, K) {
            REP(k, 1, K) {
                sum += gcd(gcd(i, j), k);
            }
        }
    }
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using i64 = long long;

struct Edge {
    int from, to;
    i64 cost;
    Edge(int f, int t, i64 c) : from(f), to(t), cost(c) {}
};

std::vector<std::vector<std::pair<int, i64>>> g;
std::vector<int> done;
std::vector<Edge> edges;

void dfs(int v) {
    done[v] = 1;
    for (auto to : g[v]) {
        edges.emplace_back(to.first, v, to.second);
        if (done[to.first]) continue;
        dfs(to.first);
    }
}

int main() {
    constexpr i64 inf = std::numeric_limits<i64>::max();
    int n, m;
    i64 p;
    std::cin >> n >> m >> p;
    g.resize(n); done.resize(n);
    for (int i = 0; i < m; i++) {
        int a, b;
        i64 c;
        std::cin >> a >> b >> c;
        --a; --b;
        g[b].emplace_back(a, p - c);
    }

    dfs(n - 1);

    std::vector<i64> dist(n, inf);
    dist[0] = 0;
    for (int i = 0; i < n - 1; i++) {
        for (auto &e : edges) {
            if (dist[e.from] == inf) continue;
            dist[e.to] = std::min(dist[e.to], dist[e.from] + e.cost);
        }
    }

    for (auto &e : edges) {
        if (dist[e.from] == inf) continue;
        if (dist[e.from] + e.cost < dist[e.to]) {
            std::cout << -1 << std::endl;
            return 0;
        }
    }

    std::cout << std::max(-dist.back(), 0ll) << std::endl;

    return 0;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 9223372036854775807;
const ll MOD = 1000000007;
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define o0(a) cout<<a<<" "
#define o1(a) cout<<a<<"\n"
#define o2(a, b) cout<<a<<" "<<b<<"\n"
#define o3(a, b, c) cout<<a<<" "<<b<<" "<<c<<"\n"
#define i1(a) cin>>a
#define i2(a, b) cin>>a>>b
#define i3(a, b, c) cin>>a>>b>>c
#define fi first
#define se second

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

ll inverse(ll a, ll z = MOD)
{
	return power(a, z-2, z);
}

ll gcd(ll a, ll b)
{
	ll temp;
	if(a < b)
	{
		temp = a;
		a = b;
		b = temp;
	}
	while(b)
	{
		temp = b;
		b = a - b;
		a = temp;
	}
	return a;
}

ll extend(ll a, ll b, ll &x, ll &y)
{
	if(b == 0)
	{
		x = 1;
		y = 0;
		return a;
	}
	ll x1, y1;
	ll g = extend(b, a%b, x1, y1);
	x = y1;
	y = x1- (a/b)*y1;
	return g;
}

ll mat_power(ll a, ll b, ll c, ll d, ll n, ll z = MOD)
{
	ll a0 = 1, b0 = 0, c0 = 0, d0 = 1;
	while(n)
	{
		if(n&1)
		{
			ll a1 = a0, b1 = b0, c1 = c0, d1 = d0;
			a0 = (a1*a + b1*c)%z;
			b0 = (a1*b + b1*d)%z;
			c0 = (c1*a + d1*c)%z;
			d0 = (c1*b + d1*d)%z;
		}
		ll a1 = a, b1 = b, c1 = c, d1 = d;
		a = (a1*a1 + b1*c1)%z;
		b = (a1*b1 + b1*d1)%z;
		c = (c1*a1 + d1*c1)%z;
		d = (c1*b1 + d1*d1)%z;
		n = n>>1;
	}
	return c0;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t = 1;
	// i1(t);
	while(t--)
	{
		char s;
		cin>>s;
		if(s >= 'a' && s <= 'z')
			o1('a');
		else
			o1('A');
	}
	return 0;
}

Measured memory_bytes: 3584
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <functional>

int main()
{
    long A,B,C;
    std::vector<long> D;
    std::cin >> A >> B >> C;
    D.push_back(A);
    D.push_back(B);
    D.push_back(C);
    std::sort(D.begin(),D.end());
    if(D[0]%2==0 || D[1]%2==0 || D[2]%2==0){
        std::cout << 0 << std::endl;
    }else{
        std::cout << D[0]*D[1] << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

  /**
   * @param args
   */
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());

    int[] a = new int[n];
    for (int i = 0; i < n; i++) {
      a[i] = Integer.parseInt(sc.next());
    }

    int[] b = new int[n];
    for (int i = 0; i < n; i++) {
      b[i] = Integer.parseInt(sc.next());
    }

    int[] c = new int[n - 1];
    for (int i = 0; i < n - 1; i++) {
      c[i] = Integer.parseInt(sc.next());
    }
    
    int score = 0;
    for (int i = 0; i < n; i++) {
      score += b[a[i] - 1];
      if(i > 0) {
        if (a[i] - a[i - 1] == 1) {
          score += c[a[i - 1] - 1];
        }
      }
    }
    
    System.out.println(score);
  }

}


Measured memory_bytes: 23380
#include<set>
#include <unordered_set>
#include <unordered_map>
#include<map>
#include<list>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<sstream>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<numeric>
#include<utility>
#include<functional>
#include<stdio.h>
#include<assert.h>
#include<memory.h>
#include<bitset>
#include<math.h>
#include <string.h>
#include <strings.h>


#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lp(i,a,n) for(int i=(a);i<=(int)(n);++i)
#define lpd(i,a,n) for(int i=(a);i>=(int)(n);--i)
#define clr(a,b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define println(a) cout <<(a) <<endl
#define sz(x) ((int)(x).size())
#define readi(x) scanf("%d",&x)
#define read2i(x,y) scanf("%d%d",&x,&y)
#define read3i(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define readll(x) scanf("%I64d",&x)
#define mod 1000000007
#define eps 1e-10
#define infi  1000000000ll
#define infll 1000000000000000000ll


using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef set<int> si;
typedef unordered_set<int> usi;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef unordered_map<ll,ll> umll;


const int N = 200003;
int n,a[N];
vi pos[N];
ll fact[N],revFact[N];

ll power(ll b,ll p) {
    if(!p) return 1;
    ll ret = power(b, p>>1);
    return ret*ret%mod*(p&1?b:1)%mod;
}

inline void initFact() {
    fact[0] = fact[1] = revFact[0] = revFact[1] = 1;
    lp(i, 2, N-2) fact[i] = fact[i-1]*i%mod,revFact[i] = power(fact[i], mod-2);
}

ll nCk(int n,int k) {
    if(!k || n == k) return 1;
    if(!n || k > n) return 0;
    return fact[n]*revFact[k]%mod*revFact[n-k]%mod;
}
int main(){
    scanf("%d",&n);
    initFact();
    lp(i, 1, n+1) scanf("%d",&a[i]),pos[a[i]].pb(i);
    int repVar = -1;
    lp(i, 1, n) if(sz(pos[i]) == 2) repVar = i;

    int x = pos[repVar][0]-1 , y = n+1-pos[repVar][1];
    lp(i, 1, n+1) {
        
        printf("%lld\n",(nCk(n+1,i)-nCk(x+y,i-1)+mod)%mod);
    }
    
    return 0;
}



/*
 */

//ios::sync_with_stdio(0);cin.tie(0);

Measured memory_bytes: 12544
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <bits/stdc++.h>
using namespace std;

class AStrings {
 public:
  void solve(std::istream &in, std::ostream &out) {
    string s1, s2;
    in >> s1 >> s2;
    out << s2 << s1 << endl;
  }
};

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  AStrings solver;
  std::istream &in(std::cin);
  std::ostream &out(std::cout);
  solver.solve(in, out);
  return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define vec(s) vector

#define vvec(s) vector<vector
>
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
#define out(s) cout<<s<<endl;
#define Reverse(x) reverse(all(x));
#define Sort(x) sort(all(x));
#define pb(s) push_back(s);
#define sp " " 
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(),s.end()
void vout(vi v){
    for(lli i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    cout << std::fixed << std::setprecision(10);
    lli d,t,s;
    cin>>d>>t>>s;
    if(d%s!=0){
        d = d / s;
        d +=1;
    }
    else{
        d = d / s;
    }
    Yes(d <= t);
}

Measured memory_bytes: 3580
#define PI 3.14159265358979323846
 
#include <cmath>
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
    long double a, b, h, m;
    cin >> a >> b >> h >> m;
    //find deg of angle
    long double hdeg=h*30;
    long double mdeg=m*6;
    hdeg+=mdeg/12;
    long double deg=abs(hdeg-mdeg);
    //apply law of cosines
    long double cosdeg = cos(deg * PI/180);
    long double asq=a*a;
    long double bsq=b*b;
    a = a;
    b = b;
    cosdeg = cosdeg;
    long double c = sqrt(asq+bsq-2*a*b*cosdeg);
    cout << fixed << showpoint;
    cout << setprecision(20);
    cout << c << endl;
    return 0;
}


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

int main()
{
  int a,i,ans_number;
  long long ans_time;
  ans_time=0;
  
  string ans_name;
  cin >> a;
  ans_number=a;
  
  string s_name[a];
  int s_time[a];
  
  for(i=0;i<a;i++)
  {
    cin >>s_name[i];
    cin >>s_time[i];
  }
  cin >> ans_name;
  for (i=0;i<a;i++)
  {
    if(equal(s_name[i].begin(), s_name[i].end(), ans_name.begin()))
    {
      ans_number=i+1;
      break;
    }
  }
  for(i=ans_number;i<a;i++)
  {
    ans_time=ans_time+s_time[i];
  }
    
  cout << ans_time <<endl;
  
}

Measured memory_bytes: 256