akhauriyash/Code-Regression huggingface dataset:
#ifndef LOCAL
#pragma GCC optimize("O2")
#endif
#include <iostream>
#include <vector>
using namespace std;

int main(){
   int N; cin >> N;
   vector<int> H(N);

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

    int point_before, point_after;
    point_before=0;
    point_after=0;
   for(int i=0; i<N-1; i++){
       //point_before=1;
       //for(int j=i; j<N; j++){
           //if (H[j] >= H[j+1]){
               //point_before++;
           //}
           //else{
               //break;
           //}
       //}

        if(H[i] >= H[i+1]){
            point_before++;
            point_after = max(point_after, point_before);
        } 
        else{
            point_after = max(point_after, point_before);
            point_before = 0;
        }

 //      point_after = max(point_after, point_before);
   }

    cout << point_after  << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define endl '\n'
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define pi acos(-1)
#define line cout<<"----------------------------"<<endl
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
const ll  mx=3000009;
ll facto[mx];
void pre()
{
    facto[0]=1;
    for(ll  i=1;i<mx;i++) facto[i]=(facto[i-1]*i)%mod;
}
ll bigmod(ll a, ll b,ll m)
{
    ll ans=1; a%=m;
    while(b)
    {
        if(b&1) ans=(ans*a)%m;
        b>>=1;
        a=(a*a)%m;
    }
    return ans;
}
int  main()
{
    pre();
    ll  r1,c1,r2,c2;
    cin>>r1>>c1>>r2>>c2;
    ll  ans=0;
    for(ll  i=c1;i<=c2;i++)
    {
        ans+=(facto[r2+i+1]*bigmod(facto[i+1],mod-2,mod))%mod*bigmod(facto[r2],mod-2,mod)%mod;
        ans-=(facto[r1+i]*bigmod(facto[i+1],mod-2,mod))%mod*bigmod(facto[r1-1],mod-2,mod)%mod;
        ans=(ans+mod)%mod;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 23680
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rrep(i, a, b) for(int i = b - 1; i >= a; i--)
#define ALL(a) a.begin(), a.end()
#define pii pair<int,int>
#pragma GCC optimize("Ofast")
#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)
#define pb push_back
#define mp make_pair
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
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; };
inline void IN(void){return;}
template <typename First, typename... Rest> void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
inline void OUT(void){cout << "\n";return;}
template <typename First, typename... Rest> void OUT(First first, Rest... rest){cout << first << " ";OUT(rest...);return;}
const double EPS = 1e-9;
const int mod = 1e9 + 7;
const int INF = 1e9;
const long long LLINF = 1e18;
long long lcm(ll a, ll b){return a * b / __gcd(a,b);}
struct IoSetup { IoSetup() {
    cin.tie(nullptr);ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
} } iosetup;
template< int mod > struct ModInt {
    int x; ModInt() : x(0) {}
    ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
    ModInt &operator+=(const ModInt &p) {if((x += p.x) >= mod) x -= mod;return *this;}
    ModInt &operator-=(const ModInt &p) {if((x += mod - p.x) >= mod) x -= mod;return *this;}
    ModInt &operator*=(const ModInt &p) {x = (int) (1LL * x * p.x % mod);return *this;}
    ModInt &operator/=(const ModInt &p) {*this *= p.inverse();return *this;}
    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }
    ModInt inverse() const {int a = x, b = mod, u = 1, v = 0, t;
    while(b > 0) { t = a / b; swap(a -= t * b, b); swap(u -= t * v, v); }return ModInt(u);}
    ModInt pow(int64_t n) const {ModInt ret(1), mul(x); while(n > 0) {if(n & 1) ret *= mul;mul *= mul;n >>= 1;}return ret;}
    friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x;}
    friend istream &operator>>(istream &is, ModInt &a) { int64_t t; is >> t; a = ModInt< mod >(t); return (is); }
    static int get_mod() { return mod; }
}; using modint = ModInt< mod >;

int main(){
    iosetup;
    string S; cin >> S;
    int N = S.size();

    if(S[0] == S[N-1]){
        if(N % 2 == 0) cout << "First" << endl;
        else cout << "Second" << endl;
    }else{
        if(N % 2 == 1)cout << "First" << endl;
        else cout << "Second" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <utility>
#include <algorithm>

using namespace std;
typedef long long ll;

int main() {
    int n, wt; // n = No. of items #### wt = Total capacity
    cin >> n >> wt;
    pair<ll, ll> items[n];
    for (int i = 0; i < n; i++) {
        cin >> items[i].first; // Weight
        cin >> items[i].second; // Value
    }

    ll val[n + 1][wt + 1];
    for (int i = 0; i <= n; i++) { // Item number
        for (int w = 0; w <= wt; w++) { // Weight number
            if (i == 0 || w == 0) val[i][w] = 0; // If item number is 0 or weight is 0 then value is also 0.
            else if (items[i - 1].first <= w) {
                ll CurWt = items[i - 1].first;
                ll CurVal = items[i - 1].second;
                val[i][w] = max(val[i - 1][w], val[i - 1][w - CurWt] + CurVal);
            } else val[i][w] = val[i - 1][w];
        }
    }
    cout << val[n][wt];
}

Measured memory_bytes: 79104
# coding: utf-8
N, M = map(int, input().split())
mod = 10 ** 9 + 7
ans = 1
if abs(N - M) > 1:
    print(0)
    exit()

L = sorted([N, M])

a2, a1 = L
if a1 == a2:
    for i in range(a1):
        ans *= (a1 - i)**2
        ans %= mod
        # print("ans", ans)
    print((ans*2) % mod)
else:
    for i in range(a2):
        ans *= a2 - i
        ans %= mod
        ans *= a2 - i
        ans %= mod
        # print("ans", ans)
    ans *= a1
    print(ans % mod)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); 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; }

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//
struct dice{
    int u, d, f, b, l, r;
    void init(int up,int down,int front, int back, int left, int right){
        u = up, d = down, f = front, b = back, l = left, r = right;
    }
    void goup(){    int tmp = u; u = b, b = d, d = f, f = tmp; }
    void godown(){  int tmp = u; u = f, f = d, d = b, b = tmp; }
    void goleft(){  int tmp = u; u = r, r = d, d = l, l = tmp; }
    void goright(){ int tmp = u; u = l, l = d, d = r, r = tmp; }

    void rotateleft() {  int tmp = f; f = r, r = b, b = l, l = tmp; }
    void rotateright() { int tmp = f; f = l, l = b, b = r, r = tmp; }

    void reversefb() { swap(f, b), swap(u, d); }
    void reverselr() { swap(l, r), swap(u, d); }
};

bool check(dice& d1, dice& d2){
    if (d1.u != d2.u) return false;

    bool ret = false;
    rep(i,4){
        if (d1.f == d2.f and d1.b == d2.b and d1.l == d2.l and d1.r == d2.r and d1.d == d2.d) ret = true;
        d1.rotateleft();
    }
    return ret;
}

bool checkall(dice& dic1, dice& dic2){
    bool ret = false;
    ret |= check(dic1, dic2);

    dic1.goleft();
    ret |= check(dic1, dic2);

    dic1.goleft();
    ret |= check(dic1, dic2);

    dic1.goleft();
    ret |= check(dic1, dic2);

    dic1.goup();
    ret |= check(dic1, dic2);

    dic1.reversefb();
    ret |= check(dic1, dic2);

    return ret;
}
int main() {
    init();
    int u, b, r, l, f, d;

    dice dic1, dic2;
    vl d1, d2;
    
    cin >> u >> b >> r >> l >> f >> d;
    d1 = {u, b, r, l, f, d};
    dic1.init(u, d, f, b, l, r);

    cin >> u >> b >> r >> l >> f >> d;
    d2 = {u, b, r, l, f, d};
    dic2.init(u, d, f, b, l, r);

    bool isok = checkall(dic1, dic2);
    cout << (isok ? "Yes" : "No") << endl;
}


Measured memory_bytes: 3236
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
string S;

int main() {
  INCANT;
  cin >> S;
  string ans = S[2]==S[3]&&S[4]==S[5]?"Yes":"No";
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c;
  cin >> a >> b >> c;
  
  int s;
  s = 0;
  if(a > b && a > c){
    s = b * c / 2;
  }
  if(b > a && b > c){
    s = a * c / 2;
  }
  if(c > a && c > b){
    s = a * b / 2;
  }
  cout << s << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef int sign;
typedef long long ll;
#define For(i,a,b) for(register sign i=(sign)(a);i<=(sign)(b);++i)
#define Fordown(i,a,b) for(register sign i=(sign)(a);i>=(sign)(b);--i)
const int N=1e5+5;
template<typename T>bool cmax(T &a,T b){return (a<b)?a=b,1:0;}
template<typename T>bool cmin(T &a,T b){return (a>b)?a=b,1:0;}
template<typename T>T read()
{
	T ans=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)&&ch!='-')ch=getchar();
	if(ch=='-')f=-1,ch=getchar();
	while(isdigit(ch))ans=(ans<<3)+(ans<<1)+(ch-'0'),ch=getchar();
	return ans*f;
}
template<typename T>void write(T x,char y)
{
	if(x==0)
	{
		putchar('0'),putchar(y);
		return;
	}
	if(x<0)
	{
		putchar('-');
		x=-x;
	}
	static char wr[20];
	int top=0;
	for(;x;x/=10)wr[++top]=x%10+'0';
	while(top)putchar(wr[top--]);
	putchar(y);
}
void file()
{
#ifndef ONLINE_JUDGE
	freopen("F.in","r",stdin);
	freopen("F.out","w",stdout);
#endif
}
int n,m,a[N],b[N],A[N];
ll dp[N];
int fa[N];
int find(int x){return x==fa[x]?x:fa[x]=find(fa[x]);}
vector<int>E[N];
#define pb push_back
void input()
{
	n=read<int>(),m=read<int>();
	For(i,1,n)a[i]=read<int>(),b[i]=read<int>();
	int x,y;
	For(i,1,m)
	{
		x=read<int>(),y=read<int>();
		E[x].pb(y),E[y].pb(x);
	}
}
bool cmp(int x,int y)
{
	return  A[x]<A[y];
}
int id[N],vis[N];
ll sum[N];
void work()
{
	For(i,1,n)dp[i]=A[i]=max(a[i]-b[i],0),sum[i]=b[i];
	For(i,1,n)id[i]=fa[i]=i;
	sort(id+1,id+n+1,cmp);
	int u,x,y;
	For(i,1,n)
	{
		u=id[i];
		x=find(u);
		for(int v:E[u])if(vis[v])
		{
			y=find(v);
			if(x==y)continue;
			fa[y]=x,sum[x]+=sum[y];
			cmin(dp[x],max(dp[y],A[x]-sum[y]));
		}
		vis[u]=1;
	}
	write(dp[id[n]]+sum[id[n]],'\n');
}
int main()
{
//	file();
	input();
	work();
	return 0;
}


Measured memory_bytes: 9852
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    S = input()
    if S == 'RRR':
        print(3)
    else:
        if 'RR' in S:
            print(2)
        else:
            if 'R' in S:
                print(1)
            else:
                print(0)

if __name__ == '__main__':
    main()


Measured memory_bytes: 8976
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool is_even_digits(const int x) {
    int temp = x;
    int digits = 1;
    while(true) {
        temp /= 10;
        if(temp == 0) {
            break;
        }
        digits++;
    }
    if(digits % 2 == 0) {
        return true;
    }
    return false;
}

int main(int argc, const char * argv[]) {
    int N = 0;
    cin >> N;

    int odd_count = 0;
    for(int i = 1; i <= N; i++) {
        if(is_even_digits(i)) {
            //cout << i << " is even digits" << endl;
        } else {
            odd_count++;
            //cout << i << " is NOT even digits" << endl;
        }
    }

    cout << odd_count << endl;
    return 0;
}

/**
 cheat sheet

 vector<int> v{ 1, 5, 8, 9, 6, 7, 3, 4, 2, 0 };
 sort(v.begin(), v.end());
 => 0 1 2 3 4 5 6 7 8 9

 vector<int> v{ 1, 5, 8, 9, 6, 7, 3, 4, 2, 0 };
 sort(v.begin(), v.end(), greater<int>());
 => 9 8 7 6 5 4 3 2 1 0

 struct A { int x, y; };
 bool comp(A i1, A i2) { return (i1.y < i2.y); }
 vector<A> v { { 6, 8 }, { 1, 9 }, { 2, 4 }, { 4, 7 } };
 sort(v.begin(), v.end(), comp);
 => [1, 9] [2, 4] [4, 7] [6, 8]

 */


Measured memory_bytes: 256
a,b,c,d,e,f=map(int,input().split())
tres = -1
res = [0,0]
for i in range(31):
    mass = i * 100*b
    if mass > f:
        break
    for j in range(31):
        mass = i * 100*b+100*a*j
        if mass > f:
            break
        if mass == 0:
            continue
        for k in range(101):
            mass = i * 100*b+100*a*j + k*d
            sugar = k*d
            if mass > f:break
            l = min(int((mass - sugar)*e/100 - k*d)//c, (f - mass)//c)
            if l < 0: break
            mass += l * c
            sugar += l*c
            noudo = sugar / mass
            if noudo > tres:
                tres = noudo
                res[0] = mass
                res[1] = sugar
                
print(" ".join(map(str,res)))


Measured memory_bytes: 39536
def draw_rect(H,W):
    n=0
    for i in range(H):
        for j in range(W):
            if n % 2 == 0:
                print("#",end="")
            else:
                print(".",end="")
            n+=1
        if W % 2 == 0:
            #幅が偶数なら切り替えて同じ柄から開始する
            n+=1
        print("")



def read_data():
    ls=[]
    while True:
        s,t=tuple(input().split())
        
        H=int(s)
        W=int(t)
        
        if H==0 and W==0:
            break
        
        ls.append((H,W))
        
    return ls


def draw_all_rect(ls):
    for W,H in ls:
        draw_rect(W,H)
        print("")

ls=read_data()
draw_all_rect(ls)


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

using namespace std;

using ll = long long;
using P = pair<ll,ll>;

#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define rrep(i,x) for(ll i = ((ll)(x) - 1); i >= 0; i--)

#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))

//ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

const ll mod = 1e9 + 7;
const ll IMF = 1LL<<29;
const double PI = 3.14159265358979323846;


// ***************************CODE**********************//


int n,C;
int s[100001];
int t[100001];
int c[100001];
int sum[200001];
int cp[200001];

int main(){
        cin >> n >> C;
        for(int i = 0; i < n; i++){
                cin >> s[i] >> t[i] >> c[i];
        }
        for(int j = 1; j <= C; j++){
                memset(cp,0,sizeof(cp));

                for(int i = 0; i < n; i++){
                        if(c[i] == j){
                                cp[s[i]*2 - 1]++;
                                cp[t[i]*2]--;
                        }
                }
                for(int k = 1; k < 200001; k++){
                        cp[k] += cp[k-1];
                }
                for(int l = 0; l < 200001; l++){
                        if(cp[l] > 0){
                                sum[l]++;
                        }
                }
        }

        int ans = 0;
        for(int i = 0; i < 200001; i++){
                chmax(ans, sum[i]);
        }

        cout << ans << endl;
        return 0;


}



Measured memory_bytes: 3072
#include<iostream>
#include<vector>
#include<string>
#include<deque>
#include<tuple>
#include<algorithm>
using namespace std;

int main(){
    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    for(size_t i = 0; i < h; i++)
    {
        cin >> s[i];
    }
    int ret = -2; // subtract start and goal
    for(size_t i = 0; i < h; i++)
    {
        ret += count(s[i].begin(), s[i].end(), '.');
    }
    deque<tuple<int, int , int> > route;
    route.push_back(make_tuple(0, 0, 0));
    s[0][0] = '0';
    int goal = -1;
    vector<int> x = {1, -1, 0, 0};
    vector<int> y = {0, 0, 1, -1};
    while(!route.empty() && goal == -1) {
        auto here = route.front();
        route.pop_front();
        for(int i = 0; i < 4; i++)
        {
            int new_x = get<1>(here) + x[i];
            int new_y = get<2>(here) + y[i];
            int length = get<0>(here);
            if (new_y == h-1 && new_x == w-1)
                goal = length;
            if (new_x >= 0 && new_x < w && new_y >= 0 && new_y < h && s[new_y][new_x] == '.') {
                route.push_back(make_tuple(length+1, new_x, new_y));
                s[new_y][new_x] = 'x';
            }
        }
    }
    if (goal == -1)
        cout << -1 << endl;
    else
        cout << ret - goal << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <math.h>
#define MAX 1000
#define ll long long
using namespace std;

int main()
{
    char a[3];
    scanf("%s",a);
    int b,c,d;
    b=0;c=0;d=0;
    for(int i=0;i<3;i++){
        if(a[i]=='a')
            b++;
        else if(a[i]=='b')
            c++;
        else if(a[i]=='c')
            d++;
    }
    if(d==1&&b==1&&c==1)
        printf("Yes");
    else
        printf("No");
    return 0;
}


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

using namespace std;

int main()
{
    int n, sum_min = 0, all_sum, tmp_sum;
    cin >> n;
    vector<int> w(n);
    for (int i = 0; i < n; i++) {
        cin >> w[i]; 
        sum_min += w[i];
    }
    all_sum = tmp_sum = sum_min;

    for (int i = 0; i < n; i++) {
        tmp_sum -= w[i];
        if (sum_min > abs(all_sum - 2 * tmp_sum)) {
            sum_min = abs(all_sum - 2 * tmp_sum);
        }
    }
    cout << sum_min << endl;
}

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

namespace AtCoder
{
    class Program
    {
        
        static void Main()
        {
            //ここから
            int i = ReadLineToInt();
            if (i == 1)
            {
                Console.WriteLine("Hello World");
                return;
            }

            int ans = 0;
            ans += ReadLineToInt();
            ans += ReadLineToInt();

            //ここまで
            Console.WriteLine(ans);
            Console.ReadKey();
        }


        static public void Swap<T>(ref T a,ref T b) { T temp = a;a = b;b = temp; }
        static public long GCD(int a, int b){ return b != 0 ? GCD(b, a % b) : a;}
        static public long LCM(int a, int b){ return (long)a * b / GCD(a, b); }
        static public int Factorial(int a) { return a == 1 ? a : a * Factorial(a - 1); }
        static public int Conbin(int n,int m) { return Factorial(n) / (Factorial(n - m) * Factorial(m)); }


        
        static public string ReadLineToString(){return Console.ReadLine();}
        static public int ReadLineToInt(){return int.Parse(Console.ReadLine());}
        static public long ReadLineToLong() { return long.Parse(Console.ReadLine()); }
        static public string[] ReadLineToStringArray(){return Console.ReadLine().Split(' ').ToArray();}
        static public int[] ReadLineToIntArray(){return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();}
        static public long[] ReadLineToLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public List<string> ReadLineToStringList(){return Console.ReadLine().Split(' ').ToList();}
        static public List<int> ReadLineToIntList(){return Console.ReadLine().Split(' ').Select(int.Parse).ToList();}
        static public List<long> ReadLineToLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }
    }
    
}



Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
const int INF = 2100100100;
using ll = long long;

int main(){
    string s;
    cin >> s;
    vector<char> input(6);
    for(int i=0;i<6;i++){
        input.at(i)=s.at(i);
    }
    if (input.at(2)==input.at(3) && input.at(4)==input.at(5))
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string A,B;
  cin >> A >> B;
  int c = 0;
  for(int i = 0;i < A.size();i++){
  if (A.at(i)!=B.at(i)){
    c++;
  }
  }
 cout << c; 
}

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

int main(){
    double pai=3.141592653589;
    int n;
    int x[1000],y[1000];
    double ans1=0,ans2=0,ans3=0,ans4=0,anstmp=0,tmp;
    scanf("%d",&n);
    for(int i=0;i<2;i++){
        for(int j=0;j<n;j++){
            if(i==0) scanf("%d",&x[j]);
            else scanf("%d",&y[j]);
        }
    }
    for(int i=0;i<n;i++){
        ans1+=abs(x[i]-y[i]);
    }
    printf("%.8lf\n",ans1);
    for(int i=0;i<n;i++){
        ans2+=(x[i]-y[i])*(x[i]-y[i]);
    }
    printf("%.8lf\n",pow(ans2,1.0/2.0));

    for(int i=0;i<n;i++){
        tmp=abs(x[i]-y[i]);
        ans3+=tmp*tmp*tmp;
    }
    printf("%.8lf\n",pow(ans3,1.0/3.0));

    for(int i=0;i<n;i++){
        anstmp=abs(x[i]-y[i]);
        ans4=max(ans4,anstmp);
    }
    printf("%.8lf\n",ans4);

    return 0;
}


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

const int N = 205;
const int mod = 998244353;

int n, res = 1;
int x[N], y[N];

int main() {
	ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> x[i] >> y[i]; res = 2 * res % mod; 
	}
	res = (res - 1 + mod) % mod;
	res = (res - n + mod) % mod;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < i; ++j) {
			int sub = 1;
			for (int k = 0; k < j; ++k) {
				if ((y[j] - y[i]) * (x[k] - x[j]) == (x[j] - x[i]) * (y[k] - y[j])) sub = 2 * sub % mod;
			}
			res = (res - sub + mod) % mod;
		}
	}
	cout << res;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
void add(int &a, int b) {
	a = (a + b);
	if (a >= MOD)a -= MOD;
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	string S;
	cin >> S;
	vector<vector<int> > dp(N, vector<int>(N, 0));
	int res = 0;
	for (int i = 0; i < N; i++) {
		dp[0][i] = 1;
	}
	for (int i = 1; i < N; i++) {
		if (S[i - 1] == '<') {
			for (int j = 0; j < N - i; j++) {
				if (j > 0)add(dp[i][j], dp[i][j - 1]);
				add(dp[i][j], dp[i - 1][j]);
			}
		}
		else {
			for (int j = N - i - 1; j >= 0; j--) {
				if (j < N - i - 1)add(dp[i][j], dp[i][j + 1]);
				add(dp[i][j], dp[i - 1][j + 1]);
			}
		}
	}
	cout << dp[N - 1][0] << endl;
}

Measured memory_bytes: 70784
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <climits>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cassert>
#include <vector>
#define all(x) x.begin() , x.end()
#define fi first
#define se second
#define pb push_back
#define umax( x , y ) x = max( x , (y) )
#define umin( x , y ) x = min( x , (y) )
#define ort (b+s)/2
#define y2 asrwjaelkf
#define y1 asseopirwjaelkf
#define set multiset
 
using namespace std;
 
typedef long long Lint;
typedef pair<Lint,Lint> ii;
typedef pair<int,char> ic;
typedef pair<ii,int> iii;
typedef pair<ii,ii> i4;
 
const int maxn = 200020;
const int maxm = 10000020;
const int MOd = 998244353;

int a, b;
string s, s2;
int cnt[maxn], dad[maxn];

int find(int n) {
	if( dad[n] == n ) return n;
	return dad[n] = find(dad[n]);
}

void solve() {
	scanf("%d %d",&a,&b);
	
	for(int i=1;i<=a;i++) dad[i] = i;
	for(int i=0,j,k;i<b;i++) {
		scanf("%d %d",&j,&k);
		j = find( j);
		k = find(k);
		if( j != k ) dad[j] = k;
	}
	int ans = 0;
	for(int i=1;i<=a;i++) cnt[find(i)]++;
	for(int i=1;i<=a;i++) umax(ans,cnt[i]);
	cout << ans << endl;
}
 
int main() {
	int n = 1;
	// scanf("%d",&n);
	while( n-- ) solve();
 
	return 0;
}

Measured memory_bytes: 10708
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>

using std::cin;
using std::cout;
using std::endl;



int main() {

    int A,B;
    cin >> A >> B;
    cout << (A<=5 ? 0 : A<13 ? B/2 : B) << endl;
	return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;
#define mp make_pair
#define sp << " " <<
#define mod 1000000007
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
bool sortfirst(pii &a,pii &b){
    return a.first<b.first;
}
int main(){
    int x,y;
    std::cin>>x>>y;
    int rew=0;
    if(x==3){
        rew+=100000;
    }
    else if(x==2){
        rew+=200000;
    }
    else if(x==1){
        rew+=300000;
    }
    if(y==3){
        rew+=100000;
    }
    else if(y==2){
        rew+=200000;
    }
    else if(y==1){
        rew+=300000;
    }  
    if(x==1&&y==1){
        rew+=400000;
    }
    std::cout<<rew;
    
    

    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
bool c(int x,int y){
    return y<x;
}
int main() {
    int n;cin>>n;
    vector<int > p(n);
    for (int i = 0; i < n; ++i)
        cin>>p[i];
    int q;cin>>q;
    while(q--){
        int b,e,k;cin>>b>>e>>k;
        rotate(&p[b],&p[e],&p[k]);
    }
    for (int i = 0; i < n-1; ++i)
        cout<<p[i]<<" ";
    cout<<p[n-1]<<endl;
    return 0;
}



Measured memory_bytes: 3128
from itertools import combinations
H,W = map(int,input().split())
grid = [0] * H
for i in range(H):
    grid[i] = list(input())
res = 'Impossible'
# 1は右、0は下
move_indexes = [i for i in range(H+W-2)]
# 移動回数W+Hの中からH回縦移動を選ぶ
for y_move in combinations(move_indexes,H-1):
    now_y, now_x = 0,0
    reached = [[0]*W for _ in range(H)]
    reached[0][0] = 1
    for i in range(H+W-2):
        # うまくやれば*1/8にはなる
        if i in y_move:
            now_y += 1
        else:
            now_x += 1
        reached[now_y][now_x] = 1
    can = True
    for i in range(H):
        for j in range(W):
            if (not reached[i][j] and grid[i][j]=='#') or (reached[i][j] and grid[i][j] == '.'):
                can = False
    if can:
        res = 'Possible'
        break

print(res)




Measured memory_bytes: 9288
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <tuple>
#include <stack>
#include <bitset>

using namespace std;
typedef long long ll;
//typedef pair<ll, ll> P;
const ll MAX_N = 101;
const ll MOD_P = 1000000000 + 7;

ll dp[MAX_N][4][4][4];

int main() {

  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  // A -> 0, G -> 1, C -> 2, T -> 3
  // AGC  012
  // ACG  021
  // GAC  102
  // A?GC 0?12
  // AG?C 01?2
  
  ll N;
  cin >> N;

  dp[0][3][3][3] = 1;
  
  for (ll len = 0; len < N; len++) {
    for (ll c1 = 0; c1 < 4; c1++) {
      for (ll c2 = 0; c2 < 4; c2++) {
	for (ll c3 = 0; c3 < 4; c3++) {

	  if (dp[len][c3][c2][c1] == 0) continue;

	  for (ll a = 0; a < 4; a++) {
	    
	    if (a == 2 && c1 == 1 && c2 == 0) continue;
	    if (a == 1 && c1 == 2 && c2 == 0) continue;
	    if (a == 2 && c1 == 0 && c2 == 1) continue;
	    if (a == 2 && c1 == 1 && c3 == 0) continue;
	    if (a == 2 && c2 == 1 && c3 == 0) continue;

	    dp[len+1][c2][c1][a] += dp[len][c3][c2][c1];
	    dp[len+1][c2][c1][a] %= MOD_P;
	  }
	}
      }
    }
  }

  ll ans = 0;
  for (ll c1 = 0; c1 < 4; c1++) {
    for (ll c2 = 0; c2 < 4; c2++) {
      for (ll c3 = 0; c3 < 4; c3++) {
	ans += dp[N][c3][c2][c1];
	ans %= MOD_P;
      }
    }
  }
  cout << ans << endl;
  
  return 0;
}


    


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

int main(void)
{
    using namespace std;
    int H, W;
    while (true) {
        scanf("%d %d", &H, &W);
        if (H == 0 && W == 0) {
            break;
        }
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                printf("#");
            }
            printf("\n");
        }
        printf("\n");
    }
}


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

#define rep(i,n) for(int i = 0; i != n; i++)

using namespace std;

pair<long long, long long> add(long long l, long long s){
	long long q = l/s;
	long long r = l % s;
	if(r == 0)
		return make_pair((2*q - 1)*s ,r);
	return make_pair(2*q*s,r);
}


int main(){
	long long N,X;
	cin >> N >> X;
	long long res = 0;
	res += N;

	long long s = min(X, N - X);
	long long l = max(X, N - X);

	while(1){
		pair<long long, long long> temp = add(l,s);
		res += temp.first;
		if(temp.second == 0)
			break;
		l = s;
		s = temp.second;
	}
	cout << res << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
string dp[10020];
const int cost[]={100000,2,5,5,4,5,6,3,7,6};
int n,m;
bool smaller(string _s1,string _s2,int add){
	if(_s1=="")return true;
	_s2.push_back('0'+add);
	if((int)_s1.size()<(int)_s2.size()){
		return true;
	}
	if((int)_s1.size()==(int)_s2.size()&&_s1<_s2)return true;
	return false;
}
int main(){
	cin>>n>>m;
	vector<int>a(m);
	for(int i=0;i<m;i++)cin>>a[i];
	for(int i=0;i<=n;i++){
		if(i&&dp[i]=="")continue;
		for(auto x:a){
			if(smaller(dp[i+cost[x]],dp[i],x)){
				dp[i+cost[x]]=dp[i];dp[i+cost[x]].push_back('0'+x);
			}
		}
	}
	cout<<dp[n]<<endl;
	return 0;
}

Measured memory_bytes: 45312
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define rep(i, f, n) for (int i = (f); i < (int)(n); i++)
#define repe(i, f, n) for (int i = (f); i <= (int)(n); i++)
using namespace std;
using ll = long long;
using GraphI = vector<vector<int>>;
using GraphC = vector<vector<char>>;
using pint = pair<int, int>;

const int INF = 1001001001;

int main() {
  int H, W;
  cin >> H >> W;
  GraphC g(H, vector<char>(W));
  GraphI d(H, vector<int>(W, 0));
  queue<pint> q;
  rep(y, 0, H) {
    rep(x, 0, W) {
      cin >> g[y][x];
      if (g[y][x] == '#') {
        d[y][x] = 1;
        q.push(pint(y, x));
      }
    }
  }

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

  while (!q.empty()) {
    auto now = q.front();
    q.pop();
    int y = now.first, x = now.second;

    rep(i, 0, 8) {
      int ny = y + dy[i], nx = x + dx[i];
      if (ny < 0 || ny >= H || nx < 0 || nx >= W) continue;
      if (g[ny][nx] == '#') continue;
      d[ny][nx] += d[y][x];
    }
  }

  rep(y, 0, H) {
    rep(x, 0, W) {
      if (g[y][x] == '#')
        cout << '#';
      else
        cout << d[y][x];
    }
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
using namespace std;
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define mod 1000000007
#define PI 3.1415926535897932384626433
#define se second
#define fi first
#define pb push_back
#define T true
#define F false
#define endl "\n"
typedef char ch;
typedef bool boll;
typedef string st;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef set < string > sst;
typedef set < long long > sl;
typedef queue < long long > que;
typedef vector < long long > vec;
typedef map < long long, long long > mll;
typedef pair < long long, long long > pll;
typedef vector < pair < long long, long long > > vpl;
typedef pair < long long, unsigned long long > pul;

int main(){
    int a,b,k;
    cin >> k;
    cin >> a>>b;
    if(a%k==0 || b%k==0){
        cout << "OK";

    }
    else{
        if(a/k - b/k != 0) cout << "OK";
        else cout << "NG";
    }
}


Measured memory_bytes: 3624
while True:
    n,k=map(int, raw_input().split())
    if n==0 and k==0:
         break
    s = map(int, raw_input().split())
    for i in xrange(n):
        b = map(int, raw_input().split())
        for j in xrange(k):
            s[j] -= b[j]
    print "Yes" if len(filter(lambda x:x<0, s))==0 else "No"

Measured memory_bytes: 4292
import java.util.*;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<String> name = new ArrayList<String>();
    ArrayList<Integer> time = new ArrayList<Integer>();
    for (int i=0; i<n; i++) {
      String a = sc.next();
      int b = sc.nextInt();
      name.add(a);
      time.add(b);
    }
    String s = sc.next();
    
    int ans = 0;
    for (int i=name.indexOf(s)+1; i<n; i++){
      ans += time.get(i);
    }
    System.out.println(ans);    
  }
}

Measured memory_bytes: 21716
#include <cstdio>
#include <math.h>
using namespace std;


#define PI 3.141592653589793238462643383279
int a, b, c;

double rad(double d) {
	return PI * d / 180;
}
double sind(double c) {
	return sin(rad(c));
}
double cosd(double c) {
	return cos(rad(c));
}
double s() {
	return a*b*sind(c) / 2;
}
double l() {
	return a + b + sqrt(a*a + b*b - 2 * a*b*cosd(c));
}
double h() {
	return b*sind(c);
}
int main(){
	scanf("%d %d %d", &a, &b, &c);
	printf("%.5f\n%.5f\n%.5f\n", s(), l(), h());

	return 0;
}

Measured memory_bytes: 2916
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
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; }
const long long INF = 1LL << 60;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)



int main(){
    int x,n;
    cin>>x>>n;
    int p[n];
    bool a[102];
    rep(i,102) a[i]=true; 
    rep(i,n){
        cin>>p[i];
        a[p[i]]=false;
    }
    int dis=200;
    int ans;

    for(int i=0;i<=101;i++){
        if(a[i]){
            if(x>=i){
                if(dis>x-i){
                    ans=i;
                    dis=x-i;
                }
            }
            else{
                if(dis>i-x){
                    ans=i;
                    dis=i-x;
                }
            }
        }
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 3552
n, k = map(int, input().split())
a = list(map(int, input().split()))
if k >= 50:
    k = 50
for j in range(k):
    s = [0] * (n + 1)
    for i in range(n):
        if i - a[i] >= 0:
            s[i - a[i]] += 1
        else:
            s[0] += 1
        if i + a[i] + 1 < n + 1:
            s[i + a[i] + 1] -= 1
        else:
            s[n] -= 1
            
    s_ = [0] * (n + 1)
    s_[0] = s[0]
    for i in range(n):
        s_[i + 1] = s_[i] + s[i + 1]
        
    a = s_
    
print(*s_[:n])

Measured memory_bytes: 186580
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;

int main()
{
	int N, A, B;
	in >> N >> A >> B;
	LL a = std::min(A, B);
	LL b = (N <= A + B ? (A + B) - N : 0);
	out << a << " " << b << std::endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main()
{
	string s;
	for(int i=0;i<3;i++)
	{
		cin>>s;
		cout<<s[i];
	}
	cout<<"\n";
}


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

using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a, b, k;
    cin >> k >> a >> b;
    for(int i=a; i<b+1; i++){
        if(i%k==0)
            return cout << "OK", 0;
    }
    cout << "NG";
    return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main(void){
  int K,T;
  cin >> K >> T;
  
  vector<int>a(T);
  for(int i=0;i<T;i++){
    cin >> a[i];
  }
  
  int m = 0;
  for(int i=0;i<T;i++){
    if(m < a[i]) m = a[i];
  }
  
  cout << max(m - 1 - (K - m) , 0) << endl;
  
  return 0;
}


Measured memory_bytes: 256
#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, k, d;
    cin >> x >> k >> d;
    x = abs(x);
    ll div = x / d;
    ll ans = 0LL;
    if (div > k)
    {
        ans = abs(x - k * d);
    }
    else
    {
        int d2 = div % 2;
        int k2 = k % 2;
        if (d2 == k2)
        {
            ans = abs(x - div * d);
        }
        else
        {
            ans = abs(x - div * d - d);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <climits>
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define in insert
#define vll vector<ll>
#define endl "\n"
#define pll pair<ll,ll>
#define f first
#define s second
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define int ll
#define sz(x) (ll)x.size()
#define all(x) (x.begin(),x.end())
using namespace std;

 
const ll INF = 1e12;
const ll N =(2e5+5); // TODO : change value as per problem
const ll mod = 998244353;
int t[4*N];	
int a[N];
int n;
int lazy[4*N];
int suf[N];
ll power(ll a, ll b)	//a is base, b is exponent
{
	if(b==0)
		return 1;
	if(b==1)
		return a;
	if(b%2 == 1)
		return (power(a,b-1)*a)%mod;
	ll q = power(a,b/2);
	return (q*q)%mod;
}

void psh(int v,int l,int r){
	int sum = suf[l] - suf[r+1];
	if(sum <0)sum+=mod;
	t[v] = (lazy[v]*sum)%mod;
	if(t[v]<0)t[v]+=mod;
	if(l != r){
		lazy[v*2] = lazy[v];
		lazy[v*2+1] = lazy[v];
	}
	lazy[v] = 0;
}
void build(int v,int l,int r){
	if(l == r){
		t[v] = power(10,n-l);
	}
	else{
		int m = (l+r)>>1ll;
		build(v*2,l,m);
		build(v*2+1,m+1,r);
		t[v] = (t[v*2] + t[v*2+1])%mod;
	}
}

void update(int v,int st,int en,int l,int r,int d){
	if(lazy[v]){
		psh(v,l,r);
	}
	if(l > en || r < st) return;
	if(l >= st && r <= en){
		lazy[v] = d;
		psh(v,l,r);
		return;
	}
	int m = (l+r)>>1ll;
	update(v*2,st,en,l,m,d);
	update(v*2+1,st,en,m+1,r,d);
	t[v] = (t[v*2] + t[v*2+1])%mod;
}
int query(int v,int l,int r,int st,int en){
	if(l > en || r < st) return 0;
	if(l >=st && r <=en) return t[v];
	int m = (l+r)>>1ll;
	int p1 = query(v*2,l,m,st,en);
	int p2 = query(v*2+1,m+1,r,st,en);
	return (p1+p2)%mod;
}

void solve(){
	cin >>n;
	build(1,1,n);
	for(int i =n;i>=1;i--){
		int gg = power(10,(n-i));
		suf[i] = (suf[i+1] + gg)%mod;
		if(suf[i] < 0)suf[i] += mod;
	}
	int q;
	cin >> q;
	while(q--){
		int l,r,d;
		cin >> l >> r >> d;
		update(1,l,r,1,n,d);
		cout<<query(1,1,n,1,n) << endl;
		// set d to every number in the range [l,r]
	}


	// cout<<t[1]<<endl;
}
signed main(){
 
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
     // freopen(".in","r",stdin);freopen(".out","w",stdout);
    
     ll tt=1;   
     // cin >> tt;
    while(tt--){    
        solve();
    }    
}


Measured memory_bytes: 13408
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include<set>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*約数*/vector<ll>div(ll a){vector<ll>b;ll i;rep(i,1,a){if(!a%i)push(b,a);}return b;}
llfor;///////////////////////////////////////////////////////////
int main(){
 ll n,c,k;
 sc(n);sc(c);sc(k);
 llpvec t(n);
 ll b;
 bool a[n+10];


rep(i,0,n){
  sc(b);
  t[i]={b,b+k};
  a[i]=false;
 }
 sort(all(t));
 //rep(i,0,n)cout<<i<<" "<<t[i].first<<" "<<t[i].second<<endl;pnn;
 ll cnt=0;ll ans=0;
  
 rep(i,0,n){
  if(!a[i]){
   cnt=1;
   a[i]=true;
   for(j=i+1;t[j].first<=t[i].second&&j<n&&cnt<c;j++){
    if(t[j].second>=t[i].second){
     a[j]=true;cnt++;
     //cout<<i<<" "<<j<<" "<<cnt<<" "<<ans<<endl;
    }
   }
   ans++;
  }
 }
 
 pr(ans);
  
   
return 0;}

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

int main(){
    string s,w;
    cin >>w;
    for(int i=0;i<w.size();i++)if(('A'<=w[i])&&(w[i]<='Z')) w[i]+='a'-'A';
    int cnt=0;
    while(cin>>s){
        if(s=="END_OF_TEXT")break;
        for(int i=0;i<s.size();i++){
            if(('A'<=s[i])&&(s[i]<='Z')) s[i]+='a'-'A';
        }
        if(s==w)cnt++;
    }
    cout << cnt <<endl;
}


Measured memory_bytes: 3156
#include <map>
#include <list>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
string s;
int main()
{
	fast;
	cin>>s;
	if (s[0]==s[1] && s[1]==s[2] || s[1]==s[2] && s[2]==s[3])
	   cout<<"Yes"<<endl;
	else
	   cout<<"No"<<endl;
    return 0;
}

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

#define f first 
#define s second 
#define pb push_back               
#define mp make_pair 

using namespace std;                    

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int N = (int)1e5 + 123, mod = (int)1e9 + 7;

int main(){    
	ll a, b, c, ans;

    cin >> a >> b >> c;
    ans = min(b * c, min(a * b, a * c));
    if(b % 2 == 0 || c % 2 == 0 || a % 2 == 0)
    	ans = 0;
    cout << ans;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e8;

using namespace std;


//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用


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

	string s[3];
	cin >> s[0] >> s[1] >> s[2];
	rep(i, 3)
	{
		cout << s[i][i];
	}
	cout << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define f first
#define s second
#define ll long long
#define vi vector<int>
#define pii pair<int, int>
#define si set<int>
#define y1 yy
#define debug if(printDebug)
using namespace std;
bool printDebug=false;
int main(){
    //printDebug=true;
    /*freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);//*/
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);//*/
    int n;
    cin >> n;
    int i=1000;
    while(i<n) i+=1000;
    cout << i-n << "\n";
    return 0;
}


Measured memory_bytes: 3624
S = str(input())
listS = list(S)

count = 0
max = 0

for i in range(len(listS)):
    if listS[i] == 'A' or listS[i] == 'T' or listS[i] == 'G' or listS[i] == 'C':
        count += 1
        if count > max:
            max = count
    else:
        count = 0

print(max)

Measured memory_bytes: 3060
using System;
class _0008
{
    public static void Main()
    {
        string str;
        while ((str = Console.ReadLine()) != null)
        {
            int n = int.Parse(str);
            int m = 0;
            for (int i = 0; i < 10; i++)
                for (int j = 0; j < 10; j++)
                    for (int k = 0; k < 10; k++)
                        for (int l = 0; l < 10; l++)
                            if (i + j + k + l == n) m++;
            Console.WriteLine(m);
        }
    }
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */



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

	LL N; cin>>N;
	VL a(N);
	FOR(i, 0, N) {
		cin >> a[i];
	}

	VL csum(N + 1, 0);
	FOR(i, 0, N) {
		csum[i + 1] = csum[i] + a[i];
	}
	LL ans = LINF;
	FOR(i, 1, N) {
		LL x = csum[N] - csum[i];
		LL y = csum[i] - csum[0];
		ans = min(ans, abs(x - y));
	}
	
	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 3456