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

using namespace std;

typedef long long int ll;

const ll MAXN = 105;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  ll n, m;
  cin >> n >> m;
  vector < ll > a(m), b(m), c(m);
  vector < vector < ll > > d(MAXN, vector < ll > (MAXN, 1e17));
  for(int i = 0; i < m; i++){
    cin >> a[i] >> b[i] >> c[i];
    d[a[i]][b[i]] = c[i];
    d[b[i]][a[i]] = c[i];
  }

  for(int k = 1; k <= n; k++){
    for(int i = 1; i <= n; i++){
      for(int j = 1; j <= n; j++){
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }

  ll ans = 0;
  for(int i = 0; i < m; i++){
    if(d[a[i]][b[i]] < c[i]) ans++;
  }

  cout << ans << '\n';
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int>


int main(){
  int H, W; cin >> H >> W;
  string s[H]; 
  rep(i,H) cin >> s[i];

  rep(i,2*H){
    int j = i/2;
    cout << s[j] << endl;
  }

  // cout << fixed << setprecision(6);
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <regex>
#include <set>
#include <cmath>
#include <numeric>

using namespace std;

struct Elem
{
    int x;
    int y;
};

int main()
{
    int s, w;
    std::cin >> s >> w;

    if(s <= w)
    {
        std::cout << "unsafe";
    }else
    {
        std::cout << "safe";
    }

    return EXIT_SUCCESS;
} 


Measured memory_bytes: 3068
import sys
sys.setrecursionlimit(100010)

l = input()
dpf = [1] * (len(l) + 1)
mod = 1000000007
for i in range(len(l)-1, -1, -1):
    dpf[i] = (3 * dpf[i+1]) % mod

def dfs(i):
    if i == len(l):
        return 1
    if l[i] == '0':
        return dfs(i+1)
    return (dpf[i+1] + (dfs(i+1) * 2) % mod) % mod

print(dfs(0))

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

int main() {
  int a,b;
  cin >> a >> b;
  
  if(a>=b){
    for(int i = 0; i < a; i++){
      cout << b;
    }
  }
  else{
    for(int i = 0; i < b; i++){
      cout << a;
    }
  }
  
 cout << endl; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using in6 = int64_t;
using ind = double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if(a == b && b == c && c == a) {
    cout << "No" << endl;
  }
  else if(a != b && b != c && c != a) {
    cout << "No" << endl;
  }
  else {
    cout << "Yes" << endl;
  }
}


Measured memory_bytes: 256
import java.util.*;

class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        int m = a * b;
        int r = 2 * ( a + b );
        System.out.println( m + " " + r );
    }
}


Measured memory_bytes: 26164
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define p pair<int,int>
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
using namespace std;
int POW(int x,int y){return int(pow(double(x),double(y)));}

int main(){
	int h,w;
	cin>>h>>w;
	vector<vector<int>> c(10),a(h);
	rep(i,10){
		c[i].resize(10);
		rep(j,10){
			cin>>c[i][j];
		}
	}
	rep(i,h){
		a[i].resize(w);
		rep(j,w){
			cin>>a[i][j];
		}
	}
	//ダイダストラ
	vector<int> b(10);
	b[1]=0;
	bool flag[10];
	rep(i,10){
		b[i]=c[i][1];
		flag[i]=0;
	}
	flag[1]=1;
	rep(aaa,9){
		int m=INF,mi;
		rep(i,10){
			if(flag[i]==0 && m>b[i]){
				m=b[i];
				mi=i;
			}
		}
		flag[mi]=1;
		rep(i,10){
			if(flag[i]==0){
				b[i]=min(b[i],b[mi]+c[i][mi]);
			}
		}
	}
	ll ans=0;
	rep(i,h){
		rep(j,w){
			if(a[i][j]>-1){
				ans+=b[a[i][j]];
			}
		}
	}
	cout<<ans<<endl;
	
}

Measured memory_bytes: 384
import math
line = input().split()
a = int(line[0])
b = round(100 * float(line[1]))

# c = round(a * b) = a * (b * 100)  / 100

# for n in range(10):
#     for j in range(100):
#         b2 = n+j/100
#         b2 = b2 * 100
#         if round(b2) != math.floor(b2):
            
#             print('!?')
#             print(b2)
#             print(round(b2),math.floor(b2))

print((a*b)//100)

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

using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    vector<int> v(n);
    for(int i=0;i<n;i++) scanf("%d",&v[i]);
    sort(v.begin(),v.end());
    long long res=0;
    for(int o=0;o<n;o++)
    {
        for(int i=o+1;i<n;i++)
        {
            int a=v[o];
            int b=v[i];
            int l=-1,r=n;
            while(l<r-1)
            {
                int m=(l+r)/2;
                if(v[m]>b-a) r=m;
                else l=m;
            }
            int x=r;
            l=-1,r=n;
            while(l<r-1)
            {
                int m=(l+r)/2;
                if(v[m]<a+b) l=m;
                else r=m;
            }
            int y=l;
            if(b-a<a&&a<a+b) y--;
            if(b-a<b&&b<a+b) y--;
            res+=max(0,y-x+1);
        }
    }
    printf("%lld\n",res/3);
    return 0;
}


Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("\n");
var n = arr.shift() - 0;
for (var i = 0; i < n; i++) {
   var [d, a] = arr[i].split(" ").map(Number);
   var d1 = Math.floor(d / 100);
   var d2 = Math.ceil(d / 100);
   var a1 = Math.floor(a / 30);
   var a2 = Math.ceil(a / 30);
   var ans = [];
   if (d % 100 == 0 && a % 30 == 0) {
      ans.push(d1+ a1 * 5);
   } else if (d % 100 == 0) {
      ans.push(d1 + a1 * 5);
      ans.push(d1+ a2 * 5);
   } else if (a % 30 == 0) {
      ans.push(d1 + a1 * 5);
      ans.push(d2 + a1 * 5);
   } else {
      ans.push(d1 + a1 * 5);
      ans.push(d2 + a1 * 5);
      ans.push(d1 + a2 * 5);
      ans.push(d2 + a2 * 5);
   }
   console.log(ans.join(" "));
}


Measured memory_bytes: 15888
import math
import fractions
import heapq
import sys
import re
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

N=int(input())
A=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

print(max(A)-min(A))

Measured memory_bytes: 68588
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n; cin >> n;
	vi a(n, inf);
	rep(i, n - 1){
		int b; cin >> b;
		a[i] = min(a[i], b);
		a[i + 1] = min(a[i + 1], b);
	}
	cout << accumulate(all(a), 0LL) << endl;
	
	return 0;
}

Measured memory_bytes: 256
/*
[agc024] C - Sequence Growing Easy
*/

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;

const int MAX_N = 200000;

int N;
ll a[MAX_N];

ll solve() {
    ll cnt[MAX_N];
    memset(cnt, 0, sizeof(cnt));

    if (a[0] > 0) {
        return -1;
    }
    for (int i = 1; i < N; i++) {
        if (a[i] - a[i - 1] > 1) {
            return -1;
        }
        if (a[i] > i) {
            return -1;
        }
        cnt[i - a[i]] = max(cnt[i - a[i]], a[i]);
    }

    return accumulate(cnt, cnt + N, 0LL);
}

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

    cout << solve() << endl;

    return 0;
}


Measured memory_bytes: 3328
//Waqt Ha Badal Jayega//

#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	//Constructive algo is love !!//

	ll k;
	cin >> k;
	ll a, b;
	cin >> a >> b;
	int flag = 0;
	for (ll i = a; i <= b; i++)
	{
		if (i % k == 0)
		{
			flag = 1;
			break;
		}
	}
	if (flag)
	{
		cout << "OK" << "\n";
	}
	else
	{
		cout << "NG" << "\n";
	}
	return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define f0(i,a,b) for(int i=a;i<b;i++)
#define f1(i,a,b) for(int i=a;i<=b;i++)
#define f2(i,a,b) for(int i=a;i>b;i--)
#define f3(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define pb push_back
#define mp make_pair
#define pii pair<int,int>

#define fi first
#define se second
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test int t;cin>>t;while(t--)

signed main(){
    fast
string s;
cin>>s;
int c=0;
f0(i,0,s.length())
{
    c+=int(s[i])-48;
}
  if(c%9==0)cout<<"Yes";
  else cout<<"No";
    }

Measured memory_bytes: 3768
import java.util.Scanner;

public class Main {

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

    long x = sc.nextLong();
    long y = sc.nextLong();

    System.out.println(gcd(x, y));
  }

  public static long gcd(long x, long y) {
    while (x != y) {
        if (x > y) {
            x -= y;
        } else {
            y -= x;
        }
    }
    return x;
  }
}


Measured memory_bytes: 26304
n = gets.to_i
x = 0
a = 1
n.times {
	o, y = gets.split.map(&:to_i)
	case o
	when 1
		x += a * y
	when 2
		x -= a * y
	when 3
		x *= y
	when 4
		a *= y
	end
}
puts x / a

Measured memory_bytes: 16132
open System.Collections.Generic
open System.Linq

// TODO: 関数型っぽく書き換える

let S = stdin.ReadLine()
let Q = stdin.ReadLine() |> int

let mutable flag = true
let ll = new LinkedList<char>()

'*'
|> ll.AddLast
|> ignore

for i in [ 0..Q - 1 ] do
    let input = stdin.ReadLine()
    if (input.[0] = '1') then
        if (flag) then flag <- false
        else flag <- true
    else
        let q = input.Split().ToArray()
        if (flag) then
            if (q.[1] = "1") then
                q.[2]
                |> char
                |> ll.AddFirst
                |> ignore
            else
                q.[2]
                |> char
                |> ll.AddLast
                |> ignore
        else if (q.[1] = "1") then
            q.[2]
            |> char
            |> ll.AddLast
            |> ignore
        else
            q.[2]
            |> char
            |> ll.AddFirst
            |> ignore

let str = (new string(ll.ToArray())).Replace("*", S)

if flag then str
else new string(str.Reverse().ToArray())
|> printfn "%s"

Measured memory_bytes: 41236
#include<bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

int main(){
  int arr[5];
  for(int i=0;i<5;i++){
    cin>>arr[i];
  }
  for(int i=0;i<5;i++){
    if(arr[i]==0){
    cout<<i+1<<endl;
      break;
    }
  }
  return 0;
}
    
  
  

Measured memory_bytes: 3648
N = int(input())
a_list = [int(input())-1 for _ in range(N)] # インデックスとボタンの番号を合わせるために-1しておく

a_now = 0
a_pushed = [0]*N

while 1:
    if a_now == 1:
        print(sum(a_pushed)) # ボタンを押した回数を出力
        exit()
    elif a_pushed[a_now] == 1: # 押したことがあるボタンに到達
        print(-1)
        exit()
    else:
        a_pushed[a_now] = 1
        a_now = a_list[a_now]

Measured memory_bytes: 7980
#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <algorithm>

bool same_sign(intmax_t m, intmax_t n) {
  if (m < 0 && n < 0) return true;
  if (m > 0 && n > 0) return true;
  return false;
}

intmax_t f(const std::vector<int>& a, const std::vector<int>& b) {
  intmax_t res = 0;
  intmax_t sum = 0;
  for (size_t i = 0; i < a.size(); ++i) {
    if (same_sign(sum+a[i], b[i])) {
      sum += a[i];
    } else {
      res += abs(sum+a[i]-b[i]);
      sum = b[i];
    }
  }
  return res;
}

int main() {
  size_t n;
  scanf("%zu", &n);

  std::vector<int> a(n);
  for (auto& ai: a) scanf("%d", &ai);

  std::vector<int> b(n, 1);
  for (size_t i = 0; i < n; i += 2) b[i] = -1;

  intmax_t res = f(a, b);
  for (auto& bi: b) bi = -bi;
  res = std::min(res, f(a, b));
  printf("%jd\n", res);
}


Measured memory_bytes: 1024
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int n, P, Q, R, C;
	static int[][] confectioneries;
	public static void main(String[] args) {
		while(read()){
			solve();
		}
	}
	
	static boolean read(){
		n = sc.nextInt();
		if( n == 0 )return false;
		confectioneries = new int[n][4];
		for(int i = 0; i < confectioneries.length; i++){
			for(int j = 0; j < confectioneries[0].length; j++){
				confectioneries[i][j] = sc.nextInt();
			}
		}
		P = sc.nextInt();
		Q = sc.nextInt();
		R = sc.nextInt();
		C = sc.nextInt();
		return true;
	}
	
	static void solve(){
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i = 0; i < confectioneries.length; i++){
			int sum = 0;
			for(int j = 1; j < confectioneries[0].length; j++){
				sum += confectioneries[i][j] * 4;
				if ( j == 2 )sum += confectioneries[i][2] * 5;
			}
			if( confectioneries[i][1] <= P
					&& confectioneries[i][2] <= Q
					&& confectioneries[i][3] <= R
					&& sum <= C){
				list.add(confectioneries[i][0]);
			}
		}
		if( list.isEmpty() ){
			System.out.println("NA");
		}else{
			for(int i = 0; i < list.size(); i++){
				System.out.println(list.get(i));
			}
		}
	}

}

Measured memory_bytes: 64112
def maximum(A,l,m,n):
    maxint=A[l][m]
    for i in range(m,n):
        s=sum(A[l][m:i+1])
        if s<0:continue
        for j in range(l,n-1):
            t=sum(A[j+1][m:i+1])
            if s+t<=0:break
            s+=t
            maxint=max(maxint,s)
    return maxint

n=input()
A=[map(int,raw_input().split()) for i in range(n)]
maxint=A[0][0]
for i in range(n):
    for j in range(n):
        maxint=max(maximum(A,i,j,n),maxint)
print maxint

Measured memory_bytes: 4588
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define dup(x,y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pii> vp;
typedef vector<T> vt;
inline int getInt() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MX = 200005;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
//---------------------------------------------------------------
#define fastio cin.tie(nullptr); std::ios::sync_with_stdio(false);
#define myio ifstream iofi; if(argc>1){iofi.open(argv[1]); std::cin.rdbuf(iofi.rdbuf());}
//--------------------------------------------------------------

void Main(){
  string s;
  cin>>s;
  int n = s.length();
  int cnt=0;
  rep(i,n) if(s[i]=='0') cnt++;
  cout<<n-abs(abs(n-cnt)-cnt)<<endl;
} int main(int argc,char** argv)
{fastio; myio; Main();}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

// 参考 https://ei1333.github.io/luzhiled/snippets/structure/segment-tree.html
template <typename T>
struct SegTree {
    using F = function<T(T,T)>;
    
    int size;
    vector<T> dat;

    const F f;
    const T INIT;
    
    SegTree(int n, const F func, const T &init) : f(func), INIT(init) {
        size = 1;
        while(size < n) size <<= 1;
        dat.assign(2*size, INIT);
    }

    void update(int k, const T &x) {
        k += size;
        dat[k] = x;
        while(k >>= 1) {
            dat[k] = f(dat[2*k],dat[2*k+1]);
        }
    }

    T query(int a,int b) {
        T l = INIT, r = INIT;
        for(a += size, b += size+1; a < b; a >>= 1, b >>= 1) {
            if (a & 1) l = f(l,dat[a++]);
            if (b & 1) r = f(r,dat[--b]);
        }
        return f(l,r);
    }

    // 未使用機能
    private:
    void set(int k, const T &x) {
        dat[k+size] = x;
    }

    void build() {
        for(int k = size - 1; k > 0; k--) {
            dat[k] = f(dat[2*k],dat[2*k+1]);
        }
    }

    T operator[](const int &k) const {
        return dat[k+size];
    }


};


int main(void)
{
    IOS
    int N, Q;
    cin >> N >> Q;

    SegTree<int> seg(N,[](int a,int b){return min(a,b);}, INT_MAX);

    REP(i,Q) {
        int c, x, y;
        cin >> c >> x >> y;
        if (c == 0) seg.update(x,y);
        else OUT(seg.query(x,y))
    }

    return 0;
}


Measured memory_bytes: 3888
a = int(input())
b = int(input())
c = int(input())
x = int(input())

counter = 0

for i in range(0, a+1):
    for j in range(0, b+1):
        for k in range(0, c+1):
            total = (500 * i) + (100 * j) + (50 * k)
            if total == x:
                counter += 1

print(counter)


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1000000;
#include <map>
#include <math.h>
 
using ll = long long;
using namespace std;

ll n, k;
const ll mod = 1000000007;


int main(){
    string s, t;
    cin >> s >> t;
    int count=0;
    rep(i, 3){
        if(s[i]==t[i]) count++;
    }
    out(count);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector<pi> vpi;
typedef long double ld;
#define pb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ALL(x) x.begin(), x.end()
#define SZ(x) (ll)x.size()
#define f first
#define s second
const ll MAXN = 100110;
const ll INF = 1e15;
const ll MOD = 1e9+7;
ll N,a,b,c,d,e;
ll A[MAXN];
ll B[MAXN];
vi V;

int main(){
    string a,b;
    cin>>a>>b;
    for(int i=0;i<SZ(a);++i)if(a[i]!=b[i]){
        cout<<"No";
        return 0;
    }
    cout<<"Yes";
}

Measured memory_bytes: 3624
#include<iostream>
#include<fstream>
#include<math.h>

using namespace std;

long binary(long bina,long K){
    long ans;
    for (int i = 0; bina>0 ; i++)
    {
      //ans = ans+(bina%K)*pow(10,i);
      ans++;
      bina = bina/K;
    }
    return ans;
}

int main(){
  //ifstream in("input.txt");
  //cin.rdbuf(in.rdbuf());

  long N,K;
  cin>>N>>K;

  if(N==1){
    cout<<1<<endl;
    return 0;
  }

  cout<<binary(N,K)<<endl;
}

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

int main(){
	int n,a[200];
	cin >> n;
	for(int i=1;i<=n;i++) cin >> a[i];
	int max=a[1],ans=1;
	for (int i=2;i<=n;i++){
		if (a[i]>=max) {
			ans++ ;
			max=a[i];
		}
	}
	cout << ans;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

int main(){
    string s,t;
    cin >> s >> t;
    int cnt = 0;
    for (int i = 0; i < s.length(); i++) {
        if (s.at(i) != t.at(i)) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3852
# B - Popular Vote

n, m = map(int, input().split())
a = list(int(x) for x in input().split())

s = sum(a)
cnt = 0

for i in range(n):
    if a[i] * 4 * m >= s:
        cnt += 1

if cnt >= m: 
    print('Yes')
else: 
    print('No')
    

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e3 + 5;

char a[12][N];
int r, c, k;

vector<vector<int>>v;
vector<int> tmp;

int solve(){
    int ret = 0;
    int total[15]{};
    for(int i = 0; i < c; i++){
        int kam[15]{};
        for(int j = 0; j < v.size(); j++){
            for(auto x: v[j]){
                if(a[x][i] == '1') kam[j]++;
            }
        }
        for(int j = 0; j < v.size(); j++){
            if(kam[j] > k) return 2e9;
        }
        bool nkml = 1;
        for(int j = 0; j < v.size(); j++){
            if(kam[j] + total[j] > k) nkml = 0;
        }
        if(nkml){
            for(int j = 0; j < v.size(); j++){
                total[j] += kam[j];
            }
        }
        else{
            ret++;
            for(int j = 0; j < v.size(); j++) total[j] = kam[j];
        }
    }
    return ret;


}


int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin  >> r >> c >> k;
    for(int i = 0; i < r; i++){
        for(int j = 0; j < c; j++){
            cin >> a[i][j];
        }
    }
    int ans = 2e9;
    for(int mask = 0; mask < (1 << (r - 1)); mask++){
        v.clear();
        for(int i = 0; i < r; i++){
            tmp.push_back(i);
            if(mask >> i & 1){
                v.push_back(tmp);
                tmp.clear();
            }
        }
        v.push_back(tmp);
        tmp.clear();
        ans = min(ans, __builtin_popcount(mask) + solve());
    }
    cout << ans;

    return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int nmax = 100005;
vector<int> A[nmax], B[nmax];
int color[nmax];
void DFS(int u, int N)
{
	bool check = true;
	for (int i = 0; i < N; i++)
	{
		if (color[i] == 0)
		{
			check = false;
			break;
		}
	}
	if (check)
	{
		for (int i = 0; i < N; i++)
		{
			cout << color[i] % 2 << endl;
		}
		return;
	}
	for (int i = 0; i < A[u].size(); i++)
	{
		if (color[A[u][i]] == 0)
		{
			color[A[u][i]] = color[u];
			DFS(A[u][i], N);
		}
	}
	for (int i = 0; i < B[u].size(); i++)
	{
		if (color[B[u][i]] == 0)
		{
			color[B[u][i]] = color[u] % 2 + 1;
			DFS(B[u][i], N);
		}
	}
	return;
}

int main()
{

	int N;
	cin >> N;
	for (int i = 0; i < N - 1; i++)
	{
		int x, y, z;
		cin >> x >> y >> z;
		if (z % 2 == 0)
		{
			A[x - 1].push_back(y - 1);
			A[y - 1].push_back(x - 1);
		}
		else if (z % 2 == 1)
		{
			B[x - 1].push_back(y - 1);
			B[y - 1].push_back(x - 1);
		}
	}

	color[0] = 2;
	DFS(0, N);
}


Measured memory_bytes: 12160
#include <bits/stdc++.h>
#define For(i, begin, end) for(int i=begin;i<end;i++)
#define Rep(i, n) For(i,0,n)
#define Sort(v) sort(v.begin(),v.end())
using namespace std;

int main(){
  int N,T;cin>>N>>T;
  int c,t;
  int ans=10000;
  Rep(i,N){
    cin>>c>>t;
    if(t<=T)ans=min(ans,c);
  }
  if(ans==10000)cout<<"TLE";
  else cout<<ans;
    
  return 0;
}

Measured memory_bytes: 256
A = list()
for i in range(3):
    A.append(list(map(int, input().split())))
N = int(input())
B = [int(input()) for _ in range(N)]
checkList = [[False, False, False], [False, False, False], [False, False, False]]
for b in B:
    for i in range(3):
        for j in range(3):
            if b == A[i][j]:
                checkList[i][j] = True
checkListT = [list(x) for x in zip(*checkList)]

ans = "No"
if all(checkList[0]):
   ans = "Yes"
if all(checkList[1]):
   ans = "Yes"
if all(checkList[2]):
   ans = "Yes"

if all(checkListT[0]):
   ans = "Yes"
if all(checkListT[1]):
   ans = "Yes"
if all(checkListT[2]):
   ans = "Yes"

if checkList[0][0] and checkList[1][1] and checkList[2][2]:
    ans = "Yes"
if checkList[0][2] and checkList[1][1] and checkList[2][0]:
    ans = "Yes"

print(ans)

Measured memory_bytes: 3064
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;


void solve(long long A, long long B, long long K){
    if(A>= K){
        cout << A-K <<" " <<B<<endl;
    }
    else{
        K -= A;
        cout << 0 << " "<<max(0LL, B-K)<<endl;
    }
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long K;
    scanf("%lld",&K);
    solve(A, B, K);
    return 0;
}


Measured memory_bytes: 256
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

vector<int> v[100000];

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

    int n = gi();
    int m = gi();
    for (int i = 0; i < n; i++) {
        int a = gi();
        int b = gi();
        if (a > m)
            continue;
        v[m-a].push_back(b);
    }

    map<int, int> mp;
    int r = 0;
    for (int i = m-1; i >= 0; i--) {
        for (int x : v[i])
            mp[x]++;
        if (mp.empty())
            continue;
        auto it = mp.end(); it--;
        r += it->first;
        it->second--;
        if (it->second == 0)
            mp.erase(it);
    }

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

    return 0;
}


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

typedef long long lnt;

const int N = 1e5 + 1;

namespace dsu {

int id[N];

void clear (int n = N - 1) { iota(id, id + n + 1, 0); }
int fs (int x) { return x == id[x] ? x : id[x] = fs(id[x]); }
bool ms (int x, int y) { if ((x = fs(x)) == (y = fs(y))) return false; id[y] = x; return true; }

};

int main (void) {
	int n, m;
	scanf("%d%d", &n, &m);
	dsu::clear(n);
	for (int i = 1, u, v; i <= m; i ++) {
		scanf("%d%d", &u, &v);
		dsu::ms(u, v);
	}
	int ans = - 1;
	for (int i = 1; i <= n; i ++)
		ans += (dsu::fs(i) == i);
	printf("%d\n", ans);
}

Measured memory_bytes: 4148
package main

import "fmt"

func main() {
	var k int
	var s string
	fmt.Scan(&k)
	fmt.Scan(&s)

	if len([]byte(s)) <= k {
		fmt.Println(s)
		return
	}

	ans := ""
	for i := 0; i < k; i++ {
		ans += string(s[i])
	}
	fmt.Println(ans + "...")
}

Measured memory_bytes: 1756
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Math;
using System.Text;
using System.Threading;
using System.Globalization;
using System.Runtime.CompilerServices;
using Library;

namespace Program
{
    public static class ABC150B
    {
        static public int numberOfRandomCases = 0;
        static public void MakeTestCase(List<string> _input, List<string> _output, ref Func<string[], bool> _outputChecker)
        {
        }
        static public void Solve()
        {
            var N = NN;
            var S = NS;
            var ans = 0;
            for (var i = 0; i < N - 2; i++)
            {
                if (S[i] == 'A' && S[i + 1] == 'B' && S[i + 2] == 'C') ans++;
            }
            Console.WriteLine(ans);
        }
        static class Console_
        {
            static Queue<string> param = new Queue<string>();
            public static string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }
        }
        class Printer : StreamWriter
        {
            public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
            public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }
            public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }
        }
        static public void Main(string[] args) { if (args.Length == 0) { Console.SetOut(new Printer(Console.OpenStandardOutput())); } var t = new Thread(Solve, 134217728); t.Start(); t.Join(); Console.Out.Flush(); }
        static long NN => long.Parse(Console_.NextString());
        static double ND => double.Parse(Console_.NextString());
        static string NS => Console_.NextString();
        static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();
        static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();
        static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();
        static IEnumerable<T> OrderByRand<T>(this IEnumerable<T> x) => x.OrderBy(_ => xorshift);
        static long Count<T>(this IEnumerable<T> x, Func<T, bool> pred) => Enumerable.Count(x, pred);
        static IEnumerable<T> Repeat<T>(T v, long n) => Enumerable.Repeat<T>(v, (int)n);
        static IEnumerable<int> Range(long s, long c) => Enumerable.Range((int)s, (int)c);
        static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }
        static IEnumerator<uint> _xsi = _xsc();
        static IEnumerator<uint> _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }
    }
}
namespace Library {
}


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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T> void operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) cin >> e; }

typedef long long ll;
int const inf = 1<<29;

int main() {
  string s; cin >> s;
  int w; cin >> w;
  rep(i, s.size()) {
    if (w * i >= s.size()) break;
    cout << s[w * i];
  }
  cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define FUP(i, a, b) for(int i = a; i <= b; i++)
#define FDOWN(i, a, b) for(int i = a; i >= b; i--)
#define MS(a, b) memset(a, b, sizeof(a))
#define ALL(v) v.begin(), v.end()
#define CIN(a) cin >> a;
#define CIN2(a, b) cin >> a >> b
#define CIN3(a, b, c) cin >> a >> b >> c
#define COUT(a) cout << a
#define COUT2(a, b) cout << a << ' ' << b
#define COUT3(a, b, c) cout << a << ' ' << b << ' ' << c
#define ENDL cout << '\n'
int dy[4] = { -1, 1, 0, 0 };
int dx[4] = { 0, 0, 1, -1 };

int N, X, T;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	CIN3(N, X, T);
	int answer = N / X;
	if (N % X) answer++;
	COUT(answer * T);

	return 0;
}

Measured memory_bytes: 3636
#if __has_include("debug.h")
    #include "debug.h"
#else  
#include <bits/stdc++.h>
using namespace std;
#define d(...) 2;
#endif

#define int long long int

#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"      

#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ff first
#define ss second
#define eps 1e-10

#define gcd(a,b)            __gcd((a),(b))
#define lcm(a,b)            ((a*b)/gcd(a,b))

void solve();

int32_t main()
{
    #ifdef DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
    #endif 

    fast
    
    int t = 1;
	// cin>>t;
	
	while(t--)
	    solve();
	return 0;  
}

void solve()
{
	int i,j;
	int n;
	cin>>n;

	vector<int>a(n);

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

	int cnt=0,k;


	sort(all(a));

	if(n<=2)
	{
		cout<<0<<endl;
		return;
	}

	for(i=0;i<n-2;i++)
	{
		for(j=i+1;j<n-1;j++)
		{
			for(k=j+1;k<n;k++)
			{
				if(a[i]+a[j]>a[k]&&(a[i]!=a[j]&&a[i]!=a[k]&a[j]!=a[k]))
				{
					cnt++;
				}
			}
		}
	}
	cout<<cnt<<endl;

}


Measured memory_bytes: 3636
/************************************************
   Start coding only after you have clear idea. 
*************************************************/

#include <bits/stdc++.h>

#define x first
#define y second
#define pii pair<int,int>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long LL;
const int maxm = 2e3+23;
const int maxn = 2e5+35;
int main(){
    string s = "ACL";
    int K; cin >> K;
    while(K--){
        cout << s;
    }
    return 0;
}

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

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int a = sc.nextInt();
    int b = sc.nextInt();
    sc.close();

    long MOD = 1000000007L;
    long ans = modPow(2, n, MOD) - 1;
    long c = 1;
    for (int i = 1; i < b + 1; i++) {
      c *= modInv(i, MOD);
      c %= MOD;
      c *= (n - i + 1);
      c %= MOD;
      if (i == a) ans -= c;
      if (ans < 0) ans += MOD;
      if (i == b) ans -= c;
      if (ans < 0) ans += MOD;
    }
    System.out.println(ans);
  }

  private static long modInv(long x, long mod) {
    return modPow(x, mod - 2, mod);
  }

  private static long modPow(long b, long e, long mod) {
    long ans = 1;
    long x = b % mod;
    for (long y = e; y != 0; y >>= 1) {
      if ((y & 1) == 1) ans = (ans * x) % mod;
      x = (x * x) % mod;
    }
    return ans;
  }
}

Measured memory_bytes: 23764
package main
 
import (
    "bufio"
    "fmt"
    "os"
    "strconv"
)

func main(){
    a := nextInt()
    b := nextInt()
    c := nextInt()
    ans := 0
    for i := a; i <= b; i++ {
        if i == 0 {
            continue;
        }
        if c%i == 0{
            ans++;
        }
    }
    fmt.Println(ans);
}
 
/* templates */
 
func Max(a ...int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r < a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Min(a ...int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r > a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Sum(a []int) (r int) {
    for i := range a {
        r += a[i]
    }
    return r
}
 
func Abs(a float64) float64 {
    if a < 0 {
        return -a
    }
    return a
}
 
type Pair struct {
    a, b int
}
 
type Pairs []Pair
 
func (p Pairs) Len() int {
    return len(p)
}
 
func (p Pairs) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}
 
func (p Pairs) Less(i, j int) bool {
    return p[i].b < p[j].b
}
 
var nextReader func() string
 
func init() {
    nextReader = NewScanner()
}
 
func NewScanner() func() string {
    r := bufio.NewScanner(os.Stdin)
    r.Buffer(make([]byte, 1024), int(1e+11))
    r.Split(bufio.ScanWords)
    return func() string {
        r.Scan()
        return r.Text()
    }
}
 
func nextString() string {
    return nextReader()
}
 
func nextInt64() int64 {
    v, _ := strconv.ParseInt(nextReader(), 10, 64)
    return v
}
 
func nextInt() int {
    v, _ := strconv.Atoi(nextReader())
    return v
}
 
func nextInts(n int) []int {
    r := make([]int, n)
    for i := 0; i < n; i++ {
        r[i] = nextInt()
    }
    return r
}
 
func nextFloat64() float64 {
    f, _ := strconv.ParseFloat(nextReader(), 64)
    return f
}


Measured memory_bytes: 1092
#include <stdio.h>

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

    int ab = a*b;
    int cd = c*d;

    if (ab > cd) {
        printf("%d\n", ab);
    } else {
        printf("%d\n", cd);
    }

    return 0;
}

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


public class Main {
    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            StringTokenizer st = new StringTokenizer(in.readLine());
            int N = Integer.parseInt(st.nextToken());
            int H = Integer.parseInt(st.nextToken());
            int W = Integer.parseInt(st.nextToken());

            int amount = 0;
            for (int I = 0; I < N; I++) {
                st = new StringTokenizer(in.readLine());
                int l = Integer.parseInt(st.nextToken());
                int w = Integer.parseInt(st.nextToken());
                if (l >= H && w >= W) {
                    amount++;
                }
            }
            System.out.println(amount);
        } catch (IOException ex) {

        }
    }
}


Measured memory_bytes: 21332
#include<iostream>

int main(void)
{
  int N;
  int x0 = 0;
  int y0 = 0;
  int t0 = 0;
  bool flag = false;
  std::cin >> N;
  for(int i = 0; i < N; i++){
    int t, x, y;
    std::cin >> t >> x >> y;
    int disX = std::abs(x - x0);
    int disY = std::abs(y - y0);
    int uc_dis = disX + disY;
    int subT = t - t0;
    if(uc_dis > subT){
      flag = true;
    }
    else if((uc_dis - subT) % 2 != 0){
      flag = true;
    //s  std::cout << x << y <<  uc_dis << std::endl;
    }
    x0 = x;
    y0 = y;
    t0 = t;
    //
  }
  if(flag){
    std::cout << "No" << std::endl;
  }else{
    std::cout << "Yes" << std::endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    int k,s,z;
    cin>>k>>s;
    int c=0;
    for(int i=0;i<=k;i++){
    for(int j=0;j<=k;j++){
    	z=s-i-j; 
    	if(s==(i+j+z))
    if(z>=0&&z<=k)
    c+=1;
    }}
    cout<<c;
    return 0;
    }

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

  int n, r;
  cin >> n >> r;
  if(10<=n){
    cout << r << endl;
  } else {
    cout << 100 * (10 - n) + r << endl;
  }

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
int main(void){
	char a[100001];
	int b;
	int c;
	int x;
	for (int i = 0; i < 100001; i++)a[i] = 0;
	scanf("%s", a);
	b = strlen(a);
	c = 0;
	x = 0;

	for (; c != b&&x == 0;){
		if (b - c == 5){
			if (a[c] == 'd'){
				if (a[c + 1] == 'r'&&a[c + 2] == 'e'&&a[c + 3] == 'a'&&a[c + 4] == 'm'){
					c = c + 5;
				}
				else{
					x++;
				}
			}
			else if (a[c] == 'e'){
				if (a[c + 1] == 'r'&&a[c + 2] == 'a'&&a[c + 3] == 's'&&a[c + 4] == 'e'){
					c = c + 5;
				}
				else{
					x++;
				}
			}
			else {
				x++;
			}
		}
		else if (b - c == 6){
		 if (a[c] == 'e'){
			if (a[c + 1] == 'r'&&a[c + 2] == 'a'&&a[c + 3] == 's'&&a[c + 4] == 'e'&&a[c+5]=='r'){
				c = c + 6;
			}
			else{
				x++;
			}
		}
		else {
			x++;
		}
		}
		else if (b - c == 7){
			if (a[c] == 'd'){
				if (a[c + 1] == 'r'&&a[c + 2] == 'e'&&a[c + 3] == 'a'&&a[c + 4] == 'm'&&a[c+5]=='e'&&a[c + 6] == 'r'){
					c = c + 7;
				}
				else{
					x++;
				}
			}
			else {
				x++;
			}
		}
		else {
			if (a[c] == 'd'){
				if (a[c + 5] == 'e'){
					if (a[c + 7] == 'a'){
						if (a[c + 1] == 'r'&&a[c + 2] == 'e'&&a[c + 3] == 'a'&&a[c + 4] == 'm'){
							c = c + 5;
						}
						else{
							x++;
						}
					}
					else if (a[c + 7] == 'e'){
						if (a[c + 1] == 'r'&&a[c + 2] == 'e'&&a[c + 3] == 'a'&&a[c + 4] == 'm'&&a[c + 6] == 'r'){
							c = c + 7;
						}
						else{
							x++;
						}
					}
					else if (a[c + 7] == 'd'){
						if (a[c + 1] == 'r'&&a[c + 2] == 'e'&&a[c + 3] == 'a'&&a[c + 4] == 'm'&&a[c + 6] == 'r'){
							c = c + 7;
						}
						else{
							x++;
						}
					}
					else{
						x = 1;
					}
				}
				else if (a[c + 5] == 'd'){
					if (a[c + 1] == 'r'&&a[c + 2] == 'e'&&a[c + 3] == 'a'&&a[c + 4] == 'm'){
						c = c + 5;
					}
					else{
						x++;
					}
				}
				else{
					x = 1;
				}
			}
			else if (a[c] == 'e'){
				if (a[c + 5] == 'r'){
					if (a[c + 1] == 'r'&&a[c + 2] == 'a'&&a[c + 3] == 's'&&a[c + 4] == 'e'){
						c = c + 6;
					}
					else{
						x++;
					}
				}
				else if (a[c + 5] == 'd'){
					if (a[c + 1] == 'r'&&a[c + 2] == 'a'&&a[c + 3] == 's'&&a[c + 4] == 'e'){
						c = c + 5;
					}
					else{
						x++;
					}
				}
				else if (a[c + 5] == 'e'){
					if (a[c + 1] == 'r'&&a[c + 2] == 'a'&&a[c + 3] == 's'&&a[c + 4] == 'e'){
						c = c + 5;
					}
					else{
						x++;
					}
				}
				else{
					x = 1;
				}
			}
			else{
				x++;
			}
		}
	}
	if (b == c)printf("YES\n");
	else printf("NO\n");

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
  #include "_DEBUG.hpp"
#endif
#define int long long
const int INF = 1LL << 60;

signed main(){

  int a, b, c; cin >> a >> b >> c;

  int ans = (a + b-1) / (b);
  cout << ans * c << endl;

  return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
bool f[4];
int main(){
	int a,b;
	memset(f,1,sizeof(f));
	cin >> a >> b;
	f[a] = 0;
	f[b] = 0;
	for(int i = 1;i < 4;++i){
		if(f[i]){
			cout << i;
			break;
		}
	} 
	return 0;
} 

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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

template<class T>bool chmax(T & a, const T & b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }



void func(std::string S){

    lli ans = -INF;

    lli size = S.size()/2;
    if(S.size()%2==0)size--;
    REP(i,1,1+size){
        string t = S.substr(0,i);

        if(t+t == S.substr(0,2*i)){
            chmax(ans,i*2LL);
        } 
    }
    cout<<ans<<endl;

}

int main(){
    // cout << fixed << setprecision(5);

    std::string S;
    std::cin >> S;
    func(S);
    return 0;
}


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

int main() {
  ll k,x;
  cin >> k >> x;
  for(int64_t i=x-k+1;i<x+k;i++){
    cout << i;
    i<x+k-1 ? cout << ' ' : cout << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cassert>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

Int a[220000];
Int n;

int main(){
    cin >> n;
    for(int i = 0;i < n;i++)cin >> a[i];
    sort(a, a+n, [](int x, int y){return x > y;});
    int x = 0;
    while(x+1 < n && a[x+1] >= x+2)x++;
    int up = a[x] - (x+1);
    int r = 0;
    while(x+r+1 < n && a[x+r+1] == x+1)r++;
    if(up % 2 == 0 && r % 2 == 0)cout << "Second" << endl;
    else cout << "First" << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef pair<int,int> PII;
int a,b;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define MAX(a,b) a>b? a:b
#define MIN(a,b) a>b? b:a

int main(){
  int r;
  cin>>r;
  cout<<3*r*r<<endl;
return 0;
}

Measured memory_bytes: 256
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;

int main(){
  long long N;
  cin >> N;
  long long A[N];
  vector<int> pbox;
  vector<int> nbox;
  int pcnt = 0;
  for(int i = 0; i < N; i++){
    cin >> A[i];
    A[i] -= i + 1;
    if(A[i]>=0) ++pcnt, pbox.push_back(A[i]);
    else nbox.push_back(A[i]);
  }
  int ncnt = N - pcnt;

  int dx = 0;

  if(pcnt>N-pcnt){
    sort(pbox.begin(),pbox.end());
    dx = pbox[pcnt-N/2-1];
  }else if(ncnt>N-ncnt){
    sort(nbox.begin(),nbox.end(),greater<int>());
    dx = nbox[ncnt-N/2-1];
  }

  long long total = 0;

  for(int i = 0; i < N; i++){
    total += abs(A[i]-dx);
  }

  printf("%lld\n", total);
  return 0;
}


Measured memory_bytes: 2676