akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    ll A;
    double B;
    cin >> A >> B;
    cout << (A*(B*100))/100 << endl;
}

Measured memory_bytes: 3692
#include <iostream>
#include <algorithm>

int GCD[220][220];
int main(){
    int k;
    std::cin >> k;
    for(int i = 1; i <= k; i++){
        for(int j = i; j <= k; j++){
            GCD[i][j] = std::__gcd(i, j);
            GCD[j][i] = GCD[i][j];
        }
    }
    long long ans = 0;
    for(int a = 1; a <= k; a++){
        for(int b = 1; b <= k; b++){
            for(int c = 1; c <= k; c++){
                ans += GCD[GCD[a][b]][c];
            }
        }
    }
    std::cout << ans << std::endl;
}


Measured memory_bytes: 3728
from fractions import gcd
n = int(input())
yakusuu = set()
ans = set()
for i in range(1, int((n-1)**(1/2))+1):
    if (n-1) % i == 0:
        yakusuu.add(i)
        yakusuu.add((n-1)//i)

for i in range(1, int(n**(1/2))+1):
    if n % i == 0:
        yakusuu.add(i)
        yakusuu.add(n//i)
yakusuu.remove(1)



for i in yakusuu:
    k = n
    if gcd(i, k) == 1:
        if k % i == 1:
            ans.add(i)
        continue

    k = n
    while k >= i:
        if k % i == 0:
            k //= i
        else:
            if k % i == 1:
                k = 1
            else:
                k = 0
    if k == 1:
        ans.add(i)

print(len(ans))


Measured memory_bytes: 66792
import sys
N=int(input())


a=list(map(int,input().split()))
if N==2:
    print(abs(a[0]-a[1]))
    print(max(a),min(a))
    sys.exit()

a.sort()
if a[0]>=0:
    print(sum(a)-2*a[0])
    z=a[0]
    for i in range(1,N-1):
        print(z,a[i])
        z-=a[i]

    print(a[N-1],z)
elif a[N-1]<0:
    ans=[]
    for i in range(N-1):
        ans.append([a[N-1],a[i]])
        a[N-1]-=a[i]
    print(a[N-1])
    for i in range(N-1):
        print(ans[i][0],ans[i][1])

else: 
    ans=[]
    for i in range(1,N-1):
        if a[i]<0:
            ans.append([a[N-1],a[i]])
            a[N-1]-=a[i]
        else:
            ans.append([a[0],a[i]])
            a[0]-=a[i]
    
    ans.append([a[N-1],a[0]])
    print(a[N-1]-a[0])
    for i in range(N-1):
        print(ans[i][0],ans[i][1])

Measured memory_bytes: 22340
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,x,l[101];
	cin>>n>>x;
	for(int i=0;i<n;i++)
		cin>>l[i];
	l[n]=1e9;
	int sum=0;
	for(int i=0;i<=n;i++){
		sum+=l[i];
		if(sum>x){
			cout<<i+1<<endl;
			return 0;
		}
	}
}


Measured memory_bytes: 256
# include<iostream>
using namespace std;
int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int cnt_day=0, cnt_coin=0, conte=1;

    while(true){
        if(conte % 7 == 0){conte=1; cnt_coin+=(a+b);}
        else {cnt_coin+=a; conte++;}
        cnt_day++;
        if(cnt_coin>=c) break;
    } 
    cout << cnt_day <<"\n";
    return 0;
}


Measured memory_bytes: 3112
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define N 505
int pos[N],id[N],ans[N*N];
bool cmp(int x,int y){return pos[x]<pos[y];}
int main()
{
	int n,i,j,k,x;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&pos[i]);
		id[i]=i;ans[pos[i]]=i;
	}
	sort(id+1,id+n+1,cmp);
	k=1;
	for(i=1;i<=n;i++){
		x=id[i];
		for(j=1;j<x;j++){
			while(ans[k])k++;
			if(k>pos[x]){printf("No\n");return 0;}
			ans[k]=x;
		}
	}
	for(i=1;i<=n;i++){
		x=id[i];
		for(j=x+1;j<=n;j++){
			while(ans[k])k++;
			if(k<pos[x]){printf("No\n");return 0;}
			ans[k]=x;
		}
	}
	printf("Yes\n%d",ans[1]);
	for(i=2;i<=n*n;i++)
		printf(" %d",ans[i]);
}

Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define lint long long
#define P pair<int, int>

int main(){
    lint K, A, B;
    
    cin >> K >> A >> B;
    
    lint ans = 1;
    
    if(K < A){
        cout << K + 1 << endl;
        return 0;
    }
    
    if(A >= B - 1){
        cout << K + 1 << endl;
        return 0;
    }
    
    K -= A - 1;
    ans = A;
    
    if(K % 2 == 0){
        cout << ans + (B - A) * (K / 2) << endl;
    } else {
        cout << ans + (B - A) * (K / 2) + 1 << endl;
    }
}

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

int main(void) {
	while (1) {
		int x, y;
		cin >> x >> y;
		if (x == 0 && y == 0) break;
		if (x > y) {
			int tmp = x;
			x = y;
			y = tmp;
		}
		cout << x << " " << y << endl;
	}
	return 0;
}



Measured memory_bytes: 3092
#include <bits/stdc++.h>
//#include <atcoder/fenwicktree>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
//#define _GLIBCXX_DEBUG

using ll = long long;
using ull = unsigned long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll mod = 1e9+7;
void chmod(ll &M){
  if(M >= mod) M %= mod;
  else if(M < 0){
     M += (abs(M)/mod + 1)*mod;
    M %= mod;
}
}
ll modpow(ll x, ll n){
   if(n==0) return 1;
  ll res=modpow(x, n/2);
 if(n%2==0) return res*res%mod;
else return res*res%mod*x%mod;
}
int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  else return GCD(b, a % b);
}

using namespace std;
int main()
{
    int N;
    cin >> N;
    vector<int> A;
    rep(i, N) {
        int a;
        cin >> a;
        if(a % 2 == 0) A.push_back(a);
    }
        bool check = true;
        rep(i, A.size()) {
            if(A.at(i)%3!=0 and A.at(i)%5!=0) {
                check = false; break;
            }
        }
    if(check) cout << "APPROVED" << "\n";
    else cout << "DENIED" << "\n";

    

}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 2;
int N;

void solve() {
    cin >> N;
    vector<int> A(N+1, 0);
    for (int i = 0; i < N; ++i) {
        cin >> A[i+1];
    }

    int m = 0;
    vector<int> B(N+1, 0);
    for (int i = N; i >= 1; --i) {
        int a = A[i];
        int s = 0;
        for (int j = 2 * i; j <= N; j += i) {
            s += B[j];
        }
        if (s % 2 != a) {
            ++m;
            B[i] += 1;
        }
    }
    cout << m << endl;
    if (m > 0) {
        for (int i = 1; i <= N; ++i) {
            if (B[i] == 1) {
                printf("%d ", i);
            }
        }
        cout << endl;
    }
}

int main() {
    solve();
    return 0;
}


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

int main() {
  int K;
  cin >> K;
  vector<int64_t> numbers(9);
  iota(numbers.begin(), numbers.end(), 1);
  auto numlen = [](int64_t n) {
    return to_string(n).size();
  };
  auto dsum = [](int64_t n) {
    int64_t sum = 0;
    while (n > 0) {
      sum += n % 10;
      n /= 10;
    }
    return sum;
  };
  while ((int)numbers.size() < K) {
    int64_t last = numbers.back();
    int64_t bound = last + 1;
    int64_t cans = bound;
    for (int replace = 1; replace < numlen(bound); ++replace) {
      int64_t k = bound;
      for (int d = 0; d < replace; ++d) {
        k /= 10;
      }
      k = max(k, (int64_t)1);
      for (int d = 0; d < replace; ++d) {
        k = k * 10 + 9;
      }
      if (k * dsum(cans) < cans * dsum(k)) {
        cans = k;
      }
    }
    numbers.push_back(cans);
  }
  for (int64_t n : numbers) {
    cout << n << '\n';
  }
  return 0;
}

Measured memory_bytes: 3608
import java.io.IOException;
import java.util.Locale;
import java.util.Scanner;


public class Main {

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

		int N = sc.nextInt();
		while (N-- > 0) {
			double x1 = sc.nextDouble();
			double y1 = sc.nextDouble();
			double x2 = sc.nextDouble();
			double y2 = sc.nextDouble();
			double x3 = sc.nextDouble();
			double y3 = sc.nextDouble();
			double x4 = sc.nextDouble();
			double y4 = sc.nextDouble();

			double[] AB = {x2-x1, y2-y1}, CD = {x4-x3, y4-y3};
			double cross = Math.abs(AB[0]*CD[1]-AB[1]*CD[0]);

			if (cross < 1e-10) {
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}

		}

	}
}

Measured memory_bytes: 23236
#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>;

const int mod = 1000000007;
// const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

void solve() {
    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    sort(a.begin(), a.end());

    combination comb(n+5);
    mint mi = 0;
    rep(i, n-k+1) mi += mint(a[i]) * comb(n-i-1,k-1);
    mint mx = 0;
    for (int i = k-1; i < n; i++) {
        mx += mint(a[i]) * comb(i,k-1);
    }

    cout << mx - mi << endl;
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 2560
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;

struct node {
	struct node* right;
	struct node* left;
	struct node* parent;
	int key;
};
typedef struct node* Node;
#define NIL NULL

Node root;

/*Node treeMinimum(Node x) {


}

Node treeMaximum(Node x) {


}

Node treeSearch(Node u, int k) {


}

Node treeSuccessor(Node x) {


}

void treeDelete(Node z) {
	Node y; // node to be deleted
	Node x; // child of y



}*/

void insert(int k) {
	Node y = NIL;
	Node x = root;
	Node z;

	z = (node*)malloc(sizeof(node));
	z->key = k;
	z->left = NIL;
	z->right = NIL;

	while (x != NIL) {
		y = x;
		if (z->key < x->key) {
			x = x->left;
		}
		else {
			x = x->right;
		}
	}
	z->parent = y;

	if (y == NIL) {
		root = z;
	}
	else if (z->key < y->key) {
		y->left = z;
	}
	else {
		y->right = z;
	}

}

/*
1 insert(T, z)
2     y = NIL // x の親
3     x = 'T の根'
4     while x ≠ NIL
5         y = x // 親を設定
6         if z.key < x.key
7             x = x.left // 左の子へ移動
8         else 
9             x = x.right // 右の子へ移動
10    z.p = y
11
12    if y == NIL // T が空の場合
13        'T の根' = z
14    else if z.key < y.key
15        y.left = z // z を y の左の子にする
16    else 
17        y.right = z // z を y の右の子にするv*/

void inorder(Node u) {
	if (u == NIL) {
		return;
	}
	inorder(u->left);
	printf(" %d", u->key);
	inorder(u->right);
}
void preorder(Node u) {
	if (u == NIL) {
		return;
	}
	printf(" %d", u->key);
	preorder(u->left);
	preorder(u->right);
}


int main() {
	int n, i, x;
	char com[20];
	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		//scanf_s("%s", com);
		cin >> com;
		if (com[0] == 'i') {
			scanf("%d", &x);
			insert(x);
		}
		else if (com[0] == 'p') {
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
	}

	return 0;
}


Measured memory_bytes: 26644
N, M = map(int, input().split())
As = sorted(list(map(int, input().split())), reverse=True)

INF = 10**9
matches = [2, 5, 5, 4, 5, 6, 3, 7, 6]

dp = [-INF for _ in range(N+100)]
dp[0] = 0

for i in range(N+1):
    for a in As:
        dp[i+matches[a-1]] = max(dp[i+matches[a-1]], dp[i]+1)

ans = ''
while N != 0:
    for a in As:
        if dp[N-matches[a-1]] == dp[N]-1:
            ans = ans+str(a)
            N -= matches[a-1]
            break

print(ans)


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

int main()
{
    int N;
    cin >> N;
    vector<pair<int, int>> tasks(N);
    for (int i = 0; i < N; i++)
    {
        int a, b;
        cin >> a >> b;
        tasks[i] = make_pair(b, a);
    }
    sort(tasks.begin(), tasks.end()); // 締切の近い順にソート
    int t = 0;
    bool can = true;
    for (auto task : tasks)
    {
        t += task.second;
        if (task.first < t)
        { // 締め切りを過ぎたか
            can = false;
            break;
        }
    }
    cout << (can ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 1792
int1 = lambda s: int(s)-1

N, K = map(int, input().split())
A = list(map(int1, input().split()))

X = []
visited = set()
now = 0
while now not in visited:
    visited.add(now)
    X.append(now)
    now = A[now]

if K < len(X):
    print(X[K] + 1)
else:
    s = X.index(now)
    print(X[s + ((K - s) % (len(X) - s))] + 1)


Measured memory_bytes: 124568
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int a,stack[100];
void push(int c);
int pop();
int main(){

  char A[100];
  int x,i,b,c;

  while(scanf("%s",A)!=EOF){
	if(A[0]=='+'){
	  c=pop();
	  b=pop();
	  push(b+c);
	  
	}
	else if(A[0]=='-'){
	  c=pop();
	  b=pop();
	  push(b-c);
	}
else if(A[0]=='*'){
	  c=pop();
	  b=pop();
	  push(b*c);
	}
 else{
   push(atoi(A));
 }
      }


  printf("%d\n",pop());
  return 0;
}

void push(int c)
{
  stack[++a]=c;
}
int pop()
{
  a--;
  return stack[a+1];
}



Measured memory_bytes: 2108
import java.io.*;
import java.util.*;
public class Main
{
	public static void main(String args[])throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		//int t = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		int arr[] = new int[n];
		st = new StringTokenizer(br.readLine());
		for(int i=0;i<n;i++)
		{
			arr[i] = Integer.parseInt(st.nextToken());
		}
		Arrays.sort(arr);
		int sum=0;
		for(int i=0;i<k;i++)
			sum += arr[i];
		System.out.println(sum);
	}
}

Measured memory_bytes: 32932
// "include" {{{
#include <deque>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <utility>
// }}}
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long 
#define pii pair<int,int> 
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long mod = 1000000007;

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

vector<int> t;
vector<int> a;

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h,w;
	cin >> h >> w;
	int a,b;
	cin >> a >> b;
	cout << (h-a) * (w-b) << '\n';
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
int main () {
  int a,b,c,d;
  cin>>a>>b>>c>>d;
while(1){
  c = c-b;
  if(c <= 0){
    cout<<"Yes"<<endl;
    break;
  }
  a = a-d;
  if(a <= 0){
    cout <<"No"<<endl;
    break;
  }
}
return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
typedef pair<long long , long long> P;
typedef long long ll;
typedef long long lint;
#define REP(i, n) for(long long (i)=0; (i)<(n); ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
lint gcd(lint x, lint y){
    if(y==0) return x;
    else return gcd(y, x%y);
}
signed main(){
    ll A, B, K; cin>>A>>B>>K;
    ll res = 0;
    ll cnt =0;
    for(int i=gcd(A,B); i>=1; i--){
        if(A%i==0 and B%i==0){
            cnt++;
            if(cnt==K){
                res = i;
                break;
            }
        }
    }
    cout<<res << endl;
    return 0;
}

Measured memory_bytes: 256
// Dāritys Morgho ban Rōvēgrie
// Math = ♥
// Sometimes it is people that no one imagines anything of who do things that no one can imagine
// After all this time? Always

#include <bits/stdc++.h>                        // uncomment before submission
//#include <ext/pb_ds/assoc_container.hpp>		// uncomment before submission
//#include <ext/pb_ds/tree_policy.hpp>			// uncomment before submission
//using namespace __gnu_pbds;					// uncomment before submission
using namespace std;
//<---------------------------------------------------Template----------------------------------------------------------->
#define int long long
#define ll long long
#define ld long double
const int INF = 1e15 + 7;
const int MAX = 1005;
const int MOD = 1e9 + 7;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;                  // Vector of long long
typedef vector<vi> vvi;                 // Vector of vi
typedef vector<ii> vii;                 // Vector of pairs
typedef vector<vii> vvii;               // Vector of Vector of pairs
typedef vector<bool> vb;                // Vector of bool
#define pq priority_queue               // Max heap (To convert to min heap, use negative sign before every value)
#define ff first                        // For pairs
#define ss second                       // For pairs
#define pb push_back                    // Pushback to vector
#define mp make_pair                    // Makes pairs to be stored as pair
#define all(c) (c).begin(), (c).end()   // Mainly used by me in sorting
// ordered_set adds two new functions to set - (set).find_by_order([kth element based on zero indexing]) and order_of_key()
// order_of_key returns number of elements less that parameter. If element exists, that order is its index
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
//<----------------------------------------------------------------------------------------------------------------------->

int f[MAX][MAX] = {0};

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m;
    cin >> n >> m;

    char a[n + 1][m + 1];

    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= m; j++)
            cin >> a[i][j];

    f[1][1] = 1;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            if (a[i][j] != '#' && !(i == 1 && j == 1))
                f[i][j] = (f[i - 1][j] + f[i][j - 1]) % MOD;
        }
    }

    cout << f[n][m] << endl;
    return 0;
}


Measured memory_bytes: 9088
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define REP(var, s, n) for (int var = (s); var < (n); ++var)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()

int main() {
  //
  int n, k;
  cin >> n >> k;
  if (k > (n - 1) * (n - 2) / 2) {
    cout << -1 << endl;
    return 0;
  }
  int diff = (n - 1) * (n - 2) / 2 - k;
  int m = (n - 1) + diff;
  cout << m << endl;
  rep(i, n - 1) { cout << 1 << " " << (i + 2) << endl; }

  int i = 2, j = 3;
  while (diff > 0) {
    cout << i << " " << j << endl;
    if (j == n) {
      i++;
      j = i + 1;
    } else {
      j++;
    }
    diff--;
  }
  return 0;
}


Measured memory_bytes: 888
N, M = map(int, input().split())
vs = []
for i in range(M):
    a, b = map(int, input().split())
    vs.append((b, a))
vs.sort()
end = 0
ans = 0
for b, a in vs:
    if end<=a:
        ans += 1
        end = b
print(ans)
    

Measured memory_bytes: 53336
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.Scanner;
import java.util.ArrayDeque;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Aeroui
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            ArrayDeque<Integer> q = new ArrayDeque<>();
            boolean f = false;
            for (int i = 0; i < n; ++i) {
                if (f) q.addFirst(in.nextInt());
                else q.addLast(in.nextInt());

                f = !f;
            }

            Iterator<Integer> it;
            if (n % 2 == 0) it = q.iterator();
            else it = q.descendingIterator();

            while (it.hasNext()) {
                out.print(it.next() + " ");
            }


        }

    }
}



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

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

    bool check=false;
    
    for(int i=0; i<s.size(); i++){
        int counter=count(s.begin(),s.end(),s[i]);
        if(counter>=2){
            check=true;
            break;
        }
    }

    if(check==false){
        cout<<"yes"<<endl;
    }else{
        cout<<"no"<<endl;
    }
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int pow(int x){
	return x*x;
}

int main(){
	int a,b,c;
	int ans1=0;
	int ans2=0;
	char ch;
	while(cin>>a>>ch>>b>>ch>>c){
		if(pow(a)+pow(b)==pow(c))ans1++;
		else if(a==b)ans2++;
	}
	
	cout<<ans1<<endl<<ans2<<endl;
}

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

#define ll long long int
#define vi vector<int>
#define ii pair< int , int >
#define vii vector<ii>
#define FOR(i, n) for(ll i = 0; i < (ll)n; i++)
int MAX(int a, int b){return (a > b) ? a:b;}
int MIN(int a, int b){return (a < b) ? a:b;}
int ABS(int x){return (x > 0) ? x:-x;}
int left(int x){return (x<<1);}
int right(int x){return (x<<1)+1;}
int lsone(int x){return (x&(-x));}

const ll INF = 1e18;
const int maxn = 110, maxw = 1e5+5;

int n, maxW;
int w[maxn], v[maxn];
ll ans[maxn][maxw];
bool found[maxn][maxw];

ll dp(int pos, int weight){
	if(weight < 0) return -INF;
	if(pos == n) return 0;
	if(found[pos][weight]) return ans[pos][weight];
	found[pos][weight] = true;
	ans[pos][weight] = max(dp(pos+1, weight), dp(pos+1, weight-w[pos])+v[pos]);
	return ans[pos][weight];
}

int main(){
	scanf("%d %d", &n, &maxW);
	for(int i = 0; i < n; i++){
		scanf("%d %d", &w[i], &v[i]);
	}
	printf("%lld\n", dp(0, maxW));
}

Measured memory_bytes: 90112
#include <stdio.h>
#include <stdlib.h>

int change(int x, int y) {
    if(x > y) {
        return x-1;
    }
    return x;
}

int max(int a, int b) {
    if(a > b) return a;
    return b;
}

int min(int a, int b) {
    return -max(-a, -b);
}


int main() {
    int N;
    scanf("%d", &N);
    char *S = (char*)malloc((N+1) * sizeof(char));
    scanf("%s", S);

    int i;
    int count = 1;
    char prev = S[0];
    for(i=1; i<N; i++) {
        if(S[i] != prev)    count++;
        prev = S[i];
    }
    printf("%d\n", count);
    free(S);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <limits>
#include <cmath>
#include <numeric>
#include <string>

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
#define rep(i, a, b) for(int i = (a); i < (b); ++i )
#define rrep(i, a, b) for(int i = (a); i > (b); --i )
#define REP(i, a, b) for(int i = (a); i <= (b); ++i )
#define RREP(i, a, b) for(int i = (a); i >= (b); --i )
#define ullrep(i, a, b) for(ull i = (a); i < (b); ++i )
#define ullrrep(i, a, b) for(ull i = (a); i > (b); --i )
#define ullREP(i, a, b) for(ull i = (a); i <= (b); ++i )
#define ullRREP(i, a, b) for(ull i = (a); i >= (b); --i )

int n, q;

class DisjointSet {
public:
    DisjointSet(){};
    DisjointSet(int size) {
        p_.resize(size, 0);
        rank_.resize(size, 0);
    };

    void makeSet(int x) {
        p_[x] = x;
        rank_[x] = 0;
    }

    bool same(int x, int y) {
        return findSet(x) == findSet(y);
    }
    int findSet(int x) {
        if (x != p_[x]) {
            p_[x] = findSet(p_[x]);
        }
        return p_[x];
    }

    void unite(int x, int y) {
        link(findSet(x), findSet(y));
    }

    void link(int x, int y) {
        if (rank_[x] > rank_[y]) {
            p_[y] = x;
        }else{
            p_[x] = y;
            if (rank_[x] == rank_[y]) {
                rank_[y]++;
            }
        }
    }

private:
    vector<int> p_, rank_;
};


int main() {
    cin >> n >> q;
    auto d = DisjointSet(n);
    rep(i, 0, n) {
        d.makeSet(i);
    }
    rep(i, 0, q) {
        int c, x, y;
        cin >> c;
        cin >> x >> y;
        if (!c) {
            //unite
            d.unite(x, y);
        }else{
            //same
            if (d.same(x, y)) {
                cout << 1 << endl;
            }else{
                cout << 0 << endl;
            };
        }
    }
}


Measured memory_bytes: 3180
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;
int64_t MOD = 1000000007;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<pair<string,int>,int>> data(n);
  REP(i,n) {
    cin >> data[i].first.first >> data[i].first.second;
    data[i].first.second *= -1;
    data[i].second = i;
  }
  sort(data.begin(), data.end());
  REP(i,data.size()) cout << data[i].second + 1 << endl;
  REP(i,data.size()) {

  }
  return 0;
}
//templete by private_yusuke

Measured memory_bytes: 384
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <stdio.h>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define rep(i,a,n) for(ll i =(a);i<(n);++i)
#define urep(i,a,n) for(ll i = (a);i>=(n);--i)
#define all(x) (x).begin(),(x).end()
#define INF 1e18
typedef long long ll;
const ll MAX=510000;
const ll mod = 1e9 + 7;
using namespace std;
ll dx[4] = { 1,-1,0,0 };
ll dy[4] = { 0,0,1,-1 };
ll N,M,X,Y,A,B,C,D,Q,K,R,W,H,P,L,G;
ll ans;
string S,T;
ll h[101010];
ll y[101010];
ll a[201010];
ll k[101010];
ll b[201010];
ll d[101010];
ll t[101010];
ll p[101010];
ll n[101010];
ll l[101010];
ll r[101010];
ll v[101010];
ll s[101010];
ll x[101010];
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	else return gcd(b, a%b);
}
ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}
struct Edge{
	ll to,cost;
	 Edge(ll to, ll cost) : to(to), cost(cost) {}
};
typedef vector<vector<Edge> > AdjList;
AdjList graph;
vector<ll> dist;

struct UnionFind {
    vector<ll> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
	vector<ll> size;
    UnionFind(ll N) : par(N),size(N) { //最初は全てが根であるとして初期化
        for(ll i = 0; i < N; i++) par[i] = i;
		for(ll i = 0; i < N; i++) size[i] = 1;
    }

    ll root(ll x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }
	ll GetSize(ll x){
		return size[root(x)];
	}

    void unite(ll x, ll y) { // xとyの木を併合
        ll rx = root(x); //xの根をrx
        ll ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
		size[ry]+=size[rx];

    }

    bool same(ll x, ll y) { // 2つのデータx, yが属する木が同じならtrueを返す
        ll rx = root(x);
        ll ry = root(y);
        return rx == ry;
    }
};

int main(){
    cin>>A>>B;
    cout<<max(A+B,max(A-B,A*B))<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF=999999999;
int main() {
 int N,D;
 cin>>N>>D;
 int X[N][D];
 for(int i=0;i<N;i++){
     for(int j=0;j<D;j++){
         cin>>X[i][j];
     }
 } 
 int count=0;
 for(int i=0;i<N;i++){
    for(int k=i+1;k<N;k++){
      int sum=0;
     for(int j=0;j<D;j++){
      int T=X[i][j]-X[k][j];
      sum+=T*T;
     }
     int q=sqrt(sum)+0.5;
     if(q*q==sum){count++;}
 }
 }
 cout<<count<<endl;
 return 0;}

Measured memory_bytes: 256
#pragma GCC diagnostic ignored "-Wunused-result"
#define NDEBUG

#include <algorithm>
#include <cassert>
#include <cinttypes>
#include <cstdio>
#include <tuple>
#include <vector>
#include <unordered_set>
#include <iostream>

#ifdef NDEBUG
#  define debug(...)
#else
#  define debug(...)                                \
  do {                                              \
    fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); \
    fprintf(stderr, __VA_ARGS__);                   \
    fputc('\n', stderr);                            \
  } while (false)
#endif

using namespace std;
using tii = tuple<int, int>;

int main() {
  int N;
  scanf("%d", &N);
  unordered_set<string> words;
  string w, w0;
  bool ans = true;
  for (int i = 0; i < N; i++) {
    cin >> w;
    if ((!w0.empty() && w0.back() != w[0]) || words.count(w) > 0) {
      ans = false;
    }
    words.insert(w);
    swap(w0, w);
  }
  puts(ans ? "Yes" : "No");
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
#define F first
#define S second
#define INF 1<<19
struct SEG{
	int seg[1<<19];
	SEG(void){for(int i=0;i<1<<19;i++)seg[i]=INF;}
	void up(int a,int x){
		a+=(1<<18)-1;
		seg[a]=min(seg[a],x);
		while(a>0){
			a=(a-1)/2;
			seg[a]=min(seg[a*2+1],seg[a*2+2]);
		}
	}
	int que(int a,int b,int l,int r,int k){
		if(r<a||b<l)return INF;
		if(a<=l&&r<=b)return seg[k];
		return min(que(a,b,l,(l+r-1)/2,k*2+1),que(a,b,(l+r+1)/2,r,k*2+2));
	}
};
int n,q,s[1<<18],l,r,a,o,dp[1<<18],d=INF,e;
P x[1<<18];
SEG p;
int main(void){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
		scanf("%d",&a);
		if(a)s[i]--;
		else s[i]++;
		s[i]+=s[i-1];
		dp[i]=INF;
	}
	scanf("%d",&q);
	for(int i=0;i<q;i++)scanf("%d%d",&x[i].F,&x[i].S);
	sort(x,x+q);
	p.up(0,(n-s[n])/2);
	dp[0]=(n-s[n])/2;
	for(int i=0;i<q;i++){
		l=x[i].F,r=x[i].S;
		while(e<l)d=min(d,dp[e++]);
		o=min(d+s[r]-s[l-1],s[r]+p.que(l,r,0,(1<<18)-1,0));
		p.up(r,o-s[r]);
		dp[r]=o;
	}
	while(e<=n)d=min(d,dp[e++]);
	printf("%d\n",d);
}


Measured memory_bytes: 6400
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
using namespace std;
int main() {
	int n, y;
	cin >> n >> y;
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j <= n; j++) {
			if (i + j > n) {
				continue;
			}
			int co = 10000 * i + 5000 * j;
			if (co + 1000 * (n - i - j) == y) {
				cout << i << " " << j << " " << (n - i - j) << endl;
				return 0;
			}
		}
	}
	cout << "-1 -1 -1" << endl;
	return 0;
}


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

int main()
{
    int K,A,B,a,b,c;
    cin >> K >> A >> B;

    if(A%K==0)
        cout << "OK" << endl;
    else
    {
        a = A/K;
        b = a+1;
        c = K*b;

        if(c>=A && c<=B)
            cout << "OK" << endl;
        else
            cout << "NG" << endl;
    }


    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=int(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;

int main(){
    int N;cin>>N;
    vector<int> A(N);
    REP(i, N) cin >> A[i];
    map<ll,ll> mp;
    ll s=0,ans=0;
    REP(i,N){
        mp[s]++;
        s+=A[i];
        ans+=mp[s];
    }
    cout<<ans<<endl;
}


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

int main(int argc , char **argv)
{
	(void)argc;
	(void)argv;

	unordered_set<int> A;
	int N;
	cin >> N;
	for(int i=0;i<N;i++){
		int a;
		cin >> a;
		auto it = A.find(a);
		if ( it==A.end()) {A.insert(a);} else {A.erase(a);}
	}

	cout << A.size() << endl;

	return 0;
}

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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

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

  for(int i=0;i<n;++i) {
    for(int j=i;j<n;++j) {
      vi b(n);
      for(int k=0;k<n;++k) {
        if(k == i) {
          b[k] = a[j];
        } else if(k == j) {
          b[k] = a[i];
        } else {
          b[k] = a[k];
        }
      }

      bool ok = true;
      for(int k=1;k<n;++k) {
        if(b[k-1] > b[k]) {
          ok = false;
          break;
        }
      }
      if(ok) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  

}


Measured memory_bytes: 256
(defun solve (heights)
  (let ((ans 0)
        (max 0))
    (loop :for h :in heights
          :do (if (>= h max)
                  (progn
                    (setf ans (1+ ans))
                    (setf max h))))
    ans))

(defun main ()
  (let* ((n (read))
        (h (loop :repeat n
                 :collect (read))))
    (format t "~A~%" (solve h))))

(main)


Measured memory_bytes: 15844
# -*-coding: utf-8 -*-
N = int(input())
T, A = map(int, input().split())

H = list(map(int, input().split()))

best_near = 100000000
ans = 0
for i in range(N):
    temp = T - H[i]*0.006
    if best_near > abs(A - temp):
        best_near = abs(A - temp)
        ans = i+1
print(ans)

Measured memory_bytes: 3064
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    n,a,b = LI()
    print(min(n*a,b))
    return

#B
def B():
    n = list(map(int,S()))
    s = sum(n)
    a = 0
    for i in n:
        a *= 10
        a += i
    if a%s == 0:
        print("Yes")
    else:
        print("No")
    return

#C
def C():
    n = I()
    f = LIR(n)
    po = [1]*11
    for i in range(n):
        k = 0
        p = 1
        for j in range(10):
            k += p*f[i][j]
            p *= 2
            po[j+1] = p
        f[i] = k
    p = LIR(n)
    ans = -float("inf")
    for i in range(1,1024):
        k = 0
        for j in range(n):
            c = i&f[j]
            s = 0
            for l in po:
                if c&l:s += 1
            k += p[j][s]
        ans = max(ans,k)
    print(ans)
#D
def D():
    n,C = LI()
    T = [[0 for i in range(100002)] for j in range(C)]
    for i in range(n):
        s,t,c = LI()
        c -= 1
        T[c][s] += 1
        T[c][t+1] -= 1
    for c in range(C):
        for i in range(100000):
            T[c][i+1] += T[c][i]
    ans = 0
    for i in range(100000):
        k = 0
        for c in range(C):
            if T[c][i]:k += 1
        ans = max(ans, k)
    print(ans)
#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    B()


Measured memory_bytes: 39920
import sys

def print_arr(arr):
	for i in range(len(arr)):
		sys.stdout.write(str(arr[i]))
		if i != len(arr) - 1:
			sys.stdout.write(' ')
	print()

def insertion_sort(arr, n, g):
	cnt = 0
	for i in range(g, n):
		v = arr[i]
		j = i - g
		while j >= 0 and arr[j] > v:
			arr[j + g] = arr[j]
			j = j - g
			cnt += 1
		arr[j + g] = v
	return cnt

def shell_sort(arr, g):
	cnt = 0
	for i in range(len(g)):
		cnt += insertion_sort(arr, len(arr), g[i])
	return cnt

def get_gap(n):
	lst = []
	v = 1
	cnt = 1
	while v <= n:
		lst.append(v)
		v += 3**cnt
		cnt += 1
	if len(lst) == 0: lst.append(1)
	return list(reversed(lst))

n = int(input())
arr = [0] * n
for i in range(n):
	arr[i] = int(input())

g = get_gap(n)
m = len(g)
cnt = shell_sort(arr, g)

print(m)
print_arr(g)
print(cnt)
for i in range(n):
	print(arr[i])



Measured memory_bytes: 45476
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
	char x;
	cin>>x;
	if (x=='A')
	{
		printf("T");
		return 0;
	}
	if (x=='T')
	{
		printf("A");
		return 0;
	}
	if (x=='G')
	{
		printf("C");
		return 0;
	}
	printf("G");
	return 0;
}

Measured memory_bytes: 256
a1 = int(input())
a2 = list(map(int,input().split(" ")))
b1 = int(input())
b2 = list(map(int,input().split(" ")))

count = 0
for i in b2:
    a2.append(i)
    k = 0
    while True:
        if a2[k] == i:
            break
        k += 1
    if not k == len(a2)-1:
        count += 1

print(count)



Measured memory_bytes: 6336
#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++)
typedef long long ll;

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

   if (a >= 13) {
       cout << b << endl;
   } else if(a >= 6) {
       cout << b / 2 << endl;
   } else {
       cout << 0 << endl;
   }
}

Measured memory_bytes: 256
#include <stdio.h>

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

int main(void)
{
	long long int a;
	long long int b;
	scanf("%lld %lld",&a,&b);
	long long int g = gcd(a,b);
	long long int ans =  (a*b)/g;
	printf("%lld\n",ans);
	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;

const int mod = 1e9+7;
const ll INF = 1e18;

void test(){

}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    char t;
    cin >> t;
    if(t - 97 >= 0 ){
        cout << 'a';
    }else{
        cout << 'A';
    }
}

Measured memory_bytes: 3540
#include<stdio.h>

//int bubbleSort(int *a, int N)
//{
//	int swap = 0, flag = 1;
//	int i, j;
//	for (i = 0; flag; i++)
//	{
//		flag = 0;
//		for (j = N - 1; j > i; j--)
//		{
//			if (a[j] < a[j - 1])
//			{
//				int t = a[j];
//				a[j] = a[j - 1];
//				a[j - 1] = t;
//				swap++;
//				flag = 1;
//			}
//		}
//	}
//	return swap;
//}

int bubbleSort(int *a, int N)
{
	int swap = 0, flag = 1;
	for (int i = 0; i < N; i++)
	{
		for (int j = N - 1; j > i; j--)
		{
			if (a[j] < a[j - 1])
			{
				int t = a[j];
				a[j] = a[j - 1];
				a[j - 1] = t;
				swap++;
			}
		}
	}
	return swap;
}

void print(int *a, int N)
{
	for (int i = 0; i < N; i++)
	{
		if (i)
			printf(" ");
		printf("%d", a[i]);
	}
}

int main()
{
	int N;
	int a[101];
	scanf("%d", &N);
	for (int i = 0; i < N; i++)
		scanf("%d", &a[i]);
	int sw = bubbleSort(a, N);
	print(a, N);
	printf("\n%d\n", sw);
}


Measured memory_bytes: 2092
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string aaa = "abcdefghijklmnopqrstuvwxyz";
		long N = long.Parse(Console.ReadLine());
		string ans = "";
		long a = 1;
		ans += aaa.Substring((int)((N-1)/a%26),1);
		N -= (N-1)/a%26*a+1;
		a *= 26;
		while(N/a>0){
			ans += aaa.Substring((int)((N-1)/a%26),1);
			N -= ((N-1)/a%26+1)*a;
			Console.Error.WriteLine(ans+" "+N);
			a *= 26;
		}
		for(var i=ans.Length-1;i>=0;i--){
			Console.Write(ans.Substring(i,1));
		}
	}
}

Measured memory_bytes: 17692
N = int(input())
IN = [list(map(int, input().split())) for i in range(N)]
# 計算に使う高さが0だと死ぬ
index = min([i for i in range(N) if IN[i][2] > 0])
for i in range(101):
  for j in range(101):
    temp_h = abs(IN[index][0]-i) + abs(IN[index][1]-j) + IN[index][2]
    check = True
    for test in IN:
      calc_h = max([temp_h - abs(test[0]-i) - abs(test[1]-j), 0])
      if calc_h != test[2]:
        check = False
        break
    if check:
      print(i, j, temp_h)
      exit()

Measured memory_bytes: 3064
k = int(input())

A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(A[k - 1])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <iostream>
int a[101];
using namespace std;
int main(){
  int n;
  cin>>n;
  int s=0;
  for (int i=0;i<n;++i){
    cin>>a[i];
    s+=a[i];
  }
  int m;
  cin>>m;
  vector<vector<int>> data(m, vector<int>(2));
 for (int i = 0; i < m; i++) {
  for (int j = 0; j < 2; j++) {
  cin >> data.at(i).at(j);
 }
 }
 for(int i=0;i<m;++i){
 cout<<s-a[data.at(i).at(0)-1]+data.at(i).at(1)<<endl;
 }
}
  

Measured memory_bytes: 256
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        a: usize,
        b: usize,
        s: Chars,
    }

    let mut cnt = 0;
    for i in s {
        debug!(cnt);
        debug!(i);
        if (i.is_digit(10) && cnt!=a) || (i=='-' && cnt==a) {
            cnt += 1;
        } else {
            println!("No");
            return;
        }
    }

    if cnt==a+b+1 {
        println!("Yes");
    } else {
        println!("No");
    }

}


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

/* prime list */
#include<vector>
template<typename T>
void isPrime(vector<bool> &vec,T n)
{
	if(vec.size()<n+1)
		vec.resize(n+1);
	
	for(auto i:vec)
		i=true;
	
	vec[0]=false;
	vec[1]=false;
	
	for(T i=2;i*i<=n;i++)
		for(T j=2;i*j<=n;j++)
			vec[i*j]=false;
	
	return;
}

int main()
{
	int csum[100010]={};
	vector<bool> v;
	isPrime(v,100010);
	
	for(int i=1;i<100010;i++)
	{
		csum[i]+=csum[i-1];
		if(v[i] && v[(i+1)/2])csum[i]++;
	}
	
	int Q;
	int l,r;
	
	cin >> Q;	
	for(int i=0;i<Q;i++)
	{
		cin >> l >> r;
		cout << csum[r]-csum[l-1] << endl;
	}
	return 0;
}


Measured memory_bytes: 1024
N = int(input())
A = list(map(int, input().split()))
dic = {}
for i in range(N):
    dic[i] = A[i]
dic = sorted(dic.items(), key=lambda x: x[1])
dic = list(zip(*dic))
ans = [dic[0][i] + 1 for i in range(N)]
for i in ans:
    print(i)


Measured memory_bytes: 26584
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <numeric>
#include <climits>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <utility>
#include <cctype>
#include <iterator>
////////////////////////////////////////////////
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++)
#define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++)
#define REPe(e, mp) for (auto& e : mp)
#define all(x) x.begin(), x.end()
#define MOD 1000000007  // 1e9+7
using namespace std;
using ll = long long int;
using vecint = vector<int>;
using vecll = vector<ll>;
using vec2int = vector<vector<int>>;
using P = pair<int, int>;
////////////////////////////////////////////////
////////////////////////////////////////////////
int main() {
  ////////////////////////////////////////////////
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ////////////////////////////////////////////////
  char s;
  cin >> s;
  int n = (s - 'a');
  if (0 <= n && n <= 25) {
    char c = 'A' + n;
    cout << 'a' << endl;
  }else{
    n = s - 'A';
    char c = 'a' + n;
    cout << 'A' << endl;
  }
}


Measured memory_bytes: 3644
// Enjoy your stay.

#include <bits/stdc++.h>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(auto it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define mt make_tuple
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)(x).size())

using namespace std;

typedef istringstream iss;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef stringstream sst;
typedef vector<ll> vi;

int m,n,obj[200];
int dp[180000];
int p3[12];

int f(int mask){
	int& res = dp[mask];
	if(res!=-1)return res;
	res = INF;

	int d[12];
	rep(i,m)d[i] = mask/p3[i]%3;

	int hit = 0;
	rep(i,n){
		int ok = 1;
		rep(j,m)if(d[j]!=2 && d[j] != (obj[i]>>j&1)){
			ok = 0;
		}
		if(ok)hit++;
	}

	if(hit <= 1)return res = 0;
	rep(i,m)if(d[i] == 2){
		res = min(res, 1 + max(f(mask - 2 * p3[i]), f(mask - 1 * p3[i])));
	}

	return res;
}

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	p3[0] = 1;
	rep(i,11)p3[i+1] = p3[i] * 3;
	while(cin>>m>>n && m){
		rep(i,n){
			string s;
			cin>>s;
			obj[i] = 0;
			rep(j,m)obj[i] |= (s[j] - '0')<<j;
		}
		memset(dp,-1,sizeof(dp));
		cout<<f(p3[m]-1)<<endl;
	}
}

Measured memory_bytes: 1924