akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
using namespace std;

int main(void) {
    vector<int> height;
    vector<int> width;
    int n = 0;
    while (true) {
        int h, w;
        cin >> h >> w;
        height.push_back(h);
        width.push_back(w);
        if (h == 0 && w == 0) {
            break;
        }
        n++;
    }
    for (int i = 0; i < n; i++) {
        for (int y = 0; y < height.at(i); y++) {
            for (int x = 0; x < width.at(i); x++) {
                if (x%2 == y%2) {
                    cout << "#";
                }
                else {
                    cout << ".";
                }
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}



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

int main() {
	int input;
	cin >> input;
	int a = to_string(input).length();
	int b = to_string(input)[0]-'0';
	if(stoi(string(a, b+'0')) >= input)
		cout << stoi(string(a, b+'0'));
	else if(b == 9)
		cout << stoi(string(a+1, '1'));
	else
		cout << stoi(string(a, b+'1'));
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string.h>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second

const int mxn = 200, k = 63;
int n;
ll a[mxn], b[mxn];
ll dp[k];

void answer(){
	cin >> n;
	
	for(int i = 0; i < n; i++) cin >> a[i];
	for(int i = 0; i < n; i++){
		char c;
		cin >> c;
		b[i] = c & 1;
	}
	
	reverse(a, a + n);
	reverse(b, b + n);
	
	memset(dp, 0, sizeof(dp));
	for(int i = 0; i < n; i++){
		if(!b[i]){
			for(int j = 0; j < k; j++){
				if((a[i] >> j) & 1){
					if(!dp[j]){
						dp[j] = a[i];
						break;
					}else{
						a[i] ^= dp[j];
					} 
				}
			}
		}else{
			for(int j = 0; j < k; j++){
				if((a[i] >> j) & 1) a[i] ^= dp[j];
			}
			if(a[i]){
				cout << 1 << endl;
				return;
			}
		}
	}
	
	cout << 0 << endl;
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int t;
	cin >> t;
	
	for(int i = 0; i < t; i++) answer();

	return 0;
}

Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
int n,w;
int v[105];
long long dp[105][100005],u[105];

int main(){
	scanf("%d %d",&n,&w);
	for(int i=1;i<=n;i++) scanf("%lld %d",&u[i],&v[i]);
	for(int i=0;i<=n;i++){
		for(int j=0;j<=100000;j++){
			dp[i][j]=1e18;
		}
	}
	dp[0][0]=0;
	for(int i=1;i<=n;i++){
		for(int j=0;j<=100000;j++){
			dp[i][j]=dp[i-1][j];
			if(j>=v[i]) dp[i][j]=min(dp[i][j],dp[i-1][j-v[i]]+u[i]);
		}
	}
	for(int i=100000;i>=0;i--){
		if(dp[n][i]<=w){
			printf("%d\n",i);
			break;
		}
	}
	
	return 0;
}

Measured memory_bytes: 80128
#include<bits/stdc++.h>
#define ll long long int
#include <stdlib.h>
#include <vector>
#define pi acos(-1)
#define MOD 1000000007
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
///s1.substr(1,3);///STARTING FROM INDEX 1, 3 LNEGTH SUBSTRING.
///s1.find("adn")///RETURNS STARTING INDEX OF THE SUBSTRING
///"adn" IF IT EXISTS IN THE STRING S1.///
///s1.find("adn",int pos);///RETURNS STARTING INDEX OF THE
///SUBSTRING "adn" SEARCHING FROM INDEX POS OF STRING s1.///
///string::npos returns a garbage value if not found...
///reverse(s1.begin(),s1.end())-> to reverse a string.
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define gcd(a,b) __gcd(a,b)
using namespace std;

vector<int>adj[100005];
int vis[100005];
int vis2[100005];
//vector<ll>a1;
ll f[100005],x7=1000000005,x8,s=0;
ll f2[100005];
ll f3[100005];
ll size1[200005];
ll size2[100005];
set<int>x2;
set<int>::iterator it;

int root(int a)
{
    while(f2[a]!=a){
        f2[a]=f2[f2[a]];
        a=f2[a];
    }
    return a;
}

void union1(int a,int b)
{
    int root_a=root(a);
    int root_b=root(b);
    if(root_a==root_b)return;
    else if(size1[root_a]>size1[root_b]){
        f2[root_b]=root_a;
        size1[root_a]+=size1[root_b];
    }
    else{
        f2[root_a]=root_b;
        size1[root_b]+=size1[root_a];
    }
}

map<string,ll>m2;

string removeSpaces(string str)
{
    str.erase(remove(str.begin(), str.end(), ' '), str.end());
    return str;
}

int binaryToDecimal(int n)
{
    int num = n;
    int dec_value = 0;

    // Initializing base value to 1, i.e 2^0
    int base = 1;

    int temp = num;
    while (temp) {
        int last_digit = temp % 10;
        temp = temp / 10;

        dec_value += last_digit * base;

        base = base * 2;
    }

    return dec_value;
}
//x8=x7;
ll g[5];
void dfs(ll a)
{
    if(vis[a])return;
    vis[a]=1;x7=min(x7,f[a]);//s-=f[a];
    for(int j=0;j<adj[a].size();j++){
        dfs(adj[a][j]);
    }
}

int main()
{
    long long int t,i,q=0,h,w,n,a=1,k1=0,k2,d,e,m,b,c,x1=1000000005,x3=0,x4=0,x5=0,x6=0;
    string s2,s3,s4,s5,s6,s7;
    cin>>n;
//    for(int i=2;i<=n;i++)a*=i;
//    ll f3[a];
    for(int i=0;i<n;i++)cin>>f[i];
    for(int i=0;i<n;i++)cin>>f2[i];
//    do{
//        cout<<f[0]<<" "<<f[1]<<" "<<f[2]<<endl;
//    }
    for(int i=0;i<n;i++)f3[i]=i+1;
    while(1)
    {

        s++;//cout<<f[0]<<f[1]<<f[2]<<endl;
        for(int i=0;i<n;i++){q++;
            if(f3[i]!=f[i])break;
        }
        if(q==n){break;}q=0;
        next_permutation(f3,f3+n);
    }//cout<<f3[0]<<f3[1]<<f3[2]<<endl;
    for(int i=0;i<n;i++)f3[i]=i+1;
    q=0;
    while(1)
    {

        k1++;//cout<<f[0]<<f[1]<<f[2]<<endl;
        for(int i=0;i<n;i++){q++;
            if(f3[i]!=f2[i])break;
        }
        if(q==n){break;}q=0;
        next_permutation(f3,f3+n);
    }
    cout<<abs(s-k1)<<endl;

    return 0;
}


Measured memory_bytes: 6016
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long LL;
struct X{
	int id;
	LL x;
	LL y;
	X(){
		id=0;
		x=0;
		y=0;
	}
	X(int _id,LL _x,LL _y){
		id=_id;
		x=_x;
		y=_y;
	}
	LL getCost(X &x1){
		LL X1=x-x1.x;
		if (X1<0){
			X1=-X1;
		}
		LL Y1=y-x1.y;
		if (Y1<0){
			Y1=-Y1;
		}
		if (X1<Y1){
			return X1;
		}else{
			return Y1;
		}
	}
};
struct EDGE{
	X p1;
	X p2;
	LL cost;
	EDGE(X _p1,X _p2){
		p1=_p1;
		p2=_p2;
		cost=p1.getCost(p2);
	}
  // コストの大小で順序定義
  bool operator<(const EDGE& o) const {
    return cost < o.cost;
  }
	bool find(const EDGE &edge){
		if (p1.id==edge.p1.id && p2.id==edge.p2.id){
			return true;
		}
		if (p1.id==edge.p2.id && p2.id==edge.p1.id){
			return true;
		}
		return false;
	}

};
bool SortX(X &x1,X &x2){
	if (x1.x<x2.x){
		return true;
	}
	return false;
}
bool SortY(X &x1,X &x2){
	if (x1.y<x2.y){
		return true;
	}
	return false;
}
// 素集合データ構造
struct UnionFind
{
  // par[i]：データiが属する木の親の番号。i == par[i]のとき、データiは木の根ノードである
  vector<int> par;
  // sizes[i]：根ノードiの木に含まれるデータの数。iが根ノードでない場合は無意味な値となる
  vector<int> sizes;

  UnionFind(int n) : par(n), sizes(n, 1) {
    // 最初は全てのデータiがグループiに存在するものとして初期化
	  for (int i=0;i<n;i++){
		par[i] = i;
	  }
  }

  // データxが属する木の根を得る
  int find(int x) {
    if (x == par[x]) return x;
    return par[x] = find(par[x]);  // 根を張り替えながら再帰的に根ノードを探す
  }

  // 2つのデータx, yが属する木をマージする
  void unite(int x, int y) {
    // データの根ノードを得る
    x = find(x);
    y = find(y);

    // 既に同じ木に属しているならマージしない
    if (x == y) return;

    // xの木がyの木より大きくなるようにする
    if (sizes[x] < sizes[y]) swap(x, y);

    // xがyの親になるように連結する
    par[y] = x;
    sizes[x] += sizes[y];
    sizes[y] = 0;  // sizes[y]は無意味な値となるので0を入れておいてもよい
  }

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

  // データxが含まれる木の大きさを返す
  int size(int x) {
    return sizes[find(x)];
  }
};

// 頂点数と辺集合の組として定義したグラフ
struct Graph
{
  int n;  // 頂点数
  vector<EDGE> edges;  // 辺集合

  // クラスカル法で無向最小全域木のコストの和を計算する
  // グラフが非連結のときは最小全域森のコストの和となる
  LL kruskal() {
    // コストが小さい順にソート
    sort(edges.begin(), edges.end());

    UnionFind uf(n);
    LL min_cost = 0;

    for (int i=0;i<edges.size();i++) {
      EDGE& e = edges[i];
	  if (!uf.same(e.p1.id, e.p2.id)) {
        // 辺を追加しても閉路ができないなら、その辺を採用する
        min_cost += e.cost;
		uf.unite(e.p1.id, e.p2.id);
      }
    }

    return min_cost;
  }
};

int main(int argc, char* argv[])
{
	int N;
	cin>>N;
	vector<X> City;
	int i;
	LL x,y;
	for (i=0;i<N;i++){
		cin>>x>>y;
		City.push_back(X(i,x,y));
	}
	sort(City.begin(),City.end(),SortX);
	Graph graph;
	graph.n=N;
	for (i=0;i<N-1;i++){
		EDGE edge(City[i],City[i+1]);
		graph.edges.push_back(edge);
	}
	sort(City.begin(),City.end(),SortY);
	for (i=0;i<N-1;i++){
		EDGE edge(City[i],City[i+1]);
		graph.edges.push_back(edge);
	}
	cout << graph.kruskal() << endl;
	return 0;
}

Measured memory_bytes: 20968
#include <bits/stdc++.h>
using namespace std;
const int nmax=3e5+3;
int n,x,act,sol[nmax],v[nmax];
int main()
{
    ios::sync_with_stdio(false);
    cin>>n;
    for(int i=1;i<=n;++i)
    {
        cin>>v[i];
        sol[i]=1;
    }
    for(int i=n;i>=1;--i)
    {
        act=0;
        for(int j=i;j<=n;j+=i) act+=sol[j];
        if(act%2!=v[i]) sol[i]=0;
    }
    act=0;
    for(int i=1;i<=n;++i) act+=sol[i];
    cout<<act<<'\n';
    for(int i=1;i<=n;++i) if(sol[i]) cout<<i<<' ';
    return 0;
}


Measured memory_bytes: 2560
using System;
using System.Collections.Generic;

namespace ABC137_A
{
    class Program
    {
        static void Main(string[] args) {
            string[] input = Console.ReadLine().Split();
            long a = long.Parse(input[0]);
            long b = long.Parse(input[1]);

            long maxValue = a + b;
            if (maxValue < a - b)
                maxValue = a - b;
            if (maxValue < a * b)
                maxValue = a * b;

            Console.WriteLine(maxValue);
        }
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;

int N,T;
long long int ans;
long long int now;
int main(){
  cin >> N >> T;
  for(int i=0;i<N;i++){
    int t;
    cin >> t;
    if(t<now){
      ans+=(t+T-now);
      now=t+T;
    }
    else{
      ans+=T;
      now=t+T;
    }
  }
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
using ll = long long;
int MOD = 1e9 + 7;
using namespace std;
ll GCD(ll x, ll y)
{
    if (y == 0)
    {
        return x;
    }
    else
    {
        return GCD(y, x % y);
    }
}
ll LCM(ll x, ll y)
{
    return x / GCD(x, y) * y;
}
struct UnionFind
{
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N)
    { //最初は全てが根であるとして初期化
        for (int i = 0; i < N; i++)
            par[i] = i;
    }

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

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

    bool same(int x, int y)
    { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
int main()
{
    int d, g;
    cin >> d >> g;
    vector<pair<int, int>> vec(d);
    for (int i = 0; i < d;i++){
        int p, c;
        cin >> p >> c;
        vec[i] = make_pair(p, c);
    }
    vector<vector<int>> reg(1 << d);
    for (int i = 0; i < (1<<d);i++){
        for (int j = 0; j < d;j++){
            if(i&(1<<j)){
                reg[i].push_back(1);
            }else{
                reg[i].push_back(0);
            }
        }
    }
    ll MIN = 1e9;
    for (int i = 0; i < (1 << d);i++){
        ll sum = 0;
        ll num = 0;
        for (int j = 0; j < d;j++){
            if(reg[i][j]==1){
                sum += (j + 1) * 100 * vec[j].first + vec[j].second;
                num += vec[j].first;
            }   
        }
        if (sum >= g)
        {
            MIN = min(MIN, num);
            //    cout<<"無駄なし "<<num<<endl;
        }
        else
        {
            for (int j = d-1; j >=0; j--)
            {
                int k = vec[j].first;
                if (reg[i][j] == 0)
                {
                    while (1)
                    {
                        num++;
                        sum += (j + 1) * 100;
                        k--;
                        if (k == 0)
                        {
                            sum += vec[j].second;
                        }
                        if (sum >= g)
                        {
                            MIN = min(MIN, num);
                            break;
                        }
                        if(k==0){
                            break;
                        }
                        
                    }
                }
            }
        }
    }
    cout << MIN << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }

unsigned int randxor()
{
	static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	unsigned int t;
	t = (x ^ (x << 11)); x = y; y = z; z = w; return(w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}



int main() {
	ll n;
	cin >> n;
	ll a = n / 11;
	if (n == a * 11) {
		cout << a * 2 << endl;
	}
	else if (n <= a * 11 + 6) {
		cout << a * 2 + 1 << endl;
	}
	else {
		cout << a * 2 + 2 << endl;
	}
	return 0;
}




Measured memory_bytes: 256
input = gets.to_i

if input.to_s.length <=2
  puts 0
  exit
end

r = [].fill([0,3,5,7], 0, input.to_s.length).inject(&:product).map do |e|
  e.flatten.join.to_i
end.reject do |num|
  num.to_s.include?('0') || num > input
end.select do |num|
  s = num.to_s
  [3,5,7].map(&:to_s).all? do |i|
    s.include?(i)
  end
end.length

puts r


Measured memory_bytes: 38780
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException{
		int x;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		x = Integer.parseInt(br.readLine());
		if(x >= 30) {
			System.out.print("Yes");
		}else {
			System.out.print("No");
		}
	}

}

Measured memory_bytes: 32460
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define M 10000
#define E 500000
  
typedef struct edge {
    int from, to, cost;
} Ed;
Ed e[E];
int d[M];
  
void sp(int,int);
 
int main(int argc,char* argv[])
{
    int vn, en, an;
    int i, j, vi;
    scanf("%d", &vn);
  
    en=0;
    for(i=0; i<vn; i++) {
        scanf("%d", &vi);
        scanf("%d", &an);
        for(j=1; j<=an; j++) {
            e[en].from=vi;
            scanf("%d %d", &e[en].to, &e[en].cost);
            en++;
        }
    }
      
    sp(vn, en);
    for(i=0; i<vn; i++) {
        printf("%d %d\n", i, d[i]);
    }
    return 0;
}
void sp(int vn, int en)
{
    int i, new=1;
    for(i=1; i<vn; i++) d[i]=INT_MAX;
      
    while(new) {
        new=0;
        for(i=0; i<en; i++) {
            if(d[e[i].from] !=INT_MAX && d[e[i].from]+e[i].cost < d[e[i].to]) {
                d[e[i].to] = d[e[i].from]+e[i].cost;
                new++;
            }
        }
    }
}

Measured memory_bytes: 6460
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>
#include<cmath>
#include<cstring>
#include<map>
#include<sstream>
 
using namespace std;
 
int main(){
 
long H;
int N;
  
cin>>H>>N;
  
int A[N];
  for(int i = 0; i < N; i++)
    cin>>A[i];

for (int i = 0; i < N; i++) {
  H -= A[i];
}

if(H <= 0){ 
  cout << "Yes" <<endl;
} else {
  cout << "No" <<endl;
}
  
}

Measured memory_bytes: 640
S = list(input())

C = []
for i in range(len(S)):
    if i%2 == 0:
        C.append('0')
    if i%2 == 1:
        C.append('1')

a = 0
for s,c in zip(S, C):
    if s == c:
        a += 1

print(min([a, len(S)-a]))


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

vector<int> forintinput(int n) {
	vector<int> x(100000);
	for(int i = 0;i < n;i++) cin >> x[i];
	return x;
}
int main(){
	char c;
	cin >> c;
	cout << char(c+1) << endl;
}

Measured memory_bytes: 3568
import java.util.Scanner;
public class Main{
    static tree[] wd;
    static int root =-1;
	public static void main(String[] args) {
	    int i=0,j,n;
	    String x;
	// TODO Auto-generated method stub
     Scanner sca = new Scanner(System.in);
     n=sca.nextInt();
     wd=new tree[n];
    for(j=0;j<n;j++){
       x=sca.next();
    	if(x.equals("insert")){
	    wd[i]=new tree(sca.nextInt());
	    insert(i);
	    i++;
	 }
    	if(x.equals("print")){
    	    inorder(root);
    	    System.out.println("");
    	    preorder(root);
    	    System.out.println("");  		
    	}
	if(x.equals("find")){
	    if(find(sca.nextInt(),root)==true){
		System.out.println("yes");
	    }else{
		System.out.println("no");
	    }
	}
    }
   }
    public static void preorder(int nd){
	System.out.print(" "+wd[nd].getnode());
	if(wd[nd].getleft()!=-1)preorder(wd[nd].getleft());
	if(wd[nd].getright()!=-1)preorder(wd[nd].getright());
    }
    public static void inorder(int nd){
	if(wd[nd].getleft()!=-1)inorder(wd[nd].getleft());
	System.out.print(" "+wd[nd].getnode());
	if(wd[nd].getright()!=-1)inorder(wd[nd].getright());
    }
    public static void insert(int data){//NIL->-1
     int y=-1,x=root;//parent of x
     while(x!=-1){
    	y=x;
    	if(wd[data].getnode()<wd[x].getnode()){
    		x=wd[x].getleft();
    	}else{
    		x=wd[x].getright();
    	}
    }
     if (y==-1){//it is root
    	 root=data;
     }else if(wd[data].getnode()<wd[y].getnode()){
    	 wd[y].setleft(data);
     }else{
    	 wd[y].setright(data);
     }
    }
    public static boolean find(int key,int opo){
	if(opo==-1)return false;
	if(key==wd[opo].getnode())return true;
	if(key<wd[opo].getnode()){
	return find(key,wd[opo].getleft());
	}else{
	return find(key,wd[opo].getright());
	}
    }
}
class tree{
    int node,par,n,i,degree=0;
    int left=-1,right=-1;
    tree(int node){
	this.node=node;
    }
    public int getnode(){
	return node;
    }
    public void setleft(int c){
	left=c;
	if(left!=-1) degree++;
    }
    public int getleft(){
	return left;
    }
    public void setright(int c){
	right=c;
	if(right!=-1) degree++;
    }
    public int getright(){
	return right;
    }
}



Measured memory_bytes: 222524
using DataStructures
const double = Float64
const int = Int64

parseint(x) = parse(int, x)
readint() = map(parseint, split(readline()))

function main()
  N,K = readint()
  p = readint()

  S = Vector{double}(undef,N+1)
  Smax = 0
  S[1] = 0
  for i in 1:N
    S[i+1] = S[i] + (1+p[i])/2
  end

  for i in K:N
    if S[i+1] - S[i-K + 1] > Smax
      Smax = S[i+1] - S[i-K + 1]
    end
  end
  println(Smax)
end

main()

Measured memory_bytes: 219572
#include "bits/stdc++.h"
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair <ll, ll > pll;

bool comp(const pll &a, const pll &b) {
	return a.first < b.first;
}
std::vector<int> enum_div(int n)//nの約数を列挙
{
	std::vector<int> ret;
	for (int i = 1; i*i <= n; ++i)
	{
		if (n%i == 0)
		{
			ret.push_back(i);
			if (i != 1 && i*i != n)
			{
				ret.push_back(n / i);
			}
		}
	}
	return ret;
}


template<int N>
int factorial() {
	return factorial<N - 1>() * N;
}

template<>  /// 特殊化：factorial<N=”1”>だったら，値を返す
int factorial<1>() {
	return 1;
}
int main()
{
	priority_queue<int> q;
	string s = {};
	string s1 = {};
	ll h = 0, w = 0, k = 0, a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, ans = 0;
	ll x[300005] = {};
	ll y[300005] = {};
	ll y2[302][302] = {};
	cin >> a;
	cin >> b;
	if (a==b)
	{
	//cout << ans << endl;
		cout << "Yes" << endl;

	}
	else
	{
		cout << "No" << endl;

	}

	//cout << ans << endl;



	//return 0;

	/*cout << c << endl;
	cout << b << endl;*/
	//cout << fixed << setprecision(10) <<tmp << endl;
	//cout<<factorial<10><<endl;
	return 0;
}
//2つの組の数をソートしたりするやつ
//vector<pair<ll, ll> > hoges(a);
//for (int i = 1; i <= a; i++)
//{
//	cin >> h;
//	hoges[i - 1] = make_pair(h, i);
//}
//sort(hoges.begin(), hoges.end(), comp);
//for (int i = 0; i < a; i++)
//{
//	cout << hoges[i].second << endl;
//}


Measured memory_bytes: 256
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    return

if __name__=='__main__':
    s = S()
    if s=="RRR":
        print(3)
    elif s=="RRS" or s=="SRR":
        print(2)
    elif s=="SSS":
        print(0)
    else:
        print(1)
    solve()

Measured memory_bytes: 27152
import sys
import collections

# Set max recursion limit
sys.setrecursionlimit(1000000)


def li_input():
    return [int(_) for _ in input().split()]

def to_bin(k):
    return bin(k)[2:]


def main():
    N = int(input())
    A = li_input()
    M = int(input())
    Q = li_input()

    B = []
    D = collections.defaultdict(lambda: 0)

    for i in range(2 ** len(A)):
        b = to_bin(i)

        if len(b) < len(A):
            b = "0" * (len(A) - len(b)) + b
        
        B.append(b)

    for b in B:
        s = 0
        for i,is_add in enumerate(b):
            if is_add == "1":
                s += A[i]

        D[s] = 1
    
    for q in Q:
        if D[q] == 1:
            print("yes")
        else:
            print("no")
            


main()



Measured memory_bytes: 89016
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (in i = 0; i < (in)(n); i++)
#define REP(i,a,b) for(in i=(in)(a);i<(in)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 998244353;
const in INF=1e18+7;
const in inf=1e9+7;
using P=pair<in,in>;
vector<in> dx={0,1,-1,0};
vector<in> dy={1,0,0,-1};

//a^n (mod)
in modpow(in a, in n, in mod) {
    in res = 1ll;
    while (n > 0ll) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    in n;
    cin>>n;
    vector<in> a(n-1,0);
    in a1;
    cin>>a1;
    if(a1!=0ll){
        cout<<0<<endl;
        return 0;
    }
    if(n==1){
        cout<<1<<endl;
        return 0;
    }
    rep(i,n-1) cin>>a.at(i);
    sort(all(a));
    if(a[0]==0){
        cout<<0<<endl;
        return 0;
    }
    in cnt=upper_bound(all(a),1)-a.begin();
    in now=1ll;
    in ans=1ll;
    while(now!=a[a.size()-1ll]){
        now ++;
        in cnt2=upper_bound(all(a),now)-upper_bound(all(a),now-1);
        ans *=modpow(cnt,cnt2,MOD);
        ans %=MOD;
        cnt =cnt2;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long INFLL = 1LL << 60;
const int INFINT = 1 << 30;
const long long MOD = 1e9 + 7;

template <class T> void vecout(T V) {
    auto t = V.begin();
    while(t != V.end()) {
        cout << *t++;
        if(t != V.end()) cout << " ";
    }
    cout << endl;
};

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

    int n;
    vector<int> v(3);
    rep(i, 3) cin >> v[i];
    sort(v.begin(), v.end());
    cout << v[0] << " " << v[2] << "\n";
}



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

#define rep(i,n) for(int i=0;i<(n);++i)
#define loop for(;;)
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;
#define inf (1e9)
#define eps (1e-9)

int main() {
  loop {
    string s; cin >> s;
    if (not cin) break;
    int n = s.size();
    vector<int> xs(n);
    rep (i, n) xs[i] = s[i] - '0';
    for (;n>1;--n)
      rep (i, n) xs[i] = (xs[i] + xs[i+1]) % 10;
    cout << xs[0] << endl;
  }

  return 0;
}

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

int main() {
  int H, W;
  cin >> H >> W;
  string a, b(W + 2, '#');
  for (cout << b << endl; H; H--) {
    cin >> a;
    cout << '#' << a << '#' << endl;
  }
  cout << b;
}


Measured memory_bytes: 3604
#include <algorithm>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
 
#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()
 
#define INF ((1ll << 31)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);}} premain;

#define MAX_N (100000)

int N, M;
int S, T;
vector<vector<int>> G;
int d[MAX_N*3 + 1] = {-1};
queue<int> que;

static int bfs(void)
{
  que.push(S);
  REP(i,N*3+1) {
    d[i] = -1;
  }
  d[S] = 0;

  while (que.size()) {
    auto p = que.front(); que.pop();
    if (T == p) {
      return d[p];
    }

    for (const auto &pp : G[p]) {
      if (d[pp] == -1) {
        que.push(pp);
        d[pp] = d[p]+1;
      }
    }
  }

  return -1;
}

int main() {
  cin >> N >> M;
  
  G.resize(3*N+1);
  
  REP(i, M) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v+N);
    G[u+N].push_back(v+2*N);
    G[u+2*N].push_back(v);
  }
  cin >> S >> T;

  int ans = bfs();
  if (-1 == ans) {
    print(-1);
  } else {
    print(ans / 3);
  }
}


Measured memory_bytes: 17792
import java.util.*;

class Main{

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


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

        boolean ret = (a <= c) && (b >= c);

        if (ret) {
            System.out.println ("Yes");
        } else {
            System.out.println ("No");
        }
    }
}

Measured memory_bytes: 21332
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,num=0;
  int x[105],ans[105]={};

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>x[i];
    if(x[i]>num) num=x[i];
  }

  for(int i=1;i<=num;i++){
    for(int j=0;j<n;j++){
      ans[i-1]+=(x[j]-i)*(x[j]-i);
    }
  }

  sort(ans,ans+num);
  cout<<ans[0]<<endl;
  return 0;
}

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

#define INF INT_MAX/2
#define MOD 1000000007

using namespace std;

using ll = long long;
using ull = unsigned long long;

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

   string S;
   cin>>S;
   int ans = 700;
   if(S[0]=='o')ans+=100;
   if(S[1]=='o')ans+=100;
   if(S[2]=='o')ans+=100;
   cout<<ans<<endl;
   return 0; 
}


Measured memory_bytes: 256
<?php
fscanf(STDIN, '%d', $n);
$q = new SplPriorityQueue();
for ($i  = 0; $i < $n; $i++) {
    fscanf(STDIN, '%d %d', $a, $b);
    $q->insert([$a, $b], 10 ** 9 - $b);
}

$flag = true;
$t = 0;
while (!$q->isEmpty()) {
    $s = $q->extract();
    $t += $s[0];
    if ($t > $s[1]) {
        $flag = false;
        break;
    }
}
if ($flag) echo 'Yes'.PHP_EOL;
else  echo 'No'.PHP_EOL;

Measured memory_bytes: 170488
import java.util.*;
public class Main {
	//定義関数から参照できる変数定義はこの辺
	static int N;
	static int V [];
	static int C [];
	static int ans=0;
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
		//long Var_name = sc.nextLong();
    	N=sc.nextInt();
    	V=new int[N+1];
    	C=new int[N+1];

    	for(int i=1;i<=N;i++){
    		V[i]=sc.nextInt();
    		//C[i]=sc.nextInt();
    	}


    	for(int i=1;i<=N;i++){
    		C[i]=sc.nextInt();
    	}

    	for(int i=1;i<=N;i++){
    		if (V[i]>C[i]) {
    			ans=ans+(V[i]-C[i]);
    		}
    	}



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

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

ll a[1002],seki[41];
int main() {
	ll n,k;
	cin>>n>>k;
	for(ll i=0;i<n;i++){
		cin>>a[i];
	}
	seki[0]=1;
	for(ll i=1;i<=40;i++){
		seki[i]=2*seki[i-1];
	}
	vector<ll>b;
	for(ll i=0;i<n;i++){
		ll sum=0;
		for(ll j=0;j+i<n;j++){
			sum+=a[i+j];
			b.push_back(sum);
			//cout <<sum<<endl;
		}
	}
	ll ans=0;
	for(ll i=40;i>=0;i--){
		ll cnt=0;
		for(ll j=0;j<b.size();j++){
			if((ans+seki[i]&b[j])==ans+seki[i]){
				cnt++;
			}
		}
		if(cnt>=k){
			ans+=seki[i];
		}
	}
	cout <<ans;
	// your code goes here
	return 0;
}

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

using namespace std;

double EPS = 1e-10;
const double PI = acos(-1);

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }

  point operator / (double d){
    return point(x/d,y/d);
  }
  
  bool operator == ( const point &p ) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};

struct segment{
  point a,b;
};

bool cmp_x(const point& p, const point& q){
  if(p.x != q.x)return p.x<q.x;
  return p.y < q.y;
}

double dot(point a, point b) {
  return (a.x * b.x + a.y * b.y);
}

double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}

double vec_abs(point a){
  return sqrt(a.x*a.x+a.y*a.y);
}

double dist(point a,point b){
  return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}

double areaPol(vector<point> t, int n){
  t.push_back(t[0]);
  int tsz=t.size();
  double area=0;
  for(int i=0;i<tsz-1;i++){
    area+=(t[i].x-t[i+1].x)*(t[i].y+t[i+1].y);
  }
  return abs(area)/2.0;
}


int main(void){
  point p;
  vector<point>t;
  int n=0;
  double x,y;
  char k;

  while(cin>>x>>k>>y){
    p.x = x;
    p.y = y;
    t.push_back(p);
    n++;
 }

  printf("%.6f\n",areaPol(t,n));

  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vll vector<ll>
#define rep(c, a, b) for(ll c=a;c<b;c++)
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;

int main(int argc, char const *argv[]) {
  ll a, b;std::cin >> a >> b;
  if(a%3==0||b%3==0||(a+b)%3==0) std::cout << "Possible" << '\n';
  else std::cout << "Impossible" << '\n';
}


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

#define ll long long
#define ull unsigned long long
#define LL long long
#define sl(n) scanf("%lld", &n)
#define sf(n) scanf("%lf", &n)
#define si(n) scanf("%d", &n)
#define sch(n) scanf(" %c", &n)
#define ss(n) scanf("%s", n)
#define pii pair <int, int>
#define pll pair <ll, ll>
#define plp pair <int, pll >
#define pb push_back
#define fr first
#define sc second
#define all(a)  a.begin(),a.end()
#define Unique(a)  sort(all(a)),a.erase(unique(all(a)),a.end())

#define inf (1LL<<50)
#define eps 1e-9

ll Set(ll n, ll pos)
{
    return n|(1LL<<pos);
}

bool Check(ll n, ll pos)
{
    return (bool) (n&(1LL<<pos));
}

ll a[100010][3];
ll dp[100010][3];

int main ()
{
    //  freopen("input.txt", "r", stdin);
    //  freopen("output.txt", "w", stdout);
    //  ios_base::sync_with_stdio(0); // no printf/scanf must be present
    ll cs, ts, i, j, k, x, y, z, q, m, n, v;

    while(sl(n) != EOF)
    {
        for (i = 1; i <= n; i++)
        {
            sl(a[i][0]);
            sl(a[i][1]);
            sl(a[i][2]);
        }

        for (i = 1; i <= n; i++)
        {
            for (j = 0; j < 3; j++)
            {
                dp[i][j] = 0;
                for (k = 0; k < 3; k++)
                {
                    if (j == k) continue;
                    dp[i][j] = max(dp[i][j], dp[i-1][k] + a[i][j]);
                }
            }
        }

        printf("%lld\n", max(dp[n][2],max(dp[n][0], dp[n][1])));
    }
    return 0;
}


Measured memory_bytes: 4992
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl;

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
//const int N = 100000;

int N,P[10],Q[10];

int get_perm(int a[]){
	int ret=1;
    vector<int> perm(N);
    for (int i = 0; i < N; i++) perm[i] = i+1;
    do {
		bool flag=true;
		rep(j,N) if(a[j]!=perm[j]) flag=false;
		if(flag) break;
		ret++;
    } while (next_permutation(perm.begin(), perm.end()));
	return ret;
}

int main() {
	cin>>N;
	rep(i,N) cin>>P[i];
	rep(i,N) cin>>Q[i];
    cout << abs(get_perm(P)-get_perm(Q)) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
static const long long inf = (1LL<<32);

void solve(){
  int v, e; cin >> v >> e;
  vector<vector<long long> > a(v + 1, vector<long long>(v + 1));
  for(int i = 1; i <= v; i++){
    for(int j = 1; j <= v; j++){
      if(i == j) a[i][j] = 0;
      else a[i][j] = inf;
    }
  }

  for(int i = 0; i < e; i++){
    long long s, t, d; cin >> s >> t >> d;
    a[s + 1][t + 1] = d;
  }

  for(int k = 1; k <= v; k++){
    for(int i = 1; i <= v; i++){
      if(a[i][k] == inf) continue;
      for(int j = 1; j <= v; j++){
        if(a[k][j] == inf) continue;
        a[i][j] = min(a[i][j], a[i][k] + a[k][j]);
      }
    }
  }
  bool ng = false;
  for(int i = 1; i <= v; i++){
    if(a[i][i] < 0) ng = true;
  }
  if(ng){
    cout << "NEGATIVE CYCLE\n";
    return;
  }

  for(int i = 1; i <= v; i++){
    for(int j = 1; j <= v; j++){
      if(j < v){
        if(a[i][j] == inf) cout << "INF ";
        else cout << a[i][j] << " ";
      }
      else{
        if(a[i][j] == inf) cout << "INF\n";
        else cout << a[i][j] << endl;
      }
    }
  }
  return;
}

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



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

using namespace std;

using int64 = long long;

bool IsValid(vector<int>& xs) {
  for (int i = 0; i < xs.size() - 1; i++) {
    if (xs[i] > xs[i + 1]) return false;
  }
  return true;
}

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

  int n;
  cin >> n;
  vector<int> xs(n);
  for (int i = 0; i < n; i++) cin >> xs[i];

  bool ans = IsValid(xs);

  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      vector<int> ys(n);
      for (int k = 0; k < n; k++) {
        if (k == i) ys[k] = xs[j];
        else if (k == j) ys[k] = xs[i];
        else ys[k] = xs[k];
      }

      ans |= IsValid(ys);
    }
  }

  cout << (ans ? "YES" : "NO") << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int a = scan.nextInt();
			int b = scan.nextInt();
			if(a > b){
				System.out.println("a > b");
			}else if(a < b){
				System.out.println("a < b");
			}else if(a == b){
				System.out.println("a == b");
			}
		}finally{
			if(scan !=null)scan.close();
		}

	}
}

Measured memory_bytes: 17160
#include<iostream>
#include<vector>
using namespace std;
int main()
{
  int n, count;
  count  = 0;
  
  // 順列の個数を入力
  cin >> n;
  
  // nの範囲チェック
  if((n >= 3) && (n <= 20))
  {  
    // 順列の各数値の入力
    vector<int> p(n);
    for( int i = 0 ; i < n ; i++ )
    {
	  cin >> p[i];
    }
    
    // 順列チェック
    for( int i = 0 ; i < (n - 2) ; i++ )
    {
      if((p[i] < p[i+1]) && (p[i+1] < p[i+2]) ||
         (p[i] > p[i+1]) && (p[i+1] > p[i+2]))
      {
        count++;
      }
    }
    
    // 結果を出力
    cout << count << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <queue>
#include <vector>
#include <cstdlib>
#define mp make_pair
#define pb push_back
#define mem(i,a) memset(i,a,sizeof(i))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
const int DMAX=100000+5;
const int MOD=1000000000+7;
template<class T> inline void read(T &x){
	x=0;
	T f=1;
	char ch=getchar();
	while(ch<'0' || ch>'9'){
		if(ch=='-'){
			f=-1;
		}
		ch=getchar();
	}
	while(ch<='9' && ch>='0'){
		x=x*10+(ch-'0');
		ch=getchar();
	}
	x*=f;
}
ll n;
ll ans=0;
int main(){
	read(n);
	for(ll i=1;i*i<=(n-1);i++){
		if((n-1)%i==0){
			ans+=2;
		}
		if(i*i==(n-1)){
			ans--;
		}
	}
	ans--;
//	cout<<ans<<" ";
	for(ll i=2;i*i<=n;i++){
		if(n%i!=0){
			continue;
		}
		ll p=n;
		while(p%i==0){
			p/=i;
		}
		if(p%i==1){
			ans++;
		}
	}
	printf("%lld\n", ans+1);
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
    int a, b, t;
    double tempo;
    int total;
    scanf("%d %d %d", &a, &b, &t);

    tempo = t + 0.5;
   
    total = ((int)tempo / a) * b;
    printf("%d", total);

    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)

using ll = long long;
using ull = unsigned long long;
constexpr ll mod = 1e9 + 7;
using namespace std;

int main() {

	ll N, K, Q; cin >> N >> K >> Q;
	vector<ll> A(Q); rep(i, Q)cin >> A[i];
	vector<ll> cnt(N, 0);//得点減点が免除される回数
	vector<ll> score(N, K);
	rep(i, Q) {
		cnt[A[i] - 1]++;
	}
	rep(i, N) {
		score[i] -= (Q - cnt[i]);
	}
	rep(i, N) {
		if (score[i] > 0)cout << "Yes" << endl;
		else cout << "No" << endl;
	}

	return 0;

}

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

int main(){
	string s;long long int k,i;
	while(cin>>s>>k){
		long long int noo=0;
		for(i=0;i<s.size()&&s[i]=='1';i++,noo++);
		if(k<=noo)cout<<'1'<<endl;
		else cout<<s[i]<<endl;
	}
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>
#include<map>

#define int long long
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
//const int INF=1001001001;
const int INF=1001001001001001001;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))
FILE *rf;
FILE *of;

//???????????????????????????
#define LLD int
const int MAX_V=100002;
struct edge{ 
	int to,cost;
};
vector<edge> edges[MAX_V];//V??????????????????
LLD d[MAX_V];//???????????????????????¢
int N,K;

void dijkstra(int s){//??§????s???????????????????????????????????±???????
    priority_queue< pair<LLD,int> , vector< pair<LLD,int> > , greater<pair<LLD,int> > > que;
    fill(d,d+N,INF);
    d[s]=0;
    que.push(make_pair(0,s) );
 
    while(!que.empty() ){
        pair<LLD,int> p=que.top(); que.pop();
        int v=p.sc;if(v==N-1)break;
        if( d[v] < p.first ) continue;
		
        rep(i,edges[v].size()){
            edge e=edges[v][i];
			if(d[e.to] > d[v]+e.cost){
				d[e.to]=d[v] + e.cost;
                que.push( make_pair(d[e.to], e.to ) );
            }
        }
    }
}

vector< int> maps[MAX_V];int C[MAX_V];int R[MAX_V];
int MAIN_SYORI(){
	
	scanf("%lld %lld",&N,&K);
	rep(i,N){
		if(edges[i].size())edges[i].clear();
		if(maps[i].size())maps[i].clear();}
	rep(i,N){
		scanf("%lld %lld",&C[i],&R[i]);
	}
	
	rep(i,K){
		int a,b;
		scanf("%lld %lld",&a,&b);
		a--;b--;
		maps[a].pb(b);
		maps[b].pb(a);
	}
	rep(i,N){
		bool iftuka[MAX_V];
		fill(iftuka,iftuka+N,false);
		queue< pair<int,int> > q;
		q.push(mp(i,R[i]));
		edge e;e.cost=C[i];
		iftuka[i]=true;
		while(!q.empty()){
			pair<int,int> p=q.front();q.pop();
			if(p.sc<1)continue;
			rep(j,maps[p.fr].size() ){
				int ne=maps[p.fr][j];
				if(!iftuka[ne]){
					iftuka[ne]=true;
					e.to=ne;edges[i].pb(e);
					q.push(mp(ne,p.sc-1));
				}
			}
		}
	}
	dijkstra(0);
	printf("%lld\n",d[N-1]);
	return 0;
}


signed main(){
	MAIN_SYORI();
	return 0;
}

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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

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

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

void solve ( int test_case )
{
    int n ;
    cin >> n ;

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

    int ans = INT_MAX ;
    for ( int i = 1 ; i <= 100 ; i ++ )
    {
        int cnt = 0 ;
        for ( auto j : v )
        {
            int t = (i - j) ;
            cnt += ( t * t ) ;
        }

        ans = min ( ans , cnt ) ;
    }

    cout << ans ; line ;


}

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i=1 ; i <= t ; i ++ ) solve ( i ) ;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>
#include <queue>

using namespace std;
using ll = long long;
// using P = pair<ll, ll>;
// //価格、割引枚数

const ll INF = 1<<30;
const ll MOD = (ll)1e9 + 7;
const ll MAX_N = (ll)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, m; cin >> n >> m;
    priority_queue<ll> que;
    for(ll i = 0; i < n; i++)
    {
        ll x; cin >> x;
        que.push(x);
    }
    while(m--)
    {
        ll x = que.top(); que.pop();
        que.push(x / 2);
    }
    ll ans = 0;
    while(que.size())
    {
        ans += (ll)que.top();
        que.pop();
    }
    cout << ans << endl;
    return 0;
}



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

string s;
ll n;
ll f[26];
ll res;

int main(){
	cin >> s;
	n=s.size();
	for(int i=0;i<s.size();i++)f[s[i]-'a']++;
	res=(n*(n-1))/2+1;
	for(int i=0;i<26;i++)res-=(f[i]*(f[i]-1))/2;
	cout << res << endl;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	static Scanner scanner;

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

	    int H=gi();
	    int W=gi();
	    int h=gi();
	    int w=gi();
	    
        System.out.println((H-h)*(W-w));
//        if (m<=4) {
//        	System.out.print("Heisei");
//        }else {
//        	System.out.print("TBD");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Measured memory_bytes: 35560
#include<bits/stdc++.h>
using namespace std;
#define INFTY 1<<20
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long int ll;
using ipair = pair<int,int>;
bool operator< (const ipair a, const ipair b){return a.first < b.first;};
const int MOD=1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main(){ 
    string s;cin>>s;
    int cnt = 0,ans = 0;
    rep(i,3){
        if(s[i]=='R'){
            cnt++;
        }else{
            ans = max(ans,cnt);
            cnt = 0;
        }
    }
    ans = max(ans,cnt);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <cmath>

using namespace std;

inline double sq (double x) {
    return x * x;
}

double rad (double x1, double y1, double x2, double y2) {
    double a = x1 * x2 + y1 * y2;
    double b = sqrt(sq(x1) + sq(y1)) * sqrt(sq(x2) + sq(y2));
    return acos(a / b);
}

int main (void) {
    double x1, x2, x3, xp;
    double y1, y2, y3, yp;
    for (;;) {
        cin >> x1; cin >> y1;
        cin >> x2; cin >> y2;
        cin >> x3; cin >> y3;
        cin >> xp; cin >> yp;
        if (cin.eof()) break;
        double d1, d2, d3;
        d1 = rad(xp - x1, yp - y1, xp - x2, yp - y2);
        d2 = rad(xp - x1, yp - y1, xp - x3, yp - y3);
        d3 = rad(xp - x2, yp - y2, xp - x3, yp - y3);
        if (d1 + d2 + d3 < 2 * M_PI)
            cout << "NO" << endl;
        else
            cout << "YES" << endl;
    }
    return 0;
}

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

res = []
for i in range(1, n+1):
    si, pi = list(input().split())
    res.append([si, int(pi), i])
    
res.sort(key = lambda x: x[1], reverse=True)
#print(res)
res.sort(key = lambda x: x[0])
#print(res)

for i in range(n):
    print(res[i][2])

Measured memory_bytes: 3060