akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;

long long  fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y){
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
/*逆元計算*/
long long int  modinv(long long a, long long m) {
	long long int b = m, u = 1, v = 0;
	while (b) {
		long long int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
// index が条件を満たすかどうか
vector<long long int >meguru;
bool isOK(int index, int key) {
	if (meguru[index] >= key) return true;
	else return false;
}
// 汎用的な二分探索のテンプレ
int binary_search(int key) {
	int left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int right = (int)meguru.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		int mid = left + (right - left) / 2;

		if (isOK(mid, key)) right = mid;
		else left = mid;
	}
	/* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
	return right;
}
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int main() {
	int n;
	cin >> n;
	long long int ans = 1;
	for (int i = 0; i < n; i++) {
		long long int a;
		cin >> a;
		ans = gcd(ans, a);
	}
	cout << ans;
}


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

int main()
{
  int w, h, n;
  cin >> w >> h >> n;
  int l = 0, r = w, d = 0, u = h;
  
  rep(i,n)
  {
    int x, y, a;
    cin >> x >> y >> a;
    if(a == 1) l = max(l, x);
    else if(a == 2) r = min(r, x);
    else if(a == 3) d = max(d, y);
    else if(a == 4) u = min(u, y);
  }
  
  cout << max(0, r-l)*max(0, u-d) << endl;
  
  return 0;
}

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

  int N ;
  cin >> N  ;
  vector<string> A(N) ;
  rep(i,N) cin >> A.at(i) ;
  //ダブり確認
  rep(i,N-1){
    for(int j = i+1 ; j< N ; j++ ){
      if( A.at(i) == A.at(j) ){
        cout << "No" << endl;
        return 0 ;
      }
    }
  }
  //しりとり確認
  rep(i,N-1){
    string W = A.at(i)  ;
    string X = A.at(i+1);
    int L = A.at(i).size() ;
    if( W[L-1] != X[0] ){
      cout << "No" << endl;
      return 0 ;
      }
  }
  cout << "Yes" <<endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

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

        for (int tu = 0; tu <= x; tu++) {
            for (int ka = 0; ka <= x - tu; ka++) {
                if (y == tu*2 + ka*4 && x == tu + ka) {
                    System.out.println("Yes");
                    return;
                }
            }
        }
        System.out.println("No");
    }
}


Measured memory_bytes: 35768
N=input()
t=map(int,raw_input().split())
v=map(int,raw_input().split())

T=sum(t)
t_len=len(t)

maxv=[0]
for ind_i,i in enumerate(t):
	for j in range(i*2):
		if j==i*2-1:
			if ind_i==t_len-1:
				maxv.append(0)
			else:	
				maxv.append( min(v[ind_i],v[ind_i+1]) )
		else:
			maxv.append(v[ind_i])


for i in range(1,2*T):
	maxv[i]=min(maxv[i],maxv[i-1]+0.5)


for i in reversed(range(1,2*T)):
	maxv[i]=min(maxv[i],maxv[i+1]+0.5)
#print maxv

#for ind,i in enumerate(maxv):
#	print ind,i


cnt=0
for i in maxv:
	cnt+=0.5

print sum(maxv)/2



Measured memory_bytes: 4296
#include <bits/stdc++.h>
#include <boost/integer/common_factor_rt.hpp>
using namespace std;
using ll=long long;
const int MOD=1000000007;

int main() {
  ll n,k;
  cin >> n >> k;
  vector<pair<ll,ll>> vp(n);
  for(ll i=0;i<n;i++){
    cin >> vp.at(i).first >> vp.at(i).second;
  }
  sort(vp.begin(),vp.end());
  ll sum=0;
  for(ll i=0;i<n;i++){
    sum+=vp.at(i).second;
    if(sum>=k){
      cout << vp.at(i).first << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 4828
#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 m;
    ll k;
    cin >> m >> k;
    int n = 1 << m;
    if(m == 0){
        if(k == 0){
            cout << 0 << " " << 0 << endl;
        }else{
            cout << -1 << endl;
        }
    }else if(m == 1){
        if(k == 0){
            cout << 0 << " " << 0 << " " << 1 << " " << 1 << endl;
        }else{
            cout << -1 << endl;
        }
    }else{
        if(k >= n){
            cout << -1 << endl;
            return 0;
        }
        REP(i, n){
            if(i != k) cout << i << " ";
        }
        cout << k << " ";
        RREP(i, n){
            if(i != k) cout << i << " ";
        }
        cout << k << endl;
    }
    return 0;
}


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

#define ll long long
#define endl '\n'
#define REP(i, a, n) for(int i=a; i<n; ++i)
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const double PI = 3.141592653589793238460;
const ll mod = 1e9 + 7;

void FAST(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}

int main(){
  FAST();

  int n;
  cin >> n;
  vi l(n);
  int sum = 0;
  REP(i, 0, n){
      cin >> l[i];
      sum += l[i];
  }

  bool flag = 1;
  REP(i, 0, n){
      if(l[i] >= sum - l[i])
        flag = 0;
  }

  cout << ((flag == 1) ? "Yes" : "No") << endl;



  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,a,n) for(int i = a;i < n;i++)
	
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
	int a,b,c,n,m;
	string s;
	cin >> s;
	
	if(s.size() == 2){
		cout << s;
	}
	else{
		cout << s[2] << s[1] << s[0] << endl;
	}
	
  	return 0;
}





Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>

using namespace std;
#define ALL(a) (a).begin(), (a).end()
#define REP(i, n) for (size_t i = 0; i < (n); i++)
#define nvec(T, v, n) vector<T> v(n); REP(i, n) {cin>>(v)[i];}
#define npairs(T1, T2, v, n) vector<pair<T1, T2>> v(n); REP(i, n){cin>>v[i].first>>v[i].second;}
#define ntuples(T1, T2, T3, v, n) vector<tuple<T1, T2, T3>> v(n); REP(i, n){cin>>get<0>(v[i])>>get<1>(v[i])>>get<2>(v[i]);}

#define min_index(v) size_t( min_element(all(v)) - (v).begin() )
#define max_index(v) size_t( max_element(all(v)) - (v).begin() )
#define min_e(v) *min_element(ALL(v))
#define max_e(v) *max_element(ALL(v))

#define count_le(v, a) size_t( upper_bound(ALL(v), a) - (v).begin() )
#define count_lt(v, a) size_t( lower_bound(ALL(v), a) - (v).begin() )
#define count_ge(v, a) size_t( (v).end() - lower_bound(ALL(v), a) )
#define count_gt(v, a) size_t( (v).end() - upper_bound(ALL(v), a) )

#define order(neq_sl) [](const auto s, const auto l){return neq_sl;}
#define make_lr(v,type,l,r) vector<type> l(n+1),r(n+1);FOR(i,n){l[i+1]=l[i]+v[i];r[i+1]=r[i]+v[n-1-i];}

#define acm accumulate
#define SUM(v) accumulate(ALL(v), 0l)
#define SORT(v) sort(ALL(v))

#define GCD(v) gcd(ALL(v), 0l)

/*template <typename T>
T gcd(T a, T b) {
    if (a > b) swap(a, b);
    if (a == 0) return b;
    return gcd(b%a, a);
}
template <typename InputItr, typename T>
T gcd(InputItr first, InputItr last, T init) {
    for (; first != last; ++first) init = gcd(init, *first);
    return init;
}*/

template <typename T>
using vec = vector<T>;

template <typename T>
using vvec = vector<vector<T>>;

int main(){
  int n,cnt=0;long d;cin>>n>>d;
  long x,y;
  for (int i = 0; i < n; i++) {
    cin>>x>>y;
    if(x*x+y*y<=d*d)cnt++;
  }
  cout<<cnt;
}


/* きょむ〜 */


Measured memory_bytes: 3632
/*  
    Talkin' to myself and feelin' old
    Sometimes I'd like to quit, nothin' ever seems to fit
    Hangin' around, nothin' to do but frown
    Rainy days and Mondays always get me down
    _________________________
    _________________________
    912 Hours of Solitude
    Quarantine_Day : 38
*/

#include<bits/stdc++.h>

using namespace std;

typedef long long int       ll;
typedef vector<int>         vi;
typedef vector<ll>          vl;
typedef pair<int, int>      pii;
typedef pair<ll, ll>		pll;

#define pb(n)           push_back(n)
#define GSORT(v)        sort(v.begin(), v.end(), greater<int>())
#define SORT(v)         sort(v.begin(), v.end());
#define REV(v)          reverse(v.begin(), v.end());
#define db(a)           cout<<#a<<" = "<<a<<endl;
#define FIN             freopen("in.txt","r",stdin);
#define FOUT            freopen("out.txt","w",stdout);
#define REP(i,n)        for(int i = (int)(0); i < (int)(n); i++)
#define FOR(i, a, b)    for(int i = (int)a; i <= (int)b; i++)    

#define MAX 50005


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

	string s; cin>>s;
	bool flag = false;
	for(char c = 'a'; c <= 'z'; c++){
		int p = s.find(c);
		if(p == -1){
			cout<<c<<"\n";
			flag = true;
			break;
		}
	}
	if(!flag) cout<<"None\n";

	return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

int V, E;
vector<int> G[10010];
vector<int> ans;
int indeg[10010];
bool used[10010];

void bfs(int s) {
    queue<int> que;
    que.push(s);
    used[s] = true;
    while (!que.empty()) {
        int u = que.front(); que.pop();
        ans.push_back(u);
        for (auto v: G[u]) {
            indeg[v]--;
            if (indeg[v] == 0 && !used[v]) {
                used[v] = true;
                que.push(v);
            }
        }
    }
}

void tsort() {
    for (int u = 0; u < V; u++) {
        used[u] = false;
        indeg[u] = 0;
    }

    for (int u = 0; u < V; u++)
        for (auto v: G[u]) indeg[v]++;

    for (int u = 0; u < V; u++)
        if (indeg[u] == 0 && !used[u]) bfs(u);
}


int main(void) {
    cin >> V >> E;
    for (int i = 0; i < E; i++) {
        int s, t;
        cin >> s >> t;
        G[s].push_back(t);
    }

    tsort();
    for (auto i: ans) cout << i << endl;

    return 0;
}

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

using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef long long LL;
typedef pair<int,int> PI; 
typedef pair<LL,LL> PLL;
typedef unsigned long long ULL;
typedef pair<double,double> PD;

#define FOR(x, b, e) for(int x = b; x<= (e); x++)
#define FORD(x, b, e) for(int x = b; x>= (e); x--)
#define REP(x, n) for(int x = 0; x<(n); ++x)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(x) ((int)(x).size())

#define PB push_back
#define IN insert
#define ST first
#define ND second
#define INF 2000000011
#define MOD 1000000007

#define MAXS 200010
#define MAXT 2097152

int n;
LL c;
LL wys[MAXS];
PLL tree[MAXT];	//{a,b}

int szer=1048576;

LL val(LL h1){
	
	int cat=h1+szer;
	LL tmx=LONG_LONG_MAX;
	
	while(cat){
		tmx=min(tmx,tree[cat].ST*h1+tree[cat].ND);
		cat/=2;
	}	
	return tmx;
}


void ins(int v,int a,int b,PLL fx){

	//cout<<v<<" "<<a<<" "<<b;
	//if(v>MAXT)
	//	return;
		
	if(a*tree[v].ST+tree[v].ND>=a*fx.ST+fx.ND&&b*tree[v].ST+tree[v].ND>=b*fx.ST+fx.ND){
		tree[v]=fx;
		return;
	}
	
	if(a*tree[v].ST+tree[v].ND<a*fx.ST+fx.ND&&b*tree[v].ST+tree[v].ND<b*fx.ST+fx.ND)
		return;
		
	int mid=(a+b-1)/2;
	ins(v*2,a,mid,fx);
	ins(v*2+1,mid+1,b,fx);	
}


int main(){
	
	ios::sync_with_stdio(0); cin.tie(0);
	cin>>n>>c;
	
	REP(i,n)
		cin>>wys[i];
	
	REP(i,MAXT)
		tree[i]={-2*wys[0],wys[0]*wys[0]};

	LL dp;
	FOR(i,1,n-1){
		dp=val(wys[i])+wys[i]*wys[i]+c;
		ins(1,0,szer-1,{-2*wys[i],wys[i]*wys[i]+dp});
	}
	
	cout<<dp;
	
	return 0;
}


Measured memory_bytes: 34560
#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

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

    vector<int> h;


    int ans = 0;
    for(int i = 0; i < n; i++){
        int tmp;
        cin >>tmp;
        bool visible = true;
        for(int j = 0; j < h.size(); j++){
            if(h[j] > tmp){
                visible = false;
                break;
            }
        }
        if(visible){
            ans++;
        }
        h.push_back(tmp);
    }
    printf("%d\n", ans);
    return 0;
}

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

int main() {

    string S;
    cin >> S;

    int m[4] = {0};
    char d[4] = {'N', 'S', 'W', 'E'};
    rep(i, S.size()) {
        rep(j, 4) {
            if (S[i] == d[j])
                m[j]++;
        }
    }

    int cnt = 0;
    rep(i, 4) {
        if (m[i] == 0)
            cnt++;
    }

    if (cnt == 2) {
        if (m[0] > 0 && m[1] > 0 || m[2] > 0 && m[3] > 0)
            cout << "Yes";
        else
            cout << "No";
    } else if (cnt == 0)
        cout << "Yes";
    else
        cout << "No";

    cout << endl;

    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	A,B = inputMap()

	if B == 1:
		print(0)
		sys.exit()

	ans = 0
	to = 0
	flg = False
	while True:
		ans += 1
		if flg == False:
			to += A
			flg = True
		else:
			to = (to-1) + A

		if to >= B:
			break

	print(ans)

if __name__ == "__main__":
	main()


Measured memory_bytes: 38416
X, Y = map(int, input().split())

G = 0

if X == 1 and Y == 1:
    G += 400000

if X == 1:
    G += 300000

if X == 2:
    G += 200000

if X == 3:
    G += 100000

if Y == 1:
    G += 300000

if Y == 2:
    G += 200000

if Y == 3:
    G += 100000

print(G)


Measured memory_bytes: 3060
from itertools import accumulate
N, C = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
mod = 10**9 + 7
X = [list(accumulate([pow(x, d, mod) for x in range(401)])) for d in range(C+1)]
dp = [[0]*(C+1) for _ in range(N+1)]
dp[0][0] = 1
for i in range(1, N+1):
    for d in range(C+1):
        dp[i][d] = sum([dp[i-1][d-k]*(X[k][B[i-1]] - X[k][A[i-1]-1]) for k in range(d+1)])%mod
        
print(dp[-1][-1])

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

signed main(){
    ll n,m=0,x,A=0,B=0;cin>>n;
    vector<ll> s(n),a(n),b(n);

    rep(i,n){
        cin>>x;
        s[x-1]=i;
    }

    rep(i,n){
        if(A+B>=s[i]){
            A++;
            B=s[i]-A;
        }else{
            B--;
            A=s[i]-B;
        }
        a[i]=A;b[i]=B;
        m=min(m,B-1);
    }

    rep(i,n)cout<<a[i]-m<< (i==n-1 ? '\n':' ');

    rep(i,n)cout<<b[i]-m<< (i==n-1 ? '\n':' ');
    
}

Measured memory_bytes: 1152
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

    public String next() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public String nextLine() {
      if (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          return reader.readLine();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }

      return tokenizer.nextToken("\n");
    }

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

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

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

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  private static int diff(int a) {
    return 10 * (int) Math.ceil(a / 10);
  }

  private static class Diff {
    int val;
    int diff;
    int tens;
    Diff(int val) {
      this.val = val;
      this.tens = (int) (10 * Math.ceil(val / 10.0));
      this.diff = this.tens - val;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    Diff[] a = new Diff[5];
    for (int i = 0; i < 5; i++) {
      a[i] = new Diff(sc.nextInt());
    }
    Arrays.sort(a, (Diff x, Diff y) -> x.diff - y.diff);
    int sum = 0;
    for (int i = 0; i < 4; i++) sum += a[i].tens;
    sum += a[a.length - 1].val;
    System.out.println(sum);
  }
}

Measured memory_bytes: 27348
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
flag = False
for i in range(0, N - M + 1):
  for j in range(0, N - M + 1):
    if B == [x[j:j+M] for x in A[i:i+M]]:
      flag = True
    if flag:
      break
  if flag:
    break
if flag:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

void Main()
{
    int n;
    cin >> n;
    cout << n * n * n << endl;
}

int main()
{
    std::cout << std::fixed << std::setprecision(15);
    Main();
}

Measured memory_bytes: 256
#include <stdio.h>

char map[16][16];

void delete_island(int x, int y)
{
	if (map[x][y] == 0) return;
	map[x][y] = 0;
	delete_island(x - 1, y);
	delete_island(x + 1, y);
	delete_island(x, y - 1);
	delete_island(x, y + 1);
}

int main(void)
{
	while (scanf("%s", &map[1][1]) != EOF){
		int i, j;
		int count = 0;
		
		for (i = 1; i < 12; i++) scanf("%s", &map[i + 1][1]);
		for (i = 0; i < 12; i++){
			for (j = 0; j < 12; j++) map[i + 1][j + 1] -= '0';
		}
		
		for (i = 0; i < 12; i++){
			for (j = 0; j < 12; j++){
				if (map[i + 1][j + 1] == 1){
					count++;
					delete_island(i + 1, j + 1);
				}
			}
		}
		printf("%d\n", count);
		scanf("%*c");
	}
	
	return 0;
}

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

int main() {
  string str;
  int ab[26] = {};
  int i;
  while (getline(cin,str)){
    for (i=0;i<str.size();i++){
      if(str[i]>='a'&&str[i]<='z') ab[str[i]-'a']++;
      else if(str[i]>='A'&&str[i]<='Z') ab[str[i]-'A']++;
    }
  }
  for(i=0;i<26;i++){
    cout << (char)('a'+i) << " : " << ab[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 3160
#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
//#define ll __int64
#define ll long long
#define P pair<ll,ll>
int n;
int t[111111];
int cnt[111111];
int main(){
	cin>>n;
	rep(i,n)cin>>t[i];
	rep(i,n)cnt[t[i]]++;
	int ans=0;
	rep(i,100001)if(cnt[i]>1)ans+=cnt[i]-1;
	if(ans%2)cout<<n-ans-1<<endl;
	else cout<<n-ans<<endl;
	return 0;	
}

Measured memory_bytes: 1024
// C++ includes
#include <bits/stdc++.h>
// 俳句
using namespace std;

// alias templates
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

// alias declaration
using ll = long long;
using str = string;

using vll = V<ll>;
using vvll = V<vll>;
using vs = V<str>;

// loops
#define FOR(i, a, b)  for (ll i = (a); i <= (ll)(b); i++) // [a,b]
#define rFOR(i, a, b) for (ll i = (b); i >= (ll)(a); i--) // [b,a]
#define REP(i, a) FOR((i), 0, (ll)(a)-1) // [0,a-1]

// for debug
#define dbg(a) cerr << "  " << (#a) << ": " << (a) << "\n";

// procon common constants
const ll MOD_BIG = 1e9 + 7;

int main(void){
    ll a,b;
    cin >> a >> b;
    FOR(i,1,1000){
        if((ll)(i*0.08)==a && (ll)(i*0.10)==b){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

typedef long double ld;

ld ab,bc,ca,s2,h[3];
ld x[3],y[3];

bool f(ld r){
    ld a,b,c,d;
    if(h[0]-r<=0)return false;
    a=(h[0]-r)/h[0];
    if(a*h[1]-r<=0)return false;
    b=(a*h[1]-r)/(a*h[1]);
    if(a*b*h[2]-r<=0)return false;
    c=(a*b*h[2]-r)/(a*b*h[2]);
    d=a*b*c;
    if(d*ab>=r*2||d*bc>=r*2||d*ca>=r*2)return true;
    return false;
}

int main(void){
    for(int i=0;i<3;i++){
        cin>>x[i]>>y[i];
        if(i>0){
            x[i]-=x[0];
            y[i]-=y[0];
        }
    }
    ab=sqrt(x[1]*x[1]+y[1]*y[1]);
    bc=sqrt((x[2]-x[1])*(x[2]-x[1])+(y[2]-y[1])*(y[2]-y[1]));
    ca=sqrt(x[2]*x[2]+y[2]*y[2]);
    s2=abs(x[1]*y[2]-x[2]*y[1]);
    h[0]=s2/bc;
    h[1]=s2/ca;
    h[2]=s2/ab;
    ld l=0,r=1e4;
    for(int i=0;i<100;i++){
        ld m=(l+r)/2;
        if(f(m)){
            l=m;
        }else{
            r=m;
        }
    }
    cout<<setprecision(20)<<l<<endl;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

int main(){
    int n,t;cin >> n >> t;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    vector<int> mina(n);
    mina[0] = a[0];
    REP(i,1,n) mina[i] = min(mina[i-1],a[i]);
    auto profit = [&](int i){return a[i]-mina[i];};
    int max_pro = -1;
    int cnt = 0;
    rep(i,n){
        if(max_pro<profit(i)){
            max_pro = profit(i);
            cnt = 1;
        }else if(max_pro==profit(i)){
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
int main(void)
{
	double h,m;
	int cMA,cHA;
	int cMB,cHB;
	int cMC,cHC;
	int cMD,cHD;
	cMA=0;
	cHA=0;
	cMB=0;
	cHB=0;
	cMC=0;
	cHC=0;
	cMD=0;
	cHD=0;
		while(scanf("%lf %lf",&h,&m)!=EOF){
			if(h>=1.1){
				cHA++;
			}
			else if(0.6<=h && h<1.1){
				cHB++;
			}
			else if(0.2<=h && h<0.6){
				cHC++;
			}
			else{
				cHD++;
			}
			if(m>=1.1){
				cMA++;
			}
			else if(0.6<=m && m<1.1){
				cMB++;
			}
			else if(0.2<=m && m<0.6){
				cMC++;
			}
			else if(0.2>m){
				cMD++;
			}
		}
	printf("%d %d\n%d %d\n%d %d\n%d %d\n",cHA,cMA,cHB,cMB,cHC,cMC,cHD,cMD);
	return 0;
}

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

using namespace std;

typedef long long ll;

int main(){
	int a[5];
	int k;
	for(int i = 0; i < 5; i++)cin >> a[i];
	cin >> k;
	sort(a, a+5);
	if(a[4]-a[0] > k)cout << ":(" << endl;
	else cout << "Yay!" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int gakuseki;
	double kg;
	double m;
	double bmi;
	
	while (scanf("%d, %lf, %lf", &gakuseki, &kg, &m) != EOF){
		bmi = kg / (m * m);
		if (bmi >= 25){
			printf("%d\n", gakuseki);
		}
	}
	return (0);
}

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

using namespace std;


int main () {

	int n, k, q;
	scanf("%d %d %d", &n, &k, &q);

	vector <int> v (n + 1, 0);

	for (int i = 0; i < q; ++i) {
		int x;
		scanf("%d", &x);
		v[x]++;
	}

	for (int i = 1; i <= n; ++i) {
		long long calc = (long long)k - q + (long long)v[i];
		printf ("%s\n", (calc > 0 ? "Yes" : "No"));
	}

	return 0;
}





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

using namespace std;

#define MODULE 1000000007
#define MP make_pair

template<class T, class U>
inline void chmin(T &t, U f) { if (t > f)t = f; }

template<class T, class U>
inline void chmax(T &t, U f) { if (t < f)t = f; }

typedef long long LL;
typedef pair<int, int> Pii;
typedef pair<LL, LL> PLL;

const int INF = INT_MAX / 2;    //int_max->2*e+9
const int MAXN = 100001;

LL makeVertex(LL a, LL b) {
    return a * ((LL)1e6+10) + b;
}

struct edge {
public:
    edge(LL vertex, LL cost) : vertex(vertex), cost(cost) {}
    bool operator<(const edge &rhs) const {
        return cost > rhs.cost;
    }

    LL vertex;  //<tyoten,company>
    LL cost;
};


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

//-----Template---------
//UnionFind解もある気がする

int n, m, tmpP, tmpQ, tmpC;

unordered_map<LL,vector<edge> > graph; // <O(M), O(M)>
unordered_map<LL,LL> distMap;  //(tyoten,com),dist

LL dijkstra(LL start,LL goal) {

    priority_queue<edge> que;   //そのままだと大きい順で出てくる

    distMap[start] = 0;
    que.push(edge(start,0));
    while (!que.empty()) {
        edge e = que.top();
        que.pop();
        LL v = e.vertex;
  //      if(distMap[v]==0 && v!=start)
            //distMap[v]=INF;

        if (distMap[v] < e.cost)continue;
        for (auto it=graph[v].begin();it!=graph[v].end();it++){
            edge e2=*it;
            if (distMap[e2.vertex] > distMap[v] + e2.cost) {
                distMap[e2.vertex] = distMap[v] + e2.cost;
                que.push(edge(e2.vertex,distMap[e2.vertex]));
            }
        }
    }
    return distMap[goal];
}

int main() {
    scanf("%d%d", &n, &m);

    for (int i = 0; i < m; ++i) {
        scanf("%d%d%d", &tmpP, &tmpQ, &tmpC);tmpP--;tmpQ--;
        graph[makeVertex(tmpP,tmpC)].push_back(edge(makeVertex(tmpQ,tmpC),0));
        graph[makeVertex(tmpQ,tmpC)].push_back(edge(makeVertex(tmpP,tmpC),0));    //各頂点をつなぐ辺は後で追加

        graph[makeVertex(tmpP,tmpC)].push_back(edge(makeVertex(tmpP,0),0));
        graph[makeVertex(tmpP,0)].push_back(edge(makeVertex(tmpP,tmpC),1));
        graph[makeVertex(tmpQ,tmpC)].push_back(edge(makeVertex(tmpQ,0),0));
        graph[makeVertex(tmpQ,0)].push_back(edge(makeVertex(tmpQ,tmpC),1));

        distMap[makeVertex(tmpP,tmpC)]=INF;
        distMap[makeVertex(tmpQ,tmpC)]=INF;
        distMap[makeVertex(tmpP,0)]=INF;
        distMap[makeVertex(tmpQ,0)]=INF;
    }

    LL res=dijkstra(makeVertex(0,0),makeVertex(n-1,0));
    cout<<((res==INF|| res==0 )?-1:res)<<endl;
    return 0;
}

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

int main() {
    ll K, A, B; cin >> K >> A >> B;

    if (B == 1 || A + 2 >= B) {
        cout << K + 1 << endl;
        return 0;
    }

    ll cookie = 1, yen = 0;
    while (K > 0) {
        if (yen > 0) {
            cookie += B;
            yen--;
        } else if (cookie >= A && K > 1) {
            cookie -= A;
            yen++;
        } else {
            cookie++;
        }
        K--;
    }

    cout << cookie << endl;
    return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>

using namespace std;

const int N = 100'009;

vector<pair<int, int>> g[2][N];

const long long inf = 1'000'000'000'000'000'000;

int n;

vector<long long> get(int from, int w) {
  vector<long long> d(n, inf);
  d[from] = 0;
  set<pair<long long, int>> s;
  s.emplace(0, from);
  while (!s.empty()) {
    int x = s.begin()->second;
    s.erase(s.begin());
    for (auto &e : g[w][x]) {
      int y = e.first;
      int v = e.second;
      if (d[x] + v < d[y]) {
        if (d[y] != inf) {
          s.erase({d[y], y});
        }
        d[y] = d[x] + v;
        s.emplace(d[y], y);
      }
    }
  }
  return d;
}

int main() {
  int m, s, t;
  scanf("%d %d %d %d", &n, &m, &s, &t);
  --s;
  --t;
  for (int i = 0; i < n; ++i) {
    g[0][i].clear();
    g[1][i].clear();
  }
  for (int i = 0; i < m; ++i) {
    int x, y, v, w;
    scanf("%d %d %d %d", &x, &y, &v, &w);
    --x;
    --y;
    g[0][x].emplace_back(y, v);
    g[0][y].emplace_back(x, v);
    g[1][x].emplace_back(y, w);
    g[1][y].emplace_back(x, w);
  }
  vector<long long> ds = get(s, 0);
  vector<long long> dt = get(t, 1);
  vector<long long> ans(n);
  ans[n - 1] = ds[n - 1] + dt[n - 1];
  for (int i = n - 2; i >= 0; --i) {
    ans[i] = min(ds[i] + dt[i], ans[i + 1]);
  }
  long long have = 1'000'000'000'000'000;
  for (int i = 0; i < n; ++i) {
    printf("%lld\n", have - ans[i]);
  }
}


Measured memory_bytes: 17664
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <limits.h>
#include <iomanip>
#include <cassert>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define REP(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define Cout(x) cout << x << endl;
#define check(v) rep(i, v.size()) cout << v[i] << endl;
#define vint(x) vector<int> x
#define vll(x) vector<long long> x
#define vstr(x) vector<string> x
const long long LLINF = 1LL << 60;
const int INF = 1e9;
const long long MOD = 1000000007;
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;
}
typedef long long ll;
#define pint pair<int, int>
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int h, n;
    cin >> h >> n;
    int all = 0;
    rep(i, n)
    {
        int a;
        cin >> a;
        all += a;
    }
    if (all >= h)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n, m;
	scanf("%d%d", &n, &m);
	printf("%d\n", m % n == 0 ? m + n : m - n);
	
	Please AC;
}


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int A,B;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>A>>B;
	cout<<max({A+B,A-B,A*B})<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


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

int main(){
  double N;
  cin >>N;
  
  int ans = 1;
  rep(i,(int)N,0){
    double a = sqrt(i);
    int p = (int)a*a; 
    if(p==i){
      ans = p;
      break;
    }
  }
  
  cout <<ans<< endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using namespace boost;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

pair<ll, ll> trans(ll n, ll W){
    ll h = n / W;
    ll w = h % 2 == 0 ? n % W : W - (n % W + 1);
    return make_pair(h, w);
};


int main() {
    ll H, W;
    cin >> H >> W;
    ll N;
    cin >> N;
    vector<vector<ll>> map(H, vector<ll>(W, 0));
    ll n{0};
    for (auto &&i: boost::irange(0LL, N)){
        ll a;
        cin >> a;
        for (auto &&j: boost::irange(n, n+a)){
            ll h, w;
            tie(h, w) = trans(j, W);
            map.at(h).at(w) = i + 1;
        }
        n+=a;
    }
    for (auto &&h: boost::irange(0LL, H)){
        for (auto &&w: boost::irange(0LL, W)){
            cout << map.at(h).at(w) << " ";
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n;i>0;i--)
#define arep(a,i,n) for(int i=(a);i<(n);i++)
#define SORT(v) sort((v).begin(),(v).end())
const ll INF = (1LL << 50);
typedef pair<int, int> P;

int main() {

	string s;
	cin >> s;

	int n = s.size();
	vector<int>ans(n + 1, 0);

	int countR = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] == '<') countR++;
		else countR = 0;
		ans[i+1] = countR;
	}

	int countL = 0;
	for (int i = n - 1; i >= 0; i--) {
		if (s[i] == '>') countL++;
		else countL = 0;
		ans[i] = max(countL, ans[i]);
	}

	ll sum = 0;
	for (int i = 0; i <= n; i++) {
		sum += ans[i];
	}

	cout << sum << endl;



	return 0;

}

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

int main(){
	int N,K;
  	char S;
  	
  	cin >> N>>K;
  	for(int i = 0; i < N;i++){
      	cin >>S;
  	if(i == K-1){
  	
	  	std::locale l = std::locale::classic();

  		std::cout << std::tolower(S, l);
    }else{
      	cout << S;
     }
    }
  	cout <<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int prime[10000];
int main(){
	int count=0;
	int k=2;
	while(true){
		bool t=true;
		for(int i=0;i<count;i++){
			if(k%prime[i]==0)
				t=false;
		}
		if(t==true){
			prime[count]=k;
			count++;
		}
		k++;
		if(k==10000)
			break;
	}
	int n;
	while(true){
	cin>>n;
	if(n==0)
		break;
	k=n;
	while(true){
		bool up=false;
		for(int i=0;i<count;i++){
			if(prime[i]==k)
				up=true;
		}
		bool down=false;
		for(int i=0;i<count;i++){
			if(prime[i]==k-2)
				down=true;
		}
		if(up==true&&down==true)
			break;
		k--;
	}
	cout<<k-2<<" "<<k<<endl;
	}
	return 0;
}

Measured memory_bytes: 1168
import sys
ipts = sys.stdin.readlines()
keys = ipts[0][1:-1].split('.')

node = root = {}
for cur in xrange(1, len(ipts)):
    line = ipts[cur]
    indent = 0
    while line[indent] == ' ':
        indent += 1
    m = line[indent:]
    key, value = m.split(':')
    if ":i" not in node:
        node[":i"] = indent
    while indent < node[":i"]:
        node = node[":p"]
    if value == '\n':
        parent = node
        node[key] = node = {}
        node[":p"] = parent
    else:
        node[key] = value[1:-1]
    prev = indent
node = root
for key in keys:
    if type(node) == dict and key in node:
        node = node[key]
    else:
        print "no such property"
        break
else:
    if type(node) == dict:
        print "object"
    else:
        print "string \"%s\"" % node

Measured memory_bytes: 6596
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;

typedef long long ll;
//typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define revrep(i, n) for(ll i = n-1; i >= 0; i--)
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll Mypow(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}

ll INFL = 1LL << 60;//10^18 = 2^60
int INF = 1 << 30;//10^9
ll MOD  = 1000000007;
//vector<int> dy = {0,0,1,-1};
//vector<int> dx = {1,-1,0,0};


int main(){
  int N; cin >> N;
  int L; cin >> L;
  vector<int> A(N, L);
  rep(i, N){
    A[i] += i;
  }
  ll res;
  ll ans = INF;
  ll sum = 0;
  rep(i, N){
    sum += A[i];
  }
  ll min = INF;
  rep(i, N){
    if(abs(min) > abs(A[i])){
      min = A[i];
    }
  }
  cout << sum - min << endl;



}


Measured memory_bytes: 256
N, K = map(int, input().split())
MOD = 998244353

L = []
R = []
for i in range(K):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)

dp = [0] * (N + 1)
dp[1] = 1
dp_sum = [0] * (N + 1)
dp_sum[1] = 1
for i in range(2, N + 1):
    for j in range(K):
        li = max(i - R[j], 1)
        ri = i - L[j]
        if ri < 1:
            continue
        dp[i] += (dp_sum[ri] - dp_sum[li - 1]) % MOD
    dp_sum[i] = (dp_sum[i - 1] + dp[i]) % MOD

print(dp[-1] % MOD)


Measured memory_bytes: 77040
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

#define MAXK 100000
int M[MAXK][10];

int main() {
    int K; cin >> K;
    memset(M, 0, sizeof(int) * K * 10);
    using pii = pair<int,int>;
    deque<pii> D;
    M[1][1] = 1;
    D.push_back({1,1});

    while (!D.empty()) {
        auto [modk, low] = D.front(); D.pop_front();
        int x10 = modk * 10 % K;
        if (M[x10][low] == 0) {
            M[x10][low] = M[modk][low];
            D.push_front({x10, low});
        }

        int p1 = (modk + 1) % K;
        int sec = (low + 1) % 10;
        if (M[p1][sec] == 0) {
            M[p1][sec] = M[modk][low] + 1;
            D.push_back({p1,sec});
        }
    }

    int mi = INT32_MAX;
    rep(i, 10) if (M[0][i] < mi) mi = M[0][i];
    cout << mi << endl;
}


Measured memory_bytes: 8348
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

char a[55][55] , b[55][55];
int n , m ;

bool ok(int x,int y){

for(int i=0;i<m;i++)
    for(int j=0;j<m;j++)
        if( a[i+x][j+y] != b[i][j] )
            return 0;
return 1;
}

int main(){

cin>>n>>m;
for(int i=0;i<n;i++)for(int j=0;j<n;j++)cin>>a[i][j];
for(int i=0;i<m;i++)for(int j=0;j<m;j++)cin>>b[i][j];

for(int i=0;i+m<=n;i++)
    for(int j=0;j+m<=n;j++)
if( ok(i,j) ){
    cout<<"Yes"<<endl;return 0;
}
cout<<"No"<<endl;
return 0;
}


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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ll long long

using namespace std;

int main(){
  vector<string> d = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
  
  string s;
  cin>>s;
  rep(i,d.size()){
    if(s==d[i]){
      cout<<7-i;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
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; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll x,y;
  cin>>x>>y;
  rep(i,x+1){
    if(i*2+4*(x-i)==y){
      COUT("Yes");
      return 0;
    }
  }
  COUT("No");
}

Measured memory_bytes: 3624
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define ALL(x) (x).begin(),(x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)

int main() {
  int N, X; cin >> N >> X;
  vector<int> L;
  rep(i,N){
    int l; cin >> l;
    L.push_back(l);
  }
  int cnt = 0;
  int sum = 0;
  while((sum <= X)&&(cnt<N+1)){
    sum += L[cnt];
    cnt++;
  }

  cout << cnt << endl;


  return 0;
}


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

int main(){
    ll a, b; cin >> a >> b;
    ll tmp1, n;
    while(true){
        tmp1 = a;
        a = b;
        b = tmp1 % b;
        if(b == 0){
            n = a;
            break;
        }
    }

    ll ans = 1, cnt = 0;
    while(n%2 == 0){
        cnt = 1;
        n /= 2;
    }
    ans += cnt;
    for (ll i = 3; i*i <= n; i+=2) {
        cnt = 0;
		while (n%i == 0) {
			cnt = 1;
            n /= i;
        }
        ans += cnt;
      	if(n == 1) break;
	}
    if(n != 1) ans++;

    cout << ans << endl;
}


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

int main() {
  int a, b; cin >> a >> b;
  int diff = b - a;
  
  int stone = 0;
  for (int i = 1; i <= diff; i++) stone += i;
  
  int snow = stone - b;
  
  cout << snow << endl;
}

Measured memory_bytes: 256