akhauriyash/Code-Regression huggingface dataset:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    a,b,c = map(int, input().split())
    if a == b == c:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
#include <bits/stdc++.h>
  
using namespace std;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
#define setp(x) fixed << setprecision(x)
#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 3e5 + 555; // TL MB
const double PI = acos(-1.0);
void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}
 
void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r; 
}

void solve()
{
		int n;
		cin >> n;
		int a[n];
		rep(i, n){
				cin >> a[i];
		}	
		ll res = 0;
		int j = -1, sum = 0, xr = 0;
		rep(i, n){
				sum += a[i];
				xr ^= a[i];
				while(j + 1 <= i && sum != xr){
					j++;
					sum -= a[j];
					xr ^= a[j];
				}
				res += (i - j );

		}
		cout << res;
}
 
int main()
{
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
    // Red;
  	int T = 1;
  	// cin >> T;
  	for(int i = 1; i <= T; ++i){
  		solve();
  	}
  	return 0;

}

Measured memory_bytes: 4416
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

#define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
#define fb(i,a,b) for(int (i) = (a); (i) >= (b); --(i))
#define mod 998244353
#define xx first
#define yy second
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define ll long long
#define pii pair<int,int>


using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>,rb_tree_tag, tree_order_statistics_node_update> ordered_set;/// find_by_order(x)(x+1th) , order_of_key() (strictly less)
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



int x[200005];
int main()
{

    ios_base::sync_with_stdio(false); cin.tie(0);
    int l;
    cin >> l;
    int n;
    cin >> n;
    ff(i,0,n - 1){
        cin >> x[i];
    }
    int res = 1e9;
    ff(i,0,n - 1){
        if(i == 0){
            res = min(res, x[n - 1] - x[0]);
            continue;
        }
        else{
            res = min(res, x[n - 1] - x[i] + x[0] - x[n - 1] + l + x[i - 1] - x[0]);
        }
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 1024
N, A, B = map(int, input().split())
if A*B < N or A+B-1 > N:
    print(-1)
else:
    array = [i for i in reversed(range(1, N+1))]
    if A > 1:
        f = array[:B]
        r = array[B:]
        L = [f]
        span = len(r)//(A-1)
        rem = len(r)%(A-1)
        i = 0
        for _ in range(A-1):
            if rem > 0:
                L.append(r[i:i+span+1])
                rem -= 1
                i += span + 1
            else:
                L.append(r[i:i+span])
                i += span
        array = []
        for l in reversed(L):
            array += l
    print(' '.join([str(a) for a in array]))


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

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

    long long n, a, b;
    cin >> n >> a >> b;

    long long ans = -1;
    if(a % 2 == b % 2){
        ans = (b - a) / 2;
    }else{
        ans = 1;
        ans += min(a - 1, n - b) + (b - a - 1) / 2;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 384
while True:
  n,x = map(int, input().split())
  if n == 0 and x == 0 :
    break

  s=0
  for i in range(1, n+1):
    xx = x - i
    for j in range(i + 1, n+1):
      for k in range(j + 1, n+1):
        if j + k == xx:
          s += 1
        
  print(s)


Measured memory_bytes: 5592
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50

def bfs(MAZE, start, goal):
    MAP = [[INF] * len(MAZE[0]) for _ in range(len(MAZE))]
    walks = [(0,1), (1,0), (-1,0), (0, -1)]
    warps = []
    for i in range(-2, 3):
        for j in range(-2, 3):
            if i == 0 and j == 0: continue
            if not (i,j) in walks:
                warps.append((i, j))
    queue = []
    k = (0,) + start
    heappush(queue, k)

    #for m in MAZE:
    #    print(m)



    while queue:
        count, ci, cj = heappop(queue)
        if (ci, cj) == goal:
            return count
        for ii, jj in walks:
            ni, nj = ci + ii, cj + jj
            if MAZE[ni][nj] == '.' and MAP[ni][nj] > count:
                heappush(queue, (count, ni, nj))
                MAP[ni][nj] = count
        for ii, jj in warps:
            ni, nj = ci + ii, cj + jj
            if MAZE[ni][nj] == '.' and MAP[ni][nj] > count + 1:
                heappush(queue, (count+1, ni, nj))
                MAP[ni][nj] = count + 1

    return -1


def run():
    H, W = map(int, sysread().split())
    Ci, Cj = map(int, sysread().split())
    Ci += 1
    Cj += 1
    Di, Dj = map(int, sysread().split())
    Di += 1
    Dj += 1
    MAZE = []
    MAZE.append('#' * (W + 4))
    MAZE.append('#' * (W + 4))
    for i in range(H):
        s = input()
        s = '##' + s + '##'
        MAZE.append(s)
    MAZE.append('#' * (W + 4))
    MAZE.append('#' * (W + 4))
    print(bfs(MAZE, (Ci, Cj), (Di, Dj)))





if __name__ == "__main__":
    run()

Measured memory_bytes: 121404
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};


int main() {
  int N;
  cin >> N;
  ll nowa = 1, nowb = 1;
  for (int i = 0; i < N; i++) {
    ll a, b;
    cin >> a >> b;
    ll k;
    if (a < b) {
      k = (nowa - 1) / a + 1;
      if (a * k + b * k < nowa + nowb) k = (nowb - 1) / b + 1;
    } else {
      k = (nowb - 1) / b + 1;
      if (a * k + b * k < nowa + nowb) k = (nowa - 1) / a + 1;
    }

    nowa = a * k, nowb = b * k;
  }
  cout << nowa + nowb << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

using ll = long long;
using namespace std;

class union_find {
    private :
        std::vector<int> par;
    public :
        union_find(int);
        int find(int);
        bool same(int, int);
        void unite(int, int);
};

union_find::union_find(int n) {
    par.resize(n);
    for (int i=0; i<n; i++) {
        par.at(i) = i;
    }
}

int union_find::find(int x) {
    if (par.at(x) == x) return x;
    else return par.at(x) = find(par.at(x));
}

bool union_find::same(int x, int y) {
    return find(x) == find(y);
}

void union_find::unite(int x, int y) {
    int x_par = find(x);
    int y_par = find(y);
    if (x_par == y_par) return;

    par.at(x_par) = y_par;
}

int main() {
    int n = 0, m = 0;
    cin >> n >> m;
    vector<pair<int, int>> a(m);
    for (int i=0; i<m; i++) {
        cin >> a.at(i).first >> a.at(i).second;
        a.at(i).first--;
        a.at(i).second--;
    }
    int ans = 0;
    for (int i=0; i<m; i++) {
        union_find buf(n);
        for (int j=0; j<m; j++) {
            if (j == i) continue;
            buf.unite(a.at(j).first, a.at(j).second);
        }
        int par = buf.find(0);
        for (int j=1; j<n; j++) {
            if (par != buf.find(j)) {
                ans++;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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

digit = 0;
tmp = N
while tmp > 0:
    tmp //= 10
    digit += 1

ans = 0
for i in range(1, digit, 2):
    ans += pow(10, i) - pow(10, i-1)
if digit%2 == 1:
    ans += N - pow(10, digit-1) + 1 

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <map>
#include <vector>
#include <string.h>

using namespace std;

int main () {
  int N;
  cin >> N;
  vector<string> W(N);
  for (int i = 0; i < N; i++) {
    cin >> W[i];  
  }  
  map<string, int> pp;
  for (int i = 0; i < N; i++) {
    if (pp[W[i]] == 1) {
      cout << "No" << endl;  
      break;
    }  
    else {
      pp[W[i]] = 1;
      if (i > 0 && W[i][0] != W[i - 1][W[i - 1].size() - 1]) {
        cout << "No" << endl;
        break;    
      }  
      if (i == (N - 1)) {
        cout << "Yes" << endl;  
      }
    }
  }
}

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

ll cnt[65];
const int mod=1e9+7;

int main(){
  int n;
  cin>>n;
  rep(i,n){
    ll a;
    cin>>a;
    for(int i=0;a>0;i++){
      cnt[i]+=a&1;
      a=a>>1;
    }
  }
  ll ans=0;
  rep(i,60){
    int s=cnt[i]*(n-cnt[i])%mod;
    rep(j,i){
      s=s*2%mod;
    }
    ans=(ans+s)%mod;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 256
#134
N=int(input())
a=[int(input()) for i in range(N) ]
a_M=[]
a_M1=sorted(a)[-1]
a_M2=sorted(a)[-2]
for i in range(N):
    if a[i]==a_M1:
        a_M.append(a_M2)
    else:
        a_M.append(a_M1)
for x in a_M:
    print(x)

Measured memory_bytes: 73376
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
using Graph = vector<vector<int> >;
using GraphC = vector<vector<char> >;
const int INF = 1000000000;
typedef pair<int, int> P;
const int MAX_N = 1000000000;
const int MAX_E = 100000000;
const int MAX_V = 10000;
typedef int64_t ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



int main() {
    int X;
	cin >> X;
	if (X == 1)
	{
		cout << 1 << endl;
		return 0;
	}
	int ans = 0;
	for (int i = 2; i*i <=X ; i++)
	{	
		
		int tmp = i * i;
		while (tmp <= X)
		{
			tmp *= i;
		}
		tmp /= i;
		ans = max(ans, tmp);
		
	}
	cout << ans << endl;
}

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

int main(){

    string S, T, U = "";
    int A, B = 0;
    cin >> S >> T >> A >> B >> U;

    if(U == S) A--;
    if(U == T) B--;

    cout << A << ' ' << B << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define M1 1000000007
#define M2 998244353

#define fl(i,a,b)  for(ll i=a;i<b;i++)
#define bfl(i,a,b) for(ll i=b-1;i>=a;i--)
#define f(i,n)     for(int i=0;i<n;i++)
#define bf(i,n)    for(int i=n-1;i>=0;i--)


#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#define bn "\n"

//------------------------------------------------------------------------ 
// #define V(a) vector<a>
// #define vt() vector< tuple < int ,int ,int > > ;
// #define vector< int ,int > pv;
// vector< pair <int,int> > vect;


//------------------------------------------------------------------------

ll modI(ll a,ll m);
ll gcd(ll a,ll b);
ll powM(ll x,ll y,ll m);
ll swap(ll a,ll b);

void swap(ll& a,ll& b)
{
    ll tp=a;
    a=b;
    b=tp;
}

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

ll powM(ll x,ll y,ll m)
{
    ll ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
 
ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

//---------------------------------------------------------------------------

// variable = Expression1 ? Expression2 : Expression3
// max = (n1 > n2) ? n1 : n2; 
// (n>m) ? cout<<"True"<<endl:cout<<"false"<<endl ;

// ---------------------------------------------------------------------------	

// int n;cin>>n;int a[n];for(int i=0;i<n;i++)cin>>a[i];    
// for(int i=0;i<n;i++)cout<<a[i];
// int a,b;cin>>a>>b;   

//----------------------------------------------------------------------------

// vector< tuple < int ,int ,int > > tv;
// vector< int ,int > pv;


//----------------------------------------------------------------------------


int main() {
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
	int tt=1;
   // cin>>tt;
	while(tt--)
	{
	    vector<char>v1;
	   ll n;
	   cin>>n;
	   n--;
	   while(n>=(ll)0)
	   {
	       ll z=0;
	     
	        z=n%26;
	   //   n--;
	      
	       char c='a'+z;
	       v1.pb(c);
	       n=n/(ll)26;
	       n--;
	       
	       
	   }
	   bf(i,v1.size())
	   {
	       cout<<v1[i];
	   }
	    cout<<bn;
	}
	
	return 0;
}


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

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

    int res = 0;

    //操作が行える限り操作を繰り返す
    while (true) {
        bool exist_odd = false; //A[i]がすべて偶数かどうかを判定するフラグ
        for (int i = 0; i < N; ++i) {
            if (A[i] % 2 != 0) exist_odd = true; //奇数があったらフラグを立てる
        }

        if (exist_odd) break;

        //操作を行えるなら操作を実際に行う 
        for (int i = 0; i < N; ++i) {
            A[i] /= 2;
        }
        ++res; //操作回数をインクリメント
    }
    cout<< res << endl;
}

Measured memory_bytes: 256
import Control.Monad
import qualified Data.ByteString.Char8 as BS
import Data.Char
import qualified Data.Vector.Unboxed.Mutable as VUM

readString = map BS.unpack . BS.words

getString = readString <$> BS.getLine

readWords alphabets (w : ws) = do
  let position = ord w - ord 'a'
  count <- VUM.read alphabets position
  VUM.write alphabets position (count + 1)
  when (ws /= []) $ readWords alphabets ws

checkCount alphabets n = do
  count <- VUM.read alphabets n
  if odd count
    then putStrLn "No"
    else
      if n < 25
        then checkCount alphabets (n + 1)
        else putStrLn "Yes"

main = do
  [w] <- getString
  alphabets <- VUM.replicate 26 0 :: IO (VUM.IOVector Int)
  readWords alphabets w
  checkCount alphabets 0


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

int main(void){
    string s;
    string t;
    cin >> s >> t;
    if(s < t)
        cout << '<' << endl;
    else if(s == t)
        cout << '=' << endl;
    else if(s > t)
        cout << '>' << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
p = [int(x) for x in input().split()]

ans = 0
for i in range(n-1):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1],p[i]
        ans += 1
if p[n-1] == n:
    ans += 1

print(ans)

Measured memory_bytes: 13880
from sys import stdin


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    D, T, S = list(map(int, _in[0].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    ans = 'Yes' if T - D/S >= 0 else 'No'
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 61732
li=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(li[int(input())-1])

Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,n) for(int i=1;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define Rrep(i,n) for(int i=n-1;i>0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
#define P pair<int,int>
#define Pll pair<ll,ll>
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main(){
    int w,h,n; cin >> w >> h >> n;
    int x1=0,x2=w,y1=0,y2=h;
    rep(i,n){
        int x,y,a; cin >> x >> y >> a;
        if(a==1) chmax(x1,x);
        if(a==2) chmin(x2,x);
        if(a==3) chmax(y1,y);
        if(a==4) chmin(y2,y);
    }
    if(x2<x1||y2<y1) cout << 0 << endl;
    else cout << (x2-x1)*(y2-y1) << endl;
}


Measured memory_bytes: 256
/***************************************************************
	File name: D.cpp
	Author: huhao
	Create time: Sun 04 Aug 2019 08:09:15 PM CST
***************************************************************/
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
#define fr(i,a,b) for(int i=(a),end_##i=(b);i<=end_##i;i++)
#define fd(i,a,b) for(int i=(a),end_##i=(b);i>=end_##i;i--)
int read()
{
	int r=0,t=1,c=getchar();
	while(c<'0'||c>'9')
	{
		t=c=='-'?-1:1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		r=r*10+c-48;
		c=getchar();
	}
	return r*t;
}
const int N=100010;
char s[N];
int n,t[N],ans[N];
int main()
{
	scanf("%s",s+1);
	n=strlen(s+1);
	fr(i,1,n)
		if(s[i]=='L')
		{
			t[i]=t[i-1];
		}
		else
		{
			int j=i;
			while(s[j]=='R')
				j++;
			j--;
			fr(k,i,j)
				t[k]=j;
			i=j;
		}
	fr(i,1,n)
		if(abs(i-t[i])%2==0)
			ans[t[i]]++;
		else
			ans[t[i]+1]++;
	fr(i,1,n)
		printf("%d%c",ans[i],i==n?'\n':' ');
	return 0;
}

Measured memory_bytes: 1280
#include <iostream> 
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include<math.h>
//#define int long long
#define m_p make_pair
#define mod 1000000007
#define rep(i,n)  for(int i=0; i<(int)(n); i++)
#define all(v)  v.begin(),v.end()
using namespace std;

int jousu(int, int);
int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int kurai(int x00, int y00) {
	int z00 = (x00 % jousu(10, y00)) / jousu(10, y00 - 1);
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}



int main() {
	int a=0;
	string s, t;
	cin >> s >> t;
	rep (i, 3) {
		if (s[i] == t[i])a++;
	}
	cout << a << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int num,i,min,max;
  int point[101];
  scanf("%d",&num);
  for(i=0;i<num;i++){
    scanf("%d",&point[i]);
  }
  //探索
  for(i=0,max=point[0];i<num;i++){
    if(max < point[i]){
      max=point[i];
    }
  }
  for(i=0,min=point[0];i<num;i++){
    if(min > point[i]){
      min=point[i];
    }
  }
  printf("%d",max-min);
  return 0;
}

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

int main()
{
    int a=0,b=0,c=0;
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        int l;
        scanf("%d",&l);
        if(l%4==0)
            a++;
        else if(l%2==0)
            b++;
        else
            c++;
    }
    if(c<=a||(b==0&&c==a+1))
        printf("Yes\n");
    else
        printf("No\n");
    //cout << "Hello world!" << endl;
    return 0;
}


Measured memory_bytes: 256
C=int(input())
D=list(map(int,input().split()))
S=0
flag=0
while(flag==0):
	for I in range(C):
		if D[I]%2==0:
			D[I]/=2
			if I==(C-1):
				S+=1
		else:
			flag=1
			break	
print(S)

Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <stack>

using namespace std;

int main()
{
    string inp;

    while (getline(cin, inp), inp != ".") {

        stack<char> st;
        bool flag = true;

        for (int i = 0; i < inp.size(); i++) {
            if (inp[i] == '(' || inp[i] == '[') 
                st.push(inp[i]);
            else if (inp[i] == ')') {
                if (st.empty() || st.top() == '[') {
                    flag = false;
                    break;
                }
                else if (st.top() == '(')
                    st.pop();
            }
            else if (inp[i] == ']') {
                if (st.empty() || st.top() == '(') {
                    flag = false;
                    break;
                }
                else if (st.top() == '[')
                    st.pop();
            }
        }
        
        if (flag && st.empty())
            cout << "yes" << endl;
        else
            cout << "no" << endl;
    }

    return 0;
}

Measured memory_bytes: 1180
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
using namespace std;


void func() {
	int n;
	cin >> n;
}


int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	vector<int> b(n, 0);\
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	b[n - 1] = 0;
	b[n - 2] = abs(a[n - 1] - a[n - 2]);
	for (int i = n - 3; i >= 0; i--) {
		b[i] = min(b[i + 1] + abs(a[i] - a[i + 1]), b[i + 2] + abs(a[i] - a[i + 2]));
	}
	cout << b[0];
}

Measured memory_bytes: 1024
import itertools
from math import *
n = int(input())

x = [0]*n
y = [0]*n

for i in range(n):
    x[i],y[i] = map(int,input().split())


per = list(itertools.permutations(range(n)))
d = [[0 for i in range(n)] for j in range(n)]

for i in range(n):
    for j in range(n):
        if i != j:
            d[i][j] = sqrt(abs(x[i]-x[j])**2 + abs(y[i]-y[j])**2)
        else:
            d[i][j] = 0;
ans = 0

for road in per:
    for k in range(n-1):
        ans += d[road[k]][road[k+1]]


print(ans/factorial(n))

Measured memory_bytes: 7996
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {

     static Scanner scanner;

     public static void main(String[] args) {
         scanner = new Scanner(System.in);

         int N=gi();
         long T=gl();
         int[] A=new int[N];
         int min=Integer.MAX_VALUE;
         int max=Integer.MIN_VALUE;
         int ans=0;
         for(int i=0; i<N;i++) {
        	 A[i]=gi();
        	 min=Math.min(min, A[i]);
        	 if(A[i]-min>max) {
        		 max=A[i]-min;
        		 ans=1;
        	 } else if(A[i]-min==max) {
        		 ans++;
        	 }
         }

         System.out.println(ans);
     }

     // 文字列として入力を取得
     public static String gs() {
          return scanner.next();
     }

     // intとして入力を取得
     public static int gi() {
          return Integer.parseInt(scanner.next());
     }

     // longとして入力を取得
     public static long gl() {
          return Long.parseLong(scanner.next());
     }

     // doubleとして入力を取得
     public static double gd() {
          return Double.parseDouble(scanner.next());
     }
}

Measured memory_bytes: 59828
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
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++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
typedef unsigned long long ul;
ll a[1 << 17], b[1 << 17];
ll sum[1 << 17], ans[1 << 17];
struct uf {
private:
	vector<int> par, ran;
public:
	uf(int n) {
		par.resize(n);
		ran.resize(n);
		rep(i, n) {
			par[i] = i;
			ran[i] = 0;
		}
	}
	int find(int x) {
		if (par[x] == x)return x;
		else return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x), y = find(y);
		if (x == y)return;
		if (ran[x] < ran[y]) {
			par[x] = y;
			sum[y] += sum[x];
		}
		else {
			par[y] = x;
			sum[x] += sum[y];
			if (ran[x] == ran[y])ran[x]++;
		}
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
};
vector<int> G[1 << 17];
vector<pair<LP,int>> v;

int trans[1 << 17];
bool comp(pair<LP, int> a, pair<LP, int> b) {
	ll da = a.first.first - a.first.second;
	ll db = b.first.first - b.first.second;
	if (da != db)return da < db;
	return a < b;
}
int main() {
	int n, m; cin >> n >> m;
	uf u(n);
	v.resize(n);
	rep(i, n) {
		cin >> v[i].first.first >> v[i].first.second;
		v[i].second = i;
	}
	sort(v.begin(), v.end(),comp);
	rep(i, n) {
		a[i] = v[i].first.first, b[i] = v[i].first.second;
		sum[i] = b[i];
		trans[v[i].second] = i;
	}
	rep(i, m) {
		int u1, u2; cin >> u1 >> u2; u1--; u2--;
		u1 = trans[u1], u2= trans[u2];
		G[u1].push_back(u2);
		G[u2].push_back(u1);
	}
	rep(i, n) {
		vector<LP> s;
		rep(j, G[i].size()) {
			int to = G[i][j];
			if (to > i)continue;
			if(u.same(i,to)){
				continue;
			}
			else {
				to = u.find(to);
				s.push_back({ sum[to], ans[to] });
				u.unite(i, to);
			}
		}
		int len = s.size();
		int par = u.find(i);
		ll csum = 0;
		rep(j, len) {
			csum += s[j].first;
		}
		ll mi = max(a[i] + csum, b[i]+csum);
		rep(j, len) {
			ll z = max(a[i] + csum - s[j].first, b[i] + csum - s[j].first + s[j].second);
			mi = min(mi, z);
		}
		ans[par] = mi;
	}
	int pp = u.find(n - 1);
	cout << ans[pp] << endl;
	//stop
	return 0;
}


Measured memory_bytes: 14964
#include<stdio.h>

    int main(){
    int a,b,c;
    int d,e,f;
    int min;

    char buf[256];
    fgets(buf,256,stdin);
    sscanf(buf,"%d %d %d",&a,&b,&c);
    
    d = a+b;
    e = b+c;
    f = c+a;

    if(d>e){
    min = e;
    }else{
    min = d;
    }
    
    if(min>f){
    min = f;
    }

    printf("%d",min);

    }

Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for (int i = 0; i < (n); ++i)
const long long mod = 1e9 + 7;

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

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

int main() {
	int n, k;
	cin >> n >> k;
	
	vector<ll> h(n);

	rep(i, n) {
		cin >> h[i];
	}

	sort(h.rbegin(), h.rend());

	ll ans=0;

	rep(i, n) {
		if (i >= k) {
			ans+=h[i];
		}
	}

	cout << ans << endl;
	
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int arr[n][3];
    for(int i=0; i<n; i++)
    {
        cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
    }
    int ans[n][3];
    ans[0][0] = arr[0][0];
    ans[0][1] = arr[0][1];
    ans[0][2] = arr[0][2];
    for(int i=1; i<n; i++)
    {
        ans[i][0] = arr[i][0] + max(ans[i-1][1], ans[i-1][2]);
        ans[i][1] = arr[i][1] + max(ans[i-1][0], ans[i-1][2]);
        ans[i][2] = arr[i][2] + max(ans[i-1][0], ans[i-1][1]);
    }
    int k = max(ans[n-1][0], max(ans[n-1][1], ans[n-1][2]));
    cout<<k;

    return 0;
}



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

#define za ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mod %1000000007
#define moz 1000000007
#define nl "\n"
#define S second
#define F first
#define PB push_back
#define MP make_pair
#define V vector
//#define P pair
#define LEN length()
#define SZ size()
#define loop(i,a,b) for(int i=(a);i<=(b);i++)
typedef long long ll;
typedef complex<ll> P;
#define X real()
#define Y imag()


int main()
{
    za ;
    int x[100009];
    int n;
    cin >> n;
    loop(i,1,n)
    {
        cin >> x[i];
    }
    int co=0;
    loop(i,1,n)
    {
        if(x[i]==i)
        {
            if(i==1) swap(x[i],x[i+1]);
            else if(i==n) swap(x[i-1],x[i]);
            else if(x[i-1]==i) swap(x[i],x[i+1]);
            else if(x[i+1]==i) swap(x[i], x[i-1]);
            else swap(x[i],x[i+1]);
            co++;
        }
    }
    cout << co << nl;
}


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

int main(){
    string s;
    cin>>s;
    vector<string> d{"SAT","FRI","THU","WED","TUE","MON","SUN"};
    auto itr=d.begin();
    itr=find(d.begin(),d.end(),s);
    itr++;
    cout<<itr-d.begin()<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int nsum(int n, int max, int min, int s, int array[])
{
	int i;
	int sum = 0;
	int count = 0;

	for (i = 0; i < n; i++){
		sum += array[i];
	}
	for (i = min; i <= 9 && i <= s - sum; i++){
		if (n == max){
			if (sum + i == s){
				return 1;
			}
		}
		else {
			if (sum + i * 2 >= s){
				return count;
			}
			array[n] = i;
			count += nsum(n + 1, max, i + 1, s, array);
		}
	}
	return count;
}

int main(void)
{
	int n;
	int s;
	int array[100] = {0};

	scanf("%d%d", &n, &s);
	while (n != 0 || s != 0){
		printf("%d\n", nsum(0, n - 1, 0, s, array));
		scanf("%d %d", &n, &s);
	}

	return 0;
}

Measured memory_bytes: 600
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			String str=sc.nextLine();
			int sum=0;
			int num=0;
			for(int i=0; i<str.length(); i++) {
				num=str.charAt(i)-'0';
				sum+=num;
			}
			int s=Integer.valueOf(str);
			if(s%sum==0) {
				System.out.println("Yes");
			}
			else {
				System.out.println("No");
			}
			
			
		}
	}
}



Measured memory_bytes: 21716
s = input()
t = input()
dp = [[0]*(len(t)+1) for _ in range(len(s)+1)]
for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1)
        else:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j])
        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j], dp[i][j+1])

ans = ''
i, j = len(s), len(t)
while 0 < i and 0 < j:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        i -= 1
        j -= 1
        ans += s[i]
print(ans[::-1])

Measured memory_bytes: 144604
# -*- coding: utf-8 -*-
# 整数の入力
n, y = map(int, input().split())

# 出力となる各紙幣の組み合わせ
# num[0]: 10,000, [1]: 5,000, [2]: 1,000
num = [-1]*3

# １万円札でループ
for i in range(0, n+1):
    # ５千円札でループ
    for j in range(0, n+1-i):
        # 千円札の枚数
        k = n - i - j
        # print("Check i: " + str(i) + ", j: " + str(j) + ", k: " + str(k))
        sum = i * 10000 + j * 5000 + k * 1000
        if sum == y:
            # print("Matched.")
            num[0] = i
            num[1] = j
            num[2] = k
            break

# チェック結果の出力
print(" ".join(map(str, num)))


Measured memory_bytes: 3060
import java.util.*;
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {
    public static void main(String[] args) {
       
        FastScanner sc = new FastScanner();
	    int N=sc.nextInt();
		int[] nums=new int[N];
		for(int i=0;i<N;i++){
		    nums[i]=sc.nextInt();
		}
		
		int ans=0;
		for(int i=0;i<N-2;i++){
		    if((nums[i]<nums[i+1] && nums[i+1]<=nums[i+2]) || (nums[i]>=nums[i+1] && nums[i+1]>nums[i+2])){
		        ans++;
		    }
		}
		System.out.println(ans);
       
    }
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
	
	public char[][] nextCharsHW(int H,int W){
		char[][] chars=new char[H][W];
		for(int i=0;i<H;i++) {
			String str=next();
			for(int j=0;j<W;j++) {
				chars[i][j]=str.charAt(j);
			}
		}
		return chars;
	}
	
	public int[][] nextIntsNM(int N,int M){
		int[][] ints=new int[N][M];
		for(int i=0;i<N;i++) {
			for(int j=0;j<M;j++) {
				ints[i][j]=nextInt();
			}
		}
		return ints;
	}
}

Measured memory_bytes: 22612
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int  mod=1e9+7;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);  
cout.tie(0);   

#ifndef ONLINE_JUDGE
    if(fopen("INPUT.txt","r"))
    {
    freopen ("INPUT.txt" , "r" , stdin);
    freopen ("OUTPUT.txt" , "w" , stdout);
    }
#endif  

    int n,a,b;
    cin>>n>>a>>b;
    int tot=0;
    int x[n+1];
    for(int i=1;i<=n;i++)
    {
        cin>>x[i];
    }
    for(int i=2;i<=n;i++)
    {
        tot+=min((x[i]-x[i-1])*a,b);
    }
    cout<<tot;
} 


Measured memory_bytes: 1024
stairs = input()
size = len(stairs) - 1

pointer = 0
direction = stairs[0]
lastChange = 0
results = [0] * (size + 1)

while pointer <= size:
    if direction != stairs[pointer] or pointer == size:
        dif = int((pointer - lastChange) / 2)
        dif2 = int((pointer - lastChange - 1) / 2)
        if direction == "R":
            results[pointer] += dif + 1
            results[pointer - 1] += dif2 + 1
        else:
            if pointer == size:
                if (pointer - lastChange) % 2 == 1:
                    dif += 1
                else:
                    dif2 += 1
            if pointer - lastChange > 1 or pointer == size:
                results[lastChange] += dif2
                results[lastChange - 1] += dif
        lastChange = pointer
        direction = stairs[pointer]
    pointer += 1

print(" ".join(str(x) for x in results))

Measured memory_bytes: 10484
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>

using namespace std;

//#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

int H,W;
int masu[405][405] = {};
int color[405][405] = {};

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


int ans = 0;
LL bcnt;
LL wcnt;

void dfs(int h, int w, int c){
    color[h][w] = 1;
    used[h][w] = 1;
    if(c == 1) bcnt++;
    else wcnt++;


    for(int x = 0; x < 4; x++){
        int nx = h + dx[x];
        int ny = w + dy[x];
        if(0 <= nx && nx < H && 0 <= ny && ny < W && masu[nx][ny] == c *(-1)+1 && used[nx][ny] == 0){
            used[nx][ny] = 1;
            dfs(nx,ny,c*(-1)+1);
        }
    }
}

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> H >> W;
    REP(i,H){
        string S; cin >> S;
        REP(j,W){
            if(S[j] == '#'){
                masu[i][j] = 1;
            }
            else{
                masu[i][j] = 0;
            }
        }

    }
    LL ans = 0;
    REP(i,H) REP(j,W){
        bcnt = 0; wcnt = 0;
        if(masu[i][j] == 1 && color[i][j] == 0){
            dump(i)
            dump(j)
            dfs(i,j,1);
            dump(bcnt)
            dump(wcnt)
            ans += bcnt * wcnt;

        }
    }
    cout << ans << endl;

}

Measured memory_bytes: 9728
#include <iostream>

using namespace std;

bool contains_target(int num[4])
{
    int i;
    bool contain_flags[4] = {false};

    for(i = 0; i < 4; i++){
        if(num[i] == 1){
            contain_flags[0] = true;
        }else if(num[i] == 9){
            contain_flags[1] = true;
        }else if(num[i] == 7){
            contain_flags[2] = true;
        }else if(num[i] == 4){
            contain_flags[3] = true;
        }
    }

    for(i = 0; i < 4; i++){
        if(contain_flags[i] == false){
            return false;
        }
    }

    return true;
}

int main(void)
{
    int num[4];

    cin >> num[0] >> num[1] >> num[2] >> num[3];

    if(contains_target(num)){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}

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

int main() {
	int n, m, l;
	cin >> n >> m >> l;
	int A[100][100], B[100][100];
	long long int C[1000][1000];
	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++){
			cin >> A[i][j];
		}
	}
	for(int a=0; a<m; a++){
		for(int b=0; b<l; b++){
			cin >> B[a][b];
		}
	}
	for(int i=0; i<n; i++){
		for(int j=0; j<l; j++){
			for(int k=0; k<m; k++){
				C[i][j] += A[i][k]*B[k][j];
			}
		}
	}
	for(int c=0; c<n; c++){
		for(int d=0; d<l-1; d++){
			cout << C[c][d] << " ";
		}
		cout << C[c][l-1] << endl;
	}
	return 0;
}


Measured memory_bytes: 3628
N = int(input())
A = list(map(int,input().split()))

colors = [0,0,0]
ans = 1
MOD = 10**9+7
for a in A:
    tmp = 0
    for i in range(3):
        if colors[i]==a:
            if tmp==0:
                colors[i]+=1
            tmp += 1
    ans *= tmp
    ans %= MOD
print(ans)
    

Measured memory_bytes: 14396
#include<iostream>
using namespace std;
int main() {
  std::string a,b;
  cin >> a >> b;
  if (a=="H") {
  	if (b=="H") cout << "H" << endl;
    else cout << "D" << endl;
  }
  else {
  	if (b=="H") cout << "D" << endl;
    else cout << "H" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long 
using ldb = long double;
using pa = pair < int, int >;
#define F  first
#define S  second
#define f(i,x,n) for(int i=x;i<n;i++) 
#define all(c) c.begin(),c.end()
const int MOD = 1e9 + 7, N = 5e5 + 10;
const int LINF = LLONG_MAX;

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << setprecision(10) << fixed ;
    ldb l;
    cin >> l;
    ldb re =  (l/3)*(l/3)*(l/3);
    cout << re;
    return 0;
}
 

Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            new ABC124().SolveB(new ConsoleInput(Console.In, ' '));
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }

    public static class AtCoderLib
    {
        // ユークリッドの互除法 
        public static int Gcd(int a, int b)
        {
            if (a < b)
                // 引数を入替えて自分を呼び出す
                return Gcd(b, a);
            while (b != 0)
            {
                var remainder = a % b;
                a = b;
                b = remainder;
            }
            return a;
        }
    }
  class ABC124
    {
        public void SolveB(ConsoleInput cin)
        {
            var n = cin.ReadInt;
            var H = cin.ReadIntArray(n);
            int count = 0;
            int max = 0;
            foreach (var h in H)
            {
                if (max <= h)
                {
                    count++;
                    max = h;
                }
            }
            WriteLine(count);
            ReadLine();
        }
    }
}


Measured memory_bytes: 11220
#include <cstdio>
const int mo=924844033;
int f[4005][2005][2];
bool u[4005];
int main(){
	int n,k;
	scanf("%d%d\n",&n,&k);
	int x=(n-1)/k+1,y=0;
	for (int i=((n-1)%k+1)*2;i;i--) u[y+=x]=1;
	for (;y<2*n;) u[y+=x-1]=1;
	f[0][0][1]=1;
	for (int i=1;i<=2*n;i++)
		for (int j=0;j<=n;j++){
			f[i][j][0]=f[i][j][1]=f[i-1][j][1];
			if (!u[i-1] && j) (f[i][j][1]+=f[i-1][j-1][0])%=mo;
		}
	int ans=0;
	for (int i=0,j=(n&1)?-1:1,k=1;i<=n;j=-j,k=1ll*k*++i%mo)
		ans=(ans+1ll*f[2*n][n-i][1]*k*j)%mo;
	printf("%d\n",(ans+mo)%mo);
}

Measured memory_bytes: 62848
#include<bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>*/
 
using namespace std;
//using namespace __gnu_pbds;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define int long long 
#define rep(i,n) for(int i=0;i<n;i++)
#define repa(i,arr,n) for(int i=arr;i<=n;i++)
#define repd(i,arr,n) for(int i=arr;i>=n;i--)
#define trav(arr,x) for(auto& arr:x)
#define all(c) c.begin(), c.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz(arr) arr.size()
#define pi 3.14159265358979323846
#define MAX (1000*1000*1000+7)
#define vi vector<int>
#define pii pair<int,int>
#define pqueue priority_queue<int>
#define pdqueue priority_queue<int,vi,greater<int> >
//#define endl "\n"
 
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 
const int mod=1e10+7;
int power(int a,int b)
{
    int ans=1;
    while(b)
    {
        if(b&1)
        {
            ans=(ans*a)%mod;
        }
        a=(a*a)%mod;
        b>>=1;
    }
    return ans;
}

int32_t main()
{
    fast;

    int k,a,b,flag=0;
    cin>>k>>a>>b;
    int val=k;
    while(1)
    {
        if(val>b) break;
        if(val>=a && val<=b)
        {
            flag=1;
            break;
        }
        val+=k;
    }
    if(flag) cout<<"OK"<<endl;
    else cout<<"NG"<<endl;
}

Measured memory_bytes: 3664