akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cmath>
#include<vector>
#define MAX 1000+1
#define INF 999999
using namespace std;

double data[MAX][MAX];
int path[MAX];
double dist[MAX];

typedef struct node{
	double x,y;
} build;

void parse(int i, vector<int> &ans){
	if(i==-1) return;
	else{
		parse(path[i], ans);
		ans.push_back(i);
	}
}


void hantei(int s, int g, int n){
	bool visited[MAX];
	
	for(int i=0; i<n; i++){
		visited[i] = false;
		dist[i] = INF;
	}
	
	dist[s] = 0.0;
	path[s] = -1;
	
	while(1){
		int next;
		int min = INF;
		
		for(int i=0; i<n; i++){
			if( visited[i] ) continue;
			if( dist[i] < min){
				min = dist[i];
				next = i;
			}
		}
		
		if(min == INF) break;
		
		visited[next] = true;
		
		for(int j=0; j<n; j++){
			if( visited[j] ) continue;
			if( dist[next] + data[next][j] < dist[j]){
				dist[j] = dist[next] + data[next][j];
				path[j] = next;
			}
		}
	}
	
	if(dist[g] == INF) cout << "NA" << endl;
	else{
		vector<int> ans;
		parse(g,ans);
		for(int i=0; i<ans.size(); i++){
			if( i ) cout << " ";
			cout << ans[i]+1;
		}
	cout << endl;
	}
}	
	
int main(){
	build b[MAX];
	int n,m,num,s,g;
	while(cin >> n){
		if(n==0) break;
		for(int i=0; i<n; i++){
			cin >> num;
			num--;
			cin >> b[num].x >> b[num].y;
		}
		
		for(int i=0; i<n; i++){
			for(int j=0; j<n; j++){
				if(i==j){
					data[i][j] = 0;
					continue;
				}
				data[i][j] = sqrt(pow(b[i].x - b[j].x, 2) + pow(b[i].y - b[j].y, 2));
				if(data[i][j] > 50) data[i][j] = INF;
				
			}
		}
		
		cin >> m;
		for(int i=0; i<m; i++){
			cin >> s >> g;
			hantei(s-1,g-1,n);
		}
	}
	return 0;
}

Measured memory_bytes: 0
X,Y = map(int, input().split())
flg = 1
tsuru = X - ((Y - 2*X)/2)
amari = (float(Y) - float(2*X))%2
minus = (Y - 2*X)/2


if(amari > 0):
  flg = 0
elif(tsuru < 0):
  flg = 0
elif(minus < 0):
  flg = 0
else:
  flg = 1

if(flg == 1):
  print("Yes")
else:
  print("No")

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

int main(){
  int a,b,c;
  long int x,y,min;
  scanf("%d %d %d %ld %ld",&a,&b,&c,&x,&y);
  long int mx=x>y?x:y;
  min=a*x+b*y;
  for(long int i=1;i<=mx;i++){
    long int sum=a*max(0L,x-i)+b*max(0L,y-i)+2*c*i;
    if(min>sum){
      min=sum;
    }
  }
  printf("%ld",min);
}


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

int main()
{
    long long n,k,ans=0;
    cin >> n>> k;
    if(k==0) ans=n*n;
    else
    {
        for(int b=k+1;b<=n;b++)
        {
        ans+=(n/b)*(b-k);
        if(n%b>=k) ans+=n%b-k+1;
        }
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int MAX_N = 300001;
int node[4*MAX_N], segtree_size;
void segtree_init(int n){
    segtree_size=1;
    while(segtree_size<n)segtree_size*=2;
    for(int i=0; i<2*segtree_size-1; ++i)node[i] = 0;
}
void segtree_update(int a, int x){
    a += segtree_size -1;
    node[a] = max(node[a], x);
    while(a>0){
        a=(a-1)/2;
        node[a]=max(node[2*a+1], node[2*a+2]);
    }
}
int segtree_query(int a, int b, int k=0, int l=0, int r=segtree_size){
    if (b <= l || r <= a){
        return 0;
    }
    if (a <= l && r <= b){
        return node[k];
    }
    int vl = segtree_query(a, b, 2*k+1, l, (l+r)/2);
    int vr = segtree_query(a, b, 2*k+2, (l+r)/2, r);
    return max(vl, vr);
}


int solve_naive(const vector<int> &va, const int k){
    vector<int> dp(va.size(), 1);
    for(int i=0; i<va.size(); ++i){
        for(int j=0; j<i; ++j){
            if(abs(va[i]-va[j])<= k)dp[i] = max(dp[i], dp[j]+1);
        }
    }
    return *max_element(dp.begin(), dp.end());
}


int main(){
    int n, k;
    cin >> n >> k;
    segtree_init(MAX_N+1);
    vector<int> va(n);
    for(int i=0; i<n; ++i)cin >> va[i];
    //cout << solve_naive(va, k) << endl;
    for(int i=0; i<n; ++i){
        int a=va[i];
        int l = segtree_query(a-k, a+k+1);
        segtree_update(a, l+1);
    }
    cout << segtree_query(0, segtree_size);
    return 0;
}

Measured memory_bytes: 8540
#include <bits/stdc++.h>
using namespace std;
int main(void){
    
    long long int x;
    cin>>x;
    
    long long int n=100;
    int ct=0;
    while(n<x){
        n=n*1.01;
        ct++;
    }
    cout<<ct<<endl;
    
   
}


Measured memory_bytes: 3636
/* Bismillahirrahmanirrahim */
/* Author : Jehian Norman Saviero (@Reiva5) */
#include <bits/stdc++.h>

// MACROS SAMPAH
#define Jehian using
#define Norman namespace
#define Saviero std
 
Jehian Norman Saviero;

// MACROS TYPE
typedef long l;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<l,l> pl;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<l> vl;
typedef vector<ll> vll;
 
// MACROS FOR PRINT
#define nl printf("\n")
#define sp printf(" ")
 
// MACROS FOR ATTRIBUTE
#define fi first
#define se second
 
// MACROS FOR FUNCTION AND METHOD
#define eb emplace_back
#define mp make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ALL(x) (x).begin(), (x).end()
#define ALLN(x,n) (x), (x)+(n)
#define CUBE(x) (SQR(x)*(x))
#define SET(x,y) for (int _qwe = sizeof(x)/sizeof(x[0]); _qwe; ) x[--_qwe] = (y)
#define SQR(x) ((x)*(x))
#define SSORT(x,sz) sort(ALLN(x,sz))
#define RESET(x) memset((x), 0, sizeof(x))
#define VSORT(x) sort(ALL(x))
 
// MACROS READ INPUT
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%ld", &x)
#define scll(x) scanf("%lld", &x)
#define scul(x) scl(x)
#define scull(x) scll(x)

int main() {
	int N;
	sci(N);
	int val = 0;
	for (int i = 0; i < N; ++i) {
		int tmp;
		sci(tmp);
		val ^= tmp;
	}
	puts(val ? "No" : "Yes");
	return 0;
}

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


int main(){
    int A, B, x;
    cin >>A >> B;
    string s;
    cin >> s;

    for(int i =0 ; i < A; i++){
        x = s[i] - '0';
        if(0>x|| x>9){
            cout << "No" << endl;
            return 0;
        }
    }
    if (s[A]!='-' || s.size()!= A+B+1){
        cout << "No" << endl;
            return 0;
    }
    for(int i =0 ; i < B; i++){
        x = s[i+ A +1] - '0';
        if(0>x|| x>9){
            cout << "No" << endl;
            return 0;
        }
    }
    
    cout << "Yes" << endl;
    return 0;
}
    

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    ll A;
    double B;
    cin >> A >> B;
    B = B * 100.0;
    ll b = (ll)round(B);
    cout << (A * b) / 100 << endl;
    return 0;
}

Measured memory_bytes: 3700
#include <stdio.h>

typedef struct {
  char s;
  int num;
} card;


card A[100001];
card B[100001];
int n;
int par(card[],int,int);
void qsort(card [],int ,int);
void merge(card[],int,int,int);
void mergesort(card[],int,int);
void checkstable();
int judge(card,card);

int main(){
  int i;
  char ch;
  scanf("%d",&n);
  scanf("%c",&ch);

  for(i=1;i<=n;i++){
    scanf("%c",&A[i].s);
    scanf("%d",&A[i].num);
    scanf("%c",&ch);
    B[i]=A[i];
  }

  qsort(A,1,n);

  checkstable();
  for(i=1;i<=n;i++){
    printf("%c",A[i].s);
    printf(" %d\n",A[i].num);
    
  }

  return 0;
}

int par(card A[],int p,int r){
  int i,j;
  card x=A[r],s;
  i=p-1;
  for(j=p;j<r;j++){
    if(A[j].num<=x.num){
      i =i+1;
      s=A[i];
      A[i]=A[j];
      A[j]=s;
    }
  }
  s=A[i+1];
  A[i+1]=A[r];
  A[r]=s;
  return i+1;
}


void qsort(card A[],int p,int r){
  int q;
  if(p<r){
    q = par(A,p,r);
    qsort(A,p,q-1);
    qsort(A,q+1,r);
  }
}

void checkstable(){
  mergesort(B,1,n+1);
  int i;
  for(i=1;i<=n;i++){
    if( judge(A[i],B[i]) == 0){
      printf("Not stable\n");
      return;
    }
  }
  printf("Stable\n");
}

void merge(card S[],int l,int m,int r){
  int i,j,k;
  int n1,n2;
  card L[500000];
  card R[500000];
  n1=m-l;
  n2=r-m;
  for(i=0;i<n1;i++){
    L[i]=S[l+i];
  }
  for(i=0;i<n2;i++){
    R[i]=S[m+i];
  }
  L[n1].num=1000000001;
  R[n2].num=1000000001;
  i = 0;
  j = 0;
  for(k=l;k<r;k++){
    if(L[i].num<=R[j].num){
      S[k]=L[i];
      i = i+1;
    } else{
      S[k]=R[j];
      j = j+1;
    }
  }
}
 
void mergesort(card S[],int l,int r){
  int m;
  if(l+1 < r){
    m = (l+r)/2;
    mergesort(S,l,m);
    mergesort(S,m,r);
    merge(S,l,m,r);
  }
}

int judge(card a,card b){
  if(a.s!=b.s){
    return 0;
  } else if(a.num!=b.num){
    return 0;
  } else {
    return 1;
  }
}

Measured memory_bytes: 6436
import java.util.*;
public class Main {
  public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int k = sc.nextInt();
  int[] p = new int[n];
  int[] dp = new int[n];
  int max = 0;
  int wk = 0;  
  for (int i=0; i < n; i++) {
    p[i]=sc.nextInt();
    if (i<k) {
	wk = wk + p[i];
    } else{
	wk = wk + p[i] - p[i-k];

    }
    max = chmax(max,wk);
  }
  System.out.println((max+k)/2.0);
  }

  private static int chmax(int a, int b) {
    return Math.max(a,b);
  }
}








Measured memory_bytes: 74488
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
//#pragma GCC optimize("Ofast")
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
//#define int ll
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define floatprec(dig) fixed << setprecision(dig)
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
#define invar(typ, var) typ var; cin >> var;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX / 2;
const ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
const double EPS = 1e-9;

signed main(void) {
  cin.tie(0); ios::sync_with_stdio(false);
  
  int N;
  cin >> N;
  vll A(N);
  rep(i, N) cin >> A[i];
  ll maxv = 0;
  ll minv = LLINF;
  rep(i, N) {
    chmax(maxv, A[i]);
    chmin(minv, A[i]);
  }
  fin(maxv - minv);
}

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

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

        // read the first list of integers
        int n = Integer.parseInt(br.readLine());
        int A[] = new int[n];
        String[] nums = br.readLine().trim().split("\\s+");
        for (int i = 0; i < n; i++)
            A[i] = Integer.parseInt(nums[i]);

        // read the second list of integers
        n = Integer.parseInt(br.readLine());
        int B[] = new int[n];
        nums = br.readLine().trim().split("\\s+");
        for (int i = 0; i < n; i++)
            B[i] = Integer.parseInt(nums[i]);

        int ans = 0;
        for (int b: B)
            for (int a: A)
                if (a == b) {
                    ans++;
                    break;
                }

        System.out.println(ans);
    }

}



Measured memory_bytes: 30304
#pragma region
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define repc(i, m, n) for (int i = m; i < n; i++)
#define reprc(i, m, n) for (int i = m; i > n; i--)
#define all(v) v.begin(), v.end()
#define INF 1e9
#define EPS 1e-10
using namespace std;
typedef long long ll;
#pragma endregion

int main()
{
    int N,M,c = 0;
    cin >> N >> M;
    vector<int> A(N);

    rep(i, N){
        cin >> A.at(i);
        c += A.at(i);
    }

    sort(all(A));
    reverse(all(A));

    if(A.at(M - 1) * (4 * M) >= c){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <numeric>
using namespace std;

int main(){
    string s,t ;
    cin >> s >> t ;
    t.pop_back() ;
    if (s == t)
    {
        cout << "Yes" << endl ;
    }else
    {
        cout << "No" << endl ;
    }
    
        


}

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

int main() {
  long long N;
  cin >> N;
  string s = "";
  
  while(N>0){
    N--;
    s += (char)(N%26+97);
    N /= 26;
  }
  
  reverse(s.begin(),s.end());
  
  cout << s << endl;
	return 0;
}


Measured memory_bytes: 3608
n=[0]*101
a,b,c,d=map(int,input().split())
n[a]+=1
n[b]-=1
n[c]+=1
n[d]-=1
for i in range(100):
  n[i+1]+=n[i]
ans=0
for i in n:
  if i==2:
    ans+=1
print(ans)


Measured memory_bytes: 3060
using System;
using System.Linq;
using System.Collections.Generic;

namespace ConsoleApp2
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            int max = 0;
            int second = 0;
            int maxIndex = -1;

            for (int i = 0; i < N; i++)
            {
                int n = int.Parse(Console.ReadLine());
                if (max <= n)
                {
                    second = max;
                    max = n;
                    maxIndex = i;
                }
                else if (second <= n)
                {
                    second = n;
                }
            }

            for (int i = 0; i < N; i++)
            {
                if (i != maxIndex) Console.WriteLine(max);
                else Console.WriteLine(second);
            }
            
            Console.WriteLine();
            Console.ReadLine();
        }
    }


}


Measured memory_bytes: 18504
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

int main() {
	int A, B;
	cin >> A >> B;

	int n = A * B;
	if (A < 10 && B < 10) cout << n << endl;
	else cout << -1 << endl;
}

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

using namespace std;
#define ll long long

int main (void) {
    int n;

    scanf("%d", &n);

    if(n % 2 == 1){
        printf("%d\n", n/2 + 1);
    } else{
        printf("%d\n", n/2);
    }
    return 0;
}

Measured memory_bytes: 256
while True:
    n,x = [int(x) for x in input().split()]
    if (n,x)==(0,0): break
    cnt=0
    for i in range(1,n-1):
        for j in range(i+1,n):
            for k in range(j+1,n+1):
                if i+j+k == x: cnt+=1
    print(cnt)

Measured memory_bytes: 7680
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    int n, k;
    Set<Integer> ds;

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

    void run() {
        FastReader sc = new FastReader();
        n = sc.nextInt();
        k = sc.nextInt();
        ds = new HashSet<>();
        for (int i = 0; i < k; i++) {
            ds.add(sc.nextInt());
        }
        solve();
    }

    void solve() {
        while (true) {
            boolean flag = true;
            int temp = n;
            while (temp > 0) {
                if (ds.contains(temp % 10)) {
                    flag = false;
                    break;
                }
                temp /= 10;
            }
            if (flag) {
                System.out.println(n);
                return;
            } else {
                n++;
            }
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


Measured memory_bytes: 23124
#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <ctime>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <algorithm>
#include <assert.h>
#include <unordered_map>
#include <unordered_set>

using namespace std;
#define pi acos(-1)
#define mod 1000000007
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef pair<int, int> PII;

inline void quickread(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int pow(int a, int b){
    int ans=1;
    while(b){
        if(b&1)ans=1LL*ans*a%mod;
        a=1LL*a*a%mod;b>>=1;
    }
    return ans;
}

int pow(int a, int b, int c){
    int ans=1;
    while(b){
        if(b&1)ans=1LL*ans*a%c;
        a=1LL*a*a%c;b>>=1;
    }
    return ans;
}
const int maxn = 100000 + 5;

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

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

int main(){
  int n,m,v[300000],v2[300001];
  cin >> n >> m;
  for(int i=0;i<n;i++) cin >> v[i];
  sort(v,v+n);
  fill(v2,v2+v[0]+1,0);
  for(int i=0;i<n-1;i++) fill(v2+v[i]+1,v2+v[i+1]+1,v[i]);
  for(int i=0;i<m;i++){
    int a,b,q,ans=0;
    cin >> q;
    a = b = v[n-1];
    while(1){
      ans = max(ans,a%q);
      if(ans == q - 1) break;
      a = v2[b];
      b = a - a % q;
      if(a == 0) break;
    }
    cout << ans << endl;
    }
}

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

#include <cstdlib>  // abs() for integer 絶対値求めやつ

#include <cmath>    // abs() for float, and fabs()

#include <algorithm>
#include <vector>
#define rep(i,n) for(int i = 0; i< (n);i++)

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

#define che(a,string) cout<<string<<":"<<(a)<<endl;

#define ch(a,string) cout<<string<<":"<<(a)<<" ";

using namespace std;

typedef pair<int,int> p;

int main(){
  string a,b;
  cin >>a>>b;
  bool ans = true;
  rep(i,3){
	  if(a.at(i)!=b.at(2-i)){
		  cout<<"NO"<<endl;
		  ans =false;
		  break;
		}
	}
	if(ans){
		cout<<"YES"<<endl;
	  }
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#define sc(x) scanf("%d",&x);
#define fo(i,s,f)  for(int i=s;i<=f;i++)
using namespace std;
int n,m,ans;
int main()
{
	sc(n);  sc(m);
	int i=0,j=0,l=0;
	fo(i,0,n)
		fo(j,0,n)
		{
			l=m-i-j;
			if(l<=n&&l>=0)  ans++;
		}
	printf("%d\n",ans);
	return 0;
}

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

#define endl '\n'
#define x first
#define y second
#define ii pair<int, int>
#define mp make_pair
#define pb push_back
#define vii vector<ii>
#define vi vector<int>
#define vvi vector<vi>
#define INF int(1e9)
#define TAM int(2e5)
#define LL long long int 

using namespace std;

int main () {
    ios_base::sync_with_stdio(false);

    int i = 1;
    int n;

    cin >> n;

    LL ans = 0;

    for(; i<=n; i++){
        if(i%3==0 and i%5==0)
            continue;
        else if(i%3==0)
            continue;
        else if(i%5==0)
            continue;
        else ans+=i;
    }

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

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

struct ind {
    string key;
    int cnt;
};

bool cmp (const ind &a, const ind &b) {
    return a.cnt > b.cnt;
}

int main() {
    cin >> n;
    vector<string> s(n);
    vector<ind> insd;
    for(int i = 0; i < n; ++i) {
        cin >> s.at(i);
    }

    sort(s.begin(), s.end());
    s.push_back("################");

    ind indata;
    indata.key = s.at(0);
    int count = 0;
    for(int i = 0; i <= n; ++i) {
        if(s.at(i) == indata.key) {
            count++;
        }else {
            indata.cnt = count;
            insd.push_back(indata);
            indata.key = s.at(i);
            count = 1;
        }
    }

    sort(insd.begin(), insd.end(), cmp);
    int insdlne = insd.size();
    int incnt = insd.at(0).cnt;
    vector<string> ans;
    for(int i = 0; i < insdlne; ++i) {
        if(insd.at(i).cnt == incnt) {
            ans.push_back(insd.at(i).key);
        }else {
            break;
        }
    }

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

    int anslen = ans.size();
    for(int i = 0; i < anslen; ++i) {
        cout << ans.at(i) << endl;
    }
}

Measured memory_bytes: 22752
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))


int main() {

  vector<int> a(3);

  std::cin >> a[0];
  std::cin >> a[1];
  std::cin >> a[2];

  sort(a.begin(),a.end());
  if (a[0]==a[2]){
    std::cout << "Yes" << endl;
    return 0;
  }else{
    std::cout << "No" << endl;
    return 0;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template<typename T> inline bool chmax(T& a,T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> inline bool chmin(T& a,T b) { if (a > b) { a = b; return true; } return false; }
constexpr long long INF = 1e18;

template<class T, typename F> struct SparseTable {
private :
    F f;
    T id;
    vector<vector<T>> st;
    vector<int> index;

public :
    SparseTable (const vector<T> &v, const F &f, const T &id) : f(f), id(id) {
        int b = 0;
        while ((1<<b) <= (int)v.size()) b++;
        st.resize(b, vector<T>(1<<b, id));
        for (int i = 0; i < v.size(); i++) st[0][i] = v[i];
        for (int i = 1; i < b; i++) {
            for (int j = 0; j + (1<<i) <= (1<<b); j++) {
                st[i][j] = f(st[i-1][j], st[i-1][j+(1<<(i-1))]);
            }
        }
        index.resize((int)v.size() + 1);
        for (int i = 2; i < (int)index.size(); i++) {
            index[i] = index[i>>1] + 1;
        }
    }

    inline T query (int l, int r) {
        assert(l <= r);
        if (l == r) return id;
        int b = index[r-l];
        return f(st[b][l], st[b][r-(1<<b)]);
    }

};

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int n;
    long long x;
    cin >> n >> x;
    vector<long long> a(n);
    for (auto& e : a) cin >> e;
    
    auto f = [](const long long &a, const long long &b) { return min(a, b); };
    SparseTable<long long, decltype(f)> st(a, f, INF);
    
    auto g = [&] (int k) {
        long long res = k * x;
        for (int i = 0; i < n; i++) {
            if (k <= i) res += st.query(i-k, i+1);
            else res += f(st.query(0, i+1), st.query(n-k+i, n));
        }
        return res;
    };
    
    int l = 0, r = n-1;
    while (abs(l - r) > 2) {
        int c1 = (l * 2 + r) / 3;
        int c2 = (l + r * 2) / 3;
        long long r1 = c1 * x, r2 = c2 * x;
        for (int i = 0; i < n; i++) {
            if (c1 <= i) r1 += st.query(i-c1, i+1);
            else r1 += f(st.query(0, i+1), st.query(n-c1+i, n));
            if (c2 <= i) r2 += st.query(i-c2, i+1);
            else r2 += f(st.query(0, i+1), st.query(n-c2+i, n));
        }
        if (r1 > r2) l = c1;
        else r = c2;
    }
    
    cout << min({g(l), g(l+1), g(l+2)}) << '\n';
    return 0;
}

Measured memory_bytes: 512
#define STOPIT
#include <bits/stdc++.h>
#define loop(n) for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto& a, auto b){ if (a > b) {a = b; return true;} return false; };
auto cmx = [](auto& a, auto b){ if (a < b) {a = b; return true;} return false; };
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
#define debug(...)\
	do {\
		std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
		debug_impl(__VA_ARGS__);\
		std::cerr << std::noboolalpha;\
	} while (false)
#else
#define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
	{ for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
 os << "{";
	for (auto it = v.begin(); it != v.end(); it++)
		{os << (it != v.begin() ? "," : "") << *it;}
	return os << "}";
}

template < class Container, class Value = typename Container::value_type >
auto run_length(Container const& v) {
	auto n = (int)v.size();
	if (n == 0)
		{ return std::vector< std::pair< Value, int > >{}; }
	auto pos = std::vector< int >{};
	for (auto i = 1; i < n; i++) {
		if (v.at(i - 1) != v.at(i))
			{ pos.emplace_back(i); }
	}
	pos.emplace_back(n);
	auto m = (int)pos.size();
	auto len = std::vector< int >(m);
	std::adjacent_difference(pos.begin(), pos.end(), len.begin());
	auto ret = std::vector< std::pair< Value, int > >(m);
	for (auto i = 0; i != m; i++)
		{ ret.at(i) = {v.at(pos.at(i) - 1), len.at(i)}; }
	return ret;
}

int main() {
	std::cin.tie(0); std::cin.sync_with_stdio(false);
	int n; std::cin >> n;
	std::vector<int> a(n);
	std::cin>> a;
	for (int& x : a) x--;
	debug(a);

	std::vector<int> b(n);
	rep(i,0,n) b.at(i) = a.at(i) == i;

	auto rle = run_length(b);
	std::vector<int> c;
	for (auto&& pair : rle) {
		int val, mul; std::tie(val, mul) = pair;
		if (val == 1) {
			c.emplace_back(mul);
		}
	}
	debug(c);

	int ans = 0;
	for (int x : c) {
		ans += (x+1) / 2;
	}
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 2808
#include<bits/stdc++.h>
#define pb           push_back
#define pf           push_front
#define in           insert
#define ff           first
#define ss           second
#define int          long long
#define rep(i,x,m)   for(int i=x;i<m;i++)
#define repr(i,x,m)  for(int i=x;i>=m;i--)
#define MOD          1000000007
#define endl         "\n"
#define all(v)       v.begin(),v.end()
#define rall(v)      v.rbegin(),v.rend()
#define vi           vector<int>
#define pi           pair<int,int>
#define sz(x)       (int)x.size()
#define pq           priority_queue<int>
#define pqs          priority_queue<int,vi,greater<int> >
#define fix(y)       fixed<<setprecision(y)
#define print(v)     for(int i=0;i<v.size();i++) cout<<v[i]<<" ";cout<<endl
#define FIO         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

int fac[2000005]={0};
void factorial(){ fac[0]=1; fac[1]=1; for(int i=2;i<200005;i++) fac[i]=((i%MOD)*(fac[i-1]%MOD))%MOD;}
int power(int n,int m)
{int p=1;if(m==0)return 1;p=(power(n,m/2)%MOD);p=(p%MOD*p%MOD)%MOD;
return(m&1?((p%MOD*n%MOD)%MOD):(p%MOD));}
int ncr(int n,int r){return ((fac[n]*power(fac[r],MOD-2))%MOD*power(fac[n-r],MOD-2))%MOD;}

void ram5564()
{
     
 int n;
 cin>>n;
 if(n>=30)
 {
    cout<<"Yes\n";return;
 }
 cout<<"No\n";
}

signed main()
{
        FIO
          
        
        int t=1;
       // cin>>t;
        while(t--)
        ram5564();
        cerr<<"\n"<<(float)clock()/CLOCKS_PER_SEC*1000<<" ms"<<endl;

        return 0;
}

Measured memory_bytes: 3804
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cctype>

using std::max;
using std::min;
using std::cerr;
using std::endl;

inline void read(int &x)
{
    int s = 0, w = 1;
    char c = getchar();
    while(!isdigit(c)){if(c == '-')w = -1; c = getchar();}
    while(isdigit(c)){s = (s << 3) + (s << 1) + c - '0', c = getchar();}
    x = s * w;
}

typedef long long ll;
#define rg register int

int n;

int main()
{
    scanf("%d", &n);
    printf("%d\n", 180 * (n - 2));
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

int main() {
    int N;
    cin >> N;
    if (N == 0 || N == 2) {
        cout << 1 << endl;
    } else if (N == 1) {
        cout << 2 << endl;
    } else {
        cout << 0 << endl;
    }
}



Measured memory_bytes: 3116
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        int i;
        double dis,sta;
        Scanner sc=new Scanner(System.in);

        while(true){
            int n=sc.nextInt();
            if(n==0){
                break;
            }
            int sum=0,sqsum=0;
            for(i=0;i<n;i++){
                int score=sc.nextInt();
                sum+=score;
                sqsum+=score*score;
            }
            dis=(double)sqsum/n-(double)sum/n*(double)sum/n;
            sta=Math.sqrt(dis);
            System.out.printf("%.8f\n",sta);
        }
        sc.close();
    }
}


Measured memory_bytes: 31512
#include<bits/stdc++.h>
#define mod 1000000007
#define max 5005
//#define max1 60000000
#define inf INT_MAX
using namespace std;
typedef  long long int ll;
template<typename T> inline T maxi(T a,T b){return a>b?a:b;}
template<typename T> inline T mini(T a,T b){return a<b?a:b;}
template<typename T> inline T absl(T a){return a>0?a:-a;}
template<typename T> inline T gcd(T a,T b){T t;if(a<b){while(a){t=a;a=b%a;b=t;}return b;}else{while(b){t=b;b=a%b;a=t;}return a;}}
#define mp(a,b) make_pair(a,b)
//###################################################------------------------------------------------------#######################################
ll solve(ll x){
    switch(x&3){
    case 0:return x;
    case 1:return 1;
    case 2:return x+1;
    case 3:return 0;
   }
}
void input(){
    ll a,b;
   cin>>a>>b;
   if(a ==0&&b==0){
    cout<<0<<endl;return;
   }
   if(a==0){
     cout<<solve(b)<<endl;return;
   }
   ll x = solve(a-1)^(solve(b));
   cout<<x<<endl;
}
int main(){
    input();
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    long long int a,b,d,x;
    char c;
    scanf("%lld%lld",&a,&b);
    scanf("%c",&c);
    scanf("%lld",&d);
    b=b*100;
    b=b+d;
    x=a*b;
    x=x/100;
    printf("%lld",x);
    return 0;
}


Measured memory_bytes: 1736
#include <iostream>
#include <vector>

using i64 = long long;

const i64 MOD = 1000000007;
i64 pow(i64 a, i64 k) {
	i64 t = 1;
	for (; k; a = a * a % MOD, k >>= 1) if (k & 1) t = t * a % MOD;
	return t;
}

const int INF = int(MOD);
const int N = 100000 + 7;

int n;
int a[N];

struct seg {
	int low[N << 2];
	void build(int p, int l, int r) {
		if (l == r)
			low[p] = a[l];
		else
			build(p << 1, l, l + r >> 1), build(p << 1 | 1, (l + r >> 1) + 1, r),
			low[p] = std::min(low[p << 1], low[p << 1 | 1]);
	}
	int getmin(int p, int l, int r, int x, int y) {
		if (x <= l && r <= y) return low[p];
		int m = l + r >> 1, u = INF, v = INF;
		if (x <= m) u = getmin(p << 1, l, m, x, y);
		if (y > m) v = getmin(p << 1 | 1, m + 1, r, x, y);
		return std::min(u, v);
	}
	void arr(int p, int l, int r, int x, int y, int k, std::vector<int>& z) {
		if (low[p] > k) return;
		if (l == r) return void(z.push_back(l));
		int m = l + r >> 1;
		if (x <= m) arr(p << 1, l, m, x, y, k, z);
		if (y > m) arr(p << 1 | 1, m + 1, r, x, y, k, z);
	}
} seg;

int ct;
int l[N], r[N], h[N];
std::vector<int> kid[N];
int build(int u, int v, int q) {
	int p = ++ct;
	l[p] = u, r[p] = v, h[p] = q;
	if (u == v) return p;
	std::vector<int> z;
	int w = seg.getmin(1, 1, n, u, v);
	z.push_back(u - 1), seg.arr(1, 1, n, u, v, w, z), z.push_back(v + 1);
	for (int i = 1, j; i < z.size(); ++i)
		if (z[i - 1] + 1 <= z[i] - 1)
			kid[p].push_back(build(z[i - 1] + 1, z[i] - 1, w));
  return p;
}

i64 dp[N][2];
void solve(int p) {
	int w = r[p] - l[p] + 1;
	for (auto t : kid[p]) solve(t), w -= r[t] - l[t] + 1;
	dp[p][0] = pow(2, w), dp[p][1] = 1;
	w = a[l[p]];
	for (auto t : kid[p])
		( dp[p][0] *= dp[t][0] + 2 * dp[t][1] ) %= MOD,
		( dp[p][1] *= dp[t][1] ) %= MOD,
		w = std::min(w, h[t]);
	( dp[p][0] -= dp[p][1] * 2 ) %= MOD;
	( dp[p][1] *= pow(2, w - h[p]) ) %= MOD;
}

int main() {
//	freopen("code.in", "r", stdin);
//	freopen("code.out", "w", stdout);

	scanf("%d", &n);
	for (int i = 1; i <= n; ++i)
		scanf("%lld", a + i);
	if (n == 1) return printf("%lld", pow(2, a[1])), 0;
	seg.build(1, 1, n);
	int rt = build(1, n, 0);
	solve(rt);
	printf("%lld", (dp[rt][0] + dp[rt][1] + MOD * 3) % MOD);
	return 0;
}


Measured memory_bytes: 4864
#include<algorithm>
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<cmath>

using namespace std;

template<typename T>void read(T&x){x=0;int fl=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')
fl=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}x*=fl;}
template<typename T,typename...Args>inline void read(T&t,Args&...args){read(t);read(args...);}

typedef long long LL;

const int N = 3005;
const LL MOD = 998244353;

int n;
LL S, a[N], dp[N][N], ans, sum[N][N];

int main(){
    read(n, S);
    for(int i = 1; i <= n; i++) read(a[i]);
    for(int k = 1; k <= n; k++){
        (dp[k][a[k]] += k) %= MOD;
        for(int s = a[k] + 1; s <= S; s++)
            (dp[k][s] += sum[k-1][s-a[k]]) %= MOD;
        for(int s = 0; s <= S; s++)
            sum[k][s] = (sum[k-1][s] + dp[k][s]) % MOD;
    }
    for(int i = 1; i <= n; i++)
        (ans += dp[i][S] * (n - i + 1) % MOD) %= MOD;
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 141184
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <climits>
#include <cassert>
#include <algorithm>
#include <utility>

using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;
using VVI = vector<vector<long long int> >;

// 二つの値の最小値を求める関数
Int Min(const Int a, const Int b) {
    if (a <= b) {
        return a;
    } else {
        return b;
    }
}

int main(void) {
    Int l, r;
    cin >> l >> r;
    r = Min(r, l + 2019);
    Int result = 2019;
    for (Int i = l; i <= r; ++i) {
        for (Int j = i + 1; j <= r; ++j) {
            result = Min(result, (i * j) % 2019);
        }
    }
    cout << result << endl;
    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin >> s;
  
  for (int i = 1; i <= s.size(); i++) {
    if (i % 2 == 1) {
      if (s[i - 1] == 'L') {
        cout << "No";
        return 0;
      }
    } else {
      if (s[i - 1] == 'R') {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
}

Measured memory_bytes: 256
# include<cstdio>
char s[5];
int main ()
{
scanf ("%s" ,&s);
int a = s[0] - '0' , b = s[1] - '0' , c = s [2] - '0' , d = s [3] - '0';
if (a -b -c - d ==7) printf ("%d-%d-%d-%d=7\n",a ,b ,c , d );
else if (a -b - c + d ==7) printf ("%d-%d-%d+%d=7\n " ,a ,b ,c , d );
else if (a - b +c - d ==7) printf ("%d-%d+%d-%d=7\n " ,a ,b ,c , d );
else if (a - b + c + d ==7) printf ("%d-%d+%d+%d=7\n " ,a ,b ,c , d );
else if ( a +b -c - d ==7) printf ("%d+%d-%d-%d=7\n " ,a ,b ,c , d );
else if ( a +b - c + d ==7) printf ("%d+%d-%d+%d=7\n " ,a ,b ,c , d );
else if ( a + b +c - d ==7) printf ("%d+%d+%d-%d=7\n " ,a ,b ,c , d );
else if ( a + b + c + d ==7) printf ("%d+%d+%d+%d=7\n " ,a ,b ,c , d );
}

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

int main(void){
   int X;
   cin>>X;
   long long K=0;
   long long sum=0;
   while(1){
      K++;
      sum+=X;
      if(sum%360==0) break;
   }
   cout<<K<<endl;
   return 0;
}


Measured memory_bytes: 3588
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

lists = [a,b,c,d,e]
lists_2 = [a%10,b%10,c%10,d%10,e%10]
for i in range(4):
  if 0 in lists_2:
    lists_2.remove(0)
  else:
    pass

count = 0
counter = 0
for i in lists:
  if i%10 == 0:
    count += i
  elif i%10!= min(lists_2):
    count += ((i//10) +1)*10
  else:
    if counter == 0:
      count += i
      counter = 1
    else:
      count += ((i//10) +1)*10
print(count)

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

#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> P;
typedef map<int,int> mp;

const int MOD = 1e9 + 7;


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

    ll n, k, s;
    cin >> n >> k >> s;

    rep(i, k){
        cout << s << " ";
    }

    if(s == 1e9){
        rep(i, n-k){
            cout << 1 << " ";
        }
    }else{
        rep(i, n-k){
            cout << s+1 << " ";
        }
    }
    cout << endl;

    return 0;
}



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

int main() {
  string S;
  int Q;
  cin >> S >> Q;
  vector<int> t(Q);
  vector<int> f(Q);
  vector<char> c(Q);
  for(int i=0;i<Q;i++){
    cin >> t[i];
    if( t[i] == 2 ){
      cin >> f[i] >> c[i];
    }
  }
  
  string A="";
  string B="";
  int k=0;
  for(int i=0;i<Q;i++){
    if(t[i]==1)
      k++;
    else if((k+f[i])%2==1)
      A = A + c[i];
    else
      B = B + c[i];
  }
  if(k%2==1){
    reverse(B.begin(),B.end());
    reverse(S.begin(),S.end());
    cout << B+S+A << endl;
  }
  else{
    reverse(A.begin(),A.end());
    cout << A+S+B << endl;
  }
}


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

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] as = br.readLine().split(" ");
		int n = Integer.parseInt(as[1]);
		int r = Integer.parseInt(as[0]);
		if(r < 10) {
			System.out.println(n + 100*(10-r));
		}else {
			System.out.println(n);
		}
			
		
	}

}


Measured memory_bytes: 22612
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 5e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//
template< typename T >
struct Compress {
  vector< T > xs;

  Compress() = default;

  Compress(const vector< T > &vs) {
    add(vs);
  }

  Compress(const initializer_list< vector< T > > &vs) {
    for(auto &p : vs) add(p);
  }

  void add(const vector< T > &vs) {
    copy(begin(vs), end(vs), back_inserter(xs));
  }

  void add(const T &x) {
    xs.emplace_back(x);
  }

  void build() {
    sort(begin(xs), end(xs));
    xs.erase(unique(begin(xs), end(xs)), end(xs));
  }

  vector< int > get(const vector< T > &vs) const {
    vector< int > ret;
    transform(begin(vs), end(vs), back_inserter(ret), [&](const T &x) {
      return lower_bound(begin(xs), end(xs), x) - begin(xs);
    });
    return ret;
  }

  int get(const T &x) const {
    return lower_bound(begin(xs), end(xs), x) - begin(xs);
  }

  const T &operator[](int k) const {
    return xs[k];
  }
};

// Binary Indexed Tree (Fenwick Tree)
template <typename T>
struct BIT {
    ll n;
    vector<T> d;
    BIT(ll n = 0) : n(n), d(n + 1) {}
    void add(ll i, T x = 1) {
        for (i++; i <= n; i += i & -i) {
            d[i] += x;
        }
    }
    T sum(ll i) {
        T x = 0;
        for (i++; i; i -= i & -i) {
            x += d[i];
        }
        return x;
    }
};

ll A[200000];
int main() {
    init();
    ll N, K;
    cin >> N >> K;
    rep(i, N) cin >> A[i], A[i] -= K;

    vc<ll> acc(N + 1);
    rep(i, N) acc[i + 1] = acc[i] + A[i];

    Compress<ll> C;
    C.add(acc);
    C.build();

    BIT<ll> bt(C.xs.size() + 1);
    ll ans = 0;
    rep(i,N){
        bt.add(C.get(acc[i]));
        ans += bt.sum(C.get(acc[i + 1]));
    }

    cout << ans << endl;
}

Measured memory_bytes: 6640
/**
 * @author: Mackenzie
**/
#include <bits/stdc++.h>

using namespace std;

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int main()
{
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#else
    fastIO;
#endif
    int n;
    cin>>n;
    vector<int> v(n);
    map<int,int> mp;
    forn(i,n)cin>>v[i],mp[v[i]]++;
    int ans=0;
    for(auto x:mp){
        if(x.S&1)ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 8140
#include<stdio.h>
int main(void){
	int age,month,date;
	int flag = 0;
	while(scanf("%d",&age) != EOF){
		scanf("%d %d",&month,&date);
		flag = 0;
		if(age < 1868){
			flag = 1;
			printf("pre-meiji");
			printf("\n");
		}
		else if(age == 1868){
			if(month == 9){
				if(date < 8){
					flag = 1;
					printf("pre-meiji");
					printf("\n");
				}
				else{
					printf("meiji %d",age - 1868 + 1);
				}
			}
			else if(month < 9){
				flag = 1;
				printf("pre-meiji");
				printf("\n");
			}
			else{
				printf("meiji %d",age - 1868 + 1);
			}
		}
		else if(age > 1868 && age < 1911){
			printf("meiji %d",age - 1868 + 1);
		}
		else if(age == 1912){
			if(month == 7){
				if(date < 30){
					printf("meiji %d",age - 1868 + 1);
				}
				else{
					printf("taisho %d",age - 1912 + 1);
				}
			}
			else if(month < 7){
				printf("meiji %d",age -1868 + 1);
			}
			else{
				printf("taisho %d",age - 1912 + 1);
			}
		}
		else if(age > 1913 && age < 1925){
			printf("taisho %d",age - 1912 + 1);
		}
		else if( age == 1926){
			if(month == 12){
				if(date < 25){
					printf("taisho %d",age - 1912 + 1);
				}
				else{
					printf("showa %d",age - 1926 + 1);
				}
			}
			else if(month < 12){
				printf("taisho %d",age - 1912 + 1);
			}
			else{
				printf("showa %d",age - 1926 + 1);
			}
		}
		else if(age > 1927 && age < 1988){
			printf("showa %d",age - 1926 + 1);
		}
		else if(age == 1989){
			if(month == 1){
				if(date < 8){
					printf("showa %d",age - 1926 + 1);
				}
				else{
					printf("heisei %d",age - 1989 + 1);
				}
			}
			else if(month < 1){
				printf("showa %d",age - 1926 + 1);
			}
			else{
				printf("heisei %d",age - 1989 + 1);
			}
		}
		else{
			printf("heisei %d",age - 1989 + 1);
		}
		if(flag == 0){
		printf(" %d %d\n",month,date);
			flag = 0;
		}
	}
	return 0;
}

Measured memory_bytes: 600
object Main extends App {
  import scala.io.StdIn._
  import scala.math
  val Array(n, m, k) = readLine.trim.split(' ').map(_.toInt)
  val oranges = List.tabulate(n){_ ⇒ readLine.trim.toInt}
  implicit val memo: Array[Option[Long]] = Array.tabulate(n + 1){_ ⇒ None}
  println(
    dp(oranges, n, m, k)
  )
  def dp(oranges: List[Int], length:Int, m: Int, k: Int)(implicit memo: Array[Option[Long]]): Long = {
    oranges match{
      case Nil ⇒ 0
      case h::t ⇒
        memo(length) match{
          case Some(v) ⇒ v
          case None ⇒ dp(t, 1, h, h, m, k, length - 1).also(it ⇒ memo(length) = Some(it))
        }
    }

  }
  def dp(oranges: List[Int], count: Long, max: Int, min: Int, m: Int, k: Int, length: Int): Long = {
    if (count == m) dp(oranges, length, m, k) + k + count * (max - min)
    else {
      oranges match {
        case Nil ⇒ k + count * (max - min)
        case h :: t if max < h ⇒ math.min(dp(oranges, length, m, k) + k + count * (max - min), dp(t, count + 1, h, min, m, k, length - 1))
        case h :: t if min > h ⇒ math.min(dp(oranges, length, m, k) + k + count * (max - min), dp(t, count + 1, max, h, m, k, length - 1))
        case _ :: t ⇒ math.min(dp(oranges, length, m, k) + k + count * (max - min), dp(t, count + 1, max, min, m, k, length - 1))
      }
    }
  }
  implicit class ScopeFunc[T](private val value: T) {
    def let[A](func:T ⇒ A): A = func(value)
    def also(func:T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}




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

namespace paiza2
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = Int32.Parse(Console.ReadLine());
            Console.WriteLine((1 + N) * N / 2);
        }

    }
}


Measured memory_bytes: 11092