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

#define loop(s, e, i) for (int i = s; i < e; ++i)
#define print(s) cout << s << endl;
using namespace std;
using ll = long long;
using lld = long long;

/*
浮動小数点の入力
cout << fixed << setprecision(9) << endl;
*/

ll gcd(ll a, ll b)
{
  if (a < b)
  {
    return gcd(b, a);
  }
  while (b != 0)
  {
    ll tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}

map<ll, ll> MAP;

void prime_factor(ll n) {
  ll a = 2;
  set<ll> inserted;

  while (a * a <= n) {
    if (n % a == 0) {
      n /= a;
      if (inserted.find(a) == inserted.end()) {
        if (MAP.find(a) != MAP.end()) {
          MAP[a] += 1;
        } else {
          MAP[a] = 1;
        }
        inserted.insert(a);
      }
    } else {
      a++;
    }
  }
  if (n==1) {
    return;
  }
  if (inserted.find(n) == inserted.end()) {
    if (MAP.find(n) != MAP.end()) {
      MAP[n] += 1;
    } else {
      MAP[n] = 1;
    }
  }
        
}

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

  ll N;
  cin >> N;
  vector<ll> A(N);

  loop(0, N, i) {
    cin >> A[i];
    prime_factor(A[i]);
  }

  bool is_pair = true;
  bool is_set = true;
  for(auto& [key, value] : MAP) {
    if (value != 1) {
      is_pair = false;

    }
    if (value == A.size()) {
      is_set = false;
    }
  }
  if (is_pair && is_set) {
    print("pairwise coprime");
  } else if (is_set) {
    print("setwise coprime");
  } else {
    print("not coprime");
  }
}

Measured memory_bytes: 15812
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

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

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

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

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

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

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

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

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

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

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

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    int n = sc.nextInt();
    String[] w = new String[n];
    for (int i = 0; i < n; i++) {
      w[i] = sc.next();
    }
    boolean pass = true;
    Set<String> used = new HashSet<>();
    used.add(w[0]);
    for (int i = 1; i < n; i++) {
      if (used.contains(w[i]) || w[i - 1].charAt(w[i - 1].length() - 1) != w[i].charAt(0)) {
        pass = false;
        break;
      }
      used.add(w[i]);
    }
    System.out.println(pass ? "Yes" : "No");
  }
}

Measured memory_bytes: 21204
#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
const int INF = 1 << 28;
inline pair<int, int> inputPos(){
	string str;
	cin >> str;
	return pair<int, int>(str[0] - 'a', atoi(str.c_str() + 2) - 1);
}

int m, n;
int D;
int sign[20][20];
int cant[20][20][20][20];
int cst[20][20][20][20];
pair<int, int> sp, gp;

bool ok(int x, int y){
	return x >= 0 && x < m && y >= 0 && y < n;
}

void solve()
{
	static int dist[101][20][20][4];
	fill_n(***dist, 101 * 20 * 20 * 4, INF);
	dist[0][sp.first][sp.second][3] = 0;
	for (int t = 0; t < 100; t++){
		for (int x = 0; x < m; x++){
			for (int y = 0; y < n; y++){
				for (int d = 0; d < 4; d++){
					if (dist[t][x][y][d] == INF) continue;
					for (int dd = 3; dd <= 5; dd++){
						int dir = (d + dd) % 4;
						int nx = x + dx[dir];
						int ny = y + dy[dir];
						if (!ok(nx, ny)) continue;
						if (cant[x][y][nx][ny]) continue;
						int nt = t + D + cst[x][y][nx][ny];
						if (nt > 100) continue;
						if (sign[nx][ny]){
							if ((nt / sign[nx][ny] + dir) % 2 == 1){
								continue;
							}
						}
						dist[nt][nx][ny][dir] = min(dist[nt][nx][ny][dir], nt);
					}
				}
			}
		}
	}
	
	for (int t = 0; ; t++){
		for (int d = 0; d < 4; d++){
			if (dist[t][gp.first][gp.second][d] < INF){
				printf("%d\n", dist[t][gp.first][gp.second][d]);
				return;
			}
		}
	}
}

int main()
{
	while (scanf("%d %d", &m, &n), m){
		memset(sign, 0, sizeof(sign));
		memset(cant, 0, sizeof(cant));
		memset(cst, 0, sizeof(cst));
		
		scanf("%d", &D);
		
		int ns;
		scanf("%d", &ns);
		for (int i = 0; i < ns; i++){
			pair<int, int> pos = inputPos();
			int k;
			scanf("%d", &k);
			sign[pos.first][pos.second] = k;
		}
		
		int nc;
		scanf("%d", &nc);
		for (int i = 0; i < nc; i++){
			pair<int, int> pos1 = inputPos();
			pair<int, int> pos2 = inputPos();
			cant[pos1.first][pos1.second][pos2.first][pos2.second] = true;
			cant[pos2.first][pos2.second][pos1.first][pos1.second] = true;
		}
		
		int nj;
		scanf("%d", &nj);
		for (int i = 0; i < nj; i++){
			pair<int, int> pos1 = inputPos();
			pair<int, int> pos2 = inputPos();
			int d;
			scanf("%d", &d);
			cst[pos1.first][pos1.second][pos2.first][pos2.second] += d;
			cst[pos2.first][pos2.second][pos1.first][pos1.second] += d;
		}
		
		sp = inputPos();
		gp = inputPos();
		
		solve();
	}
}

Measured memory_bytes: 3104
#include <iostream>
#include <array>
#include <map>
#include <algorithm>
#include <cmath>
#include <vector>
#include <fstream>
#include <string>
#include <random>
#include <queue>
#include <iomanip>
#include <functional>
#include <climits>
#include <tuple>
#include <unordered_map>
#include <limits>
#include <functional>
#include <cassert>
#include <numeric>
#include <bitset>

#define FOR(x,n) for(int x = 0; x < n; x++)
#define INPUT(x) scanf("%d",&x);
#define PUT(x) cout << x << endl
#define DPUT(x) printf("%.15lf\n",x)
#define GET(x,y) std::get<x>(y)
#define CHMAX(x,y) x = std::max(x,y)
#define CHMIN(x,y) x = std::min(x,y)
#define SP_END (i != n - 1 ? ' ' : '\n') ;

using namespace std;

using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vll = std::vector<ll>;
using vpll = std::vector<pll>;
using vpii = std::vector<pii>;
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using vvpii = std::vector<vpii>;
using vch = std::vector<char>;
using vvch = std::vector<vch>;
using tiii = std::tuple<int, int, int>;

const ll mod197 = 1000000007LL;
const ll INF = 10000000000LL;

const double PI11 = 3.14159265359;

const int dis[5] = { 0,1,0,-1,0 };

const int disD[4] = { 0,1,1,0 };
const int disLD[3] = {0,1,0};

const char disC[4] = { 'U','D','R','L' };
const char disY[4] = { -1,1,0,0 };
const char disX[4] = { 0,0,1,-1 };

char field[52][52] = {};

int main(void)
{

	int H, W,count = 0,answer = 0;

	cin >> H >> W;

	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			cin >> field[i][j];
			if (field[i][j] == '.') {
				count++;
			}
		}
	}

	queue<tiii> q;

	q.push(tiii{1,1,1});

	while (!q.empty()) {
		tiii now = q.front();
		q.pop();

		if (field[get<0>(now)][get<1>(now)] == '.') {

			if (get<0>(now) == H && get<1>(now) == W) {
				cout << count - (get<2>(now)) << endl;
				return 0;
			}
			
			field[get<0>(now)][get<1>(now)] = '#';

			for (int i = 0; i < 4; i++) {
				q.push(tiii{ get<0>(now) +dis[i],get<1>(now) +dis[i+1],get<2>(now) + 1});
			}

			/*
			cerr << get<0>(now) << ":" << get<1>(now) << endl;
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					cerr << field[i][j];
				}
				cerr << endl;
			}
			cerr << endl;
			/**/

		}

	}

	cout << -1 << endl;


	return 0;
}



Measured memory_bytes: 256
def divide_2(t):
  global now
  now = 0
  for i in range(10**5):
    if t%2 == 1:
      return now
      break
    else:
      t = t//2
      now += 1
now = 0
N = int(input())
A = list(map(int,input().split()))
k = []
for i in range(N):
  k.append(divide_2(A[i]))
print(min(k))

Measured memory_bytes: 3064
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


def main():
    N = input()
    a = sum([int(c) for c in N])
    print("Yes" if int(N) % a == 0 else "No")


if __name__ == '__main__':
    main()


Measured memory_bytes: 3888
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
#include<typeinfo>
#include<complex>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(ll i = a;i < b; i++)
const long double PI = (acos(-1));

int main() {

	int n;
	cin >> n;

	cout << 1110 - n << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef pair<int,int> pa;
#define w1 first
#define w2 second
#define ls (x<<1)
#define rs (x<<1|1)
#define pb push_back
#define mp make_pair
#define mid ((l+r)>>1)
#define SZ(x) ((x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
#define rep2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define per(i,a,b) for(int (i)=(a);(i)>=(b);(i)--)
#define Rep(p,x) for(int (p)=head[(x)];(p);(p)=nxt[(p)])
template<class T>void read(T&num){
	num=0;T f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar();
	num*=f;
}
int power(int x,int k,int p){int res=1;for(;k;k>>=1,x=1ll*x*x%p)if(k&1)res=1ll*res*x%p;return res;}
int getgcd(int x,int y){return !x?y:getgcd(y%x,x);}
const int maxn=1e5+5;
int n,k,tot,ans;
int a[maxn];
int head[maxn],des[maxn<<1],nxt[maxn<<1];
void adde(int x,int y){
	des[++tot]=y;nxt[tot]=head[x];head[x]=tot;
}
int dfs(int x,int fa){
	int dep=0;
	Rep(p,x)if(des[p]!=fa)dep=max(dep,dfs(des[p],x));
	dep++;
	if(x!=1){
		if(fa!=1&&dep==k)ans++,dep=0;
		if(fa==1&&dep==k+1)ans++,dep=0;
	}
	return dep;
}
int main(){
	read(n);read(k);
	rep(i,1,n)read(a[i]);
	ans=(a[1]!=1);
	rep(i,2,n)adde(a[i],i);
	dfs(1,0);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 6528
#include <iostream>
#include <string>
#include <algorithm>
#include <stdlib.h>
#include <iomanip>
#include <vector>
#include <cmath>
#include <bits/stdc++.h>
using namespace std;
//typedef long long unsigned int ll;
typedef long long ll;
typedef pair<ll, ll> p;
//typedef tuple<ll, ll, ll> tp;
const ll INF = 1e18;
const ll mod = 1e9+7;

int main() {
  ll n,m;
  cin >> n >> m;
  vector<p> vc(n);
  for (int i=0;i<n;i++){
    ll a, b;
    cin >> a >> b;
    vc[i] = p(a,b);
  }
  sort(vc.begin(), vc.end(), greater<p>());
  //cout << vc.back().first << vc.back().second << endl;
  
  priority_queue<p> que;
  ll sum = 0;
  for(ll i=1;i<=m;i++){
    while(1){
      p p1 = vc.back();
      if (p1.first == i){
        vc.pop_back();
        que.push(p(p1.second, p1.first));
      }
      else break;
    }
    if (!que.empty()){
      p p2 = que.top(); que.pop();
      sum += p2.first;
    }
    //cout << sum << endl;
  }
  
  cout << sum << endl;
}

Measured memory_bytes: 3956
#include <bits/stdc++.h>
#define Int int64_t

using namespace std;

void chmax(Int& a, Int b) { if (a < b) { a = b; } };

int main() {
	int R, C, K;
	cin >> R >> C >> K;
	vector<vector<Int>> V(R, vector<Int>(C, 0));
	for (int i = 0; i < K; ++i) {
		int r, c, v;
		cin >> r >> c >> v;
		V[r-1][c-1] = v;
	}

	vector<vector<vector<Int>>> dp(R, vector<vector<Int>>(C, vector<Int>(4, 0)));
	for (int i = 0; i < R; ++i) {
		for (int j = 0; j < C; ++j) {
			for (int k = 0; k <= 3; ++k) {
				if (k < 3) {
					if (i + 1 < R) {
						chmax(dp[i + 1][j][0], dp[i][j][k] + V[i][j]);
					}
					if (j + 1 < C) {
						chmax(dp[i][j + 1][k + 1], dp[i][j][k] + V[i][j]);
					}
				}
				if (i + 1 < R) {
					chmax(dp[i + 1][j][0], dp[i][j][k]);
				}
				if (j + 1 < C) {
					chmax(dp[i][j + 1][k], dp[i][j][k]);
				}
			}
		}
	}

	Int ans = 0;
	for (int i = 0; i <= 3; ++i) {
		chmax(ans, dp[R-1][C-1][i] + (i < 3 ? V[R-1][C-1] : 0));
	}
	cout << ans << "\n";

	return 0;
}


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

vector<vector<int>> g;
vector<int> id;
vector<ll> sum;

int f(int x, int ida){
	id.at(x) = ida;
	rep(i, g.at(x).size()){
		if(id.at(g.at(x).at(i)) != ida) f(g.at(x).at(i), ida);
	}
	return 0;
}

int main(){
	int n, m;
	cin >> n >> m;
	vector<vector<int>> ce(m, vector<int>(2));
	rep(i, m) cin >> ce.at(i).at(0) >> ce.at(i).at(1);
	g = vector<vector<int>>(n, vector<int>(0));
	id = vector<int>(n);
	sum = vector<ll>(n);
	vector<ll> a(m);
	ll ans = n;
	ans *= (n-1);
	ans /= 2;
	rep(i, n){
		id.at(i) = i;
		sum.at(i) = 1;
	}
	for(int i=m-1; i>0; i--){
		int c0 = ce.at(i).at(0) -1;
		int c1 = ce.at(i).at(1) -1;
		a.at(i) = ans;
		if(id.at(c0) != id.at(c1)){
			ans -= sum.at(id.at(c0)) * sum.at(id.at(c1));
			if(sum.at(id.at(c0)) < sum.at(id.at(c1))){
				sum.at(id.at(c1)) = sum.at(id.at(c0)) + sum.at(id.at(c1));
				f(c0, id.at(c1));
			}else{
				sum.at(id.at(c0)) = sum.at(id.at(c0)) + sum.at(id.at(c1));
				f(c1, id.at(c0));
			}
			g.at(c0).push_back(c1);
			g.at(c1).push_back(c0);
		}
	}
	a.at(0) = ans;
	rep(i, m) cout << a.at(i) << endl;
	return 0;
}

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

int N;
string S;

signed main() {
  cin >> N >> S;
  char p = '0';
  int ans = 0;
  for(auto s : S) {
    if(s!=p) ans++;
    p = s;
  }
  cout << ans << endl;
}


Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<string>
#include<sstream>
#include<chrono>
#include<algorithm>
#include<functional>
#include<cstdlib>
#include<numeric>
#include<queue>
#include<stack>
using namespace std;
typedef unsigned long long ull;
int main()
{
	unsigned long long n = 0;
	cin >> n;

	//3,5,15の倍数を除けば良い

	unsigned long long sum = 0;
	ull th = 3;
	ull fi = 5;
	for (unsigned long long i = 0; i <= n; i++)
	{
		if (i % th != 0 && i % fi != 0)sum += i;
	}
	std::cout << sum << std::endl;
}

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

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define iter(v, i) for (__typeof__((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define fast_io_without_cstdio ios_base::sync_with_stdio(false), cin.tie(NULL)
#define all(v) (v).begin(), (v).end()

#ifdef __linux__
#define gc getchar_unlocked
#define pc putchar_unlocked
#else
#define gc getchar
#define pc putchar
#endif

#if __cplusplus <= 199711L
template<class BidirIt>
BidirIt prev(BidirIt it, typename iterator_traits<BidirIt>::difference_type n = 1) {
    advance(it, -n);
    return it;
}

template<class ForwardIt>
ForwardIt next(ForwardIt it, typename iterator_traits<ForwardIt>::difference_type n = 1) {
    advance(it, n);
    return it;
}
#endif

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

const double EPS = 1e-9;
const double PI = 3.141592653589793238462;

template<typename T>
inline T sq(T a) { return a * a; }

const int MAXN = 1e5 + 10;

map<int, vi> xmap;
int a[MAXN], b[MAXN];
ll cnt[10];
int H, W;

set<ii> visit;

int check(int x, int y) {
    if (x <= 0 || y <= 0)
        return -1;
    if (x + 2 > H || y + 2 > W)
        return -1;
    if (visit.count(mp(x, y)))
        return -1;
    visit.insert(mp(x, y));
    int res = 0;
    for (int add = 0; add < 3; add++) {
        if (!xmap.count(x + add)) continue;
        vi &cur = xmap[x + add];
        auto it = lower_bound(all(cur), y);
        while (it != cur.end() && *it < y + 3) {
            res++;
            it++;
        }
    }
    return res;
}

int main() {
    //freopen("", "rt", stdin);
    //freopen("", "wt", stdout);
    int N;
    scanf("%d %d %d", &H, &W, &N);
    for (int i = 0; i < N; i++) {
        scanf("%d %d", &a[i], &b[i]);
        xmap[a[i]].pb(b[i]);
    }
    for (auto &it : xmap)
        sort(all(it.se));
    for (int i = 0; i < N; i++) {
        int x0 = a[i] - 2;
        int y0 = b[i] - 2;
        for (int x = x0; x < x0 + 5; x++)
            for (int y = y0; y < y0 + 5; y++) {
                int res = check(x, y);
                if (res != -1)
                    cnt[res]++;
            }
        /*if (a[i] + 2 > H) continue;
        if (b[i] + 2 > W) continue;
        int c = 0;
        for (int add = 0; add < 3; add++) {
            if (!xmap.count(a[i] + add)) continue;
            vi &cur = xmap[a[i] + add];
            auto it = lower_bound(all(cur), b[i]);
            while (it != cur.end() && *it < b[i] + 3) {
                c++;
                it++;
            }
        }
        cnt[c]++;*/
    }
    ll sum = 0;
    for (int i = 1; i < 10; i++)
        sum += cnt[i];
    cnt[0] = (H - 2) * 1LL * (W - 2) - sum;
    for (int i = 0; i < 10; i++)
        printf("%lld\n", cnt[i]);
    return 0;
}



Measured memory_bytes: 129152
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

const int MOD_TYPE = 1;
const ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const double PI = acos(-1.0);

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#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 Yay(n) cout << ((n) ? "Yay!" : ":(") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << endl;

vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[100];
  rep(i, n) cin >> a[i];
  bool flag = true;
  int cnt = 0;
  while (flag)
  {
    flag = false;
    for (int j = n - 1; j >= 1; j--)
    {
      if (a[j] < a[j - 1])
      {
        swap(a[j], a[j - 1]);
        cnt++;
        flag = true;
      }
    }
  }
  rep(i, n) cout << a[i] << (i == n - 1 ? "\n" : " ");
  cout << cnt << endl;
  return 0;
}



Measured memory_bytes: 3184
#include<bits/stdc++.h>
#define ll long long 
#define endl "\n"
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
int main()
{
    fastio;
    ll a,b;
    cin>>a>>b;
    cout<<a*b;
    return 0;
}


Measured memory_bytes: 3636
#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,k;
	cin >> a >> b >> c >> k;
	if (a > k) {
		cout << k << endl;
		return(0);
	}
	else if (a + b > k) {
		cout << a << endl;
		return(0);
	}
	else {
		cout << a - (k - a - b) << endl;
	}
	return (0);
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
   #define PP pair<int,pair<int,int>>
const int MAX = 510000;
const int MOD =  1000000007;
const int INV2 = (MOD+1)/2;

     signed main(){
       int n,ans=0;
       cin>>n;
       bool used[n]={},t=false;
       pair<pair<int,int>,int> p[2*n];
       int a,b,mina=MOD,minb=MOD,maxa=-1,maxb=-1,suma=0,sumb=0;
       for(int i=0;i<n;i++){
         cin>>a>>b;
         mina=min(a,mina);
         maxa=max(a,maxa);
         suma+=a;
         minb=min(b,minb);
         maxb=max(b,maxb);
         sumb+=b;
         p[2*i]=make_pair(make_pair(a,b),i);
         p[2*i+1]=make_pair(make_pair(b,a),i);
       }
       if(maxa<=minb){
         cout<<suma<<endl;
         return 0;
       }
       if(maxb<=mina){
         cout<<sumb<<endl;
         return 0;
       }
       sort(p,p+2*n);
       for(int i=0;i<n;i++){
         ans+=p[i].first.first;
         if(used[p[i].second])t=true;
         else used[p[i].second]=true;
       }
       if(t)cout<<ans<<endl;
       else {
         if(p[n-1].second==p[n].second)cout<<ans+min(-p[n-1].first.first+p[n+1].first.first,-p[n-2].first.first+p[n].first.first)<<endl;
         else cout<<ans-p[n-1].first.first+p[n].first.first<<endl;
       } 

                  
}


        


Measured memory_bytes: 4992
#include <iostream>
#include <iomanip>
using namespace std;
int main(void){
    // Your code here!
        int a,b;
        cin >> a;
        cin >> b;
        int d=a/b;
        int r=a%b;
        double f=double(a)/double(b);
        cout << d;
        cout << " ";
        cout << r;
        cout << " ";
        cout << fixed << setprecision(5) << f;
        cout << endl;
        
    
}



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

using namespace std;

int main(){

  int a,b;

  while(cin>>a>>b,a||b){
	int change=b-a;
	int c100=0;
	int c500=0;
	int c1000=0;

	while(1){
	  if(change/1000==0)
		break;
	  else{
		c1000++;
		change-=1000;
	  }
	}

	while(1){
	  if(change/500==0)
		break;
	  else{
		c500++;
		change-=500;
	  }
	}

	while(1){
	  if(change/100==0)
		break;
	  else{
		c100++;
		change-=100;
	  }
	}

	cout<<c100<<" "<<c500<<" "<<c1000<<endl;
	
  }
  
}



Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
using ll = long long;
using pll = pair<ll,ll>;
using vvll = vector<vector<ll>>;
using vll = vector<ll>;
using vstr = vector<string>;
const ll MOD=1000000007;
vll dx{0,1,0,-1};
vll dy{1,0,-1,0};

void solve()
{
    int N;
    cin>>N;
    int res=0;
    for(int c=1;c<N;c++){
        int ab = N - c;
        for(int a=1;a*a<=ab;a++)
        {
            if(ab%a==0){
                res++; 
                if(ab/a!=a){
                    res++;
                }
            }
        }
    }
    cout<<res<<endl;
}

int main(){
    solve();
    return 0;
}


Measured memory_bytes: 3600
f=0
while 1:
    try:n=int(input())
    except:break
    if f:print()
    f=1
    a=[[0 for _ in range(5)]for _ in range(8)]
    for i in range(4,-1,-1):
        b=n%10
        a[not b//5][i]=1
        a[b%5+3][i]=1
        n//=10
    for i in range(8):
        for j in range(5):
            if i==2:print('=',end='')
            else:print(' ' if a[i][j] else '*',end='')
        print()

Measured memory_bytes: 7636
#include <algorithm>
#include <iostream>
#include <unordered_map>
#include <vector>

long long comb(int n, int r)
{
    long long ans = 1;

    for (int i = 1; i <= r; i++) {
        ans = ans * (n - i + 1) / i;
    }
    return ans;
}

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

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

    std::vector<long long> dp(n + 1, 0);

    for (int i = 1; i <= n; i++) {
        dp[i] = dp[i - 1] + a[i - 1];
    }

    std::unordered_map<long long, int> sum_and_num;
    for (int i = 0; i <= n; i++) {
        sum_and_num[dp[i]]++;
    }

    long long count = 0;
    for (auto i = sum_and_num.begin(); i != sum_and_num.end(); i++) {
        count += comb(i->second, 2);
    }

    std::cout << count << std::endl;
}


Measured memory_bytes: 10824
#include<iostream>
#include <string>
#include <cstdlib> //絶対値利用のため
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
#define fr(i,n) for(int i=0;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)

//const int INF = INT_MAX / 2;




int main() {
	int n, m, c;
	cin >> n >> m >> c;
	int a[20][20], b[20];
	for (int i = 0; i < m; i++) cin >> b[i];
	for (int i = 0; i < n; i++){
		for (int j = 0; j < m; j++) { 
			cin >> a[i][j];
		}
	}
	int counter = 0;
	for (int i = 0; i < n; i++) {
		int sum = 0;
		for (int j = 0; j < m; j++) {
			sum += a[i][j] * b[j];
		}
		sum += c;
		if (sum > 0) counter++;
	}

	cout << counter << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <string>
#include <math.h>

#pragma optimize("O3")

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;

#define sync                    \
ios_base::sync_with_stdio(0); \
cin.tie(0);                   \
cout.tie(0)
#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define pb push_back
#define mp make_pair
#define fopen freopen("input.txt", "r", stdin); freopen("output.txt","w", stdout)
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, b, a) for(ll i = (b) - 1; i >= (a); --i)
#define REP(i, N) FOR(i, 0, N)
#define REPR(i, N) RFOR(i, N, 0)
#define FILL(A,value) memset(A,value,sizeof(A))
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll, ll>
#define MP make_pair
#define endl '\n'

const ll MOD = 1e9 + 7;
const ll INF = 2 * 1e9 + 7;
const int base = 2e5 + 1;
const int MAX = 1e5 + 2;
const double EPS = 1e-9;
const double PI = acos(-1.);
const int MAXN = 2 * 1e6 + 1;

int main()
{
	int n;
	cin >> n;
	vi a(n);
	vi b(n);
	vi c(n);
	FOR(i, 0, n)
	{
		cin >> c[i];
	}
	FOR(i, 0, n)
	{
		cin >> b[i];
	}
	FOR(i, 0, n)
	{
		cin >> a[i];
	}
	sort(ALL(b));
	sort(ALL(c));
	vector<ll> preff_b(n);
	FOR(i, 0, n)
	{
		int l = 0, r = n - 1;
		while (r - l > 1)
		{
			int m = (r + l) / 2;
			if (c[m] < b[i])
			{
				l = m;
			}
			else
			{
				r = m - 1;
			}
		}
		if (c[r] < b[i])
		{
			l = r;
		}
		if (c[l] < b[i])
		{
			preff_b[i] = l + 1;
		}
	}
	FOR(i, 1, n)
	{
		preff_b[i] += preff_b[i - 1];
	}
	ll res = 0;
	FOR(i, 0, n)
	{
		int l = 0, r = n - 1;
		while (r - l > 1)
		{
			int m = (r + l) / 2;
			if (b[m] < a[i])
			{
				l = m;
			}
			else
			{
				r = m - 1;
			}
		}
		if (b[r] < a[i])
		{
			l = r;
		}
		if (a[i] > b[l])
		{
			res += preff_b[l];
		}
	}
	cout << res;
	//system("pause");
	return 0;
}

Measured memory_bytes: 2176
import java.util.Scanner;

public class Main {
    public static void main (String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] array = new int[n];
        for(int i = 0; i < n; i++){
            array[i] = scan.nextInt();
        }
        for(int i = 0; i < array.length; i++){
            int idx = i;

            while(idx > 0 && array[idx-1] > array[idx]){
                int tmp = array[idx-1];
                array[idx-1] = array[idx];
                array[idx] = tmp;
                idx--;

            }
            show(array);
        }

    }
    public static void show(int[] array){
        int i;
        for(i = 0; i < array.length-1; i++){
            System.out.print(array[i] + " ");
        }
        System.out.println(array[i]);


    }

}


Measured memory_bytes: 30908
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <numeric>
#include <boost/math/constants/constants.hpp>

using namespace std;
#define ll long long
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, n, m) for(int i=n; i<m; ++i)

int main(){
  string S;
  cin >> S;
  int N;
  N = S.length();
  int ans[100010]={};

  int ind;
  int Rnum=1;
  int Lnum=1;
  
  FOR(i, 1, N){
    if(S[i]=='R' & S[i-1]=='R') Rnum++;
    else if(S[i]=='L' & S[i-1]=='L') Lnum++;
    else if(S[i]=='L' & S[i-1]=='R') ind=i;
    else if(S[i]=='R' & S[i-1]=='L'){
      ans[ind] += (Rnum/2 + (Lnum+1)/2);
      ans[ind-1] += (Lnum/2 + (Rnum+1)/2);
      Rnum = 1;
      Lnum = 1;
    }
  }
  ans[ind] += (Rnum/2 + (Lnum+1)/2);
  ans[ind-1] += (Lnum/2 + (Rnum+1)/2);
  
  rep(i, N) cout << ans[i] << " "; 
  
}

Measured memory_bytes: 1024
class Array
  def swap!(a, b)
    self[a], self[b] = self[b], self[a]
    self
  end
end
def selection_sort(array)
  count = 0
  array.length.times do |index|
    min = array[index]
    min_index = index
    array[index..array.length-1].each_with_index do |value, cindex|
      if min > value
        min_index = cindex + index
        min = value
      end
    end
    if index != min_index
      array.swap! index, min_index
      count += 1
    end
  end
  [array, count]
end

n = gets.to_i
array = gets.split(' ').map(&:to_i)
array, count = selection_sort array
puts array.join(' '), count



Measured memory_bytes: 6916
#include<iostream>
#include<stdio.h>
#include<vector>//s1.erase(n)=文字列s1の、n文字目以降削除
#include<algorithm>//辞書順=next_permutation
#include<set>
#include<string>//char 小文字のほうが32大きい
#include<sstream>
#include<string.h>
#include<complex>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<locale>
#include<utility>//swap=数値交換
#define rt "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define drop(i,n) for(int i=n;0<i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define sec(a,b,ans) if(ans)cout<<a<<rt;else cout<<b<<rt;
#define vcin(s,n) rep(i,n)cin>>s[i];//vcin(配列名),(繰り返し回数)
#define sort(s) sort(s.begin(),s.end())//標準=昇順
#define reve(s) reverse(s.begin(),s.end())
#define asas int ans=0
#define llcncn llint cnt=0
#define llasas llint ans=0
#define str string
#define please return
#define AC 0
#define Rapid cin.tie(0);ios::sync_with_stdio(false)
#define Pi 3.1415926535897932384626
#define nine 1000000000

using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<double> vdou;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<char>> vvchar;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<string>> vvstr;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}

unsigned GetDigit(unsigned num) {
	return std::to_string(num).length();
}

int tow(int n) {//2のn乗
	if (n == 0)return 1;
	int x = tow(n / 2);
	x *= x;
	if (n % 2 == 1)x *= 2;
	return x;//@domino
}

/*

 (char)toupper(a[n])=文字列のn文字目を大文字で出力

  pow(a,b)=aのb乗

  */


int main(void) {

	int n, k, q;
	cin >> n >> k >> q;
	vint cnt(n, k - q);
	rep(i, q) {
		int x;
		cin >> x;
		cnt[x - 1]++;
	}
	rep(i, n) {
		Yes(0<cnt[i]);
	}

	please AC;
}

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

int main()
{
	int N,K;
	ll n=1;
	cin>>N>>K;
	for(int i=0;i<N;i++)
	{
		if(n*2<n+K)n*=2;
		else n+=K;
	}
	cout<<n<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main(){
    int n; cin >> n;
    ll f[n][10]; rep(i,n) rep(j,10) cin >> f[i][j];
    ll p[n][11]; rep(i,n) rep(j,11) cin >> p[i][j];

    ll ans = -(1ll<<60);
    loop(i,1,1<<10){
        ll data[n]; rep(j,n) data[j] = 0;
        rep(j,10){
            if(i & 1<<j){
                rep(k,n) if(f[k][j] == 1) data[k]++;
            }
        }
        ll count = 0;
        rep(j,n) count += p[j][data[j]];
        if(ans < count) ans = count;
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 3508
import sys
input = sys.stdin.readline
INF = float('INF')


def main():
    H, N = map(int, input().split())
    skills = [None] * N
    max_a = 0
    for i in range(N):
        a, b = map(int, input().split())
        if a > max_a:
            max_a = a
        skills[i] = (a, b)

    # dpの配列準備
    # インデックス→体力、中身→その体力を削るための最小MP
    dp = [INF] * (H + max_a + 1)
    dp[0] = 0

    # 各体力を削る最小MPをDPで更新していく
    for i in range(H):
        # そのHPをちょうど削る攻撃がない場合はそれ以降の行動を計算できないので飛ばす1
        if dp[i] == INF:
            continue

        # そうでない場合は、次の攻撃をシミュレーション
        for a, b in skills:
            # 攻撃した場合の累計消費MPを算出
            mp = dp[i] + b
            # その攻撃をした場合に削れる体力に割り当てられている消費MPと比較
            # より少ない消費MPで削れることがわかった場合は更新
            if mp < dp[i + a]:
                dp[i + a] = mp

    # 更新が終わったので、倒せるダメージのうち、累計消費MPが一番少ないものを出力
    print(min(dp[H:]))

if __name__ == "__main__":
    main()


Measured memory_bytes: 3544
#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(void){
	ll target;
  	ll b = 100;
  	int cnt = 0;
  	cin >> target;
  	while(target > b){
    	b += b/100;
      	cnt++;
    }
  	cout << cnt;
	return 0;
}

Measured memory_bytes: 3584
//
// Created by yamunaku on 2019/09/15.
//

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD9 998244353
#define MOD1 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)
#define CST(x) cout<<fixed<<setprecision(x)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> mti;
typedef vector<ll> vl;
typedef vector<vector<ll>> mtl;

int main(){
    int n,m;
    cin >> n >> m;
    priority_queue<int> q;
    rep(i,n){
        int a;
        cin >> a;
        q.push(a);
    }
    rep(i,m){
        int x=q.top();
        q.pop();
        q.push(x/2);
    }
    ll ans=0;
    while(!q.empty()){
        ans+=q.top();
        q.pop();
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
int main(){
	int n,cnt[6]={0};
	float h;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>h;
		if(h<165.0){
			cnt[0]++;
		}else if(h<170.0){
			cnt[1]++;
		}else if(h<175.0){
			cnt[2]++;
		}else if(h<180.0){
			cnt[3]++;
		}else if(h<185.0){
			cnt[4]++;
		}else{
			cnt[5]++;
		}
	}
	for(int i=0;i<6;i++){
		cout<<i+1<<":";
		for(int j=0;j<cnt[i];j++){
			cout<<"*";
		}
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 3048
#include<stdio.h>
#include<stdlib.h>

#define NIL NULL
#define N 500000

struct node{
  struct node *parent;
  struct node *right;
  struct node *left;
  int key;
};

typedef struct node * Node;

Node root;

void insert(int);
void inorder(Node);
void preorder(Node);

int main(void){
  int n,x;
  int i;
  char com[20];

  scanf("%d",&n);

  for(i = 0; i < n; i++){
    scanf(" %s",com);
    if(com[0] == 'i'){
      scanf(" %d",&x);
      insert(x);
    }
    else if(com[0] == 'p'){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  
  return 0;
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = (Node)malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }
    else{
      x = x->right;
    }
  }
  z->parent = y;
  if(y == NIL){
    root = z;
  }
  else{
    if(z->key < y->key){
      y->left = z;
    }
    else{
      y->right = z;
    }
  }
}

void inorder(Node u){
  if(u == NIL)return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}

void preorder(Node u){
  if(u == NIL)return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}



Measured memory_bytes: 25228
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int maxTimes = 0;
        int number = 1;
        for (int i = 1; i <= n; i++) {
            int temp = 0;
            int num = i;
            while (num % 2 == 0) {
                num = num / 2;
                temp++;
            }
            if (temp > maxTimes) {
                maxTimes = temp;
                number = i;
            }
        }
        System.out.println(number);
    }
}


Measured memory_bytes: 21972
#include<iostream>

using namespace std;

int main () {
   int a, b;
   cin >> a >> b;
   if (a > b) {
      cout << "a > b" << endl;
   } else if (a < b) {
      cout << "a < b" << endl;
   } else {
      cout << "a == b" << endl;
   }
   return  0;
}

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

#define pb push_back
#define io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define clr(v) v.clear()
vector<ll>v;
pair<ll,ll>p;
map<ll,ll>mp;
set<ll>st;
deque<ll>dq;
priority_queue<ll>pq;
#define f(i,b) for(i=0;i<b;i++)
#define f1(i,b) for(i=1;i<=b;i++)
#define fr(i,b)for(i=b-1;i>=0;i--)
ll mn=INT_MAX,mx=INT_MIN;
ll n,m,tc,i,j,tmp,sum,cn,ans,res,pos,flag;

string s;


ll a[200007],b[200007];
int main()
{

   io;
   string s="";
cin>>n;
while(n--)
{
char c=n%26+'a';
s=c+s;
n/=26;
}
cout<<s;

return 0;
}





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

int main(){
    int x,y,z;
    cin >> x >> y >> z;
    swap(x,y);
    swap(x,z);
    cout << x << " " << y << " " << z << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int N,A,B; cin>>N>>A>>B;

    uint64_t ans=0;
    rep(i,1,N+1){
        int n0,n1,n2,n3,n4;
        n0=(i/(int)pow(10,0))%10;
        n1=(i/(int)pow(10,1))%10;
        n2=(i/(int)pow(10,2))%10;
        n3=(i/(int)pow(10,3))%10;
        n4=(i/(int)pow(10,4))%10;

        if(n0+n1+n2+n3+n4>=A && n0+n1+n2+n3+n4<=B) ans+=i;
    }

    cout<<ans<<endl;
}

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

string memo[70][70];
bool Compare(string s1, string s2){
	//s1>s2
	if(s1.length()>s2.length())return true;
	else if(s1.length()<s2.length())return false;
	else{
		for(int i=0;i<s1.length();i++){
			if(s1[i]>s2[i])return true;
			else if(s1[i]<s2[i])return false;
		}
	}
	return false;
}

int main(){
	int w,h;
	int dy[2]={-1,0};
	int dx[2]={0,-1};
	while(cin>>w>>h && (w||h) ){
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				char ch;	cin>>ch;
				if(isdigit(ch)){
					memo[i][j]=ch;
				}else{
					memo[i][j]="*";
				}
			}
		}

		for(int y=h-1;y>=0;y--){
			for(int x=w-1;x>=0;x--){
				if(memo[y][x]=="*")continue;

				for(int i=0;i<2;i++){
					int nY=y+dy[i], nX=x+dx[i];
					if(nY<0||nX<0||nY>=h||nX>=w)continue;
					else if(memo[nY][nX]=="*")continue;

					string now=memo[nY][nX];
					string tmp=now[0]+memo[y][x];
					if(Compare(tmp,now)){
						memo[nY][nX]=tmp;
					}
				}
			}
		}

		string ans="0";
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				if(memo[i][j][0]=='0' || memo[i][j]=="*")continue;
				//cout<<memo[i][j]<<" ";

				if(Compare(memo[i][j],ans)){
					ans=memo[i][j];
					//cout<<memo[i][j]<<" ";
				}

			}
		}
		cout<<ans<<endl;

	}

	return 0;
}



Measured memory_bytes: 3248
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N=2e5+5;

char S[N];

int main()
{
	scanf("%s",S);
	int n = strlen(S);
	ll sum = 0;
	for(int i=0;i<n;i++) sum += int(S[i] - '0');
	puts(sum % 9 == 0 ? "Yes" : "No");
}


Measured memory_bytes: 3824
n = int(input())
h = list(map(int, input().split()))

count = 0
max_count = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        count += 1
        max_count = max(max_count, count)
    else:
        count = 0

print(max_count)


Measured memory_bytes: 15740
n,m,k=map(int,input().split())
if(k>=m-n):
    for i in range(n,m+1):
        print(i)
else:
    l=list(range(n,n+k))
    d=list(range(m-k+1,m+1))
    s=l+d
    s=list(set(s))
    s.sort()
    for i in s:
        print(i)


Measured memory_bytes: 62152
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>

using ll = long long int;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = 998244353ll;

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int main(void){
	int a,b,l,r;
	std::cin >> a >> b;
	l = std::max((100*a+7)/8,10*b);
	r = std::min((100*a+107)/8-1,10*b+9);
	if(r<l){
		std::cout << -1 << std::endl;
	}else{
		std::cout << l << std::endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T iabs(const T& x) { return max(x, -x); }
// #define abs gabs


struct segtree {
    int N;
    vector<i64> dat, sum;
    segtree(int n) {
        N = 1;
        while(N < n) N <<= 1;
        dat.assign(2*N-1,0);
        sum.assign(2*N-1,0);
    }
    void add(int a, int b, i64 x) { add(a,b,x,0,0,N); }
    i64 add(int a, int b, i64 x, int k, int l, int r) {
        if(b <= l or r <= a) return dat[k];
        if(a <= l and r <= b) {
            sum[k] += x;
            return dat[k] += x;
        }
        int m = (l+r)/2;
        return dat[k] = min(add(a,b,x,2*k+1,l,m),add(a,b,x,2*k+2,m,r))+sum[k];
    }
    i64 minimum(int a, int b) { return minimum(a,b,0,0,N); }
    i64 minimum(int a, int b, int k, int l, int r) {
        if(b <= l or r <= a) return 1e16;
        if(a <= l and r <= b) return dat[k];
        int m = (l+r)/2;
        return min(minimum(a,b,2*k+1,l,m),minimum(a,b,2*k+2,m,r))+sum[k];
    }
};

int main() {
    i64 n, d, a;
    cin >> n >> d >> a;
    using P = pair<i64, i64>;
    vector<P> xh(n);
    for (int i = 0; i < n; ++i) {
        cin >> xh[i].first >> xh[i].second;
        xh[i].second = (xh[i].second + a - 1) / a;
    }
    sort(begin(xh), end(xh));
    segtree st(n + 1);
    i64 ans = 0;
    for (int i = 0; i < n; ++i) {
        i64 x, h;
        tie(x, h) = xh[i];
        // cerr << h << endl;
        h -= st.minimum(i, i + 1);
        cerr << h << endl;
        if (h > 0) {
            int r = lower_bound(begin(xh), end(xh), make_pair(x + 2 * d + 1, i64(0))) - begin(xh);
            st.add(i, r, h);
            ans += h;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 13312
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
	char s[10]; scanf("%s",s); sort(s, s+4);
  	if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2])
      puts("Yes"); else puts("No");
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdio>
#include <set>
#include <map>
#include <algorithm>
#define int long long int

using namespace std;

main()
{
    int n, m;
    cin>>n>>m;
    int x = max(0LL, m - 2 * n);
    int y = max(0LL, min(m, x / 2));
    int ans = min(n, m / 2);
    for(int i = -10; i < 10; ++i)
    {
        int b = min(m, max(0LL, y + i));
        int res = min(n + b / 2, (m - b) / 2);
        ans = max(ans, res);
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  string s;cin >> s;
  map<char,int> ch;
  rep(i,10) ch['0'+i] = i;
  int reverse[] = {1,-1,-1,-1,-1};
  map<int,char> m;
  m[1] = '+';
  m[-1] = '-';
  rep(i,8){
    int sum = ch[s[0]];
    rep(j,3) sum += reverse[i&(1<<j)]*ch[s[j+1]];
    if(sum==7){
      cout << ch[s[0]];
      rep(j,3){
        cout << m[reverse[i&(1<<j)]] << ch[s[j+1]];
      }
      cout << "=7" << endl;
      break;
    }
  }
  return 0;
}


Measured memory_bytes: 256
class UnionFind():
    def __init__(self,n):
        self.n = n
        self.parents = [-1 for i in range(n)]
    def find(self,x):
        if self.parents[x] < 0:
            return x
        self.parents[x] = self.find(self.parents[x])
        return self.parents[x]
    def unite(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.parents[x] > self.parents[y]:
            x,y = y,x
        self.parents[x] += self.parents[y]
        self.parents[y] = x
        return True
    def same(self,x,y):
        return self.find(x) == self.find(y)
    def size(self,x):
        return -self.parents[self.find(x)]

n,m,k = map(int, input().split())
deg = [0 for i in range(n)]
to = [[] for i in range(n)]
uf = UnionFind(n)
for i in range(m):
    a,b = map(int, input().split())
    a -= 1; b -= 1;
    deg[a] += 1
    deg[b] += 1
    uf.unite(a,b)
for i in range(k):
    c,d = map(int, input().split())
    c -= 1; d -= 1;
    to[c].append(d)
    to[d].append(c)
for i in range(n):
    ans = uf.size(i)-1-deg[i]
    for u in to[i]:
        if uf.same(i,u):
            ans -= 1
    if i != n-1:
        print(ans, end=" ")
    else:
        print(ans)

Measured memory_bytes: 26296