akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
// マクロ
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
// 型エイリアス
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;

int main() {
    int n;
    cin >> n;
    vi a(n);
    rep(i,n) cin >> a[i];
    int nxt = 1, ans = 0;
    rep(i,n) {
        if(a[i] == nxt) nxt++;
        else ans++;
    }
    if(ans == n) cout << -1 << endl;
    else cout << ans << endl;
}

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int s;cin>>s;
    if(s==1||s==2||s==4){
        cout<<4<<endl;
        return 0;
    }
    int i = 2;
    for(; s!=1; i++) s=(s%2)?(3*s+1):(s/2);
    cout<<i<<endl;
    return 0;
}

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

#define ll long long

using namespace std;

int x,y,s;

int main(){
    while(1){
        scanf("%d %d %d",&x,&y,&s);
        if(x==0 && y==0 && s == 0) break;

        int p = 100 * s /(100+x);
        int max=0;
        for(int i=1;i<=(s+1)/2;i++){
            for(int j= p-i;j < s; j++){
                 int x1 = i *(100 + x)/100;
                 int x2 = j *(100 + x)/100;
                 if(x1 + x2 == s){
                     int sum = i *(100 + y)/100 + j *(100 + y)/100;
                     if(max < sum) max = sum;
                 }
            }
        }

        printf("%d\n",max);
    }

}


Measured memory_bytes: 3108
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,k,ans=0;
    cin>>n>>k;
    long long int ar[n];
    for(int i=0;i<n;i++)
        cin>>ar[i];
    sort(ar,ar+n);
    if(k>=n) cout<<0<<endl;
    else{
        for(int i=0;i<n-k;i++ )
            ans+=ar[i];
        cout<<ans<<endl;
    }
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0;i<((ll)(n));i++)
#define reg(i,a,b) for(ll i = ((ll)(a));i<=((ll)(b));i++)
#define irep(i,n) for(ll i = ((ll)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(ll i = ((ll)(b));i>=((ll)(a));i--)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

/*
*/

ll n,L,x[100010],d[100010][18],Q;

void init(){
	cin>>n;
	rep(i,n)cin>>x[i];
	cin>>L>>Q;
}

int main(void){
	init();
	// sparce tableの構築
	int curpos=0;  // 今の位置
	rep(i,n){  // 尺取り法でやる
		while(x[curpos+1]-x[i]<=L && curpos+1<n)curpos++;
		d[i][0]=curpos;
	}
	reg(j,1,17)rep(i,n)d[i][j] = d[d[i][j-1]][j-1];
	// rep(i,n){
	// 	cerr<<i<<": ";
	// 	reg(j,0,17)cerr<<d[i][j]<<" ";
	// 	cerr<<endl;
	// }
	// query処理
	rep(i,Q){
		ll a,b,ans=0;
		cin>>a>>b;
		a--;
		b--;
		if(a>b)swap(a,b);
		int cpos=a;  // 今の位置
		irep(j,18){
			if(cpos>=b)break;
			if(d[cpos][j]<b){
				cpos = d[cpos][j];
				ans += 1<<j;
			}
			if(j==0 && cpos<b){
				cpos = d[cpos][0];
				ans++;
			}
		}
		if(cpos<b)cerr<<"ダメ"<<endl;
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 15616
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int h = in.nextInt();
		int w = in.nextInt();
		char[][] map = new char[h][w];
		int[][] hmap = new int[h][w]; // 横方向
		int[][] vmap = new int[h][w]; // 縦方向

		for ( int i = 0; i < h; i++ ) {
			map[i] = in.next().toCharArray();
		}
		in.close();

		int cnt = 0;
		// 横の処理
		for ( int r = 0; r < h; r++ ) {
			cnt = 0;
			for ( int c = 0; c < w; c++ ) {
				if ( map[r][c] == '.' ) {
					cnt++;
					hmap[r][c] += cnt;
				} else if ( map[r][c] == '#' ) {
					cnt = 0;
				}
			}

			for ( int c = w - 2; 0 <= c; c-- ) {
				if ( map[r][c] == '#' ) {
					continue;
				} else if ( map[r][c + 1] == '.' ) {
					hmap[r][c] = hmap[r][c + 1];

				}
			}
		}

		// 縦の処理
		for ( int c = 0; c < w; c++ ) {
			cnt = 0;
			for ( int r = 0; r < h; r++ ) {
				if ( map[r][c] == '.' ) {
					cnt++;
					vmap[r][c] = cnt;
				} else if ( map[r][c] == '#' ) {
					cnt = 0;
				}
			}

			for ( int r = h - 2; 0 <= r; r-- ) {
				if ( map[r][c] == '#' ) {
					continue;
				} else if ( map[r + 1][c] == '.' ) {
					vmap[r][c] = vmap[r + 1][c];
				}
			}
		}
		
		int ans = 0;
		for ( int r = 0; r < h; r++ ) {
			for ( int c = 0; c < w; c++ ) {
				ans = Math.max(ans, hmap[r][c] + vmap[r][c] - 1);
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 116308
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

int R, C;

int count_senbei(vector<int> &senbei) {
	int res = 0;
	for(int i = 0; i < C; ++i) {	
		int cnt = __builtin_popcount(senbei[i]);
		res += max(cnt, R - cnt);
	}
	return res;
}

int main() {
	while(cin >> R >> C && R) {
		vector<int> init_senbei(C, 0);
		int tmp = 0;	
		for(int i = 0; i < R; ++i) {
			for(int j = 0; j < C; ++j) {
				cin >> tmp;
				init_senbei[j] |= tmp * (1<<i);
			}	
		}
		int ans = 0;	
		vector<int> senbei = init_senbei;
		for(int bit = 0; bit < (1<<R); ++bit) {
			senbei = init_senbei;
			for(int x = 0; x < C; ++x) {
				senbei[x] = bit ^ init_senbei[x];
			}	
			ans = max(ans, count_senbei(senbei));
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1296
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N = int(input())
vv = inpl()

cnt1 = defaultdict(int)
cnt2 = defaultdict(int)
ed1 = []
ed2 = []

for i in range(N):
    v = vv[i]
    if i%2 == 0:
        if cnt1[v] == 0:
            ed1.append(v)
        cnt1[v] += 1
    else:
        if cnt2[v] == 0:
            ed2.append(v)
        cnt2[v] += 1

n1 = n2 = 0
cnts1 = []
cnts2 = []
for e in ed1:
    cnts1.append([cnt1[e],e])
for e in ed2:
    cnts2.append([cnt2[e],e])

cnts1.sort(reverse=True)
cnts2.sort(reverse=True)
cnts1.append([0,0])
cnts2.append([0,0])

if cnts1[0][1] != cnts2[0][1]:
    print(N-cnts1[0][0]-cnts2[0][0])
else:
    ans1 = cnts1[1][0] + cnts2[0][0]
    ans2 = cnts1[0][0] + cnts2[1][0]
    print(N-max(ans1,ans2))


Measured memory_bytes: 25432
#include<bits/stdc++.h>
#include<ctype.h>
# define pb push_back
#define fst first
#define sec second
#define For(i,a,b) for(int i=a;i<b;i++)
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
#define fo(i,n) for(ll i=0;i<n;i++)
#define endl "\n"
#define rev(i,n) for(ll i=n-1;i>=0;i--)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define boolsize 1000001
#define pi pair<ll,ll>
#define vi vector<ll>
#define vii vector<pi>
using namespace std;
template<typename T>
void showvector(vector <T> v)
{
    for(T x:v)
        cout<<x<<" ";
    cout<<endl;

}
template<typename T>
void showvector1(vector <T> v)
{
    ll n=v.size();
    fo1(i,n-1)
        cout<<v[i]<<endl;

}
template<typename T>
void showset(set <T> s)
{
    for(T x: s)
        cout<<x<<" ";
    cout<<endl;
}
template<class T>
void showvectorpair(vector<T> v)
{
    for(auto it=v.begin();it!=v.end();it++)
        cout<<it->first<<" "<<it->second<<endl;
    cout<<endl;
}
template<typename T,typename P>
void showmap(map <T,P> m)
{
    for(auto it=m.begin();it!=m.end();it++)
        cout<<it->first<<" "<<it->second<<endl;
    cout<<endl;
}
template<typename T>
bool comp(T a,T b)
{
    return (a>b);
}
template<class T>
bool comppair(T a,T b)
{
    if(a.first==b.first)
        return(a.second>b.second);
    return (a.first>b.first);
}
bool sameparity(ll a,ll b)
{
    return (a%2==b%2);
}
bool difparity(ll a,ll b)
{
    return !(a%2==b%2);
}
bool isprime(ll x)
{   if(x<=1)
     return false;
    for(ll i=2;i<=sqrt(x);i++)
    {
        if(x%i==0)
            return false;
    }
    return true;
}
bool iseven(ll x)
{
    return !(x%2);
}
bool isodd(ll x)
{
    return (x%2);
}
//vector <bool> prime(boolsize,1);
//void seive()
//{
//    ll n=boolsize;
//    prime[0]=prime[1]=0;
//    for(ll i=2;i<=sqrt(boolsize);i++)
//    {
//        if(prime[i]==1)
//        {
//            for(ll j=i*i;j<=n;j+=i)
//            {
//                prime[j]=0;
//            }
//        }
//    }
//}

/// check for test case before submitting
void vfun()
{
 string s,a,b;
 cin>>s;
 if(s.size()%2)
    s.pop_back();
 else
 {
     s.pop_back();s.pop_back();
 }
 while(!s.empty())
 {
     ll k=s.size()/2;
     a.assign(s.begin(),s.begin()+k);
     b.assign(s.begin()+k,s.end());
     if(a==b)
        break;
     s.pop_back();
     s.pop_back();
 }
 cout<<2*a.size();

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0); ///cant use scanf, printf
    cin.tie(0);cout.tie(0); /// no longer auto flush cout before each cin, remove for interactive
    //cout << fixed << setprecision(11); /// no scientific output
    ll test=1;
    //cin>>test;
    while(test--)
    {

        //fun();
        vfun();
//         if(vfun())
//            cout<<"YES\n";
//         else
//            cout<<"NO\n";
    }
}
///before sub
/// check for value of zero and single input in array
///loop vars,1LL in mult, equal, one, bounds, int v ll, endl, finish taking inputs
/// check whether test cases are given or not




Measured memory_bytes: 3632
import copy

while True:
    n = input()
    if n == 0: break
    L = []
    for i in range(n):
        f, w, s = raw_input().split()
        L.append([f, int(w), int(s)])
    else:
        L = sorted(L, key=lambda x: int(x[1]), reverse=True)
    
    ans = []
    while len(L) != 1:
        for i in range(len(L)):
            _L = copy.deepcopy(L)
            f = _L[i][0]
            s = _L[i][2]
            del _L[i]
            t = sum([_L[o][1] for o in range(len(_L))])
            if t <= s:
                ans.append(f)
                del L[i]
                break
    else:
        ans.append(L[0][0])
        for line in ans:
            print line

Measured memory_bytes: 4276
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

int prev[100001];
int rank[100001];
int size[100001];

void init(int n){
	for(int i=1; i<=n; i++){ prev[i]=i; rank[i]=1; size[i]=1; }
}
int root(int x){
	return prev[x]==x?x:(prev[x]=root(prev[x]));
}
long join(int x, int y){
	x=root(x), y=root(y);
	if(x==y) return 0;
	long ans = (long)size[x]*size[y];
	if(rank[x]<rank[y]){
		prev[x]=y;
		size[y]+=size[x];
	}else if(rank[x]>rank[y]){
		prev[y]=x;
		size[x]+=size[y];
	}else{
		prev[x]=y;
		rank[y]++;
		size[y]+=size[x];
	}
	return ans;
}

int32_t nextint(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); bool s=false; if(c=='-'){s=true;c=getchar_unlocked();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); int s=0; if(c=='-'){s=1;c=getchar_unlocked();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
void printlong(int64_t x){ if(x<0){x=-x; putchar_unlocked('-');}else if(x==0){putchar_unlocked('0');} int d=0; char s[20]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar_unlocked(s[i]); putchar_unlocked('\n'); }

int a[100000][2];
long b[100000];
int main(void){
	int n=nextint();
	int m=nextint();
	for(int i=m-1; i>=0; --i){
		a[i][0]=nextint();
		a[i][1]=nextint();
	}
	init(n);
	for(int i=0; i<m; i++){
		b[i]=join(a[i][0], a[i][1]);
	}
	long ans=0;
	for(int i=m-1; i>=0; --i){
		ans+=b[i];
		printlong(ans);
	}
}


Measured memory_bytes: 3968
#include<bits/stdc++.h>
using namespace std;
int main(){
    int k;
    cin>>k;
    string s;
    cin>>s;
    if(k>=s.length())
        cout<<s<<endl;
    else{
        for(int i=0;i<k;i++){
            cout<<s[i];
        }
        cout<<"..."<<endl;
    }
    
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define pi pair<int, int>
#define x first
#define y second
using namespace std;

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

int n, a[N], is[N][N], h[N][N];
long long ans = 0;

bool check(int x, int y) {
    return (x >  0 && y > 0 && x <= n && y <= n);
}

void calc_h() {
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            h[i][j] = min(min(i - 1, n - i), min(j - 1, n - j));
}

void relax(int x, int y) {
    is[x][y] = 0;
    queue<pi> q;
    q.push({x, y});
    while (!q.empty()) {
        int x = q.front().x, y = q.front().y;
        q.pop();
        for (int d = 0; d < 4; d++) {
            int ax = x + dx[d], ay = y + dy[d];
            if (check(ax, ay) && h[ax][ay] > h[x][y] + is[x][y]) {
                h[ax][ay] = h[x][y] + is[x][y];
                q.push({ax, ay});
            }
        }
    }
}

int main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            is[i][j] = 1;
    calc_h();
    for (int i = 1; i <= n * n; i++) {
        int pos;
        cin >> pos;
        int x = pos / n + 1, y = pos % n;
        if (pos % n == 0)
            x--, y = n;
        //cout << h[x][y] << ' ' << h[3][1] << ' ' << h[3][2] << endl;
        ans += h[x][y];
        relax(x, y);
    }
    cout << ans;
    return 0;
}


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

#define int long long
#define all(x) x.begin(), x.end()
#define rev(x) x.rbegin(), x.rend()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define endl '\n'
#define pi 3.141592653589793238
#define mp make_pair
#define pb push_back
#define precise cout<<fixed<<setprecision(20)
#define ff first
#define ss second
#define T int t;cin>>t;rep(mmm,0,t)
#define uniq(v) v.resize(distance(v.begin(),unique(all(v))))

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

const int N=100001;
int mod=1000000007;
//mod=998244353;

int min(int a,int b){if(a<b) return a; else return b;}
int max(int a,int b){if(a>b) return a; else return b;}
int power(int a,int b){int res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int gcd(int p, int q){if(p%q==0) return q; else{return gcd(q,p%q);}} 
int mul(int a,int b){return ((a%mod)*(b%mod))%mod;}
int sub(int a,int b){return (((a-b)%mod)+mod)%mod;}

void solve()
{
	int n;
	cin>>n;
	int no9=power(9,n);
	int no09=power(8,n);
	int p=no9+sub(no9,no09);
	p%=mod;
	int ans=sub(power(10,n),p);
	cout<<ans<<endl;
}

signed main()
{
    ios::sync_with_stdio(0); 
    cin.tie(0);cout.tie(0);
     solve();
    return 0;
}

Measured memory_bytes: 3620
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main()
{
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  if (a+b+c<=21) {
    printf("win\n");
  } else {
    printf("bust\n");
  }
  return 0;
}


Measured memory_bytes: 128
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from random import *

s = input()
m = {}
for ch in s:
    m.update({ch:1})
res = (m.get('N') == m.get('S')) and m.get('W') == m.get('E')
if res:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 4848
#include <iostream>
#include <stdio.h>

using namespace std;

#define INFTY 2000000000
#define MAX 100000

struct Card {
    char suit;
    int value;
};

Card L[MAX/2 + 2], R[MAX/2 + 2];

int partition(Card A[], int p, int r){
    int j, i;
    Card x, t;
    x = A[r];
    i = p - 1;
    for(j = p; j < r; j++){
        if(A[j].value <= x.value){
            i++;
            t = A[i];
            A[i] = A[j];
            A[j] = t;
        }
    }
    t = A[i+1];
    A[i+1] = A[r];
    A[r] = t;
    return i + 1;
}
void merge(Card A[], int left, int mid, int right){
    int n1 = mid - left, n2 = right - mid;
    
    for(int i = 0; i < n1; i++){
        L[i] = A[left + i];
    }
    for(int i = 0; i < n2; i++){
        R[i] = A[mid + i];
    }
    L[n1].value = INFTY;
    R[n2].value = INFTY;
    int i = 0;
    int j = 0;
    for(int K = left; K < right; K++){
        if(L[i].value <= R[j].value){
            A[K] = L[i];
            i++;
        }
        else{
            A[K] = R[j];
            j++;
        }
    }
}
void mergeSort(Card A[], int left, int right){
    int mid;
    if(left + 1 < right){
        mid = (left + right)/2;
        mergeSort(A, left, mid);
        mergeSort(A, mid, right);
        merge(A, left, mid, right);
    }
}
void quicksort(Card A[], int p, int r){
    int q;
    if(p < r){
        q = partition(A, p, r);
        quicksort(A, p, q-1);
        quicksort(A, q+1, r);
    }
}

int main(void){
    // Your code her
    int n, v;
    Card A[MAX], B[MAX];
    char S[10];
    int stable = 1;
    
    scanf("%d", &n);
    
    for(int i = 0; i < n; i++){
        scanf("%s %d", S, &v);
        A[i].suit = S[0];
        B[i].suit = S[0];
        A[i].value = v;
        B[i].value = v;
    }
    mergeSort(A, 0, n);
    quicksort(B, 0, n - 1);
    
    for(int i = 0; i < n; i++){
        if(A[i].suit != B[i].suit)stable = 0;
    }
    if(stable == 1)printf("Stable\n");
    else printf("Not stable\n");
    for(int i = 0; i < n; i++){
        printf("%c %d\n", B[i].suit, B[i].value);
    }
    
    return 0;
}


Measured memory_bytes: 5512
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    n = int(input())
    D = []
    for _ in range(n):
        D.append(int(input()))

    D_set = set(D)
    print(len(D_set))


if __name__ == '__main__':
    main()


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int a, b, t; cin >> a >> b >> t;
    cout << t/a*b << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


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

static const double pi = acos(-1);

int main() {
  int a, b, h, m;
  scanf("%d %d %d %d", &a, &b, &h, &m);

  double theta_h = (h + 1.0 * m / 60) / 12 * 2 * pi;
  double theta_m = (h + 1.0 * m / 60) * 2 * pi;
  double x_h = a * cos(theta_h), y_h = a * sin(theta_h);
  double x_m = b * cos(theta_m), y_m = b * sin(theta_m);

  double d = sqrt((x_h - x_m) * (x_h - x_m) + (y_h - y_m) * (y_h - y_m));
  printf("%.9lf\n", d);

  return 0;
}

Measured memory_bytes: 4152
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
F = sys.stdin

S = F.readline().rstrip()
A = int(S[:1])
B = int(S[1:2])
C = int(S[2:3])
D = int(S[3:4])

sum = A
nums = [B, C, D]
N = 3
l = [0, 0, 0]
ans = str(A)

# pdb.set_trace()
for bit in range(1<<N):
    for i in range(N):
        if bit & (1<<i):
            sum -= nums[i]
            l[i] = 1
            continue
        sum += nums[i]

    if sum == 7:
        for j in range(N):
            if l[j] == 0:
                ans += ('+' + str(nums[j]))
                continue
            ans += ('-' + str(nums[j]))

        ans += '=7'

        print(ans)
        sys.exit()
    l = [0,0,0]
    sum = A

print('NO_ANSWER')


Measured memory_bytes: 5384
N = int(input())
A = [int(i) for i in input().split()]

mod = 10 ** 9 + 7

sum = [0] * N
A = A[::-1]
sum[0] = A[0]
for i in range(1, N) :
  sum[i] = (sum[i - 1] + A[i]) % mod
  
sum = sum[::-1]
A = A[::-1]

ret = 0
for i in range(N - 1) :
  ret += A[i] * sum[i + 1] % mod
  ret %= mod
  
print(ret)

Measured memory_bytes: 94864
def warshall_floyd(distance_table, point_size):
    for k in range(point_size):
        for i in range(point_size):
            for j in range(point_size):
                if distance_table[i][j] > distance_table[i][k] + distance_table[k][j]:
                    distance_table[i][j] = distance_table[i][k] + distance_table[k][j]

class bit:
    def __createtable():
        table = [None] * 64
        mask64 = (1 << 64) - 1
        hash = 0x03F566ED27179461
        for i in range(64):
            table[hash >> 58] = i
            hash = (hash << 1) & mask64
        return table
    
    __table = __createtable()

    def number_of_trailing_zeros(x):
        if x == 0:return 64
        mask64 = (1 << 64) - 1
        return bit.__table[((bit.lowest_one(x) * 0x03F566ED27179461) & mask64) >> 58]

    def lowest_one(i):
        return i & -i

def ccp(distance_table, point_size, v):
    if v:
        i = bit.number_of_trailing_zeros(v)
        v ^= (1 << i)
        return min(ccp(distance_table, point_size, v ^ (1 << j)) + distance_table[i][j] for j in range(point_size) if v & 1 << j)
    else:
        return 0


import sys
readline = sys.stdin.readline

point_size, e = map(int, readline().split())
distance_table = [[float('inf')] * point_size for _ in range(point_size)]
cost = 0
v = 0
for _ in range(e):
    s, t, d = map(int, readline().split())
    distance_table[s][t] = min(distance_table[s][t], d)
    distance_table[t][s] = min(distance_table[t][s], d)
    v ^= 1 << s ^ 1 << t
    cost += d

warshall_floyd(distance_table, point_size)
print(cost + ccp(distance_table, point_size, v))

Measured memory_bytes: 6812
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
  long long int ans=0,x,m=100;
  (void)scanf("%lld",&x);
  while(m<x){
    m=m+m/100;
    ans++;
  }
  printf("%lld\n",ans);
  return 0;
}

Measured memory_bytes: 1732
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

struct S{
    int a,b;
    ll c;
    string s,t;
};

bool cmp(S a,S b){
    if(a.a==b.a){
        if(a.b==b.b){
            if(a.s==b.s){
                if(a.c==b.c){
                    return a.t<b.t;
                }
                return a.c<b.c;
            }
            return a.s<b.s;
        }
        return a.b<b.b;
    }
    return a.a<b.a;
}

int main (){
    int n;
    cin>>n;
    vector<S> v(n);
    rep(i,0,n){
        cin>>v[i].a>>v[i].b>>v[i].s>>v[i].c>>v[i].t;
    }

        sort(v.begin(),v.end(),cmp);
    rep(i,0,n){
        cout<<v[i].a<<" "<<v[i].b<<" "<<v[i].s<<" "<<v[i].c<<" "<<v[i].t<<endl;
    }
}



/*
5
105 24 C 1500000000000 white
100 23 C 1500000000000 blue
105 23 A 1480000000000 pink
110 25 B 1500000000000 black
110 20 A 1300000000000 gree
*/



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

int main() {
    int n, a[100], ans = 0;
    cin >> n;
    rep(i, n) {
        cin >> a[i];
    }
    REP(i, 1, n) {
        if (a[i-1]==a[i]) {
            ans++;
            i++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using i128 = boost::multiprecision::int128_t;
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using VVV = vector<VV>;
using VVVll = vector<VVll>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m)-1; i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << p.first << " " << p.second; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << " "; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int Log2(ll x) { int k; for (k = 0; x > 0; ++k) x >>= 1; return k; } // number of binary digits
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const ld PI    = acos(-1.0);
const int MOD  = int(1e9)+7;
// const int MOD  = 998244353;


int main() {
  int n; cin >> n;
  V q(n);
  rep(i, n) {
    int p; cin >> p;
    --p;
    q[p] = i;
  }

  int ans = 0;
  int now = 1;
  // if (q[0] == 0) ++now;
  rep2(i, 1, n) {
    if (q[i] > q[i-1]) ++now;
    else {
      chmax(ans, now);
      now = 1;
    }
  }
  chmax(ans, now);

  ans = n - ans;
  cout << ans << "\n";
  return 0;
}


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

int main(void) {
    int a, b;
    char op;
    while(1){
        scanf("%d %c %d", &a,&op,&b);
        if (op == '+') printf("%d\n",a+b);
        else if (op == '-') printf("%d\n",a-b);
        else if (op == '*') printf("%d\n",a*b);
        else if (op == '/') printf("%d\n",a/b);
        else if (op == '?') break;
    }
    return 0;
}


Measured memory_bytes: 3212
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int a[105],x,y,n,m;
int main()
{
    ios::sync_with_stdio(0),cin.tie(0);
//    freopen(".in","r",stdin);
//    freopen(".out","w",stdout);
    int i,j;
    cin>>n>>m;
    for(i=1;i<=m;i++)
    {
        cin>>x>>y;
        a[x]++,a[y]++;
    }
    for(i=1;i<=n;i++)
    {
        cout<<a[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int route,time,cost,tm,mn=100000;
    cin>>route>>time;
    while(route--)
    {
        cin>>cost>>tm;
        if(time>=tm)
            mn=min(mn,cost);
    }
    if(mn==100000)
        cout<<"TLE"<<endl;
    else
        cout<<mn<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

using namespace std;
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
    double a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
    double x,y;
    y=((e-a)*(a*a+b*b-c*c-d*d)-(c-a)*(a*a+b*b-e*e-f*f))/(2*(e-a)*(b-d)-2*(c-a)*(b-f));
    if(c-a!=0){
         x=(2*(b-d)*y-a*a-b*b+c*c+d*d)/(2*(c-a));
    }else{
        x=(2*(b-f)*y-a*a-b*b+e*e+f*f)/(2*(e-a));
    }
    double r=sqrt((x-a)*(x-a)+(y-b)*(y-b));
    printf("%.3f %.3f %.3f\n",x,y,r);
    }
    
    
    return 0;
}


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

int main() {
    map<string, int> cnt;
    string x;
    while (cin >> x) cnt[x]++;
    int m = 0;
    for (map<string, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
        if (m < it->second) m = it->second;
    }
    string a, b;
    for (map<string, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
        if (a.size() < it->first.size()) a = it->first;
        if (m == it->second) b = it->first;
    }
    cout << b << ' ' << a << endl;
    return 0;
}

Measured memory_bytes: 0
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    string s;
    while(getline(cin,s)){
        if(s=="END OF INPUT")break;
        int last=0;
        vi v;
        for(int i=0;i<s.size();i++){
            if(s[i]==' '){
                v.push_back(i-last);
                last=i+1;
            }
        }
        v.push_back((int)s.size()-last);
        rep(i,v.size())if(i)cout<<v[i];else cout<<v[i];
        cout<<endl;
    }
}

Measured memory_bytes: 3120
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
using vll=vector<ll>;
using vvll=vector<vll>;
using vi=vector<int>;
using vvi=vector<vector<int>>;
using vb=vector<bool>;
using pii=pair<int,int>;
using vpii=vector<pair<int,int>>;
using plli=pair<ll,int>;
using vplli=vector<pair<ll,int>>;
using pllll=pair<ll,ll>;
using vpllll=vector<pair<ll,ll>>;

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;}

//pow(llpow,modpow)
template<class T> ll llpow(ll x,T n){ll ans=1;if(x==0)ans=0;while(n){if(n&1)ans*=x;x*=x;n>>=1;}return ans;}
long long modpow(long long a, long long n, long long mod) {long long res = 1;while (n > 0) {if (n & 1) res = res * a % mod;a = a * a % mod;n >>= 1;}return res;}
//最大公約数
template<class T> inline T gcd(T x,T y){if(y==0)return x; else {return gcd(y,x%y);}}
//最小公倍数
template<class T> inline T lcm(T x,T y){return x/gcd(x,y)*y;}
//逆元
long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}

#define rep(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)
//試験導入
#define irep(i, end_i, begin_i) for (ll i = (ll)begin_i-1; i >= (ll)end_i; i--)

long long INF = 1LL<<60;
vll p(1000010,0);
int main( ){
    ll n;
    cin>>n;
    vll a(n);
    rep(i,0,n)cin>>a[i],p[a[i]]++;
    sort(a.begin(),a.end());
    ll cnt=0;
    rep(i,0,n){
        ll v=a[i];
        if(p[v]==1)cnt++;
        if(v==1)break;
        for(ll j=2;j*v<=1e6;j++){
            p[v*j]=0;
        }
    }
    cout<<cnt<<endl;
    return 0;
}




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

int main() {
        long long x, y, z, k;
        scanf("%lld%lld%lld%lld", &x, &y, &z, &k);
        vector<long long> xs(x), ys(y), zs(z);
        rep(i, x) scanf("%lld", &xs[i]);
        rep(i, y) scanf("%lld", &ys[i]);
        rep(i, z) scanf("%lld", &zs[i]);
        vector<long long> xys;
        rep(i, x) rep(j, y) xys.push_back(xs[i] + ys[j]);
        sort(xys.rbegin(), xys.rend());
        vector<long long> ans;
        rep(i, min(x * y, k)) rep(j, z) ans.push_back(xys[i] + zs[j]);
        sort(ans.rbegin(), ans.rend());
        rep(i, k) printf("%lld\n", ans[i]);
        return 0;
}


Measured memory_bytes: 42600
import std.stdio;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;

void main() {
    int N = readln.chomp.to!int;
    Point[][] points = new Point[][](N, 2);
    foreach(int i; 0..N) {
        int[] input = readln.split.to!(int[]);
        points[i] = [Point(input[0], input[1]), Point(input[2], input[3])];
        sort!((a,b) => a.x<b.x)(points[i]);
    }
    if (N > 101^^2/2) {
        writeln(0);
        return;
    }
    double ans = double.max;
    sort!((a, b) => a[0].x<b[0].x)(points);
    foreach(int i; 0..N) foreach(int j; i+1..N) {
        if (points[j][0].x - points[i][1].x > ans) continue;
        double value = getDistance(points[i], points[j]);
        if (value < ans) ans = value;
    }
    writefln("%.5f", ans);
}
double getDistance(Point[] p, Point[] q) {
    if ((p[1]-p[0]).cross(q[0]-p[0]).dot((p[1]-p[0]).cross(q[1]-p[0])) < 0 && (q[1]-q[0]).cross(p[0]-q[0]).dot((q[1]-q[0]).cross(p[1]-q[0])) < 0) {
        return 0;
    }

    double result = double.max;
    foreach(int i; 0..2) {
        double value1, value2;
        if ((q[i]-p[0]).dot(p[1]-p[0]) <= 0) {
            value1 = dist(p[0], q[i]);
        } else if ((q[i]-p[0]).dot(p[1]-p[0]) >= (p[1]-p[0]).dot(p[1]-p[0])) {
            value1 = dist(p[1], q[i]);
        } else {
            value1 = (p[0]-q[i]).cross(p[1]-p[0]).abs/dist(p[1], p[0]);
        }
        if ((p[i]-q[0]).dot(q[1]-q[0]) <= 0) {
            value2 = dist(q[0], p[i]);
        } else if ((p[i]-q[0]).dot(q[1]-q[0]) >= (q[1]-q[0]).dot(q[1]-q[0])) {
            value2 = dist(q[1], p[i]);
        } else {
            value2 = (q[0]-p[i]).cross(q[1]-q[0]).abs/dist(q[1], q[0]);
        }
        result = min(result, value1, value2);
    }
    return result;
}
int cross(Point p1, Point p2) {
    return p1.x*p2.y - p1.y*p2.x;
}
int dot(int z1, int z2) {
    return z1*z2;
}
int dot(Point p1, Point p2) {
    return p1.x*p2.x + p1.y*p2.y;
}
double dist(Point p1, Point p2) {
    return sqrt(((p2.x-p1.x)^^2 + (p2.y-p1.y)^^2).to!double);
}
struct Point{
    int x, y;
    this(int x, int y) {
        this.x = x;
        this.y = y;
    }
    Point opBinary(string op)(Point rhs) if (op == "+") {
        return Point(this.x+rhs.x, this.y+rhs.y);
    }
    Point opBinary(string op)(Point rhs) if (op == "-") {
        return Point(this.x-rhs.x, this.y-rhs.y);
    }
}

Measured memory_bytes: 22864
import sys
sys.setrecursionlimit(10**6)

def dfs(x, al):
    global cntx, cnty
    if (al, x) in used:
        return
    used.add((al, x))
    if al == 0:
        cntx += 1
    else:
        cnty += 1
    for xy in to[al][x]:
        dfs(xy, 1 - al)
    return

n = int(input())
to = [{}, {}]
for _ in range(n):
    x, y = map(int, input().split())
    to[0].setdefault(x, [])
    to[1].setdefault(y, [])
    to[0][x] += [y]
    to[1][y] += [x]
used = set()
ans = 0
for x in to[0].keys():
    if (0, x) in used: continue
    cntx = 0
    cnty = 0
    dfs(x, 0)
    ans += cntx * cnty
print(ans - n)


Measured memory_bytes: 92576
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <utility>
#include <numeric>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <limits>

#define for0(i, n)    for (int i = 0  ; i <  (n); ++i)
#define for1n(i, n)   for (int i = 1  ; i <= (n); ++i)
#define for1(i, n)    for (int i = 1  ; i <  (n); ++i)
#define forn(i, n)    for (int i = 0  ; i <= (n); ++i)
#define forx(i, n, x) for (int i = (x); i <  (n); ++i)

using namespace std;

typedef long long ll;
typedef priority_queue<ll> pq;
typedef priority_queue<ll,vector<ll> ,greater<ll>> pql;
typedef stack<ll> stk;
typedef queue<ll> qu;


int main(void){
    string s, t;
    cin >> s >> t;

    int result = 0;
    
    for0(i, 3){
        if (s[i] == t[i]) {
            ++result;
        }
    }

    cout << result;
    
    return 0;
}


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

template <typename T>
class MinCostFlow
{
public:
  MinCostFlow(int n) : n(n), capacity(n, vector<T>(n)), cost(n, vector<T>(n)), prev(n) {}

  void add_edge(int src, int dst, T cap, T c)
  {
    capacity[src][dst] = cap;
    capacity[dst][src] = 0;
    cost[src][dst] = c;
    cost[dst][src] = -c;
  }

  T min_cost_flow(int s, int t, T f)
  {
    T res = 0;
    h.assign(n, 0);
    while (f > 0)
    {
      if (!dijkstra(s, t))
        return -1;
      for (int i = 0; i < n; ++i)
        h[i] += dist[i];

      T d = f;
      for (int v = t; v != s; v = prev[v])
        d = min(d, capacity[prev[v]][v]);
      f -= d;
      res += d * h[t];
      for (int v = t; v != s; v = prev[v])
      {
        capacity[prev[v]][v] -= d;
        capacity[v][prev[v]] += d;
      }
    }
    return res;
  }

private:
  int n;
  T inf = numeric_limits<T>::max();
  vector<vector<T>> capacity, cost;
  vector<T> dist, h, prev;

  bool dijkstra(int s, int t)
  {
    dist.assign(n, inf);
    dist[s] = 0;
    priority_queue<pair<T, int>, vector<pair<T, int>>, greater<pair<T, int>>> pq;
    pq.emplace(0, s);
    while (!pq.empty())
    {
      int c = pq.top().first;
      int v = pq.top().second;
      pq.pop();
      if (dist[v] < c)
        continue;
      for (int nv = 0; nv < n; ++nv)
      {
        if (capacity[v][nv] > 0 && dist[nv] > dist[v] + cost[v][nv] + h[v] - h[nv])
        {
          dist[nv] = dist[v] + cost[v][nv] + h[v] - h[nv];
          prev[nv] = v;
          pq.emplace(dist[nv], nv);
        }
      }
    }
    return dist[t] != inf;
  }
};

int main()
{
  int V, E, F, u, v, c, d;
  cin >> V >> E >> F;
  MinCostFlow<int> mcf(V + 1);
  for (int i = 0; i < E; ++i)
  {
    cin >> u >> v >> c >> d;
    mcf.add_edge(u, v, c, d);
  }
  cout << mcf.min_cost_flow(0, V - 1, F) << endl;
  return 0;
}


Measured memory_bytes: 3256
#include <stdio.h>          // printf(), scanf()
#include <stdlib.h>         // abs()
#include <string.h>         // memset()
#include <stdbool.h>

#define MAX_N 15
#define MAX_S (1 << MAX_N)

const double INF = 1e10;

int n;
int s[MAX_N], l[MAX_N], p[MAX_N];
double dp[MAX_N][MAX_S];
int w[MAX_N][MAX_S];
short prev[MAX_N][MAX_S][2];
int ord[MAX_N];

int
main(int argc, char **argv)
{
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
		scanf("%d%d%d", &s[i], &l[i], &p[i]);

	memset(prev, -1, sizeof(prev));
	int S = 1;
	for (int i = 0; i < n; i++, S <<= 1)
		w[i][S] = p[i];

	int e = 1 << n;
	for (int k = 0; k < e; ++k)
	{
		S = 1;
		for (int i = 0; i < n; ++i, S <<= 1)
		{
			if (k & S)
				continue;

			int t = k | S;
			for (int j = 0; j < n; ++j)
			{
				if (i == j || w[j][k] == 0)
					continue;

				int d = abs(l[i] - l[j]);
				double x = dp[j][k] + (d * (70 + 20.0 * w[j][k])) / 2000.0;
				if (dp[i][t] == 0 || x < dp[i][t])
				{
					dp[i][t] = x;
					w[i][t] = w[j][k] + p[i];
					prev[i][t][0] = j;
					prev[i][t][1] = k;
				}
			}
		}
	}

	double min = INF;
	int u = 0;
	for (int i = 0; i < n; ++i)
	{
		double y = dp[i][e - 1];
		if (y == 0)
			continue;

		if (y < min)
		{
			min = y;
			u = i;
		}
	}

	ord[0] = u;
	int v = e - 1;
	for (int k = 1; k < n; ++k)
	{
		ord[k] = prev[u][v][0];
		v = prev[u][v][1];
		u = ord[k];
	}

	for (int i = n - 1; i >= 0; --i)
		printf("%d%c", s[ord[i]], (i != 0) ? ' ' : '\n');

	return 0;
}

Measured memory_bytes: 8680
#include <bits/stdc++.h>
#define ff(i, a, b) for(int i = (a), _b = (b); i <= _b; i++)
#define fb(i, a, b) for(int i = (a), _b = (b); i >= _b; i--)
#define pb push_back

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

int N;
int dad[100005];
vi child[100005];
int f[100005];

void dfs(int u) {
    if (child[u].empty()) return;
    vi S;
    ff(i, 0, child[u].size() - 1) {
        int v = child[u][i];
        dfs(v);
        S.pb(f[v]);
    }
    sort(S.begin(), S.end(), greater <int> ());
    ff(i, 0, S.size() - 1) f[u] = max(f[u], S[i] + i + 1);
}

int main(void) {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> N;
    ff(i, 2, N) cin >> dad[i], child[dad[i]].pb(i);
    dfs(1);
    cout << f[1] << endl;
    return 0;
}


Measured memory_bytes: 14336
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <iomanip>
#include <queue>
#define inp(X) cin >> X
#define out(X) cout << X << endl
#define out16(X) cout << setprecision(16) << X << endl
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define MAX(A) *max_element(A.begin(),A.end())
#define MIN(A) *min_element(A.begin(),A.end())
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vd = std::vector<double>;
using vvd = std::vector<std::vector<double>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using namespace std;
#define MOD 1000000007
#define INF 1000000001
#define LL_INF 1001001001001001001

ll gcd(ll x, ll y){
	if(y==0) return x;
	return gcd(y,x%y);
}

bool bfs(vector<vector<int>> g, vector<int> &dist, int sv){
	queue<int> q;
	q.push(sv);
	dist[sv]=0;
	while(!q.empty()){
		int now = q.front(); q.pop();
		for(auto v : g[now]){
			if(dist[v]!=-1) continue;
			dist[v] = dist[now]+1;
			q.push(v);
		}
	}
}

int main(void) {
	int a1,a2,a3; cin >> a1 >> a2 >> a3;
	if(a1+a2+a3>=22) out("bust");
	else out("win");

}




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

int main(){
	int i,j,k,n,m,l,f,x,y,z; string s;
	cin >> n >> s;

	f = 0;
	rep(i, n-1){
		x = 0;
		set<char> a;
		set<char> b;

		rep(j, i+1){
			a.insert(s[j]);
		}

		REP(k, i+1, n){
			b.insert(s[k]);
		}

		for(auto ch: a){
			if(b.find(ch) != b.end()){
				x++;
			}
		}
		f = max(x, f);
	}

	cout << f << endl;
}

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

int main() {
    int H, W;

    while(1) {
        cin >> H >> W;

        if ((H == 0) && (W == 0)) {
            break;
        }

        for (int i = 0; i < H; ++i) {
            for (int j = 0; j < W; ++j) {
                if (((i + j) % 2) == 0) {
                    cout << "#";
                } else {
                    cout <<".";
                }
            }
            cout << endl;
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3060