akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, a, b) for(ll i = a; i < b; i++)
#define out(x) std::cout << x << '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define sz(x) ((int)(x).size())
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INF = INT_MAX / 2;
const ll  inf = LLONG_MAX / 2;
const int mod = 1000000007;
const int MAX_N = 101010;
const long double PI = acos(-1);

std::map<ll, ll> prime_factor(ll n) {
	std::map<ll, ll> res;
	for (ll i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			++res[i];
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	/*------------------------------*/

	ll n;
	cin >> n;

	vector<ll> e(n + 1, 0);

	for (ll i = 2; i <= n; i++) {
		for (auto pf : prime_factor(i)) {
			e[pf.first] += pf.second;
		}
	}

	map<ll, ll> cnt;
	for (auto x : e) {
		if (x >= 74) {
			cnt[74]++;
		}
		if (x >= 24) {
			cnt[24]++;
		}
		if (x >= 14) {
			cnt[14]++;
		}
		if (x >= 4) {
			cnt[4]++;
		}
		if (x >= 2) {
			cnt[2]++;
		}
	}

	ll ans = 0;
	ans += cnt[74];
	ans += cnt[24] * (cnt[2] - 1);
	ans += cnt[14] * (cnt[4] - 1);
	ans += (cnt[4] * (cnt[4] - 1)) / 2 * (cnt[2] - cnt[4]);
	ans += (cnt[4] * (cnt[4] - 1)) / 2 * (cnt[4] - 2);

	out(ans);

	return 0;
}

Measured memory_bytes: 256
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

L = I()

print(L**3/27)

Measured memory_bytes: 38256
#include <iostream>
#include <bitset>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)

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

    long odd=0, even=0;
    REP(i, S.size())
    {
        if (i % 2 == 0)
        {
            if(S[i] == '0')
            {
                odd++;
            }
            else
            {
                even++;
            }
            
        }
        else
        {
            if(S[i] == '0')
            {
                even++;
            }
            else
            {
                odd++;
            }
        }
    }

    cout << min(odd, even) << endl;
}

Measured memory_bytes: 512
const main = (inputs) => {
  var N = inputs[0].split(" ")[0];
  var D = inputs[0].split(" ")[1];
  var list = inputs.filter((v,i)=>i>0).map(v=>v.split(" "));
  var ans = 0;
  for(var i=0;i<N;i++){
    for(var j=i+1;j<N;j++){
      var dis = 0;
      for(var k=0;k<D;k++){
        dis += Math.pow(list[i][k]-list[j][k], 2);
      }
      if(Math.sqrt(dis) == ~~Math.sqrt(dis)) ans++;
    }
  }
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split("\n"));


Measured memory_bytes: 21064
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    ll ans = n*(n-1)/2;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3656
import numpy as np

H, W = list(map(int, input().split()))
arr = np.array([list(input()) for i in range(H)])
arr = arr[(np.apply_along_axis(lambda line: '#' in line, 1, arr))]
arr = arr[:, (np.apply_along_axis(lambda line: '#' in line, 0, arr))]
for l in arr.tolist():
    print(''.join(l))


Measured memory_bytes: 21260
import scala.io.StdIn
object Main extends App {
  val List(a, b) = StdIn.readLine().split(" ").map(_.toInt).toList
  var tmp = 1
  var answer = 0
  while (tmp < b) {
    tmp += a
    tmp -= 1
    answer += 1
  }
  println(answer)
}


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


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, max=0, count=0;
  cin >> N;
  vector<int> H(N);
  REP(i,N) cin >> H[i];
  REP(i,N) {
    if(H[i]>=max) {
      max=H[i]; 
      count++;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
import sys
from sys import exit
from math import gcd, factorial, ceil, floor, sqrt
from bisect import bisect_left, bisect_right
from copy import deepcopy
from heapq import heapify, heappop, heappush
from itertools import permutations, combinations, product, accumulate
from collections import defaultdict, deque
sys.setrecursionlimit(10**7)

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

K, N = mi()
A = li()

ls = []
for i in range(N-1):
    ls.append(A[i+1] - A[i])
ls.append(A[0] + (K - A[-1]))
print(K - max(ls))

Measured memory_bytes: 34312
#include <stdio.h>
#include <string.h>
int main() {
	char s[11];
	int l, p = 0, d[11];
	long long int ans = 0, a = 0;
	scanf("%s", s);
	l = strlen(s);
	for (int i = 0; i < l; i++)
	{
		d[i] = (int)(s[i] - '0');
	}
	for (int i = 0; i < 1 << (l - 1); i++)
	{
		a = d[0];
		for (int j = 0; j < l - 1; j++)
		{
			if (i & (1 << j)) {
				ans += a;
				a = 0;
			}
			a *= 10;
			a += d[j + 1];
		}
		ans += a;
	}
	printf("%lld", ans);
	return 0;
}

Measured memory_bytes: 128
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

int[][10^^5] G;
bool[10^^5] MEMO;

void main()
{
    auto nm = readln.split.to!(int[]);
    auto N = nm[0];
    auto M = nm[1];

    foreach (_; 0..M) {
        auto ab = readln.split.to!(int[]);
        auto A = ab[0]-1;
        auto B = ab[1]-1;
        G[A] ~= B;
        G[B] ~= A;
    }

    auto r = [0];
    MEMO[0] = true;
    void solve() {
        for (;;) {
            auto p = r[$-1];
            foreach (q; G[p]) if (!MEMO[q]) {
                r ~= q;
                MEMO[q] = true;
                goto next;
            }
            break;
            next:
        }
    }
    solve();
    reverse(r);
    solve();
    writeln(r.length);
    writeln(r.map!(i => (i+1).to!string).join(" "));
}

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

using ll = long long;

const int N = 100005;

int n, m, c, a[N], v[N];
vector<int> e[N];
priority_queue<int, vector<int>, greater<int>> p, q;
ll r;

void f(int x, int y){
    v[x] = 1;
    p.push(a[x]);
    for(int i : e[x]) if(i != y) f(i, x);
}

int main(){
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; i++) scanf("%d", a + i);
    for(int x, y; m--; ){
        scanf("%d%d", &x, &y);
        e[x].push_back(y);
        e[y].push_back(x);
    }
    for(int i = 0; i < n; i++){
        if(v[i]) continue;
        c++;
        f(i, 0);
        r += p.top();
        p.pop();
        while(!p.empty()){ q.push(p.top()); p.pop(); }
    }
    for(int i = 0; i < c - 2; i++){
        if(q.empty()){ puts("Impossible"); return 0; }
        r += q.top();
        q.pop();
    }
    printf("%lld\n", (c > 1) * r);
}

Measured memory_bytes: 7676
#include <iostream>
#include <algorithm>
#include <vector>

int main() {
  int n, k;
  std::cin >> n >> k;
  std::vector<int> h(n);
  for (int i = 0; i < n; i++) {
    std::cin >> h[i];
  }
  std::sort(h.begin(), h.end());
  long long ans = 1000000000;
  for (int i = 0; i < n - k + 1; i++) {
    if (ans > h[i + k - 1] - h[i]) {
      ans = h[i + k - 1] - h[i];
    }
  }
  std::cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 640
#coding:utf-8
n=[int(i) for i in input().split()]
if((n[0]+n[1])%3==0):
  print("Possible")
elif(n[0]%3==0):
  print("Possible")
elif(n[1]%3==0):
  print("Possible")
else:
  print("Impossible")

Measured memory_bytes: 3060
N, A, B = map(int,input().split())

if (B-A)%2 == 0:
    print((B-A)//2)
else:
    ans1 = A + (B-A-1)//2
    ans2 = N-B+1 + (N-(A+N-B+1))//2
    print(min(ans1, ans2))

Measured memory_bytes: 3060
n,d = map(int,input().split())
obj = [list(map(int,input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    for j in range(n):
        if i == j:
            pass
        else:
            dis = 0
            for k in range(d):
                dis += (obj[i][k] - obj[j][k])**2
            dis = dis ** 0.5
            if dis == dis // 1:
                ans += 1

print(ans//2)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define FPEN freopen("in.txt", "r", stdin);
#define debug(...)                                                             \
    { cerr << "# " << __VA_ARGS__ << "\n"; }
#else
#define debug(...)
#define FPEN
#endif
const int maxn = 200009;
typedef long long i64;
typedef pair<i64, i64> pi64;
typedef pair<int, int> pi;
const i64 MOD = 119 << 23 | 1;
class {
  public:
    void solve() {
        int a, b;
        cin >> a >> b;
        b *= 10;
        for (int i = b; i < b + 10; ++i) {
            if (i * 8 / 100 == a) {
                cout << i << '\n';
                return;
            }
        }
        cout << -1;
        return;
    }
} NSPACE;
int main() {
    FPEN;
    ios_base::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    NSPACE.solve();
}

Measured memory_bytes: 256
from sys import exit
S = input()
t = ['+', '-']
for i in range(2):
    for j in range(2):
        for k in range(2):
            r = S[0]+t[i]+S[1]+t[j]+S[2]+t[k]+S[3]
            if eval(r)==7:
                print(r+'=7')
                exit()

Measured memory_bytes: 3060
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
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;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
const ll mod=1e9+7;
const int inf=1<<30;

ll dp[41][2];

int main(){
  ll n,k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  string s;
  int i=0;
  while((1ll<<i)<=k){
    if((1ll<<i)&k) s='1'+s;
    else s='0'+s;
    i++;
  }
  int l=s.size();
  rep(i,l)rep(j,2){
    ll x=(1ll<<(l-1-i));
    ll cnt=0;
    rep(m,n){
      if(a[m]&x) cnt++;
    }
    int nj=j;
    if(s[i]=='1'){
      if(i>0) chmax(dp[i+1][nj],dp[i][j]+x*(n-cnt));
      if(i==0) chmax(dp[i+1][0],dp[i][0]+x*(n-cnt));
      chmax(dp[i+1][1],dp[i][j]+x*cnt);
    }
    else{
      chmax(dp[i+1][1],dp[i][1]+x*(n-cnt));
      if(i>0) chmax(dp[i+1][nj],dp[i][j]+x*cnt);
      if(i==0) chmax(dp[i+1][0],dp[i][0]+x*cnt);
    }
  }
  ll ans=0;
  rep(j,2){
    chmax(ans,dp[l][j]);
  }
  for(i=l;i<41;i++){
    ll x=(1ll<<i);
    ll cnt=0;
    rep(m,n){
      if(a[m]&x) cnt++;
    }
    ans+=x*cnt;
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
//AtCoder Beginner Contest 047 C問題
#include <bits/stdc++.h>
using namespace std;

int main(){
	bool white = true;
	int ans = 0;
	char s[123456];
	for(int i=1; i<123456; i++){
		s[i] = 0;
	}
	scanf("%s", s);
	for(int i=1; i<123456; i++){
		if(s[0] == 'W'){
			if(s[i] == 'W' && !white){
				ans++;
				white = true;
			}
			if(s[i] == 'B' && white){
				ans++;
				white = false;
			}
		}
		else{
			if(s[i] == 'W' && white){
				ans++;
				white = false;
			}
			if(s[i] == 'B' && !white){
				ans++;
				white = true;
			}
		}
	}
	printf("%d\n", ans);
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <math.h>
#include <iostream>
#include <stdlib.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
 
int main(void){
    int n;
    cin >> n;
    int A[n], B[n], C[n-1];
    REP(i,n) cin >> A[i];
    REP(i,n) cin >> B[i];
    REP(i,n-1) cin >> C[i];
    int satisfy = 0;
    int eat_index = -2;
    REP(i,n){
        satisfy += B[A[i]-1];
        if(A[i]-1==eat_index+1){
            satisfy += C[eat_index];
        }
        eat_index = A[i]-1;
    }
    cout << satisfy << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <functional>
#include <vector>

char s[5005];
long long dp[5005][5005], n, ans;
std::vector <long long> split;

int main () {
	std::cin >> (s+1);
	n = strlen (s+1);
	std::function <void (int, long long)> dfs;
	dfs = [&dfs] (int dep, long long cur) {
		if (dep == n+1) {
			ans += cur;
			for (auto x : split)
				ans += x;
			return;
		}
		dfs (dep + 1, cur * 10 + s[dep]-'0');
		split.push_back (cur);
		dfs (dep + 1, s[dep]-'0');
		split.pop_back ();
		return;
	};
	dfs (1, 0);
	std::cout << ans/2 << "\n";
	return 0;
}

Measured memory_bytes: 256
#python3

def main():

    k, s = map(int, input().split())
    ctn = 0
    for i in range(k+1):
        for j in range(k+1):
            v = s - (i + j)
            if (0<=v) & (v<=k):
                ctn += 1  
    print(ctn)
main() 

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
const ll MOD = 1e9+7;

int main(){
  ll r, l;
  cin >> l >> r;
  ll p=r-l+1;
  if(p>=2019){
    cout << 0 << endl;
  }
  else{
  int sz = r-l+1;
  vector<int> A(sz);
  int i;
  int j=0;  
  for(i=l; i<=r; i++){
    A[j] = i%2019;
    j++;
  }
  //rep(j, sz) cout << A[j] << endl;  
    //cout << A[sz-1] << endl;
  /*sort(A.begin(), A.end());
  int f = A[0]*A[1];
  int g = f%2019;
    cout << g << endl; */
    int x = 2018;
    for(i=0; i<sz-1; i++){
      for(j=i+1; j<sz; j++){
        int f = A[i]*A[j];
        int g = f%2019;
        if(x>g) x = g;
        if(g==0) {x = 0; break;}
      }
    }
    cout << x << endl;
  /*int f = min(A[0], A[1]);
  int s = max(A[1], A[0]);
  for(j=2; j<sz; j++){
    int x = A[j];
    if(f==0) break;
    else if(f>x){
      s = f;
      f = x;
    }
    else if(s>x) s = x;
    //cout << s << " " << f << endl;
  }
    //cout << s << " " << f << endl;
  f = f*s;  
    //cout << f << endl;
  cout << f%2019 << endl;*/
  }
}

Measured memory_bytes: 256
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

def main():
	n,m=map(int,input().split())
	uf=UnionFind(n)
	
	for i in range(m):
		x,y,z=map(int,input().split())
		x-=1;y-=1
		uf.union(x,y)
	print(uf.group_count())
		
		
		
	
	
	
	
	


	
if __name__ == "__main__":
	main()


Measured memory_bytes: 7856
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pa pair<int,int>
const int Maxn=100010;
const int inf=2147483647;
int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return x*f;
}
int n,m,ans[Maxn];LL sum[Maxn],a[Maxn],s[Maxn];
struct Query{int x,id;}q[Maxn];
bool cmp(Query a,Query b){return a.x>b.x;}
int L,R;
LL g(int x,int st,int len,LL v)
{
	int ed=st+len-1;
	if(ed>n)return(1LL<<61);
	if(ed<=x)return (LL)len*v-(sum[ed]-sum[st-1]);
	if(st>x)return (LL)sum[ed]-sum[st-1]-len*v;
	return (LL)(x-st+1)*v-(sum[x]-sum[st-1])+(sum[ed]-sum[x])-(ed-x)*v;
}
void get(int x,int len,int v)
{
	int l=1,r=n-len+1;
	while(l<=r)
	{
		int mid=l+r>>1;
		if(g(x,mid,len,v)<=g(x,mid+1,len,v))r=mid-1;
		else l=mid+1;
	}
	L=r+1,R=L+len-1;
//	printf("%d %d %d %d %d\n",x,len,v,L,R);
}
int main()
{
	n=read(),m=read();sum[0]=s[0]=0;
	for(int i=1;i<=n;i++)
	{
		a[i]=read(),sum[i]=sum[i-1]+a[i];
		s[i]=s[max(0,i-2)]+a[i];
	}
	for(int i=1;i<=m;i++)q[i].x=read(),q[i].id=i;
	sort(q+1,q+1+m,cmp);
//	printf("%lld %lld\n",g(1,1,2,20),g(1,2,2,20));
	int t=1;
	for(int i=1;i<=m;i++)
	{
		int l=1,r=n;
		while(l<=r)
		{
			int mid=l+r>>1;
			if(a[mid]>=q[i].x)r=mid-1;
			else l=mid+1;
		}
		int pos=r+1;
		while(t<=(n+1)/2)
		{
			get(pos,t,q[i].x);
			if(R<n-t+1){t++;continue;}
//			printf("%d %d %d\n",L,R,t);
			if(R>n-t+1)t--;
			else if(abs(a[R]-q[i].x)<abs(a[L]-q[i].x))t--;
			break;
		}
		t=min(t,(n+1)/2);
		ans[q[i].id]=t;
	}
//	for(int i=1;i<=m;i++)printf("%d\n",ans[i]);
	for(int i=1;i<=m;i++)printf("%lld\n",sum[n]-sum[n-ans[i]]+s[max(0,n-(ans[i]<<1))]);
}

Measured memory_bytes: 5248
#define ll long long
#define pb push_back
#include<bits/stdc++.h>
using namespace std;
const int N = 200000;
int arr[N];
vector<int> v1, v2;
int n, x;
void solve(){
	cin >> n;
	unordered_map<int,int> l, r;
	vector<int> rs;
	v1.clear();
	for(int i = 0; i < n; i++) cin >> x, v1.pb(x);
	for(int i = 1; i <= n; i++){
		int val1 = v1[i - 1];
		int val2 = v1[n - i];
		l[val1]++;
		l[val2]--;
		if(l[val2] == 0) l.erase(val2);
		if(l[val1] == 0) l.erase(val1);
		if(l.size() == 0) rs.pb(i);
	}
	for(int i = 0; i < rs.size(); i++){
		if(i) cout << " ";
		cout << rs[i];
	}
	cout << endl;
}
int main(){
	solve();
	return 0;
}


Measured memory_bytes: 4116
n = int(input())
x = [0]*n
y = [0]*n
for i in range(n):
    x[i],y[i] = map(int,input().split())
import itertools
data = list(range(n))
r = n
cc = list(itertools.permutations(data, r))
dis = [0]*len(cc)
j = 0
for L in cc:
    for i in range(len(L)-1):
        dis[j] += ((x[L[i]]-x[L[i+1]])**2 + (y[L[i]]-y[L[i+1]])**2)**0.5
    j += 1
print(sum(dis)/len(cc))

Measured memory_bytes: 9332
// ABC156-D
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i,n) for(int i=0;i<int(n);i++)
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
namespace you {
    std::string to_string(char val) {
        return std::string(1, val);
        // return std::string{val};
        // you::to_string(char)
    }
}

int num=210000;
ll mod=pow(10,9)+7;
vector<ll> fact(num);
vector<ll> invfact(num);
ll modpow(ll x,ll y,ll mod){ //x^y
    if(y==0) return 1;
    if(y==1) return x%mod;
    if(y%2==1) return x*modpow(x,y-1,mod)%mod;
    ll t=modpow(x,y/2,mod);
    return (t*t)%mod;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);

    int n,a,b;
    cin>>n>>a>>b;
    fact[0]=1;
    for(int i=1;i<num;i++){
        fact[i]=fact[i-1]*i%mod;
    }
    invfact[num-1]=modpow(fact[num-1],mod-2,mod);
    for(int i=num-2;i>-1;i=i-1){
        invfact[i]=invfact[i+1]*(i+1)%mod;
    }
    ll ans=modpow(2,n,mod)-1;
    //cout<<ans<<endl;
    ll npa=1,npb=1;
    for(int i=0;i<a;i++){
        npa=npa*(n-i)%mod;
    }
    npa=npa*invfact[a]%mod;

    for(int i=0;i<b;i++){
        npb=npb*(n-i)%mod;
    }
    npb=npb*invfact[b]%mod;
    ans=ans-(npa+npb)%mod;
    //cout<<ans<<endl;
    ans%=mod;
    if(ans<0) ans+=mod;
    cout<<ans<<endl;
    //cout<<npa<<" "<<npb<<endl;
    // cout<<invfact[a]<<" "<<invfact[b]<<endl;
    return 0;
}

Measured memory_bytes: 3584
h, w = gets.chomp.split.map(&:to_i)

c = []
10.times do
  c.push gets.chomp.split.map(&:to_i)
end

a = []
h.times do
  a.push gets.chomp.split.map(&:to_i)
end

10.times do
  10.times do |i|
    10.times do |j|
      10.times do |k|
        c[i][j] = [c[i][j], c[i][k] + c[k][j]].min
      end
    end
  end
end
10.times do |i|
#  p c[i]
end

ans = 0
h.times do |i|
  w.times do |j|
    ans += c[a[i][j]][1] if a[i][j] != -1
  end
end

puts ans

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

void solveA(){
  int a,b,c;
  cin >> a >> b >> c;

  if (a==b && b == c){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}
void solveB(){
}
void solveC(){
}

int main(){
  solveA();
}


Measured memory_bytes: 256
a, b, m = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
X = [0] * m
Y = [0] * m
C = [0] * m
for i in range(m):
    X[i], Y[i], C[i] = map(int, input().split())
cost = min(A) + min(B)
for i in range(m):
    cost = min(cost, A[X[i] - 1] + B[Y[i] - 1] - C[i])
print(cost)


Measured memory_bytes: 23396
//For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 a.cpp -o a.exe in cmd
    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define ll long long
    #define ld long double
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define pb push_back
    #define f first
    #define s second
    
    using namespace std;
    int main()
    {
        std::ios::sync_with_stdio(false);
        int T;
        T=1;
        // cin.ignore(); must be there when using getline(cin, s)
        while(T--)
        {
            int n,i,j,k;
            cin>>n>>k;
            ll ar[n+1];
            for(i=1;i<=n;++i)
                cin>>ar[i];
            ll dp[n+1];
            dp[n]=0;
            for(i=n-1;i>=1;--i)
            {
                dp[i]=1e9;
                //cout<<i+1<<endl;
                for(j=1;j<=k && i+j<=n;++j)
                {
                    //cout<<dp[i+j]<<" "<<ar[i]<<" "<<abs(ar[i]-ar[j])<<endl;
                    dp[i]=min(dp[i],dp[i+j]+abs(ar[i]-ar[i+j]));

                }
                //cout<<i<<" "<<dp[i]<<endl;
            }
            cout<<dp[1]<<endl;
        }
        return 0;
    }


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

int n,a[300010];

int main() {
	scanf("%d",&n);
	rep(i,0,3*n) scanf("%d",a+i);
	sort(a,a+3*n);
	ll ans=0;
	rep(i,0,n) ans+=a[n+2*i];
	printf("%lld\n",ans);
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
bool comp(pair<long long int,long long int>a,pair<long long int,long long int>b)
{
    if(a.first==b.first)
    {
        if(a.second<=b.second)
        return true;
        else
        return false;
    }
    if(a.first>b.first)
    return true;
    else return false;
}
bool rev(long long int a,long long int b)
{
    if(a>b)return true;
    else return false;
}
bool compa(pair<string,pair<int,int>>a,pair<string,pair<int,int>>b)
{
    if(a.first==b.first)
    {
        if(a.second.first>b.second.first)
        return true;
        else
        return false;
    }
    if(a.first<b.first)
    return true;
    else 
    return false;
}
long long int gcd(long long int bdda,long long int chota)
{
    if(chota==0)
        return bdda;
    return gcd(chota,bdda%chota);
}
void solve()
{
    long long int n;
    cin>>n;
    long long int a[n];
    for(long long int i=0;i<n;i++)cin>>a[i];
    long long int ans=0,c=1;
    for(long long int i=0;i<n;i++)
    {
        if(a[i]==c)
        c++;
        else ans++;
    }
    if(ans==n)
    {
        cout<<"-1";return;
    }
    cout<<ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;    
    t=1;

    //cin>>t;
    while(t--)
    {
        solve();
    }
}


Measured memory_bytes: 5164
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;
 
using namespace std;

int main(){
    int N, C, K, T, cnt, ans, tmp;    cin >> N >> C >> K;
    tmp = 0;
    ans = 0;
    cnt = 0;
    vector<int> v(N);
    for(int i=0; i<N; i++)  cin >> v[i];
    sort(all(v));
    for(int i=0; i<N; i++){
        T = v[i];
        if(tmp == 0)    tmp = T;
        if(T <= tmp+K)  cnt++;
        else{
            tmp = T;
            cnt = 1;
            ans++;
        }
        if(cnt == C){
            ans++;
            cnt = 0;
            tmp = 0;
        }
    }
    if(cnt > 0) ans++;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include<stdio.h>
int main (){
	int aa;
	int ba;
	int ka;
	int hasila= 0;
	
	scanf("%d", &ka);
	scanf("%d %d", &aa ,&ba);
	
	for(int i=aa;i<=ba;i++){
		if(i%ka==0){
			hasila++;
		}
	}
		if(hasila !=0){
		printf("OK");
		}else{
			printf("NG");	
		}
	return 0;
}

Measured memory_bytes: 1724
#include<iostream>

using namespace std;

int main()
{
    int S;
    cin>>S;
    int h = int(S/3600);
    int m = int((S-h*3600)/60);
    int s = S - h*3600 - m*60;
    cout<<h<<":"<<m<<":"<<s<<endl;
    return 0;
}



Measured memory_bytes: 3100
N, M = gets.split.map(&:to_i)
Q = Array.new(N + 1, 0)

M.times do
  pi, result = gets.split
  pi = pi.to_i
  
  next if Q[pi] > 0
  
  if result == "AC"
    Q[pi] = Q[pi].abs + 1
  else
    Q[pi] -= 1
  end
end

puts "#{Q.count{|v| v > 0 }} #{Q.inject(0){|s,v| v > 0 ? s + (v - 1) : s }}"

Measured memory_bytes: 4604
#include <iostream>

using std::cin;
using std::cout;
using std::endl;

#define ll long long

int main()
{
  int64_t N, x, crnt, prev = 0, cnt = 0;

  cin >> N >> x;

  for(int i = 0; i < N; i++) {
    cin >> crnt;

    if(prev + crnt > x) {
      cnt += (prev + crnt) - x;
      crnt -= (prev + crnt) - x;
    }
    prev = crnt;
  }

  cout << cnt << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
 
#define WHITE 10000
#define BLACK 10001
#define GRAY 10002
#define TRUE 1
#define FALSE 0
#define NUL NULL
 
void dfs(void);
void visit(int);
void push(int);
void pop(void);
int isEmpty(void);
 
int v[101][101],s[101],time1,n;
int *d,*f,*color;
int top = 0;
 
int main(){
  int u,i,j,w,k;
 
  scanf("%d",&n);
 
  d = malloc(sizeof(int) * (n + 1));
  f = malloc(sizeof(int) * (n + 1));
  color = malloc(sizeof(int) * (n + 1));
 
  for(i = 1;i <= n;i++){
    scanf("%d %d",&u,&k);
    for(j = 1;j <= k;j++){
      scanf("%d",&w);
      v[i][w] = 1;
    }
  }
 
  dfs();
 
  for(i = 1;i <= n;i++){
    printf("%d %d %d\n",i,d[i],f[i]);
  }
 
  return 0;
}
 
void dfs(){
  int i = 1,j = 1;
  for(i = 1;i <= n;i++){
      color[i] = WHITE;
  }
 
  time1 = 0;
 
  for(i = 1;i <= n;i++){
    if(color[i] == WHITE){
      visit(i);
    }
  }    
 
}
 
void visit(int r){
  int u,vv=NUL,i;
 
  push(r);
  color[r] = GRAY;
  d[r] = ++time1;
 
  while(isEmpty() == FALSE){
    vv=NUL;
    u = s[top];
    for(i = 1;i <= n;i++){
    if(v[u][i] == 1 && color[i] == WHITE){
      vv = i;
      break;
    }
     
    }
    if(vv != NUL){
      if(color[vv] == WHITE){
    push(vv);
    color[vv] = GRAY;
    d[vv] = ++time1;
      }
    }
    else{
      pop();
      color[u] = BLACK;
      f[u] = ++time1;
    }
  }
}
 
void push(int x){
  top++;
  s[top] = x;
}
 
int isEmpty(){
  if(top == 0){
    return TRUE;
  }
  else{
    return FALSE;
  }
}
 
void pop(){
  top--;
}

Measured memory_bytes: 636
package main
 
import (
	"fmt"
)
 
var n, ans int
func main() {
	fmt.Scan(&n)
	for i := 1; i <= n; i ++ {
		if i % 3 != 0 && i % 5 != 0 {
			ans += i
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1768
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T> ostream& operator<<(ostream& s,const multiset<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double EPS=1e-10;
const double PI=acos(-1);

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	ll n;
	cin>>n;
	vector<ll> a(n);
	ll sum=1;
	bool flag=false;
	rep(i,n){
		cin>>a[i];
		if(sum>=INF && a[i]>=INF && (sum>INF || a[i]>INF)){
			flag=true;
		}
		if(!flag){
			sum*=a[i];
		}
		if(sum>10*inf){
			flag=true;
		}
		if(a[i]==0) sum=0;
	}
	if(sum==0){
		cout<<0<<endl;
		return 0;
	}
	if(flag) cout<<-1<<endl;
	else cout<<sum<<endl;
}

Measured memory_bytes: 3988
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
int main(){
  long long int n;
  cin >> n;
  n--;
  cout << n*(n+1)/2 << endl;
  return 0;
}

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

using namespace std;

int main() {
	Int N, K;
	cin >> N >> K;
	vector<Int> A(N);
	for (int i = 0; i < N; ++i) { cin >> A[i]; }

	for (int i = K; i < N; ++i) {
		cout << (A[i] > A[i - K] ? "Yes" : "No") << endl;
	}

	return 0;
}


Measured memory_bytes: 4840
import sys
input = sys.stdin.readline
n_dices, n_points = map(int, input().split())
points = sorted(list(map(int, input().split())))
if n_dices >= n_points:
    print(0)
    sys.exit()
interval_list = [points[i + 1] - points[i] for i in range(n_points - 1)]
interval_list.sort(reverse = True)
print(sum(interval_list[n_dices - 1:]))

Measured memory_bytes: 13956
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>

using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define ll long long
const int inf=10000000000000007;
const int MOD=1000000007;

class Edge{
public:
//int s;
int t;
long long len;
};
class Node{
    public:
    int num;//node番号
    long long dist;//startからの距離
    vector<Edge> edge;//自分から生えている辺
    bool comp;//dijkstra中で到達しているかどうか
    void in_edge(Edge &edge_in){
        edge.push_back(edge_in);
    }  
};
bool operator >(const Node& a,const Node &r){
        return a.dist > r.dist;
    }
void dijkstra(vector<Node> &node,int s,int t,int n){
    //n個のノードでできたグラフのsからtまでの最短距離を計算する
    //この時各要素のdistの値はsからの最短距離となる
    for(int i=1;i<=n;i++){
        //初期化
        node[i].dist=inf;
        node[i].num=i;
        node[i].comp=true;
    }
    node[s].dist=0;
    priority_queue<Node,vector<Node>,greater<Node>> que;
    que.push(node[s]);
    while(!que.empty()){
        Node buf;
        buf=que.top();//
        que.pop();
        int k=buf.num;
        if(node[k].comp){
            node[k].comp=false;
            int edge_num=buf.edge.size();
            for(int i=0;i<edge_num;i++){
                int buf_t=node[k].edge[i].t;
                int buf_len=node[k].edge[i].len;
                if(node[buf_t].dist>node[k].dist+buf_len){
                node[buf_t].dist=node[k].dist+buf_len;
                que.push(node[buf_t]);
                }
            }
        }
    }
}
signed main(){
  int n,m,s,t;//n:node_num,s:start_node,t:goal_node,m:edge_num
    cin>>n>>m;
    s=1;t=n;
    vector<Node> yen(n+1);
    vector<Node> snuke(n+1);
    for(int i=0;i<m;i++){
        int a,b;
        long long l,r;
        cin>>a>>b;
        l=1;r=1;
        Edge in;
//        in.s=a;
        in.t=b;
        in.len=l;
        yen[a].in_edge(in);//有向グラフの場合ここまで
        in.len=r;
        snuke[a].in_edge(in);
//        in.s=b;
        in.t=a;
        snuke[b].in_edge(in);
        in.len=l;
        yen[b].in_edge(in);//無向グラフの場合こっちも
    }
    dijkstra(yen,t,s,n);
    dijkstra(snuke,t,s,n);
    vector<Node> yenr=yen;
    vector<Node> snuker=snuke;
    dijkstra(yenr,s,t,n);
    dijkstra(snuker,s,t,n);
    if(yenr[n].dist<=2){
        cout<<"POSSIBLE"<<endl;
    }
    else{
        cout<<"IMPOSSIBLE"<<endl;
    }
  return 0;
}


Measured memory_bytes: 88604
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int arr[n];
	for(int i = 0;i<n;i++)
	cin>>arr[i];
	int flag = 0;
	for(int i = 0;i<n;i++)
	{
		if(arr[i]%2==0)
		{
			 if(arr[i]%3==0||arr[i]%5==0)
			 {
				 flag=1;
			//	 continue;
			 }
			 else
			 {
				 flag=0;
				break;
			 }
		 }
		 else
		 {
			 flag=1;
		 }
	 }
	 if(flag==1)
	 cout<<"APPROVED";
	 else
	 cout<<"DENIED";
	}


Measured memory_bytes: 256
n, m = map(int, input().split())
a = list(map(int, input().split()))
total = sum(a)

count = 0
judge = lambda x: x >= total * (1 / (4 * m))
for vote in a:
  if judge(vote):
    count += 1
  if count >= m:
    print("Yes")
    exit()
print("No")

Measured memory_bytes: 3060
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def roundUp(a, b):
        return -(-a // b)

    @staticmethod
    def toUpperMultiple(a, x):
        return Math.roundUp(a, x) * x

    @staticmethod
    def toLowerMultiple(a, x):
        return (a // x) * x

    @staticmethod
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

    @staticmethod
    def sign(n):
        if n == 0:
            return 0
        if n < 0:
            return -1
        return 1

    @staticmethod
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


MOD = int(1e09) + 7
INF = int(1e15)

T_MAX = int(1e05) + 1


def main():
    # sys.stdin = open("sample.txt")
    N, C = Scanner.map_int()
    S = [Scanner.map_int() for _ in range(N)]
    M = [[0 for _ in range(C)] for _ in range(T_MAX)]
    for i in range(N):
        M[S[i][0]-1][S[i][2]-1] += 1
        M[S[i][1]][S[i][2]-1] -= 1
    for c in range(C):
        for t in range(1, T_MAX):
            M[t][c] += M[t-1][c]
    ans = 0
    for t in range(T_MAX):
        ans = max(ans, M[t].count(1))
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 97628
#include <iostream>

typedef unsigned int ui;

void swap(ui & a, ui & b)
{
	unsigned int tmp = a;
	a = b;
	b = tmp;
}

ui gcd(ui a, ui b)
{
	if (a < b) swap(a, b);

	ui c = a % b;
	while (c != 0) {
		a = b;
		b = c;
		c = a % b;
	}

	return b;
}

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

int main() {
	using namespace std;

	ui a, b;
	while (cin >> a >> b) {
		const ui GCD = gcd(a, b);
		cout << GCD << ' ' << lcm(a, b, GCD) << endl;
	}
	return 0;
}

Measured memory_bytes: 1152
import java.util.Random;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        double d = n * 1.0;
        System.out.println(2.0 * d * Math.PI);
    }

}

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

constexpr long long MOD = 1e9 + 7;

int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  int ans = 0ll;
  cin >> a[0];

  for (int i=1; i<n; i++) {
    cin >> a[i];
    ans += (a[i] * a[i-1])%MOD;
    a[i] += a[i-1];
    ans %= MOD;
    a[i] %= MOD;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4796
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
int main(){
  char s[11];
  cin>>s;
  int mini=1000;
  for(int i=0;i<=strlen(s)-3;i++){
    mini=min(abs(753-((s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0'))),mini);
  }
  cout<<mini<<"\n";
  return 0;
}


Measured memory_bytes: 256
import math
A, B, H, M = list(map(int, input().split()))
deg_l = 6 * M
deg_s = 30 * H + 0.5 * M
deg = abs(deg_l - deg_s)
cos = math.cos(math.radians(deg))
ans = math.sqrt((A**2) + (B**2) - (2*A*B*cos))
print(ans)

Measured memory_bytes: 9508
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

int main(int argc, char const *argv[]) {
    int n, m;
    cin >> n >> m;
    ll ans = (1900*m+100*(n-m))*pow(2,m);
    cout << ans << endl; 
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include <vector>
#include <string>
using namespace std;
const int NIL = -2;
class bintree{
public:
	int left;
	int right;
	int parent;
	int key;
	bintree():left(NIL),right(NIL),parent(NIL),key(0){
	}
};

void PrintID(int key) {
	cout << " " << key;
}
void TraversePrint_Preorder(vector<bintree> & T,int id) {
	bintree & t = T[id];
	PrintID(t.key);
	if (t.left != NIL) {
		TraversePrint_Preorder(T,t.left);
	}
	if (t.right != NIL) {
		TraversePrint_Preorder(T,t.right);
	}
}
void TraversePrint_Inorder(vector<bintree> & T,int id) {
	bintree & t = T[id];
	if (t.left != NIL) {
		TraversePrint_Inorder(T,t.left);
	}
	PrintID(t.key);
	if (t.right != NIL) {
		TraversePrint_Inorder(T,t.right);
	}
}
void TraversePrint_Postorder(vector<bintree> & T,int id) {
	bintree & t = T[id];
	if (t.left != NIL) {
		TraversePrint_Postorder(T,t.left);
	}
	if (t.right != NIL) {
		TraversePrint_Postorder(T,t.right);
	}
	PrintID(t.key);
}
int TraverseSearch_Inorder(vector<bintree> & T,int id,int key) {
	bintree & t = T[id];
	if (t.key == key){
		return	1;
	} else if (key < t.key) {
		if (t.left != NIL) {
			return TraverseSearch_Inorder(T,t.left,key);
		}
	} else {
		if (t.right != NIL) {
			return TraverseSearch_Inorder(T,t.right,key);
		}
	}
	return 0;
}

void TreeInsert(vector<bintree> & T,int &top,int z){
	int y = NIL;
	int x = top;
	while (x != NIL){
		y = x;
		if (T[z].key < T[x].key) {
			x = T[x].left;
		}
		else {
			x = T[x].right;
		}
	}
	T[z].parent = y;
	if (y == NIL) {
		top = z;
	} else if (T[z].key < T[y].key) {
		T[y].left = z;
	} else {
		T[y].right = z;
	}
}
int main(){
	vector<bintree> T;
	int n;
	cin >> n;
	T.resize(n);
	int top = NIL;
	for(int z=0;z<n;++z) {
		string op;
		cin >> op;
		if (op == "insert") {
			cin >> T[z].key;
			TreeInsert(T,top,z);
		} else if (op == "find") {
			int k;
			cin >> k;
			int find = TraverseSearch_Inorder(T,top,k);
			const char *findmsg[] = {"no","yes"};
			cout << findmsg[find] << std::endl;
		} else if (op == "print") {
			TraversePrint_Inorder(T,top);
			cout << std::endl;
			TraversePrint_Preorder(T,top);
			cout << std::endl;
		}
	}
}

Measured memory_bytes: 8984
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

using ll = long long;
using ull = uint64_t;
using P = pair<int, int>;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

struct LazySegmentTree{
    vector<int> data;
    vector<int> lazy;
    int sz;
    const int M0 = numeric_limits<int>::max();

    LazySegmentTree(int n){
        sz = 1;
        while(sz < n)   sz <<= 1;
        data.assign(sz << 1, M0);
        lazy.assign(sz << 1, M0);
    }

    void set(int k, const int& x) { data[sz + k] = x; }
    void build(){
        for(int k = sz - 1; k >= 0; --k){
            data[k] = min(data[k << 1], data[k << 1 | 1]);
        }
    }

    void propagate(int k){
        if(lazy[k] != M0){
            data[k] = lazy[k];
            if(k < sz){
                lazy[k << 1] = lazy[k];
                lazy[k << 1 | 1] = lazy[k];
            }
            lazy[k] = M0;
        }
        return;
    }

    int update(int a, int b, const int& x, int k = 1, int l = 0, int r = -1){
        if(r == -1) r = sz;
        // cerr << "a:" << a << ",b:" << b << ',';
        // cerr << "k:" << k << ",l:" << l << ",r:" << r << '\n';
        propagate(k);
        if(b <= l || r <= a)    return data[k];
        else if(a <= l && r <= b){
            lazy[k] = x;
            propagate(k);
            return data[k];
        }
        else{
            return data[k] = min(update(a, b, x, k << 1, l, (l + r) >> 1),
                                update(a, b, x, k << 1 | 1, (l + r) >> 1, r));
        }
    }

    int query(int a, int b, int k = 1, int l = 0, int r = -1){
        if(r == -1) r = sz;
        propagate(k);
        if(b <= l || r <= a)    return M0;
        else if(a <= l && r <= b)   return data[k];
        else{
            return min(query(a, b, k << 1, l, (l + r) >> 1),
                        query(a, b, k << 1 | 1, (l + r) >> 1, r));
        }
    }

    int operator[](const int& k){
        return query(k, k + 1);
    }
};

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

    int n, q;
    cin >> n >> q;
    LazySegmentTree seg(n);
    for(int i = 0; i < q; ++i){
        int com;
        cin >> com;
        if(!com){
            int s, t, x;
            cin >> s >> t >> x;
            seg.update(s, t + 1, x);
        }
        else{
            int s, t;
            cin >> s >> t;
            cout << seg.query(s, t + 1) << '\n';
        }
    }
}


Measured memory_bytes: 4928
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        if (a<b&&b<c){
            System.out.println("Yes");
            }else {
                 System.out.println("No");
            }
        }
        
    }




Measured memory_bytes: 26348
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  string s,d;
  cin>>s;
  cin>>d;
  ll p=s.size();
  ll c=0;
  for(ll i=0;i<p;i++){
  	if(d[i]!=s[i]){
  		c++;
	  }
  }
  cout<<c<<"\n";
  return 0;}

Measured memory_bytes: 3920
#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int n,m,a,b;
  vector<int> vec;
  
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a;
    vec.push_back(a);
  }
 
  cin >> m;
  for(int i=0;i<m;i++){
    cin >> b;
    cout << lower_bound(vec.begin(),vec.end(),b)-vec.begin() << " " << upper_bound(vec.begin(),vec.end(),b)-vec.begin() << endl;
  }
  
  return(0);
}



Measured memory_bytes: 3464
/* --- author: dxm --- */
#include<bits/stdc++.h>
using namespace std;

#define INF 1e9
#define Inf 1e18
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define fst first
#define snd second
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef unsigned int uint;
typedef unsigned long long ull;
inline void Fail(){printf("-1");exit(0);}

const int maxn=300005;
int n,a,b,res[maxn];

int main(){
	scanf("%d%d%d",&n,&a,&b);
	if(a+b>n+1||1LL*a*b<n)Fail();
	int now=n-1,c=a,d=n-1;
	while(d-b+1>=c){
		for(int i=d-b+1;i<=d;i++)res[i]=now,now--;
		d-=b;c--;
	} 
	for(int i=c-1;i<=d;i++)res[i]=now,now--;
	for(int i=c-2;i>=0;i--)res[i]=now,now--;
	rep(i,n)printf("%d ",res[i]+1);
	return 0;
}

/*
Input:
-----------------
Output:
*/

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define RFOR(i, m, n) for (int i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

ll factorial(ll n) {
  ll answer = 1;
  while (n > 1) {
    answer *= n;
    answer %= mod;
    n--;
  }
  return answer;
}

ll combination(ll n, ll r) {
  return factorial(n) / (factorial(r) * factorial(n - r));
}

ll permutation(ll n, ll r) { return factorial(n) / factorial(n - r); }

int main() {
  int a, b;
  cin >> a >> b;

  cout << max(a - b * 2, 0) << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main() {
	int n;
	while (cin >> n&&n) {
		int p[10000], d1[10000], d2[10000];
		int top[2] = {};
		for (int i = 0; i < n; i++) {
			cin >> p[i] >> d1[i] >> d2[i];
			if (top[1] < d1[i] + d2[i]) {
				top[0] = p[i];
				top[1] = d1[i] + d2[i];
			}
		}
		cout << top[0] <<" "<< top[1] << endl;
	}


	return 0;
}

Measured memory_bytes: 3172