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

#define fast ios::sync_with_stdio(false);cin.tie(0); cout.tie(0);
#define pb push_back
#define sz(s) (int)s.size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i,n) for(int i=0;i<(int)n;i++)
#define for1(i,n) for(int i=1;i<=(int)n;i++)
#define ford(i, b, a) for (int i = (int)(b); i >= a; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
const ll N = (ll)1e5+77;
const ll inf = (ll) 1e16+7;
const ll mod = (ll) 998244353;
const ld pi = acos(-1);

int main() {
    fast;
    int a[5] = {0}, x, y;
    forn(i, 3) {
        cin >> x >> y;
        a[x]++;
        a[y]++;
    }
    int odd = 0;
    for1(i, 4) {
        if (a[i] & 1) ++odd;
    }
    if (odd == 2) cout << "YES\n";
    else cout << "NO\n";
    return 0;
}

Measured memory_bytes: 256
/**-------------------------
|--------From A.R.A--------|
-------------------------**/

#include <bits/stdc++.h>

#define ll            long long int
#define pb            push_back
#define ull           unsigned long long int
#define endl          "\n"
#define sz(c)         (c).size()
#define sall(c)       sort((c).begin(),(c).end())
#define rsall(c)      sort((c).rbegin(),(c).rend())
#define rev(c)        reverse((c).begin(),(c).end())
#define FOR(i,n)      for(ll i=0;i<n;i++)
#define max3(a,b,c)   max(max(a,b),c)
#define min3(a,b,c)   min(min(a,b),c)
#define input(a,i,n)  for(ll i=0;i<n;i++){      cin>>a[i];}
#define output(a,i,n) for(ll i=0;i<n;i++){cout<<a[i]<<" ";}

using namespace std;
int64_t R=1;
void solution(){
    int64_t n;
    cin>>n;
    if(n==0){cout<<"1"<<endl;}
    else{cout<<"0"<<endl;}
}
int main()
{
    FOR(i,R){solution();}
    return 0;
}


Measured memory_bytes: 3632
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-04-02 22:45:03
*/

#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(),(x).end()
#define rev(x) greater<(x)>()
#define MOD 1000000007
#define INF 1000000000

typedef long long LL;
typedef long double LD;

bool compare_by_b(pair<int, int> a, pair<int, int> b)
{
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

LL modpower(LL n, LL m, LL mod) {
    if (m == 0) {
        return 1;
    } else if (m % 2 == 0) {
        LL p = modpower(n, m/2, mod);
        return p*p % mod;
    } else {
        return n*modpower(n, m-1, mod) % mod;
    }
}

LL modinv(LL n, LL mod) {
    return modpower(n, mod-2, mod);
}

LL modcombination(LL n, LL r, LL mod) {
    LL ret = 1;

    for (int i = 0; i < r; i++) {
        ret *= (n-i);
        ret %= mod;
        ret *= modinv(i+1, mod);
        ret % mod;
    }

    return ret % mod;
}

int gcd(int k, int l) {
    if (l > 0) return gcd(l, k%l);
    else return k;
}

ostringstream oss_global;
string s_global = oss_global.str();

int main()
{
    string s;
    cin >> s;

    int p, n;
    p = n = 0;
    for (int i = 0; i < 4; i++) {
        if (s[i] == '+') p++;
        if (s[i] == '-') n++;
    }

    cout << p - n << endl;

    return 0;
}


Measured memory_bytes: 256
(defun take-m (m lst)
  (let ((threshold (/ (apply #'+ lst) (* 4 m)))
        (new-lst (sort (copy-list lst) #'>)))
       (if (<= threshold (nth (1- m) new-lst))
           (format t "Yes")
           (format t "No"))))

(let* ((n (read))
       (m (read))
       (lst (loop for i from 0 below n collect (read))))
      (take-m m lst))

Measured memory_bytes: 13920
//Mir_123
//Credits:- Shashank Keshav
/*Life begins beyond your comfort zone*/
/*Either solve hard questions
  or else don't solve any question*/
#include<bits/stdc++.h>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<iterator>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define bin binary_search
#define vmin *min_element
#define vmax *max_element
bool cmp_sec(pair<ll,ll> &a,pair<ll,ll> &b)
{
  if(a.second!=b.second)
    return a.second<b.second;
  return a.first<b.first;
}
//Use set if your want your array to be auto sorted
//sort takes log(N) time
struct item
{
  ll w,v;
};
int main(void)
{
  ll n,mw,i,j;
  cin>>n>>mw;
  vector<item>vec(n);
  for(i=0;i<n;i++)  cin>>vec[i].w>>vec[i].v;
  vector<ll>dp(mw+1,0);
  for(i=0;i<n;i++)
  {
    for(j=mw-vec[i].w;j>=0;j--)
    {
      dp[j+vec[i].w]=max(dp[j+vec[i].w],dp[j]+vec[i].v);
    }
  }
  cout<<vmax(dp.begin(),dp.end());
  return 0;
}


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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define llbidx(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y) // 二要素間の距離
#define deg2rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad2deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)
#define Find(set, element) set.find(element) != set.end()
#define Decimal(x) printf("%.10f\n", x) // 小数点を10桁まで表示
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << "\n";
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define endl "\n"
// gcj print用
#define Case(x) printf("Case #%d: ", x);

typedef pair<int, int> PI;
typedef pair<ll, ll> PLL;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<int>>> vvvl;
typedef vector<PI> vpi;
typedef vector<vector<PI>> vvpi;
typedef vector<vector<vector<PI>>> vvvpi;
typedef vector<PLL> vpl;
typedef vector<vector<PLL>> vvpl;
typedef vector<vector<vector<PLL>>> vvvpl;

int POWINT(int x, int n) {
  int ret = 1;
  while (n > 0) {
    if (n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
};

ll POWLL(ll x, int n) {
  ll ret = 1;
  while (n > 0) {
    if (n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
};

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;
};

void print() {
  cout << endl;
}

template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
    cout << a;
    if (&a != &vec.back()) cout << " ";
  }
  cout << endl;
}

template <class T>
void print(vector<T> &vec, ll k){
   ll n = vec.size();
   k = min(k, n);
   rep(i, 0, k-1) cout << vec[i] << " ";
   cout << vec[k-1] << endl;
}

template <class T>
void print(vector<vector<T>> &df) {
  for (auto& vec : df) {
    print(vec);
  }
}

template<class T, class U>
void print(pair<T,U> &p){
  cout << p.first << " " << p.second << "\n";
}

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

  int A, B, C, K;
  cin >> A >> B >> C >> K;
  if (K <= A) {
    cout << K << endl;
  } else if (K <= A + B) {
    cout << A << endl;
  } else {
    int ans = A;
    int m = K - (A + B);
    ans -= m;
    cout << ans << endl;
  }

  return 0;
};


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

int main() {
  int n, k, d, ans;
  cin >> n >> k;

  map<int, int> p;
  for (int i = 0; i < k; i++) {
    cin >> d;
    p[d]++;
  }

  ans = n;
  while (1) {
    bool ok = true;
    for (int i = (int)log10(ans); i >= 0; i--) {
      int x = (ans % (int)pow(10, i + 1)) / (int)pow(10, i);
      if (p.count(x)) {
        ok = false;
        break;
      }
    }
    if (ok) {
      cout << ans << endl;
      return 0;
    } else
      ans++;
  }
}

Measured memory_bytes: 384
//#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

//うーん

void pakuri_sort(int N, int A[]) {
	const int b = 8;
	int tmp[1 << 18];
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
	}
}

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint();
	int n = (1 << N);
	int S[1 << 18];
	rep(i, (1 << N)) {
		S[i] = getint();
	}
	pakuri_sort(n, S);
	int A[1 << 17];
	A[0] = S[n - 1];
	int OK = 1;
	rep(i, N - 1) {
		int p = n - 1;
		for (int j = (1 << i) - 1; j >= 0; j--) {
			while (p >= 0 && S[p] >= A[j]) p--;
			if (p < 0) {
				OK = 0;
				break;
			}
			A[j + (1 << i)] = S[p];
			S[p] = 1e9;
			p--;
		}
		if (!OK) break;
		pakuri_sort(1 << (i + 1), A);
	}
	int i = N - 1;
	int p = n - 1;
	for (int j = (1 << i) - 1; j >= 0; j--) {
		while (p >= 0 && S[p] >= A[j]) p--;
		if (p < 0) {
			OK = 0;
			break;
		}
		S[p] = 1e9;
		p--;
	}

	if (OK) printf("Yes");
	else printf("No");

	Would you please return 0;
}

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

#define N 100005

using namespace std;

int a,b,k;

template<typename Drake>
void read(Drake &x){
	x=0;char ch=getchar();bool f=1;
	while(!isdigit(ch)){
		if(ch=='-')f^=1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	x*=(2*f-1);
}

template<typename Drake>
void write(Drake x){
	if(x<0){x=-x;putchar('-');}
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

template<typename Drake>
void writeln(Drake x){
	write(x);
	puts("");
}

void init(){
	read(a);read(b);read(k);
}

int main(){
	init();
	if(b-a+1<k*2){
		for(register int i=a;i<=b;i++)
		cout<<i<<endl;
	}
	else {
		for(register int i=a;i<=a+k-1;i++)
		cout<<i<<endl;
		for(register int i=b-k+1;i<=b;i++)
		cout<<i<<endl;
	}
	return 0;
}

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


using namespace std;
#define ll long long
#define ld long double
#define  P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,m,n) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cout(n) cout<<fixed<<setprecision(n)

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

    ll a,b;
    cin>>a>>b;
    if(a>=13)cout<<b<<endl;
    else if(a>=6)cout<<b/2<<endl;
    else cout<<0<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
    double x1,y1,x2,y2,a,b,c;
    cin>>x1>>y1>>x2>>y2;
    a = x1 - x2;
    b = y1 - y2;
    c = sqrt(a*a + b*b);
    cout<<fixed;
    cout<<setprecision(8);
    cout<<c;
}


Measured memory_bytes: 3300
import java.io.*;
import java.util.*;
public class Main
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
 
    public static void main(String[] args)
    {
        FastReader in=new FastReader();
        String s=in.next();
        String t=in.next();
        int l=s.length(), lt=t.length();
        boolean flag=false, flag2;
        int i;
        SortedSet<String> a=new TreeSet<String>();
        String temp = "";
        for(i=0; i<=l-lt; i++)
        {
        	flag2=true;
        	for(int j=0; j<lt; j++)
        	{
        		if((s.charAt(i+j)!=t.charAt(j))&&s.charAt(i+j)!='?')
        			flag2=false;
        	}
        	if(flag2)
        	{
        		
        		flag=true;
        		if(i!=0)
        			temp=s.substring(0, i)+t+s.substring(i+lt, l);
        		if(i==0)
        			temp=t+s.substring(i+lt, l);
        		
        		//System.out.println(temp);
        		a.add(temp);
        	}
        }
        Iterator<String> it=a.iterator();
        char[] b = null;
        if(it.hasNext())
        {
        	temp=it.next();
        	//System.out.println(temp.length());
        	b= temp.toCharArray();
        for(int j=0; j<l; j++)
        {
        	if(b[j]=='?')
        		b[j]='a';
        }
        }
        if(!flag)
        	System.out.println("UNRESTORABLE");
        else
        	System.out.println(b);
    }
}

Measured memory_bytes: 21332
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
//cout << fixed << setprecision(10);

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; }

int dp[100020];

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

  dp[0] = 1;
  rep(i,100020) {
    if (dp[i] == 0) continue;
    for (int j = 100; j <= 105; ++j) {
      dp[i+j] = dp[i];
    }
  }
  cout << dp[x] << endl;
  return 0;
}

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

typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define le length()
#define mp make_pair
#define mt make_tuple
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second
#define INF lli(1e19)

#define forz(i, n) for (lli i = 0; i < n; i++)
#define fore(i, m, n) for (lli i = m; i < n; i++)
#define rforz(i, n) for (lli i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (lli i = n - 1; i >= m; i--)
#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define gcd __gcd
#define kira ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define newline cout<<endl;
//#define endl "\n"



inline lli power(lli x, lli y, lli p = mod)
{
    lli res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

inline lli modadd(lli a, lli b, lli m = mod)
{
    a += b;
    if (a >= m)
        a -= m;
    return a;
}

inline lli modmul(lli a, lli b, lli m = mod)
{
    return ((a % m) * (b % m)) % m;
}

inline lli modi(lli a, lli m = mod) { return power(a, m - 2, m); }
inline lli md(lli x) {if(x>=0)return x; return -x;}
///////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
lli n,m,k,r;
//lli u, v;
//bool vis[3030];
//vector<lli> adj[3030];
//void init()
//{
//    forz(i,n) vis[i]=0, adj[i].clear();
//}


int32_t main()
{
    kira;

    lli T=1;
    //cin>>T;

    while(T--)
    {
        cin>>n>>m>>k;
        cout<<k*(n/m+!!(n%m))<<endl;

    }

    return 0;

}


Measured memory_bytes: 3648
#include <math.h>

#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>

using namespace std;

int main() {
  int D, N; cin >> D >> N;
  int d=1;
  for(int i=0; i<D; ++i) d*=100;
  if(N != 100) {
    cout << N*d << endl;
  } else {
    cout << (N+1)*d << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#define ll long long
#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 dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
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; }

using namespace std;

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

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

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

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        a: usize,
        b: usize
    }
    if a < 10 && b < 10 {
        println!("{}", a * b);
    } else {
        println!("-1")
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
string s;
vector<int> v;
int main(){ 

int ans =700;
cin>>s ;
int cnt =0;
for(int i=0;i <3;i ++){
if(s [i]=='o')cnt++;
}
ans+=100*cnt;
cout<<ans<<endl;
return 0;
}


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

using namespace std;

int main(){
	int a, b;

	scanf("%d%d", &a, &b);

	if (a % 2 == 0 or b % 2 == 0){
		printf("No\n");
	}
	else{
		printf("Yes\n");
	}

	return 0;
}

Measured memory_bytes: 256
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
# from math import gcd
from functools import lru_cache
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
a=list(map(int,input().split()))

lst=[0]*3
for i in range(n):
    lst[a[i]-1]+=1

dp=[[[0.0]*310 for i in range(310)] for j in range(310)]

for k in range(lst[2]+1):
    for j in range(lst[1]+lst[2]+1-k):
        for i in range(lst[0]+lst[1]+lst[2]+1-k-j):
            if i==j==k==0:
                continue
            tmp=1.0
            if i>0:
                tmp+=dp[i-1][j][k]*i/n
            if j>0:
                tmp+=dp[i+1][j-1][k]*j/n
            if k>0:
                tmp+=dp[i][j+1][k-1]*k/n
            
            tmp*=n/(i+j+k)

            dp[i][j][k]=tmp

print(dp[lst[0]][lst[1]][lst[2]])

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

int main(){
  int n,m;
  cin>>n>>m;
  vector<string> a(n),b(m);
  for(int i=0; i<n; i++)cin>>a[i];
  for(int i=0; i<m; i++)cin>>b[i];

  bool ans=false;
  for(int i=0; i<=n-m; i++){
    for(int j=0; j<=n-m; j++){
      bool eq=true;
      for(int k=0; k<m; k++){
        if(a[i+k].substr(j,m)!=b[k]){
          eq=false;
          break;
        }
      }
      if(eq){
        ans=true;
        break;
      }
    }
  }

  if(ans)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 256
import re
a,b = input().strip().split(" ")
a = int(a)
b = int(b)
s = str(input()).strip()
s_pattern='^[0-9]{{{a}}}-[0-9]{{{b}}}$'.format(a=a,b=b)
pattern = re.compile(s_pattern)
m = pattern.match(s)
if m:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3188
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pi> vpi;
typedef vector<vi> vvi;
const int inf = 0x3f3f3f3f;
const ll linf = 1234567890123456789;
const ll mod = 998244353;
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " = " << x << endl
#define sz(x) ((int)(x).size())

int h, w;
vector<string> s;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    cin >> h >> w;
    s = vector<string>(h);
    for(int i = 0; i < h; i++) cin >> s[i];
    priority_queue<tuple<int, int, int>> pq;
    pq.emplace(0-(s[0][0]=='#'), 0, 0);
    vvi visited(h, vi(w));
    while(sz(pq)){
        int dist, r, c;
        tie(dist, r, c) = pq.top();
        pq.pop();
        if(visited[r][c]) continue;
        visited[r][c] = 1;
        if(r == h-1 && c == w-1){
            cout << -dist << endl;
            return 0;
        }
        if(r != h-1) pq.emplace(dist-(s[r+1][c] != s[r][c] && s[r][c]=='.'), r+1, c);
        if(c != w-1) pq.emplace(dist-(s[r][c+1] != s[r][c] && s[r][c]=='.'), r, c+1);
    }
}

Measured memory_bytes: 384
#include <algorithm>
#include <cmath>
#include <vector>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <ctype.h>
#include <climits>
#include <queue>
using namespace std;
#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
typedef long long ll;

int main(){
	
	int l,r,d;
	cin >> l >> r >> d;
	
	int ans=0;
	int i=l;
	while(i<=r){
		if(i%d==0) ans++;
		i++;
	}
	
	cout << ans <<endl;
	
	
	
	return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define PI 3.141592653589
#define ll long long
using namespace std;

template<typename T_char>
T_char ToUpper(T_char cX){return toupper(cX);}

int main(){
  int n;
  string s;
  cin >> n >> s;
  int x=0, mx =0;
  for(int i=0; i<n; ++i){
    if(s[i]=='I') ++x;
    else --x;
    mx = max(mx, x);
  }

  cout << mx << endl;
  return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(N: int, T: "List[int]", M: int, P: "List[int]", X: "List[int]"):
    sm = sum(T)
    for i in range(M):
        p = P[i]
        x = X[i]
        print(sm - T[p-1] + x)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    M = int(next(tokens))  # type: int
    P = [int()] * (M)  # type: "List[int]" 
    X = [int()] * (M)  # type: "List[int]" 
    for i in range(M):
        P[i] = int(next(tokens))
        X[i] = int(next(tokens))
    solve(N, T, M, P, X)

if __name__ == '__main__':
    main()


Measured memory_bytes: 5052
N = int(input())

Z = [list(map(int,input().split())) for a in range(N)]


def solve():
    former = [0,0,0]
    for a in Z:
        distance = abs(a[1]-former[1])+abs(a[2]-former[2])
        if distance > a[0] - former[0]:
            print("No")
            return
        if (a[0]-former[0]) % 2 != distance % 2:
            print("No")
            return
        former = a
    print("Yes")

solve()



Measured memory_bytes: 27380
/*
⣿⣿⣿⣿⣿⣿⡷⣯⢿⣿⣷⣻⢯⣿⡽⣻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠸⣿⣿⣆⠹⣿⣿⢾⣟⣯⣿⣿⣿⣿⣿⣿⣽⣻⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣻⣽⡿⣿⣎⠙⣿⣞⣷⡌⢻⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⡄⠹⣿⣿⡆⠻⣿⣟⣯⡿⣽⡿⣿⣿⣿⣿⣽⡷⣯⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣟⣷⣿⣿⣿⡀⠹⣟⣾⣟⣆⠹⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢠⡘⣿⣿⡄⠉⢿⣿⣽⡷⣿⣻⣿⣿⣿⣿⡝⣷⣯⢿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣯⢿⣾⢿⣿⡄⢄⠘⢿⣞⡿⣧⡈⢷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢸⣧⠘⣿⣷⠈⣦⠙⢿⣽⣷⣻⣽⣿⣿⣿⣿⣌⢿⣯⢿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣟⣯⣿⢿⣿⡆⢸⡷⡈⢻⡽⣷⡷⡄⠻⣽⣿⣿⡿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣏⢰⣯⢷⠈⣿⡆⢹⢷⡌⠻⡾⢋⣱⣯⣿⣿⣿⣿⡆⢻⡿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⡎⣿⢾⡿⣿⡆⢸⣽⢻⣄⠹⣷⣟⣿⣄⠹⣟⣿⣿⣟⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⢸⣯⣟⣧⠘⣷⠈⡯⠛⢀⡐⢾⣟⣷⣻⣿⣿⣿⡿⡌⢿⣻⣿⣿
⣿⣿⣿⣿⣿⣿⣧⢸⡿⣟⣿⡇⢸⣯⣟⣮⢧⡈⢿⣞⡿⣦⠘⠏⣹⣿⣽⢿⣿⣿⣿⣿⣯⣿⣿⣿⡇⢸⣿⣿⣾⡆⠹⢀⣠⣾⣟⣷⡈⢿⣞⣯⢿⣿⣿⣿⢷⠘⣯⣿⣿
⣿⣿⣿⣿⣿⣿⣿⡈⣿⢿⣽⡇⠘⠛⠛⠛⠓⠓⠈⠛⠛⠟⠇⢀⢿⣻⣿⣯⢿⣿⣿⣿⣷⢿⣿⣿⠁⣾⣿⣿⣿⣧⡄⠇⣹⣿⣾⣯⣿⡄⠻⣽⣯⢿⣻⣿⣿⡇⢹⣾⣿
⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⡽⡇⢸⣿⣿⣿⣿⣿⣞⣆⠰⣶⣶⡄⢀⢻⡿⣯⣿⡽⣿⣿⣿⢯⣟⡿⢀⣿⣿⣿⣿⣿⣧⠐⣸⣿⣿⣷⣿⣿⣆⠹⣯⣿⣻⣿⣿⣿⢀⣿⢿
⣿⣿⣿⣿⣿⣿⣿⣿⠘⣯⡿⡇⢸⣿⣿⣿⣿⣿⣿⣿⣧⡈⢿⣳⠘⡄⠻⣿⢾⣽⣟⡿⣿⢯⣿⡇⢸⣿⣿⣿⣿⣿⣿⡀⢾⣿⣿⣿⣿⣿⣿⣆⠹⣾⣷⣻⣿⡿⡇⢸⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡇⢹⣿⠇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠻⡇⢹⣆⠹⣟⣾⣽⣻⣟⣿⣽⠁⣾⣿⣿⣿⣿⣿⣿⣇⣿⣿⠿⠛⠛⠉⠙⠋⢀⠁⢘⣯⣿⣿⣧⠘⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡈⣿⡃⢼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡙⠌⣿⣆⠘⣿⣞⡿⣞⡿⡞⢠⣿⣿⣿⣿⣿⡿⠛⠉⠁⢀⣀⣠⣤⣤⣶⣶⣶⡆⢻⣽⣞⡿⣷⠈⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠘⠁⠉⠉⠉⠉⠉⠉⠉⠉⠉⠙⠛⠛⢿⣄⢻⣿⣧⠘⢯⣟⡿⣽⠁⣾⣿⣿⣿⣿⣿⡃⢀⢀⠘⠛⠿⢿⣻⣟⣯⣽⣻⣵⡀⢿⣯⣟⣿⢀⣿
⣿⣿⣿⣟⣿⣿⣿⣿⣶⣶⡆⢀⣿⣾⣿⣾⣷⣿⣶⠿⠚⠉⢀⢀⣤⣿⣷⣿⣿⣷⡈⢿⣻⢃⣼⣿⣿⣿⣿⣻⣿⣿⣿⡶⣦⣤⣄⣀⡀⠉⠛⠛⠷⣯⣳⠈⣾⡽⣾⢀⣿
⣿⢿⣿⣿⣻⣿⣿⣿⣿⣿⡿⠐⣿⣿⣿⣿⠿⠋⠁⢀⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣌⣥⣾⡿⣿⣿⣷⣿⣿⢿⣷⣿⣿⣟⣾⣽⣳⢯⣟⣶⣦⣤⡾⣟⣦⠘⣿⢾⡁⢺
⣿⣻⣿⣿⡷⣿⣿⣿⣿⣿⡗⣦⠸⡿⠋⠁⢀⢀⣠⣴⢿⣿⣽⣻⢽⣾⣟⣷⣿⣟⣿⣿⣿⣳⠿⣵⣧⣼⣿⣿⣿⣿⣿⣾⣿⣿⣿⣿⣿⣽⣳⣯⣿⣿⣿⣽⢀⢷⣻⠄⠘
⣿⢷⣻⣿⣿⣷⣻⣿⣿⣿⡷⠛⣁⢀⣀⣤⣶⣿⣛⡿⣿⣮⣽⡻⣿⣮⣽⣻⢯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⢀⢸⣿⢀⡆
⠸⣟⣯⣿⣿⣷⢿⣽⣿⣿⣷⣿⣷⣆⠹⣿⣶⣯⠿⣿⣶⣟⣻⢿⣷⣽⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢀⣯⣟⢀⡇
⣇⠹⣟⣾⣻⣿⣿⢾⡽⣿⣿⣿⣿⣿⣆⢹⣶⣿⣻⣷⣯⣟⣿⣿⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢀⡿⡇⢸⡇
⣿⣆⠹⣷⡻⣽⣿⣯⢿⣽⣻⣿⣿⣿⣿⣆⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⢸⣿⠇⣼⡇
⡙⠾⣆⠹⣿⣦⠛⣿⢯⣷⢿⡽⣿⣿⣿⣿⣆⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠎⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⢀⣿⣾⣣⡿⡇
⣿⣷⡌⢦⠙⣿⣿⣌⠻⣽⢯⣿⣽⣻⣿⣿⣿⣧⠩⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⢰⢣⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⢀⢀⢿⣞⣷⢿⡇
⣿⣽⣆⠹⣧⠘⣿⣿⡷⣌⠙⢷⣯⡷⣟⣿⣿⣿⣷⡀⡹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣈⠃⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢀⣴⡧⢀⠸⣿⡽⣿⢀
⢻⣽⣿⡄⢻⣷⡈⢿⣿⣿⢧⢀⠙⢿⣻⡾⣽⣻⣿⣿⣄⠌⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠛⢁⣰⣾⣟⡿⢀⡄⢿⣟⣿⢀
⡄⢿⣿⣷⢀⠹⣟⣆⠻⣿⣿⣆⢀⣀⠉⠻⣿⡽⣯⣿⣿⣷⣈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⢀⣠⠘⣯⣷⣿⡟⢀⢆⠸⣿⡟⢸
⣷⡈⢿⣿⣇⢱⡘⢿⣷⣬⣙⠿⣧⠘⣆⢀⠈⠻⣷⣟⣾⢿⣿⣆⠹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⣠⡞⢡⣿⢀⣿⣿⣿⠇⡄⢸⡄⢻⡇⣼
⣿⣷⡈⢿⣿⡆⢣⡀⠙⢾⣟⣿⣿⣷⡈⠂⠘⣦⡈⠿⣯⣿⢾⣿⣆⠙⠻⠿⠿⠿⠿⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⢋⣠⣾⡟⢠⣿⣿⢀⣿⣿⡟⢠⣿⢈⣧⠘⢠⣿
⣿⣿⣿⣄⠻⣿⡄⢳⡄⢆⡙⠾⣽⣿⣿⣆⡀⢹⡷⣄⠙⢿⣿⡾⣿⣆⢀⡀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⣀⣠⣴⡿⣯⠏⣠⣿⣿⡏⢸⣿⡿⢁⣿⣿⢀⣿⠆⢸⣿
⣿⣿⣿⣿⣦⡙⣿⣆⢻⡌⢿⣶⢤⣉⣙⣿⣷⡀⠙⠽⠷⠄⠹⣿⣟⣿⣆⢙⣋⣤⣤⣤⣄⣀⢀⢀⢀⢀⣾⣿⣟⡷⣯⡿⢃⣼⣿⣿⣿⠇⣼⡟⣡⣿⣿⣿⢀⡿⢠⠈⣿
⣿⣿⣿⣿⣿⣷⣮⣿⣿⣿⡌⠁⢤⣤⣤⣤⣬⣭⣴⣶⣶⣶⣆⠈⢻⣿⣿⣆⢻⣿⣿⣿⣿⣿⣿⣷⣶⣤⣌⣉⡘⠛⠻⠶⣿⣿⣿⣿⡟⣰⣫⣴⣿⣿⣿⣿⠄⣷⣿⣿⣿
*/


#include <bits/stdc++.h>
using namespace std;


int main()
{
    long n;
    cin >> n;
    long ans = 0;
    ans += (n / 500) * 1000;
    n -= (500 * (n/500));
    ans += (n / 5)*5;
    cout << ans << endl;
    return 0;
}


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

#define yes "yes"
#define Yes "Yes"
#define no "no"
#define No "No"

namespace mydef
{
  void say(string some){
    cout << some << "\n";
  }
} // namespace mydef
using namespace mydef;
using P = pair<int,int>;
typedef long long ll;
const int INF = 1001001001;
const long double PI=3.14159265358979323846;

//ここから書く

signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
  int n, x, t;
  cin >> n >> x >> t;

  int m = (n+x-1)/x;
  cout << m*t << "\n";

  return 0;
}




Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<n; i++)
#define pb push_back
#define int long long
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
const int MOD = 1000000007;

string S;
int Aacc[100100];
int Cacc[100100];
int Qacc[100100];

int mod_pow(int x, int n) {
    int res = 1;
    while (n>0) {
        if (n&1) res = res*x%MOD;
        x = x*x%MOD;
        n >>= 1;
    }
    return res;
}

signed main() {
    cin >> S;
    int N = S.size();
    rep(i, N) {
        if (S[i]=='A') Aacc[i+1] = Aacc[i]+1;
        else Aacc[i+1] = Aacc[i];
    }
    rep(i, N) {
        if (S[i]=='C') Cacc[i+1] = Cacc[i]+1;
        else Cacc[i+1] = Cacc[i];
    }
    rep(i, N) {
        if (S[i]=='?') Qacc[i+1] = Qacc[i]+1;
        else Qacc[i+1] = Qacc[i];
    }
    
    int ans = 0;
    rep(i, N) {
        if (S[i]=='B' or S[i]=='?') {
            int A = Aacc[i];
            int C = Cacc[N]-Cacc[i+1];
            int lQ = Qacc[i];
            int rQ = Qacc[N]-Qacc[i+1];
            ans += A*C*mod_pow(3, lQ+rQ);
            ans %= MOD;
            ans += A*rQ*mod_pow(3, lQ+rQ-1);
            ans %= MOD;
            ans += lQ*C*mod_pow(3, lQ+rQ-1);
            ans %= MOD;
            ans += lQ*rQ*mod_pow(3, lQ+rQ-2);
            ans %= MOD;
        }
    }
    cout << ans << endl;
}

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

#define endl '\n'
#define pb push_back
#define fi(a,b) for(i=a;i<=b;i++)
#define fj(a,b) for(j=a;j<=b;j++)
#define elif else if
#define ll  long long
#define vi vector<int>
#define vl vector<long long>
#define ii pair<int,int>
#define vii vector<ii>
#define ff first
#define ss second
#define speed() ios_base::sync_with_stdio(false); cin.tie(NULL);
#define mod 1000000007
#define PI 3.14159265358979323846
#define N 1000001



int main()
{
    int t=1;
    //cin>>t;
    while(t--)
    {
        int i,j,ans=0;
        string a,b;
        cin>>a>>b;
        int n = (int)a.size();
        int m = (int)b.size();

        for(i=0;i<=n-m;i++)
        {
            int cnt=0;
            for(j=0;j<m;j++)
            {
                if(a[i+j]==b[j])  cnt++;
            }
            ans = max(ans,cnt);
        }

        cout<<m-ans;
    }
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod=1000000007;
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);
int main()
{
    IO
    ll n,k;
    cin>>n>>k;
    ll a[n+1];
    for(ll i=1;i<=n+1;i++)
    a[i]=i-1;
    ll pre[n+2],suff[n+2];
    pre[1]=0;
    for(ll i=2;i<=n+1;i++)
    {
        pre[i]=(pre[i-1]+a[i]);
    }
    suff[1]=n;
    for(ll i=n;i>=1;i--)
    {
        suff[n-i+2]=suff[n-i+1]+a[i];
    }
    ll sum=0;
    for(ll i=k;i<=n+1;i++)
    {
        ll ans=(suff[i]-pre[i]+1);
        sum=(sum+ans)%mod;
    }
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 8328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end(), greater<ll>());
    ll ans = A[0];
    int idx = 1;
    for (int i = 2; i < N; i++) {
        ans += A[idx];
        if (i % 2 == 1) idx++;
    }
    cout << ans << "\n";
    return 0;
}

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

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

    int ans = 100;
    for (int i = 0; i < N; i++) {
        int A;
        cin >> A;
        int cnt = 0;
        while (A % 2 == 0) {
            A = A / 2;
            cnt += 1;
        }
        ans = min(ans, cnt);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3576
A = int(input())
B = int(input())
C = int(input())
X = int(input())
result = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            Sum = (500 * i) + (100 * j) + (50 * k)
            if Sum == X:
                result += 1
print(result)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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 ll INF = 1LL << 60;
const int MAX = 1000000010;

int main() {
    string s; 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
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
#define all(v) v.begin(), v.end()
const int inf = 1000000000; //10^9
using ll = long long;
using P = pair<int, int>;
//加算代入演算子は+=！！！！！

int main()
{
    ll a, b, x, c;
    cin >> a >> b >> x;
    c = b / x - a / x; //答えはa以上b以下だけどこの式だとaが含まれない
    if (a % x != 0) //aがxで割り切れないときはそのままでいいけど
    {
        cout << c << endl;
    }
    else //aがxで割り切れる場合は、+1しなきゃいけない
    {
        cout << c + 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


vector<int> manacher(string s){
  int n=s.size();
  vector<int> v(n);
  for(int i=0,j=0;i<n;){
    while(i-j>=0&&i+j<n&&s[i-j]==s[i+j]) j++;
    v[i]=j;
    int k=1;
    while(i-k>=0&&i+k<n&&k+v[i-k]<j) v[i+k]=v[i-k],k++;
    i+=k;j-=k;
  }
  return v;
}


template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}

//INSERT ABOVE HERE
signed main(){
  int n;
  cin>>n;
  string t;
  cin>>t;
  auto ms=manacher(t);

  for(int l=2;l<=n;l++){
    int flg=1;
    for(int i=l-1;i<n;i+=l-1)
      flg&=ms[i]==min(i+1,n-i);
    if(flg) drop(l);
  }

  assert(0);
  return 0;
}



Measured memory_bytes: 8884
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
typedef long long ll;
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;
const int inf = 1001001001;
 
int main(){

    ll h1,m1,h2,m2,a;
    cin >> h1 >> m1 >> h2 >> m2 >> a;
    ll c=h2*60+m2-h1*60-m1-a;
    cout << c << endl;


    
 
}

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

int main() {
  int A, B, C, D; cin >> A >> B >> C >> D;
  string r = "Yes";
  while (A > 0 || C > 0) {
    C -= B;
    if (C <= 0) {
      r = "Yes";
      break;
    }
    A -= D;
    if (A <= 0) {
      r = "No";
      break;
    }
  }
  cout << r << endl;
  return 0;
}

Measured memory_bytes: 3632
import sys
n = int(input())
A=[int(e)for e in sys.stdin]
cnt = 0
G = [int((2.25**i-1)/1.25)for i in range(17,0,-1)]
G = [v for v in G if v <= n]
def insertionSort(A, n, g):
    global cnt
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j+g] = A[j]
            j = j - g
            cnt += 1
        A[j+g] = v
for g in G:
    insertionSort(A, n, g)
print(len(G))
print(*G)
print(cnt)
print(*A,sep='\n')


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

using namespace std;
int main(){
	int n;
	cin>>n;
	string s;
	cin>>s;
	int ans=0; 
	for(int i=0;i<n;i++){
		if(s[i]=='.')ans++;	
	}
	int cnt=ans;
	for(int i=0;i<n;i++){
		if(s[i]=='.')cnt--;
		else cnt++;
		ans=min(ans,cnt);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 640
arr = $stdin.gets.chomp.split(" ")
arr.map! do |a_j|
 a_j.to_i
end

a = arr[0] + arr[1]
b = arr[0] - arr[1]
c = arr[0] * arr[1]

if
  a >= b and a >= c
  puts a
elsif
  b >= a and b >= c
  puts b
else
  puts c
end

Measured memory_bytes: 1788
#データセットに対する処理の実行
result_data = list()
while True:
    input_data = list(input())
    if input_data[0] == "-":
        break
    shuffle_count = int(input())
    for i in range(shuffle_count):
        separate_number = int(input())
        input_data = input_data[separate_number:] + input_data[0:separate_number]
    result_data.append(input_data)

#結果の表示
for i in result_data:
    print("".join(i))



Measured memory_bytes: 5592
#include <iostream>
#include <string>
using namespace std;
int main() {
  double w;
  while (cin >> w) {
    cout << (
        (w > 91.) ? "heavy" :
        (w > 81.) ? "light heavy" :
        (w > 75.) ? "middle" :
        (w > 69.) ? "light middle" :
        (w > 64.) ? "welter" :
        (w > 60.) ? "light welter" :
        (w > 57.) ? "light" :
        (w > 54.) ? "feather" :
        (w > 51.) ? "bantam" :
        (w > 48.) ? "fly" : "light fly") << endl;
  }
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#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,a,b) for(int i=a;i<b;i++)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define vi vector<int>
#define pb push_back
#define i197 1000000007
#define MAX_N 200002
using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<Pii,int> Piii;
typedef pair<int,ll> Pil;
typedef pair<ll,ll> Pll;
typedef pair<string,int> Psi;
typedef pair<Psi,int> Psii;

const int inf=1000000000;
struct edge{
	int myc,to,c,cost;
};
struct pos{
	int to,cost,color;
};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main() {
	int l,r;
	cin>>l>>r;
	int res=2018;
	int n=2019;
	if(r-l<2019)n=r-l+1;
	int a[n]={};
	rep(i,n){
		a[i]=(l+i)%2019;
	}
	rep(i,n-1){
		for(int j=i+1;j<n;++j){
			res=min(res,(a[i]*a[j])%2019);
		}
	}
	cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline

def root(v):
    if v == par[v]:
        return v
    par[v] = root(par[v])
    return par[v]

def unite(u, v):
    u = root(u)
    v = root(v)
    if u == v:
        return
    if rank[u] < rank[v]:
        u, v = v, u
    par[v] = u
    if rank[u] == rank[v]:
        rank[u] += 1

def connected(u, v):
    return 1 if root(u) == root(v) else 0

N, M = map(int, input().split())
P = list(map(int, input().split()))
par = [i for i in range(N)]
rank = [0] * N
for _ in range(M):
    x, y = map(int, input().split())
    unite(x-1, y-1)
res = 0
for i in range(N):
    res += connected(i, P[i]-1)
print(res)


Measured memory_bytes: 13876
#include <iostream>
#include <cstring>
#include <sstream>
#include <cctype>
#include <cmath>
#include <cstdio>
using namespace std;
#define MPI  3.14159265358979323846


int main(){

	int n;
	cin >> n;

	int x[101], y[101];
	for (int i = 0; i < n; i++){
		cin >> x[i];
	}
	for (int i = 0; i < n; i++){
		cin >> y[i];
	}

	double l1=0, l2=0, l3=0, li;
	li = abs(x[0] - y[0]);
	for (int i = 0; i < n; i++){
		l1 += abs(x[i] - y[i]);
		l2 += pow(x[i] - y[i], 2);
		l3 += pow(abs(x[i] - y[i]), 3);
		if (li < abs(x[i] - y[i]))li = abs(x[i] - y[i]);
	}

	printf("%.6f\n%.6f\n%.6f\n%.6f\n", l1, sqrt(l2), pow(l3,0.333333333333), li);

	return 0;
}


Measured memory_bytes: 3340
#include <stdio.h>
#include <stdlib.h>
  
struct node{
  
int id;
struct node* parentNode;
struct node* leftChild;
struct node* rightChild;
  
};
  
struct node *createNode(int);
void insert(struct node*);
void printNodes(void);
int findNode(int, struct node*);
void preOrder(struct node *);
void inOrder(struct node *);
  
struct node* nodes[500002];
struct node* root;
 
int num_nodes=0, n; 
 
main(){
  
int i, id;
char com[7];
 struct node* tmpNode;
  
scanf("%d",&n);
  
for(i=0; i<n; i++){
  
scanf("%s",com);
if(com[0]=='i'){
scanf("%d",&id);
insert(createNode(id));
}else if(com[0]=='p'){
printNodes();
}else if(com[0]=='f'){
scanf("%d",&id);
	if(findNode(id, root)){
		printf("yes\n");	
	}else{
		printf("no\n");	
	}
}
  
}/* END OF LOOP */
 
 return 0;
  
}
 
struct node *createNode(int id){
  struct node *newNode;
  if(id<0) return NULL;
 
  newNode=(struct node*)malloc(sizeof(struct node));
  newNode->id=id;
  newNode->parentNode=NULL;
  newNode->rightChild=NULL;
  newNode->leftChild=NULL;
   
  nodes[num_nodes++]=newNode;
  return newNode;
}
  
void insert(struct node* z){
  
  struct node* y = NULL;
  struct node* x = root;
 
  while(x != NULL){
    y = x;
    if(z->id < x->id){
      x = x->leftChild;
    }else{
      x = x->rightChild;
    }
  }
  z->parentNode = y;
  if(y == NULL){
    root = z;
  }else{
    if(z->id < y->id){
      y->leftChild = z;
    }else{
      y->rightChild = z;
    }
  }
  
}
  
void printNodes(void){
	
  inOrder(root);
  printf("\n");
  preOrder(root);
  printf("\n"); 
 
}

int findNode(int searchingId, struct node* nd){
	
	if(nd->id == searchingId) return 1;
	if(nd->id < searchingId && nd->rightChild){
		return findNode(searchingId, nd->rightChild);
	}
	if(nd->id > searchingId && nd->leftChild){
		return findNode(searchingId, nd->leftChild);
	}
	return 0;
	
}
  
void preOrder(struct node* nd){
  printf(" %d",nd->id);
  if(nd->leftChild){
    preOrder(nd->leftChild);
  }
  if(nd->rightChild){
    preOrder(nd->rightChild);
  }
  
}
  
void inOrder(struct node* nd){
  if(nd->leftChild){
    inOrder(nd->leftChild);
  }
  printf(" %d",nd->id);
  if(nd->rightChild){
    inOrder(nd->rightChild);
  }
  
}

Measured memory_bytes: 11000
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
    cin >> n;
    vector<long long> a(n, 0);
    long long lsum = 0;
    long long rsum = 0;

    for(int i = 0; i < n; ++i) {
        cin >> a.at(i);
        rsum += a.at(i);
    }

    long long min = 1e16+7;
    for(int i = 0; i < n-1; ++i) {
        lsum += a.at(i);
        rsum -= a.at(i);
        if(abs(lsum-rsum) < min) {
            min = abs(lsum-rsum);
        }
    }

    cout << min << endl;
}

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

using namespace std;

int k;

int _get(vector <vector <int> >& ar, int x, int y) {
	if (x < 0 || y < 0) return 0;
	return ar[min(2 * k - 1, x)][min(k - 1, y)];
}

int get(vector <vector <int> >& ar, int x, int y) {
	return _get(ar, x, y) - _get(ar, x - k, y) - _get(ar, x, y - k) + _get(ar, x - k, y - k);
}

int main() {
	ios::sync_with_stdio(false);
	int n;
	cin >> n >> k;
	vector <int> x(n);
	vector <int> y(n);
	vector <char> c(n);
	vector <vector <int> > arw(2 * k, vector <int> (k));
	vector <vector <int> > arb(2 * k, vector <int> (k));
	for (int i = 0; i < n; ++i) {
		cin >> x[i] >> y[i] >> c[i];
		x[i] %= 2 * k;
		y[i] %= 2 * k;
		if (y[i] >= k) {
			y[i] -= k;
			if (x[i] >= k) {
				x[i] -= k; 
			}
			else {
				x[i] += k;
			}
		}
		// cout << x[i] << " " << y[i] << " " << c[i] << endl;
		if (c[i] == 'W') {
			arw[x[i]][y[i]]++;
		}
		else {
			arb[x[i]][y[i]]++;
		}
	}
	for (int i = 1; i < k; ++i) {
		arw[0][i] += arw[0][i - 1];
		arb[0][i] += arb[0][i - 1];
	}
	for (int i = 1; i < 2 * k; ++i) {
		arw[i][0] += arw[i - 1][0];
		arb[i][0] += arb[i - 1][0];
	}
	for (int i = 1; i < 2 * k; ++i) {
		for (int j = 1; j < k; ++j) {
			arw[i][j] += arw[i - 1][j] + arw[i][j - 1] - arw[i - 1][j - 1];
			arb[i][j] += arb[i - 1][j] + arb[i][j - 1] - arb[i - 1][j - 1];
		}
	}
	// for (int j = k - 1; j >= 0; --j) {
	// 	for (int i = 0; i < 2 * k; ++i) {
	// 		cout << arw[i][j] << " ";
	// 	}
	// 	cout << endl;
	// }
	// cout << "**********" << endl;
	// for (int j = k - 1; j >= 0; --j) {
	// 	for (int i = 0; i < 2 * k; ++i) {
	// 		cout << arb[i][j] << " ";
	// 	}
	// 	cout << endl;
	// }
	int ans = 0;
	for (int i = 0; i < 2 * k; ++i) {
		for (int j = 0; j < k; ++j) {
			int cur = 0;
			cur += get(arw, i - 2 * k, j) + get(arw, i, j) + get(arw, i + 2 * k, j);
			cur += get(arw, i + k, j + k) + get(arw, i - k, j + k) + get(arw, i - k, j - k) + get(arw, i + k, j - k);
			cur += get(arb, i - k, j) + get(arb, i + k, j) + get(arb, i, j - k) + get(arb, i, j + k);
			cur += get(arb, i + 2 * k, j + k) + get(arb, i + 2 * k, j - k) + get(arb, i + k, j + 2 * k) + get(arb, i + k, j - 2 * k);
			cur += get(arb, i - 2 * k, j + k) + get(arb, i - 2 * k, j - k) + get(arb, i - k, j + 2 * k) + get(arb, i - k, j - 2 * k);
			ans = max(ans, cur);
		}
	}
	cout << ans << endl;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int A, B;

int digits(int num) {
  int ans = 0;
  for(int i = 1; i <= num; ++i) {
    int tmp = i;
    int res = 0;
    while(tmp > 0) {
      int a = tmp % 10;
      res += a;
      tmp = tmp / 10;
    }
    if(A <= res && res <= B) ans += i;
  }
  return ans;
}

int main() {
  int N; cin >> N;
  cin >> A >> B;
  cout << digits(N) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<functional>
using namespace std;
int main(void) {
    
    int h,w;
    cin>>h>>w;

    char a[h+2][w+2];

    for(int i=1;i<h+1;i++){
        for(int j=1;j<w+1;j++){
            cin>>a[i][j];
        }
    }
    for(int i=0;i<w+2;i++){
        a[0][i]='.';
        a[h+1][i]='.';
    }

    for(int i=0;i<h+2;i++){
        a[i][0]='.';
        a[i][w+1]='.';
    }

  /*  for(int i=0;i<h+2;i++){
        for(int j=0;j<w+2;j++){
            cout<<a[i][j];
        }
        cout<<endl;
    }*/

    for(int i=0;i<h;i++){
        for(int j=0;j<w-1;j++){
            if(a[i][j]=='#'){

                if(a[i][j+1]=='.'){
                    if(a[i][j-1]=='.' ){
                        if(a[i-1][j]=='.'){
                            if(a[i+1][j]=='.'){
                                cout<<"No"<<endl;
                                return 0;
                            }
                        }
                    }
                }
            }
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

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

int main() {
  int64_t N;
  cin>>N;
  int k=0;
  int keta=0;
  while(true){
    int64_t x=(pow(26,k)-1)/25;
    int64_t y=(pow(26,k+1)-1)/25;
    if(x-1<N && N<y){
      keta=k;
      break;
    }
    k++;
  }
  N=N-(pow(26,keta)-1)/25;
  
  for(int j=0;j<keta;j++){
    int64_t syou=N/pow(26,keta-j-1);
    N=N-syou*pow(26,keta-j-1);
    cout<<char(97+syou);
  }
  cout<<endl;
}


Measured memory_bytes: 4064