akhauriyash/Code-Regression huggingface dataset:
import numpy as np
from itertools import product


def main():
    n, m = map(int, input().split())
    s = np.full((m, n), False, dtype=bool)

    for i in range(m):
        line = list(map(int, input().split()))
        for e in line[1:]:
            s[i][e-1] = True

    p = list(map(int, input().split()))

    ans = 0

    for pat in product((False, True), repeat=n):
        for i in range(m):
            if np.sum(np.logical_and(s[i], pat)) % 2 != p[i]:
                break
        else:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 27284
#include <bits/stdc++.h>
#include <string>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
    // メインプログラムここから
    string s1, s2, s3;
    
    cin >> s1 >> s2 >> s3;
    
    cout << "A" << s2[0] << "C" << endl;
    // ここまで
}

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

int main() {
    int R;
    cin >> R;
    double ans = 2 * R * PI;
    printf("%.2lf\n", ans);
}

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


#define long long long int

using namespace std;

typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef pair<int, int> pi;


int main() {
    std::ios_base::sync_with_stdio(false);

    int n, k;
    int count = 0;
    cin >> n >> k;
    while (n > 0){
        n /= k;
        count++;
    }
    cout << count;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace _0061
{
    class Program
    {
        static void Main(string[] args)
        {
            var inputsList = new Dictionary<string,int>();
            var outputsList = new List<string>();
            var rankList = new Dictionary<string, int>();

            while (true)
            {
                var input = Console.ReadLine();
                if (string.IsNullOrEmpty(input))
                {
                    break;
                }
                else
                {
                    var inputs = input.Split(',');
                    if (inputs.Count() == 2)
                        {
                            if (inputs[0] != "0")
                            {
                                inputsList.Add(inputs[0], int.Parse(inputs[1]));
                                rankList.Add(inputs[0], -1);
                            }
                        }
                        else
                        {
                            outputsList.Add(inputs[0]);
                        }
                }
            }
            CalculateRank(rankList, inputsList);

            foreach (var output in outputsList)
            {
                Console.WriteLine(rankList[output]);
            }
        }

        static void CalculateRank(Dictionary<string, int> rank, Dictionary<string, int> input) 
        {
            var list = input.OrderByDescending(p => p.Value);
            var rankNumber = 0;
            var score = 0;
            foreach (var team in list)
            {
                if (team.Value != score)
                {
                    score = team.Value;
                    rankNumber++;
                }
                rank[team.Key] = rankNumber;
            }        
        }
    }
}

Measured memory_bytes: 10572
use std::cmp;
use std::io;
use std::io::prelude::*;
use std::collections::BTreeMap;
use std::iter;

fn main() {
    let mut buf = String::new();
    let stdin = io::stdin();
    let mut lock = stdin.lock();

    lock.read_to_string(&mut buf);

    let mut iter = buf.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    let mut a = Vec::new();
    let mut map: BTreeMap<usize, Vec<usize>> = BTreeMap::new();

    for (i, h) in iter.map(|s| s.parse::<usize>().unwrap()).enumerate() {
        a.push(h);
        if map.contains_key(&h) {
            map.get_mut(&h).unwrap().push(i);
        } else {
            map.insert(h, vec![i]);
        }
    }

    if map.len() == 1 && map.contains_key(&0) {
        println!("0");
        return;
    }

    let mut sunk = iter::repeat(false).take(n).collect();
    let mut answer = 1;
    let mut lands = 1;

    for (&h, is) in map.iter() {
        for &i in is.iter() {
            fn connecting(v: &Vec<bool>, i: usize) -> isize {
                let left = i == 0 || v[i-1];
                let right = i == v.len() - 1 || v[i+1];

                match (left, right) {
                    (true, true) => -1,
                    (false, false) => 1,
                    _ => 0,
                }
            }

            lands += connecting(&sunk, i);
            sunk[i] = true;
        }

        answer = cmp::max(answer, lands);
    }

    println!("{}", answer);
}



Measured memory_bytes: 17208
class RMQ(object):
    INF = 2 ** 31 - 1

    def __init__(self, num) -> None:
        n = 1
        while n < num:
            n = n * 2
        self.n = n
        self.val = [self.INF] * (2 * n - 1)

    @staticmethod
    def merge(a: int, b: int) -> int:
        return min(a, b)

    def update(self, k: int, x: int) -> None:
        k = k + self.n - 1
        self.val[k] = x
        while k:
            k = (k - 1) // 2
            self.val[k] = self.merge(self.val[k * 2 + 1], self.val[k * 2 + 2])

    def dfs(self, beg: int, end: int, k: int, l: int, r: int) -> int:
        if (end <= l or r <= beg):
            return self.INF
        if (beg <= l and r <= end):
            return self.val[k]
        vl = self.dfs(beg, end, k * 2 + 1, l, (l + r) // 2)
        vr = self.dfs(beg, end, k * 2 + 2, (l + r) // 2, r)
        return self.merge(vl, vr)

    def query(self, beg: int, end: int) -> int:
        return self.dfs(beg, end, 0, 0, self.n)


if __name__ == "__main__":
    n, q = map(lambda x: int(x), input().split())
    rmq = RMQ(n)

    for _ in range(q):
        com, x, y = map(lambda x: int(x), input().split())
        if (0 == com):
            rmq.update(x, y)
        else:
            print(rmq.query(x, y + 1))



Measured memory_bytes: 8692
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 998244353;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<pair<int,ll>> vec;
typedef vector<string> svec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-8;

struct uf {
private:
	vector<int> par, ran;
public:
	uf(int n) {
		par.resize(n, 0);
		ran.resize(n, 0);
		rep(i, n) {
			par[i] = i;
		}
	}
	int find(int x) {
		if (par[x] == x)return x;
		else return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x), y = find(y);
		if (x == y)return;
		if (ran[x] < ran[y]) {
			par[x] = y;
		}
		else {
			par[y] = x;
			if (ran[x] == ran[y])ran[x]++;
		}
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
};

int c[1 << 17];

vector<int> G[1 << 17];
vector<P> ans;

void dfs(int id, int fr) {
	rep(j, G[id].size()) {
		int to = G[id][j];
		if (to == fr)continue;
		dfs(to, id);
	}
	if (fr >= 0) {
		if (c[id]) {
			ans.push_back({ id,fr });
		}
		else {
			ans.push_back({ fr,id });
			c[fr] ^= 1;
		}
	}
}
void solve() {
	int n, m; cin >> n >> m;
	vector<P> v;
	rep(i, m) {
		int a, b; cin >> a >> b; a--; b--;
		v.push_back({ a,b });
		//G[a].push_back(b);
		//G[b].push_back(a);
	}
	if (m % 2) {
		cout << -1 << endl; return;
	}
	uf u(n);
	vector<bool> used(m, false);
	rep(i, m) {
		int a = v[i].first, b = v[i].second;
		if (u.same(a, b))continue;
		u.unite(a, b); used[i] = true;
		G[a].push_back(b); G[b].push_back(a);
	}
	rep(i, m) {
		if (!used[i]) {
			ans.push_back(v[i]);
			c[v[i].first]^=1;
		}
	}
	dfs(0, -1);
	rep(i, m) {
		cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
	}
}

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

	//cout << fixed << setprecision(10);
	//init();
	solve();
	//stop
	return 0;
}



Measured memory_bytes: 17140
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<math.h>
#include<queue>
#include<functional>
#include<limits.h>
#include<set>
#define int long long
using namespace std;

int c[300000];
vector<int>X, Y;
signed main() {
	priority_queue<int, vector<int>, greater<int>>Q;
	int a; cin >> a;
	for (int b = 0; b < 3 * a; b++) {
		scanf("%lld", &c[b]);
	}
	int sum = 0;
	for (int i = 0; i < 2 * a; i++) {
		Q.push(c[i]);
		sum += c[i];
		if (Q.size() == a + 1) {
			sum -= Q.top();
			Q.pop();
		}
		if (Q.size() == a) {
			X.push_back(sum);
		}
	}
	priority_queue<int>P;
	sum = 0;
	for (int i = 3 * a - 1; i >= a; i--) {
		P.push(c[i]);
		sum += c[i];
		if (P.size() == a + 1) {
			sum -= P.top(); P.pop();
		}
		if (P.size() == a) {
			Y.push_back(sum);
		}
	}
	reverse(Y.begin(), Y.end());
	int ans = LLONG_MIN;
	for (int i = 0; i <= a; i++) {
		ans = max(ans, X[i] - Y[i]);
	}
	cout << ans << endl;
}

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

#define _GLIBCXX_DEBUG

//vector<int> A(M), B(M);
//vector<vector<char>> answer(N, vector<char>(N, '-'));

int main() {
  int x;
  
  cin >> x;
  
  if(x >= 30) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 3600
import java.util.Arrays;

//intのオーバーフローに気をつけろ,AGCはだいたいlongにしておけ
//毎回余りを求めることでオーバーフローしなくなる
//nextLineよりnextだ
//charは''で囲うんだぞ
//読み込みは先に全部やっておけ
//for文を回す回数に気をつけろ
	//for文は10^3の三重はTLE,10^5の二重はTLE,10^9のforはTLE
//貪欲は使えるか？？試した？？

import java.util.Scanner;

public class Main {

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

		    String s = sc.next();
		    String t = sc.next();
		    int count = 0;
		    if(s.length() > t.length()) {
		    	System.out.println("GREATER");
		    	count++;
		    }else if(t.length() > s.length()) {
		    	System.out.println("LESS");
		    	count++;
		    }else {
		    	for(int i = 0; i < s.length(); i++) {
		    		if(s.substring(i, i+1).equals(t.substring(i, i+1))) {
		    			continue;
		    		}else {
		    			int si = Integer.parseInt(s.substring(i,i+1));
		    			int ti = Integer.parseInt(t.substring(i,i+1));
		    			if(si > ti) {
		    				System.out.println("GREATER");
		    				count++;
		    			}else {
		    				System.out.println("LESS");
		    				count++;
		    			}
		    			break;
		    		}
		    	}
		    }
		    if(count == 0) {
		    	System.out.println("EQUAL");
		    }
		    
		    
		    
		    sc.close(); }

	public static void saiki(int a, String b) {
		//再帰コーディングのお手本

		if(a == 0) {
			System.out.println(b);
		}else {
			for(char ch = 'a'; ch <= 'c'; ch++) {
				saiki(a-1,b + ch);
			}
		}
	}

	public static  int gcd(int a, int b) {
	    if (a < b) {
	        int tmp = a;
	        a = b;
	        b = tmp;
	    }

	    int r = -1;
	    while (r != 0) {
	        r = a % b;
	        a = b;
	        b = r;
	    }

	    return a;
	}
}


Measured memory_bytes: 23760
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for(int i = (s); i < (int)(n); i++)
#define chmin(x, y) x = min(x, y)
typedef long long ll;
const int INF = 1001001001;
const int mod = 1000000007;

void dfs(int x, int y) {}

int main() {
    int N, K;
    cin >> N >> K;
    int64_t ans = K;

    for(int i = 1; i < N; i++){
        ans *= (K - 1);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
main(){
int n,i,A,B,C,f;
for(std::cin>>n;n-->0;puts(f?"NO":"YES"))
 for(B=C=f=i=0;i<10;i++){
  std::cin>>A;
  if(B<A)B=A;else C<A?C=A:f=1;
 }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
const int N = 55;
const int MM = 111;
const int mod = 1e9 + 7;
#define P pair<int, int>
#define mk_p make_pair
#define fs first
#define sc second
int head[N], nex[MM<<1], to[MM<<1], size = 1;
int n, m, K;
int col[N], dfn[N], low[N], cnt, tot, tp;
int sz_e[N], sz_v[N];
P zh[MM<<1];
int C[222][222];
inline int A(int x, int y){
    return x + y - (x + y >= mod ? mod : 0);
}
inline int M(int x, int y){
    return 1LL * y * x % mod;
}
int gcd(int x, int y){
    return !y ? x : gcd(y, x % y);
}
void add(int x, int y){
    to[++size] = y;
    nex[size] = head[x];
    head[x] = size;
}
int ksm(int base, int x){
    int ans = 1;
    while(x){
        if(x & 1)ans = M(ans, base);
        base = M(base, base);
        x >>= 1;
    }
    return ans;
}
void tarjan(int u, int lst){
    dfn[u] = low[u] = ++cnt;
    for(int i = head[u];i;i = nex[i]){
        if(i == lst)continue;
        int v = to[i];
		if(dfn[v] > dfn[u])continue;
        zh[++tp] = mk_p(u, v);
        if(!dfn[v]){
            tarjan(v, i ^ 1);
            low[u] = min(low[v], low[u]);
            if(low[v] >= dfn[u]){
                tot++;
				int x, y;
                do{
                    x = zh[tp].fs, y = zh[tp].sc;
                    sz_e[tot]++;
                    if(col[x] != tot)col[x] = tot, sz_v[tot]++;
                    if(col[y] != tot)col[y] = tot, sz_v[tot]++;
                    tp--;
                }while(x != u || y != v);
            }
        }
        else low[u] = min(low[u], dfn[v]);
    }
}
int main(){
    C[0][0] = 1;
    for(int i = 1;i <= 202; i++){
        C[i][0] = 1;
        for(int j = 1;j <= i; j++)C[i][j] = A(C[i-1][j], C[i-1][j-1]);
    }   
    cin>>n>>m>>K;
    int u, v;
    for(int i = 1;i <= m; i++){
        cin>>u>>v;
        add(u, v); add(v, u);
    }
    for(int i = 1;i <= n; i++){
        if(!dfn[i])tarjan(i, 0);
    }
    int ans = 1;
    for(int i = 1;i <= tot; i++){
        if(sz_e[i] == 1){
            ans = M(ans, K);
        }
        else if(sz_e[i] == sz_v[i]){
            int sum = 0;
            for(int j = 1;j <= sz_e[i]; j++){
                sum = A(sum, ksm(K, gcd(j, sz_e[i])));
            }
            sum = M(sum, ksm(sz_e[i], mod - 2));
            ans = M(ans, sum);
        }
        else ans = M(ans, C[K+sz_e[i]-1][K-1]);
    }
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

struct UnionFindTree {
  vector<int> par;
  int n;
  
  UnionFindTree(int _n) : n(_n) {
    par.resize(_n);
    for (int i = 0; i < _n; i++) {
      par[i] = i;
    }
  }
  
  int findParent(int v) {
    if (par[v] == v) return v;
    return par[v] = findParent(par[v]);
  }
  
  void merge(int x, int y) {
    x = findParent(x);
    y = findParent(y);
    if (x == y) return;
    else {
      par[y] = x;
    }
  }
};

int main()
{
  int N;
  vector< pair<int, int> > p;
  map<int, int> x_map, y_map;
  
  scanf("%d", &N);
  p.resize(N);
  vector<int> xs[N], ys[N];
  
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &p[i].first, &p[i].second);
    int x_id = (x_map.find(p[i].first) != x_map.end() ? x_map[p[i].first] : x_map.size());
    int y_id = (y_map.find(p[i].second) != y_map.end() ? y_map[p[i].second] : y_map.size());
    x_map[p[i].first] = x_id;
    y_map[p[i].second] = y_id;
    xs[x_id].push_back(i);
    ys[y_id].push_back(i);
  }
  
  UnionFindTree uf(N);
  
  for (int i = 0; i < x_map.size(); i++) {
    if (xs[i].size() >= 2) {
      for (int j = 1; j < xs[i].size(); j++) {
        uf.merge(xs[i][0], xs[i][j]);
      }
    }
  }
  
  for (int i = 0; i < y_map.size(); i++) {
    if (ys[i].size() >= 2) {
      for (int j = 1; j < ys[i].size(); j++) {
        uf.merge(ys[i][0], ys[i][j]);
      }
    }
  }
  
  set<int> gr_x[N], gr_y[N];
  for (int i = 0; i < N; i++) {
    gr_x[uf.findParent(i)].insert(p[i].first);
    gr_y[uf.findParent(i)].insert(p[i].second);
  }
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    ans += (long long)gr_x[i].size() * gr_y[i].size();
  }
  
  printf("%lld\n", ans - N);
  
  return 0;
}

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

int main() {
  int N, M, X;
  cin >> N >> M >> X;
  vector<int> C(N);
  vector<vector<int>> A(N, vector<int>(M));
  rep(i, N) {
    cin >> C.at(i);
    rep(j, M) {
      cin >> A.at(i).at(j);
    }
  }

  // 全パターン試す
  int ans = INT_MAX;
  for (int bits = 1; bits < (1 << N); bits++) {
    int cost = 0;
    vector<int> v(M, 0);
    for (int i = 0; i < N; i++) {
      if ((bits >> i) & 1) {
        // Ciが含まれる場合
        cost += C.at(i);
        rep(j, M) {
          v.at(j) += A.at(i).at(j);
        }
      }
    }

    bool res = true;
    rep(i, M) {
      if (v.at(i) < X) {
        res = false;
        break;
      }
    }
    if (res && cost < ans) {
      ans = cost;
    }
  }

  if (ans == INT_MAX) {
    ans = -1;
  }

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

Measured memory_bytes: 3568
import java.util.Scanner;

public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int h = n / 3600;
		n = n % 3600;
		int m = n /60;
		int s = n % 60;
		System.out.println(h + ":" + m + ":" + s);
	}
}


Measured memory_bytes: 17356
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp2
{
    class Program
    {
        const long mod = 1000000007;
        static int n;
        static void Main(string[] args)
        {
            n = int.Parse(Console.ReadLine());
            long ans = pow(10) + pow(8) - pow(9) * 2;
            while(ans < 0) ans += mod;
            ans %= mod;
            Console.WriteLine(ans);
        }

        static long pow(long a)
        {
            long t = 1;
            for (int i = 0; i < n; ++i)
            {
                t *= a;
                t %= mod;
            }
            return t;
        }
    }
}

Measured memory_bytes: 27504
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n; cin >> n;
  ll y; cin >> y;
  y /= 1000;
  for(int i=0; i*10<=y; i++) {
    for(int j=0; j*5<=y-i*10; j++) {
      int k = (y-i*10-j*5);
      if(i + j + k == n) {
        cout << i << ' ' << j << ' ' << k << "\n";
        return 0;
      }
    }
  }
  cout << -1 << ' ' << -1 << ' ' << -1 << "\n";
  return 0;
}


Measured memory_bytes: 3624
#include <cstddef>
#include <complex>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <array>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <limits>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <valarray>
#include <utility>
#include <tuple>
#include <cmath>
#include <memory>
#include <random>
#include <fstream>
#include <locale>

using ll = long long;
using ull = unsigned long long;

//vector
template <class T>
using vec = std::vector<T>;

template <class T>
using vvec = vec<vec<T>>;

constexpr std::size_t operator""_sz(ull n) { return std::size_t(n); }

int main()
{
    using namespace std;

    int H, W, h, w;
    cin >> H >> W >> h >> w;

    auto m = min(h, w);

    cout << (H * W - h * W - w * H + h * w) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <typeinfo>
#include <climits>
#include <algorithm>
#include <cctype>
#include <stdio.h>
#include <cstdlib>
using namespace std;

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

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
    string str;
    cin>>str;
    int i=0,c=0,maxi=0,j;
    while(str[i]!='\0')
    {
        c=0;
        if(str[i]=='R')
        {
            for(j=i;j<str.length();j++)
            {
                if(str[j]=='R')
                {
                    c++;
                }
                else
                {
                    break;
                }
            }
            if(c>maxi)
            {
                maxi=c;
            }
        }
        i++;
    }
    cout<<maxi;
}


Measured memory_bytes: 3636
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */

#define MAXN (100000)
#define MOD (1000000007)

int main(void)
{
    int a,b;
    scanf("%d %d",&a, &b);

    int ans[3] = {a+b,a-b,a*b};
    qsort(ans, 3, sizeof(int), des);
    printf("%d\n",ans[0]);

    return 0;
}





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

#define ld long double

using namespace std;

multiset <ld> st;

int main()
{
    int n;
    ld x;
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> x;
        st.insert(x);
    }
    while(st.size() > 1)
    {
        ld first = *st.begin();
        st.erase(st.begin());
        ld second = *st.begin();
        st.erase(st.find(second));
        ld s = (first + second) / 2.0;
        st.insert(s);
    }
    cout << fixed << setprecision(10) << *st.begin();
}


Measured memory_bytes: 256
import java.util.Scanner;
class Main{
    public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        char base=scn.next().charAt(0);
        //処理
        char answer='A';
        switch(base){
                case 'A':
                    answer='T';
                    break;
                case 'T':
                    answer='A';
                    break;
                case 'C':
                    answer='G';
                    break;
                case 'G':
                    answer='C';
                    break;
        }
        //出力
        System.out.println(answer);
    }
}

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

int main() {
  int n; cin >> n;
  int h[n]; REP(i, n) cin >> h[i];

  int dp[n];
  REP(i,n+1) dp[i] = INF;
  dp[0] = 0;
  for (int i = 1; i < n; i++) {
    int h1 = dp[i-1] + abs(h[i-1]-h[i]);
    int h2 = i-2 >= 0 ? dp[i-2] + abs(h[i-2]-h[i]) : INF;
    dp[i] = min(h1,h2);
  }
  cout << dp[n-1] << endl;
}

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

int main() {
        int i, j;
        int H, W, h, w;
        cin >> H >> W >> h >> w;
        if (W % w == 0 && H % h == 0) { 
                cout << "No" << endl;
                return 0;
        }
        cout << "Yes" << endl;
        bool f = false;
        if (H % h != 0 && W % w == 0) { 
                swap(W, H);
                swap(w, h);
                f = true;
        }
        vector<int> a(W);
        for (i = 0; i < w - 1; i ++) a[i] = 100000;
        a[w - 1] = -100000;
        for (i = w; i < W; i ++) a[i] = a[i - w] - 1;
        vector<int> b(W);
        for (i = 0; i < W; i ++) {
                if (i) {
                        b[i] = a[i] - a[i - 1];
                } else {
                        b[i] = a[i];
                }
        }
        if (!f) {
                for (i = 0; i < H; i ++) {
                        for (j = 0; j < W; j ++) {
                                if (j == W - 1) cout << b[j] << endl;
                                else cout << b[j] << " ";
                        }
                }
        } else {
                for (i = 0; i < W; i ++) {
                        for (j = 0; j < H; j ++) {
                                cout << b[i] << ' ';
                        }
                        cout << endl;
                }
        }
        return 0;
}


Measured memory_bytes: 2048
s = [int(input())]
for i in range(1000000):
	if s[i]%2==0:
		
		# print(s)
		if s[i]/2 in s:
			print(i+2)
			break
		s.append(s[i]/2)
	else:
		
		if 3*s[i]+1 in s:
			print(i+2)
			break
		s.append(3*s[i]+1)
	# print(s)


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

int main() {
  string s;
  int N; // N = Q
  cin >> s >> N;

  // 実際に反転するのは出力前でよい。反転を考慮して実装する。
  bool reverseFlag = false;

  for(int i = 0; i < N; ++i){
      int in;
      cin >> in;

      if(in == 1){
        if(reverseFlag) reverseFlag = false;
        else reverseFlag = true;

        continue;
      }

      string c;
      cin >> in >> c;
      if(in == 1){
          if(!reverseFlag){
              s.insert(0, c);
          }else if(reverseFlag){
              s.append(c);
          }
      }

      if(in == 2){
          if(reverseFlag){
              s.insert(0, c);
          }else if(!reverseFlag){
              s.append(c);
          }
      }
  }

  if(reverseFlag) {
      reverse(s.begin(), s.end());
  }
  cout << s << endl;
}


Measured memory_bytes: 900
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val x = sc.nextInt()
    val y = sc.nextInt()
    println(problemddcca(x, y))
}

fun problemddcca(x: Int, y: Int): Int {
    var sum = 0
    sum += when (x) {
        3 -> 100000
        2 -> 200000
        1 -> 300000
        else -> 0
    }
    sum += when (y) {
        3 -> 100000
        2 -> 200000
        1 -> 300000
        else -> 0
    }
    sum += if (x == 1 && y == 1) 400000 else 0
    return sum
}

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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> C(N);
  for(int i= 0; i<K;i++){
    int d;
    cin >> d;
    for(int j = 0;j<d;j++){
      int a;
      cin >> a;
      --a;
      ++C[a];
    }
  }
  int ans = count(C.begin(), C.end(),0);
  cout << ans << endl;
}

Measured memory_bytes: 3560
//
//  1129.c
//  
//
//  Created by Albert Hesse on 2018/08/07.
//


#include<stdio.h>

int n, r, p, c;
int i, j;
int a[50], b[50];

int main(void)
{
    while(1){
        scanf("%d %d", &n, &r);
        if(n==0&&r==0)
            break;
        for(i=0;i<n;i++)
            a[i]=n-i;
    
        for(i=0;i<r;i++){
            for(j=0;j<n;j++)
                b[j]=a[j];
    
            scanf("%d %d", &p, &c);
        
            for(j=0;j<c;j++)
                a[j]=b[p-1+j];
        
            for(j=c;j<c+p-1;j++)
                a[j]=b[j-c];
        }
        printf("%d\n", a[0]);
    }
    return 0;
}



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

int main()
{
	long long n;
	long long t=0;
	cin>>n;
	long double s=100.0f;
	while(1)
	{
		if(s>=(long double)n)
		{
			cout<<t<<endl;
			return 0;
		}
		s=1.01*s;
		s=(long long)s;
		t++;
	}
	return 0;

 } 

Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
  int N,K;
  cin>>N>>K;
  vector<int> A(N);
  for(int &i:A)
    cin>>i;
  vector<bool> B(K+1,false);
  for(int i=1;i<=K;i++)
    for(int k:A)
      if(i-k>=0)
        B[i]=B[i]||!(B[i-k]);
  cout<<(B[K]?"First":"Second")<<endl;
}

Measured memory_bytes: 3636
n = int(input())
s = []
for _ in range(n):
    s.append(input().split())
x = input()

m_l = []
for i in s:
    m_l.append(i[0])

t = []
for j in s:
    t.append(int(j[1]))

m_s = n - m_l.index(x) - 1

ans = 0

for r in range(m_l.index(x)+1,n):
    ans += t[r]
print(ans)

Measured memory_bytes: 3064
#![allow(unused)]

#[allow(unused_imports)]
use std::{cmp, collections, fmt, io, iter, ops, str};
use cmp::Ordering::*;
use collections::{HashMap, HashSet};
use io::{Read, Write};

#[cfg(feature = "debug")]
macro_rules! debug {
    ($fmt: expr) => { eprintln!($fmt) };
    ($fmt: expr, $($arg: tt)*) => { eprintln!($fmt, $($arg)*) };
}

#[cfg(not(feature = "debug"))]
macro_rules! debug {
    ($fmt: expr) => {};
    ($fmt: expr, $($arg: tt)*) => {};
}

fn read_line() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().to_owned()
}

fn read_word() -> String {
    const CAPACITY: usize = 16;

    let mut stdin = io::stdin();
    let mut byte: [u8; 1] = [0];

    loop {
        let mut buf = Vec::with_capacity(CAPACITY);

        loop {
            let res = stdin.read(&mut byte);

            if res.unwrap_or(0) == 0 || byte[0] <= b' ' {
                break;
            } else {
                buf.push(byte[0]);
            }
        }

        if buf.len() > 0 {
            return String::from_utf8(buf).unwrap();
        }
    }
}

fn parse_line<T: str::FromStr>() -> T {
    read_line().parse().ok().unwrap()
}

fn parse_word<T: str::FromStr>() -> T {
    read_word().parse().ok().unwrap()
}

fn parse_vec<T: str::FromStr>() -> Vec<T> {
    read_line()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn flush() {
    io::stdout().flush();
}

fn main() {
    let n = parse_line::<usize>();
    let data = parse_vec::<i32>();

    let mut sorted = data.clone();
    sorted.sort();

    let mid_left = sorted[n / 2 - 1];
    let mid_right = sorted[n / 2];

    for i in 0..n {
        if data[i] <= mid_left {
            println!("{}", mid_right);
        } else {
            println!("{}", mid_left);
        }
    }
}


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

int main()
{
    int n, k, ans = 0;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    for (int l = 0; l <= k; l++)
    {
        for (int r = 0; r <= k - l; r++)
        {
            if (l + r > n)
                continue;
            vector<int> p;
            int count = 0;
            for (int i = 0; i < r; i++)
            {
                int x = a[n - 1 - i];
                p.push_back(x);
            }
            for (int i = 0; i < l; i++)
            {
                int x = a[i];
                p.push_back(x);
            }
            sort(p.begin(), p.end(), greater<int>());
            for (int i = l + r + 1; i <= k; i++)
            {
                if (p.size() == 0)
                    break;
                if (p.back() <= 0)
                    p.pop_back();
                else
                    break;
            }
            count = accumulate(p.begin(), p.end(), 0);
            ans = max(ans, count);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: String = read();
    let b: String = read();
    let x: usize = format!("{}{}", a, b).parse().ok().unwrap();
    let y = (x as f64).sqrt() as usize;
    println!("{}", if y * y == x { "Yes" } else { "No" });
}

Measured memory_bytes: 4352
/*
    1 2 3
  1 2 3 4 = a
  2 3 4 5
  3 4 5 6
  
  1 - 2 b
  2 - 3 b
*/
#include <bits/stdc++.h>
using namespace std;

int main() {
    int c[3][3];
    int a[3],b[3];
    bool ans = true;
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++){
            cin >> c[i][j];
        }
    }
    for (int i = 0; i < 3; i++){
        a[i] = c[0][i];
    }
    b[0] = 0;
    b[1] = c[1][0]-a[0];
    b[2] = c[2][0]-a[0];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            if (c[i][j] != a[j] + b[i]) {
                ans = false;
                break;
            }
        }
    }
    if (ans) {
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}




Measured memory_bytes: 256
N,M,X=[int(i) for i in input().split()]
C=[0]*N
A=[[] for i in range(N)]
for n in range(N):
    tmp=[int(i) for i in input().split()]
    C[n]=tmp[0]
    A[n]=tmp[1:]
Cmin=100000000000
minW=Cmin
for i in range(2**N):
    W=0
    T=[0]*M
    I=i
    cnt=0
    while I>0:
        if I%2==1:
            W+=C[cnt]
            T=[T[j]+A[cnt][j] for j in range(M)]
        cnt+=1
        I//=2
    if X<=min(T) and minW>W:
        minW=W
print(minW if minW!=Cmin else -1)


Measured memory_bytes: 9228
#include <stdio.h>

int main(void)
{
        int a,b,c,d;
        scanf("%d%d%d%d",&a,&b,&c,&d);
        if(a*b==c*d)printf("%d\n",c*d);
        else if(a*b>c*d)printf("%d\n",a*b);
        else printf("%d\n",c*d);
        return 0;
}


Measured memory_bytes: 1728
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "cmath"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

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

	cin >> N;
	map<int, int>m;
	for (int i = 0; i < N; i++) {
		cin >> M;
		m[M]++;
	}
	for (auto i : m) {
		if (i.first > i.second) {
			K += i.second;
		}
		else {
			K += i.second - i.first;
		}
	}
	cout << K << endl;
	return 0;
}

Measured memory_bytes: 4736
#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; }

int main(){
    int a,b,h; cin >> a >> b >> h;
    cout << (a+b) * h / 2 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define eb emplace_back
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 233;
int main()
{
	int n;cin>>n;
	ll sum = 0,ans = 0;
	for(int i=1;i<=n;i++){
		ll c;int d;
		scanf("%d%lld",&d,&c);
		ans += c;
		sum += d*c;
	}
	ans += (sum-1)/9;
	cout << ans-1 << endl;
}


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

typedef long long ll;
const ll INF = 1e18;
const int BIG = 1e9 + 555;
const int maxN = 2e5 + 55;

int n;

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

	cin >> n;
	
	multiset<ll> se;
	for(int i = 1; i <= n; i++){
		ll x;	cin >> x;	
		se.insert(x);
	}
	
	int ans = 0;
	while(!se.empty()){
		ll mx = *se.rbegin();
		ll target = 1;
		while(target <= mx){
			target *= 2;
		}
		se.erase(se.find(mx));
		target -= mx;
		if(se.count(target)){
			ans++;
			se.erase(se.find(target));
		}
	}
	
	cout << ans << '\n';

	return 0;
}

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

using namespace std;

int f(int a, int b) {

    if (a >= 13) {
        return b;
    } else if (a >= 6) {
        return b / 2;
    }

    return 0;
}

int main() {

    int a, b;
    cin >> a >> b;

    int result = f(a, b);
    cout << result << endl;

    return 0;
}


Measured memory_bytes: 256
r, g, b, n = input().split()

r = int(r)
g = int(g)
b = int(b)
n = int(n)

max_r = n // r

count = 0

for ir in range(max_r + 1):
    remaining = n - r * ir
    max_g = remaining // g
    for ig in range(max_g + 1):
        remaining = n - r * ir - g * ig
        if remaining % b == 0:
            count += 1

print(count)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef map<int, int> mi;
typedef set<int> si;
#define VV(T) vector<vector< T > >
#define dump(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl

#define rep(i, n) REP(i, 0, n)                              // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++)             // x, x + 1, ..., n-1
#define invrep(i, n) for(int i = (n)-1; i >= 0; i--)        // n-1, n-2, ..., 0
#define invREP(i, x, n) for(int i = (n)-1; i >= (x; i--)    // n-1, n-2, ..., x
#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(v) (v).begin() , (v).end()
#define RALL(v) (v).rbegin(), (v).rend()

#define PB push_back

#define COUT(x) cout << (x) << endl
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl

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


int main(){
    int N, M; cin >> N >> M;
    vi X(M);
    rep(i, M) cin >> X[i];
    sort(ALL(X));
    vi L;
    REP(i, 1, M){
        L.push_back(abs(X[i] - X[i - 1]));
    }
    sort(ALL(L));
    ll ans = 0;
    rep(i, M - N){
        ans += L[i];
    }
    COUT(ans);
}


Measured memory_bytes: 1276
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    string S;
    cin >> S;
    deque<string> dq;
    int len_S = S.size();
    rep(i,len_S){
        dq.push_back(S.substr(i,1));
    }
    int reverse_count = 0;
    int Q;
    cin >> Q;
    rep(i,Q){
        int T;
        cin >> T;
        if (T == 1){
            reverse_count++;
        }
        else if (T == 2){
            int F;
            string C;
            cin >> F >> C;
            if (F == 1){
                if (reverse_count % 2 == 0) dq.push_front(C);
                else dq.push_back(C);
            }
            else{
                if (reverse_count % 2 == 0) dq.push_back(C);
                else dq.push_front(C);
            }
        }
    }
    int len_dq = dq.size();
    if (reverse_count % 2 == 0){
        rep(i,len_dq){
            cout << dq.front();
            dq.pop_front();
        }
        cout << endl;
    }
    else{
        rep(i,len_dq){
            cout << dq.back();
            dq.pop_back();
        }
        cout << endl;
    }
}


Measured memory_bytes: 17152
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>
#include <cassert>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

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

typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using uInt = long long unsigned int;
using Double = long double;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//edit
class Solve {
public:
    void solve() {
//        string s;
//        cin >> s;
//        for (auto e : s) {
//            if (e == '7') {
//                cout << "Yes" << endl;
//                return;
//            }
//        }
//        cout << "No" << endl;

        Int N;
        cin >> N;
        Int ans = N * (N + 1) / 2;
        Int dec3 = (N / 3) * (N / 3 + 1) / 2 * 3;
        Int dec5 = (N / 5) * (N / 5 + 1) / 2 * 5;
        Int add15 = (N / 15) * (N / 15 + 1) / 2 * 15;
        ans -= dec3;
        ans -= dec5;
        ans += add15;

        cout << ans << endl;

    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
//    std::ifstream in("input.txt");
//    std::cin.rdbuf(in.rdbuf());

    Solve().solve();


    return 0;
}


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

const int32_t MAX_K = 100;
const int32_t MAX_N = 1e5;

bool dp[MAX_N + 5];
int32_t a[MAX_K + 5];

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

	int32_t n, k;
	std::cin >> n >> k;

	for(int32_t i = 0; i < n; i++) {
		std::cin >> a[i];
	}

	dp[0] = false;
	for(int32_t i = 1; i <= k; i++) {
		dp[i] = false;
		for(int32_t j = 0; j < n; j++) {
			if(a[j] <= i && dp[i - a[j]] == false) {
				dp[i] = true;
				break;
			}
		}
	}

	std::cout << (dp[k] ? "First" : "Second") << '\n';
}



Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int main()
{
	int a;
	cin >> a;
	cout << a + a * a + a * a * a << endl;
}

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

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

    bool flag = false;

    for(int i = 1; i < 10; ++i) {
        if(N % i == 0 && flag == false) {
            if(N / i < 10) {
                cout << "Yes" << endl;
                flag = true;
            }
        }
    }

    if(flag == false) {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using ll = long long int;
using vec = vector<int>;
using P = pair<int,int>;
const int INF = 1e9+7;

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

  int x = 1000 - n % 1000;
  if (x == 1000) {
    cout << 0 << endl;
  } else {
    cout << x << endl;
  }
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	int n;
	cin >> n;
	
	int ans = 0;
	for(int i = 1; i <= n; ++i) {
		int x = i;
		int cnt = 0;
		int tmp = 0;
		
		while( x ) {
			tmp = x % 10;
			x /= 10;
			cnt++;
		}
		
		if( cnt % 2 != 0 ) ans++; 
	}
	
	cout << ans << endl;
	
	return 0;
}


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

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

const int MAX = 2000020;
const int MOD = 1e9+7;

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

ll modpow(ll x,ll n){
  ll ans=1;
  while(n){
    if(n&1) ans=ans*x %MOD;
    x=x*x %MOD;
    n/=2;
  }
  return ans;
}

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  COMinit();
  
  ll k;
  string s;
  cin>>k>>s;
  
  ll n=s.size();
  
  ll ans=0;
  rep(i,k+1){
    ans=(ans+(((COM(n+k-i-1,n-1)*modpow(25,k-i))%MOD)*modpow(26,i))%MOD)%MOD;
  }
  
  cout<<ans<<endl;
    
  return 0;
}

Measured memory_bytes: 51144
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n,m) for (int i=n; i<m; i++)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl
#define Size(n) (n).size()

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

	int n,y,x,b,c,f=0,t=0;
	cin>>n>>y;
	
    if (y%1000 != 0 || y > n*10000) {
        cout<<"-1 -1 -1"<<"\n";
        return 0;
    }
    if (y==n*10000){
        cout<<to_string(n)+" 0 0"<<"\n";
        return 0;
    }

    x = (n*10000 - y)/1000;
    
    //x=5a+9bとなる正の整数a,bが存在するか
    b=x/9;

    REP(i,b+1){
        if((x-9*i)%5==0 && 0<=(x-9*i)/5 && (x-9*i)/5<=n-i){
            f=(x-9*i)/5;
            t=i;
            break;
        }
    }
    if (t+f==0){
        cout<<"-1 -1 -1"<<"\n";
        return 0;
    }

    cout<<to_string(n-f-t)+" "+to_string(f)+" "+to_string(t)<<"\n";

}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;

long gcd(long a, long b)
{
    if (a < b)
        return gcd(b, a);

    if (b == 0)
        return a;

    return gcd(b, a % b);
}

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

    vector<long> A(N);
    for (int i = 0; i < N; ++i)
        cin >> A[i];

    long g = A[0];
    for (long a : A) {
        g = gcd(g, a);
    }

    long mx = *max_element(A.begin(), A.end());
    bool possible = false;
    if (K <= mx) {
        possible = (K % g == 0);
    }

    cout << (possible ? "POSSIBLE" : "IMPOSSIBLE") << '\n';

    return 0;
}


Measured memory_bytes: 1024