akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

namespace AOJ
{
  class Program
  {
    public static void Main()
    {
      string line;
      while ((line = Console.ReadLine()) != null)
      {
        var n = int.Parse(line);
        if (n == 0)
          break;
        var nums = new List<int>();
        foreach (var i in Enumerable.Range(0, n))
          nums.Add(int.Parse(Console.ReadLine()));

        var max = int.MinValue;
        foreach (var skip in Enumerable.Range(0, nums.Count()))
        {
          var sum = 0;
          foreach (var m in nums.Skip(skip))
          {
            sum += m;
            if (max < sum)
              max = sum;
          }
        }

        Console.WriteLine(max);
      }
    }
  }
}

Measured memory_bytes: 6028
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    N = int(input())
    R = []
    for _ in range(N):
        X, L = map(int, input().split())
        R.append([X+L, X-L])
    R.sort()

    res = 1
    tmp = R[0][0]
    for i in range(1, N):
        if tmp <= R[i][1]:
            res += 1
            tmp = R[i][0]

    print(res)


if __name__ == '__main__':
    main()

Measured memory_bytes: 80088
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(obj)   (obj).begin(),(obj).end()

#define debug(var)  do{std::cout << __LINE__ << "> " << #var << ": ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

void Main() {
	int N; cin >> N;
	string S; cin >> S;
	int cnt = 0;
	REP(i, N - 3 + 1) {
		if (S.substr(i, 3) == "ABC") ++cnt;
	}
	cout << cnt << endl;
}

int main() {
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define dbg(x) cout << #x << ": " << (x) << '\n'
#define ff first
#define ss second
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
const ll inf = 1e15;

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

   int n, w;
   cin >> n >> w;
   vector <ll> wgt(n + 1), val(n + 1);
   for (int i = 1; i <= n; i++) {
      cin >> wgt[i] >> val[i];
   }

   vector <vector <ll>> dp(n + 1, vector <ll> (1e5 + 10, inf));
   int ans = 0;

   dp[0][0] = 0;
   for (int i = 1; i <= n; i++) {
      for (int j = 0; j <= 1e5; j++) {
         dp[i][j] = min(dp[i - 1][j], dp[i][j]);
         if (dp[i - 1][j] != inf && dp[i - 1][j] + wgt[i] <= w) {
            dp[i][j + val[i]] = min(dp[i - 1][j] + wgt[i], dp[i][j + val[i]]);
         }
         if(dp[i][j] != inf)
            ans = max(ans, j);
      }
   }

   cout << ans << '\n';

   return 0;
}

Measured memory_bytes: 80256
#include <iostream>
#include <map>
#include <string>
using namespace std;
map<string,int>mp;
int main(void)
{
    int n;
    mp["AC"]=mp["WA"]=mp["TLE"]=mp["RE"]=0;
    cin>>n;
    while(n--)
    {
        string s;
        cin>>s;
        mp[s]++;
    }
    cout<<"AC"<<" x "<<mp["AC"]<<endl;
    cout<<"WA"<<" x "<<mp["WA"]<<endl;
    cout<<"TLE"<<" x "<<mp["TLE"]<<endl;
    cout<<"RE"<<" x "<<mp["RE"]<<endl;
}


Measured memory_bytes: 3232
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

int main() {
	map<string, vector<int> > index;
	string word;
	int page;
	while (cin >> word >> page) {
		index[word].push_back(page);
	}
	map<string, vector<int> >::iterator it = index.begin();
	while (it != index.end()) {
		cout << it->first << endl;
		vector<int> v = it->second;
		sort(v.begin(), v.end());
		int ifs = 1;
		vector<int>::iterator itv = v.begin();
		while (itv != v.end()) {
			if (ifs == 0)
				cout << " ";
			cout << *itv;
			ifs = 0;
			itv++;
		}
		cout << endl;
		it++;
	}

	return 0;
}

Measured memory_bytes: 1244
#include "bits/stdc++.h"
using namespace std;
#define forn(i, x, n) for (int i = x; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define pii pair<int, int>
#define pll pair<ll, ll>
typedef long double ld;
typedef long long ll;

int ans = INT_MAX;
int d[33][33];
int co[500][500];

int calc(vector<int>& v, int i) {
    int cur = 0;
//    cout << i << " =" << endl;
    for (int x = 0; x < v.size(); x++) {
//        cout << v[x] << endl;
        cur += d[v[x] - 1][i];
//        cout << v[x] << " " << d[v[x] - 1][i] << endl;
    }
    return cur;
}

void gen() {exit(0);}
int main() {
    #ifdef DEBUG
    freopen("input", "r", stdin);
//    freopen("output", "w", stdout);
//    gen();
    #endif
    int n, c;
    scanf("%d %d", &n, &c);
    vector<int> x;
    vector<int> y;
    vector<int> z;
    forn(i, 1, c + 1) {
        forn(j, 1, c + 1) {
            scanf(" %d", &d[i - 1][j - 1]);
        }
    }
    forn(i, 1, n + 1) {
        forn(j, 1, n + 1) {
            scanf(" %d", &co[i - 1][j - 1]);
            if (((i + j) % 3) == 0) {
                x.push_back(co[i - 1][j - 1]);
            } else if (((i + j) % 3) == 1) {
                y.push_back(co[i - 1][j - 1]);
            } else {
                z.push_back(co[i - 1][j - 1]);
            }
        }
    }
    int dp[3][33];
    fill(dp[0], dp[0] + (3 * 33), 1e9);
    for (int i = 0; i < c; i++) {
        dp[0][i] = min(dp[0][i], calc(x, i));
        dp[1][i] = min(dp[1][i], calc(y, i));
        dp[2][i] = min(dp[2][i], calc(z, i));
//        cout << dp[0][i] << " " << dp[1][i] << " " << dp[2][i] << endl;
    }
    int ans = INT_MAX;
    forn(i, 0, c) {
        forn(j, 0, c) {
            forn(k, 0, c) {
                if (i != j && j != k && i != k) {
                    int cur = dp[0][i] + dp[1][j] + dp[2][k];
//                    cout << cur << endl;
                    ans = min(ans, cur);
                }
            }
        }
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 2416
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<numeric>
#include<map>
using namespace std;

int main(){
    pair<pair<string,int>,int> p[110];
    pair<string,int> q[110];
    int N,P[110];
    string S[110];
    cin>>N;
    for(int i=0;i<N;++i){
        cin>>S[i]>>P[i];
        q[i]=make_pair(S[i],-P[i]);
        p[i]=make_pair(q[i],i+1);    
    }
    sort(p,p+N);
    for(int i=0;i<N;++i){
        cout<<p[i].second<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
N = int(input())
X = list(map(int, input().split()))
org = X.copy()

X.sort()

right = int(N // 2)
left = right - 1

med = (X[left] + X[right]) / 2

for x in org:
    if x >= med:
        print(X[left])
    else:
        print(X[right])


Measured memory_bytes: 30908
#include<stdio.h>
int main(void){
int k,a,b;
int tf=0;
scanf("%d",&k);
scanf("%d %d",&a,&b);
if(scanf("%d",&k)!=0 && scanf("%d %d",&a,&b)!=0){
    for(int i=0;k*i<=b;i++){
      if((a<=k*i)&&(k*i<=b)){
        tf=1;
        break;
      }
    }
    if(tf==0){
    printf("NG");
    }else{
    printf("OK");
    }
}
return 0;
}

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

typedef long long ll;
typedef pair<int,int> P;
typedef map<int,int> M;
typedef vector<int> V;
typedef queue<int> Q;
typedef pair<long,long> PLL;
typedef map<long,long> MLL;
typedef vector<long long> VLL;
typedef vector<pair<int,int>> VP;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define MOD (1e9+7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n-1);i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
/*--------------------------------------------*/
ll memo[inf];
ll lucas(int);
int main(){
    int n;cin>>n;
    ll ans=lucas(n);
    cout<<ans<<endl;
}
ll lucas(int n){
    if(memo[n]!=0)return memo[n];
    if(n==1)return n;
    if(n==0)return 2;
    memo[n]=lucas(n-1)+lucas(n-2);
    return memo[n];
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int n,c=0;
    scanf("%d",&n);
    int d[n-1];
    for (int i = 0 ;i<n;i++){
        scanf("%d",&d[i]);
    }
    for(int x=0;x<n-2;x++){
        for(int y=x+1;y<n-1;y++){
            for(int z =y+1;z<n;z++){
                if (d[x]<d[y]+d[z]&&d[y]<d[z]+d[x]&&d[z]<d[x]+d[y]){
                    c++;
                }
            }
        }
    }
    printf("%d",c);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main(){
  int N;
  cin >> N;
  int A[N];
  int B[N-1];
  int ans = 0;
  for(int i=0; i<N-1; i++){
    cin >> B[i];
  }

  A[N-1] = B[N-2];
  A[0] = B[0];

  for(int i=N-2; i>0; i--){
    A[i] = min(B[i], B[i-1]);
  }

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

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)){
			int n = sc.nextInt();
			long [] array = new long [n];
			for (int i=0; i<n; i++) {
				 array[i] = sc.nextLong();
			}
			int times = sc.nextInt();
			for (int i=0; i<times; i++) {
				int b = sc.nextInt();
				int e = sc.nextInt();
				int t = sc.nextInt();
				for (int k=0; k< e - b; k++) {
					long temp = array[b+k];
					array[b+k] = array[t+k];
					array[t+k] = temp;
				}
			}
			for (int i=0; i<n - 1; i++) System.out.print(array[i] + " ");
			System.out.println(array[n - 1]);
		}
	}
}


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

using namespace std;
using ll = long long;
using ld = long double;

void solve() {
  int k;
  cin >> k;
  for (int i = 0; i < k; i++) {
    cout << "ACL";
  }
  cout << endl;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);

  solve();
  return 0;
}


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

int main() {
    int N;
    std::cin >> N;
    
    int num = 0;
    int N_rem = N;
    while (N_rem > 0) {
        num += N_rem % 10;
        N_rem /= 10;
    }
    
    std::cout << (N % num == 0 ? "Yes" : "No") << std::endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,a[100005],ans[100005];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	   scanf("%d",&a[i]),ans[a[i]]=i;
	for(int i=1;i<=n;++i)
	   printf("%d ",ans[i]);
	printf("\n");
	return 0;
}

Measured memory_bytes: 4484
#include<bits/stdc++.h>
using namespace std;
 
/* data type, special numbers, defines */
//#define int ll //use if ded
#define ll long long
#define ld long double
const ll inf=LLONG_MAX;
//const ll mod=1e9+7;
const ll mod=998244353;
const ld pi=acos(-1.0);
#define all(v) v.begin(), v.end()
/* end data type and special numbers */
 
/* fast input.output */
#define gc getchar//_unlocked
#define pc putchar//_unlocked
#define endl pc('\n')
int get_i(){
	char c=gc(); bool neg=false;
	for(; c<'0'||'9'<c; c=gc())
		if(c=='-') neg=true;
	int rs=c-'0'; c=gc();
	for(; '0'<=c && c<='9'; c=gc())
		rs=(rs<<1)+(rs<<3)+(c-'0');
	if(neg) rs=-rs;
	return rs;
}
ll get_l(){
	char c=gc(); bool neg=false;
	for(; c<'0'||'9'<c; c=gc())
		if(c=='-') neg=true;
	ll rs=c-'0'; c=gc();
	for(; '0'<=c && c<='9'; c=gc())
		rs=rs*10ll+(c-'0');
	if(neg) rs=-rs;
	return rs;
}
string get_s(){
	char c=gc();
	for(; c<33 || 126<c; c=gc());
	string s=""; s+=c; c=gc();
	for(; 33<=c && c<=126; c=gc())
		s+=c;
	return s;
}
char get_c(){
	char c=gc();
	for(; c<33 || 126<c; c=gc());
	return c;
}
void print_i(int _n){
	bool neg=false; if(_n<0) {neg=true; _n=-_n;}
	if(neg) pc('-');
	int N=_n, rev, count=0;
	rev=N;
	if(N==0) {pc('0'); return;}
	while((rev%10)==0) {count++; rev/=10;}
	rev=0;
	while(N!=0) {rev=(rev<<3)+(rev<<1)+N%10; N/=10;}
	while(rev!=0) {pc(rev%10+'0'); rev/=10;}
	while(count--) pc('0');
}
void print_l(ll _n){
	ll N=_n, rev, count=0;
	rev=N;
	if(N==0) {pc('0'); return;}
	while((rev%10)==0) {count++; rev/=10;}
	rev=0;
	while(N!=0) {rev=rev*10ll+N%10; N/=10;}
	while(rev!=0) {pc(rev%10+'0'); rev/=10;}
	while(count--) pc('0');
}
void print_s(string a){
	for(int i=0; i<a.size(); i++)
		pc(a[i]);
}
#define endline pc('\n');
#define space pc(' ');
/* end fast input/output */

/*   E N D   O F   T E M P L A T E   */

bool ok(string a){
	int l=0, r=a.size()-1;
	bool yes=true;
	while(l!=a.size()-1){
		if(a[l]!=a[r]){
			yes=false; break;
		}
		l++; r--;
	}
	return yes;
}

int cnt[200005], a[200005];
int main(){
	int n=get_i(); memset(cnt, 0, sizeof(cnt));
	for(int i=0; i<n; i++){
		a[i]=get_i(); cnt[a[i]]++;
	}
	ll ans=0ll;
	for(int i=1; i<=n; i++)
		ans+=(ll)cnt[i]*(ll)(cnt[i]-1)/2;
	for(int i=0; i<n; i++){
		print_l(ans-(ll)cnt[a[i]]+1ll);
		endline
	}
	return 0;
}

Measured memory_bytes: 4096
#include<iostream>
using namespace std;
int main(){
  int n,c=0,c1=0,c2=0,c3=0;
  string str;
  cin>>n;
  cin.ignore();
  for(int i=1;i<=n;i++){
    getline(cin,str);
    if(str=="AC")
      c++;
    else if(str=="WA")
      c1++;
    else if(str=="TLE")
      c2++;
    else if(str=="RE")
      c3++;
    str.clear();
  }
  cout<<"AC x "<<c<<"\n";
  cout<<"WA x "<<c1<<"\n";
  cout<<"TLE x "<<c2<<"\n";
  cout<<"RE x "<<c3<<"\n";
}

Measured memory_bytes: 3524
#!/usr/bin/env python3
import sys


def solve(P: int, Q: int, R: int):
    a = sorted([P, Q, R])
    print(a[0] + a[1])
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    P = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    R = int(next(tokens))  # type: int
    solve(P, Q, R)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
n = gets.to_i
ary = []
n.times do
  ary << gets.split(" ").map(&:to_i)
end

ary = ary.sort {|a,b| a[1] <=> b[1]}
time_sum = 0

ary.each do |x|
	time_sum += x[0]
	if time_sum > x[1]
		puts "No"
		exit
		break
	end
end

puts "Yes"


Measured memory_bytes: 21468
#include <stdio.h>
#define N 36

int main() {
  int i, j;
  int n, minj;
  int flag = 0;
  char bcard[N][2], scard[N][2];
  char temp[2];

  scanf("%d", &n);


  for(i = 0; i < n; i++)
    scanf("%s", bcard[i]);

  for(i = 0; i < n; i++) 
    for(j = 0; j < 2; j++) 
      scard[i][j] = bcard[i][j];
    

  //Bubble Sort
  for(i = 0; i < n; i++) {
    for(j = n - 1; j >= 0; j--) {
      if(bcard[j-1][1] > bcard[j][1]) {
	temp[0] = bcard[j][0];
        temp[1] = bcard[j][1];
	bcard[j][0] = bcard[j-1][0];
	bcard[j][1] = bcard[j-1][1];
	bcard[j-1][0] = temp[0];
	bcard[j-1][1] = temp[1];
      }
    }
  }

  //printBubbleSort
  for(i = 0; i < n; i++) {
    for(j = 0; j < 2; j++) {
      printf("%c", bcard[i][j]);
    }
    if(i < n - 1) printf(" ");
  }
  printf("\n");
  printf("Stable\n");
  

  //Selection Sort
  for(i = 0; i < n - 1; i++) {
    minj = i;
    for(j = i; j < n; j++) {
      if(scard[minj][1] > scard[j][1]) minj = j;	
    }
    if(scard[minj][1] < scard[i][1]) {
      temp[0] = scard[i][0];
      temp[1] = scard[i][1];
      scard[i][0] = scard[minj][0];
      scard[i][1] = scard[minj][1];
      scard[minj][0] = temp[0];
      scard[minj][1] = temp[1];
    }
  }

  //Compare
  for(i = 0; i < n; i++) 
    for(j = 0; j < 2; j++) 
      if(bcard[i][j] != scard[i][j]) flag = 1;

  //printSelectionSort
  for(i = 0; i < n; i++) {
    for(j = 0; j < 2; j++) {
      printf("%c", scard[i][j]);
    }
    if(i < n - 1) printf(" ");
  }
  printf("\n");
  if(flag == 0) printf("Stable\n");
  else printf("Not stable\n");
   

  return 0;
  
}

Measured memory_bytes: 584
// #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

const int N = 2020;
int n , K , u[N] , v[N];
vi g[N];

void dfs(int c,int fa,int K,int &cnt) {
  cnt++;
  if(K == 0) return;
  for(auto t : g[c]) if(t != fa) {
    dfs(t , c , K - 1 , cnt);
  }
}

int main(){
  cin >> n >> K;
  rep(i,1,n) {
    int u,v;
    cin >> u >> v;
    ::u[i] = u;
    ::v[i] = v;
    g[u].pb(v);
    g[v].pb(u);
  }
  int ans = n;
  if(K & 1) {
    rep(i,1,n) {
      int cnt = 0;
      dfs(u[i] , v[i] , K >> 1 , cnt);
      dfs(v[i] , u[i] , K >> 1 , cnt);
      ans = min(ans , n - cnt);
    }
  } else {
    rep(i,1,n+1) {
      int cnt = 0;
      dfs(i , 0 , K >> 1 , cnt);
      ans = min(ans , n - cnt);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 384
# https://atcoder.jp/contests/abc159/submissions/11139734

def main():
    MOD = 998244353

    N, S = map(int, input().split())
    *A, = map(int, input().split())

    ans = 0
    dp = [0] * (S + 1)
    for i, a in enumerate(A, start=1):
        dp[0] = i  # i以前の(i+1)通りの起点がある（以後未取得）
        ans += dp[S]  # aを取らずにclose
        if S >= a:
            ans += dp[S - a]  # aを取ってclose
        ans %= MOD
        for s in reversed(range(a, S + 1)):
            dp[s] += dp[s - a]
            dp[s] %= MOD

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3316
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1001001001
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define double long double
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n+1)
using namespace std;
ll n,m;




//注意

vector<set<ll>> s(300000);
vector<pair<ll ,bool>> f(3000000);
deque<ll> q;


void search(){
    if(q.size()==0) return;
    ll num=q.front();
    q.pop_front();
    //cout<<"num= "<<num<<" ";
    for(auto itr=s[num].begin();itr!=s[num].end();++itr){
        //cout<<*itr<<" ";
        if(f[*itr].second==false){
            f[*itr].second=true;
            f[*itr].first=num;
            q.push_back(*itr);
        }
    }
   // cout<<endl;
    search();
}

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

    ll c,d,maxi=0,mini=INF,sum=0;
    string str;
    cin>>n>>m;
    vector<ll> a(m);
    vector<ll> b(m);
    s.resize(n);
    f.resize(n);
    rep(i,n) f[i].second=false;
    rep(i,m){
        cin>>c>>d;
        c--;
        d--;
        s[c].insert(d);
        s[d].insert(c);
    }
    q.push_back(0);
    search();
    ll flag=1;
    rep(i,n){
        if(f[i].second==false) flag=0;
    }
    if(flag==0) No;
    else{
        Yes;
        for(ll i=1;i<n;i++){
            cout<<f[i].first+1<<endl;
        }
    }

    return 0;
}


Measured memory_bytes: 86680
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		int sum = 0, i;
		for (i = 1; i <= N; i++) {
			sum += i;
		}
		System.out.println(sum);
	}
}


Measured memory_bytes: 8148
#include <bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lp(i,a,n) for(int i=a;i<=n;++i)
#define lpd(i,a,n) for(int i=a;i>=n;--i)
#define mem(a,b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define println(a) cout <<(a) <<endl
#define sz(x) ((int)(x).size())
#define readi(x) scanf("%d",&x)
#define read2i(x,y) scanf("%d%d",&x,&y)
#define read3i(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define mod 1000000007
#define eps 1e-9
#define infi 1000000000
#define infll 1000000000000000000ll
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef set<int> si;
typedef map<int,int> mii;

const int N = 1000002;
int n,k,q;
char a[N];

int main(){
    readi(n);
    scanf("%s", a);
    readi(q);
    while(q--){
        readi(k);
        int j = 0, ds = 0, ms = 0;
        ll cur = 0, ans = 0;
        lp(i,0,n-1){
            while(i-j >= k){
                if(a[j] == 'D') cur -= ms;
                ds -= a[j] == 'D';
                ms -= a[j] == 'M';
                ++j;
            }

            if(a[i] == 'C') ans += cur;
            if(a[i] == 'D') ++ds;
            if(a[i] == 'M') cur += ds, ++ms;
        }
        printf("%lld\n", ans);
    }
}

/*
uniform_int_distribution<type>(l, r)(rng)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
*/


Measured memory_bytes: 1280
#include<iostream>
#include<string>
using namespace std;
int main() {
	int a, b, x = 0;
	cin >> a >> b;
	if (x < a * 2 - 1) {
		x = a * 2 - 1;
	}
	if (x < a + b) {
		x = a + b;
	}
	if (x < b * 2 - 1) {
		x = b * 2 - 1;
	}
	cout << x << endl;
	return 0;
}


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

int X, N;
bool contained[105];
int main()
{
	scanf("%d%d", &X, &N);
	for(int i = 1; i <= N; i++)
	{
		int pi;
		scanf("%d", &pi);
		contained[pi] = true;
	}
	
	int leftPtr = X, rightPtr = X;
	while(leftPtr >= 0)
	{
		if(!contained[leftPtr])
		{
			printf("%d", leftPtr);
			return 0;
		}
		
		else if(!contained[rightPtr])
		{
			printf("%d", rightPtr);
			return 0;
		}
		
		leftPtr--;
		rightPtr++;
	}
}


Measured memory_bytes: 3800
#include <bits/stdc++.h>
#pragma GCC optimize("O3")

#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define mp make_pair
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int((v).size())
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) 
#define rep2(i, n, m) for (ll i = n; i <= (ll)(m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (ll)(m); --i)

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

using ll = long long;
using ld = long double;
using namespace std;

constexpr ll MOD = 1000000007;

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

  ll n; cin >> n;
  ll ans = 1;

  while (n) {
    n /= 2;
    ans *= 2;
  }

  cout << ans-1 << endl;

  return (0);
}


Measured memory_bytes: 3624
#include <stdio.h>
#include <string.h>

int main(){
	char find[10],ring[20],num = 0;
	int i,j,n;
	scanf("%s",find);
	scanf("%d",&n);
	for(i = 0;i < n;i++){
		scanf("%s",ring);
		for(j = 0;j < 10;j++) ring[j + 10] = ring[j];
		if(strstr(ring,find)) num++;
	}
	printf("%d\n",num);
	return 0;
}

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

int main()
{
    int n, m, r;
    cin >> n >> m >> r;
    int c[r] = {};
    int d[n][n] = {};
    for(int i=0; i<n; i++) 
        for(int j=0; j<n; j++) d[i][j] = 1e9;
    for(int i=0; i<r; i++){
        cin >> c[i];
        c[i]--;
    }
    for(int i=0; i<m; i++){
        int x, y, dis;
        cin >> x >> y >> dis;
        x--, y--;
        d[x][y] = dis;
        d[y][x] = dis;
    }
    
    for(int k=0; k<n; k++)                      // warshall-floyd
        for(int i=0; i<n; i++)
            for(int j=0; j<n; j++)
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
                
    sort(c, c+r);
    int ans = 1e9;   
    do {
        int tmp = 0;
        for(int i=0; i<r-1; i++){
            tmp += d[c[i]][c[i+1]];
        }
        ans = min(ans, tmp);
    } while(next_permutation(c, c+r));
 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
using namespace std;
int main() {
	string s;
	cin >> s;
	int cnt = 0;
	for (int i = 0; i < 6; i++)
		if (s[i] == '1')cnt++;
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <iostream>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <list>
#include <stack>
#include <climits>
#include <unordered_set>
#include <unordered_map>
#define m7 1000000007
#define m9 1000000009
#define ll long long
#define pii pair<int,int>
#define F first
#define S second

using namespace std;
int main()
{
	int n, w;
	cin >> n >> w;
	vector<int> wt(n), vl(n);
	map<int, int> M;
	for (int i = 0; i < n; i++) {
		cin >> wt[i] >> vl[i];
	}
	M[0] = 0;
	for (int i = 0; i < n; i++) {
		map<int, int> T = M;
		for (auto it : M) {
			
			if (it.second + wt[i] > w) continue;
			
			int val = it.first + vl[i];
			if (T.find(val) == T.end() ) {
				T[val] = it.second + wt[i];
			}
			else {
				T[val] = min(T[val], it.second + wt[i]);
			}
		}
		M = T;
	}
	int maxi = 0;
	for (auto it : M) {
		maxi = max(maxi, it.first);
	}
	cout << maxi;
	return 0;
}

Measured memory_bytes: 4992
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { -1, 0, 0, 1 };
const ll dy[4] = { 0, -1, 1, 0 };
const ll INF = 1e9 + 7;
const ll inf = 1LL << 50;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
struct Accelerate_Cin {
	Accelerate_Cin() {
		cin.tie(0);
		ios::sync_with_stdio(0);
		cout << fixed << setprecision(20);
	};
};
///////////////////////////////////////


int main() {
	ll n; cin >> n;
	ll x[100100];
	REP(i, n)cin >> x[i];
	vector<ll>a(n);
	for (int i = n - 1; i >= 0; --i) {
		a[n - 1 - i] = x[i];
	}
	vector<int>dp(100100);//dp[i]:=i+1の部分列の最後の要素となる最小の値
	REP(i, 100100)dp[i] = INF;
	for (int i = 0; i < n; ++i) {
		*upper_bound(dp.begin(),dp.end(), a[i]) = a[i];
	}
	cout << (lower_bound(dp.begin(), dp.end(), INF) - dp.begin()) << endl;
	return 0;
}


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

int main() {
  int n; cin>>n;
  string s;cin>>s;
  n = s.length();
  if (n % 2 == 1){
    cout << "No" << endl;
    return 0;
  }
  string ans = "Yes";
  for (int i=0, j=n/2; i<n/2; i++, j++) {
    if (s[i] != s[j]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;

}


Measured memory_bytes: 3568
#include <iostream>
#include <string>

using namespace std;

int main()
{
	int X = 0, A = 0, B = 0;

	cin >> X;
	cin >> A;
	cin >> B;

	int n = (X - A) / B;
	
	int remain = X - A - B * n;
	cout << remain;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int A,B,C,D,E,k;
    while(cin>>A>>B>>C>>D>>E>>k)
    {
        int a[10]={0};
        a[0]=A-B;
        a[1]=A-C;
        a[2]=A-D;
        a[3]=A-E;
        a[4]=B-C;
        a[5]=B-D;
        a[6]=B-E;
        a[7]=C-D;
        a[8]=C-E;
        a[9]=D-E;
        int i;
        for(i=0;i<9;i++)
        {
            if(a[i]<0)
                a[i]=-a[i];
        }
        for(i=0; i<10; i++)
        {
            if(a[i]>k)
            {
                cout<<":("<<endl;
                break;
            }
            if(i==9&&a[i]<=k)
                cout<<"Yay!"<<endl;
        }

    }
    return 0;
}

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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define ALL(x) x.begin(),x.end()
#define EPS (1e-8)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

typedef long long ll;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;

inline bool LT(double a,double b) { return !equals(a,b) && a < b; }
inline bool LTE(double a,double b) { return equals(a,b) || a < b; }

void compute() {

}

int c[10][10], fw[10][10];
int A[300][300];

int main() {
  int h,w;
  cin >> h >> w;
  rep(i,10) {
    rep(j,10) {
      cin >> c[i][j];
      fw[i][j] = c[i][j];
    }
  }
  rep(k,10) rep(i,10) rep(j,10) {
    fw[i][j] = min(fw[i][j],fw[i][k]+fw[k][j]);
  }
  ll ans = 0;
  rep(i,h) rep(j,w) {
    cin >> A[i][j];
    if( A[i][j] != -1 ) {
      ans += fw[A[i][j]][1];
    }
  }
  cout << ans << endl;
  compute();
  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define popc __builtin_popcount
#define ctz __builtin_ctz

typedef long long ll;
const int N = 18, N2 = 32854, mod = 1000000007;

int V, E, ALL;
int G[N], f[N2];

int main() {
	int i, j, u, v, S, tot, win, lose, ans = 1; ll cur;
	scanf("%d%d", &V, &E), ALL = ~(-1 << V);
	for (i = 0; i < E; ++i)
		scanf("%d%d", &u, &v), G[--u] |= 1 << --v, ans = ans * 2 % mod;
	for (*f = 1, i = 2; i <= ALL; i += 2)
		for (j = i; ; j = (j - 1) & i) {
			cur = 1, tot = i + (i >> 1 & 1);
			win = j + (j >> 1 & 1), lose = tot & ~win;
			for (S = i + (i >> 1 & 1); S; S &= S - 1)
				v = ctz(S), cur = cur * (win >> v & 1 ? (1 << popc(G[v] & lose)) - 1 : 1 << popc(G[v] & win)) % mod;
			f[i] = (f[i] + cur * f[j]) % mod;
			if (!j) break;
		}
	ans -= f[ALL - 1], printf("%d\n", ans + (ans >> 31 & mod));
	return 0;
}

Measured memory_bytes: 384
H,W=map(int,input().split())

A = [list(map(int, input().split())) for _ in range(10)]

for a in range(10):
    for b in range(10):
        for c in range(10):
            A[b][c]=min(A[b][c],A[b][a]+A[a][c])

ans=0
D=[]
for j in range(H):
    C=list(map(int,input().split()))
    D.append(C)
        
for k in range(H):
    for l in range(W):
        if D[k][l]!=(-1) and D[k][l]!=(1):
            ans+=A[D[k][l]][1]
print(ans)

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

int main() {
  int n,l; cin >> n >> l;
  std::vector<string> v(n);
  rep(i,n) cin >> v[i];

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

  rep(i,n) cout << v[i];
  
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;

const int N=3e3+2;
ll mod,g[N][N],C[N][N],f[N];

ll modpow(ll x,ll y,ll p,ll res=1) {
    for(;y;y>>=1,x=x*x%p) if(y&1) res=res*x%p;
    return res;
}

int main() {
    int n;scanf("%d%lld",&n,&mod);
    for(int i=0;i<=n;++i) {
        C[i][0]=g[i][0]=1;
        for(int j=1;j<=i;++j) 
            C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod,
            g[i][j]=(g[i-1][j-1]+1ll*(j+1)*g[i-1][j]%mod)%mod;
    }
    ll ans=0;
    for(int i=0;i<=n;++i) {
        ll k=C[n][i];
        if(i&1) k=mod-k;
        ll x=modpow(2,n-i,mod-1);x=modpow(2,x,mod);
        ll num=modpow(2,n-i,mod),y=1,res=0;
        for(int j=0;j<=i;++j)
            res=(res+1ll*g[i][j]*y%mod)%mod,y=num*y%mod;
        ans=(ans+k*res%mod*x%mod)%mod;
    }
    printf("%lld\n",ans);
    return 0;
}

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

namespace abc087c
{
    class Program
    {
        static void Main(string[] args) {
            var N = int.Parse(Console.ReadLine());
            var A1 = Console.ReadLine().Split().ToList().ConvertAll(int.Parse);
            var A2 = Console.ReadLine().Split().ToList().ConvertAll(int.Parse);
            var maxNumberOfCandies = 0;
            for(var i= 1; i <= N; ++i) {
                var numberOfCandies = A1.Take(i).Sum();
                numberOfCandies += A2.Skip(i-1).Sum();
                if(numberOfCandies > maxNumberOfCandies) {
                    maxNumberOfCandies = numberOfCandies;
                }
            }
            Console.WriteLine(maxNumberOfCandies);
        }
    }
}


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

class Procon
{
    public Procon() { }
    static void Main(string[] agrs)
    {
        new Procon().Do();
    }

    Scanner cin;

    public void Do()
    {
        cin = new Scanner();
        string S = cin.nextString();
        int ret = 0;
        for (int i = 0; i < S.Length; i++)
        {
            if (S[i] == '+')
            {
                ret++;
            }
            else
            {
                ret--;
            }
        }
        Console.WriteLine(ret);
    }
}

class Scanner
{
    string[] s;
    int i;
    int max_i;

    public Scanner()
    {
        s = new string[0];
        max_i = 0;
        i = 0;
    }

    public string nextString()
    {
        if (i >= s.Length)
        {
            s = Console.ReadLine().Split(' ');
            max_i = s.Length;
            i = 0;
            if (max_i == 0)
            {
                return "";
            }
            return s[i++];
        }
        else
        {
            return s[i++];
        }
    }

    public int nextInt()
    {
        return int.Parse(nextString());
    }


    public long nextLong()
    {
        return long.Parse(nextString());
    }

    public double nextDouble()
    {
        return double.Parse(nextString());
    }

    public string[] arrayString()
    {
        return Console.ReadLine().Split(' ');
    }

    public int[] arrayInt()
    {
        string[] str = Console.ReadLine().Split(' ');
        int[] array = new int[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = int.Parse(str[i]);
        }
        return array;
    }

    public long[] arrayLong()
    {
        string[] str = Console.ReadLine().Split(' ');
        long[] array = new long[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = long.Parse(str[i]);
        }
        return array;
    }

    public double[] arrayDouble()
    {
        string[] str = Console.ReadLine().Split(' ');
        double[] array = new double[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            array[i] = double.Parse(str[i]);
        }
        return array;
    }
}

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

typedef long long LL;
LL d[100010];
int x[100010];

int main () {
        int n;
        LL A, B;
        cin >> n >> A >> B;
        for (int i = 1; i <= n; i++)    cin >> x[i];
        d[1] = 0;
        for (int i = 2; i <= n; i++) {
                if ((x[i] - x[i - 1]) * A < B) {
                        d[i] = d[i - 1] + (x[i] - x[i - 1]) * A;
                } else {
                        d[i] = d[i - 1] + B;
                }
        }
        cout << d[n] << endl;
        return 0;
}


Measured memory_bytes: 1408
S = gets.chomp
K = gets.to_i

#初めて1以外が出現する場所
m = 0

0.upto(S.length-1) do |i|
  next if S[i] == "1"
  m = i
  break
end

if m >= 1 && K <= m
  puts 1
else
  puts S[m]
end


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int sum;
int main()
{
    // ios::sync_with_stdio(false);
    // cin.tie(0), cout.tie(0);
    ll n, d, x, y;
    cin >> n >> d;
    for (ll i = 0; i < n; i++)
    {
        cin >> x >> y;
        x > 0 ? x = x : x = 0 - x;
        y > 0 ? y = y : y = 0 - y;
        if (x * x + y * y <= d * d)
            sum++;
    }
    cout << sum << endl;
    system("pause");
    return 0;
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rrepa(i,a,n) for(int i=n-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define vc vector

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;

const int MN=10000001;

int main(){

    int n;
    cin>>n;

    vl f(MN,1);

    repa(i,2,n+1){
        for(ll j=1;j*i<MN;j++){
            f[i*j]++;
        }
    }

    ll ans=0;

    repa(i,1,n+1)ans+=i*f[i];

    cout<<ans<<"\n";

    return 0;

}


Measured memory_bytes: 81392
#!python3

# input
X = int(input())


def solve():
    for a in range(1, 1000):
        for b in range(-100, 1000):
            if a ** 5 - b ** 5 == X:
                return (a, b)


def main():
    ans = solve()
    print(*ans)


if __name__ == "__main__":
    main()


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

int main() {
  int n, l;
  cin >> n >> l;
  
  vector<string> vec(n);
  for (int i=0; i<n; i++){
    cin >> vec[i];
  }
  
  sort(vec.begin(), vec.end());
  
  string ans=vec[0];
  for (int i=1; i<n; i++){
    ans+=vec[i];
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iomanip>
#include <string>
#include<iostream>
#include<vector>
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
#include<math.h>
#include <ctype.h>
#include <algorithm> // sort
#include <map> // pair
using namespace std;
#define nin(n) int n; cin >> n;
#define kin(k) int k; cin >> k;

int main() {
  int n,m;
  cin >> n >> m;
  vector<long long int> vec(n);
  for(int i=0;i<n;i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  vector<pair<long long int,long long int>> magic(m+1);
  for(int i=0;i<m;i++){
    cin >> magic.at(i).second >> magic.at(i).first;//firstに変更後の数を、secondに変えられる数を入れる
  }
  magic.at(m).first=0;magic.at(m).second=1;
  sort(magic.begin(), magic.end());
  reverse(magic.begin(),magic.end());
 long long int ans=0;
  int vecnum,magnum;
  vecnum=0;magnum=0;
  for(int i=0;i<n;i++){
    if(vec.at(vecnum)>=magic.at(magnum).first){
      ans+=vec.at(vecnum);
      vecnum++;
    }
    else{
      int count=0;
      while(i<n&&count<magic.at(magnum).second){
        ans+=magic.at(magnum).first;
        i++;
        count++;
      }
      magnum++;
      i--;
    }
  }
  cout << ans << endl;
}

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

#define fr first
#define se second

using namespace std;

const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;

int main()
{
    ios_base::sync_with_stdio(false);

    int n, m;
    cin >> n >> m;
    if(n == m){
        cout << "Yes\n";
    }
    else{
        cout << "No\n";
    }
}



Measured memory_bytes: 256
A , B , C = map(int,input().split())
K = int(input())
k = 0
j = 0
while k < K and j == 0:
  j = 1
  if A >= B :
    B *= 2
    k += 1
    j = 0
  if B >= C :
    C *= 2
    k += 1
    j = 0
if k <= K and A < B and B < C:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 9196
s=int(input())
import math
ketamax=int(math.floor(s/3))

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

waru=pow(10,9)+7
ans=0
for i in range(1,ketamax+1):
  nokori=s-3*i
  kazu=cmb(nokori+i-1,i-1)%waru
  ans=(ans+kazu)%waru


answer=int(ans%waru)
print(answer)

Measured memory_bytes: 68484
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007

int main(){

		int n, m;
		cin >> n >> m;
		if(n > m)
			for(int i = 0; i < n; ++i)
				cout << m;
		else
			for(int i = 0; i < m; ++i)
				cout << n;
	return 0;
}

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

using namespace std;


class Puzzle
{
public:
	int N, K;
	vector<int> As;

	void input()
	{
		cin >> N >> K;

		int a;
		for (int ni = 0; ni < N; ni++) {
			cin >> a;
			As.push_back(a);
		}
	}

	void play()
	{
		int cost = get_cost(0);
		for (int si = 1; si <= N - K; si++) {
			int new_cost = get_cost(si);
			if (new_cost < cost) cost = new_cost;
		}
		printf("%d", cost);
	}

	int get_cost(int s) 
	{
		int cost1 = abs(As[s]) + As[s + K - 1] - As[s];
		int cost2 = abs(As[s + K - 1]) + As[s + K - 1] - As[s];
		int cost = min(cost1, cost2);

		return cost;
	}

};


int main()
{

	Puzzle puz;

	puz.input();
	puz.play();

    return 0;
}



Measured memory_bytes: 892
#include<stdio.h>
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,j,n) for((i)=(j) ; (i)<(n) ; (i)++)
#define pl(format,var) p(format "\n",var)
#define p(format,var) printf(format,var)
#define asizeof(array) (sizeof(array)/sizeof(array[0]))

#define XMAX 8 //入力データ横サイズ
#define YMAX 8 //入力データ縦サイズ
#define PATTERN_NUM 7 //パターン数
/*
履歴
・

[メモ1]
A-G用のデータを作る。
たとえばAならこんなデータを持たせたい
	A
	0,1
	1,0
	0,-1
1を見つけたら、添字をこの通りに探索する。
全て探索して、全部1だったら、Aってことになる。

どのパターンも3回辿ることになるから、データ構造は配列でいいか。

		//パターンを検索
		printf("##\n");
		rep2(i,YMAX){
			rep2(j,XMAX){
				p("%d",array[i][j]);
			}
			printf("\n");
		}
		printf("##\n");


→ (0,1)
↓ (1,0)
*/
int main(){
	char line[80]; //入力行
	int array[8][8]; //入力データ1つ
	int pattern[PATTERN_NUM*3][2]={ /* パターン探索データ */
		{0,1},{1,0},{0,-1}, /* A */
		{1,0},{1,0},{1,0}, /* B */
		{0,1},{0,1},{0,1}, /* C */
		{1,0},{0,-1},{1,0}, /* D */
		{0,1},{1,0},{0,1}, /* E */
		{1,0},{0,1},{1,0}, /* F */
		{0,1},{-1,0},{0,1} /* G */
	};
	int i,j,k,l; //カウンタ変数
	int ti,tj; //探索先インデックス
	char ans; //答え
	
	while(1){
		//一つの入力データを読み込む
		rep2(i,YMAX){
			fgets(line, sizeof(line), stdin);
			rep2(j,XMAX){
				array[i][j] = line[j] - '0';
			}
		}
		
		//パターンを探索
		rep2(i,YMAX){
			rep2(j,XMAX){
				if(array[i][j] == 1){
					//パターン探索データに従って探す
					rep2(k,PATTERN_NUM){
						ti = i;
						tj = j;
						//探索データ一つ一つを当てはめる
						ans = 1;
						rep2(l,3){
							ti += pattern[(k*3)+l][0];
							tj += pattern[(k*3)+l][1];
							//探索先がデータをはみ出るか, その値が0であれば
							//このパターンはマッチしないことを表す
							if(ti<0 || ti>=YMAX || tj<0 || tj>=XMAX || array[ti][tj]==0){
								ans = 0;
								break;
							}
						}
						//パターンマッチしたら, 該当する文字を出力し, 探索終了
						if(ans){
							pl("%c",'A'+k);
							goto SEARCH_END;
						}
					}
				}
			}
		}

SEARCH_END:
		//改行区切りを読み込んだら, 続行する
		fgets(line, sizeof(line), stdin);
		if(line[0] != '\n')
			break;
	}

  return 0;
}

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

using i64 = int64_t;

int main(){
    int m1, d1, m2, d2;
    cin >> m1 >> d1 >> m2 >> d2;
    cout << (m2 > m1 ? 1 : 0) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	char a[10],b[10],c[10];
	int i,j;
  	scanf("%s %s %d %d %s",a,b,&i,&j,c);
  if(a[0]==c[0]){
  		i--;
  	}
  	else{
    	j--;
    }
  printf("%d %d",i,j);
}

Measured memory_bytes: 128
#include <atcoder/all>
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Yes() std::cout << "Yes" << std::endl
#define No() std::cout << "No" << std::endl
#define Say(s) std::cout << s << std::endl
const ll MOD = 1000000007;
const ll INF = 1061109567;

int main()
{
    ll k;
    std::string s;
    std::cin >> k;
    rep(i, k)
    {
        s += "ACL";
    }
    Say(s);
    return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define MAXN 100010
#define LL long long
using namespace std;

LL n, a[MAXN], b[MAXN], ans;


int main()
{
	scanf("%lld", &n);
	for(int i=2; i<=n+1; i++) scanf("%lld", &a[i]);
	a[1]=0; a[n+2]=0;
	for(int i=2; i<=n+2; i++) b[i]=abs(a[i]-a[i-2]);
	for(int i=2; i<=n+2; i++)
	{
		ans+=abs(a[i]-a[i-1]);
	}
	for(int i=2; i<=n+1; i++)
	{
		printf("%lld\n", ans-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+b[i+1]);
	}
} 

Measured memory_bytes: 2816
#include <stdio.h>

int main(void)
{
	int m,f,b,a;
	scanf("%d %d %d",&m,&f,&b);
	if(m+f>=b){
		if(m<b){
			a=b-m;
		}
		else{
			a=0;
		}
		printf("%d\n",a);
	}
	if(m+f<b){
		printf("NA\n");
	}
	return 0;
}



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

using namespace std;

#define fcout(d) cout << fixed << setprecision(d)
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define repU(i,s,t) for(int i = (s); i <= (t); ++i)
#define repD(i,t,s) for(int i = (t); i >= (s); --i)
#define all(v)  begin(v),end(v)
#define clr(v) fill(all(v),0)
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define q_ceil(n,d) ((n - 1)/(d) + 1)
#define parity(a,b) (((a)^(b)) & 1 ^ 1)

typedef long long ll;
typedef unsigned long long ull;
typedef double db;

const pair<int,int> DIR[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF_32 = -1 + (1 << 30);
const ll INF_64 = -1 + (1LL << 62);
const int MOD = 1e9 + 7;

ull next_subset(ull s){
	ull tem = s + (s & -s);
	ull btm = (~tem & s) / (s & -s) >> 1;
	return btm | tem;
}


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n,a; cin>>n;
	vector<int> ed;
	priority_queue<int> q;
	rep(i,n){
		cin>>a; q.push(a);
	}
	while(ed.size() < 2 && !q.empty()){
		a = q.top(); 
		q.pop();
		if(!q.empty() && a == q.top()){ ed.pub(a); q.pop(); }
	}
	if(ed.size() == 2) cout<<(ll)ed[1] * ed[0]<<'\n';
	else cout<<0<<'\n';
}


Measured memory_bytes: 892
#include <stdio.h>
#include <iostream>
using namespace std;

//????????????
class Circle {
private:
	int x, y, r;
public:
	Circle(int x, int y, int r);
	void getRLTB(int rltb[]);
};

//?????????????????????
Circle::Circle(int x, int y, int r)
{
	this->x = x;
	this->y = y;
	this->r = r;
}

void Circle::getRLTB(int rltb[])
{
	rltb[0] = x + r;
	rltb[1] = x - r;
	rltb[2] = y + r;
	rltb[3] = y - r;
}


//????????¢?????????
class Rectangle {
private:
	int right, left = 0, top, bottom = 0;
public:
	Rectangle(int w, int h);
	bool judge(Circle cir);
};

//?????????????????????
Rectangle::Rectangle(int w, int h)
{
	this->right = w;
	this->top = h;
}

bool Rectangle::judge(Circle cir)
{
	int rltb[4];
	cir.getRLTB(rltb);
	
	if (rltb[0] > right) return false;
	if (rltb[1] < left) return false;
	if (rltb[2] > top) return false;
	if (rltb[3] < bottom) return false;
	
	return true;
}

//???????????¢??°
int main(void)
{		
	int w, h, x, y, r;
	cin >> w >> h >> x >> y >> r;
	
	Circle cir(x, y, r);
	Rectangle rec(w, h);
	
	if (rec.judge(cir)) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 3104
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

int main() {
	int N , A, B, C;

	cin >> N;
	cin >> A >> B;
	cin >> C;

	int *D;
	D = new int[N];
	int tmp;
	for (int i = 0; i < N; i++) {
		cin >> tmp;
		D[i] = tmp;
	}
	sort(D, D + N, greater<int>());

	int cc = C / A;
	for (int i = 0; i < N; i++) {
		int cal = C;
		int price = A;
		for (int j = 0; j <= i; j++) {
			cal += D[j];
			price += B;
		}
		if (cc > cal / price) {
			break;
		}
		cc = cal / price;
	}
	cout << cc << endl;

	return 0;
}

Measured memory_bytes: 3092