akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

const int Size = 1e5;
int a[Size];
int main(){
	int h,n,res;
	cin>>h>>n;
	res = h;
	for(int i=0;i<n;i++){
		cin>>a[i];
		res-= a[i];
	}
	if(res<=0)
		cout<<"Yes"<<"\n";
	else 
		cout<<"No"<<"\n";
return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

const int MOD = 1000000007;

int N, ans = 0, lst = 0;
vi nums;

void solve(int ind) {
    int odd = 0, even = 0;
    while (nums[ind] > 1) {
        even ++;
        if (nums[ind]&1) odd = 1;
        nums[ind] = (nums[ind]+1)/2;
    }
    even -= odd;
    if (odd) {
        if (lst < even+1) {
            ans += max(0,even+1-lst);
            lst = even+1;
        } else lst = even;
    } else {
        ans += max(0,even-lst);
        lst = even;
    }
}

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin >> N;
	F0R(i,N) {
	    int a; cin >> a; 
	    nums.pb(a);
	}
	F0R(i,N) solve(i);
	cout << ans;
}

// read!
// ll vs. int!

Measured memory_bytes: 892
#include <iostream>
using namespace std;
const double PLICE = 100;
double f1(double p,int y){
	return PLICE * (1 + (y * p));
}
double f2(double p,int y){
	double a = 1;
	for(int i = 0;i < y;++i){
		a *= (1 + p);
	}
	return PLICE * a;
}
int main(){
	int n,y,a,c,d;
	double b,p,price;
	while(cin >> n && n){
        price = 0;
		cin >> y;
		for(int i = 0;i < n;++i){
			cin >> a >> b >> c;
			p = b / 100;
			if(c == 1){
				if(price < f1(p,y)){
					price = f1(p,y);
					d = a;
				}
			}
			else{
				if(price < f2(p,y)){
					price = f2(p,y);
					d = a;
				}
			}
		}
		cout << d << endl;
	}
	return 0;
}

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

#define for_(i,a,b) for(int i=(a);i<(b);++i)
template< typename T > using Vec = vector< T >;
typedef long long lint;
template< typename T > void modAdd(T& a, T b, T mod) { a = (a + b) % mod; }

struct Edge {
	int v;
	lint d;
	bool operator > (const Edge& e) const { return d > e.d; }
};

int N, M, S, T, U[200005], V[200005];
lint D[200005];
Vec< Vec< Edge > > edge;

lint dst[2][100005];
void calcDist(int piv, int start) {
	priority_queue< Edge, Vec< Edge >, greater< Edge > > que;
	que.push(Edge{start, 0});
	dst[piv][start] = 0;
	while (!que.empty()) {
		Edge e = que.top(); que.pop();
		if (dst[piv][e.v] < e.d) continue;
		for (const Edge& ei : edge[e.v]) {
			if (dst[piv][ei.v] == -1 || dst[piv][ei.v] > e.d + ei.d) {
				dst[piv][ei.v] = e.d + ei.d;
				que.push(Edge{ei.v, dst[piv][ei.v]});
			}
		}
	}
}

lint numpath[2][100010];
const lint MOD = (lint)1e9 + 7;
void countPaths(int piv, int start) {
	Vec< Vec< int > > dag(N, Vec< int >());
	
	queue< int > que;
	que.push(start);
	Vec< bool > vis(N, false);
	vis[start] = true;
	
	while (!que.empty()) {
		int v = que.front(); que.pop();
		for (const Edge& e : edge[v]) {
			if (dst[1-piv][v] == dst[1-piv][e.v] + e.d) {
				dag[v].push_back(e.v);
				if (vis[e.v]) continue;
				que.push(e.v);
				vis[e.v] = true;
			}
		}
	}
	
	Vec< int > indeg(N, 0);
	for_(v,0,N) for (int u : dag[v]) ++indeg[u];
	
	que.push(start);
	numpath[piv][start] = 1;
	
	while (!que.empty()) {
		int v = que.front(); que.pop();
		for (int u : dag[v]) {
			modAdd(numpath[piv][u], numpath[piv][v], MOD);
			--indeg[u];
			if (indeg[u] == 0) que.push(u);
		}
	}
}

void solve() {
	memset(dst, -1, sizeof(dst));
	calcDist(0, S);
	calcDist(1, T);
	
	memset(numpath, 0, sizeof(numpath));
	countPaths(0, S);
	countPaths(1, T);
		
	lint collision = 0;
	
	Vec< bool > flag(N, false);
	
	for_(v,0,N) {
		if (dst[0][v] == dst[1][v]) {
			lint num = (numpath[0][v] * numpath[1][v]) % MOD;
			modAdd(collision, num * num, MOD);
			flag[v] = true;
		}
	}
	
	double thr = (double)dst[0][T] / 2.;
	for_(i,0,M) {
		int u = U[i], v = V[i], d = D[i];
		if (flag[u] || flag[v]) continue;
		if (abs(dst[0][v] - dst[0][u]) == d) {
			if (dst[0][v] + d == dst[0][u]) swap(u, v);
			if ((double)dst[0][u] < thr && (double)(dst[0][u] + d) > thr) {
				lint num = (numpath[0][u] * numpath[1][v]) % MOD;
				modAdd(collision, num * num, MOD);
			}
		}
	}
	
	cout << ((numpath[0][T] * numpath[1][S] - collision + MOD) % MOD) << endl;
}

int main() {
	cin >> N >> M;
	cin >> S >> T;
	--S; --T;
	
	edge.assign(N, Vec< Edge >());
	for_(i,0,M) {
		cin >> U[i] >> V[i] >> D[i];
		--U[i]; --V[i];
		edge[U[i]].push_back(Edge{V[i], D[i]});
		edge[V[i]].push_back(Edge{U[i], D[i]});
	}
	
	solve();
}

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

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }



int main() {
    ll h,w; cin >> h >> w;
    if(h%3 == 0 || w%3 == 0) {
        cout << 0 << endl;
        return 0;
    }
    // それ以外
    ll ans = LONG_MAX;
    FOR(i,1,h) {
        ll a = w*i;

        // 下半分は横分割版
        ll b = (w/2)*(h-i), c =(w/2)*(h-i);
        if(w%2 == 1) c += (h-i);
        //cout << a << ":" << b << ":" << c << endl;
        chmin(ans, abs(max(max(b, c),a)-min(min(a, b),c)));

        // 下半分も縦分割版
        ll hh = h-i;
        b = (hh/2)*w, c =(hh/2)*w;
        if(hh%2 == 1) c += w;
        //cout << a << ":" << b << ":" << c << endl;
        chmin(ans, abs(max(max(b, c),a)-min(min(a, b),c)));
    }
    FOR(i,1,w) {
        ll a = h*i;
        ll b = (h/2)*(w-i), c =(h/2)*(w-i);
        if(h%2 == 1) c += (w-i);
        //cout << a << ":" << b << ":" << c << endl;
        chmin(ans, abs(max(max(b, c),a)-min(min(a, b),c)));

        ll ww = w-i;
        b = (ww/2)*h, c =(ww/2)*h;
        if(ww%2 == 1) c += h;
        //cout << a << ":" << b << ":" << c << endl;
        chmin(ans, abs(max(max(b, c),a)-min(min(a, b),c)));
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace  std;
#define REP(i, n) for(long long (i)=0; (i)<(n); ++i)
class Node{
    public:
    Node *left, *right;
    int value;
    Node(int x){
        this->value = x;
        this->left = this;
        this->right = this;
    }
    ~Node(){
        this->left->right = this->right;
        this->right->left = this->left;
    }
};

class LinkedList{
public:
    Node *null;
    LinkedList(){
        null = new Node(-1); 
    }
    ~LinkedList(){
        while(null->right!=null){
            removeNode(null->right);
        }
        delete null;
    }
    void insert(int x){
        Node* nv = new Node(x);
        Node* head = null->right;
        nv->right = head;
        nv->left = null;
        head->left = nv;
        null->right = nv;
    }
    void remove(int x){
        Node* v = null->right;
        while(v->value!=x and v!=null){
            v = v->right;
        }
        if(v==null) return;
        else{
            return removeNode(v);
        } 
    }
    void removeNode(Node* x){
        if(x==null) return;
        else delete x;
    }
    void removeFirst(){
        removeNode(null->right);
    }
    void removeLast(){
        removeNode(null->left);
    }
    void show(){
        Node *v = null->right;
        while(v!=null){
            if(v->left!=null) cout << " ";
            cout << v->value;
            v = v->right;
        }
        cout << endl;
    }
};
signed main(){
    int n; cin>>n;
    string command;
    int x;
    LinkedList LL;
    for(long long i=0; i<n; i++){
        cin >> command;
        if(command=="insert"){
            cin>>x;
            LL.insert(x);
        }
        else if(command=="delete"){
            cin>>x;
            LL.remove(x);
        }
        else if(command=="deleteFirst") LL.removeFirst();
        else if(command=="deleteLast") LL.removeLast();
        else cout << "nannkachigau" << command << endl;
    }
    LL.show();

    return 0;
}


Measured memory_bytes: 34424
import java.util.Scanner;

public class Main{

public static void sort(int a, int b, int c) {
int lowest;
int mid;
int highest;
if (a < b && a < c) {
lowest = a;
} else if (b < a && b < c) {
lowest = b;
} else {
lowest = c;
}if (a > b && a > c) {
highest = a;
} else if (b > a && b > c) {
highest = b;
} else {
highest = c;
}if ((a > b && a < c) || (a <b && a > c)) {
mid = a;
} else if ((b > a && b < c) || (b < a && b > c)) {
mid = b;
} else {
mid = c;
}
System.out.println(lowest + " " + mid + " " + highest);
} 
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
sort(a, b, c);
}
}


Measured memory_bytes: 26344
#include <bits/stdc++.h>
#define ff { ios_base::sync_with_stdio(false);cin.tie(NULL);}
using namespace std;

typedef long long ll;
 ll  pp=1e9+7; 
double pi=3.141592653589793238;
  
 int main() {
        ff;
        string s,t;
        cin>>s>>t;
        ll c=0;
        for(int i=0;i<s.length();i++){
            if(s[i]!=t[i])c++;
        }
        cout<<c<<endl;
    return 0;
}

            
		
        
           
  

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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pll> pip;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-9;

int dd[13][4] = {
	{2,-1,-1,-1},
	{2,5,-1,-1},
	{0,1,3,6},
	{2,7,-1,-1},
	{5,-1,-1,-1},
	{1,4,6,9},
	{2,5,7,10},
	{3,6,8,11},
	{7,-1,-1,-1},
	{5,10,-1,-1},
	{6,9,11,12},
	{7,10,-1,-1},
	{10,-1,-1,-1}
};

int main() {
	queue<string> que;
	map<string, int> d;
	
	que.push("abcdefghijkla");
	d["abcdefghijkla"] = 0;
	
	while (!que.empty()) {
		string now = que.front(); que.pop();
		int cost = d[now];
		
		if (cost > 10) break;
		
		REP(i, 13) if (now[i] == 'a') {
			REP(j, 4) {
				if (dd[i][j] == -1) break;
				
				swap(now[i], now[dd[i][j]]);
				if (d.find(now) == d.end()) {
					d[now] = cost + 1;
					que.push(now);
				}
				swap(now[i], now[dd[i][j]]);
			}
		}
	}
	while (!que.empty()) que.pop();
	
	int p[13];
	while (cin >> p[0], ~p[0]) {
		FOR(i, 1, 13) cin >> p[i];
		string st = "";
		REP(i, 13) st += p[i] + 'a';
		
		map<string, int> d2;
		que.push(st);
		d2[st] = 0;
		
		int ans = INF;
		
		while (!que.empty()) {
			string now = que.front(); que.pop();
			int cost = d2[now];
			
			if (cost > 10) break;
			if (d.find(now) != d.end()) chmin(ans, d[now] + d2[now]);
			
			REP(i, 13) if (now[i] == 'a') {
				REP(j, 4) {
					if (dd[i][j] == -1) break;
					
					swap(now[i], now[dd[i][j]]);
					if (d2.find(now) == d2.end()) {
						d2[now] = cost + 1;
						que.push(now);
					}
					swap(now[i], now[dd[i][j]]);
				}
			}
		}
		while (!que.empty()) que.pop();
		
		if (ans <= 20) cout << ans << endl;
		else puts("NA");
	}
	return 0;
}

Measured memory_bytes: 11456
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
  int n,flag=0;
  char s[101];
  scanf("%s",s);
  n=strlen(s);
  for(int i=0;i<n;i++){
    if(flag&&s[i]=='F'){
      printf("Yes\n");
      return 0;
    }
    if(s[i]=='C')
      flag=1;
  }
  printf("No\n");
}



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

#define ll long long int
#define f(i,x,n)  for(int i=x;i<n;i++)
#define FASTIO cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
#define sz(a) int((a).size())
#define mod 1000000007
#define inf LLONG_MAX
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
template <typename T>
inline T gcd(T a, T b) { while (b != 0) swap(b, a %= b); return a; }

template <typename T>
inline void seethis(vector<T>vect)
{
    for(T x:vect)
        cout<<x<<" ";
    cout<<"\n";
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}
//LCM
int lcm(int a, int b) {  return a * (b / gcd(a, b)); }

//For sort by second
bool cmp(const pair<int,int> &a)
{ return a.first<a.second; }

//Tree
/* const int MAXN = 1e5 + 5;
vector<ll> adj[MAXN];*/

//ModPower
ll modpower(ll a,ll b,ll c)
{
    ll res=1;
    while(b)
    {
        if(b&1LL)
            res=(res*a)%c;
        a=(a*a)%c;
        b>>=1;
    }
    return res;
}

int main()
{
    FASTIO;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ll k,x;
     cin>>k>>x;

     if(k*500>=x)
        cout<<"Yes\n";
    else
        cout<<"No\n";

    
    return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define LL long long
#define maxn 200005
#define modn 998244353

using namespace std;
int main(){
	LL n;
	while(cin>>n){
		map<LL, LL> mp;
		LL arr[n];
		for(LL i=0; i<n; i++){
			scanf("%lld", arr+i);
			mp[arr[i]]++;
		}
		LL sum = 0;
		for(map<LL, LL>::iterator it = mp.begin(); it!=mp.end(); it++){
			LL t = it->second;
			sum += t*(t-1)/2;
			it->second--;
		}
		for(LL i=0; i<n; i++){
			printf("%lld ", sum-mp[arr[i]]);
		}cout << endl;
	}
}

Measured memory_bytes: 11008
#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;

using ll = long long;

//vector
using vi = vector<int>;
using vii = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

//constant
const double EPS = 1e-10;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }

// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

// DP
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

const string YES = "Yes";
const string NO = "No";



// ***************************************


int main(){
    ll N, K;
    cin >> N >> K;

    vll A(N);
    for(ll &a: A){
        cin >> a;
    }

    FOR(i, K, N){
        if (A[i] > A[i - K]) {cout << YES <<endl;}
        else {cout << NO << endl;}
    }


    return 0;
}


Measured memory_bytes: 4836
#include <iostream>

using namespace std;

int a[13];


int main()
{
    a[4] = 1;
    a[6] = 1;
    a[9] = 1;
    a[11] = 1;
    a[0] = 1e6;
    a[2] = 2;

    int x,y;
    cin >> x >> y;
    if(a[x] == a[y]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


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

#define MAX 2000000
#define VMAX 10000

int main()
{
  int i, j, n;
  int *A, *B;
  int C[VMAX+1];
  
  scanf("%d",&n);

  A = malloc(sizeof(int)*n+1);
  B = malloc(sizeof(int)*n+1);

  for(i = 0; i <= VMAX; i++) {
    C[i] = 0;
  }
  
  for(i = 0; i < n; i++) {
    scanf("%d", &A[i+1]);
    C[A[i+1]]++;
  }

  for(i = 1; i <=VMAX; i++) {
    C[i] = C[i] + C[i-1];
  }

  for(j = 1; j <= n; j++) {
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }

  for(i = 1; i <= n; i++) {
    if(i > 1) printf(" ");
    printf("%d", B[i]);
  }
  printf("\n");

  return 0;
}

Measured memory_bytes: 16272
K, N = map(int,input().split())
#K: 湖1周の長さ, N:湖の周りにある家の数

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

ans = 10**10
for i in range(N):
    for j in range(2):
        if j == 0: #時計周り
            if i == 0:
                dif = A[0]+(K-A[-1])
            else:
                dif = A[i] - A[i-1]
            ans = min(ans, K-dif)
        else: #半時計周り
            if i == N-1:
                dif = A[0]+(K-A[-1])
            else:
                dif = A[i+1] - A[i]
            ans = min(ans, K-dif)

print(ans)

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

int main() {
    int N;
    cin >> N;
    if (N%2 ==0) cout << N/2 << endl;
    else cout << (N+1)/2 << endl;
    //cout << N/2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    vector<int> v(3);
    cin >> v[0] >> v[1] >> v[2];
    sort(v.begin(), v.end(), greater<int>());
    int result = 0;
    result += v[0] - v[1];
    v[2] += result;
    if((v[0]-v[2])%2==0){
        result += (v[0] - v[2]) / 2;
    }else{
        result +=1+ (1+v[0] - v[2]) / 2;
    }
    cout << result << endl;

    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline


class SegmentTree0():
    """
    0-indexed Segment Tree
    """
    def __init__(self, n_, ele_id, op_func):
        self.n = 1 << (n_ - 1).bit_length()  # size
        self.data = [ele_id] * (2 * self.n - 1)  # binary tree (0-indexed)
        self.ele_id = ele_id  # identity element
        self.op_func = op_func  # binary operation of monoid

    def __getitem__(self, i):
        return self.data[i + self.n - 1]

    def build(self, data_init):
        for i in range(len(data_init)):
            self.data[i + self.n - 1] = data_init[i]  # set data in leaf
        for i in range(self.n - 2, -1, -1):
            self.data[i] = self.op_func(self.data[2 * i + 1],
                                        self.data[2 * i + 2])

    def update(self, i, x):
        # change i-th element to x (i : 0-indexed)
        i += self.n - 1
        self.data[i] = x
        while i > 0:
            i = (i - 1) // 2  # go to parenet-node
            self.data[i] = self.op_func(self.data[2 * i + 1],
                                        self.data[2 * i + 2])

    def query(self, a, b):
        # query for interval [a, b) (a, b : 0-indexed)
        return self.query_(a, b, 0, 0, self.n)

    def query_(self, a, b, k, l, r):
        if r <= a or b <= l:
            # [a, b) and [l, r) have no intersection
            return self.ele_id
        if a <= l and r <= b:
            # [a, b) includes [l, r)
            return self.data[k]
        else:
            # [a, b) and [l, r) have some overlap
            child_l = self.query_(a, b, 2 * k + 1, l, (l + r) // 2)
            child_r = self.query_(a, b, 2 * k + 2, (l + r) // 2, r)
            return self.op_func(child_l, child_r)


n, q = map(int, input().split())
ele_id = (1 << 31) - 1
op_func = min
st_rmq = SegmentTree0(n, ele_id, op_func)
for _ in range(q):
    com, x, y = map(int, input().split())
    if com == 0:
        st_rmq.update(x, y)
    elif com == 1:
        ans = st_rmq.query(x, y + 1)
        print(ans)



Measured memory_bytes: 9452
N,M = map(int,input().split())
 
A = [[] for i in range(N)]
 
for i in range(N):
    A[i] = list(map(int,input().split()))
 
B = [[0]*1 for i in range(M)]
 
for i in range(M):
    B[i] = int(input())

for r in range(N):
    t = 0
    for c in range(M):
        t += A[r][c]*B[c]
    print("%d"%(t))


Measured memory_bytes: 6016
#pragma region
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define repc(i, m, n) for (int i = m; i < n; i++)
#define reprc(i, m, n) for (int i = m; i > n; i--)
#define all(v) v.begin(), v.end()
#define INF 1e9
#define EPS 1e-10
using namespace std;
typedef long long ll;
#pragma endregion

int main()
{
    string S,T,U;
    int A,B;
    cin >> S >> T;
    cin >> A >> B;
    cin >> U;

    if(S == U){
        A--;
    }else if(T == U){
        B--;
    }

    cout << A << " " << B << endl;
}

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

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define rng(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define rbf(i, v) for (auto& (i) : (v))
#define All(x) (x).begin(),(x).end()
#define COL(x) cout << x << endl
#define CO(x) cout << x
//#define int long long

using LL = long long;
using UL = unsigned long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using VP = vector<PII>;

const double PI = 3.141592653589793;
const int MOD = 1000000007;
const LL INF64 = INT64_MAX >> 1;
const int INF = INT_MAX >> 1;

template<typename T> inline T sqr(T x) { return (x * x); }
inline void printd(double x) { printf("%.10lf\n", x); }
inline void upsort(VI& x) { sort((x).begin(), (x).end()); }
inline void downsort(VI& x) { sort((x).begin(), (x).end(), greater<int>()); }
inline int absdiff(int a, int b) { return (a - b) * (static_cast<int>(a > b)*2 - 1); }
int gcd(int a, int b) { // 最大公約数
	if (a < b) return gcd(b, a);
	int r;
	while ((r = a % b)) {
		a = b;
		b = r;
	}
	return b;
}
inline int lcm(int a, int b) { return a * b / gcd(a, b); } // 最小公倍数
#pragma endregion

signed main()
{
	int A, B;
	cin >> A >> B;
	COL(A*B);
	return 0;
}

Measured memory_bytes: 3636
N, x = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
if A[0] > x:
    ans += A[0] - x
    A[0] = x
 
for i in range(1, N):
    if A[i]+A[i-1] > x:
        ans += A[i]+A[i-1]-x
        A[i] -= A[i]+A[i-1]-x
 
print(ans)

Measured memory_bytes: 20124
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int a,int b){return b?gcd(b,a%b):a;}

signed main(){
    int k;
    string s;
    cin >> k >> s;
    if(s.size()<=k){
        cout << s << endl;
    }
    else{
        REP(i,k){
            cout << s[i];
        }
        cout << "..." << endl;
    }
    



    return 0;
}

Measured memory_bytes: 3624
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>

#define REP(n) for(int i = 0;i < n;i++)
#define LLREP(n) for(long long int  i = 0;i < n;i++)
typedef long long int ll;
using namespace std;
#define MAX_A 100005

int main(){

    int a,b,c,d;
    cin >> a >> b >> c >> d;

    if(abs(a-b)<= d && abs(b-c) < d || abs(a-c) <= d){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
   
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define x first
#define y second
#define ndl '\n'
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)x.size()
#define bit __builtin_popcount
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

using namespace std;
using namespace __gnu_pbds;

template<typename T> using indexed_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<int, ull> piu;
typedef vector<vector<int>> matrix;

const ll INF = 1e18 + 123;
const ld EPS = 1e-9;
const int inf = 1e9 + 123;
const int MOD = 1e9 + 7;
const int N = 5e5 + 13;
const int M = 1e6 + 123;
const double pi = acos(-1.0);
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};

void solve(){
    ll w, h;
    cin >> w >> h;
    if (w == 1 || h == 1){
        cout << 1;
        return;
    }
    if (w % 2 == 0){
        cout << (w/2) * h;
    }
    else if (h%2 == 0){
        cout << (h/2) * w;
    }
    else{
        cout << ((h+1)/2) * ((w+1)/2) + (w/2) * (h/2);
    }
}

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    while (t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
  int a, b, c, x;
  int i, j, k;
  int ret;
  int cnt = 0;

  ret = scanf("%d\n%d\n%d\n%d\n",&a,&b,&c,&x);

  for (i = 0;i <= a;i++) {
    for(j = 0;j <= b;j++) {
      for(k = 0;k <= c;k++) {
        if (((500*i)+(100*j)+(50*k)) == x) {
          cnt++;
        }
      }
    }
  }

  printf("%d\n",cnt);

  return 0;
}

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

int main(){
  long n,m,inf = 1000000007;
  cin >> n >> m;
  long x[n+1],y[m+1];
  for(int i = 1;i <= n;i++){
    cin >> x[i];
  }
  for(int i = 1;i <= m;i++){
    cin >> y[i];
  }
  long xsum = 0,ysum = 0;
  for(long i = 1;i <= n;i++){
    xsum += (i-1)*x[i]%inf - (n-i)*x[i]%inf;
    xsum %= inf;
  }
  for(long i = 1;i <= m;i++){
    ysum += (i-1)*y[i]%inf - (m-i)*y[i]%inf;
    ysum %= inf;
  }
  if(xsum < 0){
    xsum += inf;
  }
  if(ysum < 0){
    ysum += inf;
  }
  cout << (xsum)*(ysum)%inf << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional>
using namespace std;

#define All(v) (v).begin(),(v).end()
int dy[8] = {-1,0,1,0,-1,1,1,-1};
int dx[8] = {0,1,0,-1,1,1,-1,-1};
const long long mod = 1000000007;

signed main(){
    long long n;
    cin>>n;
    vector<long long> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    long long res=0;
    for(int i=0;i<60;i++){
        long long cnt=0;
        for(int j=0;j<n;j++){
            if(a[j]&(1ll<<i)){
                cnt++;
            }
        }
        res+=(1ll<<i)%mod*cnt%mod*(n-cnt)%mod;
    }
    cout<<res%mod<<endl;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
typedef vector<vector<int>> Graph;
const int inf = 1e9;
const int mod = 1e9 + 7;


class SCC {
private:
    const int n;
    VV G;
    VV rG;
    V vs;
    vector<bool> used;
    V cmp;
public:
    SCC(int _n) : n(_n), G(_n), rG(_n), used(_n), cmp(_n) {}
    void addEdge(int from, int to) {
        G[from].emplace_back(to);
        rG[to].emplace_back(from);
    }
    void dfs(int v) {
        used[v] = true;
        rep(i, G[v].size()) {
            if (!used[G[v][i]]) dfs(G[v][i]);
        }
        vs.emplace_back(v);
    }
    void rdfs(int v, int k) {
        used[v] = true;
        cmp[v] = k;
        rep(i, rG[v].size()) {
            if (!used[rG[v][i]]) rdfs(rG[v][i], k);
        }
        vs.emplace_back(v);
    }
    int scc() {
        // memset(used, 0, sizeof(used));
        // vs.clear();
        rep(v, n) {
            if (!used[v]) dfs(v);
        }
        used.assign(n, false);
        // memset(used, 0, sizeof(used));
        int k = 0;
        for (int i = vs.size() - 1; i >= 0; i--) {
            if (!used[vs[i]]) rdfs(vs[i], k++);
        }
        return k;
    }
    bool same(int a, int b) {
        return cmp[a] == cmp[b];
    }
};


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

    int N, M;
    cin >> N >> M;
    SCC scc(N);
    rep(i, M) {
        int s, t;
        cin >> s >> t;
        scc.addEdge(s, t);
    }

    scc.scc();

    int Q;
    cin >> Q;
    rep(i, Q) {
        int u, v;
        cin >> u >> v;
        cout << scc.same(u, v) << endl;
    }

}

Measured memory_bytes: 4644
#include <stdio.h>

int main(){
	int  q, h, s, d;
	int  n;
	long int value = 0;

	scanf("%d %d %d %d", &q, &h, &s, &d);
	scanf("%d", &n);

	if(2*q < h) h = 2*q;
	if(2*h < s) s = 2*h;
	if(2*s < d) d = 2*s;

	value += (long)d * (long)(n / 2);
	if(n % 2)
		value += s;

	printf("%ld\n", value);

}

Measured memory_bytes: 128
import java.util.*;
public class Main{
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);



while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
}
//sc.close();
}
}



Measured memory_bytes: 26332
<?php

fscanf(STDIN, '%d %d', $N, $M);
$point = array_map('intVal', explode(' ', trim(fgets(STDIN))));

if ($N >= $M) {
    echo 0;
} else {
    rsort($point);
    $distance = [];
    for ($i = 0; $i < $M-1; ++$i) {
        $distance[] = $point[$i] - $point[$i+1];
    }
    rsort($distance);
    array_splice($distance, 0, $N-1);
    
    echo array_sum($distance);
}


Measured memory_bytes: 19700
//package solution;

import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;
import java.text.*;

public final class Main {
    BufferedReader br;
    StringTokenizer stk;

    public static void main(String[] args) throws Exception {
        new Main().run();
    }
    
    {
        stk = null;
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    
    void run() throws Exception {
        double s = ni();
        double fdim = s/3;
        double sdim = s/3;
        double tdim = s - (fdim + sdim);
        double volume = fdim * sdim * tdim;
        NumberFormat nf = new DecimalFormat("#0.0000000000");
        pl(nf.format(volume));
    }
    
    //Reader & Writer
    String nextToken() throws Exception {
        if (stk == null || !stk.hasMoreTokens()) {
            stk = new StringTokenizer(br.readLine(), " ");
        }
        return stk.nextToken();
    }

    String nt() throws Exception {
        return nextToken();
    }

    String ns() throws Exception {
        return br.readLine();
    }

    int ni() throws Exception {
        return Integer.parseInt(nextToken());
    }

    long nl() throws Exception {
        return Long.parseLong(nextToken());
    }

    double nd() throws Exception {
        return Double.parseDouble(nextToken());
    }

    void p(Object o) {
        System.out.print(o);
    }

    void pl(Object o) {
        System.out.println(o);
    }
    
    void selector() {
        Random rd = new Random();
        String[] s = new String[] {"Strings", "Sorting", "Search"
                , "Graph theory", "Greedy", "Dynamic programming"
                , "Constructive algos", "Bit manipulation", "Recursion"};
        pl(s[rd.nextInt(s.length)] + " " + (rd.nextInt(5)+1));
    }
}

Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = INF+7;
const ll LINF = 1e18;
#define rep(i,N) for(int (i)=0;(i)<(N);++(i))
#define rrep(i,N) for(int (i)=(N-1);(i)>0;--i)
#define FOR(i,j,N) for(int (i)=(j);(i)<(N);++(i))
#define put(n) cout<<(n)<<endl;
#define VI vector<int>
#define VII vector<vector<int>>
#define all(v) v.begin(),v.end()
#define MP make_pair
#define pb(n) push_back(n)
#define int long long
int N,K,a,b,cnt;
signed main(){
    cin>>N>>K;
    map<int,int> mp;
    rep(i,N) cin>>a>>b,mp[a] += b;
    for(auto i = mp.begin(); i != mp.end(); ++i){
        if(cnt + i->second >= K){
            cout<<i->first<<endl;
            return 0;
        } 
        cnt += i->second;
    }
}

Measured memory_bytes: 4224
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <queue>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n , q;
	std::string buf;
	std::vector<std::priority_queue<long> > ques;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif


#if INPUT_FROM_FILE
	std::getline(ifs, buf);
#else
	std::getline(std::cin, buf);
#endif
	{
		std::istringstream stream(buf);

		stream >> n >> q;
	}

	ques.resize(n);
	for(int i = 0; i < q; i++){
#if INPUT_FROM_FILE
		std::getline(ifs, buf);
#else
		std::getline(std::cin, buf);
#endif
		std::istringstream stream(buf);
		long tmp, t, x;

		if(buf[0] == '0'){
			stream >> tmp >> t >> x;

			ques[t].push(x);
		}
		else if(buf[0] == '1'){
			stream >> tmp >> t;

			if(!ques[t].empty()){
				std::cout << ques[t].top() << std::endl;
			}
		}
		else{
			stream >> tmp >> t;
			if(!ques[t].empty()){
				ques[t].pop();
			}
		}

	}

	return 0;
}



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

int main() {
    int n, m, k, t;
    while(~scanf("%d %d %d", &n, &m, &k)) {
        scanf("%d", &t);
        ll sum = n + m + k;
        ll c = max(max(n, m), k);
        while(t--) {
            sum += c;
            c = c * 2;
        }
        cout << sum << endl;
    }
    return 0;
}


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

class Program {
    static void Main(string[] args) {
        Console.WriteLine(Cin.Next() == Cin.Next() ? "H" : "D");
    }
}


public class Cin {
    private static string[] s = new string[0];
    private static int i = 0;

    private static char[] cs = new char[] { ' ' };

    public static string Next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        i = 0;
        return Next();
    }

    public static int Ni() {
        return int.Parse(Next());
    }

    public static long NextLong() {
        return long.Parse(Next());
    }

    public static double NextDouble() {
        return double.Parse(Next());
    }

}


Measured memory_bytes: 11092
from collections import defaultdict
H = defaultdict(lambda: 0)
H[0] = 1
def inpl(): return [int(i) for i in input().split()]
N, A = inpl()
x = inpl()
x = [i-A for i in x]
H[0]= 1
for i in x:
    for ni,nv in H.copy().items():
        H[ni+i] += nv
print(H[0]-1)

Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> cycle(ll start, vector<ll>&telp){
	ll idx=telp[start];
	vector<ll>ret;
	while(idx != start){
		ret.push_back(idx);
		idx = telp[idx];
	}
	ret.push_back(idx);
	return ret;
}
vector<ll> init_cycle(ll start,vector<ll>&telp){
	ll idx=0;
	vector<ll>ret;
	while(idx != start){
		ret.push_back(idx);
		idx = telp[idx];
	}
	ret.push_back(idx);
	return ret;
}
int main(){
	ll n,k; cin>>n>>k;
	vector<ll>telp(n);
	for(ll i=0;i<n;i++) {
		cin>>telp[i];
		telp[i]--;
	}
	ll fast=0, slow=0, cnt=0;
	bool ans=false;
	do{
		fast = telp[telp[fast]];
		slow = telp[slow];
	}while(slow != fast);
	slow = 0;
	while(slow!=fast){
		slow=telp[slow];
		fast=telp[fast];
	}
	ll start = slow;
	vector<ll>init=init_cycle(start, telp);
	if(k <= init.size()-1){
		cout<<init[k] + 1<<endl;
		return 0;
	}
	k -= (init.size());
	vector<ll>lst = cycle(start, telp);
	cout<<lst[k%lst.size()]+1<<endl;
	return 0;
}

Measured memory_bytes: 6832
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

int main(){
    string s;
    int a, b;

    cin >> a >> b >> s;

    if(s.substr(a, 1) == "-" && s.find("-") == s.rfind("-")){
        if(s.size() == (a + b) + 1){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
n = int(input())
h_list = list(map(int, input().split()))

jump_max = 0
count = 0
for index in range(1, n):
    tmp_high = h_list[index]
    before_high = h_list[index-1]
    if tmp_high <= before_high:
        count +=1
        continue
    else:
        jump_max  = max(jump_max, count)
        count = 0
print(max(jump_max, count))

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

namespace AOJ
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = 0;
            while (true)
            {
                count++;
                int x = int.Parse(Console.ReadLine());

                if (x == 0) break;

                Console.WriteLine("Case " + count + ": " + x);
            }
        }
    }
}



Measured memory_bytes: 17920
sx, sy, tx, ty = map(int, input().split())
py = ty-sy
px = tx-sx
ans = "R"*px + "U"*py + "L"*px + "D"*(py+1) + "R"*(px+1) + "U"*(py+1) + "LU" + "L"*(px+1) + "D"*(py+1)+ "R" 
 
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n, k;
  cin>>n>>k;
  int a[n];
  for(int i=0;i<n;i++) cin>>a[i];
  vector<bool> dp(k+1,false);
  for(int i=0;i<=k;i++) for(int j=0;j<n;j++) 
  {
      if(i>=a[j]) dp[i]=dp[i]|(!dp[i-a[j]]);
      else break;
  }
  if(dp[k]) cout<<"First";
  else cout<<"Second";
}

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

int main() {
  int H, W;
  cin >> H >> W;

  vector<string> A(105);
  bool erase_x[105] = {}, erase_y[105] = {};
  for (int i = 0; i < H; i++) {
    cin >> A[i];
    if (A[i].find('#') == string::npos)
      erase_y[i] = true;
  }

  for (int j = 0; j < W; j++) {
    erase_x[j] = true;
    for (int i = 0; i < H; i++) {
      if (A[i][j] == '#') {
        erase_x[j] = false;
        break;
      }
    }
  }

  for (int i = 0; i < H; i++) {
    if (!erase_y[i]) {
      for (int j = 0; j < W; j++) {
        if (!erase_x[j])
          cout << A[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 888
x, n = list(map(int, input().split()))
if n == 0:
  print(x)
  quit()
p = list(map(int, input().split()))
ans = x
ans2 = x-1
while True:
  if not ans in p:
    print(ans)
    quit()
  ans += 1
  if not ans2 in p:
    print(ans2)
    quit()
  ans2 -= 1
  

Measured memory_bytes: 9128
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(){
  string S;
  cin >> S;
  char ans = 'A';
  for(int i = 0; i < 26; i++){
    char tmp = 'a' + i;
    bool flag = true;
    for(int j = 0; j < S.size(); j++){
      if(tmp == S[j]){
        flag = false;
        break;
      }
    }
    if(flag){
      ans = tmp;
      break;
    }
  }
  if(ans == 'A') cout << "None" << endl;
  else cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define rn(i,n) for(int i=1;i<=n;i++)

int main(void){
  int n,d;
  cin>>n>>d;

  if(n%(2*d+1)==0)cout<<n/(2*d+1)<<endl;
  else cout<<n/(2*d+1)+1<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#define mp make_pair

using namespace std;
int n, m, a[100005];
long long ans;
priority_queue<pair<int,int> > q;
int main()
{
    scanf("%d%d", &n, &m);
    for(int i = 1; i <= n; i++)
    {
        scanf("%d", &a[i]);
        ans += a[i];
        q.push(mp(a[i] - a[i] / 2, i));
    }
    for(int i = 1, x; i <= m; i++)
    {
        ans -= q.top().first;
        x = q.top().second;
        q.pop();
        a[x] /= 2;
        q.push(mp(a[x] - a[x] / 2, x));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1656
n = int(input())
point = []
for _ in range(n):
    x, y = map(int, input().split())
    point.append([x, y])
    
ans = 0
for i in range(n):
    for j in range(i, n):
        ans += (((point[i][0] - point[j][0]) ** 2) + ((point[i][1] - point[j][1]) ** 2)) ** 0.5
print((ans * 2) / n)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main() {
    int a, b; cin >> a >> b;
    cout << 6 - a - b << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
void chmax(long long& a, long long b) { if (a < b) a = b; }

int main() {
    // 入力
    int N; long long W;
    cin >> N >> W;
    vector<long long> weight(N), value(N);
    for (int i = 0; i < N; ++i) cin >> weight[i] >> value[i];

    // DP テーブル定義
    vector<vector<long long> > dp(N+1, vector<long long>(W+1, 0));

    // DPループ
    for (int i = 0; i < N; ++i) {
        for (int w = 0; w <= W; ++w) {

            // i 番目の品物を選ぶ場合
            if (w - weight[i] >= 0) {
                chmax(dp[i+1][w], dp[i][w - weight[i]] + value[i]);
            }

            // i 番目の品物を選ばない場合
            chmax(dp[i+1][w], dp[i][w]);
        }
    }

    // 最適値の出力
    cout << dp[N][W] << endl;
}


Measured memory_bytes: 80256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const int Max = 2e5;

long long n, a[Max + 5];
long long sum[Max + 5], tot[Max + 5], ans = 100000000000;

int main()
{
	scanf ("%lld", &n);
	sum[0] = 0;
	for (int i = 1; i <= n; i++){
		scanf ("%lld", &a[i]);
		sum[i] = sum[i - 1] + a[i];
//		printf ("%d\n", sum[i]);
	}
	tot[n + 1] = 0; 
	for (int i = n; i >= 1; i--){
		tot[i] = tot[i + 1] + a[i];
//		printf ("%d\n", tot[i]);
	}
	for (int i = 1; i <= n - 1; i++){
//		printf ("%d  %d\n", sum[i], tot[i]);
		long long w = abs(sum[i] - tot[i + 1]);
		ans = min(ans, w);
	}
	printf ("%lld\n", ans);
}

Measured memory_bytes: 4864
n = int(input())
count = 0
d = []
flag = False

for i in range(n):
    d = list(map(int, input().split()))
    if d[0] == d[1]:
        count += 1
    else:
        count = 0
    if count == 3:
        flag = True

if flag:
    print('Yes')
else:
    print('No')

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

using namespace std;

typedef long long ll;
typedef long double ld;
#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
#define per(i , j , n) for(long long i = j ; i >= n ; i--)

const ll N = 123456;
const ll mod = 1e9 + 7;
const ld eps = 1e-5;
const int MAX = 55;

#define DIM 55 // default to 2. Set value according to problem.
struct matrix{
  ll a[DIM][DIM];
    
    // constructor. Make an empty array.
    matrix() {
        memset(a, 0, sizeof(ll) * DIM * DIM);
    }
    
    // constant matrix (M). Set value according to problem.
    void unit_matrix() {
        a[0][0] = 26; a[0][1] = 52;
        a[1][0] = 0; a[1][1] = 1;
    }
    
    matrix operator* (matrix b) {
        matrix c;
        for (int k = 0; k < DIM; ++ k) { 
            for (int i = 0; i < DIM; ++i) {
                for (int j = 0; j < DIM; ++j) {
                    c.a[i][j] = (c.a[i][j] + a[i][k] * b.a[k][j]) % mod;
                }
            }
        }
        return c;
    }
};
 
matrix pow_matrix(matrix a, ll n) {
    if (n == 1) return a;
    
    matrix b = pow_matrix(a, n / 2);
    b = b * b;
    if (n & 1) b = b * a;
    
    return b;
}

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

    cout << fixed;

    int n;

    cin >> n;

    ll k;

    cin >> k;

    matrix m;

    rep(i , 0 , n - 1) {
        rep(j , 0 , n - 1) {

            cin >> m.a[i][j];
        }
    }

    m = pow_matrix(m , k);

    ll ans = 0;

    rep(i , 0 , n - 1) {
        rep(j , 0 , n - 1) {
            ans += m.a[i][j];
            ans %= mod;
        }
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 8576
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>

using namespace std;
using ll = long long;

#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1;} return 0;}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////

const int MAX = 100010;
int a[MAX], b[MAX], c[MAX];

int main() {
    int n;
    cin >> n;
    rep(i, n) cin >> a[i] >> b[i] >> c[i];
    vector<vector<int>> dp(n, vector<int>(3, 0));
    dp[0][0] = max(b[0], c[0]);
    dp[0][1] = max(a[0], c[0]);
    dp[0][2] = max(a[0], b[0]);
    repf(i, 1, n) {
        dp[i][0] = max(dp[i-1][1] + a[i], dp[i-1][2] + a[i]);
        dp[i][1] = max(dp[i-1][0] + b[i], dp[i-1][2] + b[i]);
        dp[i][2] = max(dp[i-1][0] + c[i], dp[i-1][1] + c[i]);
    }
    cout << max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2])) << endl;
    return 0;
}


Measured memory_bytes: 6912
#include <stdio.h>
int main(void){
  int A,B,C,i=0;
  scanf("%d %d %d",&A,&B,&C);
  for(;B-A>=0;B=B-A)
  i++;
  
  if(i>C)
  printf("%d",C);
  else
  printf("%d",i);
  
  return(0);
}

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


int main() {
    ll x;
    cin >> x;
    ll money = 100;
    ll year = 0;

    while(x > money){
        year++;
        money += money/100;
    }

    cout << year << endl;

    return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
int cmpint(const void *x, const void *y) { return *(int *)y - *(int *)x; }
int main() {
	int n, a[100000], first = 0, second = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	qsort(a, n, sizeof(int), cmpint);
	for (int i = 0; i < n - 1; i++) {
		if (a[i] == a[i + 1]) {
			if (first == 0) {
				first = a[i];
				a[i] = a[i + 1] = 0;
			} else {
				second = a[i];
				break;
			}
		}
	}
	printf("%lld\n", (long long)first * second);
	return 0;
}

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

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	string S;
	cin >> S;
	if (S == "Sunny") {
		cout << "Cloudy" << endl;
	}
	else if (S == "Cloudy") {
		cout << "Rainy" << endl;
	}
	else if (S == "Rainy") {
		cout << "Sunny" << endl;
	}
	return 0;
}

Measured memory_bytes: 256