akhauriyash/Code-Regression huggingface dataset:
#include<iostream> 
#include<string>
#include<bits/stdc++.h>
using namespace std;
int main(){	
    int N,L;
    cin>>N>>L;
    int f[N];
    int sum=0;
    for(int i=1;i<=N;i++){
    	f[i-1]=L+i-1;
    }
    for(int i=0;i<N;i++){
    	sum=sum+f[i];
    }
    for(int i=0;i<N;i++){
    	if(f[i]==0){
    		cout<<sum<<endl;
    		return 0;
    	}
    }
    if(f[0]>0){
    	cout<<sum-f[0]<<endl;
    	return 0;
    }
    else{
    	cout<<sum-f[N-1]<<endl;
    	return 0;
    }
} 

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

using namespace std;

char island[12][13];

void solve(int row, int col) {
	int currentRow, currentCol;
	int dx[4] = { 0,1,0,-1 };
	int dy[4] = { 1,0,-1,0 };

	island[row][col] = 0;
	for (int i = 0; i < 4; i++) {
		currentRow = row + dx[i];
		currentCol = col + dy[i];

		if (currentRow < 0 || currentCol < 0 || currentCol > 11) {
			continue;
		}

		if (island[currentRow][currentCol] == '1') {
			solve(currentRow, currentCol);
		}
	}

}

int main(void) {
	int i,j,cnt;

	while (cin >> island[0]) {
		for (i = 1; i < 12; i++) {
			cin >> island[i];
		}
		
		cnt = 0;
		for (i = 0; i < 12; i++) {
			for (j = 0; j < 12; j++) {
				if (island[i][j] == '1') {
					cnt++;
					solve(i,j);
				}
			}
		}
		cout << cnt << endl;
	}

	return 0;
}


Measured memory_bytes: 3012
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;
int main(void) {
	int a, b, c;
	cin >> a >> b >> c;
	if(a+b+c>=22)
		cout << "bust" << endl;
	else cout << "win" << endl;
	return 0;
}

Measured memory_bytes: 256
function main(arg) {
    var S = arg.split("");
    var cnt = 0;
    var whiteCnt = 0;
    var firstFlg = true;
    var localCnt = 0;
    var doneWhite = 0;
    var islastB;
    
    for(var i = 0 ; i < S.length; i++) {

        if(S[i] == "W") {
            doneWhite++;
            islastB = false;
            if( firstFlg == true ) {
                whiteCnt++;
            }
            continue;
        }
        
        if(firstFlg) {
            for(var j = 1 ; j < S.length-i ;j++) {
                if( S[i+j] == "B") {
                    continue;
                }
            
                if( S[i+j] == "W" ) {
                    whiteCnt++;
                }
            }
        }

        cnt = cnt + whiteCnt - doneWhite;
        
        islastB = true;
        firstFlg = false;
    }
    
    if( cnt<0 ) {
        cnt = 0;
    }
    console.log(cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    y /= gcd(x,y);
    return (x*y);
}

int main()
{
    
    ll m;
    cin >> m;
    cout << 48-m << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

bool check(string s, char c)
{
    rep(i,s.size())if(s[i]!=c) return false;
    return true;
}

int main()
{
    string s;
    cin >>s;
    int S = s.size();

    bool a[26]={};
    rep(i,S) a[s[i]-'a']=true;

    int ans = 1010;
    rep(alp,26)
    {
        if(!a[alp]) continue;

        char c = 'a'+alp;
        int ct = 0;
        string p=s, now;
        while(1)
        {
            if(check(p,c)) break;

            now = "";
            rep(i,(int)p.size()-1)
            {
                if(p[i]==c || p[i+1]==c) now+=c;
                else now+=p[i];
            }
            ++ct;
            p = now;
        }

        ans = min(ans,ct);
    }

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


Measured memory_bytes: 256
from sys import stdin


inp = stdin.readline

n, k = [int(x) for x in inp().strip().split()]

array = [int(x) for x in inp().strip().split()]

distance = [0]*(k * 2)

for i in range(k - 1):
    distance[i] = array[i+1] - array[i]

distance[k-1] = n-array[k-1] + array[0]
distance[2*k-1] = n-array[k-1] + array[0]
for i in range(k - 1):
    distance[k+i] = array[i+1] - array[i]

minimum = 999999999

count = 0
total = 0
countLimit = k-1
for i in range(k * 2):
    if count < countLimit:
        total += distance[i]
        count += 1
    else:
        if minimum > total:
            minimum = total
        total += distance[i]
        total -= distance[i-countLimit]

print(minimum)


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

typedef long long int ll;


int main()
{
   ll x;
   cin>>x;
   ll cnt=0;

    for(ll i=100; i<x; )
    {
        i= i+ (i/100);
        cnt++;
    }

    cout<<cnt<<endl;

    return 0;
}


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

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var hw = Console.ReadLine().Split().Select(x => long.Parse(x)).ToArray();
        var h = hw[0];
        var w = hw[1];

        var k = h == 1 || w == 1 ? 1 : (h / 2 + h % 2) * (w / 2 + w % 2) + (h / 2) * (w / 2);

        Console.WriteLine(k);
    }
}


Measured memory_bytes: 13268
n,x=map(int,input().split())
a=list(map(int,input().split()))
ct=0
if a[0]>x:
  ct+=a[0]-x
  a[0]=x
for i in range(n-1):
  if a[i]+a[i+1]>x:
    ct+=a[i+1]-x+a[i]
    a[i+1]=x-a[i]
print(ct)

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

int main() {
  string S, T; cin >> S >> T;
  sort(S.begin(), S.end());
  sort(T.begin(), T.end());
  reverse(T.begin(), T.end());
  if (S < T) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;

int main()
{
    int  a=0,c=0,i=0,n=0,j=0;
    int aa[100]={};
    cin >> n;
    for(i=0;i<n;i++){
        cin >> aa[i];

    }
    bool flag = 1;
    while(flag){
        flag = 0;
        for(j = n-1; j > 0; j--){
            if(aa[j]<aa[j-1]){
                swap(aa[j],aa[j-1]);
                c++;
                flag=1;
            }
        }
    }

    for(i=0;i<n;i++){
        cout << aa[i];
        if(i<n-1){
            cout << ' ';
        }
    }
    cout << endl;
    cout << c << endl;
    //cout << b;
}

Measured memory_bytes: 1164
#約数列挙
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

def main():
    A,B = map(int, input().split())
    div_list = make_divisor_list(B)

    if A in div_list:
        print(A+B)
    else:
        print(B-A)


if __name__ == '__main__' :
    main()

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int t2m(ll s){
  ll s1 = s / 100,s2 = s % 100;
  return s1 * 60 + s2;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  ll s1,s2;
  while(cin >> n >> s1 >> s2 && n){
    ll Ma = t2m(s2);
    ll a,s,e;
    vector<ll> ans(t2m(s2)+1,0);
    rep(i,n){
      cin >> a;
      ll bs = t2m(s1);
      rep(j,a){
        cin >> s >> e;
        s = t2m(s);
        e = t2m(e);
        REP(k,bs,s){
          ans[k] = 1;
        }
        bs = e;
      }
      REP(j,bs,Ma){
        ans[j] = 1;
      }
    }
    ll res = 0,tmp = 0;
    REP(i,t2m(s1),t2m(s2)){
      if(ans[i]){
        ++tmp;
        res = max(res,tmp);
      }
      else
        tmp = 0;
    }
    cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 3108
import java.util.*;

public class Main {

    Edge[] g;
    int n;


    void run() {
        Scanner sc = new Scanner(System.in);

        n = sc.nextInt();
        int m = sc.nextInt();

        g = new Edge[n];
        for (int i = 0; i < n; i++) {
            g[i] = new Edge();
            if (i != 0) g[i].add(new P(i - 1, 0));
        }

        for (int i = 0; i < m; i++) {
            int l = sc.nextInt() - 1, r = sc.nextInt() - 1, c = sc.nextInt();
            g[l].add(new P(r, c));
        }
        System.out.println(dijkstra());
    }

    long dijkstra() {
        long[] d = new long[n];
        Arrays.fill(d, 1L << 60);
        d[0] = 0;
        PriorityQueue<P> q = new PriorityQueue<>(Comparator.comparingLong(p -> p.c));
        q.add(new P(0, 0));

        while (!q.isEmpty()) {
            P cur = q.remove();
            if (cur.t == n - 1) return cur.c;
            if (cur.c > d[cur.t]) continue;

            for (P next: g[cur.t]) {
                if (d[next.t] > cur.c + next.c) {
                    d[next.t] = cur.c + next.c;
                    q.add(new P(next.t, cur.c + next.c));
                }
            }
        }
        return -1;
    }

    class Edge extends ArrayList<P> {}

    class P {
        int t;
        long c;
        P(int t, long c) {
            this.t = t;
            this.c = c;
        }
    }

    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }

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

}


Measured memory_bytes: 112464
import java.io.*;

class Main{
    public static void main(String[] args){
	try{
	    BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));
	    double x=0.0, y=0.0;
	    int t = 0;
	    while(true){
		String st = sc.readLine();
		if(st.equals("0,0"))
		    break;
		String[] s = st.split(",");
		int d = Integer.valueOf(s[0]);
		double deg = Math.toRadians(t);
		x += d*Math.sin(deg);
		y += d*Math.cos(deg);
		t += Integer.valueOf(s[1]);
	    }
	    System.out.printf("%d\n%d\n",(int)x,(int)y);
	}catch(Exception e){
	    System.out.println("Error");
	}
    }
}

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

int main(){
  long d;
  cin >> d;
  long n = 26, csum = 0, ccost = 0;
  vector<long> c(n),last(n);
  rep(i,n){
    cin >> c[i];
    csum += c[i];
    last[i] = 0;
  }
  vector<vector<long>> s(d,vector<long>(n));
  rep(i,d)rep(j,n)cin >> s[i][j];
  vector<vector<long>> cand;
  vector<long> score;
  random_device rd{};
  vector<long> yotei(d);
  vector<long> tmp(d);
  long final_ans = 0, final_index;

  rep(jj,100){

    long ans = 0;
    rep(i,n)last[i] = 0;
    rep(i,d)yotei[i] = rd()%n;
    rep(i,d){
      ccost += csum;
      ccost -= c[yotei[i]]*(i+1 - last[yotei[i]]);
      ans -= ccost;
      last[yotei[i]] = i+1;
      ans += s[i][yotei[i]];
    }
    int ii = 0;
    while(ii < 10000){
      long new_day = rd()%d, new_con;
      while(1){
        new_con = rd()%n;
        if(yotei[new_day] != new_con)break;
      }
      long pre_con = yotei[new_day];
      yotei[new_day] = new_con;
      long tmpans = 0;
      ccost = 0;
      rep(i,n)last[i] = 0;
      rep(i,d){
        tmp[i] = yotei[i];
        ccost += csum;
        ccost -= c[yotei[i]]*(i+1 - last[yotei[i]]);
        tmpans -= ccost;
        last[yotei[i]] = i+1;
        tmpans += s[i][yotei[i]];
      }
      if(tmpans < ans)yotei[new_day] = pre_con;
      else{
        ans = tmpans;
        cand.push_back(tmp);
      }
      ii++;
    }
    if(final_ans < ans){
      final_ans = ans;
      final_index = int(cand.size()-1);
    }
  }
  rep(i,d)cout << cand[final_index][i]+1 << endl;
  return 0;
}

Measured memory_bytes: 200308
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <functional>
#include <array>

using namespace std;

int64_t Func(int64_t now, string S){
    if(S == ""){
        return now;
    }
    int64_t ans = 0;
    for(size_t i = 1; i <= S.size(); ++i){
        ans += Func(now + stoll(S.substr(0, i)), S.substr(i));
    }
    return ans;
}

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

    cout << Func(0, S) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
#define N 500000
using namespace std;
int main()
{
     int a,b;
     int k=0;
    int c[N],w,v;
    cin>>a>>b;
    while (b)
    {
        c[k++]=b%10;
        b/=10;
    }
   w=a;
  for (int i=0;i<k;i++)
    w*=10;
    for (int i=k;i>=0;i--)
        w+=c[i]*pow(10,i);

        v=sqrt(w);
    if (v*v==w)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int sum=0;
  for(int i=0;i<N;i++){
    int l, r;
    cin >> l >> r;
    sum +=(r-l+1);
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
const input = require("fs").readFileSync("/dev/stdin", "utf8")
const n = Number(input)
function main(n){
  if(Number.isInteger(n / 111)){
  	return n
  }else{
 	return (Math.floor(n / 111) + 1) * 111
  }
}
        
console.log(main(n));

Measured memory_bytes: 21064
#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

void fail(){
  cout << "No" << endl;
  exit(0);
}

signed main(){

  int n; cin >> n;
  vector<int> a(n);
  map<int ,int> mp;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    mp[a[i]]++;
  }

  if(mp[0] == n){
    cout << "Yes" << endl;
    return 0;
  }
  if(n % 3 != 0) fail();

  if(mp.size() == 2){
    if(mp[0] != n / 3) fail();
  }else{
    vector<int> vec;
    for(auto p : mp){
      if(p.first != 0 && p.second == n / 3) vec.push_back(p.first);
    }
    if(vec.size() != 3 || (vec[0] ^ vec[1] ^ vec[2]) != 0) fail();
  }
  cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 5632
import sys

def result():


    input_first = input().split()
    input_second = input().split()

    N= input_first
    paper = [int(i) for i in input_second]


    for num in paper:
        if num%2 ==0 and num%3!=0 and num %5 != 0:
            print('DENIED')
            return 

    print('APPROVED')
    return 


result()




Measured memory_bytes: 2940
n=int(input())
a=list(map(int,input().split()))
d={}
l=[]
ind=0
total=0

def comb(a):
    return a*(a-1)//2

for i in range(n):
    try:
        l[d[a[i]]]+=1
    except:
        d[a[i]]=ind
        l.append(1)
        ind+=1

for i in range(len(l)):
    total+=comb(l[i])

for i in range(n):
    b=l[d[a[i]]]
    print(total-b+1)


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

using namespace std;

int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int c=0,m=0;
    for(int i=n-2;i>=0;i--)
    {
        if(a[i]>=a[i+1])
        {
            c++;
            m=max(m,c);
        }
        else
            c=0;
    }
cout<<m;
}


Measured memory_bytes: 640
n = int(input())
a = list(map(int, input().split()))

x = 0
for i in range(n):
    if a[i] % 2 == 0:
        if a[i] % 3 == 0 or a[i] % 5 == 0:
            x += 0
        else:
            x += 1
if x == 0:
    print('APPROVED')
else:
    print('DENIED')


Measured memory_bytes: 3060
#include <bits/stdc++.h>  // ver2.2.0
#define int long long
#define endl "\n"
#define ALL(v) (v).begin(),(v).end()
#define Vi vector<int>
#define VVi vector<Vi>
#define Vs vector<string>
#define Pii pair<int,int>
#define VPii vector<Pii>
#define Tiii tuple<int,int,int>
#define PQi priority_queue<int>
#define PQir priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define FI first
#define SE second
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define sortr(v) sort(v,greater<>())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repeq(i,a,b) for(int i=a;i<=b;i++)
#define repreq(i,a,b) for(int i=a;i>=b;i--)
#define leng(n) (int)(log10(n)+1)
#define dem(a,b) ((a+b-1)/(b))
#define Vin(a) rep(iI,0,a.size())cin>>a[iI]
#define Vout(a) rep(lZ,0,a.size()-1)cout<<a[lZ]<<' ';cout<<a.back()<<endl
#define VVout(a) rep(lY,0,a.size()){Vout(a[lY]);}
#define VPout(a) rep(lX,0,a.size())cout<<a[lX].FI<<' '<<a[lX].SE<<endl
#define INF 3000000000000000000  //  3.0 * 10 ^ 18 (MAXの1/3くらい)
#define MOD 1000000007  //  10^9 + 7
using namespace std;
 
int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm
void uniq(Vi &v){sort(ALL(v)); v.erase(unique(ALL(v)),v.end());}  //  uniqのやつ
 
int mypow(int x, int n, int m){  //  累乗x^n(mod m)  O(log(n))
if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}

Vs mapp(0);

int check(int i,int j){
  if(mapp[i][j]!='.') return 0;
  int wh=1,bl=0,ct=0,times;
  int h=mapp.size(),w=mapp[0].size();
  Vi dx(4),dy(4);
  dx={1,-1,0,0};
  dy={0,0,1,-1};
  char fd;
  Pii now;
  queue<Pii> next;
  next.push(mp(i,j));
  mapp[i][j] = '0';
  
  while(next.size()!=0){
    if(ct%2==0) fd='#';
    else fd='.';
    
    times = next.size();
    rep(QW,0,times){
      now = next.front();
      next.pop();
      rep(i,0,4){
        if(now.FI+dx[i]>=0 && now.FI+dx[i] < h && now.SE+dy[i] >=0 && now.SE+dy[i]<w) {
          if(mapp[now.FI+dx[i]][now.SE+dy[i]]==fd) {
            if(fd =='#') bl++;
            else wh++;
            next.push(mp(now.FI+dx[i],now.SE+dy[i]));
            mapp[now.FI+dx[i]][now.SE+dy[i]]='0';
          }
        }
      }
      
    }
    
    ct++;
  }
  
  //cout << wh*bl << endl;
  //VVout(mapp);
  //cout<<endl;
  return wh*bl;
}

signed main() {
  cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(12);
  int h,w;
  cin >> h >> w;
  string s;
  rep(i,0,h) {
    cin >> s;
    mapp.pb(s);
  }
  int ans=0;
  rep(i,0,h){
    rep(j,0,w){
      ans += check(i,j);
    }
  }
  //VVout(mapp);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 512
def main():
    a = []
    for i in range(5):
        a.append(int(input()))

    amari = 0
    amari_max = 0
    for i in range(5):
        if a[i] % 10 != 0:
            amari += 10 - a[i] % 10
            if amari_max <  10 - a[i] % 10:
                amari_max = 10 - a[i] % 10
    print(sum(a)+amari-amari_max)

main()



Measured memory_bytes: 3060
#include<stdio.h>
int main(void)
{
	int n,i,j,k,flg;
	scanf("%d",&n);
	k=0;
	for(i=1;i<n;i++){
		flg=0;
		if(i%2!=0) flg=1;
		for(j=i+1;j<=n;j++){
			if(flg==1&&j%2==0)k++;
			if(flg==0&&j%2!=0)k++;
		}
	}
	printf("%d\n",k);
	return 0;
}

Measured memory_bytes: 128
using System;

public class Hello
{
    public static void Main()
    {
        while (true)
        {
            var s = int.Parse(Console.ReadLine().Trim());
            if (s == 0) break;
            var ret = 999999999;
            for (int i = 0; i <= s; i += 200)
                for (int j = 0; j <= s; j += 300)
                {
                    var k = s - i - j;
                    if (k < 0 ||  k % 500 != 0) continue;
                    var w = getA(i / 200) + getB(j / 300) + getC(k / 500);
                    ret = Math.Min(ret, w);
                }
            Console.WriteLine(ret);
        }
    }
    public static int getA(int n)
    {
        var a = n % 5;
        var b = n / 5;
        return 1520 * b + a * 380;
    }
    public static int getB(int n)
    {
        var a = n % 4;
        var b = n / 4;
        return 1870 * b + a * 550;
    }
    public static int getC(int n)
    {
        var a = n % 3;
        var b = n / 3;
        return 2244 * b + a * 850;
    }
}



Measured memory_bytes: 9112
#include <stdio.h>
int main(){
    long long int h, w;
    long long ans =0;
    scanf("%lld %lld", &h, &w);
    if(w==1 || h==1){
        printf("1");
        return 0;
    }
    long long  int men=h*w;
    if(men%2==0) printf("%lld", men/2);
    if(men%2!=0) {
        printf("%lld", men/2+1);
        return 0;
    }
    return 0;
}

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    ll n, k;
    cin >> n >> k;
    vector<ll> v(n);
    for(auto& i : v) cin >> i;

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

    REP(i, n){
        RREP(j, n){
            if(v[i] > v[j]) dp[i][j] = dp[i][j+1] + 1;
            else dp[i][j] = dp[i][j+1];
        }
    }

    ll small = 0;
    REP(i, n){
        small += dp[i][i];
        small %= MOD;
    }

    ll large = 0;
    REP(i, n){
        large += dp[i][0];
        large %= MOD;
    }

    //debug(small);debug(large);

    ll ans = 0;
    ans = small * k % MOD;
    large *= (k*(k-1))/2 % MOD;
    large %= MOD;

    ans += large;
    ans %= MOD;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 31616
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    string S;
    cin>>N;
    cin>>S;
    int x=0;
    for (int i = 0; i < S.size(); i++)
    {
        x=S[i]-'A';
        x= (x+N)%26;
        S[i]= 'A'+x;
    }
    cout << S<<endl;
    
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi >
#define vvvi vector<vvi >
#define pii pair<int,int>
#define INF 1e9
#define MOD 1e9+7
typedef long long llong;
using namespace std;

int main(){
	int n,m;
	cin>>n>>m;
	
	vi a(n+1,0);
	
	REP(i,m){
		int l,r;
		cin>>l>>r;
		
		a[l-1]++;
		a[r-1+1]--;
	}
	
	for(int i=0;i<n+1;++i){
		a[i+1]+=a[i];
	}
	
	int res=0;
	REP(i,n){
		if(a[i]==m) res++;
	}
	
	cout<<res<<endl;
}

Measured memory_bytes: 640
/**
* Motto:   fight till end
* Author: fyter_112
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ump unordered_map<int,int>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define rep(i,a,n) for(int i=a;i<(n);i++)
#define all(x) x.begin(),x.end()
#define reps(i,j,n)   for(int i=(j);i>=(n);i--)
#define ld long double
#define count(i,n) for(i=n;i>0;i=i/10)
#define kick(ts) cout<<"Case #"<<ts<<": "
#define mod 1000000007
int32_t main()
{
  int n,w;
  cin>>n>>w;
  int weight[n],value[n];
  int sum=0,p=0;
  int dp[n+1][w+1];
  rep(i,0,n)
  {
    cin>>weight[i]>>value[i];
  }
  rep(i,0,n+1)
  {
    rep(j,0,w+1)
    {
      if(i==0 || j==0)
      {
        dp[i][j]=0;
      }
      else if(weight[i-1]<=j)
      {
        dp[i][j]=max(value[i-1]+dp[i-1][j-weight[i-1]],dp[i-1][j]);
      }
      else
      {
        dp[i][j]=dp[i-1][j];
      }
    }
  }
  cout << dp[n][w] <<'\n';
}


Measured memory_bytes: 79104
def mi():
    return map(int, input().split())

def main():
    N = int(input())
    X = list(mi())
    Y = sorted(X)
    for i in range(N):
        if X[i] <= Y[N//2-1]:
            print(Y[N//2])
        else:
            print(Y[N//2-1])


if __name__ == '__main__':
    main()

Measured memory_bytes: 93780
{-# LANGUAGE BangPatterns, FlexibleContexts #-}

import Control.Applicative
import Control.Monad
import Control.Monad.ST
import Data.Array
import Data.Array.ST
import Data.List
import Debug.Trace (traceShow, traceShowM)
import qualified Data.ByteString.Char8 as B

readi b | Just (n, _) <- B.readInt b = n

f1 :: Int -> [Int]
f1 n = do
    xs <- sequence (replicate n "357")
    guard (check xs)
    return $ read xs

check :: String -> Bool
check xs
    | null ("753" \\ xs) = True
    | otherwise          = False

main :: IO ()
main = do
    n <- readLn :: IO Int
    let xs = concatMap f1 [3 .. 9]
    print $ length $ takeWhile (<= n) xs
    return ()

Measured memory_bytes: 2428
#pragma GCC optimize ("-O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include<cmath>
#include<cstdio>
#include<algorithm>
#include<bitset>
#include<complex>
#include<deque>
#include<fstream>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<utility>
#include<valarray>
#include<vector>
#include<array>
#include<forward_list>
#include<random>
#include<ratio>
#include<tuple>
#include<unordered_map>
#include<unordered_set>
#include<cstring>

using namespace std;
using Int = long long; using uint = unsigned int; using uInt = unsigned long long;
typedef pair<int,int> Pi; typedef pair<Int,Int> Pl;
constexpr int mod = 1e9+7;
constexpr int INF32 = numeric_limits<int>::max();
constexpr Int INF64 = numeric_limits<Int>::max();
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define mp make_pair
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rep(i,n) for(int(i)=0; i<n; ++i)
#define rer(i,l,r) for(int i=l; i<=r; ++i)
#define gnr(i,l,r) for(int i=r; i>=l; --i)
#define eb emplace_back
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) {rep(i,n-1)cout<<a[i]<<' '; if(n)cout<<a[n-1]<<'\n';}
#define prip(p) cout<<p.fi<<' '<<p.se<<'\n'
#define priend(a) {cout<<(a)<<'\n'; return 0;}
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n,m,_,x,y,q;
string s,sb;
bool ok;
char ch;

template<class T>
T extgcd(T a,T b,T &x,T &y){
  T d=a;
  if(b){
    d=extgcd(b,a%b,y,x);
    y-=(a/b)*x;
  }else{
    x=1,y=0;
  }
  return d;
}

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

  cin>>n>>m; extgcd(n,m,x,y);
  prip(Pi(x,y));
}


Measured memory_bytes: 3224
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP2(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(v) (v).begin(),(v).end()
#define INF 2e9
typedef long long ll;

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

  cout<<s.substr(0,4)<<" "<<s.substr(4,8)<<endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
 
const int N = 1e5 + 5;
 
int n;
int a[N];
 
int32_t main()
{
	IOS;
	cin >> n;
	int ans = 1;
	for(int i = 1; i <= n; i++)
		cin >> a[i];
	sort(a + 1, a + n + 1);
	if(a[1] == 0)
	{
		cout << 0;
		return 0;
	}
	long double cur = 1;
	for(int i = 1; i <= n; i++)
	{
		cur *= a[i];
		if(cur > 1e18 + 5)
		{
			cout << -1;
			return 0;
		}
		ans *= a[i];
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 4384
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
import sys

n = ni()
cnts = []
for i in range(n):
    cnts.append(collections.Counter(list(input())))
ans=""
alp = list("abcdefghijklmnopqrstuvwxyz")
for w in alp:
    tmp=10**10
    for i in range(n):
        tmp = min(tmp,cnts[i][w])
    ans+= w*tmp
print(ans)


Measured memory_bytes: 9544
#include <iostream>
#include <string>
#include <vector>
#include <cstdint>

using namespace std;

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

	string s;
	cin >> s;

	vector<string> result(n);
	int32_t num_passed{ a + b };
	for (auto i{ 0 }; i < s.size() && result.size(); ++i) {
		if (s[i] == 'a' && num_passed > 0) {
			result[i] = "Yes";
			--num_passed;
		}else if (s[i] == 'b' && num_passed > 0 && b > 0) {
			result[i] = "Yes";
			--num_passed;
			--b;
		}else {
			result[i] = "No";
		}
	}

	for (const auto& x : result) {
		cout << x << '\n';
	}
	cout << flush;
}


Measured memory_bytes: 6144
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long d = sc.nextInt();
        d = d*d;
        int count = 0;

        for (int i = 0; i < n; i++) {
            long x = sc.nextInt();
            long y = sc.nextInt();
            long z = x*x + y*y;
            if (z <= d) {
                count++;
            }
        }
        System.out.println(count);
	}
}


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

int main() {
  int N;
  string S;

  cin >> N;
  cin >> S;

  
  

  if (N % 2 == 0) {
    rep(i, N/2){
      if (S[i] == S[i+N/2]) {
        continue;
      } else {
        cout << "No" << endl;
        return 0;
      }
     
    }
  } else {
    cout << "No" << endl;
    return 0;
  }

  cout << "Yes" << endl;
  return 0;
}

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>
#include <stdio.h>
#include <bits/stdc++.h>


using namespace std;
#define ll long long
#define ld long double
#define  P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORa(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define FORr(i,m,n) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define FORs(i,st) for(auto i : st)
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define ALL(c) (c).begin(), (c).end()
#define VEC2(x,a,b) vector<vector<ll>> x = vector<vector<ll>>(a,vector<ll>(b,0))
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "; cout<<endl
#define cout(n) cout<<fixed<<setprecision(n)

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

    ll n;
    cin>>n;
    map<string, ll> mp;
    FOR(i,0,n){
      string f,s;
      cin>>f>>s;
      if(f == "insert") mp[s] = 1;
      else{
        if(mp[s] == 1)cout<<"yes"<<endl;
        else cout<<"no"<<endl;
      }
    }
}



Measured memory_bytes: 47416
#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>  
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<ll> v32;
typedef vector<vector<ll> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<vector<p64> > vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 1e9+7;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// #define INF 1e18
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
void solve()
{
	string s;
	cin>>s;
	int n=s.length();
	s="a"+s;
	int d;
	cin>>d;
	ll sum=0;
	vv64 dp(n+1,v64(d+1,0));
	// dp[0][0]=1;
	for (int i=1; i<=n; i++)
	{
		for (int j=0; j<=9; j++)
		{
			for (int k=0; k<d; k++)
			{
				dp[i][(k+j)%d]+=dp[i-1][k];
				dp[i][(k+j)%d]%=MOD;
			}
		}
		int num=s[i]-'0';
		for (int j=0; j<num; j++)
		{
			dp[i][(sum+j)%d]++;
			dp[i][(sum+j)%d]%=MOD;
		}
		sum=(sum+s[i]-'0')%d;
	}
	dp[n][sum%d]++;
	dp[n][sum%d]%=MOD;
	cout<<(dp[n][0]-1+MOD)%MOD<<endl;

}
int main() 
{ 
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 
    int t=1;
    while (t--)
    {
        solve();
    }
    return 0;   
} 

Measured memory_bytes: 10368
#include<bits/stdc++.h>
using namespace std; 
using lint  =                           long long int;
using plint =                           pair<lint, lint>;
#define vli                             vector<lint>
#define pb                              push_back
#define ALL(x)                          begin(x),end(x)
#define inf                             (1LL<63)-1
#define MOD 1000000007
#define SZ(x)                           ((lint)(x).size())
#define                                 FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define                                 IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define                                 REP(i, n) FOR(i,0,n)
#define                                 IREP(i, n) IFOR(i,0,n)
#define                                 f_ip   ios_base::sync_with_stdio(false); cin.tie(NULL);
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T>                    istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }


/*
   -------
         |
    **   |
   -------      
   |
   ------------------------------------------------------------------------------------------------------
*/

void solve(){
   int N,K;cin>>N>>K;
   int ans=0;
   while(N != 0){
       ++ans;
       N /= K;
   }
   cout<<ans<<endl;
}

int main(){   
  
 solve();

 return 0;
}


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

int main() {
	int n,p;
	int sum = 0;
	int maxP = 0;

	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> p;
		maxP = max(p, maxP);
		sum += p;
	}

	sum -= maxP / 2;

	cout << sum;

	return 0;
}

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

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

            var d = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            int ans = 0;

            for (int i = 0; i < N - 1; i++) {
                for (int j = 1; i + j < N; j++) {
                    ans += d[i] * d[i + j];
                }
            }

            Console.WriteLine(ans);
        }

    }
}


Measured memory_bytes: 13268
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for(ll i = m; i < (n); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>; 
using vl = vector<ll>;
using vll = vector<vl>;
using pll = pair<ll, ll>;

int main() {
    ll a, b;
    cin >> a >> b;
    ll c = a * b;
    if(c % 2 == 0) cout << "Even";
    else cout << "Odd";
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
                                                                                                
  
int main(){
                                                                                                
   
    int n, x, i; 

    int k = 0;

    
    cin >> n >> x;

    vector<int> m(n);


    for( i = 0 ; i < n ; i = i + 1 ){

         cin >> m.at(i);

         x -= m.at(i);

         k += 1;

         }

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


    if( x > 0 ){

        k += x / m.at(0);

        }


    cout << k << endl;


    return 0;

}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
    int N;
    int A,B;
    scanf("%d",&N);
    if(N==1){
        printf("Hello World\n");
    }else if(N==2){
        scanf("%d",&A);
        scanf("%d",&B);
        printf("%d\n",A+B);
    }
    return 0;
}

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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

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

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, k;
    cin >> n >> k;
    ll ans = 0;
    FOR (b, 1, n + 1) {
        int p = n / b;
        int r = n % b;
        ans += p * (ll)max(b - k, (ll)0);
        ans += (ll)max(r - k + 1, (ll)0);
    }
    if (k == 0) ans -= n;
    cout << ans << endl;
    
    return 0;
}



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

#define all(x) (x).begin(), (x).end()
#define dbl(k, x) fixed << setprecision(k) << (x)

template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}

#define _upgrade                \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)

// ********************** CODE ********************** //

int main() {
  _upgrade;
  char c;
  cin >> c;
  if (c >= 'a') {
    cout << 'a' << '\n';
  } else {
    cout << 'A' << '\n';
  }
  return 0;
}

Measured memory_bytes: 3648
//Md Fahad
// CSE 18

#include<bits/stdc++.h>


using  namespace  std;

#define PI              acos(-1.0)
#define lcm(a,b)        (a * (b / __gcd(a,b)))
#define en '\n'

#define READ_IN freopen("Input.txt","r",stdin);
#define READ_OUT freopen("Output.txt","w",stdout);
#define Infi                0x3f3f3f3f

const int fx[] = {+1,-1,+0,+0};                         // 4 X directions
const int fy[] = {+0,+0,+1,-1};                         // 4 Y directions
const int fx8[] = {+0,+0,+1,-1,-1,+1,-1,+1};            // King X Moves
const int fy8[] = {-1,+1,+0,+0,+1,+1,-1,-1};            // King Y Moves
const int kx[] = {-2, -2, -1, -1,  1,  1,  2,  2};      // Knight X Moves
const int ky[] = {-1,  1, -2,  2, -2,  2, -1,  1};      // Knight Y Moves



int  Set    (int N,int pos) {return N=N | (1<<pos);}    /// turn a bit on
int  reset  (int N,int pos) {return N= N & ~(1<<pos);}  /// turn a bit off
bool check  (int N,int pos) {return (bool)(N & (1<<pos));} /// check, if a bit is on or not

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define trace(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define trace(x...)
#endif


typedef long long int           ll;
typedef unsigned long long int  llu;

int main(void)
{
    //READ_IN;
    int n,m;
    cin >> n >> m;

    int k = (n*(n-1))/2;
    int f = (m*(m-1))/2;
    cout << k + f << endl;

    return 0;
}



Measured memory_bytes: 256
a, b, c = gets.chomp.split(' ').map(&:to_i)
k = gets.chomp.to_i

k.times do
  if a >= b
    b *= 2
  elsif b >= c
    c *= 2
  end
end

if a < b && b < c
  puts 'Yes'
else
  puts 'No'
end
  


Measured memory_bytes: 14376
#include<iostream>
#include<vector>
#include<algorithm>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;

int main()
{
    int n, i;
    long long ans = 0;
    cin >> n;
    vector<long long>a(n);
    rep(j,n) cin >> a[j];
    sort(a.begin(), a.end());
    ans += a[n - 1];
    for(i = n-2; i > (n-2)/2; i--){
        ans += a[i];
        ans += a[i];
    }
    if(n % 2 == 1) ans -= a[i + 1];
    cout << ans << endl;
    return 0;
}

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

using namespace std;

#ifdef LOCAL_DEFINE
  #include "../../library/DEBUG.hpp"
#else
  #define debug(...) 0
#endif

int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<long long> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr.begin(), arr.end());
  long long ans = 0;
  for (int i = 0; i < k; i++) {
    ans += arr[i];
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 3672
import java.util.Scanner;

public class Main {

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

			char searchChar = 'a';
			char endChar = 'z';

			while (searchChar <= endChar) {
				String searchStr = Character.toString(searchChar);
				if (s.indexOf(searchChar) == -1) {
					System.out.println(searchStr);
					return;
				} else {
					s = s.replaceAll(searchStr, "");
				}
				searchChar++;
			}
			System.out.println("None");
		} finally {
			sc.close();
		}
	}
}

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

using LD = long double;

struct vec2 {
	LD x, y;
	vec2(LD x = 0, LD y = 0) : x(x), y(y) {}
	vec2 operator + (const vec2 &rhs) const {
		return vec2(x + rhs.x, y + rhs.y);
	}
	vec2 operator - (const vec2 &rhs) const {
		return vec2(x - rhs.x, y - rhs.y);
	}
	LD operator * (const vec2 &rhs) const {
		return x * rhs.x + y * rhs.y;
	}
	LD operator ^ (const vec2 &rhs) const {
		return x * rhs.y - y * rhs.x;
	}
	vec2 operator * (const LD rhs) const {
		return vec2(x * rhs, y * rhs);
	}
	friend vec2 operator * (const LD lhs, const vec2 rhs) {
		return vec2(lhs * rhs.x, lhs * rhs.y);
	}
	vec2 operator / (const LD rhs) const {
		return vec2(x / rhs, y / rhs);
	}
	LD norm2() const {
		return x * x + y * y;
	}
	LD norm() const {
		return std::sqrt(norm2());
	}
	friend std::istream& operator >> (std::istream &cin, vec2 &v) {
		return cin >> v.x >> v.y;
	}
	friend std::ostream& operator << (std::ostream &cout, const vec2 v) {
		return cout << std::fixed << std::setprecision(10) << v.x << ' ' << std::fixed << std::setprecision(10) << v.y;
	}
};
int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	vec2 p0, p1, p2; int q;
	std::cin >> p0 >> p1, p1 = p1 - p0;
	std::cin >> q;
	for (int i = 1; i <= q; ++i) {
		std::cin >> p2, p2 = p2 - p0;
		if ((p1 ^ p2) > 0)
			std::cout << "COUNTER_CLOCKWISE\n";
		else if ((p1 ^ p2) < 0)
			std::cout << "CLOCKWISE\n";
		else if (p1 * p2 < 0)
			std::cout << "ONLINE_BACK\n";
		else if (p2.norm2() > p1.norm2())
			std::cout << "ONLINE_FRONT\n";
		else
			std::cout << "ON_SEGMENT\n";
	}
}



Measured memory_bytes: 3288