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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repr(i, n) for(int i = (n-1); i >= 0; --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; }

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

const int MAX = 200005;
const int INF = 1001001001;
const int MOD = 1000000007;

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

    if (30 <= X) puts("Yes");
    else puts("No");
}

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>

#include <cstdio>

using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
typedef long long ll;
typedef unsigned long long ull;

int a[500000];

int main()
{
	string S;
	stack<int> stk;
	int len;
	ll ans = 0;
	int index, val;

	cin >> S;
	len = S.length();

	rep(i, len + 1) a[i] = -1;

	rep(i, len) {
		if (S[i] == '<') {
			if (stk.empty()) {
				if (i == 0) a[i] = 0;
				else a[i] = a[i - 1] + 1;
			}
			else if (stk.top() == '>') {
				val = 0;
				index = i;
				a[index] = val;

				while (!stk.empty()) {
					stk.pop();
					index--;
					val++;
					a[index] = max(a[index], val);
				}
			}
		}
		else {
			if (stk.empty()) {
				stk.push('>');
				if (i != 0) a[i] = a[i - 1] + 1;
			}
			else if (stk.top() == '>') stk.push('>');
		}

		if (i == len - 1) {
			if (S[i] == '>') {
				val = 0;
				index = len;
				a[index] = val;

				while (!stk.empty()) {
					stk.pop();
					index--;
					val++;
					a[index] = max(a[index], val);
				}

			}
			else a[len] = a[i] + 1;
		}
	}

	rep(i, len + 1) ans += (ll)a[i];

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4740
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) std::begin(a), std::end(a)
#define RALL(a) std::rbegin(a), std::rend(a)
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define INT(x) (static_cast<int>(x))

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;

constexpr int INF = 2e9;
constexpr double EPS = 1e-10;
constexpr double PI = acos(-1.0);

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

template <typename T>
constexpr int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
constexpr int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T, typename U>
constexpr void chmax(T& m, U x) {
	m = max(m, x);
}

template <typename T, typename U>
constexpr void chmin(T& m, U x) {
	m = min(m, x);
}

template <typename T>
constexpr T square(T x) {
	return x * x;
}

// 二項係数
// 計算量 O(r)
template <typename T>
constexpr T combination(long long n, long long r) {
	if(n < r || n < 0 || r < 0) {
		return T(0);
	}
	T ret = 1;
	r = std::min(r, n - r);
	for(int i = 0; i < r; i++) {
		ret *= (n - i);
		ret /= i + 1;
	}
	return ret;
}

int main() {
	int n;
	cin >> n;
	vector<ll> a(n);
	unordered_map<ll, ll> m;
	REP(i, n) {
		cin >> a[i];
		m[a[i]]++;
	}
	unordered_map<ll, ll> comb;
	ll sum = 0;
	REP(i, n) {
		if(comb[a[i]] == 0) {
			comb[a[i]] = combination<ll>(m[a[i]], 2);
			sum += comb[a[i]];
		}
	}
	REP(i, n) {
		cout << sum - comb[a[i]] + comb[a[i]] * (m[a[i]] - 2) / m[a[i]] << endl;
	}
	return 0;
}


Measured memory_bytes: 17864
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long int
#define mod 1000000007
#define string_mod 2549536629329_base_255
#define pb push_back
#define F first
#define S second
#define ff first
#define endl "\n"
#define ss second
#define all(v) v.begin(), v.end()
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
int power(int x, unsigned int y, int p)
{
    int res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res % p;
} 
void solve()
{
    int a;
    long double b; 
    cin >> a >> b;
    int c=(b*100+0.5);
    a *=c;
    int f = a / 100;
    cout <<f << endl;
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int tc;
    tc = 1;
    // cin >> tc;
    while (tc--)
    {
        solve();
    }

    return 0;
}

Measured memory_bytes: 3680
#include <iostream>
#include <vector>
#include <cstring>

using namespace std;

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

int main(){
    int n;
    while(cin >> n && n){
        bool field[21][21];
        int px = 10;
        int py = 10;
        vector<pair<int,int> > js(n);
        memset(field, false, sizeof(field));
        for(int i=0;i<n;i++){
            cin >> js[i].first >> js[i].second;
        }
        int m,dir;
        char c;
        int times;
        cin >> m;
        field[px][py] = true;
        for(int i=0;i<m;i++){
            cin >> c;
            if(c == 'E'){
                dir = 0;
            }else if(c == 'N'){
                dir = 1;
            }else if(c == 'W'){
                dir = 2;
            }else{
                dir = 3;
            }
            cin >> times;
            for(int j=0;j<times;j++){
                px += dx[dir];
                py += dy[dir];
                field[px][py] = true;
            }
        }
        bool isok = true;
        for(int i=0;i<n;i++){
            if(field[js[i].first][js[i].second] == false){
                isok = false;
            }
        }
        if(isok){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
}

Measured memory_bytes: 0
#include<iostream>
#include<cstdio>
#include<functional>
#include<cstring>
#include<string>
#include<vector>
#include<queue>
#include<cmath>
#include<algorithm>
#include<map>
#include<ctime>
using namespace std;
typedef long long ll;
typedef long double ld;
const int maxn = 1e5+7;
const int inf = 1e5;
const int modn = 1e9+7;
const ld eps = 1e-8;
const long double PI = acos(-1.0);
void qRead(ll &x){x = 0;char a;for(a = getchar();a <'0' || a > '9';a = getchar());for(;a >= '0' && a <= '9';a = getchar())x = x*10 + a-'0';}
void qRead(int &x){x = 0;char a;for(a = getchar();a <'0' || a > '9';a = getchar());for(;a >= '0' && a <= '9';a = getchar())x = x*10 + a-'0';}
ll qpow(ll a,ll b,ll mo = modn){
//    printf("%lld\n",mo);
    ll res = 1;
    while(b){
        if(b & 1)res = (res*a) % mo;
        a = (a*a) % mo;
        b >>= 1;
    }
    return res;
}
ld qpow(ld a,ll b){
    ld res = 1;
    while(b){
        if(b & 1)res *= a;
        a = a*a;
        b >>= 1;
    }
    return res;
}
ll gcd(ll a,ll b){
    if(!b)return a;
    return gcd(b,a%b);
}
//ll vis[maxn],prime[maxn],cnt,smallP[maxn];
//void getPrime(int n){
//    cnt = 0;
//    for(int i = 1;i <= n;i++)vis[i] = 0;
//    for(ll i = 2;i <= n;i++){
//        if(!vis[i]){
//            prime[++cnt] = i;
//            smallP[i] = i;
//        }
//        for(int j = 1;j <= cnt && i*prime[j] <= n;j++){
//            vis[prime[j]*i] = 1;
//            smallP[prime[j]*i] = prime[j];
//            if((i % prime[j]) == 0)break;
//        }
//    }
//}
//ll cnm[maxn][maxn];
//void getCnm(){
//    cnm[0][0] = 1;
//    for(int i = 1;i < maxn;i++){
//        for(int j = 0;j <= i;j++){
//            cnm[i][j] = cnm[i-1][j];
//            if(j)cnm[i][j] += cnm[i-1][j-1];
//            cnm[i][j] %= (modn-1);
//        }
//    }
//}
//ll f[maxn],invF[maxn];
//void getF(){
//    f[0] = invF[0] = 1;
//    for(int i = 1;i < maxn;i++)f[i] = f[i-1]*i % modn;
//    invF[maxn-1] = qpow(f[maxn-1],modn-2);
//    for(int i = maxn-2;i >= 1;i--)invF[i] = invF[i+1]*(i+1) % modn;
//}
int main(){
    int n,i;
    scanf("%d%d",&n,&i);
    printf("%d\n",n+1-i);
}


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

using namespace std;

int main() {
	bool dp[10001] = {};
	dp[0] = true;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int s;
		cin >> s;
		for (int t = 10000-s; t >= 0; t--) {
			dp[t + s] |= dp[t];
		}
	}
	int ans=0;
	for (int t = 10000; t >= 0; t--) {
		if (dp[t] && (t % 10)) {
			ans = t; break;
		}
	}
	cout << ans << endl;
	return 0;
}

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

int w, h;
int c[50][50];

void dfs(int x, int y) {
  c[x][y] = 0;
  for (int dx = -1; dx <= 1; dx++) {
    for (int dy = -1; dy <= 1; dy++) {
      int nx = x + dx, ny = y + dy;
      if (0 <= nx && nx < h && 0 <= ny && ny < w && c[nx][ny] == 1)
        dfs(nx, ny);
    }
  }
  return;
}

int main() {
  while (true) {
    cin >> w >> h;
    if (w == 0 && h == 0) break;
    for (int i = 0; i < h; i++)
      for (int j = 0; j < w; j++)
        cin >> c[i][j];
    int islands = 0;
    for (int i = 0; i < h; i++) {
      for (int j = 0; j < w; j++) {
        if (c[i][j] == 1) {
          islands++;
          dfs(i, j);
        }
      }
    }
    cout << islands << endl;
  }
  return 0;
}


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

int n;
string s;
int32_t main() {
    int ans = 0;
    cin >> n >> s;
    for(int i = 0; i < s.length()-1; ++i) {
        if (s[i] != s[i+1]) ++ans;
    }
    cout << ans+1;
}

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

//read_kaisetsu
int main() {
    int n,k;cin>>n>>k;
    ll x[n],y[n],x1[n],y1[n];
    rep(i,n){
        cin>>x[i]>>y[i];
        x1[i]=x[i];
        y1[i]=y[i];
    }
    sort(x1,x1+n);
    sort(y1,y1+n);
    ll ans = (x1[n-1]-x1[0])*(y1[n-1]-y1[0]);
    rep(i,n)rep(j,n)rep(l,i)rep(m,j){
        int cc=0;
        ll x_s = min(x[i],x[l]);
        ll x_l = max(x[i],x[l]);
        ll y_s = min(y[j],y[m]);
        ll y_l = max(y[j],y[m]);
        rep(t,n)if(x[t]>=x_s && x[t]<=x_l && y[t]>=y_s && y[t]<=y_l)++cc;
        
        if(cc>=k)ans = min(ans, (x_l - x_s)*(y_l - y_s));
    }
    cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
using ll=long long;
#define int ll
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define SZ(x) ((int)x.size())
#define fi first
#define se second
const int INF = 1e15;
using namespace std;

template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;

using pi=pair<int,int>;
using vi=vc<int>;

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

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

    int N; cin >> N;
    vc<pair<int,pi>> v;
    rep(i,N){
        int a,b,c; cin >> a >> b >> c;
        v.eb(c,pi(a,b));
    }
    sort(all(v));
    reverse(all(v));
    int mh=0;
    int ansx,ansy;
    rep(i,101){
        rep(j,101){
            int H=0;
            bool can=true;
            rep(k,N){
                int a=v[k].se.fi,b=v[k].se.se,h=v[k].fi;
                if(!k){
                    H=h+abs(a-i)+abs(b-j);
                } else {
                    if(max(H-abs(a-i)-abs(b-j),0ll)!=h) {
                        can=false;
                        break;
                    }
                }
            }
            if(can){
                if(chmax(mh,H)){
                    ansx=i,ansy=j;
                }
            }
        }
    }
    cout << ansx << " " << ansy << " " << mh << endl;
}

Measured memory_bytes: 256
import sys
from collections import defaultdict, deque, Counter
import math

# import copy
from bisect import bisect_left, bisect_right
# import heapq

# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

def solve():
    n,m,k = getList()
    anums = getList()
    bnums = getList()
    arui = []
    tmp = 0
    for num in anums:
        tmp += num
        arui.append(tmp)
    brui = []
    tmp = 0
    for num in bnums:
        tmp += num
        brui.append(tmp)
    ans = 0
    for i, ar in enumerate(arui):
        if ar <= k:
            nokori = k - ar
            byom = bisect_right(brui, nokori)
            tans = byom + i + 1
            if tans > ans:
                ans = tans

    tans = bisect_right(brui, k)
    if tans > ans:
        ans = tans
    print(ans)
def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    # main()
    solve()

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

int main()
{
	double a,b,h,m;
	cin >> a >> b >> h >> m;
	double angle1 = M_PI / 6.0 * h + M_PI / 360.0 * m, angle2 = M_PI / 30 * m;
	double angle = abs(angle1-angle2);
	angle = min(angle, 2.0 * M_PI - angle);
	double ans = sqrt(a*a + b*b - 2.0 * a * b * cos(angle));
	cout << setprecision(10) << ans << endl;
	return 0;
}

Measured memory_bytes: 4196
N = int(input())
csf = [tuple(map(int,input().split())) for i in range(N-1)]

for i in range(N-1):
    t = 0
    for c,s,f in csf[i:]:
        t = max(t, s)
        if t%f:
            t += -t%f
        t += c
    print(t)

print(0)

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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 (a>b) { a=b; return 1; } return 0; }

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin>>s;
    int n = s.size();
    if (n==2 && s[0]==s[1]){
        cout<<"1 2\n";
        return 0;
    }
    rep(i,n-2){
        if (s[i]==s[i+1] || s[i+1]==s[i+2] || s[i]==s[i+2]){
            cout<<i+1<<" "<<i+3<<"\n";
            return 0;
        }
    }
    cout<<"-1 -1\n";
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 10000000000000009
//#define INF 9223372036854775807
typedef long long ll;
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define ORREP(i,n) for(int i=(n);i>=1;--i)
#define ZREP(i,n) for(int i=1;i<(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define rollcall cout<<"I'm Sucu."<<endl;
#define YES(s) s?cout << "YES" << endl:cout << "NO" << endl
#define Yes(s) s?cout << "Yes" << endl:cout << "No" << endl
#define Taka(s) s?cout << "Takahashi" << endl:cout << "Aoki" << endl
#define out(s,t,u) s?cout << t << endl:cout << u << endl
#define int ll
#define Endl endl

signed main(){
    int a,b;
    cin >> a >> b;
    cout << (a+b)/2 << endl;
    return 0;
}   


Measured memory_bytes: 3132
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <unordered_map> 
#include <map> 
#include <numeric>
#include <limits>
#include <utility>
#include <queue>
using namespace std;
typedef long long LL;

int main(void) {
	char c;
	cin >> c;
	if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') {
		cout << "vowel" << endl;
	}
	else {
		cout << "consonant" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
int main()
{
  int a,b,c,s;
  scanf("%d%d%d",&a,&b,&c);
    s=a*100+b*10+c;
    if(s%4==0)
        printf("YES");
    else
        printf("NO");
    return 0;
}

Measured memory_bytes: 256
using System;
class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());

		if (N == 1)
		{
			Console.WriteLine("Hello World");
		} else
		{
			int A = int.Parse(Console.ReadLine());
			int B = int.Parse(Console.ReadLine());
			Console.WriteLine(A+B);
		}
	}
}

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using vec_b = vector<bool>;
using vec_str = vector<string>;
using graph = mat;
using edge = pair<ll,ll>;
using wgraph = vector<vector<edge>>;

#define INF (1LL << 60)
#define MOD 1000000007

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back


void bfs(wgraph G, ll r, vec_b& f, vec& ans)
{
    queue<edge> Q;
    Q.push(make_pair(r,0));
    f[r] = true;
    ll cnt;
    while(!Q.empty()) {
        edge e = Q.front(); Q.pop();
        cnt = 1;
        FORR(ne,G[e.first]) {
            ll nv = ne.first;
            ll k = ne.second;
            if(!f[nv]) {
                if(cnt == e.second) ++cnt;
                ans[k] = cnt;
                Q.push(make_pair(nv,cnt));
                ++cnt;
                f[nv] = true;
            }
        }
    }
}


int main()
{
    ll N;
    cin >> N;
    wgraph G(N);
    ll a, b;
    REP(i,0,N-1) {
        cin >> a >> b;
        --a; --b;
        G[a].pb(make_pair(b,i));
        G[b].pb(make_pair(a,i));
    }

    vec ans(N-1);
    vec_b F(N, false);
    bfs(G, 0, F, ans);
    
    ll K = 0;
    REP(i,0,N-1) K = MAX(K,ans[i]);
    _PR(K);
    REP(i,0,N-1) _PR(ans[i]); 

    return 0;
}

/*



*/

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

namespace ConsoleApp15
{
    class Class345
    {
        static void Main()
        {
            var r = Console.ReadLine().Split().Select(int.Parse).ToArray();
            double A = r[0], B = r[1], H = r[2], M = r[3];
            var a = new double[2] { A * Math.Sin((M / 720 + H / 12)*2* Math.PI), A * Math.Cos((M / 720 + H / 12)*2* Math.PI) };
            var b = new double[2] { B*Math.Sin( M/ 60 * 2 * Math.PI), B * Math.Cos(M / 60 * 2 * Math.PI) };
            Console.WriteLine(Math.Sqrt((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])));
        }
    }
}


Measured memory_bytes: 28700
//111
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<algorithm>
#include<deque>
#include<queue>
#include<set>
#include<map>
#include<functional>

using namespace std;
#define LL long long
#define ALF "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define LLBIG 1999999999999999999LL
#define INTBIG 1111111111
#define MOD 1000000007
#define PI pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>

int H, W, h, w, A, B, C;
string s;

int main() {
	cin >> s;
	for (int i = 0; i < 3; i++)s[i] = (s[i] == '1' ? '9' : '1');
	cout << s << endl;

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>

int main() {
  int N, T; scanf("%d %d\n", &N, &T);
  int t[N];

  for (int i = 0; i < N; i++)
    scanf("%d", &t[i]);

  long ans = 0;
  for (int i = 1; i < N; i++) {
    if (t[i] - t[i-1] >= T)
      ans += T;
    else
      ans += t[i] - t[i-1];
  }
  ans += T;

  printf("%ld\n", ans);
}


Measured memory_bytes: 896
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn = 20;
const int maxm = (1<<18)+10;
const int INF = 1e9+8;
int n;
int a[maxn],b[maxn],dp[2][maxm][52];
vector <int> vec[maxn];
void init()
{
	for(int i=0;i<maxm;i++)
       for(int j=0;j<52;j++)
          dp[0][i][j]=dp[1][i][j]=INF;
}
int vis[maxn];
int sum[maxn];
int main()
{
	scanf("%d",&n);
	init();
	for(int i=0;i<n;i++) scanf("%d",&a[i]);
	for(int i=0;i<n;i++) scanf("%d",&b[i]);
	int len=1<<n;
	int tmp;
	for(int i=0;i<len;i++)
	{
		tmp=0;
		for(int j=0;j<n;j++)
		if(i&(1<<j)) tmp++;
		vec[tmp].push_back(i);
	} 
	int sta,cur;
	dp[0][0][0]=0;
	for(int i=1;i<=n;i++)
	{
	    cur=i&1;
	    //cout<<i<<endl;
	    for(int j=0;j<vec[i-1].size();j++)
	    {
	  	    sta=vec[i-1][j];
	  	    for(int k=0;k<n;k++)
	  	    if(sta&(1<<k)) vis[k]=1;
	  	    else vis[k]=0;
	  	    sum[0]=vis[0];
	  	    for(int i=1;i<n;i++) sum[i]=sum[i-1]+vis[i];
	  	    for(int Max=0;Max<=50;Max++)
	  	    {
	  	  	    if(dp[cur^1][sta][Max]==INF) continue;
	  	  	    for(int k=0;k<n;k++)
	  	  	    {
	  	  	 	    if(vis[k]) continue;
	  	  	 	    tmp=0;
	  	  	 	    if(k) tmp+=k-sum[k-1];
	  	  	 	    tmp+=sum[n-1]-sum[k];
	  	  	 	    //cout<<sta<<" "<<Max<<" "<<k<<" "<<tmp<<" "<<dp[cur^1][sta][Max]<<" "<<a[]<<endl;
	  	  	 	    if(tmp%2==0&&a[k]<Max) continue;
	  	  	 	    else if(tmp%2==0)
	  	  	 	    dp[cur][sta+(1<<k)][a[k]]=min(dp[cur][sta+(1<<k)][a[k]],dp[cur^1][sta][Max]+tmp);
	  	  	 	    if(tmp%2==1&&b[k]<Max) continue;
	  	  	 	    else if(tmp%2==1)
	  	  	 	    dp[cur][sta+(1<<k)][b[k]]=min(dp[cur][sta+(1<<k)][b[k]],dp[cur^1][sta][Max]+tmp);
			    }
		    }
	    }
    } 
    int ans=INF;
    cur=n&1;
    for(int i=0;i<=50;i++)
    ans=min(ans,dp[cur][len-1][i]);
    if(ans==INF) printf("-1");
    else printf("%d",ans/2);
    return 0;
}

Measured memory_bytes: 108148
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import re
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  S=pin()[:-1]
  if re.fullmatch(r"YAKI[A-Z]*",S)==None:
    print("No")
    return 
  print("Yes")
  return 

main()

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

long long fib[100001]={0};

long long test(int n){	// フィボナッチ数列をメモする関数
	fib[0]=1;
	fib[1]=1;

	if(fib[n])return fib[n];
	else{
		fib[n]=test(n-1)+test(n-2);
		fib[n]%=1000000007;
		return fib[n];
	}
}



int main(){
	long long int now=0,step=1,ans=1;
	int x;
	x=1000000007;
	long long a;
	for(int i=0;i<100001;i++)a=test(i);


	int n,m;	cin>>n>>m;
	if(m==0)cout<<fib[n]<<endl;
	else{
		int broken[m];
		for(int i=0;i<m;i++)cin>>broken[i];


		int j=0;
		while(now<n){
			if(now+1!=broken[min(j,m-1)]){
				now++;
				++step;
			}else{
				if(now+2==broken[min(j+1,m-1)]){
					ans=0;
					break;
				}else{
					ans *= fib[step-1];
					ans%=x;
					//				cout<<"NOW: "<<now<<endl;
					//				cout<<"STEP: "<<step<<endl;
					//				cout<<"FIB["<<step<<"]= "<<fib[step]<<endl;
					//				cout<<endl;

					j++;

					now+=2;
					step=1;
				}
			}

		}
	}

	ans *= fib[step-1];
	ans%=x;

	if(m)cout<<ans<<endl;

	return 0;
}


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

        using namespace std;

        #define pb push_back
        #define mp make_pair
        #define fr first
        #define sc second

        typedef long long int lli;

        lli n, k, h[200001], sum = 0;

        int main(){
            cin>>n>>k;
            for(int i = 0;i<n;i++){
                cin>>h[i];
            }
            sort(h,h+n);
            for(int i = 0;i<n-k;i++){
                sum += h[i];
            }
            cout<<sum<<endl;
            return 0;
        }


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long
using namespace std;
typedef pair<ll,ll> pi;

int main(){
    double n;
    cin >> n;
    double ans = (n*n*n)/(3.0*3.0*3.0);
    printf("%.6f\n",ans);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define is(a, b) a == b
#define len(v) ll(v.size())

const ll mod=1e9+7;

//vector書き出し
template <class T>
void cout_vec(const vector<T> &vec1){
  rep(i,len(vec1)){
    cout<<vec1[i]<<' ';
  }
  cout<<'\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    cin>>n>>k;
    int inf=3*1e6;
    vector<int> a(200010,0);
    rep(i,n){
      int x;
      cin>>x;
      a[x]++;
    }
    int l=0;
    rep(i,200010){
      if(a[i]!=0){
        l++;
      }else{
        a[i]=inf;
      }
    }
    //cout<<l<<'\n';
    int ans=0;
    sort(begin(a),end(a));
    //cout<<a[0]<<'\n';
    int cnt=0;
    while(l>k){
      l--;
      ans+=a[cnt];
      cnt++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
N,M = map(int,input().split())
a = [int(input()) for i in range(M)] 
t = d = [0]*(N+1)

for i in range(M):
  d[a[i]] = 1

t[0]=t[1]=1
if M>0:
  t[1] = 0 if (a[0]==1) else 1

for i in range(2,N+1):
  t[i] = 0 if d[i] else t[i-1]+t[i-2]
print (t[N] % 1000000007)


Measured memory_bytes: 460020
#include <bits/stdc++.h>
#define pi acos(-1)
#define ll long long
#define ull unsigned long long
#define db double
#define ull unsigned long long
#define MIN INT_MIN
#define MAX INT_MAX
#define Sort(x) sort((x).begin(), (x).end())
#define pb push_back
#define ii pair <int,int>
#define iii pair <int,ii>
#define pll pair <ll,ll>
#define plll pair <ll,pll>
#define ff first
#define ss second
#define minQueue priority_queue <int,vector<int>,greater<int> >
#define maxQueue priority_queue<int,vector<int>,less<int> >
#define pb push_back
#define max3(a,b,c) max(a, max(b,c))
#define min3(a,b,c) min(a, min(b,c))
#define GCD(x,y) __gcd((x), (y))
#define LCM(x,y) ((x / GCD((x), (y))) * y)
#define loop(a,n) for(int i=a; i<n; i++)
#define mem(x,y) memset((x), (y), sizeof (x));
#define Case int T; scanf("%d", &T); for(int cas = 1; cas <= T; ++cas)
#define pf printf
#define sf scanf
#define pr1(x) cout << x << endl
#define pr2(x,y) cout << x << ' ' << y << endl
#define powerOfTwo(x) (x && !(x & (x - 1)))
#define Iterator(type) type <int> :: iterator
#define mapIterator map <int,int> :: iterator //it->ff it->ss
#define FI freopen ("input.txt", "r", stdin)
#define FO freopen ("output.txt", "w", stdout)
#define Ziru 0
using namespace std;
/*int intConvert(string s){
    int n;
    stringstream geek(s);
    geek >> n;
    return n;
}*/

/*string strConvert(int n){
    string s;
    stringstream ss;
    ss << n;
    s=ss.str();
    return s;
}*/

///***********BigMod************************************************************************************
//int StringMod(string num, int a){
//    int res = 0;
//    for (int i = 0; i < num.length(); i++)
//         res = (res*10 + (int)num[i] - '0') %a;
//    return res;
//}

//int BigMod(ll b,ll p, ll m){
//   if(p==0)return 1;
//   else if(p%2==1){
//        int part1=b%m;
//        int part2=BigMod(b,p-1,m);
//        return (part1*part2)%m;
//
//   }
//   else if(p%2==0){
//        int half=BigMod(b,p/2,m);
//        return (half*half)%m;
//   }
//}
///BigMod (89, 14 ,2589)==1849
///StringMod(1956410986640441413344189841, 2589)==1849;


///_________________factorial___________________________________________________________________________

//int multiply(int x, int res[], int res_size);
//
//void factorial(int n){
//    int res[500];
//    res[0] = 1;
//    int res_size = 1;
//    for (int x=2; x<=n; x++)
//        res_size = multiply(x, res, res_size);
//    cout << "Factorial of given number is \n";
//    for (int i=res_size-1; i>=0; i--)
//        cout << res[i];
//}
//int multiply(int x, int res[], int res_size){
//    int carry = 0;
//    for (int i=0; i<res_size; i++){
//        int prod = res[i] * x + carry;
//        res[i] = prod % 10;
//        carry  = prod/10;
//    }
//    while (carry){
//        res[res_size] = carry%10;
//        carry = carry/10;
//        res_size++;
//    }
//    return res_size;
//}


int main(){
    int n,m;
    cin>>n>>m;
    cout<<__gcd(n,m)<<endl;
	return Ziru;
}




Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, k; cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    int ans = 0;
    for (int i = 0; i < k; ++i) ans += a[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3612
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.io.*;
import java.util.*;

public class Main
{
    void run() {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();

        String[] cells = new String[H];

        for (int h = 0; h < H; ++h)
        {
            cells[h] = sc.next();
        }

        for (int h = 0; h < H; ++h)
        {
            for (int w = 0; w < W; ++w)
            {
                if (cells[h].charAt(w) == '#') {
                    System.out.printf("#");
                }
                else {
                    int[] dh = new int[]{0, 1, -1};
                    int[] dw = new int[]{0, 1, -1};
                    int cnt = 0;
                    for (int i = 0; i < 3; ++i) {
                        for (int j = 0; j < 3; ++j) {
                            int h2 = h + dh[i];
                            int w2 = w + dw[j];
                            if ((i != 0 || j != 0)
                                && 0 <= h2 && h2 < H
                                && 0 <= w2 && w2 < W
                                && cells[h2].charAt(w2) == '#') {
                                ++cnt;
                            }
                        }
                    }
                    System.out.printf("%d", cnt);
                }
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


Measured memory_bytes: 25460
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int JOIlevel(const string &s){
  int J=0,O=0,I=0;
  int res = 0;
  char prec = -1;

  for(int i = 0; i < (int)s.length(); ++i){
    if( s[i] == 'J' && (prec == 'J' || prec == -1 ) ){
      ++J;
      O = 0;
      I = 0;
      prec = s[i];
    }else if( s[i] == 'O' && (prec == 'J' || prec == 'O' ) ){
      ++O;
      prec = s[i];
      I = 0;
      if( O > J ){
        O = 0;
        J = 0;
        prec = -1;
      }
    }else if( s[i] == 'I' && (prec == 'O' || prec == 'I' ) ){
      ++I;
      prec = s[i];
      if( I >= O ){
        res = max(res,min(J,min(O,I)));
      }
    }else{
      J = O = I = 0;
      prec = -1;
      if( s[i] == 'J' ){
        ++J;
        prec = s[i];
      }

    }
    
  }
  return res;
}
int main()
{
  string s;
  while(
        cin >> s){
    cout << JOIlevel(s) << endl;
  }
  return 0;
}

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

const long long MOD = 1e9 + 7;
const int HW_MAX = 1000;
long long dp[HW_MAX + 1][HW_MAX + 1];

int main() {
  int H, W; cin >> H >> W;
  dp[0][0] = 1;
  for(int h = 0; h < H; h++){
    for(int w = 0; w < W; w++){
      char a; cin >> a;
      if (a == '#') {dp[h][w] = 0; continue;}
      
      if(h - 1 >= 0) dp[h][w] += dp[h - 1][w];
      if(w - 1 >= 0) dp[h][w] += dp[h][w - 1];
      dp[h][w] %= MOD;
    }
  }
  
  cout << dp[H-1][W-1] << endl;
}

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

int main () {
  char c;
  int ans = 0;
  rep(i,3) {
    cin >> c;
    if(c == '1') ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream> pre processor directive
#include <string>
#include <iomanip>
#include <cctype>
using namespace std;
int main()
{
    string S;
    cin>>S;
    string Arr[6]={"MON","TUE","WED","THU","FRI","SAT"};
    if (S=="SUN") cout<<7<<endl;
    int counter=0;
    for (int i=0;i<6;i++){
        if (S==Arr[i]){
            for (int j=i+1;j<7;j++){
                counter++;
            }
         cout<<counter<<endl;
         break;
        }
    }
}


Measured memory_bytes: 256
import math


def C(k, n, mod):
    return math.factorial(n) // math.factorial(n - k) // math.factorial(k) % mod


n, k = map(int, input().split())
mod = int(1e9) + 7
s = 0
for i in range(1, k + 1):
    if n + 1 - k - i >= 0:
        print((C(i - 1, k - 1, mod) * C(i, n - k + 1, mod)) % mod)
    else:
        print(0)


Measured memory_bytes: 66264
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
int main()
{
    int N;
    cin >> N;
    vector<int> idx;
    REP(i,N)idx.pb(i);
    vector<pair<double,double>> pos;
    REP(i,N){
        double x,y;
        cin >> x >> y;
        pos.pb({x,y});
    }
    double dis=0.0;
    int cnt=0;
    do{
        REP(i,idx.size()-1){
            int id = idx[i];
            int idn = idx[i+1];
            dis += sqrt(pow((pos[id].first-pos[idn].first),2) + pow((pos[id].second-pos[idn].second),2));
        }
        cnt++;
    }while(next_permutation(idx.begin(),idx.end()));
    cout << fixed << setprecision(10) << (dis/cnt) << endl;
}

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

struct Node{
  int key;
  struct Node *parent;
  struct Node *left;
  struct Node *right;
};

#define NIL NULL
typedef struct Node* NodePointer;
NodePointer root;

void inOrder(NodePointer);
void preOrder(NodePointer);
void print(void);
void insert(int);
NodePointer makeNode(int);
int find(int);

int main(){
  int Q,i,x;
  char order[7];
  scanf("%d",&Q);
  for(i = 0 ; i < Q ; i++){
    scanf("%s",order);
    if(order[0] == 'i'){
      scanf("%d",&x);
      insert(x);
    }else if(order[0] == 'f'){
      scanf("%d",&x);
      puts(find(x) ? "yes" : "no");
    }else{
      print();
    }
  }
  return 0;
}

void inOrder(NodePointer x){
  if(x == NIL){ return; }
  inOrder(x->left);
  printf(" %d",x->key);
  inOrder(x->right);
}

void preOrder(NodePointer x){
  if(x == NIL){ return; }
  printf(" %d",x->key);
  preOrder(x->left);
  preOrder(x->right);
}

void print(){
  inOrder(root); printf("\n");
  preOrder(root); printf("\n");
}

void insert(int key){
  NodePointer x = root,y = NIL;
  NodePointer z = makeNode(key);
  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }else{
      x = x->right;
    }
  }
  z->parent = y;
  if(y == NIL){
    root = z;
  }else if(z->key < y->key){
    y->left = z;
  }else{
    y->right = z;
  }
}

NodePointer makeNode(int key){
  NodePointer newNode = malloc(sizeof(struct Node));
  newNode->key = key;
  newNode->left = newNode->right = NIL;
  return newNode;
}

int find(int key){
  NodePointer x = root;
  while(x != NIL){
    if(key < x->key){
      x = x->left;
    }else if(key > x->key){
      x = x->right;
    }else{
      return 1;
    }
  }
  return 0;
}

Measured memory_bytes: 19364
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
typedef long long ll;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

int main(){
    int n;
    string s;cin >> n >> s;
    int bnum=0,wnum=0,b=0;
    vector<int> bsum(n+1,0);
    vector<int> wsum(n+1,0);
    
    
    rep(i,n){
        if(s[i]=='#')bsum[i]++;
        else wsum[i]++;
    }

    rep(i,n){
        bsum[i+1]+=bsum[i];
        wsum[i+1]+=wsum[i];
    }
    int res=1e9;
    for(int i=1;i<=n;i++){
        res = min(res,bsum[i]+(wsum[n]-wsum[min(i+1,n)]));
    }
    rep(i,n){
        if(s[i]=='.')wnum++;
        else bnum++;
    }
    if(s[0]=='.'&&bsum[n]==n-1)cout << 0 << endl;
    else cout << min(bnum,min(res,wnum)) << endl;
    return 0;
}

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a, b) accumulate(all(a), b)
#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, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
typedef unsigned long long ull;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
ll const INF = 1e18;

template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int n, m;
    cin >> n >> m;
    vector<bool> v(n+1, false);
    REP(i, m){
        int a;
        cin >> a;
        v[a] = true;
    }

    vector<ll> dp(n+1);
    dp[0] = 1, dp[1] = (v[1] ? 0 : 1);
    FOR(i, 2, n+1){
        if(v[i]) dp[i] = 0;
        else{
            dp[i] = dp[i-1] + dp[i-2];
            dp[i] %= MOD;
        }
    }

    cout << dp.back() << endl;

    return 0;
}


Measured memory_bytes: 1024
package main

import (
	"bufio"
	"fmt"
	"os"
	"reflect"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
var bufferSize = 1024 * 1024

type t struct {
	t int64
	f int64
	c byte
}

func solve(s []byte, q int64, qs []t) []byte {
	edges := make([][]byte, 2)
	edges[0] = make([]byte, 0, q)
	edges[1] = make([]byte, 0, q)
	frontIdx := 0

	reversed := false
	for _, tt := range qs {
		if tt.t == 1 {
			reversed = !reversed
			frontIdx = 1 - frontIdx
			continue
		}
		if tt.f == 1 {
			edges[frontIdx] = append(edges[frontIdx], tt.c)
		} else {
			edges[1 - frontIdx] = append(edges[1 - frontIdx], tt.c)
		}
	}

	ret := make([]byte, 0, len(s) + len(edges[0]) + len(edges[1]))
	for i := len(edges[frontIdx]) - 1; i >= 0; i-- {
		ret = append(ret, edges[frontIdx][i])
	}
	if reversed {
		for i := len(s) - 1; i >= 0; i-- {
			ret = append(ret, s[i])
		}
	} else {
		for _, b := range s  {
			ret = append(ret, b)
		}
	}
	for _, b := range edges[1 - frontIdx] {
		ret = append(ret, b)
	}
	return ret
}

func main() {
	scanBuffer := make([]byte, 1024)
	sc.Buffer(scanBuffer, bufferSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush()

	s := nextStringAsBytes()
	q := nextInt()

	qs := make([]t, q)
	for i := int64(0); i < q; i++ {
		qs[i].t = nextInt()
		if qs[i].t == 2 {
			qs[i].f  = nextInt()
			qs[i].c  = nextStringAsBytes()[0]
		}
	}

	bytes := solve(s, q, qs)
	fmt.Fprintln(out, string(bytes))
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextStringAsBytes() []byte {
	sc.Scan()
	return []byte(sc.Text())
}

func nextInt() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int64) []int64 {
	ret := make([]int64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextFloats(n int64) []float64 {
	ret := make([]float64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextFloat()
	}
	return ret
}
func nextStrings(n int64) []string {
	ret := make([]string, n)
	for i := int64(0); i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func containStr(arr []string, target string) bool {
	for _, v := range arr {
		if v == target {
			return true
		}
	}
	return false
}

func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "orz")
	}
}

// mapからkeysとvaluesを返す
func splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {
	switch reflect.TypeOf(m).Kind() {
	case reflect.Map:
		s := reflect.ValueOf(m)
		for _, v := range s.MapKeys() {
			keys = append(keys, v)
			values = append(values, s.MapIndex(v))
		}
	default:
		fmt.Fprintln(out, "orz")
	}
	return
}


Measured memory_bytes: 10368
n = int(input())
a = [int(input()) for _ in range(n)]

asort = sorted(a)

import bisect
for i in range(n):
    if bisect.bisect_left(asort,a[i]) < n-1:
        print(asort[-1])
    elif bisect.bisect_left(asort,a[i]) == n-1:
        print(asort[-2])

Measured memory_bytes: 19012
#include <bits/stdc++.h>
#include <string>
#include <cmath>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<ll> vll;
 
#define all(v) v.begin(),v.end()
#define test() int t;cin>>t;while(t--) 
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ff first
#define ss second
#define pb push_back
const int mod = 998244353;
const ll INF = -(ll)1e10;

int main()
{
    int n;
    cin>>n;
    int ans = 0;
    for(int i = 1; i<=n-1; i++)
    {
        ans+=(n/i);
        if(n%i==0)ans--;
    }
    cout<<ans<<endl;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> f(N+1,0);
  for(int i=1; i<100; i++){
    for(int j=1; j<100; j++){
      for(int k=1; k<100; k++){
        int p = i*i + j*j + k*k + i*j + i*k + j*k;
        if(p <= N) f[p]++;
      }
    }
  }
  for(int i=1; i<=N; i++){
    cout << f[i] << endl;
  }
  return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
const int N=100005;
int n,a[N];
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++)scanf("%d",&a[i]);
	int flag=0,ans=1;
	for (int i=2;i<=n;i++){
		if (a[i]<a[i-1])flag|=1;
		if (a[i]>a[i-1])flag|=2;
		if (flag==3)ans++,flag=0;
	}
	printf("%d",ans);
}

Measured memory_bytes: 640
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        nm: [usize; 2],
        xs: [i32; nm[1]]
    }
    println!("{}", solve(nm[0], nm[1], xs));
}

fn solve(n: usize, m: usize, xs: Vec<i32>) -> i32 {
    if n >= m {
        return 0;
    }
    let mut xs = xs;
    xs.sort();
    let mut x_gaps: Vec<i32> = Vec::new();
    for i in 1..m {
        x_gaps.push(xs[i] - xs[i-1]);
    }
    x_gaps.sort();
    x_gaps.reverse();
    let mut answer = xs.last().unwrap() - xs.first().unwrap();
    for i in 0..n-1 {
        answer -= x_gaps[i];
    }
    answer
}

#[test]
fn solve_test() {
    assert_eq!(solve(2,5,vec![10,12,1,2,14]), 5);
    assert_eq!(solve(3,7,vec![-10,-3,0,9,-100,2,17]), 19);
    assert_eq!(solve(100,1,vec![-100000]), 0);
}


Measured memory_bytes: 6396
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ for(auto it : P) { s << "<" << it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ for(auto it : P) { s << "<" << it.first << "->" << it.second << "> "; } return s << endl; }



int main() {
    int K, A, B;
    cin >> K >> A >> B;
    bool res = false;
    for (int i = A; i <= B; ++i) {
        if (i % K == 0) res = true;
    }
    if (res) cout << "OK" << endl;
    else cout << "NG" << endl;
}

















Measured memory_bytes: 3624
N = int(input())
A = [int(i) for i in input().split()]

dp = [[0 for j in range(N+1)] for i in range(N+1)]

for l in range(1, N+1):
    for i in range(N+1-l):
        j = i+l

        if (N-l) % 2 == 0:
            dp[i][j] = max(dp[i+1][j]+A[i], dp[i][j-1]+A[j-1])
        else:
            dp[i][j] = min(dp[i+1][j]-A[i], dp[i][j-1]-A[j-1])

# print(dp)
print(dp[0][N])


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

using namespace std;

int main(){
        long long N;
        long long A,B,maxA=-1,minB=0;
        cin >> N;
        for(int i=0;i<N;i++){
                cin >> A >> B;
                if(A>maxA){
                        maxA=A;
                        minB=B;
                }
        }
        cout << maxA+minB << endl;

        return 0;
}

Measured memory_bytes: 256