akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
#define chmax(a, b) a = (((a)<(b))?(b):(a))
#define chmin(a, b) a = (((a)<(b))?(a):(b))

const int INF = 1001001001;
const ll MOD = 1e9+7;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){std::fill((T*)array, (T*)(array+N),val);}

class CompareDist
{
public:
    bool operator()(PLL n1,PLL n2) {
				if(n1.first!=n2.first) return n1.first<n2.first;
				else return n1.second<n2.second;
    }
};

#define lengthof(x) (sizeof(x) / sizeof(*(x)))


__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

ll mpow(ll a, ll b){
  if(b==0) return 1;
  else if(b%2==0){ll memo = mpow(a,b/2); return memo*memo%MOD;}
  else return mpow(a,b-1) * a % MOD;
}

signed main(){
  int a,b,c,x; cin>>a>>b>>c>>x;
  int ans = 0;
  rep(i,a+1){
    rep(j,b+1){
      rep(k,c+1){
        if(500*i+100*j+50*k==x) ans++;
      }
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    vector<int> a(3);
    for(int i=0;i<3;i++)cin>>a[i];
    sort(a.begin(),a.end());
    int ans=0;
    for(int i=0;i<2;i++){
        ans+=a[i+1]-a[i];
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
def main():
    n, a, b = [int(i) for i in input().split()]
    ans = 0
    for i in range(1,n+1):
        tmp = 0
        for ss in str(i):
            tmp += int(ss)
        if a <= tmp <= b:
            ans += i
    print(ans)


if __name__ == '__main__':
    main()


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

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

type Graph = Vec<Vec<(usize,usize)>>;

fn dijkstra(s:usize,g:Graph){
    let mut d = vec![usize::max_value();g.len()];
    d[s] = 0;
    let mut p:Vec<isize> = vec![-1;g.len()];
    // white=-1, gray=0, black=1
    let mut color:Vec<isize> = vec![-1;g.len()];
    //探索中の頂点から最小である頂点
    let mut minnode = 0;

    loop {
        //探索中の頂点から最小である頂点を探す
        let mut mincost = usize::max_value();
        for i in 0..g.len(){
            if color[i] != 1 && d[i] < mincost {
                mincost = d[i];
                minnode = i;
            }
        }

        if mincost == usize::max_value() {
            //探索終了
            break;
        }
        color[minnode] = 1;

        for v in 0..g.len(){
            if color[v] != 1 && g[minnode].iter().find(|x| x.0 == v).is_some() {
                if d[minnode] + g[minnode].iter().find(|x| x.0 == v).unwrap().1 < d[v] {
                    d[v] = d[minnode] + g[minnode].iter().find(|x| x.0 == v).unwrap().1;
                    p[v] = minnode as isize;
                    color[v] = 0;
                }
            }
        }
    }

    for (i,e) in d.iter().enumerate(){
        println!("{} {}",i,e);
    }
}

fn main() {

    let n: usize = read();
    let mut G: Graph = vec![Vec::new(); n];
    for _i in 0..n {
        let u: usize = read();
        let k: usize = read();
        for _j in 0..k {
            let v: usize = read();
            let c: usize = read();
            G[u].push((v,c));
        }
    }

    dijkstra(0,G); 
    
}


Measured memory_bytes: 5048
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define rev(a,b,c) for(int a=b;a>=c;a--)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define end end()
#define vec vector<ll>
#define se set<ll>
#define mults multiset<ll>
#define F first
#define S second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b
#define get(a) cin>>a
#define nextl cout<<endl
const ll mod = 1000000007;
const ll maxn = 500005;
const ll mm = 1e+18;
ll power(ll x, ll y)
{
    ll res = 1;
    x = x % mod;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % mod;
        y = y>>1;
        x = (x*x) % mod;
    }
    return res;
}
ll ncr(ll n, ll k)
{
    ll C[k+1];
    memset(C, 0, sizeof(C));

    C[0] = 1;

    for (ll i = 1; i <= n; i++)
    {
        for (ll j = min(i, k); j > 0; j--)
            C[j] = (C[j] + C[j-1])%mod;
    }
    return C[k];
}
void solve()
{
    int n;
    get(n);
    int a[n];
    rep0(i,n) get(a[i]);
    int ans=0;
    rep0(i,n-1)repp(j,i+1,n) ans+=a[i]*a[j];
    pr(ans);
}
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
       // nextl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin>>s1>>s2;
  int l1 = s1.size(), l2 = s2.size();

  vector<vector<int>> dp(l1+1, vector<int>(l2+1, 0));
  string res;
  int prevMax = 0;
  for(int i = 1; i <= l1; i++) {
    for(int j = 1; j <= l2; j++) {
      if(s1[i-1] == s2[j-1])
        dp[i][j] = dp[i-1][j-1] + 1;
      else
        dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
    //   cout<<dp[i][j]<<" ";
    }
    // cout<<endl;
  }
  int i = l1, j = l2;
  while(i > 0 && j > 0) {
    if(s1[i-1] == s2[j-1]) {
      res += s1[i-1];
      i--;
      j--;
  	}
    else if(dp[i-1][j] > dp[i][j-1])
      i--;
    else
      j--;
  }
  reverse(res.begin(), res.end());
  cout<<res;
  return 0;
}

Measured memory_bytes: 35584
// Template begins
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <math.h>
#include <iomanip>
#include <queue> 
#include <string.h>
#include <string>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define endl "\n"
#define lb lower_bound
#define ub upper_bound
#define fo(i,a,b) for(i=a;i<b;i++)
#define all(v) (v).begin(),(v).end()
#define sort0(v) sort(all(v))
#define lbb(a,b,arr,x) lower_bound(arr+a,arr+b+1,x)-arr
#define ubb(a,b,arr,x) upper_bound(arr+a,arr+b+1,x)-arr
#define freq(a,b,arr,x) upper_bound(arr+a,arr+b+1,x)-lower_bound(arr+a,arr+b+1,x)
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define d5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<endl
#define d6(a,b,c,d,e,f) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<" "<<(f)<<endl
#define max3(a,b,c) max(max((a),(b)),(c))
#define max4(a,b,c,d) max(max((a),(b)),max((c),(d)))
#define ss second
#define ff first
#define pb push_back
#define mp make_pair
#define printp(x) cout << x.ff << " " << x.ss << endl

const ll mod=998244353;
#define inf 9999999999999
#define MAXN   100001 
  
// stores smallest prime factor for every number 
ll inv(ll i){if(i==1) return 1;return (mod-((mod/i)*inv(mod%i))%mod)%mod;}
ll gcd(ll a,ll b){if(a==0) return b;return gcd(b,b%a);}
inline void fastio(){ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
// Template ends
const int MN = 2e5+7;






int main(){
    fastio();
    
    
        
        //write code here
        int n; cin>>n;
        ll a[n];
        for(int i=0;i<n;i++){
            cin>>a[i];
        }
        sort(a,a+n);
        ll ans=0;
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                if(a[i]==a[j]){
                    continue;
                }
                for(int k=j+1;k<n;k++){
                    if(a[i]==a[k] || a[j]==a[k]){
                        continue;
                    }
                    if(a[k]<a[i]+a[j]){
                        //cout<<i<<" "<<j<<" "<<k<<endl;
                        ans++;
                    }
                }
            }
        }
        cout<<ans<<endl;
        
    
    return 0;
}

 

Measured memory_bytes: 3196
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define test lli t;cin>>t;while(t--)
#define vll vector<lli>
#define mll map<lli,lli>
#define vvll vector<vector<lli>>
#define vpll vector<pair<lli,lli>>
#define vvpll vector<vector<pair<lli,lli>>>
#define mpll map<pair<lli,lli>,lli>
#define pll pair<lli,lli>
#define sll stack<lli>
#define qll queqe<lli>
#define pb push_back
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ff first
#define ss second
#define mod 1000000007
#define ma 1000000000000000000
#define mi -1000000000000000000
int main()
{
  lli k,i;
  cin>>k;
  for(i=0;i<k;i++)
  	cout<<"ACL";
	return 0;
}

Measured memory_bytes: 3592
import java.io.*;
import java.util.*;

public class Main {
    private static int MOD = 998244353;
    private static int add(int a, int b) {
        a += b;
        while (a >= MOD) a -= MOD;
        while (a < 0) a += MOD;
        return a;
    }
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        StringTokenizer sti = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int S = Integer.parseInt(st.nextToken());
        int[] arr = new int[N];
        for (int i = 0; i < N; ++i) {
            arr[i] = Integer.parseInt(sti.nextToken());
        }
        int[] dp  = new int[S + 1];
        dp[0] = 1;
        for (int i = 0; i < N; ++i) {
            int[] temp = new int[dp.length];
            for (int j = 0; j <= S; ++j) {
                temp[j] = add(dp[j], dp[j]);
                if (j - arr[i] >= 0) {
                    temp[j] = add(temp[j], dp[j - arr[i]]);
                }
            }
            dp = temp;
            //  0 1 2 3
            //0 1 0 0 0 
            //1 2 1 0 0
            //2 4 2 2 1
            //3 8 4 4 6
        }
        System.out.println(dp[S]);
    }
}

Measured memory_bytes: 49716
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
const int INFTY =2147483647;
int main(){
    string s,t,ans="No";
    cin>>s>>t;
    if(s.compare(t.substr(0,s.length()))==0) ans="Yes";
    cout<<ans<<endl;
}

Measured memory_bytes: 3632
import java.util.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

// AOJ 0045
public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int sum1 = 0, sum2 = 0, cnt = 0;;
		while (sc.hasNext()) {
			String[] ss = sc.next().split(",");
			int a = new Integer(ss[0]), b = new Integer(ss[1]); 
			sum1 += a * b;
			sum2 += b;
			cnt++;
		}
		System.out.println(sum1);
		System.out.printf("%1.0f", (double)sum2 / cnt);
		System.out.println();
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    long long N,ans;
    cin>>N;
    ans=0;
    long long D[1000001];
    for(long long i=0;i<1000001;i++){
        D[i]=0;
    }
    long long A[N];
    for(long long i=0;i<N;i++){
        cin>>A[i];
        D[A[i]]++;
        ans+=A[i];
    }
    long long Q;cin>>Q;
    long long B[Q],C[Q];
    for(long long i=0;i<Q;i++){
        cin>>B[i]>>C[i];
    }
    for(long long i=0;i<Q;i++){
        D[C[i]]+=D[B[i]];
        ans+=(D[B[i]])*(C[i]-B[i]);
        cout<<ans<<endl;
        D[B[i]]=0;
    }
}


Measured memory_bytes: 13776
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(j,n) for(int i=(int)(j);i<(int)(n);i++)
signed main(){
  int N;
  cin>>N;
  int ans=N*100/108;
  if(ans*108/100==N)
    cout<<ans<<endl;
  else if((ans+1)*108/100==N)
    cout<<ans+1<<endl;
  else
    cout<<":("<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    int n; cin >> n;
    vector<int> p(n);
    REP(i, n) cin >> p[i];
    int cnt = 0;
    REP(i, n){
        if(p[i] != i + 1) cnt++;
    }
    if(cnt == 0 or cnt == 2) cout << "YES" << endl;
    else cout << "NO" << endl;
}

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

int main(){
    int x,y;
    cin>>x>>y;
    if(x<y){
        cout<<"a"<<" < "<<"b"<<endl;
    }else if(x>y){
        cout<<"a"<<" > "<<"b"<<endl;
    }else{
        cout <<"a == b"<< endl;
    }
    return 0;
}

Measured memory_bytes: 3096
#include <iostream>
//配列
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
	int n,m,x;
	cin>>n>>m>>x;
	vector<int> c(n);
	vector<vector<int>> a(n,vector<int>(m));
	for(size_t i = 0; i<n; i++)
	{
		cin>>c[i];
		for(size_t ii = 0; ii<m; ii++)
		{
			cin>>a[i][ii];
		}
	}
	int min = 100100100;
	for(int bit = 0; bit<(1<<n); ++bit)
	{
		int cc = 0;
		vector<int> aa(m);
		for(int i = 0; i<n; ++i)
		{
			if(bit & (1<<i))
			{
				cc += c[i];
				for(size_t ii = 0; ii<m; ii++)
				{
					aa[ii] += a[i][ii];
				}
			}
		}
		int tf = 0;
		for(size_t i = 0; i<m; i++)
		{
			if(aa[i]<x)
			{
				tf = 1;
			}
		}
		if(tf==0&&min>cc)
		{
			min = cc;
		}
	}
	if(min==100100100)
		cout<<-1<<endl;
	else
		cout<<min<<endl;
	return 0;
}

Measured memory_bytes: 3600
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

int main() {

    long long N, A;
    cin >> N >> A;

    vector<long long> x(N);
    for (auto &_ : x) cin >> _;

    //dp[i+1][j][k]
    //i+1枚目まででj枚使って合計がkとなる組み合わせ
    vector<vector<vector<long long>>> dp(N + 1, vector<vector<long long>>(N + 2, vector<long long>(2560, 0)));
    dp[0][0][0] = 1;

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            for (int k = 0; k <= 2500; k++) {
                if (k + x[i] <= 2502)dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
                dp[i + 1][j][k] += dp[i][j][k];
            }
        }
    }

    long long ans = 0;
    for (int i = 1; i <= N; i++) {
        ans += dp[N][i][A * i];
    }

    cout << ans << endl;

}













































Measured memory_bytes: 54400
def prob_c():
    l, r = [int(a) for a in input().split()]
    if r - l >= 2018:
        print("0")
    else:
        l = l % 2019
        r = r % 2019
        ans = 2018
        for i in range(l, r):
            for j in range(i+1, r+1):
                candidate = (i * j) % 2019
                if ans > candidate:
                    ans = candidate
            if ans == 0:
                break
        print(str(ans))

prob_c()

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

int main() {
	long n,m,d,i,j,ans=0,cur=0;
	cin >> n >> m >> d;
	vector<string> s(n);
	for(i=0; i<n; i++){
		cin >> s[i];
	}
	for(i=0; i<n; i++){
		for(j=0; j<m; j++){
			if(s[i][j]=='#'){
				cur=0;
			}else{
				cur++;
				if(cur>=d) ans++;
			}
		}
		cur=0;
	}
	
	for(j=0; j<m; j++){
		for(i=0; i<n; i++){
			if(s[i][j]=='#'){
				cur=0;
			}else{
				cur++;
				if(cur>=d) ans++;
			}
		}
		cur=0;
	}
	cout << ans << endl;
}


Measured memory_bytes: 3192
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    string s;
    cin >> s;
    while(s != "."){
        string t;
        cin >> t;

        if(s == t){
            cout << "IDENTICAL" << endl;
            cin >> s;
            continue;
        }

        vector<string> xs;
        vector<string> xt;
        int i = 0;
        while(i < (int)s.length()){
            string tmp;
            if(s[i] == '\"'){
                i++;
                tmp = "";
                while(s[i] != '\"'){
                    tmp.push_back(s[i]);
                    i++;
                }
                i++;
                xs.push_back(tmp);
                continue;
            }

            tmp = "";
            while(s[i] != '\"' && i < (int)s.length()){
                tmp.push_back(s[i++]);
            }
            xt.push_back(tmp);
        }

        vector<string> ys;
        vector<string> yt;
        i = 0;
        while(i < (int)t.length()){
            string tmp;
            if(t[i] == '\"'){
                i++;
                tmp = "";
                while(t[i] != '\"'){
                    tmp.push_back(t[i]);
                    i++;
                }
                i++;
                ys.push_back(tmp);
                continue;
            }

            tmp = "";
            while(t[i] != '\"' && i < (int)t.length()){
                tmp.push_back(t[i++]);
            }
            yt.push_back(tmp);
        }

        if(xs.size() != ys.size() || xt.size() != yt.size()){
            cout << "DIFFERENT" << endl;
            cin >> s;
            continue;
        }

        int c = 0;
        rep(i, (int)xs.size()){
            if(xs[i] != ys[i]){
                c++;
            }
        }

        int d = 0;
        rep(i, (int)xt.size()){
            if(xt[i] != yt[i]){
                d++;
            }
        }

        if(d == 0 && c == 1){
            cout << "CLOSE" << endl;
            cin >> s;
            continue;
        }
        cout << "DIFFERENT" << endl;

        cin >> s;
    }

    return 0;
}



Measured memory_bytes: 3164
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
    ll n , m;
   // cout << "hello world" << endl;
    cin >> n >> m;
    vector< pair< ll , ll > > v;
    for(int i = 0 ; i < n ;i++){
        ll x , y;
        cin >> x >> y;
        //cout << x << " " << y << endl;
    	v.push_back({x,y});
    }
    sort(v.begin() , v.end());
    ll ans = 0;
    for(int i = 0 ; i < n ;i++){
        ll temp = min(m,v[i].second);
        ans += v[i].first*temp;
        m -= temp;
        if(m == 0)
            break;
    }
    cout << ans << endl;
 	return 0; 
}

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

int main() {
  int K; string S; cin >> K >> S;
  if (S.length() <= K) cout << S;
  else {
    for (int i=0; i<K; i++) {
      cout << S[i];
    }
    cout << "...";
  }
}

Measured memory_bytes: 3624
a=input()
op=list("+-")
flag = False
for i in op:
    for j in op:
        for k in op:
            s = a[0]+i+a[1]+j+a[2]+k+a[3]
            if eval(s) == 7:
                flag = True
                break
        if flag:
            break
    if flag:
        break
print(s+"=7")


Measured memory_bytes: 2940
#pragma region
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()
#pragma endregion


int main()
{
	int n, k; cin >> n >> k;
	if ((n + 1) / k >= 2)cout << "YES" << endl;
	else cout << "NO" << endl;
}

Measured memory_bytes: 256
import numpy as np
N=int(input())
h=np.array(list(map(int,input().split())))
ans=0
now=0
while(now<N):
    init=now
    while(1):
        if h[now]==0:
            if now==init:
                now+=1
                break
            else:
                h[init:now]-=1
                ans+=1
                now=init
                break
        elif now==N-1:
            h-=1
            ans+=1
            now=init
            break            
        now+=1
print(ans)

Measured memory_bytes: 12468
#include <bits/stdc++.h>
using namespace std;
//T+N
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
#define endl "\n"
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template<class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; }
template<class T, class T2> inline bool chkmin(T &x, const T2 &y) { return x > y ? x = y, 1 : 0; }
const ll mod = 1e9 + 7;
template<class T> inline void fix(T &x) {if(x >= mod | x <= -mod) {x %= mod;} if(x < 0) {x += mod;}}
#define out(x) cout << __LINE__ << ": " << (#x) << " = " << (x) << endl

const ll MAX_N = 1e5 + 10, LOG = 20;;
ll arr[MAX_N], n, l, q;
vector<ll> g[MAX_N];
ll par[MAX_N][LOG];

void dfs(ll x, ll p) {
    par[x][0] = p;
    for(ll i = 1; i < LOG; i ++) {
        par[x][i] = par[par[x][i - 1]][i - 1];
    }
    for(auto it : g[x]) {
        dfs(it, x);
    }
}

ll query(ll a, ll b) {
    if(a == b) {
        return 0;
    }
    ll cnt = 0;
    for(ll i = LOG - 1; i >= 0; i --) {
        if(par[a][i] < b) {
            cnt += (1 << i);
            a = par[a][i];
        }
    }
    return cnt + 1;
}

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    cin >> n;
    for(ll i = 0; i < n; i ++) {
        cin >> arr[i];
    }
    cin >> l;
    arr[n] = 2 * mod;
    for(ll i = 0; i < n - 1; i ++) {
        ll ind = lower_bound(arr, arr + n + 1, arr[i] + l + 1) - arr;
        g[ind - 1].push_back(i);
    }
    for(ll i = 0; i < LOG; i ++) {
        par[n][i] = n;
    }
    dfs(n - 1, n);
    cin >> q;
    for(ll i = 0; i < q; i ++) {
        ll a, b;
        cin >> a >> b;
        a --; b --;
        if(a > b) {swap(a, b);}
        cout << query(a, b) << endl;
    }
    return 0;
}




Measured memory_bytes: 25856
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rrep(i,n) for(int (i) = (n) - 1; (i) >= 0; --(i)) //Reversi rep
#define nfor(i,a,b) for(int (i) = (a); (i) < (b); ++(i)) //Natural for
#define rfor(i,a,b) for(int (i) = (b); (i) >= (a); --(i)) //Reversi for
#define ll long long
#define mod (1000000007)
#define YES cout << "YES" << endl;
#define Yes cout << "Yes" << endl;
#define yes cout << "yes" << endl;
#define NO cout << "NO" << endl;
#define No cout << "No" << endl;
#define no cout << "no" << endl;

int asc(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}

int desc(const void *a, const void *b) {
    return *(int *)b - *(int *)a;
}

int main()
{
    int h,w,count = 0;
    cin >> h >> w;
    char s[h + 2][w + 2];
    rep(i, h + 2){
        rep(j, w + 2){
            if (i == 0 || i == h + 1 || j == 0 || j == w + 1) {
                s[i][j] = '.';
            }else{
                cin >> s[i][j];
            }
        }
    }
    rep(i, h){
        rep(j, w){
            if (s[i + 1][j + 1] == '.') {
                count = 0;
                rep(r, 3){
                    rep(k, 3){
                        if(s[i + r][j + k] == '#'){
                            ++count;
                        }
                    }
                }
                cout << count;
            }else{
                cout << "#";
            }
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
int main(int argc, char* argv[])
{
	string S,T;
	cin>>S;
	cin>>T;
	char *pS=(char*)S.c_str();
	char *pT=(char*)T.c_str();
	if (strstr(pS,pT)){
		cout<<0<<endl;
		return 0;
	}
	int i,j;
	size_t sLen=S.size();
	size_t tLen=T.size();
	int MaxSameNum=0;
	for (i=0;i<sLen-tLen+1;i++){
		int SameNum=0;
		for (j=0;j<tLen;j++){
			if (S[i+j]==T[j]){
				SameNum++;
			}
		}
		if (MaxSameNum<SameNum){
			MaxSameNum=SameNum;
		}
	}
	cout<<tLen-MaxSameNum<<endl;
	return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007 
#define all(n)      (n).begin(), (n).end()
#define ll long long 
int a[10001];



int main (){
	#ifndef ONLINE_JUDGE
		freopen ("input.txt","r",stdin);
		freopen ("output.txt", "w", stdout);
	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	//Write from here.
	int sum = 0;
	int n,m; cin >> n >> m;
	for(int i = 0; i < m; i++){
		cin >> a[i];
		sum += a[i];
	}
	if(sum > n){
		cout << -1 << '\n';
	}else{
		cout << n - sum << '\n';
	}

	
	
	return 0;
}

Measured memory_bytes: 3680
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define V vector<ll>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;


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

    int j;
    char c = '1';
    rep(i, 0, s.size()){
        if(s[i] != '1'){
            c = s[i];
            j = i;
            break;
        }
    }

    j++;

    if(j > n) cout << 1 << endl;
    else cout << c << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		solver();
	}

	void solver() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		boolean f = false;
		for (int i = 0; i < s.length(); i++) {
			for (int j = i + 1; j < s.length(); j++) {
				if (s.charAt(i) == 'C' && s.charAt(j) == 'F') {
					f = true;
				}
			}
		}
		if (f) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}


Measured memory_bytes: 10060
#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstring>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<vector>
using namespace std;
long long int a[200001];
long long int S[200001];
int main() {


	int n;
	int i;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a[i];
	}
	S[0] = 0;
	for (i = 0; i < n; i++) {
		S[i + 1] = S[i] + a[i];
	}
	long long int MIN = 10000000000000000;
	long long int pq, rs, pqrs[4];
	long long int x, y, z;
	int left, right, mid, mid2;
	for (i = 2; i < n - 1; i++) {
		pq = S[i];
		rs = S[n] - S[i];
	
		left = 0;
		right = i;
		while (1) {
			mid = (left + right) / 2;
			x = abs((S[i] - S[mid - 1]) - S[mid - 1]);
			y = abs((S[i] - S[mid]) - S[mid]);
			z = abs((S[i] - S[mid + 1]) - S[mid + 1]);
			if (x < y && y < z) {
				right = mid;
			}
			else if (x > y && y > z) {
				left = mid;
			}
			else {
				break;
			}
		}

		left = i;
		right = n;

		while (1) {
			mid2 = (left + right) / 2;
			x = abs((S[n] - S[mid2 - 1]) - (S[mid2 - 1] - S[i]));
			y = abs((S[n] - S[mid2]) - (S[mid2] - S[i]));
			z = abs((S[n] - S[mid2 + 1]) - (S[mid2 + 1] - S[i]));
			if (x < y && y < z) {
				right = mid2;
			}
			else if (x > y && y > z) {
				left = mid2;
			}
			else {
				break;
			}
		}

		pqrs[0] = S[mid];
		pqrs[1] = S[i] - S[mid];
		pqrs[2] = S[mid2] - S[i];
		pqrs[3] = S[n] - S[mid2];
		//cout << pqrs[0] << ' ' << pqrs[1] << ' ' << pqrs[2] << ' ' << pqrs[3] << endl;
		sort(pqrs, pqrs + 4);
		if (MIN > pqrs[3] - pqrs[0])MIN = pqrs[3] - pqrs[0];
	
	}
	cout << MIN << endl;
	return 0;



	/*int i;
	long long int n;
	cin >> n;
	long long int sum = 0;
	for (i = 0; i < n; i++) {
		cin >> a[i];
		a[i] = a[i] - (i + 1);
		//sum = sum + a[i] - i;
	}
	sort(a, a + n);
	//long long int b = sum / n;
	//int j;
	//long long int sum2 = 0;
	//sum = 10000000000000000;
	
	//for (j = b - 10000; j <= b + 10000; j++) {

	//	sum2 = 0;
		for (i = 0; i < n; i++) {
			sum = sum + abs(a[i] - a[n / 2]);
		}
	//	sum = min(sum, sum2);
	//}
		
	
	cout << sum << endl;
	return 0;
	*/
	

}

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


main(){
   ll n,m,ans=0,i;
   cin >> n >> m;
   vector<ll> l(m),r(m);
   for(i=0;i<m;i++) cin >> l[i] >> r[i];

   ll L=*max_element(l.begin(), l.end());
   ll R=*min_element(r.begin(), r.end());

   for(i=1;i<=n;i++){
       if(L<=i && i<=R) ans++; 
   }
   cout << ans << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(void){
  string str;
  vector<string> arg;

  while(cin >> str){
	arg.push_back(str);
  }

  cout << 90 << endl;
  for(int i=0;i<8;i++){
	for(int j=0;j<8;j++){
	  cout << arg[7-j][i];
	}
	cout << endl;
  }
  cout << 180 << endl;
  for(int i=0;i<8;i++){
	for(int j=0;j<8;j++){
	  cout << arg[7-i][7-j];
	}
	cout << endl;
  }

  cout << 270 << endl;
  for(int i=0;i<8;i++){
	for(int j=0;j<8;j++){
	  cout << arg[j][7-i];
	}
	cout << endl;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;cin>>s;
    if(s=="ABC")cout<<"ARC";
    else cout<<"ABC";
    return 0;
}

Measured memory_bytes: 3612
# enumerate の 番号が降順 のもの. 最後が0になる
def reverse_enumerate(l):
	for i, l_i in zip(range(len(l)-1, -1, -1), l):
		yield i, l_i
# n-gram(調べて)
def n_gram(s, n):
	return [s[i:i+n] for i in range(len(s)-n+1)]
# 二つの文字列が等しいかを調べる. 全ての文字と等しくなる文字を設定可能(all_match)
def is_equal_match(s1, s2, all_match=[]):
	for i in range(len(s1)):
		if not (s1[i] == s2[i] or s1[i] in all_match):
			return False
	return True
# 指定した index に 文字列を埋め込む
def fill_in_str(text, s, n):
	return text[:n] + s + text[n+len(s):]

s_ = input()
t = input()

for i, s_i in reverse_enumerate(n_gram(s_, len(t))[::-1]):
	if is_equal_match(s_i, t, all_match="?"):
		print(fill_in_str(s_, t, i).replace("?", "a"))
		exit()
print("UNRESTORABLE")

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

using namespace std;

int main() {
    int N, W, w, v;
    cin >> N >> W;

    vector<long long> dp(W + 1);

    for (int i = 0; i < N; i++) {
        cin >> w >> v;
        for (int j = W; j >= w; j--) dp[j] = max(dp[j - w] + v, dp[j]);
    }

    cout << dp[W];

    return 0;
}


Measured memory_bytes: 3948
#include <iostream>
#include <math.h>
#include <map>

using namespace std;

bool check(map<int, int> reportsMap, int noses) {
   int maxReport = noses - 1;
   if (noses % 2 == 0) {
      for (int i = 1; i <= maxReport; i+=2) {
         if (reportsMap[i] != 2) { return false; }
      }

   } else {
      if (reportsMap[0] != 1) { return false; }
      for (int i = 2; i <= maxReport; i+=2) {
         if (reportsMap[i] != 2) { return false; }
      }
   }
   return true;
}

int main() {

   long long noses;
   cin >> noses;

   map<int, int> reportsMap;
   for (int i = 0; i < noses; i++) {
      int report;
      cin >> report;
      if (reportsMap.count(report)) {
         reportsMap[report] += 1;
      } else {
         reportsMap[report] = 1;
      }
   }

   long long pattern = 1;
   for (int j = 0; j < (noses / 2); j++) {
      pattern = pattern * 2 % 1000000007;
   }
   //long long pattern = pow(2, (noses / 2));
   //int answer = pattern % 1000000007;
   long long answer = pattern;

   if (check(reportsMap, noses) == false) {
      answer = 0;
   }

   cout << answer << endl;
}

Measured memory_bytes: 6144
def solve(N, C, K, Ts):
    Ts.sort()
    count = 0
    ans = 0
    time = 0
    for t in Ts[::-1]:
        if count >= C or t < time - K:
            ans += 1
            count = 0
            time = 0
        count += 1
        if time == 0:
            time = t
    if count > 0:
        ans += 1
    return ans


if __name__ == "__main__":
    N, C, K = tuple(map(int, input().split(" ")))
    Ts = [int(input()) for _ in range(N)]
    print(solve(N, C, K, Ts))


Measured memory_bytes: 7888
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define all(x) x.begin(),x.end()


int main()
{
	int k, x; cin >> k >> x;
	if (500 * k >= x)cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int N;
int A[210];

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

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

		//操作が行える場合、行う
		for (int i = 0; i < N; ++i){
			A[i] /= 2;
			}
		++res; //操作回数カウント
		}

		cout << res <<endl;		

	}

Measured memory_bytes: 764
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<iomanip>
using namespace std;

int main(void)
{
    int x,y,z,total = 0,ans = 0;
    cin >> x >> y >> z;
    for(;;)
    {
        if(total + y + z * 2 <= x){total += y + z; ans++;}
        else{break;}
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    a = input()
    if a.upper() == a:
        print("A")
    else:
        print("a")
    return

#Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 65448
#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<math.h>
#include<vector>
using namespace std;

int main(){
    int R;
    cin >> R;
    if(R < 1200) cout << "ABC" << endl;
    else if(R < 2800) cout << "ARC" << endl;
    else cout << "AGC" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
#ifdef LOCAL
#include"rprint.hpp"
#else
template <ostream& out = cout, class... T> void prints(T&&...){ }
template <ostream& out = cout, class... T> void printd(T&&...){ }
template <ostream& out = cout, class... T> void printb(T&&...){ }
template <ostream& out = cout, class... T> void printArr(T&&...){ }
#endif

int main(){
    int n; cin >> n;
    vector<ll> as(n);
    for(int i = 0; i < n; i++){
        cin >> as[i];
    }
    ll ans = MLL, a = accumulate(as.begin(), as.end(), 0ll), b = 0;
    for(int i = 0; i < n - 1; i++){
        a -= as[i];
        b += as[i];
        ans = min(ans, abs(a - b));
        printd(a, b, ans);
    }
    cout << ans << '\n';
    return 0;
}


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

int main() {
  int a;
  cin >> a;
  cout << a+a*a+a*a*a << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
const long long INF = (1LL<<61);

long long Ceil(long long a,long long b){
  return (a+b-1)/b;
}


long long A,B,C,D;
std::map<long long,long long> dp;

long long dfs(long long N){
    if(dp[N]!=0){
        return dp[N];
    }
    if(N<=0){
        return 0;
    }
    if(N==1){
        return D;
    }
    
    long long R = INF;
    if(N<INF/D){
        R = N*D;
    }
    
    //2 floor 
    R = std::min(R,A+D*(N%2)+dfs(N/2));
    
    //2 ceil
    if(N%2!=0){
        R = std::min(R,A+D*(2-N%2)+dfs(Ceil(N,2)));
    }
    
    //3 floor 
    R = std::min(R,B+D*(N%3)+dfs(N/3));
    
    //3 ceil
    if(N%3!=0){
        R = std::min(R,B+D*(3-N%3)+dfs(Ceil(N,3)));
    }
    
    //5 floor 
    R = std::min(R,C+D*(N%5)+dfs(N/5));
    
    //5 ceil
    if(N%5!=0){
        R = std::min(R,C+D*(5-N%5)+dfs(Ceil(N,5)));
    }
    
    dp[N]=R;
    return R;
}

signed main(void){
    
    int T;
    std::cin >> T;
    for(int i=0;i<T;i++){
        long long N;
        std::cin >> N >> A >> B >> C >> D;
        
        dp.clear();
        long long Ans = dfs(N);
        std::cout << Ans << std::endl;
        
    }
    
    return 0;
}


Measured memory_bytes: 4412
from sys import stdin
N = int(stdin.readline().rstrip())
dic = set()
for i in range(N):
    op, string = stdin.readline().rstrip().split()
    if op == 'insert':
        dic.add(string)
    elif op == 'find':
        if string in dic:
            print('yes')
        else:
            print('no')


Measured memory_bytes: 31408
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<utility>
#include<cctype>
using namespace std;

int main(void)
{
  int a,b;
  cin>>a>>b;
  int ans1=0;
  for(int i=0;i<b-a;i++)
    {
      ans1+=i+1;
    }
  cout<<ans1-b<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>

using namespace std;

int n,m,k,ans;
char s[7][7];
bool cho[2][7];

void get_cho(int x,int y)
{
	memset(cho,0,sizeof(cho));
	int k=1;
	while(x)
	{
		if(x&1)cho[0][k]=1;
		x>>=1;++k;
	}
	k=1;
	while(y)
	{
		if(y&1)cho[1][k]=1;
		y>>=1;++k;
	}
}

int main()
{
//	freopen("in.in","r",stdin);
	scanf("%d %d %d",&n,&m,&k);
	
	for(int i=1;i<=n;++i)scanf("%s",s[i]+1);
	
	for(int x=0;x<=(1<<n)-1;++x)
		for(int y=0;y<=(1<<m)-1;++y)
		{
			get_cho(x,y);
			int cnt=0;
			for(int i=1;i<=n;++i)if(!cho[0][i])
				for(int j=1;j<=m;++j)if(!cho[1][j])
					if(s[i][j]=='#')++cnt;
			if(cnt==k)++ans;
		}
	
	printf("%d\n",ans);
	
	return 0;
}

Measured memory_bytes: 1732
#include <stdio.h>
#include <math.h>

int main (void) {
    int n, num;
    int res=0;
    double lim;

    scanf ("%d", &n);

    for (int i=0; i<n; i++) {
        int j = 2;
        scanf ("%d", &num);
        lim = sqrt(num);
        for (; j<=lim; j++) {
            if (num%j==0) break;
        }
        if (j>lim) res++;
    }

    printf ("%d\n", res);

    return 0;
}


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

int main()
{
	int N = 0, M = 0;
	long X = 0;

	cin >> N >> M;

	X = (N - M) * 100 + M * 1900;

	for (int i = 0; i < M; i++)
		X *= 2;

	cout << X << endl;

    return 0;
}

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

#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); bool s=false; if(c=='-'){s=true;c=getchar_unlocked();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); int s=0; if(c=='-'){s=1;c=getchar_unlocked();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar_unlocked(); } *s='\0'; return len; }

int p[25]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
int a[25];
int main(void){
	int n=nextint();
	for(int k=2; k<=n; k++){
		int m=k;
		for(int i=0; i<25; i++){
			while(m%p[i]==0){ m/=p[i]; a[i]++; }
		}
	}
	int ans=0;
	for(int i1=0; i1<25; i1++){
		for(int i2=i1+1; i2<25; i2++){
			for(int i3=i2+1; i3<25; i3++){
				if(a[i1]>=4 && a[i2]>=4 && a[i3]>=2) ans++;
				if(a[i2]>=4 && a[i3]>=4 && a[i1]>=2) ans++;
				if(a[i3]>=4 && a[i1]>=4 && a[i2]>=2) ans++;
			}
			if(a[i1]>=14 && a[i2]>=4) ans++;
			if(a[i2]>=14 && a[i1]>=4) ans++;
			if(a[i1]>=24 && a[i2]>=2) ans++;
			if(a[i2]>=24 && a[i1]>=2) ans++;
		}
		if(a[i1]>=74) ans++;
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 128
float w;main(i){for(;~scanf("%f",&w);i=(i+5)%11,i<8?printf("light %s\n"+i%2*6,"welter\0middle\0heavy\0 fly"+i/2*7):puts("bantam\0 feather\0light"+i*8-64))for(i=0;i<11&&w>"0369<@EKQ["[i++];);}

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

//#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

//#define int long long
using namespace std;
const int INF = 2e9;
const int MOD = 1e9 + 7;
const int MB = 20;

bool cmp(const pair<string, pair<int, int>>& one, const pair<string, pair<int, int>>& two) {
	if (one.first == two.first) return one.second.first > two.second.first;
	return one.first < two.first;
}

void solve() {
	int n;
	cin >> n;
	vector<pair<string, pair<int, int>>> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i].first >> a[i].second.first;
		a[i].second.second = i;
	}
	sort(all(a), cmp);
	for (int i = 0; i < n; i++) {
		cout << a[i].second.second + 1 << '\n';
	}
}


signed main() {
	/*
	freopen("search.in", "r", stdin);
	freopen("search.out", "w", stdout);
	*/
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cout << fixed;
	cout.precision(12);
	solve();
}

Measured memory_bytes: 256
N = int(input())
A = [int(e) for e in input().split()]
B = [int(e) for e in input().split()]
C = [int(e) for e in input().split()]

sut = 0
i = 0

while i < N:
    sut += B[i]
    if i < N-1 and (A[i]+1) == A[i+1]:
        sut += C[(A[i]-1)]
    i += 1

print(sut)

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <cmath>

const int mod = 1000000007;
struct mod_int
{
    long long x;
    mod_int(long long x = 0) : x((x % mod + mod) % mod) {}
    mod_int operator-() const { return mod_int(-x); }
    mod_int &operator+=(const mod_int a)
    {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mod_int &operator-=(const mod_int a)
    {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mod_int &operator*=(const mod_int a)
    {
        (x *= a.x) %= mod;
        return *this;
    }
    mod_int operator+(const mod_int a) const
    {
        mod_int res(*this);
        return res += a;
    }
    mod_int operator-(const mod_int a) const
    {
        mod_int res(*this);
        return res -= a;
    }
    mod_int operator*(const mod_int a) const
    {
        mod_int res(*this);
        return res *= a;
    }
    mod_int pow(long long t) const
    {
        if (!t)
            return 1;
        mod_int a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }
    mod_int inv() const
    {
        return pow(mod - 2);
    }
    mod_int &operator/=(const mod_int a)
    {
        return (*this) *= a.inv();
    }
    mod_int operator/(const mod_int a) const
    {
        mod_int res(*this);
        return res /= a;
    }
};

#include <vector>
#include <cassert>
struct combination
{
    std::vector<mod_int> fact, ifact;
    combination(int n) : fact(n + 1), ifact(n + 1)
    {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i)
            fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i)
            ifact[i - 1] = ifact[i] * i;
    }
    mod_int operator()(int n, int k)
    {
        if (k < 0 || k > n)
            return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
};

int main()
{
    int n, k;
    int a[100000];
    std::cin >> n >> k;
    for (int i = 0; i < n; ++i)
    {
        std::cin >> a[i];
    }

    std::sort(a, a + n);

    mod_int sum_max = 0;
    mod_int sum_min = 0;
    combination comb(n);
    for (int i = k - 1; i < n; ++i)
    {
        sum_max += comb(i, k - 1) * a[i];
    }
    for (int i = 0; i < n - k + 1; ++i)
    {
        sum_min += comb(n - i - 1, k - 1) * a[i];
    }

    std::cout << (sum_max - sum_min).x << std::endl;
    return 0;
}

Measured memory_bytes: 2176
S=str(input())
l=len(S)
ans=0
dig=1
mod=[0]*2019
mod[0]=1
t=0
for i in range(l):
    t=(t+int(S[-i-1])*dig)%2019
    mod[t]+=1
    dig=(dig*10)%2019
    
for j in mod:
    ans=ans+(j*(j-1))//2
print(ans)


Measured memory_bytes: 9128
#include<bits/stdc++.h>
#define S second
#define f first
#define P pair<int,int>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
main(){
  int n,p,m,t,s;
  cin>>n;
  vector<int>a[n+1];
  r(i,n){cin>>p>>m;
    while(m--)cin>>t,a[p].push_back(t);
  }
  cin>>m;
  while(m--){
    bool v[n+1];
    r(i,n+1)v[i]=0;
    cin>>s>>t>>p;p--;
    queue<P>q;
    q.push(make_pair(s,0));
    v[s]=1;
    while(!q.empty()){
      P w=q.front();q.pop();
      if(w.f==t){cout<<w.S+1<<endl;goto L;}
      r(i,a[w.f].size()){
        if(!v[a[w.f][i]]&&w.S+1<=p){
          q.push(make_pair(a[w.f][i],w.S+1));
          v[a[w.f][i]]=1;
        }
      }     
    }
    cout<<"NA"<<endl;
    if(0)L:n++;
  }
}

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

int main () {
    int n;
    cin >> n;
    vector <double> x(n);
    vector <double> y(n);
    for (int i = 0; i < n; i++) cin >> x[i];
    for (int i = 0; i < n; i++) cin >> y[i];

    for (int i = 1; i <= 4; i++) {
        double D = 0;
        if (i != 4){
            for (int j = 0; j < n; j++) {
                D += pow(abs(x[j] - y[j]), i);
            }
            printf("%.8f\n", pow(D, (double)1/ (double)i));
        } else {
            for (int j = 0; j < n; j++) {
                double chebi = abs(x[j] - y[j]);
                if (D < chebi) {
                    D = chebi;
                }
            }
            printf("%.8f\n", D);
        }
    }

}


Measured memory_bytes: 3408