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

#define for0(i, n) for (ll i = 0; i < (ll)(n); ++i) // 0 based indexing
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (ll i = (ll)(l); i <= (ll)(r); ++i) // closed interver from l to r r inclusive
#define forr0(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i) // reverse 0 based.
#define forr1(i, n) for (ll i = (ll)(n); i >= 1; --i) // reverse 1 based

#define ff first
#define ss second
#define pb push_back

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ld a,b;
	cin >> a>>b;
	int in =1;
	int ans =0;
	while(in < b) { 
		in -= 1;
		in += a;
		ans++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
using System;

namespace ITP1_1_C
{
  class Program
  {
    static void Main(string[] args)
    {
      var line = Console.ReadLine();
      string[] data = line.Split(' ');
      int a = int.Parse(data[0]);
      int b = int.Parse(data[1]);
      int area = a * b;
      int length = a * 2 + b * 2;
      Console.WriteLine("{0} {1}", area, length);
    }
  }
}



Measured memory_bytes: 15948
// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░

//PointBlank's code (⌐■_■)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
 
ll power(ll x, ll y); 
#define repp(I, A, B) for(int I = A; I <= B; I++)
#define rep(I, A, B) for(int I = A; I < B; I++)
#define rrep(I, B, A) for(int I = B; I >= A; I--)
#define pb emplace_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define LB lower_bound
#define UB upper_bound
#define MP make_pair
#define mem(A, B) memset(A, B, sizeof(A));
#define mem0(A) memset(A, 0, sizeof(A));
#define quickio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define bitcount(n) __builtin_popcountll(n)
#define in_edges(M) repp(I, 1, M){int A, B; cin >> A >> B; v[A].pb(B), v[B].pb(A);}
#define in_edges2(M) repp(I, 1, M){int A, B; cin >> A >> B; v[A].pb(B);}
#define endl "\n"

const ll MOD = 1000000007;

int p[20];
vector<int> v[20];
 
int main() //PointBlank's code ¯\_(ツ)_/¯
{
    int n, m, k;
    cin >> n >> m;
    repp(i, 1, m){
        cin >> k;
        v[i].resize(k, 0);
        for(auto &s : v[i]) cin >> s;
    }
    repp(i, 1, m) cin >> p[i];

    int res = 0;
    rep(i, 0, 1 << n){
        int flag = 1;
        repp(k, 1, m){
            int f = 0;
            for(auto &s : v[k]) if(i & (1 << (s - 1))) f = 1 - f;
            if(f != p[k]) flag = 0;
        }
        res += flag;
    }

    cout << res;
}

ll power(ll x, ll y)
{ 
    ll res = 1; x %= MOD;
    while(y > 0){if(y & 1) res = (res*x) % MOD; y = y>>1, x = (x*x) % MOD;} 
    return res; 
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,-1,sizeof(x))
const int INF = 1000000001;

int main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  cout << min(a, b) + min(c, d) <<endl;
}

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

#define NREP() for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define ALL(x) (x).begin(), (x).end()
#define MSG(x) cout << x << endl;
#define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl;
#define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl;
#define yn(x) x ? cout << "yes" << endl : cout << "no" << endl;

using namespace std;
using ll = long long;
const static ll MOD = 1e9 + 7;

int main(int argc, char *argv[]) {
    ll n;
    cin >> n;
    ll x = n / 100;
    n -= x * 100;
    ll y = n / 10;
    n -= y * 10;

    Yn(x == 7 || y == 7 || n == 7)
}


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

int main(){
	int n;
	cin >> n;
	vector<int> h(n);
	rep(i, n) cin >> h.at(i);

	int ans = 0;
	int cnt = 0;
	for(int j = 0; j < n-1; j++){
		if(h.at(j) >= h.at(j+1)){
			cnt++;
			ans = max(ans, cnt);
		}else{
			cnt = 0;
		}
	}

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

Measured memory_bytes: 640
#include "cstdio"
#include "string"
#include "iostream"
using namespace std;
int main(){
	string s;
	cin>>s;
	int x=s.size();
	if(s[0]==s[x-1]){
	if(x%2==0){
		printf("First\n");return 0;
	}
	else{
		printf("Second\n");return 0;
	}
	}
	else{
		if(x%2==0){
		    printf("Second\n");return 0;
	    }
	    else {
		    printf("First\n");return 0;
	    }
	}
}

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

using namespace std;

typedef long long ll;

const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f;

#define rep(i, a, b) for(int i = a; i <= b; i ++)
#define pre(i, a, b) for(int i = a; i >= b; i --)

string s;

int read()
{
	int x;
	scanf("%d", &x);
	return x;
}


int yello, red;

int main()
{
	cin >> s;
	for(int i = 0; i < s.size(); i ++)
	{
		if(s[i] == '1')yello++;
		else red++;
	}
	cout << min(yello, red) * 2 << endl;
}

Measured memory_bytes: 512
import itertools
import copy
import numpy as np

def main():
    H, W, K  = map(int, input().split())
    if K == 0:
        print(1)
        exit()
    c = np.full((H, W), False)
    for h in range(H):
        for w, s in enumerate(input()):
            if s == '#':
                c[h][w] = True
            else:
                c[h][w] = False
    ans = 0
    for h in range(H):
        for coh in itertools.combinations(range(H), h):
            cc = np.delete(c, coh, 0)
            for w in range(W):
                for cow in itertools.combinations(range(W), w):
                    ccc = np.delete(cc, cow, 1)
                    if ccc.sum() == K:
                        ans += 1
    print(ans)
if __name__ == "__main__":
    main()

Measured memory_bytes: 27320
#include <bits/stdc++.h>
#include <vector> 
# include <cstdint>
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define RFOR(i,l,r) for(int i=(l);i>=(int)(r);i--)
#define rep(i,n)  FOR(i,0,n)
#define rrep(i,n)  RFOR(i,n-1,0)

using namespace std;
const int MX = 1e6;
const int inf = 1e9;
//const int mod = 1e9+7;
using ll = long long;
const int mod = 1000000007;

int no[MX+5];
signed main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) {
        cin >>a[i];
        no[a[i]]--;
    }
    sort(a.begin(), a.end());
    ll ans =0;
    rep(i,n) {
        int index = a[i];
        if(no[a[i]]<-1) {
            ans+=2;
            no[a[i]]= 0;
            continue;
        }
        //cout << index << endl;
        ll now = 1;
        while(now*index<=MX) {
            if(no[now*index]<=0) {
                no[now*index]= index;
            }
            else {
                if(now==1 &&(index)%no[index]==0) {
                    //cout << index << "aaa"<<no[index] << endl;
                    ans++;
                    break;
                }
                no[now*index]=min(index,no[index*now]);
            }
            now++;
        }
    }
    //rep(i,30) cout << i <<" "<<no[i] << endl;
    //cout << ans << endl;
    cout << n-ans << endl;
    return 0;
}


Measured memory_bytes: 8016
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define PI acos(-1)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}



int main(){
   
   int n;
   cin>>n;
   int ca=0,cb=0,cc=0,cd=0;

   rep(i,n){
      string s;
      cin>>s;
      if(s=="AC") ca++;
      else if(s=="WA") cb++;
      else if (s=="TLE") cc++;
      else if(s=="RE") cd++;
   }
   cout<<"AC x "<<ca<<endl;
   cout<<"WA x "<<cb<<endl;
   cout<<"TLE x "<<cc<<endl;
   cout<<"RE x "<<cd<<endl;






return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <vector>
using namespace std;
 
int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	vector<long long> B(N + 1, 0); //累積和テーブル
	int mod = 1000000007;
 
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
		B[i + 1] = B[i] + A[i];
	}
 
	long ans = 0;
 
	//i について全探索する
	for (int i = 0; i < N; i++)
	{
		//累積和を使ってA[i+1] + ... + A[N] を求める
		long long sum = (B[N] - B[i + 1]) % mod;
 
		ans += A[i] * sum;
		ans %= mod;
	}
 
	cout << ans << endl;
}

Measured memory_bytes: 5596
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<stack>
#include<set>
using namespace std;

int a[105];

int main(){
    int i,n;
    a[0]=0;
    for(i=1;i<=100;i++)
        a[i]=a[i-1]+i;
    while(scanf("%d",&n)!=EOF)
        printf("%d\n",a[n]);
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<(x)<<endl
#define fi first
#define se second

#define INF 2147483600

int main(){
  int n,x;
  cin>>n>>x;
  if(x==1 || x==2*n-1){
    cout<<"No"<<endl;
    return 0;
  }
  vector<int> vec(2*n+1);
  if(x==n){
    rep(i,n*2-1) vec[i]= i+1;
  }
  if(x<n){
    vec[n-1]=1;
    vec[n-2]=x;
    int d=2;
    rep(i,n-2){
      if(d==x) d++;
      vec[i]=d++;
    }
    rep(i,n-1) vec[n+i]=i+n+1;
  } else if(x>n){
    vec[n-1]=2*n-1;
    vec[n-2]=x;
    int d=2*n-2;
    rep(i,n-2){
    if(d==x) d--;
      vec[i]=d--;
    }
    rep(i,n-1) vec[n+i]=i+1;
  }
  cout<<"Yes"<<endl;
  rep(i,2*n-1) printf("%d\n", vec[i]);


  return 0;
}


Measured memory_bytes: 2304
# coding: utf-8


def count_mountain(li):
    pre = False
    count = 0
    for i in range(1, max(li) + 1):
        for j in range(len(li)):
            now = li[j] >= i
            if pre == False and now == True:
                count += 1
            pre = now
        pre = False

    return count


def main():
    n = int(input())
    h = list(map(int, input().split()))

    print(count_mountain(h))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

inline string get(string s, int a, int b) {
    string ans;
    while (a < b)
        ans.push_back(s[a++]);
    return ans;
}

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

    string s;
    cin >> s;

    if (k == 0) {
        cout << s;
        return 0;
    }

    k--;

    string append = s;
    reverse(append.begin(), append.end());

    s = s + append;

    if (k == 0) {
        string ans = get(s, 0, n);
        for (int i = 1; i <= n; i++)
            ans = std::min(ans, get(s, i, i + n));

        cout << ans;
        return 0;
    }

    char ch = s[0];
    for (int i = 1; i < n; i++)
        ch = std::min(ch, s[i]);

    int avem = 0;
    vector < int > cnt(2 * n);
    for (int i = 0; i < 2 * n; i++) {
        if (s[i] == ch)
            avem++;
        else
            avem = 0;
        cnt[i] = avem;
    }

    int best = 0;
    for (auto &x : cnt)
        best = std::max(best, x);

    if (k >= 30 || ((1LL * best) << k) >= n) {
        string ans(n, ch);
        cout << ans;
        return 0;
    }

    string prefix(best << k, ch);

    string ans = get(s, 0, n);
    for (int i = n - 1; i < 2 * n; i++) {
        if (cnt[i] == best) {
            string a = get(s, i - best - (n - (best << k)) + 1, i - best + 1);
            reverse(a.begin(), a.end());
            ans = std::min(ans, prefix + a);
        }
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 384
import heapq

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n = int(input())
xy = [list(map(int, input().split())) + [i] for i in range(n)]
xy.sort()
UF = UnionFind(n)
lst = [[xy[0][1], xy[0][2]]]

for _, y, i in xy[1:]:
    flg = False
    tmp = lst[0]
    while lst and lst[0][0] < y:
        flg = True
        pos = lst[0][1]
        UF.union(i, pos)
        heapq.heappop(lst)
    if flg:
        heapq.heappush(lst, tmp)
    else:
        heapq.heappush(lst, [y, i])
for i in range(n):
    print(UF.size(i))

    
    

Measured memory_bytes: 52228
def resolve():
    from collections import defaultdict
    s = input()
    n = len(s)
    d = defaultdict(int)
    d[0] += 1
    j = 0
    for i in range(1, n + 1):
        j += int(s[-i]) * pow(10, i - 1, 2019)
        j %= 2019
        d[j] += 1

    def calc(x): return x * (x - 1) // 2
    ans = 0
    for v in d.values():
        ans += calc(v)
    print(ans)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 9500
#include <iostream>
#include <map>
using namespace std;
typedef long long ll;
ll n, M=1e9+7;
map<ll, ll> m;
ll f(ll p) {
	if(p<2) return p+1;
	if(m[p]) return m[p];
	return m[p] = (p%2 ? 2*f(p/2)+f(p/2-1) : f(p/2)+2*f(p/2-1)) % M;
}

int main() {
	cin>>n;
	cout<<f(n);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
using Graph = vector<vector<int>>;
using Graphl = vector<vector<ll>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
#define RRep(i, k, n) for (int i = k; i > (int)(n); i--)
#define FOR(itr, v) for (auto itr = (v).begin(); itr != (v).end(); ++itr)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define ALL(a)  (a).begin(),(a).end()
#define rALL(a)  (a).rbegin(),(a).rend()
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; }
template<class T> void PrintVector(const vector<T> &vec) {for (auto val : vec) cout << val << " "; cout << endl;}
const long long INF = 1LL << 60;
const long long minusINF = -(1LL << 40);
const int MOD = 1000000007;
const double PI = acos(-1); //3.14~
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    string s; ll k; cin >> s >> k;
    int ans = 1;
    rep(i, min((ll)s.size(), k))
    {
        if (s[i] == '1') continue;
        else{
            ans = s[i] - '0';
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'

void solve(){
  int n;
  cin >> n;
  int p = 1e9;
  int ans = 0;
  forn(i, n-1){
    int b;
    cin >> b;
    ans += min(b, p);
    p = b;
  }
  ans += p;
  cout << ans;
}

int main() {
  ios::sync_with_stdio(false);
  // cin.tie(0); cout.tie(0);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 


*/

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

// #include <boost/algorithm/string/join.hpp>
// using boost::algorithm::join;
//
// #include "boost/multi_array.hpp"
// boost::multi_array<int, 3> dp;
// dp.resize(boost::extents[10][9][8]);
//
// #include <boost/multiprecision/cpp_dec_float.hpp>  // quite slowly
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision; // mp::log10
// using bigint = boost::multiprecision::cpp_int;
// using rational = mp::cpp_rational;  // double d = static_cast<double>(r);

typedef long long ll;
typedef unsigned long long ull;
//typedef long double ld;

typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<double,double> pdd;
typedef set<int> si;
typedef set<ll> sll;
typedef vector<int> vi;
typedef vector<pair<int, int > > vii;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef vector<vll> vvll;

//constexpr ll MOD = 1e9+7;
template<typename T>constexpr auto inf=numeric_limits<T>::max()/4;
constexpr int INF=inf<int>;
constexpr ll LINF=inf<ll>;

#define Sort(x) sort(begin(x),end(x))
#define Reverse(x) reverse(begin(x),end(x))
#define ABS(a,b) ((a)<(b)?(b)-(a):(a)-(b))
#define nbit(n) (1ull<<(n))
#define _ol3(_1,_2,_3,name,...)name
#define _rep(i,n)_repi(i,0,n)
#define _repi(i,a,b)for(int i=a,i##_l=(b);i<i##_l;++i)
#define REP(...) _ol3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)
#define REPR(i,n) for(int i=n-1;i>=0;--i)
#define REPA(i,v) REP(i,(v).size())

// sort(begin(x), end(x), greater<ll>());
// lower_bound(a.begin(), a.end(), val): a[i] ≥ valである最左の位置
// upper_bound(a.begin(), a.end(), val): a[i] > valである最左の位置

// Returns minimum of a and b.
// If a is less b, a is set to b.
template<typename T>
T chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
  return a;
}

// Returns maximum of a and b.
// If a is less b, a is set to b.
template<typename T>
T chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
  return a;
}

template <typename T>
void dumpContents(const T& v, const string& msg)
{
  cerr << "### " << msg << " ###\n";
  for (const auto& x : v) {
    cerr << x << " ";
  }
  cerr << endl;
}

struct before_main_function {
  before_main_function() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<setprecision(20)<<fixed;
#define endl "\n"
  }
} before_main_function;

// ========== end of template ==========

int main(int argc, char** argv) {
  int N;
  cin >> N;

  ll ret = 0;
  REP(i, 1, N+1) {
    if (i%3==0 || i%5 == 0) continue;

    ret += i;
  }

  cout << ret << endl;

  return 0;
}

/* vim: set expandtab shiftwidth=2 softtabstop=2 : */


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

using namespace std;

int main()
{
  int N, A[100000];
  cin >> N;
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }
  long long ret = 0;
  int small = 1;
  for(int i = 0; i < N; i++) {
    int get = max(0, (A[i] - 1) / small);
    ret += get;
    if(i == 0 || small == A[i]) ++small;
  }
  cout << ret << endl;
}


Measured memory_bytes: 768
#include <iostream>
#include <vector>
#include <string.h>
#include <string>
#include <algorithm>

using namespace std;

const int MAXN = 200005;

long long t[MAXN], f[MAXN];
int n;
int a[MAXN], w[MAXN];

void Add(int z, long long w)
{
	z += 1;
	for (; z < MAXN; z += z & (-z))
		t[z] = max(t[z], w);
}

long long GetMax(int z)
{
	long long res = 0;  z += 1;
	for (; z; z -= z & (-z))
		res = max(res, t[z]);
	return res;
}

long long Work()
{
	memset(t, 0, sizeof(t));
	memset(f, 0, sizeof(f));
	cin >> n;
	for (int i = 0; i < n; i ++)
		cin >> a[i];
	memcpy(w, a, sizeof(a));
	sort(w, w + n);
	int m = unique(w, w + n) - w;

	for (int i = 0; i < n; i ++)
		a[i] = lower_bound(w, w + m, a[i]) - w;

	for (int i = 0; i < n; i ++)
		cin >> w[i];
	long long ans = 0;
	for (int i = 0; i < n; i ++)
	{
		f[i] = GetMax(a[i] - 1) + w[i];
		ans = max(ans, f[i]);
		Add(a[i], f[i]);
	}
	return ans;
}

int main()
{
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(false);
	int T = 1;
	//cin >> T;
	for (int tt = 0; tt < T; tt ++)
		cout << Work() << endl;

	return 0;
}


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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if ((a == b) && (b != c)) {
    cout << "Yes" << endl;
  }
  else if ((a == c) && (b != c)) {
    cout << "Yes" << endl;
  }
  else if ((b == c) && (a != c)) {
    cout << "Yes" << endl;
  }
  else { 
    cout << "No" << endl;
  }
}
  
 
      
      

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

div = 26
ans = []

while 1:
    if N % 26 == 0:
        ans.append(26)
        N = N // div - 1
    else:
        amari = N % div
        ans.append(amari)
        N //= div
    if N == 0:
        break

ans.reverse()
name = []

for i in ans:
    name.append(chr(i+96))

print(''.join(name))


Measured memory_bytes: 9176
sa = list(input())
sb = list(input())
sc = list(input())


v = sa.pop(0)

while True:

    if v == 'a':
        if len(sa) == 0:
            print('A')
            exit()
        v = sa.pop(0)
    elif v == 'b':
        if len(sb) == 0:
            print('B')
            exit()
        v = sb.pop(0)
    else:
        if len(sc) == 0:
            print('C')
            exit()
        v = sc.pop(0)

Measured memory_bytes: 3064
#include <cstdio>

int main()
{
	int x, y, z;
	int w;
	scanf("%d %d %d", &x, &y, &z);

	w = x;
	x = y;
	y = w;

	w = x;
	x = z;
	z = w;

	printf("%d %d %d", x, y, z);

	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>

using namespace std;

//スタックを実装する配列S
//スタックに必要な、最後尾のindexを示す変数top
int MAX=1000;
int top,S[1000];



bool isEmpty()
{
    return top == 0;
}

bool isFull()
{
    return top > (MAX-1);
}

//pushは配列最後尾に要素を追加する
//このときtopのindexも1つ増やす
void push(int x)
{
    if(isFull())
    {
        cout<<"overflow!!"<<endl;
        return;
    }
    //++topという記法は
    //topに+1し、そのtopのindexを用いる操作を行うことができる
    S[++top] = x;
    //したがって以下に同等
    //top++;
    //S[top] = x;
}

//popはtopが表すindexを1つ後退させ
//後退前の要素を返す
int pop()
{
    if(isEmpty())
    {
        cout<<"Empty!!"<<endl;
        return -1;
    }
    top--;
    return S[top+1];
}




int main()
{
    int a,b;
    top = 0;
    //入力文字列ｓ(小文字)
    char s[100];

    //EOFはファイル終端を表す
    //したがって終端までwhile文が回り続ける
    // scanfの戻り値は読み込めた要素数,第二引数以降に要素数を指定できる
    // デフォは１
    //読み込めなかったときは-1が返る
    //一方でEOFは数字としては-1として認識される(Falseと似てるね。確認済み)ようなのでそこの等値比較を行っている
    while( scanf("%s",s)  != EOF )
    {
        if( s[0]=='+')
        {
            b=pop();
            a=pop();
            push(a+b);
        }else if(s[0]=='-')
        {
            b=pop();
            a=pop();
            push(a-b);
        }else if(s[0]=='*')
        {
            b=pop();
            a=pop();
            push(a*b);
        }else
        {
            //atoi(const char *str) 文字列→int  変換
            //変換不能値は0
            push(atoi(s));
        }
    }

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

    return 0;

}




Measured memory_bytes: 3236
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cstdlib>
#include <typeinfo>

using namespace std;

#define FOR(i,n) for(i=0;i<n;++i)
#define INF 1e9

int i,j;

int main(void){
    
    int w,a,b;
    cin>>w>>a>>b;
    
    if(a<b){
        if(b-(a+w)>=0)cout<<b-(a+w);
        else cout<<0;
    }
    else {
        if(a-(b+w)>=0)cout<<a-(b+w);
        else cout<<0;
    }
    
    
    
    return 0;
    
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#define ll long long
#define pr(x) cout<<#x<<"="<<x<<endl
using namespace std;
int n,i,a[1000],ans;
int main()
{
	cin>>n;
	for (i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	sort(a+1,a+1+n);
	for (i=1;i<=n;i++)
	{
		ans+=a[i];
	}
	if (ans%10!=0) {
		cout<<ans;
		return 0;
	}
	for (i=1;i<=n;i++)
	{
		if((ans-a[i])%10!=0)
		{
			cout<<ans-a[i];return 0;
		}
	}
	cout<<0;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer sum;
		for(;;) {
			sum = 0;
			String str = sc.next();
			if(str.equals("0")) {
				break;
			}
			for(int i = 0; i < str.length(); i++) {
				sum += Integer.parseInt("" + str.charAt(i));
			}
			System.out.println(sum);
		}
		sc.close();
	}
}


Measured memory_bytes: 26988
h, w = map(int, input().split())
S = [input() for i in range(h)]
dx = [1, 1, 0, -1, -1, -1, 0, 1]
dy = [0, 1, 1, 1, 0, -1, -1, -1]
ANS = []
for y in range(h):
	s = ''
	for x in range(w):
		if S[y][x] == '#':
			s += '#'
		else:
			count = 0
			for di in range(8):
				ny = y + dy[di]
				nx = x + dx[di]
				if ny < 0 or nx < 0 or ny >= h or nx >= w:
					continue
				if S[ny][nx] == '#':
					count += 1
			s += str(count)
	ANS.append(s)
for i in range(h):
	print(ANS[i])

Measured memory_bytes: 39920
#include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;


void solve(){
    int n, r;
    cin >> n >> r;
    if(n < 10)
        cout << r + (100*(10-n)) << endl;
    else
        cout << r << endl;
}

int main(){
    /*
    int t; cin >> t;
    while(t--) solve();
    */
    solve();
    return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n, k int
	var s string
	fmt.Scan(&n, &k, &s)
	var d int
	for i := 1; i < n; i++ {
		if s[i] != s[i-1] {
			d++
		}
	}
	var ans int
	if 2*k < d {
		ans = n - 1 - d + 2*k
	} else {
		ans = n - 1
	}
	fmt.Println(ans)
}


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

typedef long long ll;

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
  return x/gcd(x, y)*y;
}

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

  ll numberA = A-1 - ((A-1)/C + (A-1)/D - (A-1)/lcm(C, D));
  ll numberB = B - (B/C + B/D - B/lcm(C, D));
  ll ans = numberB - numberA;

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

Measured memory_bytes: 256
from itertools import accumulate
n=int(input())

a1=list(map(int,input().split()))
a2=[0]+list(map(int,input().split()))

s1=list(accumulate(a1))
s2=list(accumulate(a2))

# print(s1)
ans=0
for i in range(n):
    t=s1[i]+s2[n]-s2[i]
    ans=max(t,ans)
print(ans)



Measured memory_bytes: 3060
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()

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

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

int main() {
  int n,l;
  cin>>n>>l;
  
  int sum=0;
  for(int i=1;i<=n;i++){
    sum += l+i-1;
  }
  
  if(l>0) cout << sum-l <<endl;
  else if(l+n-1<0) cout << sum-l-n+1 <<endl;
  else cout << sum <<endl;
  
  return 0;
}

Measured memory_bytes: 256
#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 200006
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define mem( a ) memset( a , 0 , sizeof a )
typedef long long ll;
int n , m;
ll a , b , c; 
int A[MAXN];

void solve() {
	cin >> a;
	ll t , b;
	scanf("%lld.%lld",&t,&b);
	t = t * 100 + b;
	ll rp = t * a;
	cout << rp / 100 << endl;
}

signed main() {
//    int T;cin >> T;while( T-- ) solve();
    solve();
}



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

if N > 81:
    print('No')

ans_list = []
if N <= 81:
    for i in range(1,10):
        for j in range(1,10):
            ans_list.append(i * j) 
    if N in ans_list:
        print('Yes')
    if N not in ans_list:
        print('No')

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

int main() {
    int N;
    cin >> N;
    vector<long long int> A(N);
    deque<long long int> B;
    bool reverse = false;
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    for(int i = 0; i < N; i++) {
        if(reverse == true) {
            B.push_front(A[i]);
        } else {
            B.push_back(A[i]);
        }
        reverse = !reverse;
    }
    for(int i = 0; i < N; i++) {
        if(reverse == true) {
            cout << B[N - i - 1];
        } else {
            cout << B[i];
        }
        if(i < N - 1) {
            cout << " ";
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 5376
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
const double PI = 3.1415926535897932;   // acos(-1)
const double EPS = 1e-15;
const int INF = 1001001001;
const ll mod = 1e+9 + 7;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define chadd(x, y) x = (x + y) % mod

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

    int n, k;
    cin >> n >> k;
    vector<int> h(n);
    for(int i = 0; i < n; ++i)  cin >> h[i];
    sort(h.begin(), h.end());
    int res = INF;
    for(int i = 0; i + k <= n; ++i) chmin(res, h[i+k-1] - h[i]);
    cout << res << endl;
}

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

using namespace std;

int a[60],b[60],c[60],d[60];


int main(){
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i]>>b[i];
	}
	for(int i=1;i<=m;i++)
	{
		cin>>c[i]>>d[i];
	}
	
	for(int i=1;i<=n;i++)
	{
		int ans=1000000000;
		int k;
		for(int j=1;j<=m;j++)
		{
			int t=abs(a[i]-c[j])+abs(b[i]-d[j]);
			if(t<ans){
				ans=t;
				k=j;
			}
		}
		cout<<k<<endl;
	}
	return 0;
} 

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

using namespace std;

int main(){
    string sentence;
    string objective_word;
    getline(cin,sentence);
    string temp(sentence);
    getline(cin,objective_word);

    sentence = sentence + temp;
    if((int)sentence.find(objective_word) >= 0) cout << "Yes\n";
    else cout << "No\n";
    return 0;
}


Measured memory_bytes: 3176
#include<stdio.h>
int binc[2000005],kind[2000005];
int find(int x){
	if(binc[x]==x) return x;
	binc[x]=find(binc[x]);return binc[x];
}
void together(int a,int b){
	int ax=find(a),bx=find(b);
	if(ax==bx) return ;
	binc[bx]=ax;
}
int main(){
	int n,m,a,b,max=-1;
	scanf("%d%d",&n,&m);
	for(int i=0;i<=n;i++) binc[i]=i;
	for(int i=1;i<=m;i++){
		scanf("%d%d",&a,&b);
		together(a,b);
	}
	for(int i=1;i<=n;i++) kind[find(i)]++;
	for(int i=1;i<=n;i++) if(kind[i]>max) max=kind[i];
	printf("%d",max);
	return 0; 
}

Measured memory_bytes: 3176
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int a[] = new int[n];
        int min = 0,max = 0;
        long sum = 0;
        
        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
            sum = sum + a[i];
            if(i != 0){
                if(max < a[i]) max = a[i];
                if(min > a[i]) min = a[i];
            }else {
                min = a[i];
                max = a[i];
            }
        }
        System.out.println(min +" "+ max +" " +sum);
    }
}


Measured memory_bytes: 41768
#pragma GCC optimize(2)
#include<bits/stdc++.h>
typedef long long LL;
using namespace std;
int main() {
	int n,a[100005];
	bool vis[100005];
	while(scanf("%d",&n)!=EOF) {
		LL ans=0;
		memset(vis,false,sizeof(vis));
		for(int i=0; i<n; i++) {
			scanf("%d",&a[i]);
			if(a[i])vis[i]=true;
			ans+=a[i]/2;
			a[i]%=2;
		}
		for(int i=1; i<n; i++) {
			if(a[i]&&a[i-1]) {
				a[i]=0;
				a[i-1]=0;
				ans++;
			} else if(a[i]==0&&a[i-1])
				if(vis[i]) a[i]++,a[i-1]--;
		}
		printf("%lld\n",ans);
	}
	return 0;
}

Measured memory_bytes: 768
#include<algorithm>
#include<string>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<utility>
#include<functional>
#include<cassert>
#include<cmath>
#include<math.h>
#include<unordered_map>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<ll> vint;
typedef vector<vint> vvint;
#define PI 3.1415926535
#define MOD 1000000007
#define rep(i, n) for(ll i=0;i<(n);i++)

int main(void) {
	ll n, m,h=0; cin >> n >> m;
	priority_queue<P,vector<P>,greater<P>> q;
	priority_queue<int,vector<int>> qh;

	rep(i, n) {
		int x, y;
		cin >> x >> y;
		q.push(P(x, y));
	}
	
	for (int i = 1; i <= m; i++) {
		while (true) {
			if (q.size() != 0) {
				if (q.top().first == i) {
					P p = q.top(); q.pop();
					qh.push(p.second);
				}
				else {
					break;
				}
			}
			else {
				break;
			}
		}
		if (qh.size() != 0) {
			int ph = qh.top(); qh.pop();
			h += ph;
		}

	}

	cout << h << endl;
	return 0;
}

Measured memory_bytes: 1908
from collections import deque
H,W = map(int,input().split())
A = [list(input().strip()) for _ in range(H)]
que = deque([])
for i in range(H):
    for j in range(W):
        if A[i][j]=="#":
            que.append((i,j,0))
tot = 0
while que:
    i,j,cnt = que.popleft()
    if j+1<W and A[i][j+1]==".":
        A[i][j+1]="#"
        que.append((i,j+1,cnt+1))
        tot = cnt+1
    if j-1>-1 and A[i][j-1]==".":
        A[i][j-1]="#"
        que.append((i,j-1,cnt+1))
        tot = cnt+1
    if i+1<H and A[i+1][j]==".":
        A[i+1][j]="#"
        que.append((i+1,j,cnt+1))
        tot = cnt+1
    if i-1>-1 and A[i-1][j]==".":
        A[i-1][j]="#"
        que.append((i-1,j,cnt+1))
        tot = cnt+1
print(tot)

Measured memory_bytes: 166108
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <complex>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define EPS 1e-8
#define DEB 0

const int dx[] = {0,1,0,-1};
const int dy[] = {-1,0,1,0};
int w,h,sx,sy;
char field[32][32];
vector<pair<int,int> > t_node;
int node[16][16],visited[32][32];
int dp[1<<10][16];

int main(){
	
	while(scanf(" %d%d ",&w,&h),w|h){
		memset(node,0,sizeof(node));
		rep(i,1<<10)rep(j,16)dp[i][j]=INT_MAX;
		
		t_node.clear();
		rep(i,h){
			scanf("%s",field[i]);
			rep(j,w){
				if( field[i][j]=='o' ){
					sx = j;
					sy = i;
				}else if( field[i][j]=='*' ){
					t_node.push_back(mp(j,i));
				}
			}
		}
		if( t_node.size()==0 ){
			printf("0\n");
			continue;
		}
		t_node.push_back(mp(sx,sy));
#if DEB
		rep(i,t_node.size()){
			printf("(%d,%d)\n",t_node[i].first, t_node[i].second);
		}
#endif	
		

		// make node (bfs)
		rep(i,t_node.size()){
			memset(visited,-1,sizeof(visited));
			queue<pair<int,int> > q;
			q.push(mp(t_node[i].first, t_node[i].second));
			visited[t_node[i].second][t_node[i].first] = 0;
			while( !q.empty() ){
				int x = q.front().first;
				int y = q.front().second;
				int c = visited[y][x];
				q.pop();
				rep(k,4){
					int tx = x + dx[k];
					int ty = y + dy[k];
					if( tx<0 || ty<0 || tx>=w || ty>=h || field[ty][tx]=='x' || visited[ty][tx]!=-1 )continue;
					visited[ty][tx] = c+1;
					q.push(mp(tx,ty));
				}
			}		
			
			rep(j,t_node.size())if( i!=j ){
				node[i][j] = visited[t_node[j].second][t_node[j].first];
			}
		}

#if DEB		
		rep(i,t_node.size()){
			rep(j,t_node.size()){
				printf("%d ",node[i][j]);
			}
			puts("");
		}
		puts("");
#endif		
			

#if DEB
		rep(i,h){
			puts(field[i]);
		}puts("");
#endif
		
		int n = t_node.size();
		int ans = INT_MAX;
		dp[0][n-1] = 0;
		
		rep(i,n-1){ //kosuu
			int comb = (1<<i)-1;
			while( comb < (1<<(n-1)) ){
				rep(k,n)if( dp[comb][k]!=INT_MAX ){ //now node
					rep(l,n-1)if( !((1<<l)&comb) && node[k][l]>0 ){
						dp[comb|(1<<l)][l] = min(dp[comb|(1<<l)][l], dp[comb][k]+node[k][l]);
						if( (comb|(1<<l))==((1<<(n-1))-1) ){
							ans = min(ans, dp[(1<<(n-1))-1][l]);
						}
#if DEB
						printf("bit:%d  , %d --> %d  , cost:%d\n",comb|(1<<l),k,l,dp[comb|(1<<l)][l]);
#endif						
					}
				}
				if( comb==0 )break;
				int x = comb & -comb;
				int y = comb + x;
				comb = ((comb&~y)/x>>1)|y;
			}
		}
	   
#if DEB
		printf("%d\n",(1<<(n-1))-1);
#endif		
		printf("%d\n",ans==INT_MAX ? -1 : ans);
	}
	return 0;
}

Measured memory_bytes: 1004
a, b, k = map(int, input().split())
l = []

i = a
while i < a+k:
  if i <= b:
    l.append(i)
  i += 1

i = b-k+1
while i <= b:
  if a <= i:
    l.append(i)
  i += 1

l = list(set(l))
l.sort()

for i in range(len(l)):
  print(l[i])

Measured memory_bytes: 3064
operand=list(map(str,input().split()))
stack=[]
for i in range(len(operand)):
    if operand[i]=="+":
        a=stack.pop()
        b=stack.pop()
        stack.append(a+b)
    elif operand[i]=="-":
        a=stack.pop()
        b=stack.pop()
        stack.append(b-a)
    elif operand[i]=="*":
        a=stack.pop()
        b=stack.pop()
        stack.append(a*b)
    else:
        stack.append(int(operand[i]))
print(stack[0])

    
    


Measured memory_bytes: 5604
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  char c;
  cin >> c;
  if('a' <= c && c <= 'z') c = 'a';
  else c = 'A';
  cout << c << endl;
  return 0;
}

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

using namespace std;

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

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int K, S;
  cin >> K >> S;
  int ans = 0;
  for (int x = 0; x <= K; ++x) {
    for (int y = 0; y <= K; ++y) {
      int z = S - (x + y);
      if (0 <= z && z <= K) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cmath>
using namespace std;
int mp[106],a[5][5],n,b,ans=0;
int main(){
	for(int i=1;i<=3;i++)
		for(int j=1;j<=3;j++)
			cin>>a[i][j];
	cin>>n;
	while(n--){
		cin>>b;
		mp[b]=1;
	}

	for(int i=1;i<=3;i++)
		if(	mp[a[i][1]]+mp[a[i][2]]+mp[a[i][3]]==3	)ans=1;

	for(int j=1;j<=3;j++)
		if(mp[a[1][j]]+mp[a[2][j]]+mp[a[3][j]]==3)ans=1;

	if(mp[a[1][1]]+mp[a[2][2]]+mp[a[3][3]]==3)ans=1;
	if(mp[a[1][3]]+mp[a[2][2]]+mp[a[3][1]]==3)ans=1;
	if(ans==1)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<typename T> istream& operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream& operator<<(ostream &os, vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream& operator<<(ostream &os, set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream& operator<<(ostream &os, pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream& operator<<(ostream &os, map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;

int N, M;
vector<int> A, B;

void output()
{
    for (auto v : A) cout << v << " ";
    cout << "\n" << B.size() << endl;
    for (auto v : B) cout << v << " ";
    cout << endl;
    exit(0);
}

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

    vector<int> odd;

    REP(_, M)
    {
        int tmp;
        cin >> tmp;
        if (tmp % 2) odd.push_back(tmp);
        else A.push_back(tmp);
    }

    if (N == 1)
    {
        A = B = vector<int>{1};
        output();
    }

    if (M == 1)
    {
        A = vector<int>{N};
        B = vector<int>{N - 1, 1};
        output();
    }

    if (odd.size() > 2) cout << "Impossible" << endl, exit(0);

    if (odd.size() == 2)
    {
        sort(odd.begin(), odd.end());
        if (odd[1] == 1)
        {
            B = A;
            A.insert(A.begin(), 1);
            A.push_back(1);
            B.push_back(2);
        }
        else if (odd[0] == 1)
        {
            B = A;
            A.insert(A.begin(), 1);
            A.push_back(odd[1]);
            B.push_back(odd[1] + 1);
        }
        else
        {
            A.insert(A.begin(), odd[0]);
            A.push_back(odd[1]);
            B = A;
            B[0]--;
            B.back()++;
        }
        output();
    }

    if (odd.size() == 1)
    {
        B = A;
        A.insert(A.begin(), odd[0]);
        if (odd[0] > 1) B.insert(B.begin(), odd[0] - 1);
        B.push_back(1);
        output();
    }

    if (odd.size() == 0)
    {
        B = A;
        B[0]--;
        B.back()++;
        output();
    }
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp;

fn run() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    let s = sc.read::<String>();
    let ans = s.chars().take(3).collect::<String>();
    println!("{}", ans);
}

fn main() {
    std::thread::Builder::new()
        .name("run".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(run)
        .unwrap()
        .join()
        .unwrap();
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn read_pairs<T: std::str::FromStr>(&mut self, n: usize) -> Vec<(T, T)> {
        (0..n).map(|_| (self.read(), self.read())).collect()
    }
    pub fn read_pairs_1_indexed(&mut self, n: usize) -> Vec<(usize, usize)> {
        (0..n)
            .map(|_| (self.read::<usize>() - 1, self.read::<usize>() - 1))
            .collect()
    }
    pub fn read_chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    pub fn read_char_grid(&mut self, n: usize) -> Vec<Vec<char>> {
        (0..n).map(|_| self.read_chars()).collect()
    }
    pub fn read_matrix<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n)
            .map(|_| (0..m).map(|_| self.read()).collect())
            .collect()
    }
}


Measured memory_bytes: 2224
#include <iostream>
using namespace std;
int main(void){
    int F[1000]={},a,b,N,s,f,p=0;
    cin>>a>>b>>N;
    for(int i=1;i<=N;i++){
        cin>>s>>f;
        for(int o=s;o<f;o++){
            F[o]=1;
        }
    }
    for(int i=a;i<b;i++){
        if(F[i]==1){
            p=1;
            break;
        }
    }
    cout<<p<<endl;
}


Measured memory_bytes: 3120
#pragma GCC optimize("O3")
//#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("avx2")
#define io_init cin.tie(0);ios::sync_with_stdio(0);cout<<setprecision(20)
#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

int main() {
	int N;
	cin >> N;
	vector<vector<pair<int, int>>> person(N, vector<pair<int, int>>());
	for (int i = 0; i < N; i++) {
		int A;
		cin >> A;
		for (int j = 0; j < A; j++) {
			int x, y;
			cin >> x >> y;
			x--;
			person[i].push_back({ x,y });
		}
	}
	int ans = 0;
	//bitが立っている人が正直
	for (int i = 0; i < (1 << N); i++) {
		bool flag = true;
		int cnt = 0;
		for (int j = 0; j < N; j++) {
			if ((i & (1 << j)) == 0)continue;
			cnt++;
			for (int k = 0; k < person[j].size(); k++) {
				if (((i & (1 << person[j][k].first)) != 0) != person[j][k].second)flag = false;
			}
		}
		if (flag)ans = max(ans, cnt);
	}
	cout << ans << endl;
}

Measured memory_bytes: 3636