akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef tuple<int, int> duo;

#define TT template<typename T>
#define ET(T) typename T::value_type
TT inline T sq(T x){return x*x;}
TT inline T In(){T x;cin>>x;return x;}
TT inline int ubnd(T&v,ET(T) x){return upper_bound(begin(v),end(v),x)-begin(v);}
TT inline int lbnd(T&v,ET(T) x){return lower_bound(begin(v),end(v),x)-begin(v);}
TT inline void sort(T&v){sort(begin(v),end(v));}
TT inline void revs(T&v){reverse(begin(v),end(v));}
TT inline void uniq(T&v){sort(v);v.erase(unique(begin(v),end(v)),end(v));}
TT inline void inpt(T&v,int n,function<ET(T)()>f=In<ET(T)>){for(v.reserve(n);n--;v.emplace_back(f()));}
TT inline void show(T&v,string d=" ",string e="\n"){int i=0;for(auto&x:v)i++&&(cout<<d),cout<<x;cout<<e;}
#undef TT
#undef ET

inline void fast_io(){ios::sync_with_stdio(0); cin.tie(0);}
inline int in(){int x;scanf("%d",&x);return x;}
inline string instr(){string x;cin>>x;return x;}
inline ll pow_mod(ll a, ll k, ll m){ll r=1;for(;k>0;a=a*a%m,k>>=1)if(k&1)r=r*a%m;return r;}
inline ll mod_inv(ll a, ll p){return pow_mod(a,p-2,p);}

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

struct Solver {
  int m, n;
  int field[128][128];
  Solver(int m, int n) : m(m), n(n) { memset(field, 0, sizeof(field)); }
  void read(){
    for (int i = 1; i <= n; i++){
      for (int j = 1; j <= m; j++){
        field[i][j] = in();
      }
    }
  }
  int solve(){
    int maxi = 0;
    for (int i = 1; i <= n; i++){
      for (int j = 1; j <= m; j++){
        maxi = max(maxi, dfs(j, i));
      }
    }
    return maxi;
  }
  int dfs(int x, int y){
    if (!field[y][x]) return 0;
    field[y][x] = 0;
    int maxi = 0;
    for (int i = 0; i < 4; i++) maxi = max(maxi, dfs(x + dx[i], y + dy[i]));
    field[y][x] = 1;
    return maxi + 1;
  }
};

int main()
{
  int m, n;
  while (cin >> m >> n, m || n){
    Solver s(m, n);
    s.read();
    cout << s.solve() << endl;
  }

  return (0);
}

// priority_queue queue deque front top push pop map set stringstream max_element min_element insert count find get tie make_tuple

Measured memory_bytes: 1316
using namespace std;

#include <bits/stdc++.h>

int main(){
    int N, M;
    cin >> N >> M;
    long long res = 0;

    int a[M + 7][N + 7];
    for ( int i = 0; i < M; i ++ ){
        int k;
        cin >> k;
        a[i][0] = k;
        for ( int j = 1; j <= k; j ++ ){
            cin >> a[i][j];
        }
    }

    int b[M + 1];
    for ( int i = 0; i < M; i ++ ){
        cin >> b[i];
    }

    for ( int i = 0; i < pow( 2, N ); i ++ ){
        int bulbs = 0;
        for ( int j = 0; j < M; j ++ ){
            int t = a[j][0];
            int switches = 0;
            for ( int p = 1; p <= t; p ++ ){
                int o = 1 << ( N - a[j][p] );
                int l = o & i;
                if ( l > 0 ) switches ++;
            }
            if ( switches % 2 == b[j] ) bulbs ++;
        }
        if ( bulbs == M ) res ++;
    }

    cout << res;
    return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> P(N);
  for(int i=0;i<N;i++){
    cin >> P.at(i);
  }
  int min=N+1;
  int count=0;
  for(int i=0;i<N;i++){
    if(min>P.at(i)){
      min=P.at(i);
      count++;
    }
  }
  cout << count << endl;
  
}

Measured memory_bytes: 1152
#include<stdio.h>

int main()
{
	int i,j,a[10],l;
	for(i=0;i<10;i++){
		scanf("%d",&a[i]);
	}
	
	for(i=0;i<10;i++){
		for(j=0;j<9;j++){
			if(a[j+1]>a[j]){
				l=a[j];
				a[j]=a[j+1];
				a[j+1]=l;
			}
		}
	}
	
	
	for(i=0;i<3;i++){
		printf("%d\n",a[i]);
	}
	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N, K, X,A,count;
    cin >> N >> K ;
    count = 0;
    bool data[N] = {false};
    for (int i = 0; i < K; i++){
        cin >> X;
         for (int j = 0; j < X; j++){
            cin >> A;
            data[A-1] = true;
         }
    }
    for (int i = 0; i < N; i++){
        if(!(data[i]))count++;
    }
    cout << count << endl;
}


Measured memory_bytes: 3592
L, R = map(int, input().split())

ans = []
imax = R - L + 1

for i in range(2019):
    a = L + i
    if a >= R:
        break
    for j in range(i + 1, 2020):
        b = L + j
        if b > R:
            break

        if (a*b)%2019 == 0:
            print(0)
            exit()
        ans.append((a*b)%2019)

print(min(ans))

Measured memory_bytes: 6784
n=int(input())
d=[]
for i in range(n):
    a,b,c=map(int,input().split())
    d.append((a,b,c))
    if c!=0:
        x=a
        y=b
        h=c

for i in range(101):
    for j in range(101):
        p=abs(i-x)+abs(j-y)+h
        for a,b,c in d:
            if (c==0 and p-abs(i-a)-abs(j-b)<1) or (c==(p-abs(i-a)-abs(j-b))):
                pass
            else:
                p=-1
                break
        if p!=-1:
            print(i,j,p)
            exit()


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

#define debug(x) cerr << #x << " = " << x << endl;
#define ii pair<int, int>
#define ll long long

const int p1 = 1000000007;
const int p2 = 1000000009;
const int b = 300;
const int ALPHA = 26;
int pot1[ALPHA], pot2[ALPHA];

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

	pot1[0] = 1;
	pot2[0] = 1;
	for(int i = 1; i < ALPHA; i++)
	{
		pot1[i] = (1ll * pot1[i-1] * b) % p1;
		pot2[i] = (1ll * pot2[i-1] * b) % p2;
	}

	string sa, sb;
	cin >> sa >> sb;
	int na = (int) sa.size(), nb = (int) sb.size();
	vector<ll> hashes;
	for(int i = 1; i <= na; i++)//tamanho da substring
	{
		int hash1 = 0, hash2 = 0;
		for(int j = 0; j < i; j++)
		{
			hash1 = (hash1 + pot1[sa[j] - 'a']) % p1;
			hash2 = (hash2 + pot2[sa[j] - 'a']) % p2;
		}
		hashes.push_back(1ll * p1 * hash1 + hash2);
		for(int j = i; j < na; j++)
		{
			hash1 = (hash1 + pot1[sa[j]     - 'a']) % p1;
			hash1 = (hash1 - pot1[sa[j - i] - 'a'] + p1) % p1;
			hash2 = (hash2 + pot2[sa[j]     - 'a']) % p2;
			hash2 = (hash2 - pot2[sa[j - i] - 'a'] + p2) % p2;
			hashes.push_back(1ll * p1 * hash1 + hash2);
		}
	}

	sort(hashes.begin(), hashes.end());

	for(int i = nb; i >= 1; i--)
	{
		int hash1 = 0, hash2 = 0;
		for(int j = 0; j < i; j++)
		{
			hash1 = (hash1 + pot1[sb[j] - 'a']) % p1;
			hash2 = (hash2 + pot2[sb[j] - 'a']) % p2;
		}
		auto it = lower_bound(hashes.begin(), hashes.end(), 1ll * p1 * hash1 + hash2);
		if(*it == 1ll * p1 * hash1 + hash2)
		{
			cout << i << endl;
			return 0;
		}
		for(int j = i; j < nb; j++)
		{
			hash1 = (hash1 + pot1[sb[j]     - 'a']) % p1;
			hash1 = (hash1 - pot1[sb[j - i] - 'a'] + p1) % p1;
			hash2 = (hash2 + pot2[sb[j]     - 'a']) % p2;
			hash2 = (hash2 - pot2[sb[j - i] - 'a'] + p2) % p2;
			auto it = lower_bound(hashes.begin(), hashes.end(), 1ll * p1 * hash1 + hash2);
			if(*it == 1ll * p1 * hash1 + hash2)
			{
				cout << i << endl;
				return 0;
			}
		}
	}
	cout << "0" << endl;

	return 0;
}



Measured memory_bytes: 68668
#include<bits/stdc++.h>
using namespace std;
int main(){
  int D;
  cin>>D;
  if(D==25){
    cout<<"Christmas"<<endl;
    return 0;
  }
  if(D==24){
    cout<<"Christmas Eve"<<endl;
    return 0;
  }
  if(D==23){
    cout<<"Christmas Eve Eve"<<endl;
    return 0;
  }
  if(D==22){
    cout<<"Christmas Eve Eve Eve"<<endl;
    return 0;
  }
}

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

int main()
{
    ios_base::sync_with_stdio(false);
    int N,K;
    cin >> N >> K;
    bool snake[101];
    for (int i = 0; i < 101; ++i) {
        snake[i] = false;
    }
    for (int i = 0; i < K; ++i) {
        int d, A;
        cin >> d;
        for (int j = 0; j < d; ++j) {
            cin >> A;
            snake[A-1] = true;
        }
    }

    int cnt = 0;
    for (int i = 0; i < N; ++i) {
        if (snake[i] == false) {
            ++cnt;
        }
    }

    cout << cnt << endl;

}



Measured memory_bytes: 3656
#include <bits/stdc++.h>
//#include <atcoder/all>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007; //998244353;

template<class _T> static void get(_T& a) {
	std::cin >> a;
}
template<class _T> static void get(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void get(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}
template <class _T> static _T tp_abs(_T a) {
	if (a < (_T)0) {
		a *= (_T)-1;
	}
	return a;
}

static void C();

int main()
{
	C();
	fflush(stdout);
	return 0;
}

static void C()
{
	int N;
	get(N);

	LLONG ans = 0;
	for (int A = 1; A < N; A++) {
		for (int B = 1; A * B < N; B++) {
			ans++;
		}
	}
	printf("%lld\n", ans);
}


Measured memory_bytes: 3772
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define endl '\n'
#define all(x) (x).begin(),(x).end()
const int INF=500+5;
const int N=200000+5;
const ll oo=1e18+5;
const ll mod=998244353;

ll pow5(ll a){
	return a*a*a*a*a;
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll x;
	cin>>x;
	for(ll i=-118;i<=119;++i){
		for(ll j=-118;j<=119;++j){
			if(pow5(i)-pow5(j)==x) return cout<<i<<" "<<j,0;
		}
	}
	return 0;
}


Measured memory_bytes: 3664
#include<stdio.h>
int main()
{
    int x,a,b;
    scanf("%d",&x);
    a=x%10;
    x/=10;
    b=x%10;
    if(a==9 || b==9)
    printf("Yes\n");
    else
    printf("No\n");
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=998244353;
signed main(){
    ll n;cin>>n;
    vector<vector<ll> >a(n,vector<ll>(n));
    bool f=0;
    rep(i,n){
        rep(j,n){
            char c;cin>>c;
            a[i][j]=c%2;
            if(a[i][j])f=1;
        }
    }
    if(!f){
        cout<<-1<<endl;
        return 0;
    }
    ll d=0;
    rep(j,n){
        ll cnt=0;
        rep(i,n){
            cnt+=a[i][j];
        }
        if(cnt==n)d++;
    }
    ll ans=n*n;
    rep(i,n){
        ll k=a[i][i];
        ll cnt=0;
        if(k){
            rep(j,n){
                cnt+=1-a[i][j];
            }
            cnt+=n-d;
        }else{
            ll s=0;
            rep(j,n){
                s+=a[j][i];
            }
            rep(j,n){
                cnt+=1-a[i][j];
            }
            if(s==0){
                cnt++;
            }
            cnt+=n-d;
        }
        ans=min(ans,cnt);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 5588
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (n, m) = get!(i32, i32);
    println!("{}", (n-1) * (m-1));
}

Measured memory_bytes: 4352
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func main() {
	args := readLine()
	argv := strings.Split(args, " ")
	result := "NO"
	numA, _ := strconv.Atoi(argv[0])
	numB, _ := strconv.Atoi(argv[1])
	numC, _ := strconv.Atoi(argv[2])
	for i := 1; i <= numB; i++ {
		if (numA*i)%numB == numC {
			result = "YES"
			break
		}
	}
	fmt.Println(result)
}

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

using namespace std;

int main() {
    int n; cin >> n;
    string temp;
    int ac = 0, wa = 0, tle = 0, re = 0;
    for(int i = 0; i < n; i++) {
        cin >> temp;
        if(temp == "AC") ac++;
        else if(temp == "WA") wa++;
        else if(temp == "TLE") tle++;
        else if(temp == "RE") re++;
    }
    cout << "AC x " << ac << "\n"
        << "WA x " << wa << "\n"
        << "TLE x " << tle << "\n"
        << "RE x " << re << "\n";
}

Measured memory_bytes: 3592
N,M,X=list(map(int,input().split(" ")))
A=list(map(int,input().split(" ")))

c1=0
for i in range(X+1,N):
  if i in A:
    c1+=1

c2=0
for i in range(X-1,0,-1):
  if i in A:
    c2+=1

print(min([c1,c2]))

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

int main()
{
	int n;

	cin >> n;

	vector<pair<int, int>> a(n);

	for (int i = 0; i < n; i++)
		cin >> a[i].second >> a[i].first;

	sort(a.begin(), a.end());

	int m = 0;
	bool f = 1;

	for (int i = 0; i < n; i++) {
		m += a[i].second;

		if (m > a[i].first) {
			f = 0;
			break;
		}
	}

	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<stack>
#include<vector>
#include<queue>
#include<set>
#include<algorithm>
#define INF 0x3f3f3f3f
#define mod 1000000009
#define e  2.718281828459045
#define eps 1.0e18
#define PI acos(-1)
#define lowbit(x) (x&(-x))
#define memset(x,y) memset(x,y,sizeof(x))
#define lson i << 1,l,m
#define rson i << 1 | 1,m + 1,r
#define ll long long
using namespace std;
pair <float,float> pt[1001],t;
map <pair<float,float>,int> mp;
struct Piont{
	float x,y;
}p[1001];
int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	//freopen("text1.in","r",stdin);
	//freopen("text1.out","w",stdout);
	ll n;
	cin>>n;
	cout<<n/500*1000+(n%500)/5*5<<endl;
	return 0;
}

Measured memory_bytes: 888
import java.math.BigDecimal;
import java.util.*;

public class Main {


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

        int n = sc.nextInt();
        sc.nextLine();
        String pStr = sc.nextLine();

        int[] p = new int[n];
        int[] temp = new int[n];
        for (int i = 0; i < n; i++) {
            p[i] = Integer.parseInt(pStr.split(" ")[i]);
            temp[i]  = Integer.parseInt(pStr.split(" ")[i]);
        }

        Arrays.sort(temp);

        boolean sorted = true;
        int before, after;
        before = after  = 0;
        for(int i = 0;i < n; i++){
            if(p[i] != temp[i]){
                sorted  = false;
                before = i;
                break;
            }
        }
        if(sorted){
            System.out.println("YES");
            return;
        }



        for(int i = n - 1; i >= 0; i--){
            if(p[i] != temp[i]){
                after = i;
                break;
            }
        }

        if(p[before] == temp[after] && p[after] == temp[before]){
            int t;
            t = p[after];
            p[after] = p[before];
            p[before] = t;
        }

        sorted = true;
        for(int i = 0;i < n; i++){
            if(p[i] != temp[i]){
                sorted  = false;
                break;
            }
        }
        if(sorted){
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

    }


}


Measured memory_bytes: 22868
#pragma GCC optimize("O3")

#include <bits/stdc++.h>

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define F first
#define S second
#define pii pair<int,int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<pii>
#define read(FILE)  freopen(FILE, "r", stdin);
#define out(FILE) freopen(FILE, "w", stdout);
#define clr(x, y) memset(x,y,sizeof(x));
#define IO ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define all(x) x.begin(),x.end()
#define rep(i, m, n) for(int i=m ; i<n ; i++)
#define forr(i, m, n) for(int i=m ; i<=n ; i++)
#define endl '\n'
#define pb push_back
#define re return
const int N = 1e5 + 5;
const ll OO = (ll) 1e9 + 7;
using namespace std;

int main() {
    IO;
    string s,t; cin>>s>>t;
    rep(i,0,min(t.size(),s.size()))
    if(s[i]!=t[i]) re cout<<"No",0;
    
    cout<<"Yes";



}

Measured memory_bytes: 3608
#include <cmath>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;


int main(){
    int N;
    int a;
    int waiting = 1;
    int ans = 0;

    cin >> N;

    for(int i = 0; i < N; i++){
        cin >> a;
        if(a != waiting){
            ans++;
        }else{
            waiting++;
        }
    }

    if(ans < N){
        cout << ans << endl;
    }else{
        cout << -1 << endl;
    }

    return 0;
}


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

def main():
    n = int(input())
    S = input()

    base = ord('A')
    ans = ''
    for i in range(len(S)):
        ans += chr((ord(S[i])-base+n)%26+base)
    print(ans)


if __name__ == '__main__':
    main()


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

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

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

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

int N;
int H[100000], step[100000];

signed main(){
    cin >> N;
    REP(i, N) cin >> H[i];
    step[N - 1] = 0;
    for(int i = N - 2; i >= 0; i--){
        if(H[i] >= H[i + 1]) step[i] = step[i + 1] + 1;
        else step[i] = 0;
    }
    int m = 0;
    REP(i, N) m = max(m, step[i]);
    PRINT(m);
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define cans cout << ans << endl
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
typedef long long ll;


int main(){
    ll a,b,c,d;
    cin >> a >> b >> c >> d;
    cout << (b-b/c-b/d+b/(c*d/__gcd(c,d))) - ((a-1)-(a-1)/c-(a-1)/d+(a-1)/(c*d/__gcd(c,d))) << endl;
    return 0;
}

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

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int N;
    vector<int> stairs;
    cin >> N;
    for (int temp, i = 0; i < N; i++) {
        cin >> temp;
        stairs.push_back(temp);
    }
    if (N == 1) cout << "Yes" << "\n";
    else {
        for (int i = stairs.size() - 2; i >= 0; i--) {
            if (stairs[i] - stairs[i + 1] <= 1) {
                if (stairs[i] - stairs[i + 1] == 1 && i != 0) {
                    stairs[i] = stairs[i] - 1;
                }
            } else {
                cout << "No" << "\n";
                return 0;
            }
        }
        cout << "Yes" << "\n";
    }
    return 0;
}

Measured memory_bytes: 892
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

long long N, M;
int main() {
    while (cin >> N >> M) {
        long long pow = 1LL<<M;
        long long ikkai = 1900LL * M + 100LL * (N - M);
        cout <<  ikkai * pow << endl;
    }
}






Measured memory_bytes: 256
#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> >;
template<class T = int> void print(vector<T> v){for(auto a:v)cout<<a<<" ";cout<<endl;}

/*
*/

ll dp[200010]={},ans=0,c=1;
map<ll,ll> m;
string s;

int main(void){
	cin>>s;
	m[0]=1;
	irep(i,s.size()){
		dp[i] = (dp[i+1] + c*(s[i]-'0')) % 2019;
		c = (c*10) % 2019;
		m[dp[i]]++;
	}
	for(auto itr=m.begin(); itr!=m.end(); itr++){
		ans += (itr->second)*(itr->second-1)/2;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 5264
import sys

N, A, B = list(map(int, input().split()))

if A > B:
  print(0)
  sys.exit()

if N == 1:
  if A != B:
    print(0)
  else:
    print(1)
  sys.exit()

print((B - A) * (N - 2) + 1)

Measured memory_bytes: 3060
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

s = input()

for i in range(len(s)):
	if  i < len(s)-1 and s[i] == s[i+1]:
		print(i+1, i+2)
		break
	elif i < len(s)-2 and s[i] == s[i+2]:
		print(i+1, i+3)
		break
else:
	print(-1, -1)


Measured memory_bytes: 10580
#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#include "queue"
#include "functional"
#include "map"
#include "unordered_map"
#include "set"
#include "stack"

#define lp(n) for (int i = 0; i < n; i++)
#define LP(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nya_n "(=^･ω･^=)"
typedef long long ll;
using namespace std;


/*
ll gcd(ll x, ll y) {
if (y == 0) return x;
return gcd(y, x%y);
}
/*
ll lcm(ll x, ll y) {
ll g = gcd(x, y);
return x / g * y;
}
ll pw(int x, int n) {
ll y = 1;
ll p = x;
while (n != 0) {
if (n % 2) {
y = y*p%mod;
n = n - 1;
}
else {
p = p*p%mod;
n = n / 2;
}
}
return y;
}

ll modinv(ll x) {
return pw(x, mod - 2);
}*/


int main() {
	int k;
	cin >> k;
	cout << (k / 2)*((k + 1) / 2) << endl;
	return 0;
}

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

int main() {
  string s;
  cin >> s;
  if (s == "Sunny"){
    cout << "Cloudy" << endl;
  }
  else if (s == "Cloudy"){
    cout << "Rainy" << endl;
  }
  else{
    cout << "Sunny" << endl;
  }
}

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

int main() {

	int n;
	int S[13] = { 1,2,3,4,5,6,7,8,9,10,11,12,13 };
	int H[13] = { 1,2,3,4,5,6,7,8,9,10,11,12,13 };
	int C[13] = { 1,2,3,4,5,6,7,8,9,10,11,12,13 };
	int D[13] = { 1,2,3,4,5,6,7,8,9,10,11,12,13 };
	char Mark[52];
	int Num[52];

	cin >> n;

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

	for (int i = 0; i < n; i++) {
		if (Mark[i] == 'S') S[Num[i]-1] = 0;
		if (Mark[i] == 'H') H[Num[i]-1] = 0;
		if (Mark[i] == 'C') C[Num[i]-1] = 0;
		if (Mark[i] == 'D') D[Num[i]-1] = 0;
	}

	for (int i = 0; i < 13; i++) {
		if (S[i] != 0) cout << 'S' << ' ' << S[i] << endl;
	}
	
	for (int i = 0; i < 13; i++) {
		if (H[i] != 0) cout << 'H' << ' ' << H[i] << endl;
	}

	for (int i = 0; i < 13; i++) {
		if (C[i] != 0) cout << 'C' << ' ' << C[i] << endl;
	}

	for (int i = 0; i < 13; i++) {
		if (D[i] != 0) cout << 'D' << ' ' << D[i] << endl;
	}
	

	return 0;
}



Measured memory_bytes: 3092
import Data.List
main=do
  s<-getLine
  k<-readLn::IO Int
  putStrLn $ if length s == 1
    then s
    else f s k

f s k
  | n1>=k = "1"
  | True = (:"") $ head $ dropWhile(=='1')s
    where n1 = length $ takeWhile(=='1')s


Measured memory_bytes: 508
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)

	m := make([]int, 26)

	for {
		sc.Scan()
		s := sc.Text()
		if len(s) == 0 {
			for k, v := range m {
				fmt.Printf("%c : %d\n", k+97, v)
			}
			return
		}
		for _, r := range s {
			if 'A' <= r && r <= 'Z' {
				m[r-65]++
			} else if 'a' <= r && r <= 'z' {
				m[r-97]++
			}
		}
	}
}



Measured memory_bytes: 1108
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <numeric>
#include <iomanip>
#include <math.h>
#include <stdio.h>

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

using namespace std;
//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; }
template<class T> inline bool chmin(T a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1LL << 60;
typedef long long int ll ;


#define INF 2000000000


int main(){
    int n;
    cin>>n;
    
    string s;
    cin >> s ;
    
    int tmp = 0;
    int count = 0;
    
    while(true){
        tmp = 0;
        tmp = s.find("ABC");
        //cout << s << endl;
        if(tmp >= 0){
	        s.erase(tmp, 3);
           count++ ;
        }else{
           break; 
        }  
        
        
    }
    cout << count << endl;

}


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

#define INX(x) (cin >> x)
#define INXV(vec, cnt) for(ll i; i < cnt; i++) INX(vec[i])
#define OUTX(x) (cout << x << endl)
#define OUTXV(vec) for(ll i; i < (ll)vec.size(); i++) OUTX(vec[i])

#define ADD emplace_back
#define MP make_pair

int main()
{
    ll H1, M1, H2, M2, K;
    cin >> H1 >> M1 >> H2 >> M2 >> K;

    ll wake = (H2 - H1) * 60 + M2 - M1;
    ll result = wake - K;
    OUTX(result);


    return 0;
}


Measured memory_bytes: 3676
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main(){
    ll x; cin>>x;
    if(x==7 || x==5 || x==3)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}

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

using namespace std;

const int mod = 998244353;

int add(int a, int b) {
  return a + b - mod * (a + b >= mod);
}

int mul(int a, int b) {
  return int(1ll * a * b % mod);
}

int power(int a, int x) {
  if (x == 0) {
    return 1;
  }
  return mul(power(mul(a, a), x >> 1), (x & 1 ? a : 1));
}

int divide(int a, int b) {
  return mul(a, power(b, mod - 2));
}

int sub(int a, int b) {
  return a - b + mod * (a < b);
}

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

  int n;
  cin >> n;
  vector<int> d(n);
  for (int i = 0; i < n; ++i) {
    cin >> d[i];
    if (i and d[i] == 0) {
      cout << 0;
      return 0;
    }
  }
  sort(d.begin(), d.end());
  if (d[0] != 0) {
    cout << 0;
    return 0;
  }
  int last = 0, cnt_last = 1, ans = 1, cnt = 0;
  for (int i = 1; i < n; ++i) {
    if (d[i] == last + 1) {
      ++cnt;
    } else if (d[i] == last + 2 and cnt) {
      ans = mul(ans, power(cnt_last, cnt));
      cnt_last = cnt;
      cnt = 1;
      ++last;
    } else {
      cout << 0;
      return 0;
    }
    if (i == n - 1 and cnt) {
      ans = mul(ans, power(cnt_last, cnt));
    }
  }
  cout << ans;

  return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long LL;
const LL INF = 1e18;
const int MAXN = 111111 * 2;
int n, E;
LL f[MAXN], minf[MAXN], x[MAXN], T, tr[MAXN << 2];

inline int get_node(int l, int r) {
	return l + r | l != r;
}

inline void build_tree(int l, int r) {
	int k = get_node(l, r);
	tr[k] = INF;
	if (l == r) return;
	int mid = l + r >> 1;
	build_tree(l, mid);
	build_tree(mid + 1, r);
}

inline void add(int l, int r, int x, LL val) {
	int k = get_node(l, r);
	if (l == r) {
		tr[k] = val;
		return;
	}
	int mid = l + r >> 1;
	if (x > mid) {
		add(mid + 1, r, x, val);
	} else {
		add(l, mid, x, val);
	}
	tr[k] = min(tr[get_node(l, mid)], tr[get_node(mid + 1, r)]);
}

inline LL query(int l, int r, int a, int b) {
	int k = get_node(l, r);
	if (l == a && r == b) {
		return tr[k];
	}
	int mid = l + r >> 1;
	if (a > mid) return query(mid + 1, r, a, b);
	if (b <= mid) return query(l, mid, a, b);
	return min(query(l, mid, a, mid), query(mid + 1, r, mid + 1, b));
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	cin >> n >> E >> T;
	for (int i = 1; i <= n; ++i) {
		cin >> x[i];
	}
	
	x[0] = 0;
	x[n + 1] = E;
	f[0] = 0;
	minf[0] = f[0] - x[0] - x[1] * 2;
	build_tree(0 + 1, n + 1);
	add(0 + 1, n + 1, 0 + 1, f[0] - x[0]);
	for (int i = 1; i <= n; i++) {
		f[i] = f[i - 1] + x[i] - x[i - 1] + T;
		/*for (int j = 0; j < i; ++j) {
			LL temp;
			if (T > (x[i] - x[j + 1]) * 2) {
				temp = f[j] + x[i] - x[j] + T;
			} else {
				temp = f[j] + x[i] - x[j] + (x[i] - x[j + 1]) * 2;
			}
			f[i] = min(f[i], temp);
		}*/
		int left = 0, right = i - 1;
		while (left < right) {
			int mid = left + right >> 1;
			if (T > (x[i] - x[mid + 1]) * 2) {
				right = mid;
			} else {
				left = mid + 1;
			}
		}
		f[i] = min(f[i], query(0 + 1, n + 1, left + 1, i - 1 + 1) + x[i] + T);
		if (left > 0) {
			f[i] = min(f[i], minf[left - 1] + x[i] * 3);
		}
		minf[i] = min(minf[i - 1], f[i] - x[i] - x[i + 1] * 2);
		add(0 + 1, n + 1, i + 1, f[i] - x[i]);
	}
	cout << f[n] + x[n + 1] - x[n] << endl;
}

Measured memory_bytes: 7552
#include <stdio.h>

long long ed (long a, long b) {
	long long c = a%b;
	if (c==0)
		return b;
	return ed (b,c);
}

int main () {
	long long A,B,C,D;
	scanf ("%lld %lld %lld %lld", &A, &B, &C, &D);
	long long lcm = C*D/ed (C,D);
	long long numa = (A-1)/C + (A-1)/D - (A-1)/lcm;
	long long numb = B/C + B/D - B/lcm;
	printf ("%lld\n", B-A+1-numb+numa);
	return 0;
}


Measured memory_bytes: 128
n = gets.to_i
$lst = Array.new(n)
parent = Array.new(n, -1)
$depth = Array.new(n, 0)
def dps(i, dep)
  if $lst[i].size == 0
    $depth[i] = dep
    return
  end
  $lst[i].each{ |j| dps(j,dep+1) }
  $depth[i] = dep
  return
end
n.times do
  l = gets.split.map(&:to_i)
  id = l.shift
  l.shift
  l.each { |i| parent[i] = id }
  $lst[id] = l
end
n.times{ |i| dps(i,0) if parent[i] == -1 }
n.times do |i|
  s = ""
  if parent[i] == -1 then s = "root"
  elsif $lst[i].size == 0 then s = "leaf"
  else s = "internal node"
  end
  puts "node #{i}: parent = #{parent[i]}, depth = #{$depth[i]}, #{s}, #{$lst[i]}"
end

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

int main() {
    int N;
    cin >> N;
    vector<int> a(N+1);
    rep(i, N) cin >> a[i+1];

    int ret = 0;
    vector<int> ans(N+1, 0);

    for (int i=N; i>=1; --i) {

        int sm = 0;
        for (int j=i; j<=N; j+=i) sm += ans[j];

        // 0の場合
        if (a[i] == 0) {
            if (sm%2 == 0) ;
            else {
                ret++;
                ans[i] = 1;
            }
        }
        else {
            if (sm%2 == 1) ;
            else {
                ret++;
                ans[i] = 1;
            }
        }
    }

    cout << ret << endl;
    for (int i=1; i<=N; ++i) {
        if (ans[i]) cout << i << " ";
    }

    return 0;
}


Measured memory_bytes: 2432
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

n = int(input())
mod = 10**23 + 117

d = {}

S = [input()[:-1] for i in range(n)]

S.sort(key = lambda x:len(x))

ans = 0
for s in S:
    if len(s) == 1:
        if -1 in d.keys():
            array = d[-1]
            ans += array[ord(s) - ord("a")]
        else: d[-1] = [0]*26
        d[-1][ord(s) - ord("a")] += 1
    else:
        h = 0
        cnt = [0]*26
        for t in s:
            cnt[ord(t) - ord("a")] += 1
        if -1 in d.keys():
            array = d[-1]
            for i in range(26):
                if cnt[i] > 0 and array[i] > 0:ans += 1
        for t in s[len(s) - 1:0:-1]:
            num = ord(t) - ord("a")
            h += num + 1
            h *= 29
            h %= mod
            cnt[num] -= 1
            if h in d.keys():
                array = d[h]
                for i in range(26):
                    if cnt[i] > 0 and array[i] > 0:ans += 1
        if h not in d.keys(): d[h] = [0]*26
        d[h][ord(s[0]) - ord("a")] += 1
print(ans)


Measured memory_bytes: 175988
n=input()
A=sorted(([int(e) for e in raw_input().split()] for _ in range(n)),key=lambda (x,y):x+y)
H=[0]
for (x,y) in A:
	for i in range(len(H)-1,-1,-1):
		if x>=H[i]:
			if i==len(H)-1: H.append(1e9)
			H[i+1]=min(H[i]+y,H[i+1])
print len(H)-1

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;

const int MOD = 1000000007;

int main() {
    int N;
    cin >> N;
    if (N == 1) {
        cout << "Hello World" << endl;
    } else {
        int A, B;
        cin >> A >> B;
        cout << A + B << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b)for(int i=(a);i<=(b);i++)
#define repR(i,n) for(int i=n;i>=0;i--)
#define P pair<int, int>
#define sz(x) x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<int>
#define COUT(x) cout<<(x)<<endl
#define MA map<int,int>
#define SE set<int>
#define PQ priority_queue
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

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

using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1LL << 50;

// pair -> vector<pair<int,int>> 
//		   AandB.push_back(make_pair(a[i],b[i]))



signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, m; cin >> n >> m;
	VE a(n);rep(i, n)cin >> a[i];
	PQ<int> pque;
	rep(i, n) {
		pque.push(a[i]);
	}
	rep(i, m) {
		int tmp = pque.top();
		pque.pop();
		tmp /= 2;
		pque.push(tmp);
	}
	int ans = 0;
	while (!pque.empty()) {
		ans += pque.top(); pque.pop();
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2168
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(M)]

island_go_from_1 = set()
island_go_to_N = set()
for i in range(M):
    if ab[i][0] == 1:
        island_go_from_1.add(ab[i][1])
    if ab[i][1] == N:
        island_go_to_N.add(ab[i][0])

ans = island_go_from_1 & island_go_to_N
if len(ans) == 0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")

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

using namespace std;    
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const bool DEBUG = true;


int main(){
    
    ll a;
    long double b;
    cin >> a >> b;
    ll ans = a * b;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3732
#include <stdio.h>

int main()
{
	int N;
  	int total = 0;
    int l;
    int r;

  	scanf("%d", &N);
    for (int i = 0;i < N;i++)
    {
        scanf("%d %d", &l, &r);
        total += r - l + 1;
    }
    printf("%d\n", total);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ll long long
#define V vector<long long>
#define VV vector<vector<long long>>
#define rep(i,n) for(ll (i)=0;(i)<(n);++(i))
using namespace std;
 
int main(){
    ll n;
    cin>>n;
    string s=to_string(n);
    rep(i,s.size()){
        if(s[i]=='7'){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
}

Measured memory_bytes: 3664
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
		if len(os.Args) > 2 {
			wfp, _ = os.Create(os.Args[2])
		}
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	s := getNextString(scanner)
	n := len(s)
	aa := make([]int, n+1)
	for i := n - 1; i >= 0; i-- {
		if s[i] == '>' {
			aa[i] = aa[i+1] + 1
		}
	}
	for i := 0; i < n; i++ {
		if s[i] == '<' {
			aa[i+1] = maxint(aa[i]+1, aa[i+1])
		}
	}

	var ans int64
	for i := 0; i < n+1; i++ {
		ans += int64(aa[i])
	}
	fmt.Fprintln(writer, ans)
	writer.Flush()
}

func maxint(a int, b int) int {
	if a > b {
		return a
	}
	return b
}


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

int main(){
  int N,K;
  cin >> N >> K;
  
  int target = 0;
  int ans = 0;
  for(int i=0; i<N; i++){
    cin >> target;
    if(K-target < target)ans += (K-target)*2;
    else  ans +=target*2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3600
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long LL;
const int maxn = 2e5+10;
const LL mod =1e9+7;
int pre[maxn];
int vis[maxn],Rank[maxn];
void init(int n)
{
    for(int i = 1;i<=n;++i)
        pre[i] = i,Rank[i] = 1;
}
int Find(int x)
{
    int t = x;
    while(pre[x]!=x)
    {
        x = pre[x];
    }
    pre[t] = x;
    return x;
}
void un(int x,int y)
{
    x = Find(x);
    y = Find(y);
    if(x!=y)
    {
        if(Rank[x]<=Rank[y])
        {
            pre[x] = y;
            Rank[y]+=Rank[x];
        }
        else
        {
            pre[y] = x;
            Rank[x]+=Rank[y];
        }
    }
}
int main()
{
   int n,m;
   scanf("%d%d",&n,&m);
   init(n);
   while(m--)
   {
       int x,y;
       scanf("%d%d",&x,&y);
       un(x,y);
   }
   int ans = 0;
   for(int i = 1;i<=n;++i)
   {
       Find(i);
      // cout << i  << " " << pre[i] << "\n";
      int d = pre[i];
      vis[d]++;
       ans = max(ans,vis[d]);
   }
  printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 3968
S = str(input())
T = str(input())
count = 0
max_count = 0

for i in range(len(S)-len(T)+1):
    nowS = S[i:i+len(T)]
    for j in range(len(T)):
        if nowS[j] == T[j]:
            count += 1
    max_count = max(max_count, count)
    count = 0
print(len(T) - max_count)

Measured memory_bytes: 73508
#include <stdio.h>
#define white 0
#define black 1

int a[100][100], n, t, d[100], q[100], color[100],qq;

void bps(int s) {
    int i;
    for (i = 0; i < n; ++i) {
        if (a[s][i] == 1) {
            if (color[i] == white) {
                color[i] = black;
                q[qq++] = i;
                d[i] = d[s] + 1;
            }
            else {
                if (d[s] + 1 < d[i]) d[i] = d[s] + 1;
            }
        }
    }
    
    if (t < qq){
        bps(q[t++]);
    }
    
}

int main() {
    int i, j, u, k, b;
    scanf("%d", &n);
    
    for (i = 0; i < n; ++i) {
        for (j = 0; j < n; ++j) {
            a[i][j]  = 0;
        }
    }
    
    for (i = 0; i < n; ++i) {
        scanf("%d %d", &u, &k);
        for (j = 0; j < k; ++j) {
            scanf("%d", &b);
            a[u-1][b-1]  = 1;
        }
    }
    
    
    for (i = 0; i < n; ++i) {
        color[i] = white;
    }
    qq = 0;
    t = 0;
    color[0]=black;
    d[0] = 0;
    bps(0);
    
    for (i = 1; i < n; ++i) {
        if (color[i] == white) d[i] = -1;
    }
    
    for (i = 0; i < n; ++i) {
        printf("%d %d\n", i+1, d[i]);
    }
    
    return 0;
}

Measured memory_bytes: 1820
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <ctime>
#include <map>
#include <stack>
#include <sstream>
#include <set>
#include <cmath>
#include <functional>
#include <memory.h>

// pi = atan(1)*4;

#define INTMAX 2100000000

using namespace std;

int main(void)
{
	int n, k;

	cin >> n >> k;

	int num = 1;
	for (int i = 0; i < n; i++)
	{
		if (num * 2 < num + k)
		{
			num *= 2;
		}
		else
		{
			num += k;
		}
	}

	cout << num << '\n';
	return 0;
}





Measured memory_bytes: 256
using System;
using static System.Console;
using static System.Math;

public class Hello{
    public static void Main(){
        string[] input = ReadLine().Split(' ');
        int kazu = int.Parse(input[0]);
        string[] suji = ReadLine().Split(' ');
//        int max = int.Parse(input[1]);
        int[] suuji = new int[kazu];
        for(int i=0;i<kazu;i++){
            suuji[i] = int.Parse(suji[i]);
        }
        for(int i=0;i<kazu*10;i++){
            for(int j=0;j<kazu-1;j++){
                if(suuji[j] > suuji[j+1]){
                    int temp = suuji[j];
                    suuji[j] = suuji[j+1];
                    suuji[j+1] = temp;
                }
            }
        }
        
/*        for(int i=0;i<kazu;i++){
            WriteLine(suuji[i]);
        }*/
        
        int a=int.Parse(input[1]);
        int ans = 0;
        for(int i=0;i<kazu;i++){
//            WriteLine("a{0}",a);
            if(suuji[i]<=a){
                a -= suuji[i];
                ans++;
            }
        }
//        WriteLine("aa{0}",a);
        if(ans == kazu && a>0){
            ans--;
//            WriteLine("ddd");
        }
        WriteLine(ans);
    }
}

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

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a%b);
}

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

struct edge {
	ll ind;
	ll to;
	ll d;
};


///////////////////////////


int main() {
   string s;
   cin >>s;

   for(ll i=0; i<s.size(); i+=2){cout <<s[i];}

}


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

int main(){
    long long n,k;
    cin >> n >> k;
    vector<pair<int,int>> res(n);
    for(int i=0;i<n;i++){
        int a,b;
        cin >> a >> b;
        res[i]=make_pair(a,b);
    }
    sort(res.begin(),res.end());
    long long cnt=0;
    for(int i=0;i<=n;i++){
        if(cnt<k&&i<n){
            cnt+=res[i].second;
        }else{
            cout << res[i-1].first << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 1024
k, n = map(int, input().split())
A = list(map(int, input().split()))

dist = 0
ng = 0
for i in range(n-1):
    sub = A[i+1] - A[i]
    if sub > ng:
        ng = sub
    dist += sub

sub = A[0] + (k - A[-1])
if sub > ng:
    ng = sub
dist += sub

print(dist - ng)

Measured memory_bytes: 32284
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  string s;
  cin >> n >> s;
  int x = 0;
  int ans = 0;
  REP(i,n){
    if(s[i]=='I') x++;
    else x--;
    ans = max(ans,x);
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<string>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<limits>
#include<bitset>
#include<array>
#include<numeric>
#include<iomanip>
#include<functional>
#include<deque>

using namespace std;
typedef long long int ll;

#define C cout<<
#define E <<endl
#define CE cout<<endl

ll n,m,a,b,c,x,y,z,aa[200010],ab[200010],ac[1010];
bool r,ra,rb,rc[200010];
string s,sa,sb,sc;
char ca,cb,cc,cd[1010][1010];
vector<ll> va,vb,vc,vd,ve;
set<int> st;

template<typename MAIN> ostream & operator<<(ostream & osys,const vector<MAIN> target){ for(MAIN it:target)osys<<it<<" "; return osys; }

int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>aa[i];
        va.push_back(aa[i]);
    }
    va.push_back(aa[0]);
    //sort(va.begin(),va.end());

    m=va[0];
    a=va[1];
    for(int i=1;i<n;i++){
        a=va[i];
        if((m xor a)!=m and (m xor a)!=a  and m!=a){
            swap(va[1],va[i]);
            break;
        }
    }
    vb={va[0],va[1]};

    for(int i=1;i<n;i++){
        m=vb[i-1] xor vb[i];
        //cout<<m<<endl;
        vb.push_back(m);
    }
    sort(va.begin(),va.end());
    sort(vb.begin(),vb.end());

    //C va E;
    //C vb E;
    C (va==vb ? "Yes":"No") E;
}


Measured memory_bytes: 4596
#include <iostream>
#include <vector>
using namespace std; using P=pair<int,int>; using ll=long long;
const ll m = 1e9+7;

int main() {
	string s; cin>>s;
  if (s[0] == '7' || s[1]=='7' || s[2]=='7') cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

int main2() {
  int n; cin>>n;
  for(int i=1;i<=n;i++) {

  }
}

Measured memory_bytes: 3620