akhauriyash/Code-Regression huggingface dataset:
/* C++標準ヘッダファイル */
/* 文字列ライブラリ */
#include <string>

/* コンテナライブラリ */
#include <array>
#include <vector>
#include <deque>
#include <list>
#include <forward_list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>

/* アルゴリズムライブラリ */
#include <algorithm>

/* 数値演算ライブラリ */
#include <cmath>
#include <math.h>

/* 入出力ライブラリ */
#include <iostream>

/* std使用<-namespace */
using namespace std;

/* define */
#define rpt(i, n) for(ll i = 0; i < (n); i++)  // リピート
#define PI (acos(-1))  // 円周率pi

/* typedef */
// long long
typedef long long ll;

// pair
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef pair<double, double> d_d;

/* main関数 */
int main(void) {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		double d1 = (double)i * 1.08;
		int d2 = (int)d1;
		if (d2 == n) {
			cout << i;
			return 0;
		}
	}
	cout << ":(";

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
int main(){
  ll bingo[3][3]={0};
  bool ishole[3][3];
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++) ishole[i][j]=false;
  }
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++) cin>>bingo[i][j];
  }
  ll n; cin>>n;
  for(int q=0;q<n;q++){
    ll a;
    cin>>a;
    for(int i=0;i<3;i++){
      for(int j=0;j<3;j++){
        if(bingo[i][j]==a) ishole[i][j]=true;
      }
    }
  }
  bool f=false;
  for(int i=0;i<3;i++){
    if(ishole[i][0]&&ishole[i][1]&&ishole[i][2]) f=true;
    if(ishole[0][i]&&ishole[1][i]&&ishole[2][i]) f=true;
  }
  if(ishole[0][0]&&ishole[1][1]&&ishole[2][2]) f=true;
  if(ishole[2][0]&&ishole[1][1]&&ishole[0][2]) f=true;
  cout<<(f?"Yes":"No")<<endl;
}


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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) for(int i=0;i<=(n);++i)
#define ALL(v) (v).begin(),(v).end()

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

string a;

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

	cin>>a;
	vector<ll> cnt(26,0);
	REP(i,a.size()) cnt[a[i]-'a']++;
	ll c=(a.size()*(a.size()-1))/2;
	ll d=0;
	REP(i,26) d+=(cnt[i]*(cnt[i]-1))/2;
	cout<<c-d+1<<endl;

	return 0;
}


Measured memory_bytes: 720
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=100100;
int i,j,k,n,En,ch,ff,ans,x,y;
int h[N],f[N];
struct edge { int s,n;} E[N<<1];
void R(int &x) {
	ff=x=0;ch=getchar();
	while (ch<'0' || '9'<ch) { if (ch=='-') ff=1;ch=getchar();}
	while ('0'<=ch && ch<='9') x=x*10+ch-'0',ch=getchar();
}
void E_add(int x,int y) {
	E[++En].s=y;E[En].n=h[x];h[x]=En;
	E[++En].s=x;E[En].n=h[y];h[y]=En;
}
void dfs(int x,int F) {
	int t=0,tt=0;
	for (int k=h[x];k;k=E[k].n) if (E[k].s!=F) {
		dfs(E[k].s,x);
		tt|=f[E[k].s]&t;
		t|=f[E[k].s];
	}
	int i=0;
	while (((1<<i)<=tt) || ((1<<i)&t)) i++;
	ans=max(ans,i);
	f[x]=(t>>i<<i)|(1<<i);
}
int main() {
	R(n);
	for (i=1;i<n;i++) {
		R(x);R(y);
		E_add(x,y);
	}
	dfs(1,0);
	printf("%d\n",ans);
}

Measured memory_bytes: 7040
#include<iostream>
using namespace std;
int intcat(int i , int j )
{
int k;
char buf[255];

sprintf(buf,"%d%d",i,j);
sscanf(buf,"%d",&k) ;
return(k);
}

int main()
{
  int tmp;
  int number[3];
  for(int i= 0; i < 3; i++){
  cin >> number[i];
  }
  
    for (int i=0; i<3; ++i) {
    for (int j=i+1; j<3; ++j) {
      if (number[i] > number[j]) {
        tmp =  number[i];
        number[i] = number[j];
        number[j] = tmp;
      }
    }
  }
 int k = intcat(number[2],number[1]);
  cout << k+number[0] << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>

using namespace std;

typedef long long ll;

int n, m;
int a[100][100];
int b[100][100];
int ansA[100][100];
int ansB[100][100];
int rowInA[100 * 100];
int rowInB[100 * 100];

vector<int> g[100][100];
bool used[100];
int R[100];

bool dfs(int v) {
  if (used[v]) return false;
  used[v] = true;
  for (int to = 0; to < n; ++to) {
    if (g[v][to].empty()) continue;
    if (R[to] == -1 || dfs(R[to])) {
      R[to] = v;
      return true;
    }
  }
  return false;
}

int main()
{
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> a[i][j];
      a[i][j]--;
      rowInA[a[i][j]] = i;
    }
  }

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      b[i][j] = i * m + j;
      rowInB[b[i][j]] = i;
    }
  }

  for (int i = 0; i < n * m; ++i) {
    g[rowInA[i]][rowInB[i]].push_back(i);
  }

  for (int step = 0; step < m; ++step) {
    memset(R, -1, sizeof(R));
    int cur = 0;
    for (int row = 0; row < n; ++row) {
      memset(used, false, sizeof(used));
      if (dfs(row)) {
        cur++;
      }
    }
    assert(cur == n);
    for (int i = 0; i < n; ++i) {
      int v = R[i];
      int w = i;
      ansA[v][step] = g[v][w].back();
      ansB[w][step] = g[v][w].back();
      g[v][w].pop_back();
    }
  }

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (j != 0) cout << " ";
      cout << ansA[i][j] + 1;
    }
    cout << endl;
  }

  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (j != 0) cout << " ";
      cout << ansB[i][j] + 1;
    }
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 1152
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

bool input(int num[4])
{
	int zero=0;
	for(int i=0;i<4;i++)
	{
		cin>>num[i];
		if(num[i]==0)
		{
			zero++;
		}
	}
	if(zero==4)
	{
		return false;
	}
	else
	{
		return true;
	}
}

char ope[3]={'*','+','-'};

#define OPE 0
#define NUM 1

int type[5][7]={
	{NUM,NUM,NUM,NUM,OPE,OPE,OPE},
	{NUM,NUM,NUM,OPE,NUM,OPE,OPE},
	{NUM,NUM,NUM,OPE,OPE,NUM,OPE},
	{NUM,NUM,OPE,NUM,NUM,OPE,OPE},
	{NUM,NUM,OPE,NUM,OPE,NUM,OPE}
};

int elmtype(char c)
{
	if('0'<=c&&c<='9')
	{
		return NUM;
	}
	else
	{
		return OPE;
	}
}

bool check(char exp[7], int tp[7])
{
	for(int i=0;i<7;i++)
	{
		if(elmtype(exp[i])!=tp[i])
		{
			return false;
		}
	}
	return true;
}

bool check(char exp[7])
{
	for(int i=0;i<5;i++)
	{
		if(check(exp,type[i]))
		{
			return true;
		}
	}
	return false;
}

int calc(char exp[7])
{
	vector<int> stk;
	for(int i=0;i<7;i++)
	{
		if(elmtype(exp[i])==NUM)
		{
			stk.push_back(exp[i]-'0');
		}
		else
		{
			int a,b,c;
			a=stk.back(); stk.pop_back();
			b=stk.back(); stk.pop_back();
			if(exp[i]=='*')
			{
				c=b*a;
			}
			else if(exp[i]=='+')
			{
				c=b+a;
			}
			else
			{
				c=b-a;
			}
			stk.push_back(c);
		}
	}
	return stk.back();
}

string conv(char exp[7])
{
	vector<string> stk;
	for(int i=0;i<7;i++)
	{
		if(elmtype(exp[i])==NUM)
		{
			string s;
			s.push_back(exp[i]);
			stk.push_back(s);
		}
		else
		{
			string a,b,c;
			a=stk.back(); stk.pop_back();
			b=stk.back(); stk.pop_back();
			c.push_back('(');
			c.append(b);
			c.push_back(' ');
			c.push_back(exp[i]);
			c.push_back(' ');
			c.append(a);
			c.push_back(')');
			stk.push_back(c);
		}
	}
	return stk.back();
}

void sort(int num[4])
{
	for(int i=0;i<4;i++)
	{
		int min=i;
		for(int j=i+1;j<4;j++)
		{
			if(num[min]>num[j])
			{
				min=j;
			}
		}
		int tmp=num[i];
		num[i]=num[min];
		num[min]=tmp;
	}
}

string solve(int num[4])
{
	sort(num);
	for(int i=0;i<3;i++){
		for(int j=i;j<3;j++){
			for(int k=j;k<3;k++){
				char exp[7]={num[0]+'0',num[1]+'0',num[2]+'0',num[3]+'0',ope[i],ope[j],ope[k]};
				while(next_permutation(exp,exp+7))
				{
					if(check(exp)&&calc(exp)==10)
					{
						return conv(exp);
					}
				}
			}
		}
	}
	return "0";
}

int main(void)
{
	int num[4];
	while(input(num))
	{
		cout<<solve(num)<<endl;
	}
	return 0;
}

Measured memory_bytes: 1232
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
using namespace std;

#include <vector>

int main(int argc, char* argv[]){
        char buf[4*100+1]={0};
        char* p=NULL;
        int N = 0;
        vector<int> v;
        int a = 0;
        int b = 0;

        if(fgets(buf, sizeof(buf)-1, stdin)==NULL){
                return 1;
        }
        N = atoi(buf);

        memset(buf, 0, sizeof(buf));
        if(fgets(buf, sizeof(buf)-1, stdin)==NULL){
                return 1;
        }
        p = strtok(buf, " ");
        v.clear();
        v.push_back(atoi(p));
        for(int i=1; i<N; i++){
                p = strtok(NULL, " ");
                int tmp = atoi(p);
                int s = 0;
                int e = v.size();
                for(; e-s>1 ;){
                        int m = (s+e)/2;
                        if(tmp<v[m]){
                                e = m;
                        }
                        else if(tmp>=v[m]){
                                s = m;
                        }
                }
                if(tmp<v[s]){
                        v.insert(v.begin()+s, tmp);
                }
                else{
                        v.insert(v.begin()+s+1, tmp);
                }
        }

#ifdef DEBUG1
        printf("input: N=%d\n", N);
        for(int i=0; i<N; i++){
            printf("A[%d]=%d\n", i, v[i]);
        }
#endif
        for(int i=0; i<N; i++){
                if(v.size()>0){
                        a+=v[v.size()-1];
                        v.pop_back();
                }
                if(v.size()>0){
                        b+=v[v.size()-1];
                        v.pop_back();
                }
        }
        printf("%d\n", (a-b));
        return 0;
}

Measured memory_bytes: 256
while True:
    m,f,r = map(int,input().split())
    s = m + f
    if m == f == r == -1:break
    if m == -1 or f == -1:
        score = "F"
    elif s >= 80:
        score = "A"
    elif 65 <= s <80:
        score = "B"
    elif 50 <= s < 65:
        score = "C"
    elif 30 <= s < 50 and r >= 50:
        score = "C"
    elif 30 <= s < 50:
        score = "D"
    else:
        score = "F"
    print(score)


Measured memory_bytes: 5592
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        FastReader s = new FastReader();
        String s1=s.next();
        if(s1.equals("ABC"))
            System.out.println("ARC");
        else
            System.out.println("ABC");
    }

    private static boolean isPrime(int n) {
        if (n == 2)
            return true;
        else if ((n % 2 == 0 && n > 2) || n < 2)
            return false;
        else {
            for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {
                if (n % i == 0)
                    return false;
            }
            return true;
        }


    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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

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

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

}

Measured memory_bytes: 25388
#include<bits/stdc++.h>
#define pir pair<int,int>
#define qmin(x,y) (x=min(x,y))
#define qmax(x,y) (x=max(x,y))
#define rsort(x,y) sort(x,y),reverse(x,y)
#define fr first
#define se second
using namespace std;
typedef long long ll;
const int Maxn=2100000;
const int inf=0x3f3f3f3f;

signed main() {
    // freopen("test.in","r",stdin);
    int x;
    scanf("%d",&x);
    if(x<600) puts("8");
    else if(x<800) puts("7");
    else if(x<1000) puts("6");
    else if(x<1200) puts("5");
    else if(x<1400) puts("4");
    else if(x<1600) puts("3");
    else if(x<1800) puts("2");
    else if(x<2000) puts("1");
    return 0;
}

Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std;
int main() {
	int D, N;
	cin >>D >> N;
	if (N==100) {
		cout<<(N+1);
	}
	else cout<<N;
	for(int i=0;i<D;i++) {
		cout<<"00";
	}
	
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
    for (int i = 0; i < 5; ++i) {
        int a = 0;
        cin >> a;
        if (a == 0) {
            printf("%d\n", i + 1);
            break;
        }

    }
}


Measured memory_bytes: 3756
import sys

S = input()

def check():
  for i in range(len(S)) :
    if i%2!=0 and S[i]=="R" :
      print("No")
      sys.exit(0)
    elif i%2==0 and S[i]=="L" :
      print("No")
      sys.exit(0)
check()
print("Yes")
sys.exit(0)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final long n = scanner.nextLong();

        for (long i = (int) Math.sqrt(n); i >= 2; i--) {
            if (n % i == 0) {
                System.out.println(Long.toString(n / i).length());
                return;
            }
        }

        System.out.println(Long.toString(n).length());
    }
}

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

#define REP(i, n) for(decltype(n) i = 0; i < n; i++)

#define ALL(c)   c.begin(), c.end()
#define SORT(c)  std::sort(ALL(c))
#define RSORT(c) std::sort(ALL(c), std::greater<decltype(c)::value_type>())

using namespace std;
using ll = long long;

const int MOD  = (int)1e9 + 7;
const int INF  = (int)1e9 + 1;
const ll  LINF = (ll)1e18 + 1;

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

    string s;
    std::cin >> s;

    int ans   = 0;
    REP(i, s.size()) {
        if(i % 2 == 1) {
            if(s[i] == 'g') ans++;
        }
        else {
            if(s[i] == 'p') ans--;
        }
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(register int i=st,i##end=ed;i<=i##end;++i)
#define DREP(i,st,ed) for(register int i=st,i##end=ed;i>=i##end;--i)
typedef long long ll;
inline int read(){
	int x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1)+(x<<3)+(c^'0');
	return x*f;
}
inline ll readll(){
	ll x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1ll)+(x<<3ll)+(c^'0');
	return x*f;
}
const int maxn=1e5+10;
int a[maxn];
int main(){
	int n=read();
	REP(i,1,n) a[i]=read();
	sort(a+1,a+n+1,greater<int>());
	bool ans=0;
	REP(i,1,n) if(i+1>a[i+1]){
		int j=i+1;
		while(j<=n && a[j]==i) ans^=1,++j;
		ans|=(a[i]-i)&1;
		break;
	}
	if(ans) printf("First\n");
	else printf("Second\n");
	return 0;
}


Measured memory_bytes: 768
#include<cstdio>
#include<queue>
const int N = 1e5+5;
const int inf = 1e8+7;
struct Node{
    int p; int v;
    Node(int p = 0,int v = 0):p(p), v(v){}
    bool operator < (const Node& other)const{
        if(v!=other.v) return v>other.v;
        else return p>other.p;
    }
};
int a[N];
int f[N];
int next[N];

int min(int a,int b){ return a>b?b:a; }
//字典序最小的
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i = 0; i <= n; i++) scanf("%1d",&a[i]);
    std::priority_queue<Node>Q;
    for(int i = n; i >= 0; i--){
        if(i==n) f[i] = 0;
        else f[i] = inf;
        if(a[i]!=1){
        int last = i + m;
            while(Q.size() && Q.top().p>last) Q.pop();
            if(Q.size()){ 
                next[i] = Q.top().p;
                f[i] = min(f[i],Q.top().v+1);
            }
        }
        if(f[i]<inf) Q.push(Node(i,f[i]));
    }
    if(f[0]>=inf) printf("-1\n");
    else{
        int p = 0;
        while(p!=n){
            printf("%d ",next[p]-p);
            p = next[p];
        }
        printf("\n");
    }
    return 0;
}

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

int main(void) {
	string s;
	int cnt = 0;
	cin >> s;

	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'x') cnt++;
	}

	cout<< (cnt>7?"NO":"YES") << endl;

	return 0;
}

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

int main(){

	int N;
	scanf("%d", &N);

	char S[N];
	scanf("%s", S);

	int cnt=1;

	for( int j=0; j<N-1; j++ ){
		if( S[j] != S[j+1] ){
			cnt++;
		}
	}

	printf("%d", cnt);

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
static const int MAX=10000;
static const int INF=(1<<20);
static const int WH=0;
static const int GRY=1;
static const int BL=2;

int n;
vector<pair<int, int> > adj[MAX];

void DijkStra(){
  priority_queue<pair<int, int> > PQ;
  int color[MAX];
  int d[MAX];
  for(int i=0; i<n; i++)
  {
    d[i]=INF;
    color[i]=WH;
  }

  d[0]=0;
  PQ.push(make_pair(0, 0));
  color[0]=GRY;

  while(!PQ.empty())
  {
    pair<int, int> f = PQ.top();
    PQ.pop();
    int u=f.second;

    color[u]=BL;

    if(d[u] < f.first*(-1)) continue;

    for(int j=0; j<adj[u].size(); j++)
    {
      int v=adj[u][j].first;
      if(color[v] == BL) continue;
      if(d[v]>d[u]+adj[u][j].second)
      {
        d[v]=d[u]+adj[u][j].second;
        PQ.push(make_pair(d[v]*(-1), v));
        color[v]=GRY;
      }
    }
  }

  for(int i=0; i<n; i++)
  {
    cout << i << " " << (d[i] == INF ? -1 : d[i]) << endl;
  }
}

int main(){
  int k, u, v, c;

  cin >> n;
  for(int i=0; i<n; i++)
  {
    cin >> u >> k;
    for(int j=0; j<k; j++)
    {
      cin >> v >> c;
      adj[u].push_back(make_pair(v, c));
    }  
  }

  DijkStra();

  return 0;
}



Measured memory_bytes: 8000
#include <iostream>
#include <queue>
#include <vector>
#include <utility>
using namespace std;
typedef pair<int, int> P;
struct edge {int to, cost;};
const int INF = (1 << 28);
int n;
vector<edge> G[110];


vector<int> dijkstra(int s) {
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0, s));
    vector<int> d(n, INF);
    d[s] = 0;
    while (!que.empty()) {
        P p = que.top(); que.pop();
        int v = p.second;
        if (d[v] < p.first) continue;
        for (auto e: G[v]) {
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }
    return d;
}

int main(void) {
    cin >> n;
    for (int i = 0; i < n; i++) {
        int u, k, v, c;
        cin >> u >> k;
        for (int j = 0; j < k; j++) {
            cin >> v >> c;
            G[u].push_back(edge {v, c});
        }
    }
    vector<int> d = dijkstra(0);
    for (int i = 0; i < n; i++) {
        cout << i << " " << d[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 1280
import java.util.*;
import java.io.*;

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

		HashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();
		
		for(int i=0; i<n; i++){
			int num = sc.nextInt();
			if(!hm.containsKey(num)){
				hm.put(num, num);
			}else{
				hm.remove(num);
			}
		}

		System.out.println(hm.size());
	}
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  rep(i, n) cin >> a[i + 1];
  vector<int> b(n + 1);
  for (int i = n; i >= 1; i--) {
    int sum = 0;
    for (int j = i + i; j <= n; j += i) {
      sum ^= b[j];
    }
    b[i] = sum ^ a[i];
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (b[i])
      ans.push_back(i);
  }
  cout << ans.size() << endl;
  rep(i, ans.size()) {
    printf("%d%c", ans[i], i + 1 == ans.size() ? '\n' : ' ');
  }
  return 0;
}

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

n0 = int(input())
n1 = int(input())
max_profit = n1 - n0
min_price = min(n0, n1)
for i in range(n - 2):
	current = int(input())
	max_profit = max(max_profit, current - min_price)
	min_price = min(min_price, current)

print(max_profit)



Measured memory_bytes: 5612
#include <iostream>
using namespace std;
int main(void){
    int a,b,i;
    char op;
    while(cin >> a >> op >> b){

    if(op=='+'){
        cout << (a+b) << endl;    
    }
    else if(op=='-'){
        cout << (a-b) << endl;    
    }
    else if(op=='*'){
        cout << (a*b) << endl;    
    }
    else if(op=='/'){
        cout << (a/b) << endl;    
    }
    else if (op== '?')
        break;   
    }
}



Measured memory_bytes: 3068
#include <iostream>
#include <math.h>

using namespace std;

int main(){
    int D,N;
    cin>>D>>N;
    if (N != 100){
        cout << pow(100, D)*N << endl;
    }else{
        cout << int(pow(100, D)*(N+1)) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
const double pi=acos(-1);

int main(){
  int a,b;
  cin >> a>>b;
  cout <<max(0,a-2*b) << endl;
}

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

int main() {
    int N, a, b, B, sumA=0, sumB=0, Min;
    cin >> N;
    for (int A=1; A<N; A++){
     		B=N-A;
      		a=A, b=B;
            sumA=0, sumB=0;
            while (true){
              		sumA += a%10;
                    a = (a-a%10)/10;
                    if (a==0) break;
            }
            while (true){
              		sumB += b%10;
                    b = (b-b%10)/10;
              		if (b==0) break;
            }
            if ((Min>sumA+sumB)||A==1){
              		Min = sumA+sumB;
            }
    }
    cout << Min << endl;
              		
}

Measured memory_bytes: 3612
#include <cstdio>

inline int ds(int n)
{
  int s = 0;
  while (n != 0)
  {
    s += n % 10;
    n /= 10;
  }
  return s;
}

int main()
{
  int n;
  scanf("%d", &n);
  
  int ans = 1e9;
  for (int a = 1; a <= n / 2; ++a)
  {
    int b = n - a;
    if (ds(a) + ds(b) < ans) ans = ds(a) + ds(b);
  }
  printf("%d\n", ans);
  return 0;
}

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

int main(){
  int n,q,si,ti,c=0;
  int S[100005],T[50005];
  
  cin >> n;
  for (si=0;si<n;si++)cin >> S[si];

  cin >> q;
  for (ti=0;ti<q;ti++)cin >> T[ti];

  for (ti=0;ti<q;ti++){
    S[n]=T[ti];
    si=0;
    while (S[si]!=T[ti])si++;
    if (si<n)c++;
  }

  cout << c << endl;
  
  return 0;
}

Measured memory_bytes: 3112
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll V = 100000;
const ll INF = 1LL << 60;
using P = pair<ll, ll>;
vector<P> G[V];	//pair<辺の距離, 行き先の頂点>
vector<ll> dist(V); //dist[i]はsから頂点iへの最短距離が入る
vector<bool> used(V);
void dijkstra(ll s) {	//s : 始点
	//初期化
	fill(dist.begin(), dist.end(), INF);
	fill(used.begin(), used.end(), false);

	priority_queue<P, vector<P>, greater<P>> q;
	q.push(P(0, s));
	while (!q.empty()) {
		ll d;	//d : sからの距離
		ll t;	//t ; 行き先
		tie(d, t) = q.top();
		q.pop();
		if (used[t]) {	//もう探索済みか
			continue;
		}
		used[t] = true;
		dist[t] = d;
		for (P e : G[t]) {
			if (dist[e.second] <= d + e.first) {	//枝刈り
				continue;
			}
			q.push(P(d + e.first, e.second));
		}
	}
}

int main() {
	vector<string> s;

	REP(i, 2) {
		string str;
		cin >> str;
		s.push_back(str);
	}

	REP(i, 2) {
		REP(j, 3) {
			if (s[i][j] != s[1 - i][2 - j]) {
				cout << "NO" << endl;
				return 0;
			}
		}
	}

	cout << "YES" << endl;
}

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

map<int, int> mp;
int main(){
	int s;
	cin >> s;

	mp[s] = 1;
	int ans = 2;
	while(1){
		if(s % 2 ==0){
			s = s /2;
		}else{
			s = 3 * s + 1;
		}

		if(mp[s] == 1){
			cout << ans << endl;
			return 0;
		}else{
			mp[s] = 1;
			ans++;
		}
	}
}


			



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{

    long long a,b,c,d;
    cin>>a>>b>>c;
    if(2*c>=b-a+1)
    {
        for(long long i=a; i<=b; i++)
        {
            cout<<i<<endl;
        }


    }
    else
    {
//cout<<a<<endl;
        for(long long  i=a; i<a+c; i++)
            cout<<i<<endl;

        for (long long  i=b-c+1; i<=b; i++)
            cout<<i<<endl;

    }
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <cfloat>
#include <cmath>
#include <functional>
#include <forward_list>
#include <list>


#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
#define EPS 1e-9

#define MAX_N 

using namespace std;


class Main {
public:
	ll getAns(ll a, ll b, ll c) {
		if (a % 2 == 0 && b % 2 == 0 && c % 2 == 0 && a == b && b == c) {
			return -1;
		}

		ll count = 0;
		while (a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
			ll nextA = (b + c) / 2;
			ll nextB = (c + a) / 2;
			ll nextC = (a + b) / 2;
			a = nextA;
			b = nextB;
			c = nextC;
			count++;
		}

		return count;
	}
};

int main(void) {
	Main main;
	ll a, b, c;
	cin >> a >> b >> c;
	cout << main.getAns(a,b,c) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAXN 100000
int n,L[MAXN+5],S;
int main()
{
	scanf("%d%d",&n,&S);
	for(int i=1;i<=n;i++)
		scanf("%d",&L[i]);
	for(int i=1;i<=n-1;i++)
	if(L[i]+L[i+1]>=S)
	{
		printf("Possible\n");
		for(int j=1;j<=i-1;j++)printf("%d\n",j);
		for(int j=n-1;j>=i+1;j--)printf("%d\n",j);
		printf("%d\n",i);
		return 0;
	}
	printf("Impossible\n");
}

Measured memory_bytes: 1152
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc130/tasks/abc130_b>
 問題文============================================================
 =================================================================
 解説=============================================================
 
 シミュレーションなりしつつ回数を数えればいい
 
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll N,X; cin >> N >> X;
    vector<ll> L(N); for(auto& in:L) cin >> in;
    auto cusum = L;
    partial_sum(L.begin(),L.end(),cusum.begin());
    res = upper_bound(cusum.begin(),cusum.end(),X) - cusum.begin() + 1;
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void debug(String str) {
        boolean debug = false;
        if (debug != false) {
            return;
        }
        System.out.println(str);
    }

    public static void main(String[] args) {

        String S;

        try (Scanner sc = new Scanner(System.in)) {
            S = sc.next();
        }
        long[] Math = new long[S.length()];
        for (int i = 0; i < Math.length; i++) {
            Math[i] = 0;
        }
        boolean LR[] = new boolean[S.length()];
        for (int i = 0; i < LR.length; i++) {
            if (S.charAt(i) == 'L') {
                LR[i] = true;
            } else {
                LR[i] = false;
            }
        }
        //Rの個数
        long countR = 0;
        for(int i = 0; i < LR.length; i++){
            if(LR[i] == false){
                countR++;
            }else{
                Math[i] += countR /2;
                Math[i-1] += countR /2;
                if(countR % 2 ==1){
                    Math[i-1] += 1;
                }
                countR =0;
            }
        }
        //Lの個数
        long countL = 0;
        for(int i = 0; i < LR.length; i++){
            if(LR[(LR.length - i) -1] == true){
                countL++;
            }else{
                Math[(LR.length - i) -1] += countL /2;
                Math[(LR.length - i) -1+1] += countL /2;
                if(countL % 2 ==1){
                    Math[(LR.length - i) -1+1] += 1;
                }
                countL =0;
            }
        }

        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < Math.length; i++) {
            long l = Math[i];
            sb.append(l).append(" ");
        }
        System.out.println(sb.toString());
        return;

    }
}


Measured memory_bytes: 28644
//#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 (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1<<30;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};

struct edge{int to; int cost;};
vector<vector<edge>> graph(0);
vector<int> d(0);
const int MAX_dist=1e9;

void init(int n){
    graph.resize(n);
    d.resize(n,MAX_dist);
}

void dijkstra(int s){
    priority_queue<P, vector<P>, greater<P>> que;
    d[s]=0;
    que.emplace(0,s);
    while(!que.empty()){
        P p=que.top();
        que.pop();
        int v=p.second;
        if(d[v]<p.first) continue;
        rep(i,graph[v].size()){
            edge e=graph[v][i];
            if(d[e.to]>d[v]+e.cost){
            d[e.to]=d[v]+e.cost;
            que.emplace(d[e.to],e.to);
            }
        }
    }
}

int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int v,e,r;
    cin>>v>>e>>r;
    init(v);
    int s,t,dd;
    rep(i,e){
        cin>>s>>t>>dd;
        graph[s].push_back({t,dd});
    }
    dijkstra(r);
    rep(i,v){
        if(d[i]==MAX_dist) cout<<"INF"<<endl;
        else cout<<d[i]<<endl;
    }
}


Measured memory_bytes: 12884
ab = [int(i) for i in input().split()]

a = 0
b = 0

for i in range(0,ab[1]):
  a *= 10
  a += ab[0]

for i in range(0,ab[0]):
  b *= 10
  b += ab[1]

ab[0] = str(a)
ab[1] = str(b)

ab = sorted(ab)

print(ab[0])

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int x, a ,b;
    cin >> x >> a >> b;

    int C = abs(a - x);
    int D = abs(b -x);
    if (C < D){
        cout << "A" << endl;
    }
    else {
        cout << "B" << endl;
    }
}

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

long long h, w, k;
long long dp[105][10] = {0};
long long memo[10] = {0};

void smemo();
long long solve();
long long calc(long long x);

int main() {
  cin >> h >> w >> k;
  smemo();
  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long now, cnt;
  dp[0][0] = 1;
  for(int i = 1; i <= h; ++i) {
    for(int j = 0; j < w; ++j) {
      now = 0;
      // from left
      if(j > 0) {
        cnt = 1;
        cnt *= memo[max(0LL, w - 1 - (j + 1))];
        cnt *= memo[max(0, j - 2)];
        cnt %= N;
        now += dp[i - 1][j - 1] * cnt % N;
        now %= N;
      }
      // from right
      if(j < w - 1) {
        cnt = 1;
        cnt *= memo[max(0, j - 1)];
        cnt *= memo[max(0LL, w - 1 - (j + 2))];
        cnt %= N;
        now += dp[i - 1][j + 1] * cnt % N;
        now %= N;
      }
      // go straight
      cnt = 1;
      cnt *= memo[max(0, j - 1)];
      cnt *= memo[max(0LL, w - 1 - (j + 1))];
      now += dp[i - 1][j] * cnt % N;
      now %= N;
      dp[i][j] += now;
      dp[i][j] %= N;
    }
  }
  return dp[h][k - 1];
}

long long calc(long long x) {
  long long ans = 1;
  for(long long i = 0; i <= 32; ++i)
    if(((1LL << i) & x) == (1LL << i)) {
      ans *= memo[i] % N;
      ans %= N;
    }
  return ans;
}

void smemo() {
  memo[0] = 1;
  // 1,1
  memo[1] = 2;
  for(int i = 2; i < 10; ++i)
    memo[i] = memo[i - 1] + memo[i - 2];
}

Measured memory_bytes: 256
<?php
error_reporting(0);
$stdin = file_get_contents('php://stdin');
$line = explode("\n",$stdin);
$fi = 0;
$cnt = 0;
$list = array();
$key = new stdclass();
foreach($line as $l) {
  if (strlen($l)==0) continue;
  if ($fi == 0) {
    $a = explode(" ",$l);
    $key->A = $a;
    $fi++;
    continue;
  }
  if ($fi > 0) {
    $a = explode(" ",$l);
    $key->X[] = $a;
  }
}
$X = $key->A[0];
$Y = $key->A[1];
$L = $key->A[2];
$BOX[$X][$Y];
for($i=0;$i<$X;$i++) {
  for($j=0;$j<$Y;$j++) {
    //初期化
    $BOX[$Y-$j][$i]=0;
  }
}
dumpbox($key,$BOX);
foreach($key->X as $l) {
  //塗る
  $px = $l[0];
  $py = $l[1];
  $typ = $l[2];
  switch($typ) {
  case 1:
    for($i=0;$i<$px;$i++) {
      for($j=0;$j<$Y;$j++) {
        $BOX[$Y-$j][$i]=1;
      }
    }
    break;
  case 2:
    for($i=$px;$i<$X;$i++) {
      for($j=0;$j<$Y;$j++) {
        $BOX[$Y-$j][$i]=1;
      }
    }
    break;
  case 3:
    for($i=0;$i<$X;$i++) {
      for($j=0;$j<$py;$j++) {
        $BOX[$Y-$j][$i]=1;
      }
    }
    break;
  case 4:
    for($i=0;$i<$X;$i++) {
      for($j=$py;$j<$Y;$j++) {
        $BOX[$Y-$j][$i]=1;
      }
    }
    break;
  }
    dumpbox($key,$BOX);
}
//数える
$total = 0;
for($i=0;$i<$X;$i++) {
  for($j=0;$j<$Y;$j++) {
    if ($BOX[$Y-$j][$i]===0) {
      $total=$total+1;
    }
  }
}
printf("%d\n",$total);
function dumpbox($key,$b) {
  return 1;
  for($i=0;$i<$key->A[1];$i++) {
    for($j=0;$j<$key->A[0];$j++) {
      printf("%d",$b[$key->A[1]-$i][$j]);
    }
    printf("\n");
  }
  printf("\n");
}


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

#define rep(i, a, b) for(ll i = a; i < (b); ++i)
#define per(i, b, a) for(ll i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define hash dhsjakhd
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;

unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 eng(seed);

uniform_int_distribution<> DD(0, (1ll << 31));

ll random2(){
    return (ll(DD(eng))*(1ll << 31) + ll(DD(eng))) & ((1ll << 62ll)-1);
}

ll n,m,T,k,q;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;

ll level[300001] = {0};

ll lvls[3][3] = {0};

ll twos[3] = {0};

ll ctn(char ch){
    if(ch == 'R')return 0;
    if(ch == 'G')return 1;
    if(ch == 'B')return 2;
    return -1;
}

string s;



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

    //freopen("input.txt","r",stdin);
   // freopen("autput.txt","w",stdout);
    ll a,b,c,d;


    cin >> n;
    cin >> s;
    ll ans = 1;
    ll f = 1;
    rep(c1,0,3*n){
        if(c1 < n)f *= (c1+1);
        f %= mod;
        c = ctn(s[c1]);
        a = 2;
        b = 1;
        if(c == 1)b = 0;
        if(c == 2)a = 0;
        if(twos[c] > 0){
            ans *= twos[c]%mod;
            //cerr << twos[c] << "  dsa\n";
            twos[c]--;
            ans %= mod;
            level[c1] = 2;
        }
        else{

            if(lvls[a][0]){
                ans *= lvls[a][0];
                lvls[a][0]--;
                ans %= mod;
                twos[b]++;
               // cerr << lvls[a][0]+1 << "  dsb\n";
                level[c1] = 1;
            }
            else{

                if(lvls[b][0]){
                    ans *= lvls[b][0];
                    lvls[b][0]--;
                    ans %= mod;
                    twos[a]++;
                    //cerr << lvls[b][0]+1 << "  dsb\n";
                    level[c1] = 1;
                }
                else{
                    lvls[c][0]++;
                    level[c1] = 0;
                }
            }

        }
    }


    rep(c1,0,3*n){
      //  cerr << level[c1] << " " << s[c1] << "\n";
    }

    ans *= f;
    ans %= mod;
    cout << ans << "\n";


    return 0;
}


Measured memory_bytes: 2964
import java.util.*;

class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();

    int num = 0; 

    for(int i=1; i<10; i++){
       for(int j=1; j<10; j++){
          if(N == i*j){
            num++;
          }
       }
    }
    
    if(num != 0){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }    
  }
}


      

Measured memory_bytes: 22868
S = raw_input()
S = S.split()
n,m,l = int(S[0]),int(S[1]),int(S[2])
MAX = int(1e15)
G = []
for i in xrange(n):
    temp=[]
    for j in xrange(n):
        temp.append(MAX)
    G.append(temp)
for i in xrange(n):
    G[i][i]=0

for i in xrange(m):
    S = raw_input()
    S = S.split()
    a,b,c = int(S[0]),int(S[1]),int(S[2])
    a-=1
    b-=1
    G[a][b]=c
    G[b][a]=c
for k in xrange(n):
    for i in xrange(n):
        for j in xrange(n):
            val = G[i][k]+G[k][j]
            G[i][j] = min(G[i][j],val)
dd = G
for i in xrange(n):
    for j in xrange(n):
        if(dd[i][j]<=l):
            G[i][j]=1
        else :
            G[i][j]=MAX
        if(i==j):
            G[i][j]=0

for k in xrange(n):
    for i in xrange(n):
        for j in xrange(n):
            val = G[i][k]+G[k][j]
            G[i][j] = min(G[i][j],val)
#print(G)
q = input()
while(q):
    q-=1
    S = raw_input()
    S =S.split()
    s,t = int(S[0]),int(S[1])
    s-=1
    t-=1
    p = G[s][t]
    if(p>=MAX):
        print -1
    else:
        print p-1


Measured memory_bytes: 36764
I=N=9**9
P,M,L,R,U,*D='x+y','x-y',[],[],[]
for t in[*open(0)][1:]:*z,u=t.split();exec(u+'+=[*map(int,z)],')
for*A,S,D in(D,U,*'xy'),(L,R,*'yx'),(U,R,P,M),(L,D,P,M),(L,U,M,P),(D,R,M,P):
 n=p=-I
 for x,y,r in eval(f"sorted(({S},{D},Q)for Q,P in enumerate(A)for x,y in P)"):
  if r:n,p=x,y  
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')

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

int main(void){
    vector<char> s(3);
    string abc= "abc";
    for (int i=0; i<3; i++) cin >> s[i];
    sort(s.begin(), s.end());
    for (int i=0; i<3; i++){
        if (abc[i] != s[i]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3584
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int main() {
	string s; cin >> s; s[5] = s[13] = ' '; cout << s << endl;
    return 0;
}

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

int n;
int a[100005];
int b[100005];


int main()
{
    scanf("%d",&n);
    long long ans = 0;
    for(int i = 0; i <= n; i++)
    {
        scanf("%d",&a[i]);
    }
    for(int i = 0; i < n; i++)
    {
        scanf("%d",&b[i]);
    }
    for(int i = 0; i < n; i++)
    {
        if(b[i] > a[i])
        {
            ans += a[i];
            if(b[i] > a[i]+a[i+1])
            {
                ans += a[i+1];
                a[i+1] = 0;
            }
            else
            {
                ans += (b[i]-a[i]);
                a[i+1] -= (b[i]-a[i]);
            }
        }
        else
        {
            ans += b[i];
        }
    }
    printf("%lld\n",ans);
    return 0;
}


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

int main(){
    int q;
    cin>>q;
    priority_queue<int> q1;
    priority_queue<int,vector<int>,greater<int>> q2;
    ll sum1=0,sum2=0;
    for(int i=0;i<q;i++){
        int id;
        cin>>id;
        if(id==1){
            int a,b;
            cin>>a>>b;
            int l=a,r=a;
            if(q1.size()){
                l=q1.top();
                r=q2.top();
            }
            q1.push(a);
            q1.push(a);
            int tmp1=q1.top();
            q1.pop();
            int tmp2=q1.top();
            q1.pop();
            q2.push(tmp1);
            q2.push(tmp2);
            tmp1=q2.top();
            q2.pop();
            q1.push(tmp1);
            if(!(l<=a&&a<=r)){
                sum1+=min(abs(a-l),abs(a-r));
            }
            sum2+=b;
        }else{
            cout<<q1.top()<<" "<<sum1+sum2<<endl;
        }
    }
}


Measured memory_bytes: 3828
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
total_A = sum(A)
total_B = sum(B)
if total_A < total_B:
    print(-1)
d = [a_i - b_i for a_i, b_i in zip(A, B)]
d.sort(reverse=True)
minus = [i for i in d if i < 0]
len_d = len(minus)
total_d = sum(minus)
n = 0
for i in d:
    if total_d >= 0:
        print(n + len_d)
        break
    total_d += i
    n += 1


Measured memory_bytes: 18292
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
from _collections import defaultdict
from functools import lru_cache

class Scanner():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def map_int():
        return [int(x) for x in Scanner.string().split()]
    def string_list(n):
        return [input() for i in range(n)]
    def int_list_list(n):
        return [Scanner.mapInt() for i in range(n)]
    def int_cols_list(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3,d + 1,2):
            if n % i == 0:
                return False
        return True

MOD = int(1e09) + 7

def main():
    N,M = Scanner.map_int()
    G = [[] for i in range(N)]
    for i in range(M):
        a,b = Scanner.map_int()
        a-=1
        b-=1
        G[a].append(b)
        G[b].append(a)
    for i in G[0]:
        for j in G[i]:
            if j == N-1:
                print("POSSIBLE")
                return
    print("IMPOSSIBLE")
    return

if __name__ == "__main__":
    main()


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

using namespace std;
using ll = long long;
#define int ll
using PII = pair<int, int>;
template <typename T> using V = vector<T>;
template <typename T> using VV = vector<V<T>>;
template <typename T> using VVV = vector<VV<T>>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define PB push_back

const ll INF = (1LL<<60);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
  out<<'[';
  REP(i, a.size()) {out<<a[i];if(i!=a.size()-1)out<<',';}
  out<<']';
  return out;
}

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

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

  struct edge { int to, a, b; };

  int n, m, s, t;
  cin >> n >> m >> s >> t; s--, t--;
  V<int> x(m), y(m), a(m), b(m);
  VV<edge> g(n);
  REP(i, m) {
    cin >> x[i] >> y[i] >> a[i] >> b[i], x[i]--, y[i]--;
    g[x[i]].push_back({y[i], a[i], b[i]});
    g[y[i]].push_back({x[i], a[i], b[i]});
  }

  V<int> d(n);
  REP(i, n) d[i] = INF;
  d[s] = 0;
  priority_queue<PII, V<PII>, greater<PII>> que;
  que.push({d[s], s});

  while(que.size()) {
    PII p = que.top(); que.pop();
    // cout << p << endl;
    if(d[p.second] < p.first) continue;
    for(auto i: g[p.second]) {
      // p.second -> i.to の適切なkを見つける
      // ceil(i.b/(d[p.second]+i.a+k)) + k を最小化するkを求める
      int sq = sqrt(i.b), cost = ceil((double)i.b/(d[p.second]+i.a));
      for(int j=max(0LL, sq-10-d[p.second]-i.a); j<sq-d[p.second]-i.a+10; ++j) {
        int tmp = ceil((double)i.b/(d[p.second]+i.a+j)) + j;
        // cout << "j=" << j << " tmp=" << tmp << endl;
        chmin(cost, tmp);
      }
      // cout << i.to << " " << cost << endl;
      if(d[i.to] > d[p.second] + cost) {
        d[i.to] = d[p.second] + cost;
        que.push({d[i.to], i.to});
      }
    }
  }

  if(d[t] == INF) cout << -1 << endl;
  else cout << d[t] << endl;

  return 0;
}



Measured memory_bytes: 32900
#include <iostream>

using namespace std;

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

    int count[3] = {};
    for (auto i = 0; i < n; i += 1) {
        int num;
        cin >> num;

        auto factors = 0;
        while (num % 2 == 0 && factors < 2) {
            num >>= 1;
            factors += 1;
        }
        count[factors] += 1;
    }

    auto valid = true;

    if (count[2] + 1 < count[0]) {
        valid = false;
    }
    if (count[1] > 0 && count[2] < count[0]) {
        valid = false;
    }

    cout << (valid ? "Yes" : "No") << "\n";
    return 0;
}


Measured memory_bytes: 256