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

using namespace std;

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

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;

#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second

ll a, b, c, d, n;

int main(int argc, char **argv) {
	cin >> a >> b >> c >> d >> n;
	a *= 8; b *= 4; c *= 2;
	ll x = min(a, min(b, c)), y = min(x, d);
	cout << (n / 2 * y + n % 2 * x / 2) << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
#include<deque>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define rep2(i,j,n) for(int i=(j);i<=(n);i++)
#define all(i) i.begin(),i.end()

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;
typedef long long i64;

int main() {
	int n;
	cin >> n;
	vi a{ 3,13,23,43,53 };
	int i = 53;
	while (a.size() < n) {
		i += 10;
		rep2(j, 2, i) {
			if (j == i) {
				a.push_back(i);
			}
			if (i%j == 0) {
				break;
			}
		}
	}
	cout << a[0];
	rep(i, 1, a.size()) {
		cout << " " << a[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
// Hack it and have it ;) //
/*author* Priyanshu Shrivastav (from IIT Palakkad) *
 * *_ __ ___  _ ______ ___  _ ____   ___  ___| |_  *
 * | '_ ` _ \| '__/ __/ _ \| '_ \ \ / / |/ __| __| *
 * | | | | | | | | (_| (_) | | | \ V /| | (__| |_  *
 * |_| |_| |_|_|(_)___\___/|_| |_|\_/ |_|\___|\__| *
When I wrote this, only God and I understood what I was doing
 ** * * * * * * * Now, only God knows!* * * * * * */
#include      <bits/stdc++.h>
using namespace std;
#define IOS       ios_base::sync_with_stdio(false); cin.tie (nullptr)
#define PREC      cout.precision (10); cout << fixed
#ifdef CONVICTION
#include "/home/convict/Dropbox/myfiles/sport_coding/cplib/snippets/debug.h"
#else
#define debug(x...)
#endif
//Don’t practice until you get it right. Practice until you can’t get it wrong

const int Mod = (int)1e9 + 7;
inline int add (int x, int y) { return (1ll * x + y + (Mod << 1)) % Mod; }
inline int sub (int x, int y) { return (1ll * x - y + (Mod << 1)) % Mod; }
inline int mul (int x, int y) { return (int) (1ll*(x + Mod) * (y + Mod) % Mod); }
inline int pow (int x, int y) {
  int res = 1;
  while (y) {
    if (y & 1) res = mul(res, x);
    x = mul(x, x), y >>= 1;
  }
  return res;
}
inline int inv (int x) { return pow(x, Mod - 2); }
inline int dv (int x, int y) { return mul(x, inv(y)); }

const int MAXFAC = (int)2e6 + 10;
int fac[MAXFAC];
void init_fac (int maxn) {
  fac[0] = 1;
  for (int i = 1; i < maxn; ++i) fac[i] = mul(fac[i - 1], i);
}
inline int C(int n, int r) {
  return dv(fac[n], mul(fac[n-r], fac[r]));
}

void preproc()
{
   init_fac(MAXFAC);
}

void solve()
{
   int H, W, A, B;
   cin >> H >> W >> A >> B;
   int res = 0;
   for (int i = 1; i <= H - A; ++i) {
      int inc = mul(C(i + B - 2, B - 1), C(H - i + W - B - 1, W - B - 1));
      res = add(inc, res);
   }
   cout << res << '\n';
}

signed main()
{
  IOS; PREC;
  preproc();

  int tc = 1;
  // cin >> tc;
  for (int Tt = 1; Tt <= tc; ++Tt) {
    // cout << "Case #" << Tt << ": ";
    solve();
  }
  return EXIT_SUCCESS;
}


Measured memory_bytes: 11428
/* ex 4-2
    kas056 */
#include <stdio.h>
#include <math.h>

int main(void){
    int a,b,hour,minute;
    double omega1,omega2,omega,length;

    scanf("%d %d %d %d", &a,&b,&hour,&minute);//入力読み取り

    omega1 = 2*M_PI * (hour+ minute / 60.0) / 12;//短針が動いた角度
    omega2 = 2*M_PI *minute / 60.0;//長針が動いた角度
    omega = fabs(omega1-omega2);//角の差の絶対値を取り、成す角を求める

    //余弦定理の適応
    //長針と短針のなす角を、180゜を境に、余弦定理に用いる角の表し方を変える
    
    length = sqrt(pow(a,2) + pow(b,2) - 2*a*b*cos(omega));
    
    //10^-10まで出力
    printf("%.10lf",length);
    return 0;
}

Measured memory_bytes: 2664
#include<stdio.h>

int a,b,n,s;

int main(){
	while(scanf("%d%d%d",&a,&b,&n)!=EOF){
		s=0;
		a=a%b;
		while(n--)s+=(a*10)/b,a=(a*10)%b;
		printf("%d\n",s);
	}
	return 0;
}

Measured memory_bytes: 0
//----------------------------templates
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("tune=native")
    #pragma GCC target ("avx")
    //----------------------------
    #include <bits/stdc++.h>
    using namespace std;

    typedef long long ll;
    typedef unsigned long long ull;
    #define int ll

    #define FOR(i,j,n) for (int i=(int)(j);i<(n);i++)
    #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 REPN(i,n) for (int i=(int)(n)-1;i>=0;i--)
    #define REPNS(i,n) for (int i=(int)(n);i>0;i--)

    #define I(n) scanf("%lld", &(n))
    #define LL(n) scanf("%lld", &(n))
    #define pb(n) push_back((n))
    #define mp(i,j) make_pair((i),(j))
    #define eb(i,j) emplace_back((i),(j))
    #define y0 y3487465
    #define y1 y8687969
    #define j0 j1347829
    #define j1 j234892
    #define uniq(v) v.erase( unique(v.begin(), v.end()), v.end() )

    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())

    typedef vector<int> vi;
    typedef pair<int,int> pi;
    typedef vector<pi> vpi;
    typedef vector<vi> vvi;
    typedef vector<vpi> vvpi;
    typedef vector<vvi> vvvi;

    const int mod = 1000000007;

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

int k,a,b,ret;
signed main(){
    cin >> k >> a >> b;
    ret = k+1;
    if ( a < b ) {
        int cand = 0;
        int turn = a-1;
        if (k > turn){
            k -= turn;
            //a枚持ってる
            cand = a;
            
            cand += (b-a) * (k/2);
            cand += (k%2);
            ret = max(ret,cand);
        }
    }
    cout << ret << endl;
}

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

N = INT()

A = [LIST() for _ in range(2)]

ans = 0
for i in range(N):
	sum_candy = sum(A[0][:i+1]) + sum(A[1][i:])
	ans = max(ans,  sum_candy)

print(ans)


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

struct edge {
	int to;
	ll cost;
};

int n;
vector<edge> g[100001];
ll dist[100001];

void dfs(int x,int p, ll count){
    dist[x] = count;
    for(auto e : g[x]){
        if(e.to!=p){
            dfs(e.to,x,count+e.cost);
        }
    }
}

int main(){
 cin>>n;

 for(int i=0;i<n-1;i++){
     int a,b,c;
     cin>>a>>b>>c;
     g[a].push_back({b,c});
     g[b].push_back({a,c});
 }
 int q,k;
 cin>>q>>k;

 dfs(k,-1,0);

 for(int i=0;i<q;i++){
 	int x,y;
 	cin>>x>>y;
 	cout<<dist[x]+dist[y]<<endl;
 }

}


Measured memory_bytes: 14336
#include <iostream>

using namespace std;

int main() {
	const int max_value= 100001;
	int b[max_value];
	bool r[max_value];
	int n,m;

	for (int i = 0; i < max_value; i++) {
		b[i] = 0;
		r[i] = false;
	}

	cin >> n >> m;
	b[1] = 1;
	r[1] = true;


	for (int i = 2; i <= n; i++) {
		b[i] = 1;
	}

	for (int i = 0; i < m; i++) {
		int x,y;
		cin >> x >> y;

		b[x]--;
		b[y]++;
		
		if (r[x]) {
			r[y] = true;
		}

		if (b[x] == 0) {
			r[x] = false;
		}
	}

	int count = 0;
	for (int i = 1; i <= n ; i++) {
		if (r[i]) {
			count++;
		}
	}

	cout << count << endl;
	return 0;
}

Measured memory_bytes: 1272
n = gets.to_i
array = Array.new(n)
n.times do |i|
  a = gets.to_i
  array[i] = a.times.map{gets.chomp.split.map(&:to_i)}
end
ans = 0
(2**n).times do |i|
  cnt = i.to_s(2).count("1")
  flag = true
  n.times do |j|
    if i[j] == 1
      array[j].each do |x,y|
        flag = false if i[x-1] != y
      end
    end
  end
  ans = cnt if ans < cnt && flag
end

puts ans

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

int main(void) {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> vec;
    for (int i = 0; i < n; i++) {
        int64_t a;
        cin >> a;
        auto itr = find(vec.begin(), vec.end(), a);
        if (itr == vec.end()) {
            vec.emplace_back(a);
        } else {
            vec.erase(itr);
        }
    }
    cout << vec.size() << "\n";
}


Measured memory_bytes: 3736
#include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
typedef long long ll;
typedef long long i64;
typedef long double ld;
const int inf = int(1e9) + int(1e5);
const ll infl = ll(2e18) + ll(1e10);

int main() {
    #ifdef LOCAL
    assert(freopen("b.in", "r", stdin));
    #else
    #endif
    ll n, x;
    cin >> n >> x;
    vector<int> a(n);
    forn (i, n)
        cin >> a[i];
    vector<int> b = a;
    ll res = infl;
    forn (len, n) {
        ll cur = x * len;
        forn (i, n)
            cur += b[i];
        res = min(res, cur);
        forn (i, n)
            b[i] = min(b[i], a[(i + n - len - 1) % n]);
    }
    cout << res << '\n';
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int h,w; cin>>h>>w;
  char s[w+2][h+2]={' '};
  for(int y=1; y<h+1; y++){
    for(int x=1; x<w+1; x++){
      cin>>s[x][y];
    }
  }
  for(int y=1; y<h+1; y++){
    for(int x=1; x<w+1; x++){
      if(s[x][y]=='#') {
        cout<<'#'; continue;
      }
      int cnt=0;
      if(s[x-1][y-1]=='#') cnt++;
      if(s[x][y-1]=='#') cnt++;
      if(s[x+1][y-1]=='#') cnt++;
      if(s[x-1][y]=='#') cnt++;
      if(s[x+1][y]=='#') cnt++;
      if(s[x-1][y+1]=='#') cnt++;
      if(s[x][y+1]=='#') cnt++;
      if(s[x+1][y+1]=='#') cnt++;
      cout<<cnt;
    }
    cout<<endl;
  }
}


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

int a[110];
bool dp[100010];

int main(){
	int n, k;
	scanf("%d%d", &n, &k);
	for(int i=0; i < n; i++)
		scanf("%d", &a[i]);
	for(int i=0; i <= k; i++)
		for(int j=0; j < n; j++)
			if(i >= a[j] && !dp[i-a[j]]) dp[i] = true;
	printf("%s\n", dp[k] ? "First" : "Second");
}


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

int main()
{
    long A, B, V, W, T;
    cin >> A >> V;
    cin >> B >> W;
    cin >> T;

    if (abs(A - B) <= (V - W) * T)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 3636
N = int(input())
lst_a = list(map(int, input().split()))
cnt_mod4 = 0
cnt_odd = 0
cnt_mod2 = 0
ans = "No"


for a in lst_a:
    if a % 4 == 0:
        cnt_mod4 += 1
    elif a % 2 != 0:
        cnt_odd += 1
    else:
        cnt_mod2 += 1


if cnt_mod2 != 0:
    cnt_odd += 1


if cnt_odd <= cnt_mod4 + 1:
    ans = "Yes"


print(ans)

Measured memory_bytes: 14252
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class Hello
{
    public static Hello hello;

    public static void Main()
    {
        hello = new Hello();
        hello.Run();
    }
    private string[] ReadInputs()
    {
        var line = System.Console.ReadLine();
        return line.Split();
    }


    public void Run()
    {
        IList<int> groupA = new List<int> { 1, 3, 5, 7, 8, 10, 12 };
        IList<int> groupB = new List<int> { 4, 6, 9, 11 };

        int[] inputN = ReadInputs().Select(x => int.Parse(x)).ToArray();
        string answer="";

        if (inputN.Contains(2))
        {
            if(inputN[0] == inputN[1])
            {
                answer = "Yes";
            }else
            {
                answer = "No";
            }
        }

        if( (groupA.Contains(inputN[0]) && groupA.Contains(inputN[1])) 
            || (groupB.Contains(inputN[0]) && groupB.Contains(inputN[1])) ){
            answer = "Yes";
        }else
        {
            answer = "No";
        }

        Console.WriteLine(answer);
    }
}


Measured memory_bytes: 11348
import sys
#import numpy as np
import math
from fractions import Fraction
import itertools

input=sys.stdin.readline

n,m=map(int,input().split())
a=list(map(int ,input().split()))
s=sum(a)
s=s/(4*m)
c=0

for i in range(n):
    if a[i]>=s:
        c+=1
if c>=m:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 72704
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define yes(n) cout << ((n) ? "yes" : "no") << endl

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

const int INF = 1001001001;
const vector<int> di = {-1,  0, 1, 0};
const vector<int> dj = { 0, -1, 0, 1};

void chmin(int &a, int b) { if (a > b) a = b; }

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll LCM(ll a, ll b) {
    ll g = GCD(a, b);
    return a / g * b;
}


int main() {
    int n; cin >> n;
    map<string, int> cnt;
    rep(i, n) {
        string s; cin >> s;
        cnt[s]++;
    }

    int m = 0;
    for (auto e: cnt) {
        m = max(m, e.second);
    }
    for (auto e: cnt) {
        if (e.second == m) cout << e.first << endl;
    }
}

Measured memory_bytes: 25216
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    ll n, p;
    cin >> n >> p;

    if (n == 1) {
        cout << p << endl;
        exit(0);
    }

    ll r = 1;
    for (ll i = 2; i * i <= p; i++) {
        if (p % i == 0) {
            int k = 0;
            while (p % i == 0 && p > 0) p /= i, k++;
            k /= n;
            for (int j = 0; j < k; j++) {
                r *= i;
            }
        }
    }

    cout << r << endl;

    return 0;
}

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

//小文字を大文字に変換する関数
char upper(char c){
  if('a' <= c && c <= 'z'){
    c = c + ('A' - 'a'); // ここ大事！！！！！！！！char + char - charしてる
  }
  return c;
}

int main() {
  
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  
  cout << upper(s1.at(0)) << upper(s2.at(0)) << upper(s3.at(0)) << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<cstring>
#include<string>
#include <math.h>
#include<algorithm>
#include<functional>
#define int long long
#define ll long long
#define inf  1000000007
#define mod 1000000007
#define pa pair<int,int>
#define pal pair<ll,ll>
#define ppa pair<int,pa>
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

class Point{
  public:
  double x,y;
  Point(double x=0,double y=0):x(x),y(y) {}
  Point operator + (Point p) {return Point(x+p.x,y+p.y);}
  Point operator - (Point p) {return Point(x-p.x,y-p.y);}
  Point operator * (double a) {return Point(x*a,y*a);}
  Point operator / (double a) {return Point(x/a,y/a);}
  double absv() {return sqrt(norm());}
  double norm() {return x*x+y*y;}
  bool operator < (const Point &p) const{
    return x != p.x ? x<p.x: y<p.y;
  }
  bool operator == (const Point &p) const{
    return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
  }
};
typedef Point Vector;

struct Segment{
Point p1,p2;
};

double hen(Vector a){
if(fabs(a.x)<EPS && a.y>0) return acos(0);
else if(fabs(a.x)<EPS && a.y<0) return 3*acos(0);
else if(fabs(a.y)<EPS && a.x<0) return 2*acos(0);
else if(fabs(a.y)<EPS && a.x>0) return 0.0;
else if(a.y>0) return acos(a.x/a.absv());
else return 2*acos(0)+acos(-a.x/a.absv());

}

double dot(Vector a,Vector b){
  return a.x*b.x+a.y*b.y;
}
double cross(Vector a,Vector b){
  return a.x*b.y-a.y*b.x;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ru[11]={1,2,4,8,16,32,64,128,256,512,1024};

ll frac[100010];
ll inv[100010];

ll saikif(ll a,int n){
  if(n==1) return a%mod;
  else if(n%2==0){
    ll q=saikif(a,n/2);
    return (q*q)%mod;
  }
  else return (a*saikif(a,n-1))%mod;
}

void gyakugen(){
  frac[0]=1;
  for(int i=1;i<=100000;i++) frac[i]=(frac[i-1]*i)%mod;
  for(int i=0;i<=100000;i++) inv[i]=saikif(frac[i],mod-2);
}


//----------------kokomade temple------------


signed main(){
string s,t;
int n;
int k=0;
while(cin>>n){

  if(n==0) break;
pa a[10010];
for(int i=0;i<n;i++){
 cin>>s>>t;
int a1=0,a2=0;
a1 += (s[0]-'0')*36000+(s[1]-'0')*3600+(s[3]-'0')*600+(s[4]-'0')*60+(s[6]-'0')*10+(s[7]-'0');
 a2 += (t[0]-'0')*36000+(t[1]-'0')*3600+(t[3]-'0')*600+(t[4]-'0')*60+(t[6]-'0')*10+(t[7]-'0');
a[i].first=a1;
a[i].second=a2;
//cout<<a1<<" "<<a2<<endl;
}
int z[100000]={0};
for(int i=0;i<n;i++){
  z[a[i].first]++;
  z[a[i].second]--;
}
for(int i=1;i<90000;i++){
  z[i] += z[i-1];
}

int ma=0;
for(int i=0;i<90000;i++){
  ma=max(ma,z[i]);
}

cout<<ma<<endl;
}

return 0;
}

Measured memory_bytes: 2144
#include <iostream>
#include <cstring>
#include<vector>
#include <algorithm>
#include<cstdlib>
#include<set>
#include<math.h>
#include<map>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(ll i=0;i<n;i++)



int main()
{
	ll n;
	cin >> n;
	set<ll> a;
	ll x;
	rep(i, n)
	{
		cin >> x;
		a.insert(x);
	}

	if (a.size() == n) cout << "YES";
	else cout << "NO";
	cout << "\n";
	return 0;
}

Measured memory_bytes: 12964
def min2(a,b)
    return a>b ? b : a
end
def max2(a,b)
    return a<b ? b : a
end


L,R = gets.split.map{|i| i.to_i}


if R - L >= 2018
    puts 0
    exit
end

lst =(L..R).map{|i| i % 2019}

len = lst.length
mn = 2018
for i in 0...(len-1)
    for j in 1...len
        
        mn = min2(mn,(lst[i]*lst[j])% 2019)

    end
end
puts mn

Measured memory_bytes: 1916
r,c = map(int,input().split())
spread = [list(map(int,input().split())) for i in range(r)]
for i in range(r):
    for j in range(c):
        print(spread[i][j],end=" ")
    print(sum(spread[i]))
for i in range(c):
    ans = 0
    for j in range(r):
        ans +=spread[j][i]
    print(ans,end=" ")
print(sum(map(sum,spread)))


Measured memory_bytes: 6256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		try (BufferedReader br = new BufferedReader(
				new InputStreamReader(System.in))) {

			String in = br.readLine();
			String chr[] = in.split("");
			int ans = 0;
			for(String a: chr) {
				ans +=(a.equals("+")?1:-1);

			}
			 System.out.println(ans);
		}
	}
}

Measured memory_bytes: 25456
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<queue>
#include<cmath>
#include<map>
#include<stack>
#define ll long long
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
static const int MAXN = 100000;
static const int MAX = 1000000000;

int main(){
    int N;
    ll ans = 0;
    cin >> N;
    for(int i = 1; i <= N; i++){
        if(i % 3 != 0 && i % 5 != 0){
            ans += i;
        }
    }
    cout << ans << endl;

    return 0;
}

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

typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
// #define LLONG_MAX 9223372036854775806
#define vmax(vec) *max_element(vec.begin(), vec.end())
#define vmin(vec) *min_element(vec.begin(), vec.end())
#define vsort(vec) sort(vec.begin(), vec.end())
#define vsortgr(vec) sort(vec.begin(), vec.end(), greater<ll>())
#define MOD 1000000007
// #define MOD 998244353
// #define MOD LLONG_MAX
const double PI=3.14159265358979323846;
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; }

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

void printv(vint &v){
    for(auto e:v) cout<<e<<" ";
        cout<<endl;
    }

// 繰り返し二乗法
ll power(ll a, ll b){
    if(a==1)return a;
    // if(a==0)re
    ll res=1;
    while(b>0){
        if(b&1) res=res*a%MOD;
        a=a*a%MOD;
        b>>=1;
    }
    return res;
}

const int MAX=2100000;

ll fact[MAX], fact_inv[MAX];

void init_fact(ll n){
    fact[0]=1;
    // 階乗の計算
    for(ll i=0; i<n; i++) fact[i+1]=fact[i]*(i+1)%MOD;
    fact_inv[n]=power(fact[n], MOD-2);
    // 逆元の計算
    for(ll i=n-1;i>=0;i--) fact_inv[i]=fact_inv[i+1]*(i+1)%MOD;
}

ll comb(ll n, ll r){
    return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%MOD;
}

ll perm(ll n, ll r){
    return (fact[n]*fact_inv[n-r])%MOD;
}

int main() {
    cout<<fixed<<setprecision(10);

    string s; cin>>s;
    if(s[2]==s[3] && s[4]==s[5]) puts("Yes");
    else puts("No");



    return 0;

}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  int syl;
  int counter_5=0;
  int counter_7=0;
  for(int i=1;i<=3;i++)
  {
cin>>syl;
    if(syl==5)
      counter_5++;
    else if(syl==7)
      counter_7++;
    else
      continue;
  }
  if(counter_5==2&&counter_7==1)
    cout<<"YES";
  else
    cout<<"NO";
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main (void)
{
  char a[101] , b[101];
  scanf("%s %s",a,b);
  int as = strlen(a) , bs = strlen(b);
  
  if(as > bs){
    printf("GREATER");
  }
  else if(as < bs){
    printf("LESS");
  }
  else if(as == bs){
    for(int i = 0;i < as;i ++){
      if(a[i]>b[i]){
        printf("GREATER");
        return 0;
      }
      else if(a[i]<b[i]){
        printf("LESS");
       return 0;
      }}
    printf("EQUAL");
  }
  return 0;
}

Measured memory_bytes: 128
//  RAKSHIT KADAM
//ALWAYS USE &IT FOR ITERATING USING AUTO ...
//USE COUNT(STARTING ADDRESS, ENDING ADRESS ,VALUE) FOR FINDING THE COUNT IN THE RESPECTIVE DATA STRUCTURE
//NOTE THAT MEMSET CANT FILL THE DOUBLE VALUES;
//ACCUMULATE DOES NOT WORK PROPERLY IF VALUES START SUMMING BEYOND 1E9...
 #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree< int ,  null_type ,  less<int> ,  rb_tree_tag ,  tree_order_statistics_node_update>
#warning !!!check the size of arrayss!!!

// NUMERIC DEFINITIONS :
    #define INF 100000000000000005
    #define inf 1000000000
    #define MOD  1000000007
    #define newMOD  998244353
    #define MAX 300006
    #define pi 3.1415926535897932384626433832795
#define ld long double
 #define ll long long
 #define int long long

 #define P(gg) for(auto rax:gg){cout<<rax<<" ";}cout<<endl;
 #define Need_for_speed(activated) ios_base :: sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
 #define satisfy ll t; cin>> t; while(t--)
 #define inp(n) int n;cin >> n
 #define mp make_pair
 #define pb push_back
 #define endl "\n"
 #define x first
 #define y second
 #define fore(i,a,b) for(ll i=a;i<b;i++)
 #define forci(i,n) for(ll i=0;i<n;i++)
 #define vi vector<ll>
 #define Endl endl
 #define lb lower_bound
 #define ub upper_bound
#define pii pair<ll,ll>

 #define input freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout)
 #define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;

ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
int power(int x, unsigned int y, unsigned int m){ if (y == 0) return 1;int p = power(x, y/2, m) % m;  p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m;}
ll modInverse(int a, int m){{ return power(a, m-2, m);}}
const int maxn = 500003;
void solve()
{
    ll a,b;cin>>a>>b;
    for(ll i=0;i<=a;i++)
    {
        ll x =b-2*i;
        if((x)%4==0 && (x)/4== a-i)
        {
            cout<<"Yes"<<endl;return;
        }
       
    }
    cout<<"No"<<endl;
    
}

signed main()
{
   Need_for_speed(activated);

//satisfy
//    {
//  solve();
//   }

    solve();
    
    return 0;
}


Measured memory_bytes: 3636
import java.util.Scanner;
      
class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String str[] = new String[1200];
    int x = 0;
    int anum = Character.getNumericValue('a');
    int znum = Character.getNumericValue('z');
    int num = znum - anum;
    int answer[] = new int[num +1];
    for(int i = 0 ; i <= num ; i++){
      answer[i] = 0;
    }
      
    while(sc.hasNextLine()){
      str[x] = sc.nextLine();
      for(int i = 0 ; i < str[x].length() ; i++){
        char c = str[x].charAt(i);
        if('A' <= c && c <= 'Z'){
          c += 'a' - 'A';
        }
        int inum = Character.getNumericValue(c);
        if('a' <= c && c <= 'z'){
          answer[inum - anum] += 1;
        }
      }
      x += 1;
    }
      
    for(int i= 0; i <= num; i++){
      char ch = (char)('a'+i);
      System.out.println(String.valueOf(ch)+" : "+answer[i]);
    }
  }
}


Measured memory_bytes: 26180
A = int(input())
B = int(input())
C = int(input())
X = int(input())

Ans = 0
for ai in range(A+1):
    for bi in range(B+1):
        for ci in range(C+1):
            if 500*ai + 100*bi + 50*ci == X:
                Ans += 1

print(Ans)

Measured memory_bytes: 3060
#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 ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;

int main(void)
{
    IOS
    int n,k;
    cin >> n >> k;

    vector<int> v(n);
    REP(i,n) cin >> v[i];

    ll ans = 1LL << 60;

    REP(i,n-k+1) {
        ll a = v[i];
        ll b = v[i+k-1];
        ll tmp;

        if (a*b < 0) {
            tmp = min(abs(a),abs(b)) * 2 + max(abs(a),abs(b));
            ans = min(ans,tmp);
        } else {
            ans = min(ans,max(abs(a),abs(b)));
        }
    }

    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 640
from collections import deque
H, W = map(int, input().split())
G = [list(input()) for i in range(H)]  # 迷路
D = [[-1] * W for i in range(H)]  # 最短距離
D[0][0] = 0

Black = 0  # 最初の盤面の黒の数
for g in G:
    Black += g.count('#')

# BFS
que = deque([[0, 0]])
direction = [(1, 0), (-1, 0), (0, 1), (0, -1)]
while que:
    nh, nw = que.pop()
    for dh, dw in direction:
        if not ((0 <= nh + dh < H) and (0 <= nw + dw < W)):
            continue

        if D[nh + dh][nw + dw] > 0:
            continue

        if G[nh + dh][nw + dw] == '#':
            continue

        D[nh + dh][nw + dw] = D[nh][nw] + 1
        que.appendleft([nh + dh, nw + dw])

if D[H - 1][W - 1] > 0:
    print(H * W - D[H - 1][W - 1] - Black - 1)
else:
    print(-1)


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

int main() {
  int a, b, c, d, e, k;
  cin >> a >> b >> c >> d >> e >> k;
  if (e - a <= k) {
    cout << "Yay!" <<endl;
  }
  else {
    cout << ":(" <<endl;
  }
}

Measured memory_bytes: 256
#!/usr/local/bin/python3
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x,a = f()

    if x<a:
        print(0)
    else:
        print(10)
    

solve()


Measured memory_bytes: 2940
<?php

$line_1 = fgets(STDIN);
$line_2 = fgets(STDIN);

$x = 0;
$arr1 = str_split($line_2);
$arr2 = [];

for($i = 0, $arr1_count = count($arr1); $i < $arr1_count; $i++) {
    if($arr1[$i] === 'I') {
        $x =++$x;
    } else {
        $x =--$x;
    }
    array_push($arr2, $x);
}

$max = max($arr2);

if ($max > 0) {
    echo $max;
} else {
    echo 0;
}

?>


Measured memory_bytes: 16252
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()
#define pb push_back

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1 << 60LL;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

// 型による変数のオーバーフローに気をつけろ！！
// 悩んだら図やグラフを書け！！悩む前から書け！！

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

	int n, x;
	cin >> n >> x;
	vector<int> m(n);
	rep(i, n) cin >> m[i];

	int cnt = 0;
	int minNum = 1000000;

	rep(i, n) {
		x -= m[i];
		cnt++;
		minNum = min(m[i], minNum);
	}

	cnt += x / minNum;

	cout << cnt << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<cmath>
using namespace std;
int main(){
    int ans=0;
    int hati=0;
    int n;
    cin>>n;
    
    for(int i=1;i<=n;i++){
        hati=0;
        for(int j=1;j<=i;j=j+2){
            if(i%j==0)hati++;
        }
        if(hati==8)ans++;
    }

    cout<<ans<<endl;

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++)

int vmaxn(vector<int> v, int n) {
  sort(v.begin(), v.end());
  return v[v.size()-n];
}

int main() {
  int N; cin >> N;
  vector<string> S(N);  
  rep(i, N) cin >> S[i];
  
  sort(S.begin(), S.end());
  vector<int> n = {0};
  vector<string> A = {S[0]};
  
  
  rep(i, N) {
    if(S[i] == A[n.size()-1]) n[n.size()-1]++;
    else {
      n.push_back(1);
      A.push_back(S[i]);
    }
  }
  
  int max = vmaxn(n, 1);

  rep(i, n.size()) {
    if(n[i] == max) cout << A[i] << endl;
  }
  
}


Measured memory_bytes: 17384
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++) 
#define rep(i,n); for(int i = 0; i < (n); i++)
#define chmin(a,b) if((a)>(b)) (a)=(b); 
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={0,1,0,-1,1,-1,-1,1};
int dy[]={1,0,-1,0,1,1,-1,-1};
const int MOD = 1e9+7;
const int INF = 1e10+10;

/*----------------------------------------------*/

signed main(){
  int n;
  cin>>n;
  int ans=1;
  rep(i,n){
    int t;
    cin>>t;
    int g=gcd(t,ans);
    ans=ans/g*t;
  }
  
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, sum = 0; cin >> N;
  map<int, int> X;
  vector<int> a;
  for(int i = 0; i < N; i++) {
    int t;
    cin >> t;
    if(!X.count(t)) {
      X[t] = 1;
    } else {
      X.at(t)++;
    }
  }
  for(int i = 0; i <= 100000; i++) {
    int x = 0;
    if(X.count(i)) {
      x += X.at(i);
    }
    if(i > 0 && X.count(i - 1)) x += X.at(i - 1);
    if(i < 100000 && X.count(i + 1)) x += X.at(i + 1);
    sum = max(sum, x);
  }
  cout << sum << endl;
}

Measured memory_bytes: 3200
mod=int(1e9)+7

n=int(input())
a=[int(i) for i in input().split()]
ans=0
for b in range(60)[::-1]:
  ans<<=1
  c=sum(a[i]>>b & 1 for i in range(n))
  ans = (ans + c*(n-c)) % mod
print(ans)

Measured memory_bytes: 122808
let rec maxSqrt n num =
  if n*n >= num then
    n
  else
    maxSqrt (n+1) num

let inp = stdin.ReadLine().Split(' ') |> String.concat "" |> int
let maxN = maxSqrt 0 inp
printfn "%s" <| if maxN*maxN = inp then "Yes" else "No"


Measured memory_bytes: 12112
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,x;
  cin >> n;
  x=0;
  for(int i=1;i<10;i++){
    if(n%i==0){
      if(n/i<=9){
        x++;
    }
  }
  }
  if(x==0){
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}


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

int n, m, deg[101000];
vector<int>G[101000];

bool dfs(int x,int fff,int s,int t){
    if (x==s) return 0;
    if (x==t) return 1;
    for (auto y:G[x])
        if (y!=fff)
            return dfs(y,x,s,t);
}

bool check4(){
    vector<int>vec;
    for (int i=1;i<=n;++i)
        if (deg[i]==4){
            vec.push_back(i);
        }
    if (vec.size()<2) return 0;
    if (vec.size()>2) return 1;
    for (auto o:G[vec[0]])
        if (!dfs(o,vec[0],vec[0],vec[1]))
            return 1;
    return 0;
}

int main(){
    cin>>n>>m;
    for (int i=1;i<=m;++i){
        int x, y; cin>>x>>y;
        G[x].push_back(y);
        G[y].push_back(x);
        ++deg[x]; ++deg[y];
    }
    for (int i=1;i<=n;++i)
        if (deg[i]&1){
            puts("No"); return 0;
        }
    if (*max_element(deg+1,deg+n+1)>=6||check4()){
        puts("Yes");
    }else{
        puts("No");
    }
}

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

int main() {
	string s;
	cin >> s;
	if (s == "SSS") {
		cout << 0 << endl;
		return 0;
	}
	if (s == "RSS") {
		cout << 1 << endl;
		return 0;
	}
	if (s == "SRS") {
		cout << 1 << endl;
		return 0;
	}
	if (s == "SSR") {
		cout << 1 << endl;
		return 0;
	}
	if (s == "SRR") {
		cout << 2 << endl;
		return 0;
	}
	if (s == "RRS") {
		cout << 2 << endl;
		return 0;
	}
	if (s == "RSR") {
		cout << 1 << endl;
		return 0;
	}
	if (s == "RRR") {
		cout << 3 << endl;
		return 0;
	}
}

Measured memory_bytes: 3624
//is there any case of -1 or any special corner cases ?
#include<bits/stdc++.h>
using namespace std;
#define int long long int 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int,int>
#define all(v) v.begin(),v.end()
#define zeros(arr) memset(arr,0,sizeof(arr));
#define precise(num)  cout<<fixed; cout << std::setprecision(num)
#define nl cout<<"\n";
#define test int t;cin>>t;while(t--) 
const int maxx  = 3*1e5 , limit = 9*1e18 , MOD=1e9+7;
#define boost  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n';

bool check(int  n,int a[] , int k , int tot){
    int res= 0;
   
    for(int i = 0 ; i < n ; i++ )
    {
        int num = a[i];
        
        int val = num/k;
        if(num%k) val++;
        
        val--;
        res+=val;
    }
    if(res<=tot)
    return true;
    return false;
  
    
}

int32_t main(){
    boost;
    // int k;cin>>k;
     
     int l =0 ;
     int r =0 ;
    int n;
    int k;cin>>n>>k;
    int a[n+1];
    for(int i =0 ; i  < n ; i++ )
    {
        cin>>a[i];
        r = max(r,a[i]);
    }
    
    while(r-l>1){
        int m = (l+r)/2;
        
        if(check(n,a,m,k)){
            // cout<<"hi\n";
            r=m;
        }else{
            l=m;
        }
        
        // cout<<l<<" "<<r<<endl;
    }
     cout<<r<<endl;
    
}

Measured memory_bytes: 5156
#include "bits/stdc++.h"
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl '\n'
#define all(V) (V).begin(), (V).end() 
using namespace std;
typedef long long ll;

int main() {fio;
	int n;
	cin >> n;
	vector <ll> d(n + 1), give(n + 1);
	for(int i = 0; i <= n; i++) {
		cin >> d[i];
	}
	give[0] = 1;
	for(int i = 0; i < n; i++) {
		give[i + 1] = min(give[i] * 2 - d[i + 1], (1LL << 57));
		if(give[i + 1] < 0) {
			cout << -1 << endl;
			return 0;
		}
	}
	ll vertices = 0;
	for(int i = n; i >= 0; i--) {
		if(i <= 57 && d[i] > (1LL << i)) {
			cout << -1 << endl;
			return 0;
		} 
		// cout << i << ' ' << d[i] << endl;
		vertices += d[i];
		if(i) {
			d[i - 1] += min(give[i - 1], d[i]);
		}
	}
	cout << vertices << endl;
    return 0;
}

Measured memory_bytes: 4784
#cording: utf-8

N = int(input())

L = list(map(int, input().split()))
max_val = max(L)
max_ind = 0
max_ind = L.index(max_val)
del L[max_ind]

sum_val = 0
for i in range(len(L)):
    sum_val += L[i]

if max_val < sum_val:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3060
W, H, N = map(int, input().split())
left_under = (0, 0)
right_top = (W, H)
for _ in range(N):
	x, y, a = map(int, input().split())
	if a == 1:
		left_under = (max([x, left_under[0]]), left_under[1])
	elif a == 2:
		right_top = (min([x,right_top[0]]), right_top[1])
	elif a == 3:
		left_under = (left_under[0], max([y,left_under[1]]))
	elif a == 4:
		right_top = (right_top[0], min([y,right_top[1]]))
 
if right_top[0] - left_under[0] <= 0 or right_top[1] - left_under[1] <= 0:
	print(0)
else:
	print((right_top[0] - left_under[0])*(right_top[1] - left_under[1]))

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int count = 0;

		for (int i = 1; i <= n; i++) {
			if (String.valueOf(i).length() % 2 == 1) {
				count++;
			}
		}
		System.out.println(count);
		sc.close();
	}
}

Measured memory_bytes: 25684
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    S = input()
    Snum = len(S)
    a = "x"*Snum
    print(a)


if __name__ == "__main__":
	main()

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
long long k;
string s;
int main()
{
	cin>>s>>k;
	if (s[0]!='1')
	{
		cout<<s[0];
		return 0;
	}
	else
	{
		int i=0;
		while (s[i]=='1' && i<s.length()) i++;
		if (i>=s.length()) cout<<1;
		else if (k<=i) cout<<1;
		else cout<<s[i];
		return 0;
	}
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n;
	cin>>n;
	ll ch[101];
	for(ll i=0;i<n;i++){
		cin>>ch[i];
	}
	ll ans=INF;
	for(ll i=0;i<=100;i++){
		ll cnt=0;
		for(ll j=0;j<n;j++){
			cnt+=pow((i-ch[j]),2);
		}
		ans=min(ans,cnt);
	}
	cout <<ans;
	// your code goes here
	return 0;
}

Measured memory_bytes: 3460
import java.util.Scanner;

class Main{
  public static void main(String[]args){
    
  Scanner sc=new Scanner(System.in);
   int N=sc.nextInt();
   int R=sc.nextInt();
   int X;
    
    if(N>=10){
      X=R;
      System.out.println(X);
    }else{
      X=R+100*(10-N);
      System.out.println(X);
    }
  }
}
      

Measured memory_bytes: 23124
#include <vector>
#include <unordered_set>
#include <sstream>
#include <iostream> 


using namespace std;
 

int main() {
		string s;
		cin >> s;
		if (s == "SSS") {
				cout << 0 << endl;
		} else if (s == "SSR" || s == "SRS" || s == "RSS" || s == "RSR") {
				cout << 1 << endl;
		} else if (s == "RRR") {
				cout << 3 << endl;
		} else {
				cout << 2 << endl;
		}

}


Measured memory_bytes: 3624
#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<string>
#include<cstring>
#include<time.h>
#include<array>
#include<iomanip>
#include<list>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<random>
#include<bitset>
#include <queue>
#include <map>


using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ldouble = long double;


//BDD,ZDD,kdtree, bdtree,bicalc, bolonoy, doloney,chinesemod,segmenttree,daikusutora, saidairyuu, 2bugurahu, heirokenshutu, topologicalsort, kyourenketuseibun


#define PRI(s) cout << s << endl
#define PRIY PRI("Yes")
#define PRIN PRI("No")

int main() {
	string s;
	char m[2];
	int c[2] = { 1,0 };
	cin >> s;
	m[0] = s[0];
	bool full = false;
	for (int i = 1; i < 4; ++i) {
		if(full){
			if (s[i] == m[0])c[0]++;
			else if (s[i] == m[1]) c[1]++;
			else {
				PRIN;
				return 0;
			}
		}
		else {
			if (s[i] == m[0])c[0]++;
			else {
				m[1] = s[i];
				c[1]++;
				full = true;
			}
		}
	}
	if (c[0] == 2 && c[1] == 2)PRIY;
	else PRIN;
	return 0;
}

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

int main()
{
	int n;
	cin>>n; n%=10;
	switch(n)
	{
		case 2:
		case 4:
		case 5:
		case 7:
		case 9: puts("hon"); break;
		case 0:
		case 1:
		case 6:
		case 8: puts("pon"); break;
		case 3: puts("bon"); break;
	}
	return 0;
}

Measured memory_bytes: 3580
import sys
d=sys.stdin.readline
p={'N':(1,5,2,3,0,4),'E':(3,1,0,5,4,2),'W':(2,1,5,0,4,3),
   'S':(4,0,2,3,5,1),'R':(0,2,4,1,3,5),'L':(0,3,1,4,2,5)}
while 1:
 n=int(d())
 if n==0:break
 a=[1];s='123456'
 for _ in[0]*n:
  s=[s[e]for e in p[d()[0]]]
  a+=[s[0]]
 print(sum(map(int,a)))


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

using ll = long long;
#define int ll

const int nax = 3005;
ll dp[nax][nax];

int32_t main()
{
	int n;
	scanf("%lld",&n);
	vector<int> a(n);
	for(int& x : a)
	{
		scanf("%lld",&x);
	}
	for(int R=0;R<n;R++)
	{
		for(int L=R;L>=0;L--)
		{
			if(L == R)
			{
				dp[L][R] = a[L];
			}
			else
			{
				dp[L][R] = max(a[L] - dp[L + 1][R], a[R] - dp[L][R - 1]);
			}
		}
	}
	printf("%lld\n",dp[0][n-1]);
	return 0;
}

Measured memory_bytes: 70016
#include <iostream>
#include <set>
#include <vector>
using namespace std;

void dfs(int& N, int& M, int& ans, vector<int>& k, vector<int>& p, vector<vector<int>>& s, set<vector<int>>& a, int b, vector<int> c) {
	if (N != b) {
		for (int i = 0; i < 2; ++i) {
			c[b] = i;
			dfs(N, M, ans, k, p, s, a, b + 1, c);
			if (!a.count(c)) {
				a.insert(c);
				int j;
				for (j = 0; j < M; ++j) {
					int d = 0;
					for (int l = 0; l < k[j]; ++l) {
						if (c[s[j][l]]) ++d;
					}
					if (p[j] != d % 2) break;
				}
				if (M == j) ++ans;
			}
		}
	}
}

int main() {
	int N, M, ans = 0;
	cin >> N >> M;
	vector<int> k(M), p(M);
	vector<vector<int>> s(M);
	for (int i = 0; i < M; ++i) {
		cin >> k[i];
		s[i] = vector<int>(k[i]);
		for (int& j : s[i]) {
			cin >> j;
			--j;
		}
	}
	for (int& i : p) cin >> i;
	set<vector<int>> a;
	dfs(N, M, ans, k, p, s, a, 0, vector<int>(N));
	cout << ans;
}

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

//B - Harshad Number

int findSumOfDigits(int n){
    int sum = 0;
    while(n > 0){
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

int main(){
    int X;
    cin >> X;
    if(X % findSumOfDigits(X) == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
n=int(input())
lst=[]
for i in range(n):
  a,b=input().split()
  lst.append([a,int(b),i+1])
  
lst2=sorted(lst,key=lambda x:x[1],reverse=True)
lst3=sorted(lst2,key=lambda x:x[0],reverse=False)
for i in lst3:
  print(i[2])

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		String contest = "";
		if(x < 1200) {
			contest = "ABC";
		} else {
			contest = "ARC";
		}
		System.out.println(contest);
	}
}

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

#define for(i, a, b) for(ll (i)=a;(i)<(b);++(i))
#define rep(i, n)    for(i, 0, n)

const ll inf = 1e15;
const ll mod = 1e9+7;

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

int main() {
    string S;
    cin >> S;
    
    int n = S.length();
    vector<bool> visit(n, false);
    
    rep(i, n) {
        int x = S[i] - 'a';
        if (visit[x]) {
            cout << "no" << endl;
            return 0;
        }
        visit[x] = true;
    }
    cout << "yes" << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
//const int INF = 1e8;
using namespace std;

class RollingHash {
	public:
		typedef pair<long long,long long> hash_type;
		long long base1, base2;
		long long mod1, mod2;
		vector<long long> hash1, hash2;
		vector<long long> pow1, pow2;

		RollingHash(const string &s) : base1(1009), base2(1007), mod1(1000000007), mod2(1000000009) {
			int n = s.size();

			hash1.assign(n + 1,0);
			hash2.assign(n + 1,0);
			pow1.assign(n + 1,1);
			pow2.assign(n + 1,1);

			rep(i,n){
				hash1[i + 1] = (hash1[i] + s[i]) * base1 % mod1;
				hash2[i + 1] = (hash2[i] + s[i]) * base2 % mod2;
				pow1[i + 1] = pow1[i] * base1 % mod1;
				pow2[i + 1] = pow2[i] * base2 % mod2;
			}
		}

		hash_type get(int l, int r) { // 区間[l,r)のハッシュ値を計算する
			long long t1 = ((hash1[r] - hash1[l] * pow1[r - l]) % mod1 + mod1) % mod1;
			long long t2 = ((hash2[r] - hash2[l] * pow2[r - l]) % mod2 + mod2) % mod2;
			return make_pair(t1, t2);
		}

		hash_type concat(hash_type h1, hash_type h2, int h2_len) {
			return make_pair((h1.first * pow1[h2_len] + h2.first) % mod1, (h1.second * pow2[h2_len] + h2.second) % mod2);
		}
};

int main(){
	int n, m;
	string s;
	cin >> n >> m >> s;

	int l = 0, r = 1;
	vector<pair<int, int>> p(m);
	rep(i,m){
		string t;
		cin >> t;
		if(t[0] == 'R'){
			if(t[1] == '+'){
				r++;
			}else{
				r--;
			}
		}else{
			if(t[1] == '+'){
				l++;
			}else{
				l--;
			}
		}
		p[i] = make_pair(l,r);
	}

	set<RollingHash::hash_type> st;
	RollingHash rh(s);
	for(auto i : p){
		tie(l,r) = i;
		st.emplace(rh.get(l, r));
	}
	cout << st.size() << endl;
}



Measured memory_bytes: 33788
//url:
//problem name:

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

veci a,b,c,d;
ll ans = 0;

int main() {
    int N,M,Q;
    cin >> N >> M >>Q;
    a = b = c = d = veci(Q);
    REP(i,Q) cin >> a[i] >> b[i] >> c[i] >> d[i];
    queue<veci> que;

    for(int i = 1; i <= M; i++) {
        que.push({i});
    }

    while(1) {
        veci res = que.front();
        que.pop();
        if(res.size() == N+1) break;
        if(res.size() == N) {
            ll score = 0;
            REP(i,Q) {
                if((res[b[i]-1]-res[a[i]-1]) == c[i]) {
                    score += d[i];
                }
            }
            chmax(ans,score);
        }
        for(int i = res[res.size()-1]; i <= M; i++) {
            veci memo = res;
            memo.push_back(i);
            que.push(memo);
        }
    }
    cout << ans << endl;
}

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

int main(){
	string c;
	cin >> c;
	if(c=="a"||c=="i"||c=="u"||c=="e"||c=="o"){
		cout << "vowel" << endl;
	}else{
		cout << "consonant" << endl;
	}
	return 0;
}

Measured memory_bytes: 256