akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>	
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define TYPE int
const int mod=(int)1e09+7;

int in(void){
	int i;scanf("%d",&i);
	return i;
}
long long llin(void){
	long long i;scanf("%lld",&i);
	return i;
}
double din(void){
	double i;scanf("%lf",&i);
	return i;
}
void chin(char s[]){
	scanf("%s",s);
}
void print(int a){
	printf("%d\n",a);
}
void llprint(long long a){
	printf("%lld\n",a);
}
void dprint(double a){
	printf("%.10f\n",a);
}
void print2(int a,int b){
	printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
	return a>b?a:b;
}
long long min(long long a,long long b){
	return a<b?a:b;
}
long long llabs(long long a){
	return a>0?a:-a;
}
double dmax(double a,double b){
	return a>b?a:b;
}
int cmp(const void *a,const void *b){
	return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
	return *(TYPE *)b-*(TYPE *)a;
}

int num[100];
int cnt=0;
void f(int n,int k,int a[]){
	int i;
	if(n==k){
		rep(i,n){
			if(num[i]%2==0)
				return;
		}
		cnt++;
		return;
	}
	for(i=a[k]-1;i<=a[k]+1;i++){
		num[k]=i;
		f(n,k+1,a);
	}
}
int main(void){
	int n=in(),i,a[100];
	rep(i,n){
		a[i]=in();
	}
	f(n,0,a);
	print((int)pow(3,n)-cnt);
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define endl "\n"
#define int long long
#define push_back pb
#define getMat(v, n, m) vector<vector<int>> v(n,vector<int>(m))
#define lb lower_bound
#define up upper_bound
#define all(v) v.begin(),v.end()
#define size(v) (int)v.size()
using namespace std;
const int mod = 1e9+7;

int32_t main(){
    fastio;

    int n; cin >> n;
    vector<int> a(n);
    for(int &x: a) cin >> x;

    int ans = 0;
    for(int i=0; i<n; i++){
        for(int j=i+1; j<n; j++){
            for(int k=j+1; k<n; k++){
                vector<int> b = {a[i],a[j],a[k]};
                sort(all(b));
                bool same = false;
                for(int l=1; l<3; l++) if(b[l]==b[l-1]) same = true;
                if(same) continue;

                if(b[0]+b[1]>b[2]){
                    ans++;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3648
//#include "SaveFuncs.cpp"

/*****/

#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

using namespace std;
using ll = long long;

#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; i++)
#define rep1(i, n) for(int i=1, i##_len=(n); i<i##_len; i++)
#define rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b);
//#define int long long
constexpr int INF = 2000000100;
constexpr int DIV = 1000000007;	// 10e9+7
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> T divUp(T a, T b) { if (a % b == 0) { return a / b; } return a / b + 1; }
std::string strMulti(std::string t, int n) { std::string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }
template<class T> T math_P(T m, T n) { T ret = 1; for (T i = m; i > m - n; i--) { ret *= i; } return ret; }
template<class T> T math_C(T m, T n) { T ret = mathP(m, n); for (T i = 2; i <= n; i++) { ret /= i; } return ret; }
template<class T> bool compare_by_b(pair<T, T> a, pair<T, T> b) { if (a.second != b.second) { return a.second < b.second; } return a.first < b.first; }
template<class T> T math_gcd(T a, T b) { a = abs(a); b = abs(b); if (a < b) { std::swap(a, b); } T tmp; while (b != 0) { tmp = b; b = a % b; a = tmp; } return a; }
template<class T> T math_lcm(T a, T b) { a = abs(a); b = abs(b); if (a > b) { std::swap(a, b); } if (a == 1) { return b; } T i = a; while (i % b != 0) { i += a; } return i; }

/*****/

int Main()
{
	int N;
	cin >> N;
	vector<int> V(N);
	rep(i, N)	cin >> V.at(i);

	sort(all(V));

	long double ret = V.at(0);
	for (int i = 1; i < N; i++)
	{
		ret += V.at(i);
		ret /= 2.0;
	}

	cout << fixed << setprecision(10);
	cout << ret;

	return 0;
}

/*****/

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

	Main();

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

        int a = sc.nextInt();
        int b = sc.nextInt();
        int area =  a * b;
        int length = 2*a + 2*b;
        
        System.out.println(area + " " + length);
        sc.close();
    }
}


Measured memory_bytes: 26160
import numpy as np

S = list(input())
T = list(input())

s_len = len(S)
t_len = len(T)

max_same = 0
for i in range(s_len-t_len+1):
    tmp_s = S[i:i+t_len]
    count_same = 0
    for j in range(t_len):
        if T[j] == tmp_s[j]:
            count_same += 1
    if count_same > max_same:
        max_same = count_same
print(t_len-max_same)

Measured memory_bytes: 27120
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

struct UnionFind {
  vector<int> parent;  // parent[root] is the negative of the size.
  UnionFind(int n) : parent(n, -1){};
  bool unite(int u, int v) {
    u = root(u);
    v = root(v);
    if (u == v)
      return false;
    if (parent[u] > parent[v])
      swap(u, v);
    parent[u] += parent[v];
    parent[v] = u;
    return true;
  }
  bool issame(int u, int v) {
    return root(u) == root(v);
  }
  int root(int u) {
    return parent[u] < 0 ? u : parent[u] = root(parent[u]);
  }
  int size(int u) {
    return -parent[root(u)];
  }
};

int main() {
  ll N, M;
  cin >> N >> M;
  vector<ll> A(M), B(M);
  rep(i, M) {
    cin >> A[i] >> B[i];
    A[i]--;
    B[i]--;
  }

  reverse(all(A));
  reverse(all(B));

  UnionFind u(N);
  vector<ll> inconv(M);
  inconv[0] = N * (N - 1) / 2;
  repp(i, 1, M - 1) {
    int a = A[i - 1], b = B[i - 1];
    if (u.issame(a, b)) {
      inconv[i] = inconv[i - 1];
    } else {
      inconv[i] = inconv[i - 1] - u.size(a) * u.size(b);
      u.unite(a, b);
    }
  }

  reverse(all(inconv));
  rep(i, M) {
    cout << inconv[i] << endl;
  }
}

Measured memory_bytes: 4096
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            var abx = Console.ReadLine().Split().Select(s => BigInteger.Parse(s)).ToArray();
            var a = abx[0];
            var b = abx[1];
            var x = abx[2];
            Func<BigInteger, BigInteger> Fn = (n) =>
               {
                   return n<0?0:n/x+1;
               };
            Console.WriteLine(Fn(b) - Fn(a-1));
        }
    }
}

Measured memory_bytes: 13652
// inputに入力データ全体が入る
function Main(input) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.trim().split("\n");
  var [N, K] = input[0].split(" ").map((n) => parseInt(n));
  var ans = 0
  while (N >= 1) {
    N = N / K
    ans++
  }
  console.log(ans)

}
// *この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// Main(require("fs").readFileSync("./input.txt", "utf-8"));


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

int main(){
  string s;
  cin>>s;
  int count=0;
  char c=s.at(0);
  for(int i=1;i<s.size();i++){
    if(c==s.at(i)) continue;
    else{
      c=s.at(i);
      count++;
    }
  }
  cout<<count<<endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#define debug(x) cout << #x << " = " << x << endl
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,n) for(int i = (n); i > -1; i--)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;

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

  int n,m,x;
  cin>>n>>m>>x;
  int a[m];
  rep(i,m) cin>>a[i];
  int zc = 0,nc = 0;
  rep(i,m) {
    if(a[i] < x) {
      zc++;
    } else {
      nc++;
    }
  }
  cout << min(zc,nc) << endl;

  return 0;
}


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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define dump(x)
#define debug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(long long N, long long M, std::vector<long long> A){
    int remain = N - accumulate(all(A), 0LL);
    cout << (remain >= 0 ? remain : -1) << endl;
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> A(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, M, std::move(A));
    return 0;
}


Measured memory_bytes: 3712
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long k = sc.nextLong();
        for (long i = a; i <= b; i++) {
            if (i < a + k || b - k < i) {
                System.out.println(i);
            }
        }
    }
}

Measured memory_bytes: 21844
from scipy.misc import comb
# from scipy.special import comb


N, M = map(int, input().split())
MOD = 10**9+7
# M を素因数分解
rest = M
ans = 1
for i in range(2, int(M ** 0.5) + 1):
    cnt = 0
    while rest % i == 0:
        cnt += 1
        rest //= i
    # cnt が 2^X 1とか 3^X の X の部分
    ans *= comb(N+cnt-1, N-1, exact=True)
    ans %= MOD
if rest != 1:
    cnt = 1
    ans *= comb(N+cnt-1, N-1, exact=True)
    ans %= MOD

print(ans)


Measured memory_bytes: 15260
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = 1; i < (int)(n+1); i++)
int main() {
  int N;
  cin>>N;
  int cnt=0;
  bool ans=false;
  vector<vector<int>> A(N, vector<int>(2));
  rep(i,N){
      rep(j,2){
          cin>>A[i][j];
      }
      if(A[i][0]==A[i][1]){
          cnt++;
      }
     else{
         if(3<=cnt){
             ans=true;
         }
         cnt=0;
     }
  }
  if(3<=cnt){
      ans=true;
  }
  if(ans==true){
      cout<<"Yes"<<endl;
  }
  else
  {
      cout<<"No"<<endl;
  }
  
}



Measured memory_bytes: 3580
#include <iostream>
#include <string>
using namespace std;

int main(){
  char ans;
  int flag = 1;
  string s;
  string p = "abcdefghijklmnopqrstuvwxyz";
  cin >> s;
  for(int j = 0; j < p.size(); j++){
    flag = 1;
    for(int i = 0; i < s.size(); i++){
      if(p[j] == s[i]){
        flag = 0;
        break;
      }
    }
    if(flag){
      cout << p[j] << endl;
      return 0;
    }
  }
  cout << "None" << endl;
  return 0;
}


Measured memory_bytes: 512
#include <cstdio>

#define FOR(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define REV(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define INC(i, n) FOR(i, 0, n)
#define DEC(i, n) REV(i, 0, n)
#define INC1(i, n) FOR(i, 1, (n) + 1)
#define DEC1(i, n) REV(i, 1, (n) + 1)

typedef long long   signed int LL;
typedef long long unsigned int LU;



int a[3];
LL ans;

int main() {
	INC(i, 3) { scanf("%d", &a[i]); }
	
	bool flag = false;
	INC(i, 3) { if(a[i] % 2 == 0) { flag = true; } }
	
	if(flag) { ans = 0; }
	else {
		int max = 0;
		INC(i, 3) { if(a[i] > a[max]) { max = i; } }
		
		ans = 1;
		INC(i, 3) { if(i != max) { ans *= a[i]; } }
	}
	
	printf("%lld\n", ans);
	
	return 0;
}


Measured memory_bytes: 128
#ifdef __GNUC__ 
#include <bits/stdc++.h>
#endif
#include <boost/multiprecision/cpp_int.hpp>
#define ALL(v) std::begin(v),std::end(v)
using namespace std;
namespace mp = boost::multiprecision;
using u6 = std::uint64_t;
using si = std::size_t;
int main() {
	si n;
	cin >> n;
	vector<long long > a(n);
	for (si i = 0; i < n; ++i) {
		cin >> a[i];
	}
	long long r = 0;
	auto t=count_if(ALL(a), [](auto x) {return x < 0; });
	if (t %2==1) {
      	r=numeric_limits<long long>::max();
		si index = 0;
		for (si i = 0; i < n; ++i) {
			if (r > abs(a[i])) { 
				r = abs(a[i]); 
				index = i;
			}
		}
		r = 0;
		for (auto x : a) { r += abs(x); }
		r -= abs(a[index]) * 2;
	}
	else {
		for (auto x : a)r += abs(x);
	}
	cout << r << endl;
}


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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = 10e10;
const ll MINF = -10e10;
//const int INF = INT_MAX;
#define mins(x, y) x = min(x, y)
#define maxs(x, y) x = max(x, y)

typedef priority_queue<P, vector<P>, greater<P> > PQ_ASK;
const int mod = 1000000007;
//ifstream myfile("C:\\Users\\riku\\Downloads\\01.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;


int main() {
    int a, b, c;

    cin >> a >> b >> c;

    int ans = 0;
    {
        int now = 10 * a + b + c;
        ans = max(ans, now);
    }
    {
        int now = a + 10 * b + c;
        ans = max(ans, now);
    }
    {
        int now = a + b + c * 10;
        ans = max(ans, now);
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
xyz=[list(map(int,input().split())) for i in range(n)]
lst=[]
for i in range(8):
    if i&1==1:
        a=1
    else:
        a=-1
    if (i>>1)&1==1:
        b=1
    else:
        b=-1
    if (i>>2)&1==1:
        c=1
    else:
        c=-1
    h=[]
    for u in xyz:
        x,y,z=u
        h.append(a*x+b*y+c*z)
    lst.append(h)
ans=0
for u in lst:
    u.sort(reverse=True)
    e=0
    for i in range(m):
        e+=u[i]
    ans=max(ans,e)
print(ans)

Measured memory_bytes: 40688
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for(int i = k; i < (int)(n); i++)
const int maxN = int(1e5 + 10);
int e[maxN] = {}, o[maxN] = {};
int num[maxN] = {};
using ll = long long;

int main() {
    ll n, m;
    ll ans = 0;
    cin >> n >> m;

    for(ll i = 1; i * i <= m; i++) {
        if(m % i == 0) {
            ll i1 = i, i2 = m / i;
            if(n * i1 <= m && ans < i1) {
                ans = i1;
            }
            if(n * i2 <= m && ans < i2) {
                ans = i2;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#pragma region _head

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<stack>
#include<numeric>
#include<utility>
#include<regex>

#pragma region _define

#define int LL
#define f(i,a,b) for(LL i=a;i<b;i++)
#define f_vI(v,n) f(i,0,n)cin>>v[i]
#define f_v2I(v1,v2,n) f(i,0,n)cin>>v1[i]>>v2[i]
#define f_v3I(v1,v2,v3,n) f(i,0,n)cin>>v1[i]>>v2[i]>>v3[i]
#define f_vO(v,n) f(i,0,n)cout<<v[i]<<endl
#define ei else if
#define all(a) a.begin(),a.end()
#define size(s) ((LL)s.size())
#define F first
#define S second
#define check() cout<<"! ! !"
#define endl "\n"
#define _y() cout<<"Yes"<<endl
#define _Y() cout<<"YES"<<endl
#define _n() cout<<"No"<<endl
#define _N() cout<<"NO"<<endl
#define int_INF 1<<29
#define ll_INF 1LL<<60
#define MOD 1000000007

#pragma endregion

#pragma region _using

using namespace std;

using LL = long long;
using st = string;
using vi = vector<LL>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vc = vector<char>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using qi = queue<LL>;
using qc = queue<char>;
using qs = queue<st>;
using si = stack<LL>;
using sc = stack<char>;
using ss = stack<st>;
using pi = pair<LL, LL>;
using mll = map<LL, LL>;
using vpi = vector<pi>;

#pragma endregion

#pragma region _graph

#define node 50  //グラフの最大位数　適宜変更
//bool graph[node][node]; bool visited[node] = { false };
#define link(a,b,m) f(i,0,m){cin>>a[i]>>b[i]; a[i]--; b[i]--; graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;}

#pragma endregion


LL gcd(LL a, LL b) {
	LL r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
LL lcm(LL a, LL b) {
	return (a / gcd(a, b) * b);
}

//素数判定
bool is_prime(int n) {
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			return false;
		}
	}
	return true;
}

//階乗計算
LL factorial(LL n) {
	LL a = 1, ret = 1;
	while (a < n) {
		a++;
		ret *= a;
		ret %= MOD;
	}
	return ret;
}

#pragma endregion 



/*****************************************************************************/

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

	int n;
	cin >> n;
	vi a(n);
	f_vI(a, n);
	int odd = 0;
	f(i, 0, n) {
		if (a[i] % 2 != 0) {
			odd++;
		}
	}
	if (odd % 2 == 0) {
		_Y();
	}
	else {
		_N();
	}
	return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
int main(void) {
	int n, limit_t;
	scanf("%d %d", &n, &limit_t);
	int c[100], t[100], minCost = 5000;
	for (int i = 0; i < n; i++) {
		scanf("%d %d", &c[i], &t[i]);
		if (t[i] <= limit_t) {
			if (c[i] < minCost) {
				minCost = c[i];
			}
		}
	}
	if (minCost == 5000) printf("TLE"); //aaaaaaaa
	else printf("%d", minCost);
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int gcd(int x, int y){
    if (y == 0) return x;
    return gcd(y, x % y);
}

int main() {
    int p, q;
    cin >> p >> q;
    int d = gcd(p, q);
    q /= d;
    ll ans = 1;
    for (ll i = 2; i * i <= q; i++){
        if (q % i == 0){
            ans *= i;
            while (q % i == 0) q /= i;
        }
    }
    cout << ans*q << endl;

    return 0;
}

Measured memory_bytes: 3048
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static class Pair<T,U>{
		T l;U r;
		Pair(T L,U R){l=L;r=R;}
		T getL(){return l;}
		U getR(){return r;}
	}

	public static void main(String[]$){
		System.out.println((getInt()-1)*(getInt()-1));
	}
}

Measured memory_bytes: 21844
#include <iostream>
#include <stdio.h> 

using namespace std;
int main(){
	int a, b;
	cin>>a>>b;
	if(a>b && b!=1){
		cout<<"Alice";
	}else if(b>a && a!=1){
		cout<<"Bob";
	}else if(a>b && b==1){
		cout<<"Bob";
	}else if(b>a && a==1){
		cout<<"Alice";
	}else {
		cout<<"Draw";
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int ans = 0;

    if ((a >= c) || (b >= c) || ((a + b) >= c)) {
      System.out.println(b + c);
    } else {
      System.out.println(a + (2 * b) + 1);
    }

  }
}

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

int main() {
    int a, p;
    cin >> a >> p;
    if (a < 0 && p < 2)
        cout << 0 << endl;
    cout << (3 * a + p) / 2 << endl;
    return 0;
}

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

using namespace std;

#define fcout(d) cout << fixed << setprecision(d)
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define repU(i,s,t) for(int (i) = (s); (i) <= (t); ++(i))
#define repD(i,t,s) for(int (i) = (t); (i) >= (s); --(i))
#define all(v)  begin(v),end(v)
#define clr(v) fill(all(v),0)
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define q_ceil(n,d) ((n - 1)/(d) + 1)
#define parity(a,b) ((a)^(b) & 1LL ^ 1LL)

typedef long long ll;
typedef unsigned long long ull;
typedef double db;

const pair<int,int> DIR[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF_32 = -1 + (1 << 30);
const ll INF_64 = -1 + (1LL << 62);
const int MOD = 1e9 + 7;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n,t,T = 0;
	db lap[102],l[40004],r[40004];
	db v[102];
	int p[40004];
	cin>>n;
	lap[0] = 0;
	rep1(i,n){
		cin>>t;
		repU(u,T * 2,T * 2 + t * 2) p[u] = i;
		T += t;
		lap[i] = T;
	}
	rep1(i,n) cin>>v[i];
	v[0] = v[n + 1] = 0;
	db last = 0,ans = 0;
	int tem = 0;	
	rep1(i,n){
		if(v[tem] - lap[tem] > v[i - 1] - lap[i - 1]) tem = i - 1;
		repU(j,lap[i - 1] * 2,lap[i] * 2) l[j] = v[tem] - lap[tem] + (db)j/2;
	}
	tem = n + 1;
	repD(i,n,1){
		if(v[tem] + lap[tem - 1] > v[i + 1] + lap[i]) tem = i + 1;
		repD(j,lap[i] * 2,lap[i - 1] * 2){ r[j] = v[tem] + lap[tem - 1] - (db)j/2; }
 	}
	rep1(i,T * 2){
		db cur = min(v[p[i]],min(l[i],r[i]));
		ans += (cur + last) / 4;
		last = cur;
	}
	fcout(5)<<ans<<endl;
}





Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
 
#define fi first
#define se second
#define FOR(a, b, c) for(int a = b; a <= c; ++a)
#define pb push_back
 
const int N = 1e5 + 10;
const int MOD = 1e9 + 7;
const int oo = 1e9;
 
typedef pair<int, int> ii;
 
struct book{
    int x, y, val;
}t[N];
int n, m, nums;
vector<ii> pos[5];
 
bool cmp(ii x, ii y)    {
    return x.fi > y.fi;
}
 
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> n >> m >> nums; n ++; m ++;
    FOR(i, 1, nums)    {
        int x1, x2, y1, y2;
        cin >> x1 >> y1 >> x2 >> y2; x1 ++; y1 ++; x2 ++; y2 ++;
        bool flag = false, flag2 = false;
 
        if(x1 == 1 || x1 == n || y1 == 1 || y1 == m) flag = true;
        if(x2 == 1 || x2 == n || y2 == 1 || y2 == m) flag2 = true;
 
        if(flag && flag2)   {
            if(x1 == 1) pos[1].pb(ii(y1, i));
            else if(x1 == n) pos[3].pb(ii(y1, i));
            else if(y1 == 1) pos[4].pb(ii(x1, i));
            else if(y1 == m) pos[2].pb(ii(x1, i));
 
            if(x2 == 1) pos[1].pb(ii(y2, i));
            else if(x2 == n) pos[3].pb(ii(y2, i));
            else if(y2 == 1) pos[4].pb(ii(x2, i));
            else if(y2 == m) pos[2].pb(ii(x2, i));
        }
    }
    sort(pos[1].begin(), pos[1].end());
    sort(pos[2].begin(), pos[2].end());
    sort(pos[3].begin(), pos[3].end(), cmp);
    sort(pos[4].begin(), pos[4].end(), cmp);
    stack<int> st;
    FOR(i, 1, 4)    {
        for(ii v: pos[i])   {
            if(!st.empty() && st.top() == v.se) st.pop();
            else st.push(v.se);
        }
    }
    set<int> check;
    while(!st.empty())  {
        if(check.find(st.top()) !=  check.end()) {
            cout << "NO"; return 0;
        }
        check.insert(st.top()); st.pop();
    }
    cout << "YES";
}

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
typedef long long ll;
const int INT_INF = 1e9;
const ll INF = 1LL << 30;
const ll MOD = 1e9 + 7;

template<typename T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

int main() {
    int n; cin >> n;
    V<ll> v(n);
    for(int i = 0; i < n; i++){
        cin >> v[i];
    }

    ll g = v[0];
    for(int i = 1; i < n; i++){
        g = gcd(g, v[i]);
    }
    cout << g << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c, d;

  cin >> a >> b >> c >> d;
  
  if ((a + b) > (c + d)) {
    cout << "Left" << endl;
  } else if((a + b) < (c + d)) {
    cout << "Right" << endl;
  } else{
    cout << "Balanced" << endl;
  }
}

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

history = [0] * (K + 1)
total = 0

divide = pow(10, 9) + 7

for i in range(K, 0, -1):
  history[i] = pow(K//i, N, divide)
  for j in range(2, K//i + 1):
    history[i] -= history[i * j]
  total += ((i * history[i]) % divide)
  
total = total % divide
print(total)


Measured memory_bytes: 11284
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace A
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var hmhmk = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var h1 = hmhmk[0];
            var m1 = hmhmk[1];
            var h2 = hmhmk[2];
            var m2 = hmhmk[3];
            var k = hmhmk[4];
            var h = h2 - h1;
            var m = m2 - m1;
            Console.WriteLine(h * 60 + m - k);
        }
    }
}


Measured memory_bytes: 28236
#include <algorithm>
#include <stdio.h>

int main() {
	int n, m, a, b;
	bool possible = 0, hav_1link[200000] = { false }, hav_nlink[200000] = { false };
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++) {
		scanf("%d %d", &a, &b);
		a--, b--;
		if (a == 0)
			hav_1link[b] = true;
		if (b == (n - 1))
			hav_nlink[a] = true;
		possible |= (hav_1link[a] & hav_nlink[a]) | (hav_1link[b] & hav_nlink[b]);
	}
	printf("%s\n", (possible ? "POSSIBLE" : "IMPOSSIBLE"));
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int n,m;
int maxn;
int main() 
{
	scanf("%d%d%d",&n,&m,&maxn);
	if(n < m)swap(n,m);
	if(maxn % n == 0)printf("%d",maxn / n);
	else printf("%d",maxn / n + 1);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#define REP(i, n) for(i=0; i<n; i++)
#define REPR(i, n) for(i=n; i>=0; i--)
#define FOR(i, m, n) for(i=m; i<n; i++)
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define INF 10000000000
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
typedef pair<double, double> doup;

int main(void) {
    ll n, i, j, cnt=0, cnt2=0;
    string s;
    cin >> s;
    
    for(i=2; i<(ll)s.size()-1; i++) {
        if(s[i]=='C')
            cnt++;
    }
    
    for(i=0; i<(ll)s.size(); i++) {
        if(s[i]>='a' && s[i]<='z')
            cnt2++;
    }
    
    
    if(s[0]=='A' && cnt==1 && cnt2==(ll)s.size()-2) {
        cout << "AC" << endl;
        return 0;
    }else {
        cout << "WA" << endl;
        return 0;
    }
    
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int h[] = new int[n];
    int tmp =0;
    for(int i=0;i<n;i++){
      h[i] = sc.nextInt();
    }
    int cnt[] = new int[n];
    cnt[n-1]=0;
    for(int i=n-1;i>0;i--){
      if(h[i]<=h[i-1]){
        tmp=tmp+1;
        cnt[i-1]=tmp;
      }else{
        tmp=0;
        cnt[i-1]=0;
      }
    }
    Arrays.sort(cnt);
    System.out.print(cnt[n-1]);
  }
}

Measured memory_bytes: 52724
import java.util.HashSet;
import java.util.Scanner;

class Main{

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        HashSet<Integer> d = new HashSet<Integer>();

        for ( int i = 0; i < N; i++ ){
            d.add(sc.nextInt());
        }
        System.out.println(d.size());
    }
}

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

int main() {
  int N;
  cin >> N;
  int total = 0;
  int temp = N;
  while (temp != 0) {
    total += temp % 10;
    temp /= 10;
  }
  if (N % total == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<list>
#include<bitset>
#include<sstream>
using namespace std;

// 特定の文字列を数える関数
size_t count(const string& str, const string& sub, const size_t ini = 0, const size_t fin = string::npos) {
	size_t pos = str.find(sub, ini);
	size_t cnt = 0;
	while (pos < fin) {
		cnt += 1;
		pos = str.find(sub, pos + sub.length());
	}
	return cnt;
}

int main() {

	string S;
	cin >> S;

	string ns = S.substr(0, 1);
	for (int i = 1; i < S.length(); i++) {
		if (ns.back() == S[i]) {
			continue;
		}
		else {
			ns += S.substr(i, 1);
		}
	}

	if (ns.length() > 1) {
		int cnt = 0;

		string str = ns.substr(0, 2);

		cnt = count(ns, str);

		cnt = 2 * cnt - 1;

		if (ns.length() % 2 == 1) {
			cnt += 1;
		}

		cout << cnt << endl;
	}
	else {
		cout << 0 << endl;
	}
	

	return 0;
}

Measured memory_bytes: 3760
#include <iostream>
using namespace std;
int n, a[200000], b[200000];

int main() {
  cin.tie(0); ios_base::sync_with_stdio(false);
  cin >> n;
  for(int i = 0; i < n; ++i) {
    cin >> a[i];
    b[a[i]] = i;
  }
  if(n == 1) {
    cout << 0 << endl;
    return 0;
  }

  int cnt = 1, ans = 0;
  for(int i = 2; i <= n; ++i) {
    if(b[i-1] < b[i]) ++cnt;
    else cnt = 1;
    ans = max(ans, cnt);
  }
  cout << n - ans << endl;
  return 0;
}

Measured memory_bytes: 1792
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::Read;
#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok().unwrap();
    ret
}
fn get_word() -> String {
    let mut stdin = std::io::stdin();
    let mut u8b: [u8; 1] = [0];
    loop {
        let mut buf: Vec<u8> = Vec::with_capacity(16);
        loop {
            let res = stdin.read(&mut u8b);
            if res.unwrap_or(0) == 0 || u8b[0] <= b' ' {
                break;
            } else {
                buf.push(u8b[0]);
            }
        }
        if buf.len() >= 1 {
            let ret = String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}

#[allow(dead_code)]
fn get<T: std::str::FromStr>() -> T { get_word().parse().ok().unwrap() }

fn dfs(v: usize, vis: &mut [bool], path: &mut Vec<usize>, edges: &[Vec<usize>]) -> bool {
    if vis[v] {
        return false;
    }
    vis[v] = true;
    path.push(v);
    for &w in edges[v].iter() {
        let res = dfs(w, vis, path, edges);
        if res {
            return true;
        }
    }
    true
}

fn solve() {
    let n = get();
    let m = get();
    let mut edges = vec![Vec::new(); n];
    for _ in 0 .. m {
        let u = get::<usize>() - 1;
        let v = get::<usize>() - 1;
        edges[u].push(v);
        edges[v].push(u);
    }
    let mut vis = vec![false; n];
    let mut path1 = Vec::new();
    let mut path2 = Vec::new();
    dfs(0, &mut vis, &mut path1, &edges);
    vis[0] = false;
    dfs(0, &mut vis, &mut path2, &edges);
    path2.reverse();
    path2.pop(); // 0 disappears
    path2.append(&mut path1);
    println!("{}", path2.len());
    for i in 0 .. path2.len() {
        print!("{}{}", path2[i] + 1, if i == path2.len() - 1 { "\n" } else { " " });
    }
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 25468
N = int(input())
S = input()
r = 0
g = 0
b = 0
for i in range(N):
    if S[i]=='R':
        r += 1
    elif S[i]=='G':
        g += 1
    else:
        b += 1
ans = r*g*b
for i in range(N):
    for j in range(i+2,N,2):
        if S[i]!=S[j]:
            k = (i+j)//2
            if S[k]!=S[i] and S[k]!=S[j]:
                ans -= 1
print(ans)

Measured memory_bytes: 68140
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;


int main(void){
  int n,i,a[1000005],f[1000005];
  ll k;
  
  cin >> n >> k;
  for (i=0;i<n;i++) cin >> a[i];
  for (i=0;i<n;i++) cin >> f[i];
  
  sort(a,a+n,greater<int>());
  sort(f,f+n);
  
  ll l,r,mid,kd;
  l=-1;
  r=1e18;
  while (r-l>1){
    mid=(l+r)/2;
    kd=0;
    for (i=0;i<n;i++){
      kd+=max((ll)0,a[i]-mid/f[i]);
    }
    
    if (kd<=k) r=mid;
    else l=mid;
    
  }
  
  cout << r << endl;
  
  return 0;
}

Measured memory_bytes: 6912
#include<iostream>
#include<stdlib.h>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<limits.h>
#include<cmath>
#define rep(i,n) for(ll i = 0; i < (ll)n; i++)
#define swap(a,b) a^=b;b^=a;a^=b;
#define chmax(a,b) {if(a < b) a = b;}
#define chmin(a,b) {if(a > b) a = b;}
using namespace std;
typedef long long ll;
ll gcd(ll, ll);
vector<bool> to_binary(int);
int sum(vector<int>);
int min(vector<int>);
int max(vector<int>);
ll nCr(ll n, ll r);

const ll INF = 1LL << 60;

typedef tuple<ll, ll> mtupl;

bool mycomp(mtupl x, mtupl y) {
	return get<1>(x) < get<1>(y);
}

vector<vector<ll>> memo;

ll get(int x, int y) {
	if (memo[x][y] != -1)
		return memo[x][y];

	if (x == 0) return 1;
	if (y < x) return 0;

	memo[x][y] = get(x, y - 1) + get(x - 1, y - 1);
	return memo[x][y];
}

ll mpow(ll a, ll b) {
	ll ans = 1;
	for (ll i = 0; i < b; i++) {
		ans *= a;
		ans %= 1000000007;
	}
	return ans;
}

ll nCr(ll n, ll r) {
	ll res = 1;
	for (int i = 0; i < r; i++) {
		res *= (n - i);
	}
	for (int i = 1; i <= r; i++) {
		res /= i;
	}
	return res;
}

int vsum(vector<int> v) {
	int res = 0;
	for (auto it = v.begin(); it != v.end(); it++)
		res += *it;
	return res;
}
int vmin(vector<int> v) {
	int min = INT32_MAX;
	for (auto it = v.begin(); it != v.end(); it++)
		min = std::min(min, *it);
	return min;
}
int vmax(vector<int> v) {
	int max = INT32_MIN;
	for (auto it = v.begin(); it != v.end(); it++)
		max = std::max(max, *it);
	return max;
}

ll gcd(ll A, ll B) {
	if (A == 0 || B == 0) return max(A, B);
	int r = A % B;
	while (r != 0) {
		A = B;
		B = r;
		r = A % B;
	}

	return B;
}

vector<bool> to_binary(int x) {
	vector<bool> res;
	while (x != 0) {
		res.push_back(x % 2);
		x /= 2;
	}
	return res;
}

template<int index>
bool comp(tuple<ll, ll, ll, ll> a, tuple<ll, ll, ll, ll> b) {
	return get<index>(a) < get<index>(b);
}

int vector_finder(std::vector<ll> vec, ll number) {
	auto itr = std::find(vec.begin(), vec.end(), number);
	size_t index = std::distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return index;
	}
	else { // 発見できなかったとき
		return 0;
	}
}


int len(int x) {
	return (int)log10(x) + 1;
}


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

	int K, X;
	cin >> K >> X;

	int min = std::max(-1000000, X - K + 1);
	int max = std::min(1000000, X + K - 1);

	for (int i = min; i <= max; i++) {
		printf("%d ", i);
	}


ProgramEndPointLabel:;

	//Program End
	system("pause");

	return 0;
}
/*

*/




Measured memory_bytes: 504
n,k=map(int,input().split())
a=list(map(int,input().split()))
ks=[]
ele=0
for i in range(max(a)+1): ks.append(0)
for m in a:
  if ks[m]==0: ele+=1
  ks[m]+=1
if ele>k:
  ks.sort()
  p=sum(ks)
  for i in range(len(ks)-k,len(ks)):
      p-=ks[i]
  print(p)
else:
  print(0)

Measured memory_bytes: 25876
using System;
using System.Linq;

namespace AtCoder
{
    class B_SomeSums_083
    {
        public static void Main()
        {
            var inputs = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var N = inputs[0];
            var A = inputs[1];
            var B = inputs[2];
            var result = 0;
            for (var i = 1; i <= N; ++i)
            {
                var sum = EachDigitsTotal(i);
                if (A <= sum && sum <= B) { result += i; }
            }
            Console.WriteLine(result);
        }

        private static int EachDigitsTotal(int _value)
        {
            var sum = 0;
            while (true)
            {
                var digit = _value / 10;
                if (digit < 1)
                {
                    sum += _value;
                    return sum;
                }
                else
                {
                    sum += _value % 10;
                    _value = digit;
                }
            }
        }
    }
}


Measured memory_bytes: 13268
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<set>
#include<queue>
#include<map>
using namespace std;
int a[100010];
map<int,int> mp;
int main()
{
	int i,j,j1,k,n,m,o,p,l;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	mp.clear();
	o=0;
	for(i=0;i<n;i+=2)
	{
		int &x=mp[a[i]];
		x++;
		if(o<x)
		{
			o=x;
			j=i;
		}
	}
	mp.clear();
	mp[a[j]]=-0x7ffffff;
	p=0;
	for(i=0;i<n;i+=2)
	{
		int &x=mp[a[i]];
		x++;
		if(p<x)
		{
			p=x;
		}
	}
	mp.clear();
	l=0;
	for(i=1;i<n;i+=2)
	{
		int &x=mp[a[i]];
		x++;
		if(l<x)
		{
			l=x;
			j1=i;
		}
	}
	mp.clear();
	mp[a[j1]]=-0x7ffffff;
	k=0;
	for(i=1;i<n;i+=2)
	{
		int &x=mp[a[i]];
		x++;
		if(k<x)
		{
			k=x;
		}
	}
	int ans;
	if(a[j]!=a[j1])
	{
		ans=n-o-l;
	}
	else
	{
		ans=n-max(o+k,l+p);
	}
	printf("%d",ans);
}


Measured memory_bytes: 2944
def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y)

N = int(input()) 
time = [int(input()) for i in range(N)]

if N==1:
  print(time[0])
else:
  tmp = time[0]*time[1]//gcd(time[0],time[1])
  for i in time:
    if tmp%i!=0:
      tmp = tmp*i//gcd(tmp,i)

  print(tmp)

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

#define pb push_back
#define fi first
#define se second
typedef long long ll;

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

	string s, t;
	cin >> s >> t;
	cout << t << s << '\n';
}


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

using namespace std;

#define INF (1 << 30)
#define EPS 1e-10
#define MOD 1000000007

#define rep(i, n) FOR(i, 0, n)
#define FOR(i, x, n) for (int i = (x); i < (n); ++i)
#define all(v) (v).begin(), (v).end()

using ll = long long;

template<class T> void chmax(T& a, T b){ a>b?:a=b; }
template<class T> void chmin(T& a, T b){ a<b?:a=b; }

int main() {
    int r;
    cin >> r;
    cout << fixed << setprecision(10);
    cout << 2 * M_PI * r << endl;

    return 0;
}

Measured memory_bytes: 3748
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

constexpr ll mod = 1e9 + 7;

template <typename T> inline bool chmax(T &a, const T b) {
    if(a >= b) return false;
    a = b;
    return true;
}
template <typename T> inline bool chmin(T &a, const T b) {
    if(a <= b) return false;
    a = b;
    return true;
}

/*-------------------------------------------*/

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

    int h, w;
    cin >> h >> w;
    int a[h][w];
    bitset<12800> dp[w];
    rep(i, h) rep(j, w) cin >> a[i][j];
    rep(i, h) rep(j, w) {
        int b;
        cin >> b;
        a[i][j] -= b;
        a[i][j] = abs(a[i][j]);
    }
    dp[0].set(6400 + a[0][0]);
    dp[0].set(6400 - a[0][0]);
    rep(i, h) rep(j, w) {
        if(i) dp[j] = (dp[j] << a[i][j]) | (dp[j] >> a[i][j]);
        if(j) dp[j] |= (dp[j - 1] << a[i][j]) | (dp[j - 1] >> a[i][j]);
    }
    int ans = 1e9;
    FOR(i, 6400 - 80, 6400 + 81)
    if(dp[w - 1][i]) chmin<int>(ans, abs(6400 - i));
    cout << ans << endl;
}

Measured memory_bytes: 384
n = int(input())

ans = 0
kouho = [[0 for i in range(10)] for j in range(10)]

#print(kouho)

for i in range(1,n+1):
    #print(int(str[i][0]))
    kouho[int(str(i)[0])][int(str(i)[-1])] += 1
    
for i in range(1,10):
    for j in range(1,10):
        ans += kouho[i][j] * kouho[j][i]
        
print(ans)

Measured memory_bytes: 40428
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int A, B;
	cin >> A >> B;
	
	for (int i = 1; i <= A + 5; i++) {
		int t = B * i;

		int x = (t + A - 1) / A;



		if (x < i + x * A - t) {
			cout << x * A << endl;
			return 0;
		}

	}
	cout << -1 << endl;
}


Measured memory_bytes: 3200
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <math.h>
#include <time.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <list>
using namespace std;
typedef long long ll;
int  frq[26];
int main() {
	string s;
	int x = 0;
	cin >> s;
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] == '+')
			++x;
		else
			--x;
	}
	cout << x << endl;
	return 0;
}

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

using namespace std;


int main() {
	int b, r, g, c, s, t;
	int get, cost, bonusCnt;

	while (true) {
		cin >> b >> r >> g >> c >> s >> t;
		if (b == 0 && r == 0 && g == 0 && c == 0 && s == 0 && t == 0) {
			break;
		}

		bonusCnt = b * 5 + r * 3;
		get = 100 + (b + r + bonusCnt) * 15 + g * 7 + c * 2;
		cost = bonusCnt * 2 + (t - bonusCnt - s) * 3;
		cout << get - cost << endl;
	}

	return 0;
}



Measured memory_bytes: 3000
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define uniq(x) (x).erase(unique(ALL(x)),(x).end())
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define debug(x) cerr<<#x<<"="<<(x)<<endl
#define gett() cerr<<"Time:"<<clock()<<"ms."<<endl
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rlcfpoj(x) scanf("%I64d",&x)
#define pi(x) printf("%d",x)
#define pl(x) printf("%lld",x)
#define plcfpoj(x) printf("%I64d",x)
#define lfd() printf("\n")
#define sp() printf(" ")
#define inrep(x) int x;scanf("%d",&x);while(x--)
#define testbit(mask,i) (((mask)>>(i))&1)
#define setbit(mask,i) ((mask)|(1<<i))
#define delbit(mask,i) ((mask)^(1<<i))
int n,u,v;
int d1[100100],d2[100100];
vector<int> ga[100100];
queue<int> bfsq;
void Bfs(int s,int* d){
	for(int i=1;i<=n;i++)
		d[i]=2e9;
	bfsq.push(s);
	d[s]=0;
	while(!bfsq.empty()){
		s=bfsq.front();
		bfsq.pop();
		for(int i=0;i<ga[s].size();i++){
			int t=ga[s][i];
			if(d[t]>d[s]+1){
				d[t]=d[s]+1;
				bfsq.push(t);
			}
		}
	}
}
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n;
	for(int i=1;i<n;i++){
		cin>>u>>v;
		ga[u].push_back(v);
		ga[v].push_back(u);
	}
	Bfs(1,d1);
	Bfs(n,d2);
	int f=0;
	for(int i=1;i<=n;i++){
		if(d1[i]<=d2[i]){
			f++;
		}
	}
	if(f>(n-f)){
		cout<<"Fennec"<<endl;
	}
	else{
		cout<<"Snuke"<<endl;
	}
	return 0;
}


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

using namespace std;

#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define MP make_pair
#define LL long long int
#define ULL unsigned long long int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define PLI pair<long long int,int>
#define PLL pair<long long int,long long int>
#define MII map<int,int>
#define MSI map<string,int>
#define MIS map<int,string>
#define MLI map<long long int,int>
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)





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






int main()
{
    FAST();

//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    int i,j,pos,mn=INT_MAX,ara[5][5];
    for(i=1;i<4;i++)
    {
        for(j=1;j<4;j++)cin >> ara[i][j];
    }
    for(i=1;i<4;i++)
    {
        if(ara[1][i] < mn)mn=ara[1][i],pos=i;
    }
    for(i=1;i<4;i++)
    {
        mn=ara[i][pos];
        for(j=1;j<4;j++)ara[i][j]-=mn;
    }
    for(i=1;i<4;i++)
    {
        if(ara[1][i] != ara[2][i]  ||  ara[1][i] != ara[3][i])
        {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
    return 0;
}


Measured memory_bytes: 256
/* Filename: ARC058C.java
 * Author: Mushiyo
 */

import java.util.Scanner;

public class Main{

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

		while (input.hasNext()) {
			int N = input.nextInt(), D = input.nextInt();
			boolean[] hate = new boolean[10];

			for (int i = 0; i < D; ++i) {
				hate[input.nextInt()] = true;
			}

			int pay = N;
			while (true) {
				int tmp = pay;
				while (tmp > 0 && hate[tmp % 10] == false) {
					tmp /= 10;
				}
				if (tmp == 0) {
					break;
				} else {
					++pay;
				}
			}
			
			System.out.println(pay);
		}
	}

}


Measured memory_bytes: 8916
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

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

char four[4][5]={"aacd","bbcd","cdaa","cdbb"},five[5][6]={"aabba","bcc.a","b..cb","a..cb","abbaa"},six[6][7]={"aabee.","d.b..e","dcc..e","ee.aab","..ed.b","..edcc"},seven[7][8]={".eeffgg","eaab...","ed.b...","fdcc...","f...aab","g...d.b","g...dcc"};
char ans[1010][1010];

int main(void){
	int n,i,j,k;
	fill(ans[0],ans[1010],'.');
	cin >> n;
	if(n==2){
		cout << "-1" << endl;
		return 0;
	}else if(n==3){
		for(i=0; i<3; ++i){
			for(j=0; j<3; ++j){
				cout << six[i][j];
			}
			cout << endl;
		}
		return 0;
	}
	for(k=0; k<n; k+=4){
		switch(n-k){
			case 7:
			for(i=0; i<7; ++i){
				for(j=0; j<7; ++j){
					ans[k+i][k+j] = seven[i][j];
				}
			}
			k += 7;
			break;
			case 6:
			for(i=0; i<6; ++i){
				for(j=0; j<6; ++j){
					ans[k+i][k+j] = six[i][j];
				}
			}
			k += 6;
			break;
			case 5:
			for(i=0; i<5; ++i){
				for(j=0; j<5; ++j){
					ans[k+i][k+j] = five[i][j];
				}
			}
			k += 5;
			break;
			default:
			for(i=0; i<4; ++i){
				for(j=0; j<4; ++j){
					ans[k+i][k+j] = four[i][j];
				}
			}
			break;
		}
	}
	for(i=0; i<n; ++i){
		for(j=0; j<n; ++j){
			cout << ans[i][j];
		}
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 2176