akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
using namespace std;
typedef pair<int, int> P;


const int INF = 6e9;
int V, E;
int d[110][110];

void warshall_floyd(){
    rep(k, 0, V){
        rep(i, 0, V){
            rep(j, 0, V){
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
}


signed main(){
    cin >> V >> E;
    rep(i, 0, V) rep(j, 0, V) d[i][j] = INF;    
    rep(i, 0, V) d[i][i] = 0;    
    int s, t, a;
    rep(i, 0, E){
        cin >> s >> t >> a;
        d[s][t] = a;
        // d[t][s] = a;
    }
    warshall_floyd();
    rep(i, 0, V){
        if(d[i][i] < 0){
            cout << "NEGATIVE CYCLE" << endl;
            return 0;
        }
    }
    rep(i, 0, V){
        rep(j, 0, V){
            if(j != 0) cout << " ";
            if(d[i][j] >= INF / 2) cout << "INF";
            else cout << d[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 3176
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>

int main() {
	std::string s;
	std::cin >> s;
	int ans = 0;
	for (int i = 0;i < s.size()-1;i++) {
		if (s[i] == 'B'&&s[i + 1] == 'W') {
			ans += 1;
		}
		if (s[i] == 'W'&&s[i + 1] == 'B') {
			ans += 1;
		}
	}
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 512
// E - Dist Max

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

int main() {
	int N;
	cin >> N;

	ll min_X = INF;
	ll max_X = -INF;
	ll min_Y = INF;
	ll max_Y = -INF;
	for (int i=0; i<N; i++) {
		ll x, y, X, Y;
		cin >> x >> y;
		X = x - y;
		Y = x + y;
		min_X = min(min_X, X);
		max_X = max(max_X, X);
		min_Y = min(min_Y, Y);
		max_Y = max(max_Y, Y);
	}

	ll ans = max(max_X - min_X, max_Y - min_Y);

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3588
A,B,C = map(int,input().split())
Top = max(A,B,C)
Bottom = min(A,B,C)
Middle = A+B+C - Top - Bottom
if (Middle - Bottom)%2 != 0:
  Top += 1
  Bottom += 1
  Answer = (Top -Middle) + (Middle - Bottom)//2 +1
else:
  Answer = (Top - Middle) + (Middle - Bottom)//2
print(Answer)

Measured memory_bytes: 3064
#include <cstdio>

const int MAX_RC = 10;
int R, C;
char grid[MAX_RC][MAX_RC];
bool seen[MAX_RC][MAX_RC];
int dr[4] = {-1, 0, 1, 0};
int dc[4] = {0, -1, 0, 1};

int main() {
  scanf(" %d %d ", &R, &C);
  bool doable = true;
  for (int r = 0; r < R; ++r) {
    for (int c = 0; c < C; ++c) {
      scanf("%c", &grid[r][c]);
    }
    scanf(" ");
  }
  int r = 0, c = 0;
  while (1) {
    int num = 0;
    seen[r][c] = true;
    int nnr, nnc, kk;
    for (int k = 0; k < 4; ++k) {
      int nr = dr[k] + r;
      int nc = dc[k] + c;
      if (nr < 0 || nr >= R || nc < 0 || nc >= C) continue;
      if (grid[nr][nc] == '.') continue;
      if (seen[nr][nc]) continue;
      ++num;
      if (num > 1) {
        doable = false;
        goto done;
      }
      nnr = nr;
      nnc = nc;
      kk = k;
    }
    if (num == 0) break;
    if (kk == 1 || kk == 0) {
      doable = false;
      break;
    }
    r = nnr;
    c = nnc;
  }
  done:
  if (doable) printf("Possible\n");
  else printf("Impossible\n");
}


Measured memory_bytes: 128
n = int(input())

if n == 10**5:
    print(90909)
elif n >= 10**4:
    print(909 + (n - 9999))
elif n >= 10**3:
    print(909)
elif n >= 10**2:
    print(9 + (n - 99))
elif n >= 10:
    print(9)
else:
    print(n)



Measured memory_bytes: 2940
#include <bits/stdc++.h> 
using namespace std; 
typedef long long ll;
int main() 
{ 
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
    string ss,st;
    cin>>ss;
    cin>>st;
    int n = ss.size();
    int m = st.size();
    vector<vector<int>> dp(n+1,vector<int>(m+1,0));
    for(int i =1;i<=n;i++){
        for(int j = 1;j<=m;j++){
            if(ss[i-1]==st[j-1])
	            dp[i][j] = dp[i-1][j-1]+1;
	        else
	            dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
        }
    }
    int i = n,j = m;
    stack<char> stc;
    while(i > 0 && j > 0){
        if(dp[i][j] == dp[i-1][j]){
    	    i--;
	    }
	    else if(dp[i][j] == dp[i][j-1]){
	        j--;
	    }
	    else{
            stc.push(ss[i-1]);
	        i--;
	        j--;
	        
	    }
    }
    while(!stc.empty()){
        cout<<stc.top();
        stc.pop();
    }
    
	return 0;
} 

Measured memory_bytes: 35584
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <functional>

using namespace std;
typedef long long int ll;

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)

struct point{
  ll x, y, vx, vy;
  point(ll x, ll y, ll vx, ll vy) : x(x), y(y), vx(vx), vy(vy) {}
};

double calcs(vector<point> bounds, double t){
  double xmin = 1e+8, xmax = -1e+8, ymin = 1e+8, ymax = -1e+8;
  for(auto it = bounds.begin(); it != bounds.end(); ++it) {
    xmin = min(xmin, it->x + t * it->vx);
    xmax = max(xmax, it->x + t * it->vx);
    ymin = min(ymin, it->y + t * it->vy);
    ymax = max(ymax, it->y + t * it->vy);
  }
  return (xmax - xmin) * (ymax - ymin);
}

int main(){
  ll N;
  cin >> N;
  vector<point> points, bounds;
  vector<double> t_cand(1, 0);
  rep(i, N){
    ll x, y, vx = 0, vy = 0;
    char d;
    scanf("%lld %lld %c", &x, &y, &d);
    if(d == 'R') vx = 1;
    if(d == 'L') vx = -1;
    if(d == 'U') vy = 1;
    if(d == 'D') vy = -1;
    points.emplace_back(x, y, vx, vy);
  }

  rep(ud, 2){
    if(ud == 0){
      sort(points.begin(), points.end(),
          [](const point &a, const point &b){return a.x < b.x; });
    }
    else{
      sort(points.begin(), points.end(),
          [](const point &a, const point &b){return a.y < b.y; });
    }
    repi(d_pnt, -1, 2){
      rep(i, N){
        if(points[i].vx * (1-ud) + points[i].vy * ud == d_pnt){
          bounds.push_back(points[i]);
          break;
        }
      }
      rrep(i, N){
        if(points[i].vx * (1-ud) + points[i].vy * ud == d_pnt){
          bounds.push_back(points[i]);
          break;
        }
      }
    }
  }

  rep(i, (ll)bounds.size()) rep(j, i){
    if((bounds[i].vx - bounds[j].vx) * (bounds[i].x - bounds[j].x) < 0)
      t_cand.push_back(1.0 * (bounds[j].x - bounds[i].x) / (bounds[i].vx - bounds[j].vx));
    if((bounds[i].vy - bounds[j].vy) * (bounds[i].y - bounds[j].y) < 0)
      t_cand.push_back(1.0 * (bounds[j].y - bounds[i].y) / (bounds[i].vy - bounds[j].vy));
  }

  double ans = 1e+20;
  for(auto it = t_cand.begin(); it != t_cand.end(); ++it) {
    ans = min(ans, calcs(bounds, *it));
  }

  printf("%.9f\n", ans);
  return 0;
}


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

int main(){
	string sa,sb,sc;
	char Ans;
	cin>>sa>>sb>>sc;
	queue<char>a,b,c;
	for(int i=0;i<(int)sa.size();i++) a.push(sa[i]);
	for(int i=0;i<(int)sb.size();i++) b.push(sb[i]);
	for(int i=0;i<(int)sc.size();i++) c.push(sc[i]);
	char k='a';
	while(1){
		if(k=='a'){
			if(a.empty()){
				Ans='A';
				break;
			}
			else k=a.front();
			a.pop();
		}
		if(k=='b'){
			if(b.empty()){
				Ans='B';
				break;
			}
			else k=b.front();
			b.pop();
		}
		if(k=='c'){
			if(c.empty()){
				Ans='C';
				break;
			}
			else k=c.front();
			c.pop();
		}
	}
	cout<<(char)Ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
void init(){
    cin.tie(0);
    cin.sync_with_stdio(0);
}

int main() {
    init();
  long long n,sum=0;
  cin>>n;
  for(int i=1;i<=n;i++){
if(i%3!=0&&i%5!=0){
    sum+=i;
}






}
cout<<sum;
}

Measured memory_bytes: 3648
#!/usr/bin/env python
#-*- coding:utf-8 -*-

import sys
import math

gx = 0
gy = 0
th = 90

for s in sys.stdin:
    x, rot = map(int, s.split(','))
    gx += x * math.cos(th/180*math.pi)
    gy += x * math.sin(th/180*math.pi)
    th -= rot

print(int(gx))
print(int(gy))

Measured memory_bytes: 6852
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        // 入力
        long[] nr = Console.ReadLine().Split().Select(long.Parse).ToArray();

        // n < rのk乗の最小値を求める
        long k = 0;
        while (nr[0] >= Math.Pow(nr[1],k))
        {  
            k++;
        }

        Console.WriteLine(k);
    }
}

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

// UnionFindの実装
struct UnionFind {
    vector<int> data;
    UnionFind(int size) : data(size, -1) { }

    // 集合をマージする
    // すでに同じ集合ならfalseが返る
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if(x == y) return false;
        //要素数の少ない方を多い方に繋げる
        if(data.at(y) < data.at(x)) swap(x, y);
        data.at(x) += data.at(y);
        data.at(y) = x;
        return true;
    }

    // ある要素がどの集合に属しているかを答える
    int root(int x) {
        // 根に直接つなぎ直す
        return data.at(x) < 0 ? x : (data.at(x) = root(data.at(x)));
    }

    // ある集合の大きさを答える
    int size(int x) {
        return -data.at(root(x));
    }

    bool same(int x, int y) {
        x = root(x); y = root(y);
        return x == y;
    }
};

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(m, 0);
    vector<int> b(m, 0);

    for(int i = 0; i < m; ++i) {
        cin >> a.at(i) >> b.at(i);
        a.at(i)--; b.at(i)--;
    }

    int cnt = 0;
    for(int i = 0; i < m; ++i) {
        UnionFind tree(n);
        int ina = a.at(i);
        int inb = b.at(i);
        for(int j = 0; j < m; ++j) {
            if(i == j) continue;
            else {
                tree.merge(a.at(j), b.at(j));
            }
        }

        if(!tree.same(ina, inb)) cnt++;
    }

    cout << cnt << endl;
}

Measured memory_bytes: 256
# include <algorithm>
# include <cmath>
# include <iostream>
# include <map>
# include <queue>
# include <string>
# include <vector>

typedef long long ll;

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m; cin >> n >> m;
    vector<int> jobs[100010];
    for (int i = 0; i < n; i++) {
        int a, b; cin >> a >> b;
        jobs[a].push_back(b);
    }
    ll ans = 0;
    priority_queue<int> q;
    for (int d = 1; d <= m; d++) {
        for (auto& x : jobs[d]) {
            q.push(x);
        }
        if (q.size()) {
            ans += q.top();
            q.pop();
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5632
#include<bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define mod 1000000007
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
vector<vector<int> > d; 
ll power(ll a,int n){
  if(n==0)
    return 1;
  if((n%2)==0)
    return (power((a*a)%mod,n/2))%mod;
  else
    return (a*(power((a*a)%mod,n/2))%mod)%mod;    
}
double sqrt1(double a){
    double l=0;
    double h=a;
    double m;
    double ans;
    while((h-l)>=1e-8){
       m=(h+l)/2;
       if((m*m)<a){
             ans=m;
             l=m;
       }
       else if(m*m==a){
             ans=m;
             break;
       }
       else{
          h=m;
       }
    }
    return ans;
}
int main(){
FASTIO
string s;
cin>>s;
int q;
cin>>q;
int t;
int f;
char c;
string s1;
string s2;
bool is=true;
for(int i=0;i<q;i++){
    cin>>t;
    if(t==1){
      is=!is;
    }
    else{
       cin>>f>>c;
       if(is){
           if(f==1){
              s1+=c;
           }
           else{
               s2+=c;
           }
       }
       else{
           if(f==1){
              s2+=c;
           }
           else{
               s1+=c;
           }
       }
    }
}
string ans;
if(is){
    for(int i=s1.size()-1;i>=0;i--)
        ans+=s1[i];
     for(int i=0;i<s.size();i++)
         ans+=s[i];
     for(int i=0;i<s2.size();i++)
         ans+=s2[i];     
}
else{
   for(int i=s2.size()-1;i>=0;i--)
        ans+=s2[i];
     for(int i=s.size()-1;i>=0;i--)
         ans+=s[i];
     for(int i=0;i<s1.size();i++)
         ans+=s1[i];     
}
cout<<ans;
return 0;
}

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

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

  
  if(S=="AAA" || S=="BBB"){
      cout<<"No"<<endl;
    
   }else{
        cout<<"Yes"<<endl;
  }
  


}

Measured memory_bytes: 256
dic = {'A': set(['B', 'D']),
       'B': set(['A', 'C', 'E']),
       'C': set(['B', 'F']),
       'D': set(['A', 'E', 'G']),
       'E': set(['B', 'D', 'F', 'H']),
       'F': set(['C', 'E', 'I']),
       'G': set(['D', 'H']),
       'H': set(['E', 'G', 'I']),
       'I': set(['F', 'H'])
       }


def hitohude(string):
    pre_ch = string[0]
    for ch in string[1:]:
        if ch not in dic[pre_ch]:
            return False
        pre_ch = ch
    return True

for i in range(1000):
    string = raw_input()
    if hitohude(string):
        print string

Measured memory_bytes: 4256
import java.util.Scanner;


// 147_a
public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();

        String s = a + b + c >= 22 ? "bust" : "win";
        System.out.println(s);

    }

}


Measured memory_bytes: 21844
N,M = map(int,input().split(' '))
ABn = [ list(map(int,input().split(' '))) for _ in range(N)]
ABn.sort()
cnt = 0
ans = 0
for i in range(N):
    if cnt + ABn[i][1] < M:
         cnt += ABn[i][1]
         ans += ABn[i][1] * ABn[i][0]
    else:
        diff = M - cnt
        ans += diff * ABn[i][0]
        break
print(ans)

Measured memory_bytes: 61016
// Problem Code: abc177_d

#include <iostream>
#include <vector>
#include <functional>

using namespace std;

int friends(int N, int M, vector<vector<int>>& adj) {
	int len, max_len = 0;
	vector<bool> visited(N);
	
	// helper function
	function<void(int)> dfs = [&](int s) {
		visited[s] = true;
		max_len = max(++len, max_len);
		for (int& u: adj[s])
			if (!visited[u])
				dfs(u);
	};
	
	// visit each component
	for (int i = 0; i < N; i++)
		if (!visited[i]) {
			len = 0;
			dfs(i);
		}
	
	return max_len;
}

int main() {
	int N, M;
	cin >> N >> M;
	vector<vector<int>> adj(N);
	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;
		--A, --B;
		adj[A].push_back(B);
		adj[B].push_back(A);
	}
	cout << friends(N, M, adj);
	return 0;
}

Measured memory_bytes: 26576
#include<stdio.h>
int main(){
  int n,q,S[10000],T[500],i,j,cnt=0;
  scanf("%d",&n);
  for(i=0;i<=n-1;i++) scanf("%d",&S[i]);
  scanf("%d",&q);
  for(i=0;i<=q-1;i++) scanf("%d",&T[i]);
  
  for(i=0;i<=q-1;i++){
    for(j=0;j<=n-1;j++){
      if(S[j]==T[i])break;
	
      
    }
     if(S[j]==T[i])cnt++;
  }
 
  printf("%d\n",cnt);
  return 0;
}



Measured memory_bytes: 2048
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll N,D; cin >> N >> D;
    
    for(int i = 0; i < N;i++){
        ll x,y; cin >> x >> y;
        
        if((x*x + y*y) <= D*D) res++;
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <cstdio>
#include <algorithm>
using namespace std;
int p[200005],a[200005];
int main()
{
 int n,ans=0;
 scanf("%d",&n);
 a[0]=n+1;
 for(int i=1;i<=n;i++)
 {
  scanf("%d",&p[i]);
  a[i]=min(a[i-1],p[i]);
  ans+=(a[i]==p[i]);
 }
 printf("%d\n",ans);
 return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int cnt[2][26];
int n[2];
int store[2][26];
int main() {
    string s[2];
    cin >> s[0];
    cin >> s[1];
    if (s[0]==s[1]) {
        cout << "Yes\n";
        return 0;
    }
    int len=s[0].length();
    for (int i =0;i<2;i++){
        for (int j=0;j<len;j++){
            cnt[i][s[i][j]-'a']++;
        }
    }
    for (int i=0;i<2;i++) {
        for (int j=0;j<26;j++){
            if (cnt[i][j]) {
                store[i][n[i]]=cnt[i][j];
                n[i]++;
            }
        }
    }
    if (n[0]!=n[1]) {
        cout << "No\n";
        return 0;
    }
    sort(store[0],store[0]+n[0]);
    sort(store[1],store[1]+n[1]);
    for(int i=0;i<n[0];i++) {
        if (store[0][i] != store[1][i]) {
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
    return 0;
}


Measured memory_bytes: 776
#include<bits/stdc++.h>
using namespace std;
int main(){
	long n; cin>>n;
	vector<long> a(n);
	for(int i=0;i<n;i++)
		cin>>a[i];
	long x=a[0],s=a[0];
	long b=0,r=1;
	for(int i=1;i<n;i++){
		x^=a[i],s+=a[i];
		if(x!=s){
			do{
				x^=a[b],s-=a[b];
				b++;
			}while(x!=s);
		}
		r+=i-b+1;
	}
	cout<<r;
}

Measured memory_bytes: 1792
#include <set>
#include <cstdio>
int i,n,v[9999];main(){for(;scanf("%d",&n),n;){std::set<int>t;for(i=1;i<n;i++)v[i]=0,t.insert(i*i%n);for(auto s=t.begin(),S=s,T=t.end();s!=T;S=++s)for(;++S!=T;v[i>n/2?n-i:i]+=2)i=*S-*s;for(i=1;i<=n/2;i++)printf("%d\n",v[i]);}}

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

int main(){
	int s;
	int h;
	int m;
	cin >> s;
	h= s/3600;
	m= (s%3600)/60;
	s= s % 60;
	cout << h <<":"<< m <<":"<< s << endl;
	return 0;
}



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


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

struct edge {int to; ll cost; };

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

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

ll LCM(ll a, ll b){
  if(a<b) swap(a,b);
  return a/GCD(a,b)*b;
}
 
int main(){
  int n, k;
  cin >> n >> k;
  int ans = 0;
  while(n>0){
    n /= k;
    ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	char c;
	cin>>c;
	if((int)c>=97 && (int)c<=122)cout<<"a\n";
	else cout<<"A\n";
	return 0;
}

Measured memory_bytes: 3688
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
  int N , K;
  cin>>N>>K;
  vector<int> date(N);
  for(int i=0;i<N;i++){
    cin>>date[i];
  }
  sort(date.begin(),date.end());
  int ans=0;
  for(int i=0;i<K;i++){
    ans+=date[N-1-i];
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <fstream>

using namespace std;
int main() {
	string s;
	int countjoi = 0, countioi = 0;
	while (cin >> s) {
		for (int i = 0; i < s.length() - 2; i++) {
			if (s[i] == 'J' && s[i + 1] == 'O' && s[i + 2] == 'I') countjoi++;
			if (s[i] == 'I' && s[i + 1] == 'O' && s[i + 2] == 'I') countioi++;
		}
		cout << countjoi << endl << countioi << endl;
		countjoi = 0; countioi = 0;
	}
	return 0;
}

Measured memory_bytes: 3112
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[] deque = new int[n];
      for(int i = 0; i < n; i++)
        deque[i] = sc.nextInt();

      int maxSum = 0;

      for(int i = 0; i <= Math.min(k, n); i++) {
        for(int j = 0; j + i <= Math.min(k, n); j++) {
          int curSum = 0;
          PriorityQueue<Integer> minHeap = new PriorityQueue<>();
          for(int a = 0; a < i; a++){
            curSum += deque[a];
            minHeap.offer(deque[a]);
          }
          for(int b = 0; b < j; b++){
            curSum += deque[n - 1 - b];
            minHeap.offer(deque[n - 1 - b]);
          }
          int restK = k - i - j;
          while(!minHeap.isEmpty() && minHeap.peek() < 0 && restK > 0) {
            curSum -= minHeap.poll();
            restK--;
          }
          maxSum = Math.max(maxSum, curSum);
        }
      }

      System.out.println(maxSum);
  }

}

Measured memory_bytes: 24020
//
//  main.c
//  Pablo Squarson's Headache
//
//  Created by x15071xx on 2016/06/03.
//  Copyright ?? 2016??´ AIT. All rights reserved.
//

#include <stdio.h>

int main(int argc, const char * argv[]) {
    
    int canvas[400][400]={0},position[200][2];
    int i,j,n=0,w=0,h=0,ni,di;

    
    while (1) {
        
        
        
        
        scanf("%d ",&n);
        if (n==0) {
            break;
        }
        canvas[199][199] = 1;
        //height width
        position[0][0]=199;position[0][1]=199;
        for (i=1; i<n; i++) {
            scanf("%d %d",&ni,&di);
            if (di==0) { //left
                canvas[position[ni][0]][position[ni][1]-1] = 1;
                position[i][0] = position[ni][0];
                position[i][1] = position[ni][1]-1;
            } else if (di==1) {//bottom
                canvas[position[ni][0]+1][position[ni][1]] = 1;
                position[i][0] = position[ni][0]+1;
                position[i][1] = position[ni][1];
            } else if (di==2) {//right
                canvas[position[ni][0]][position[ni][1]+1] = 1;
                position[i][0] = position[ni][0];
                position[i][1] = position[ni][1]+1;
            } else if (di==3) {//top
                canvas[position[ni][0]-1][position[ni][1]] = 1;
                position[i][0] = position[ni][0]-1;
                position[i][1] = position[ni][1];
            }
        }
        //width
        for (i=0; i<400; i++) {
            for (j=0; j<400; j++) {
                if (canvas[i][j] == 1) {
                    h++;
                    //printf("%d %d",i,j);
                    break;
                }
            }
        }
        //height
        for (i=0; i<400; i++) {
            for (j=0; j<400; j++) {
                if (canvas[j][i] == 1) {
                    w++;
                    break;
                }
            }
        }
        
        printf("%d %d\n",w,h);
        w=0;
        h=0;
        for (i=0;i<200 ; i++) {
            position[i][0]=0;
            position[i][1]=0;
        }
        for (i=0; i<300; i++) {
            for (j=0; j<300; j++) {
                canvas[i][j]=0;
                
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1236
#include <stdio.h>
#include <string.h>
const int Max = 100000+50;
int a[Max];
int ss[Max];
int isprime()
{
	int i,j;
	memset(a,0,sizeof(a));
	a[0]=1;
	a[1]=1;
	for(i=2;i<Max;i++)
	{
		if(a[i])
		{
			continue;
		} 
		for(j=i*2;j<Max;j+=i)
		{
			a[j]=1;
		}
	} 
}
int main(int argc, char *argv[])
{
	isprime();
	ss[0]=ss[1]=0;
	for(int i=2;i<Max;i++)
	{
		ss[i]=ss[i-1];
		if(!a[i]&&!a[(i+1)/2])
		{
			ss[i]++;
		}
	}
	int cases;
	scanf("%d",&cases);
	while(cases--)
	{
		int n,m;
		scanf("%d%d",&n,&m);
		int sum=0;
		if(n==m&&!a[n]&&!a[(n+1)/2])
		{
			printf("1\n");
			continue;
		}
		int t=0;
		if(!a[n]&&!a[(n+1)/2])
			t++;
		printf("%d\n",ss[m]-ss[n]+t);
	}
	return 0;
}


Measured memory_bytes: 1280
using System;
    class Program
    {
        static void Main(string[] args)
        {
            string[] st = Console.ReadLine().Split();
            int k = int.Parse(st[0]);
            int s = int.Parse(st[1]);
            int ans = 0;
            for(int x = 0; x <= k; x++)
            {
                for(int y = 0; y <= k; y++)
                {
                    if(s - (x + y) <= k && s - (x + y) >= 0)
                    {
                        ans += 1;
                    }
                }
            }
            Console.WriteLine(ans);
        }
    }

Measured memory_bytes: 13140
/// In the name of ALLAH
/// I'm THEOVE46
#include<bits/stdc++.h>
using namespace std;

#define gap             " "
#define nn              "\n"
#define pi              2*acos(0.0)
#define db              double
#define ft              float
#define ll              long long int
#define ull             unsigned long long int
#define pf              printf
#define sf              scanf
#define ff              first
#define ss              second
#define sfi(n)          sf("%d",&n)
#define sfi2(n, m)      sf("%d%d",&n,&m)
#define sfl(n)          sf("%lld",&n)
#define sfl2(n, m)      sf("%lld%lld",&n,&m)
#define sff(n)          sf("%f",&n)
#define sfd(n)          sf("%lf",&n)
#define pfi(n)          pf("%d",n)
#define pfl(n)          pf("%lld",n)
#define pff(n)          pf("%f",f)
#define pfd(n)          pf("%lf",f)
#define bfi             cin.ignore()
#define bfs             cin.get()
#define bfc             getchar()
#define gl(s)           getline(cin, s)
#define loop(a,n)       for(i=a; i<n; i++)
#define mloop(i,a,n)    for(i=a; i<n; i++)
#define rloop(i,a,n)    for(i=a; i>=n; i--)
#define tloop(test)     for(ll tl=1; tl<=test; tl++)
#define case1(z)        cout<<"Case "<<z<<": "
#define case2(z)        printf("Case %d: ",z)
#define vi              vector<int>
#define vl              vector<ll>
#define vld(vc,rw)      vector<vector<ll> >vc(rw)
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define pis             pair<int,string>
#define psi             pair<string,int>
#define mls             map <ll,string>
#define msl             map <string,ll>
#define mll             map <ll,ll>
#define mp              make_pair
#define pb              push_back
#define itr             vector<int> :: iterator
#define atl(i, v)       for(auto i: v)
#define sz(s)           s.size()
#define sl(s)           s.length()
#define Sort(s)         sort(s.begin(), s.end())
#define SortR(s)        sort(s.rbegin(), s.rend())
#define all(x)          x.begin(),x.end()
#define rall(x)         x.end(), x.begin()
#define MEM(ar,val)     memset(ar, (val), sizeof(ar))
#define IN(A,B,C)       assert(B<=A && A<=C)
#define MOD             1000000007
#define EPS             1e-9
#define Max             1e9
#define Min             -1e9
#define bug1            "**1**"
#define bug2            "****2****"
#define artri(b,h)      0.5*b*h
#define artrap(b1,b2,h) (b1+b2)/2*h
#define arcrl(r)        pi*r*r
#define vlsyl(r,h)      pi*r*r*h
#define vlcone(r,h)     pi*r*r*(h/3)
#define vlsph(r)        (4/3)*pi*r*r*r
#define flush           fflush(stdout)
#define pcn(dg,val)     fixed << setprecision(dg) << val
#define ggl             pf("Case #%lld: ", tl)
#define FastIO          ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define showsort(n, a)  for(int i=0; i<n; i++) cout << a[i] << gap; cout << endl;

///THEOVE46

int main()
{
    //FastIO;
    ll l, r, d, x=0, i, j;
    cin >> l >> r >> d;
    loop(l, r+1)
        if(i%d==0) x++;
    cout << x << endl;
    return 0;
}

///   check for integer overflow, array bounds
///   check for n=1
///   - - - The Ove 46



Measured memory_bytes: 3592
# ほんとうに全ての値を最初に計算し、累積和のリストを作成してしまおう。
# 計算時間は421msでOKだけど、答えが間違っている。＝＞なおした

import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


# 2017に似た数

def is_like2017(n):
    if is_prime(n) and is_prime((n+1)//2):
        return True
    else:
        return False


Q = int(input())

l_list = [0]*Q
r_list = [0]*Q

for i in range(Q):
    l_list[i], r_list[i] = map(int, input().split())
    

ans = [0]

for i in range(1, 100000+1):
    if i % 2 == 0:
        ans.append(ans[i-1])
    elif is_like2017(i):
        ans.append(ans[i-1] + 1)
    else:
        ans.append(ans[i-1])    
        
for i in range(Q):
    print(ans[r_list[i]]-ans[l_list[i]-1])
   


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

using namespace std;

void init(char *c){
    for(int i = 0; i < 3 ; i++){
        c[i] = '+';
    }
}

int main(){

    string s;cin >> s;
    char c[3];
    int ans;
    
    
    for(int i = 0; i < (1 << 3) ; i++){
        init(c);
        ans = s[0]-'0';
        for(int j = 0; j < 3 ; j++){
            if(i & (1 << j)){
                c[j] = '-';
                ans -= s[j+1] - '0'; 
            }else{
                ans += s[j+1] - '0';
            }
        }
        if(ans == 7){
            break;
        }
    }
    for(int i = 0; i < 3 ; i++){
        cout << s[i];
        cout << c[i];
    }
    cout << s[3];
    cout << "=7" << endl;
    //cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#Card Game for Three (ABC Edit)
SA = input()
SB = input()
SC = input()
turn = "a"
while min(len(SA), len(SB), len(SC)) >= 0:
    if turn == "a":
        if len(SA) == 0:
            print("A")
            break
        else:
            turn = SA[0]
            SA = SA[1:]
    elif turn == "b":
        if len(SB) == 0:
            print("B")
            break
        else:
            turn = SB[0]
            SB = SB[1:]
    else:
        if len(SC) == 0:
            print("C")
            break
        else:
            turn = SC[0]
            SC = SC[1:]

Measured memory_bytes: 3064
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 4e2 + 10;
LL cnt[N];
int dp[2][N];
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string str;
	cin >> str;
	int ans = INF;
	for (int i = 0; i + 3 <= str.length(); i++)
	{
		ans = min(abs(stoi(str.substr(i, 3)) - 753), ans);
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

const int N = 110;

int n, m, d, Mod;
int f[N][N][N], g[N][N][N];
int cf[N][N][N], cg[N][N][N];
int C[N][N];

int add(int a, int b) {
  return (a += b) >= Mod ? a - Mod : a;
}

int sub(int a, int b) {
  return (a -= b) < 0 ? a + Mod : a;
}

int mul(int a, int b) {
  return 1ll * a * b % Mod;
}

int fast_pow(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = mul(a, a)) {
    if (b & 1) res = mul(res, a);
  }
  return res;
}

void upd(int &a, int b) {
  a = add(a, b);
}

void init() {
  for (int i = 0; i <= 100; i++) C[i][0] = 1;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= i; j++) {
      C[i][j] = add(C[i - 1][j], C[i - 1][j - 1]);
    }
  }
  for (int k = 1; k <= d; k++) {
    for (int i = 0; i <= m; i++) {
      for (int j = 0; j <= n; j++) {
        int tmp = sub(fast_pow(k, m - i), fast_pow(k - 1, m - i));
        cf[k][i][j] = fast_pow(mul(tmp, fast_pow(d - k + 1, i)), j);
      }
    }
  }
  for (int k = 1; k <= d; k++) {
    for (int i = 0; i <= n; i++) {
      for (int j = 0; j <= m; j++) {
        int tmp = sub(fast_pow(d - k + 1, i), fast_pow(d - k, i));
        cg[k][i][j] = fast_pow(mul(tmp, fast_pow(k, n - i)), j);
      }
    }
  }
}

int main() {
  cin >> n >> m >> d >> Mod;
  init();
  f[1][0][0] = 1;
  for (int k = 1; k <= d; k++) {
    for (int i = 0; i <= n; i++) {
      for (int j = 0; j <= m; j++) {
        int tmp = f[k][i][j];
        for (int p = 0; i + p <= n; p++) {
          upd(g[k][i + p][j], mul(tmp, mul(C[n - i][p], cf[k][j][p])));
        }
        tmp = g[k][i][j];
        for (int p = 0; j + p <= m; p++) {
          upd(f[k + 1][i][j + p], mul(tmp, mul(C[m - j][p], cg[k][i][p])));
        }
      }
    }
  }
  cout << f[d + 1][n][m] << endl;
  return 0;
}


Measured memory_bytes: 20736
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m;
  cin >> n >> m;
  vector<int> k(n);
  vector<int> cnt(m);
  int temp;
  for(int i=0;i<n;i++){
    cin >> k.at(i);
    for(int j=0;j<k.at(i);j++){
      cin >> temp;
      cnt.at(temp - 1) += 1;
    }
  }

  int sum = 0;
  for(int i=0;i<m;i++)
    if(cnt.at(i) == n)
      sum += 1;

  cout << sum << endl;
}


Measured memory_bytes: 384
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    ll n; cin>>n;
    vector<ll> x(n+2,0);
    x[0]=-INF; x.back()=INF;
    rep(i,n) cin>>x[i+1];
    ll L; cin>>L;
    vector<vector<ll>> dl_l(20,vector<ll>(n,0));
    vector<vector<ll>> dl_r(20,vector<ll>(n,0));
    
    rep(i,n){
        ll l=i+1,r=n+1,c;
        while(l!=r){
            c=(l+r+1)/2;
            if(x[c]<=x[i+1]+L) l=c;
            else r=c-1;
        }
        
        dl_l[0][i]=l-1;
        l=0,r=i+1;
        while(l!=r){
            c=(l+r)/2;
            if(x[c]>=x[i+1]-L) r=c;
            else l=c+1;
        }
        dl_r[0][i]=l-1;
    }
    for(int i=1;i<20;i++)rep(j,n){
        dl_l[i][j]=dl_l[i-1][dl_l[i-1][j]];
        dl_r[i][j]=dl_r[i-1][dl_r[i-1][j]];
    }
    ll q; cin>>q;
    rep(i,q){
        ll a,b,cur,ans=0,c; cin>>a>>b;
        a--; b--;
        cur=a;
        if(a<b){
            while(cur<b){
                c=1;
                rep(i,20){
                    if(dl_l[i][cur]>=b){
                        if(i){
                            cur=dl_l[i-1][cur];
                            ans+=c/2;
                        }
                        else{
                            cur=dl_l[0][cur];
                            ans++;
                        }
                        break;
                    }
                    c*=2;
                }
            }
        }
        else{
            while(cur>b){
                c=1;
                rep(i,20){
                    if(dl_r[i][cur]<=b){
                        if(i){
                            cur=dl_r[i-1][cur];
                            ans+=c/2;
                        }
                        else{
                            cur=dl_r[0][cur];
                            ans++;
                        }
                        break;
                    }
                    c*=2;
                }
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 36228
package main

import (
	"fmt"
)

func printRec(h, w int) {
	for i := 0; i < h; i++ {
		for j := 0; j < w; j++ {
			fmt.Printf("#")
		}
		fmt.Printf("\n")
	}
	fmt.Printf("\n")
}

func main() {
	var h, w int
	for {
		fmt.Scan(&h, &w)
		if h == w && h == 0 {
			break
		}
		printRec(h, w)
	}
}



Measured memory_bytes: 1100
n = int(input())
lis = list(map(int, input().split()))

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if lis[i]+lis[j] > lis[k] and lis[j]+lis[k] > lis[i] and lis[k]+ lis[i]>lis[j] and lis[i] != lis[j] and lis[j] != lis[k] and lis[k] != lis[i]:
                ans += 1

print(ans)

Measured memory_bytes: 9200
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

N = input()
K = getN()
L = len(N)

def judge(a):
    return a == 0

# N以下の数字で条件を満たす桁がk個のもの
def digit_dp(n, k):
    l = len(n)

    dp = [[[0] * (k + 1) for _ in range(2)] for i in range(l + 1)]
    dp[0][0][0] = 1

    for i in range(l):
        d = int(n[i])

        for j in range(2):
            for d_j in range(10 if j else d + 1):
                for k_j in range(k + 1):
                    # 0じゃない数字が混じっていれば数字は進む
                    if not judge(d_j):
                        # 求めたい個数以下なら
                        if k_j + 1 <= k:
                            dp[i + 1][j | (d_j < d)][k_j + 1] += dp[i][j][k_j]
                    else:
                        dp[i + 1][j | (d_j < d)][k_j] += dp[i][j][k_j]

    return dp[l][0][k] + dp[l][1][k]

print(digit_dp(N, K))

Measured memory_bytes: 78584
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[3][3],b[10];
    for(int i=0;i<3;++i)
        for(int j=0;j<3;++j)
        cin>>a[i][j];
    map<int,int>m;
    int n,k;
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>b[i];
        m[b[i]]=1;
    }
    int count=0;
    for(int i=0;i<3;++i){
        if(m[a[i][0]]&&m[a[i][1]]&&m[a[i][2]])
            count++;
    }
    for(int j=0;j<3;++j){
        if(m[a[0][j]]&&m[a[1][j]]&&m[a[2][j]])
            count++;
    }
    if(m[a[0][0]]&&m[a[1][1]]&&m[a[2][2]])
        count++;
    else if(m[a[0][2]]&&m[a[1][1]]&&m[a[2][0]])
        count++;

    if(count!=0) cout<<"Yes";
    else cout<<"No";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }     //最小公倍数
using Graph = vector<vector<int>>;
ll inf=300000000000000000;
const double PI = 3.14159265358979323846;
int binary(vector<ll> &a,ll k,int l,int r){
  if(a[0]>k)return 0;
  int mid=(l+r)/2;
  //cout << l << " " << r << " " << mid << endl;
  if(l==mid)return 1+l;
  if(a[mid]<=k)return binary(a,k,mid,r);
  else return binary(a,k,l,mid);
}
int main(){
  ll n,m,k;
  cin >> n >> m >> k;
  vector<ll> a(n+1);
  vector<ll> b(m+1);
  rep(i,n)cin >> a[i];
  rep(i,m)cin >> b[i];
  a[n]=inf;
  b[m]=inf;
  int l=0;
  int r=0;
  int ans=0;
  rep(i,n)a[i+1]+=a[i];
  rep(i,m)b[i+1]+=b[i];
  rep(i,m+1){
    if(i==0)ans=max(ans,binary(a,k,0,n));
    else if(k-b[i-1]>=0){
      ans=max(ans,i+binary(a,k-b[i-1],0,n));
      //cout << i << " " << binary(a,k-b[i-1],0,n) << endl;
    }
    
  }
  cout << ans << endl;
  /*ll c[n+m];
  rep(i,n+m){
    if(a[l]<b[r]){
      c[i]=a[l];
      l++;
    }
    else{
      c[i]=b[r];
      r++;
    }
  }
  rep(i,n+m-1)c[i+1]+=c[i];
  if(k<c[0]){
    cout << 0 << endl;
    return 0;
  }
  if(c[n+m-1]<=k){
    cout << n+m << endl;
    return 0;
  }
  int x=0;
  while(c[x]<=k)x++;
  cout << x << endl;*/
}


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

int main(void)
{
    IOS
    int n; cin >> n;
    vector<vector<int>> v(2,vector<int>(n));

    REP(i,2) REP(j,n) cin >> v[i][j];
    int cnt = accumulate(v[1].begin(),v[1].end(),0) + v[0][0];
    int ans = cnt;
    REP(i,n-1) {
        cnt = cnt + v[0][i+1] - v[1][i];
        ans = max(cnt,ans);
    }

    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007


int main(){
	int a, b;
	scanf("%d%d", &a, &b);
	int lar, sma;
	if(a>b){
		lar = a;
		sma = b;
	}
	else{
		lar = b;
		sma = a;
	}
	char c = sma + '0';
	for(int i=0; i<lar; i++){
		printf("%c", c);
	}
	printf("\n");
	//printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
using namespace std;
int main() {
	int n, N = 0,nc=0;
	string s;
	cin >> n >> s;
	for (int x = 0; x < n; ++x) {
		if (s[x] == 'I') nc = nc + 1;
		else if (s[x] == 'D') nc = nc - 1;
		if (N < nc)N = nc;

	}
	cout << N << endl;

}


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


int main() {
int N,K,J;
  cin>>N>>K;
  J=1;
  int K2=K;
  for(int i=0;i<100;i++){
    if(K2>N){
     break; 
    }
    K2 *=K; 
    J++;
    
}
  cout<<J<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <deque>
#include <queue>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <iomanip>
#include <utility>
#include <functional>
using namespace std;
#define ll long long
#define ull unsigned ll
/*Fast I/O goes here*/
const double EPS = 1e-8;
const ll PR = 19260817;
const ll inv2 = 500000004;
const ll inv3 = 333333336;
int main() {
	string s;
	cin>>s;
	if(s.length()>=4&&s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I') puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 384
#include<bits//stdc++.h>
using namespace std;
const int dx[] = { 1, -1, 4, -4};
#define fr first
#define sc second
typedef pair < string , int > sPi;
string s;int now;
map< string , int > used;
int bfs(){
  queue< sPi > q;
  q.push(sPi("01234567",0));
  used["01234567"] = 1;
  while(!q.empty()){
    sPi p = q.front();
    q.pop();
    for(int i = 0 ; i < 4 ; i++){
      string next = p.fr;
      if(0 <= p.sc+dx[i] && p.sc+dx[i] < 8 && !(p.sc==3&&!i) && !(p.sc==4&&i==1)){
        swap(next[p.sc],next[p.sc + dx[i]]);
        if(!used[next]){
          used[next] = used[p.fr] + 1;
          q.push(sPi(next,p.sc+dx[i]));
        }
      }
    }
  }
  return -1;
}
int main(){
  s.resize(8); bfs();
  while(cin >> s[0] >> s[1] >> s[2] >> s[3] >> s[4] >> s[5] >> s[6] >> s[7]){
    cout << used[s] - 1 << endl;
  }
}


Measured memory_bytes: 5264
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>
#include <cstring>

using namespace std;

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

typedef pair<int, int> P;
#define mp make_pair
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort((v).begin(), (v).end());					//小さい順
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());		//大きい順
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define F first
#define S second
#define pb push_back
#define mod 1000000007LL
#define INF 12345678901234567

const int maxn = 1e5 + 10;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	// your code is here
	
	ll x; cin >> x;

	ll sum = 0;
	ll count = 0;
	while (sum < x)
	{
		count++;
		sum += count;
	}
	Print(count);
	return 0;

}

Measured memory_bytes: 256
#include <stdio.h>

int p[20005];
int a[20005];
int b[20005];

int main() {

	int N;

	scanf("%d",&N);

	int i;

	for (i = 0; i < N; i++) {
		scanf(" %d",&p[i]);
		a[i] = N*(i + 1);
		b[N - 1 - i] = a[i];
	}
	for (i = 0; i < N; i++) {
		a[p[i] - 1] += i;
	}
	for (i = 0; i < N-1; i++) {
		printf("%d ",a[i]);
	}
	printf("%d\n",a[N-1]);
	for (i = 0; i < N - 1; i++) {
		printf("%d ", b[i]);
	}
	printf("%d\n", b[N - 1]);

	return 0;
}

Measured memory_bytes: 768
#include<iostream>
#include<cstring>

using namespace std ;

int len ;

string s ;

int main(){

	cin >> s ;
	 
	len = s.length() ;
	
	for(int i = 0 ; i < len ; i++ ){
		if(s[i] == 'C'){
			for(int j = i ; j < len ; j++ ){
				if(s[j] == 'F'){
					cout << "Yes" ;
					return 0 ;
				}
			}
		}
	}
	
	cout << "No" ;

	return 0 ;

}


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

int main()
{
    vector<int> T(5), suf(5);
    for (int i = 0; i < 5; i++) {
        cin >> T[i];
        suf[i] = T[i] % 10;
    }
    sort(suf.begin(), suf.end());

    int g;
    int res = 0;
    for (int i = 0; i < 5; i++) {
        if (suf[i] != 0) {
            g = suf[i];
            break;
        }
    }

    int temp = 0;
    for (int i = 0; i < 5; i++) {
        if (g != T[i] % 10 || temp != 0) {
            res += T[i];
            if (T[i] % 10 != 0) {
                res += (10 - T[i] % 10);
            }
        }
        else {
            temp = T[i];
        }
    }
    res += temp;

    cout << res << endl;
}

Measured memory_bytes: 256
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
n,m,k = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)
b = gets.chomp.split.map(&:to_i)

acusum = Array.new(n+1)
bcusum = Array.new(m+1)

acusum[0] = 0
bcusum[0] = 0

1.upto(n) do |i|
  acusum[i] = acusum[i-1] + a[i-1]
end
1.upto(m) do |i|
  bcusum[i] = bcusum[i-1] + b[i-1]
end

ans = 0
i = n
j = 0

num = acusum[i] + bcusum[j]
while num > k
  i -= 1
  num = acusum[i] + bcusum[j]
end

while 0 <= i
  while j < m && acusum[i] + bcusum[j+1] <= k
    j += 1
  end
  # p [i,j, i+j]
  ans = [ans, i + j].max

  i -= 1
end

puts ans




Measured memory_bytes: 48980
#n = int(input())
#m = int(input())
#k = int(input())
#n, m = map(int, input().split())
#n, m, k = map(int, input().split())
#a = list(map(int, input().split()))
#table = []
'''
for i in range h:
    temp = list(map(int, input().split()))
    table.append(temp)
'''
x, a = map(int, input().split())
if x < a:
    print(0)
else:
    print(10)

Measured memory_bytes: 2940