akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <bitset>
#include <numeric>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[8]={ 0, 1, 0,-1, 1, 1,-1,-1}; // x軸方向への変位
ll dy[8]={ 1, 0,-1, 0, 1,-1, 1,-1}; // y軸方向への変位

int main(void) {
    ll n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    ll ans = 3;
    ll INF = 1e+9+7;
    ll a = 1;
    if(s[2]==t[2] && s[0]!=t[0]) {
        ans*=2; a = 3;
    }
    if(s[0]==t[0] && s[1]!=t[1]) a = 1;
    if(s[0]!=t[0] && s[1]!=t[1]) {
        a = 2; ans = 6;
    }
    //cout << a << endl;
    for(ll i = a; i < n; i++){
        if(s[i]==t[i] && s[i-1]==t[i-1]) ans*=2;
        else if(s[i]!=t[i] && s[i-1]==t[i-1]){
            ans*=2; i++;
        }
        else if(s[i]!=t[i] && s[i-1]!=t[i-1]){
            ans*=3; i++;
        }
        ans%=INF;
       // cout << i << " " << ans << " " << s[i] << endl;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long maxn=2e6+5;
const long long inf=0x3f3f3f3f;
const long long mod=1e9+7;
long long n,m;
long long fac[maxn],infac[maxn];
long long quick_pow(long long A,long long B,long long C)
{
	long long ans=1;
	while(B)
	{
		if(B&1)
			ans=(ans*A)%C;
		B>>=1;
		A=(A*A)%C;
	}
	return ans;
}
void init()
{
	fac[0]=infac[0]=1;
	for(long long i=1;i<=m;i++)
	{
		fac[i]=fac[i-1]*i%mod;
		infac[i]=quick_pow(fac[i],mod-2,mod);
	}
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	cin>>n>>m;
	init();
	long long res=0;
	for(long long i=0;i<=n;i++)
	{
		if(i&1)
			res=(res-fac[n]*infac[i]%mod*infac[n-i]%mod*fac[m-i]%mod*infac[m-n]%mod+mod)%mod;
		else
			res=(res+fac[n]*infac[i]%mod*infac[n-i]%mod*fac[m-i]%mod*infac[m-n]%mod+mod)%mod;
	}
	for(long long i=m-n+1;i<=m;i++)
		res=res*i%mod;
	cout<<(res+mod)%mod<<endl;
	return 0;
}


Measured memory_bytes: 11396
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1001001001;
const ll LONGINF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
int main() {
    int N; cin >> N;
    int M = (1 << N);    
    vector<int> A(M);
    for(int i=0; i<M; i++) cin >> A[i];
    sort(A.rbegin(), A.rend());

    int ofs = 1;
    vector<int> v;
    v.emplace_back(A[0]);

    multiset<int> ms;
    for(int i=1; i<M; i++) ms.emplace(A[i]);

    bool ok = true;
    while(v.size() < M) {
        int K = v.size();
        vector<int> new_elems;
        for(auto e : v) {
            int val = (ms.lower_bound(e) == ms.begin() ? -1 : *prev(ms.lower_bound(e)));
            fprintf(stderr, "K = %d: e = %d, val = %d\n", K, e, val);
            if(val < 0) {
                ok = false;
                break;
            }
            else {
                new_elems.emplace_back(val);
                ms.erase(ms.find(val));
            }
        }
        if(!ok) break;
        for(auto e : new_elems) v.emplace_back(e);
    }
    cout << (ok ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 13568
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
        Scanner sc = new Scanner(System.in);
		List<Integer> s = new ArrayList<>();
		
		for (int i = 0; i < 4; i++) {
			s.add(sc.nextInt());
		}
		
		sc.close();
		
		int l = s.get(0) + s.get(1);
		int r = s.get(2) + s.get(3);
		
		if (l > r) {
			System.out.println("Left");
		} else if (l == r){
			System.out.println("Balanced");
		} else {
			System.out.println("Right");
		}
		
	}

}


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

using namespace std;

struct student{
    int id;
    int no;
};
bool cmp (student s1, student s2)
{
    return s1.no < s2.no;
}
int main()
{
    int n, id = 1;
    cin >> n;
    vector<student> students;
    while(n--)
    {
        student s1;
        cin >> s1.no;
        s1.id = id;
        students.push_back(s1);
        id++;
    }
    sort(students.begin(),students.end(),cmp);
    for(int i = 0; i < students.size(); i++)
    {
        cout << students[i].id << " ";
    }
    return 0;
}


Measured memory_bytes: 1780
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] C = new String[n];


		for(int i = 0; i < n; i++) {
			C[i] = scan.next();
		}

		String[] B = C.clone();
		String[] A = B.clone();

		for(int i = 0; i < n; i++) {
			for(int j = n - 1; j > i; j--) {
				if(C[j].toCharArray()[1] < C[j - 1].toCharArray()[1]) {
					String temp = C[j];
					C[j] = C[j - 1];
					C[j - 1] = temp;
				}
			}
		}

		for(int i = 0; i < n; i++) {
			int min = i;
			for(int j = i; j < n; j++) {
				if(B[j].toCharArray()[1] < B[min].toCharArray()[1]) {
					min = j;
				}
			}
			String temp = B[i];
			B[i] = B[min];
			B[min] = temp;
		}

		for(int i = 0; i < n - 1; i++) {
			System.out.print(C[i] + " ");
		}
		System.out.println(C[n-1]);

		System.out.println(stable(A, C));

		for(int i = 0; i < n - 1; i++) {
			System.out.print(B[i] + " ");
		}
		System.out.println(B[n-1]);
		System.out.println(stable(A, B));

		scan.close();
	}
	public static String stable(String[] A, String[] B) {
		boolean flag = true;

		for(int i = 0; i < B.length; i++) {
			int index = B[i].toCharArray()[1];
			String s = "";

			for(int j = 0; j < B.length; j++) {
				if(B[j].toCharArray()[1] == index) {
					s += B[j].toCharArray()[0];
				}
			}

			char[] sc = s.toCharArray();
			int count = 0;
			for(int k = 0; k < A.length; k++) {
				if(A[k].toCharArray()[1] == index) {
					if(A[k].toCharArray()[0] == sc[count]){
						count++;
					} else {
						flag = false;
						break;
					}
				}

			}

			if(flag == false) {
				break;
			}
		}

		if(flag) {
			return "Stable";
		} else {
			return "Not stable";
		}

	}

}


Measured memory_bytes: 26560
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;



int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.length();
  VI freq(26);
  REP(i, 0, s.length()) {
    freq[s[i] - 'a'] += 1;
  }
  bool ok = true;
  REP(i, 0, 26) {
    ok &= freq[i] <= (n + 2) / 3;
  }
  cout << (ok ? "YES" : "NO") << "\n";
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#define FOR(i,k,n)  for(int i = (k);i < (n);++i)
#define REP(i,n)    FOR(i,0,n)

using namespace std;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;

void dfs(const vector<vecint>& g, vecint& w, int i, int p, int carry) {
  w[i] += carry;
  carry = w[i];
  for (int ch : g[i]) {
    if (ch == p) continue;
    dfs(g, w, ch, i, carry);
  }
}

int main()
{
  int n,q;
  cin>>n>>q;
  vector<vecint> g(n);
  REP(i,n-1) {
    int a,b;
    cin>>a>>b;
    --a;--b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  vecint w(n);
  REP(i,q) {
    int p,x;
    cin>>p>>x;
    --p;
    w[p] += x;
  }
  dfs(g, w, 0, -1, 0);
  REP(i,n) {
    if (i) cout<<' ';
    cout<<w[i];
  }
  cout<<endl;
  return 0;
}


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

int main()
{
 int x,y,z;

 while(1){
  cin >> x >> y;
  if(x==0 && y==0)break;if(x>y){z=x;x=y;y=z;}

  cout << x << " " << y << endl;
 }
}

Measured memory_bytes: 3052
import math

def update(index,n):
    targ[index] = n
    index = (index - 1) // 2
    while True:
        targ[index] = min(targ[index * 2 + 1],targ[index * 2 + 2])
        if index <= 0:
            break
        index = (index - 1) // 2

def find(i,e,node,inode,enode):
    #print(i,e,node,inode,enode)
    if inode > e or enode < i:
        return float("inf")
    elif (i <= inode and enode <= e) or inode==enode:
        return targ[node]

    else:
        irange = find(i,e,2*node + 1,inode,(inode+enode)// 2 )
        erange = find(i,e,2*node + 2,(inode+enode)//2 + 1,enode)
        return min(irange,erange)

num,query = (int(n) for n in input().split(' '))
initial = 2147483647
ln = 2 ** math.ceil(math.log2(num)) - 1
if num == 1:
    tail = 2
else:
    tail = 2 ** math.ceil(math.log2(num)) - num
global targ
targ = [initial] * (ln + num + tail)

for q in range(query):
    #print(targ)
    temp = [int(n) for n in input().split(' ') ]
    if temp[0] == 0:
        update(temp[1] + ln,temp[2])
    else:
        print(find(temp[1],temp[2],0,0,ln))

Measured memory_bytes: 11136
#include <bits/stdc++.h>
 
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
typedef pair <ll,ll> P;

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

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) { 
        os << v[i]; 
        if (i != (int)v.size() - 1) 
            os << " "; 
    } 
    return os; 
} 

int main()
{
    ll N, C;
    cin >> N >> C;
    vector<ll> s(N);
    vector<ll> t(N);
    vector<ll> c(N);
    vector<ll> cnt(200002, 0);
    vector<ll> tmp(200002, 0);
    rep(i, N) {
        cin >> s[i] >> t[i] >> c[i];
    }
    for(ll i = 1; i <= C; ++i) {
        fill(all(tmp), 0);
        rep(j, N) {
            if(c[j] == i) {
                tmp[s[j] * 2 - 1]++; tmp[t[j]*2]--;
            }
        }
        for(ll j = 1; j < 200002; ++j) tmp[j] += tmp[j-1];
        rep(j, 200002) {
            if(tmp[j] > 0) cnt[j]++;
        }
    }
    ll ma = 0;
    rep(i, 200002) ma = max(ma, cnt[i]);
    print(ma);
    return 0;
}

Measured memory_bytes: 5760
#include<bits/stdc++.h>
#define pb           push_back
#define pii          pair<int,int>
#define vi           vector<int>
#define vpii         vector<pair<int,int>>
#define gph          map<int, vector<int>>
#define mp           make_pair
#define FOR(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD0(i, n) for (int i = (int)n; i >= 0; i--)
#define FORD1(i, n) for (int i = (int)n; i >= 1; i--)
#define FORS(i, n) for(; i < (int)(n); i++)
#define debug(X) { cout << #X << " = " << (X) << endl; }
#define printArr(A,n) { cout << #A << " = "; FOR(i,n) cout << A[i] << ' '; cout << endl; }
using namespace std;
#define int long long int


int a, b;
vector<int> visited;
bool fail = false;
int n;
bool edges[701][701];
int cnt = 0;
void dfs(int cur, bool turn){
    //debug(cur);
    if(visited[cur] == turn)return;
    if(visited[cur] != -1 && visited[cur] ==  !turn){
        fail = true;
        return; 
    }
    visited[cur] = turn;
    if(turn)a++;
    else b++;
    FOR(i, n){
        if(i == cur)continue;
        if(!edges[i][cur]){
            cnt++;
            dfs(i, !turn);
        }
        if(fail)return;
    }
}
signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
  //  freopen("2.txt", "r", stdin);
    cin >> n;
    visited = vector<int>(n + 5, -1);
    int m;cin >> m;
    int u, v;
    FOR(i, m){
        cin >> u >> v;
        u--,v--;
        edges[u][v] = edges[v][u] = true;
    }
    vector<pii> options;
    a = 0, b= 0;
    FOR(i, n){
        if(visited[i] == -1)dfs(i, false);
        if(fail){
            cout << -1 <<endl;
            return 0;
        }
        if(a + b > 0)options.pb(mp(a, b));
        a = 0, b= 0;
    }
    const int lim = (n)/2;
    assert(m*2 + cnt == (n*(n-1)));
    vector<bool> dp(lim + 1);
    dp[0] = true;
    int sum = 0;
    for(pii x: options){
        vector<bool> dp2(lim+1);
        sum += x.first + x.second;
        FORD1(i, lim){
            if(x.first <= i)dp2[i] =dp2[i] |  dp[i - x.first];
            if(x.second <= i)dp2[i] = dp2[i] | dp[i - x.second]; 
        }
        dp = dp2;
    }
    assert(sum == n);
    FORD1(i, lim){
        if(dp[i]){
            cout << i*(i-1)/2 + (n-i)*(n-i-1)/2 <<endl; 
            return 0;
        }
    }

}




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

using namespace std;

int main()
{
	int k;
	cin >> k;
	vector<long long> a;
	for (int i = 1; i <= 9; i++) {
		a.push_back(i);
	}
	while (true) {
		if (k <= a.size()) {
			cout << a[k - 1] << endl;
			return 0;
		}
		k -= a.size();
		vector<long long> old;
		swap(old, a);
		for (long long x : old) {
			for (int i = -1; i <= 1; i++) {
				int d = x % 10 + i;
				if (d < 0 || d > 9) continue;
				long long nx = x * 10 + d;
				a.push_back(nx);
			}
		}
	}
	return 0;
}

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

typedef long long ll;


int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //Älä käytä, jos tehtävä on interaktiivinen!
    int n;
    cin >> n;
    if (n>=30){
        cout << "Yes\n";
    }
    else cout << "No\n";
}







Measured memory_bytes: 3636
import java.io.PrintWriter
import java.lang.Math.max

fun main(args: Array<String>) {
    val pw = PrintWriter(System.out)
    val (N, Q) = readLine()!!.split(" ").map(String::toInt)
    val S = readLine()!!
    var wa = IntArray(S.length)
    for (i in S.indices) {
        if (i == 0) continue
        if (S[i-1] == 'A' && S[i] == 'C') {
            wa[i] = 1
        }
    }
    for (i in wa.indices) {
        if (i == 0) continue
        wa[i] += wa[i-1]
    }
    for (i in (1..Q)) {
        val (l, r) = readLine()!!.split(" ").map(String::toInt)
        pw.println(wa[r-1] - wa[l-1])
    }
    pw.flush()
}

Measured memory_bytes: 58740
n, m = map(int, input().split())
A = sorted(list(map(int, input().split())))
BC = sorted([list(map(int, input().split()))
             for i in range(m)], key=lambda x: x[1], reverse=True)
D = []

for bc in BC:
    b = bc[0]
    c = bc[1]
    D += [c] * b
    if len(D) >= n:
        break

if len(D) < n:
    D += [0] * (n-len(D))

ans = 0
for a, d in zip(A, D):
    ans += max(a, d)

print(ans)


Measured memory_bytes: 33640
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long ll;
const int INF=1001001001;
int main(){
  int N,M;
  cin>>N>>M;
  vector<int>a(N);
  int ans=0;
  for(int i=0;i<=M-1;++i){
    int k;
    cin>>k;
    for(int j=0;j<=k-1;++j){
      int s;
      cin>>s;
      s--;
      a[s] |= 1<<i;
    }
  }
  int p=0;
  for(int i=0;i<=M-1;++i){
    int x;
    cin>>x;
    p |= x<<i;
  }
  for(int s=0;s<(1<<N);s++){
    int t=0;
    for(int i=0;i<N;i++){
      if(s>>i & 1){
        t ^= a[i];
      }
    }
    if(t==p){
      ans++;
    }
  }    
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <utility>
#include <vector>

using namespace std;

class union_find {
    vector<int> p;
    vector<int> r;

public:
    union_find(int n) {
        p = vector<int>(n);
        r = vector<int>(n);

        for (int i = 0; i < n; i++) {
            p[i] = i;
            r[i] = 0;
        }
    }

    int root(int a) {
        if (p[a] != a) {
            p[a] = this->root(p[a]);
        }

        return p[a];
    }

    void unite(int a, int b) {
        int ra = this->root(a);
        int rb = this->root(b);

        if (ra == rb) {
            return;
        }

        if (r[ra] < r[rb]) {
            p[ra] = rb;
        } else {
            p[rb] = ra;

            if (r[ra] == r[rb]) {
                r[ra]++;
            }
        }
    }
};

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

    union_find pq(n);
    for (int i = 0; i < k; i++) {
        int p, q;
        cin >> p >> q;
        pq.unite(p - 1, q - 1);
    }

    union_find rs(n);
    for (int i = 0; i < l; i++) {
        int r, s;
        cin >> r >> s;
        rs.unite(r - 1, s - 1);
    }

    map<pair<int, int>, int> cnt;
    for (int i = 0; i < n; i++) {
        cnt[make_pair(pq.root(i), rs.root(i))]++;
    }

    cout << cnt[make_pair(pq.root(0), rs.root(0))];
    for (int i = 1; i < n; i++) {
        cout << " " << cnt[make_pair(pq.root(i), rs.root(i))];
    }
    cout << endl;
}


Measured memory_bytes: 15104
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define P pair<ll, ll>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define pp pair<ll, pair<ll, ll>> 




////////////////////////////////////////////////////////


int main() {
    double a, b, h, m; cin >> a >> b >> h >> m;
    double H, M;
    H = 360.0*(h/12.0)+360.0*(m/(12.0*60.0));
    M = 360.0*(m/60.0);
    double the = abs(H-M);
    the = (the*pi/180.0);
    // co(the);
    double l = a*a + b*b - 2.0*a*b*cos(the);
    l = sqrt(l);
    cout << fixed << setprecision(15) << l << endl;

    return 0;
}


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



int main() {
    int n;
    cin >> n;
    double sum = 0;
    rep(i,n) {
        double a;
        cin >> a;
        sum += 1/a;
    }
    double ans = 1/sum;
    printf("%.10f\n", ans);
    return 0;
}

Measured memory_bytes: 3788
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;

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


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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long  ll; typedef vector<int> VI; typedef pair<int,int> pii;
typedef vector<ll> VL; const int MD = 1e9 + 7;
void dbg(){cerr<<"\n";} template <typename T,typename ...T2> void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }


int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int a, b, ans =0;
	cin >>a >>b;
	
	cout << a*b <<"\n";
	return 0;
}


Measured memory_bytes: 3612
#include <cstdio>
using namespace std;
struct RNG{
    typedef unsigned long long ull;
    ///taken from http://prng.di.unimi.it/xoshiro256plusplus.c
    ull s[4];

    RNG(ull a, ull b, ull c, ull d){
        ///please seed this with something legit
        s[0]=a,s[1]=b,s[2]=c,s[3]=d;
    }

    static inline ull rotl(const ull x, int k){
        return (x << k) | (x >> (64 - k));
    }


    ull next() {
        const ull result = rotl(s[0] + s[3], 23) + s[0];

        const ull t = s[1] << 17;

        s[2] ^= s[0];
        s[3] ^= s[1];
        s[1] ^= s[2];
        s[0] ^= s[3];

        s[2] ^= t;

        s[3] = rotl(s[3], 45);

        return result;
    }
}*rng=new RNG(264736840,673312201,616314496,60764831);

int n;
int temp1[200005];
int temp2[200005];
int arr[200005];
int brr[200005];

long long bases[30];
const int MOD=1000000007;
const long long power=167451913;

long long hash1[30];
long long hash2[30];

void print(){
    for (int x=0;x<30;x++) printf("%d ",hash1[x]);
    printf("\n");
    for (int x=0;x<30;x++) printf("%d ",hash2[x]);
    printf("\n\n");
}
int main(){
    scanf("%d",&n);
    for (int x=0;x<n;x++) scanf("%d",&temp1[x]);
    for (int x=1;x<n;x++) arr[x]=temp1[x-1]^temp1[x];
    arr[0]=temp1[0]^temp1[n-1];
    for (int x=0;x<n;x++) scanf("%d",&temp2[x]);
    for (int x=1;x<n;x++) brr[x]=temp2[x-1]^temp2[x];
    brr[0]=temp2[0]^temp2[n-1];
    
    for (int x=0;x<1024;x++) rng->next();
    for (int x=0;x<30;x++) bases[x]=rng->next()%MOD;
    
    for (int x=0;x<n;x++){
        for (int y=0;y<30;y++){
            hash1[y]=(hash1[y]*power)%MOD;
            if (arr[x]&(1<<y)) hash1[y]=(hash1[y]+bases[y])%MOD;
        }
    }
    
    for (int x=0;x<n;x++){
        for (int y=0;y<30;y++){
            hash2[y]=(hash2[y]*power)%MOD;
            if (brr[x]&(1<<y)) hash2[y]=(hash2[y]+bases[y])%MOD;
        }
    }
    
    long long super=1;
    for (int x=0;x<n;x++) super=(power*super)%MOD;
    
    for (int x=0;x<30;x++){
        if (hash1[x]!=hash2[x]) goto __fail;
    }
    printf("%d %d\n",0,temp1[n-1]^temp2[n-1]);
    __fail:;
    for (int x=0;x<n-1;x++){
        for (int y=0;y<30;y++){
            hash1[y]=(hash1[y]*power)%MOD;
            if (arr[x]&(1<<y)){
                hash1[y]=(hash1[y]+bases[y])%MOD;
                hash1[y]=(hash1[y]-super*bases[y])%MOD;
                if (hash1[y]<0) hash1[y]+=MOD;
            }
        }
        
        for (int x=0;x<30;x++){
            if (hash1[x]!=hash2[x]) goto fail;
        }
        printf("%d %d\n",(x+1)%n,temp1[x]^temp2[n-1]);
        fail:;
        
    }
    
    
    
}

Measured memory_bytes: 6528
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

class Main{
  public static void main(String[] arigs) throws IOException{
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    String N = reader.readLine();
    if(N.contains("7")){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
    reader.close();
  }
}

Measured memory_bytes: 32408
#include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define mod 1000000007
#define PI acos(-1)
#define fi first
#define se second
#define lowbit(x) (x&(-x))
#define mp make_pair
#define pb push_back
#define ins insert
#define si size()
#define E exp(1.0)
#define fixed cout.setf(ios::fixed)
#define fixeds(x) setprecision(x)
#pragma GCC optimize(2)
using namespace std;
inline ll read(){ll s=0,w=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;}void put1(){ puts("Yes") ;}void put2(){ puts("No") ;}
void debug(){printf("T   A   T\n");}void put3(){ puts("-1"); }ll qpf(ll a, ll b, ll p)
{ll ret = 0;while(b){if(b & 1) ret = (ret + a) % p;a = (a + a) % p;b >>= 1;}
return ret % p ;}ll qp(ll a, ll n, ll p){ll ret = 1;while(n){if(n & 1) ret = qpf(ret, a, p);
a = qpf(a, a, p);n >>= 1;}return ret % p ;}//��=acos(L/2R);
//void say(){ cout<<"I CAN AC"<<endl;}

const int manx=1e6+5;
const double eps =1e-8;

 int main()
 {
 	int a,b;
 	cin>>a>>b;
 	for(int i=1;i<=2000;i++){
 		if((int)(i*0.08)==a&&(int)(i*0.1)==b){
 			cout<<i<<endl;
 			return 0;
		 }
	 }
	cout<<-1<<endl;
  }



Measured memory_bytes: 256
/*input
1000000
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define debug cout << "hi" << endl

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

const int MOD = 1e9 + 7;
const int INF32 = 1<<30;
const ll INF64 = 1LL<<60;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n; cin >> n;
    ll ans = 0;
    for(int i = 1; i <= n; i++) if(i % 3 && i % 5) ans += i;
    cout << ans;

    return 0;
}

Measured memory_bytes: 3648
import java.util.Scanner;

//Bubble Sort
public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			int[] a = new int[n];
			for(int i=0;i<n;i++)a[i]=sc.nextInt();
			int s = 0;
			for(int j=n-1;j>=1;j--){
				for(int i=0;i<j;i++){
					if(a[i+1]<a[i]){
						int t = a[i];
						a[i]=a[i+1];
						a[i+1]=t;
						s++;
					}
				}
			}
			System.out.println(s);
		}
	}
}

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

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MAX 1000000001;
using namespace std;
typedef long long ll;

int n;
int h[200];


int main(int argc, char const *argv[]) {
  std::cin >> n;
  h[0] = 0;
  rep(i,1,n+1)std::cin >> h[i];
  h[n+1] = 0;
  ll res = 0;
  rep(i,0,n){
    if(h[i+1]>h[i]) res+= h[i+1] - h[i];
  }
  std::cout << res << '\n';

  return 0;
}


Measured memory_bytes: 256
all_lines = readlines.map{ |line| line.split(' ') }
lines = []
start_number = 0

while all_lines[start_number][0].to_i > 0
  n = start_number + all_lines[start_number][0].to_i
  end_number = 1 + n + all_lines[1 + n][0].to_i
  lines.push(all_lines[start_number..end_number])
  start_number = 1 + end_number
end

x = lines.count
x.times do |n|
  ary = lines[n]
  t = ary[0][0].to_i
  gem_coordinates = [] #
  depth = 10 #縦
  width = 10 #横

  t.times do |i|
    gem_coordinates.push(ary[i+1].map(&:to_i))
  end
  number_of_order = ary[t+1][0].to_i

  number_of_order.times do |i|
    order = ary[t+2+i]
    number = ary[t+2+i][1].to_i
    case
    when order.include?("N")
      number.times do
        depth += 1
        gem_coordinates.reject! { |item| item[0] == width && item[1] == depth }
      end
    when order.include?("S")
      number.times do
        depth -= 1
        gem_coordinates.reject! { |item| item[0] == width && item[1] == depth }
      end
    when order.include?("E")
      number.times do
        width += 1
        gem_coordinates.reject! { |item| item[0] == width && item[1] == depth }
      end
    when order.include?("W")
      number.times do
        width -= 1
        gem_coordinates.reject! { |item| item[0] == width && item[1] == depth }
      end
    end
  end

  puts gem_coordinates.empty? ? "Yes" : "No"
end



Measured memory_bytes: 7788
// AOJ DPL_1_C Knapsack Problem
//
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
template<class T> inline bool chmax(T& a, T b) {return a<b?a=b,true:false;}

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

    int N, W;
    cin >> N >> W;

    vector<int> v(N), w(N);
    rep(i, N) cin >> v[i] >> w[i];

    vector<vector<int>> dp(N+1, vector<int>(W+1, 0));    

    rep1(i, N+1) {
        rep(j, W+1) {
            dp[i][j] = dp[i-1][j];
            if (j >= w[i-1]) {
                chmax(dp[i][j], dp[i-1][j-w[i-1]] + v[i-1]);
                chmax(dp[i][j], dp[i][j-w[i-1]] + v[i-1]);
            }
        }
    }

    // rep(i, dp.size()) {
    //     rep(j,dp[i].size()) {
    //         cout << setw(3) << dp[i][j] << " ";
    //     }
    //     cout << endl;
    // }

    cout << dp[N][W] << endl;
}



Measured memory_bytes: 6836
#include<bits/stdc++.h>
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 all(v) (v).begin(),(v).end()
typedef pair<int,int> P;
int n,t,s;int a,b;
int dp[3002][3002];

int main(){
  cin>>n>>t>>s;
  REP(i,n){
    cin>>a>>b;
    REP(j,t){
      dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1]);
    }
    REP(j,t){
      if(j<s&&s<j+b)continue;
      if(t<j+b)continue;
      dp[i+1][j+b]=max(dp[i][j]+a,dp[i+1][j+b]);
    }
  }
  cout<<dp[n][t]<<endl;
  return 0;
}

Measured memory_bytes: 38280
#include <iostream>
#include <string>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;


int main(){
    ll N, M;

    //input
    cin >> N >> M;

    cout << (N + M) * (N + M - 1) / 2 - N * M << endl;

    return 0;
}


Measured memory_bytes: 256
n,m = map(int,input().split())
l = [0 for i in range(n)]
rl = [0 for i in range(n)]
if n != 1:
    l[0] = 1
k = 0
for i in range(m):
    s,c = map(int,input().split())
    s -= 1
    if s == 0:
        if c == 0 and n > 1:
            k = 1
            break
        else:
            if rl[s] == 0:
                l[s] = c
                rl[s] = 1
            else:
                if l[s] != c:
                    k = 1
                    break
    else:
        if rl[s] == 0:
            l[s] = c
            rl[s] = 1
        else:
            if l[s] != c:
                k = 1
                break
if k == 1:
    print(-1)
else:
    for i in l:
        print(i,end="")

Measured memory_bytes: 3064
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


import math


A, B = map(int, input().split())

result = 0

for i in range(A, B + 1):
    string    = str(i)
    list_flag = [string[j] == string[-j - 1] for j in range(math.ceil(len(string) / 2))]
    if (len(list_flag) == sum(list_flag)):
        result += 1

print(result)


Measured memory_bytes: 3060
use proconio::input;

fn main() {
    input! {
        n: isize,
        m: isize,
        a: [isize; m],
    }

    let x = n - a.iter().sum::<isize>();

    if x >= 0 {
        println!("{}", x);
    } else {
        println!("-1");
    }
}


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

#define for(i, a, b) for(ll (i)=a;(i)<(b);++(i))
#define rep(i, n)    for(i, 0, n)

const ll inf = 1e15;
const ll mod = 1e9+7;

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

int main() {
    ll X;
    cin >> X;
    
    ll ans = 1;
    rep(i, X) {
        for(j, 2, i) {
            ll x = i + 1;
            while (x % j == 0) x /= j;
            if (x == 1) ans = i + 1;
        }
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int s = 0;
	rep(i, 10){ int x; cin >> x; s += x; }
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 3128
n = int(input())
s = str(input())
left = s[0]
ans = 10**6
left = {}
left.setdefault('W',0)
left.setdefault('E',0)
right = {}
right.setdefault('E',0)
right.setdefault('W',0)
for i in range(n):
    right[s[i]] += 1
ans = 10**6
for i in range(n):
    right[s[i]] -= 1
    ans = min(ans,left['W']+right['E'])
    #print(left,right)
    left[s[i]] += 1
print(ans)
    


Measured memory_bytes: 9764
#define _USE_MATH_DEFINES
#include  <iostream>
#include  <algorithm>
#include  <climits>
#include  <vector>
#include  <string>
#include  <cstring>
#include  <stack>
#include  <queue>
#include  <cmath>
#include  <iomanip>
#include  <set>
#include  <map>
#include  <new>

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

typedef long long ll;
typedef vector<vector<int> > Graph;

const int Mod = static_cast<int>(1e9 + 7);

int n, m, q;
vector<int>a, b, c, d;
int ans = 0;

void dfs(vector<int> A) {
	if (A.size() == n + 1) {
		int now = 0;
		rep(i, q) {
			if (A[b[i]] - A[a[i]] == c[i])  now += d[i];
		}
		ans = max(ans, now);
		return;
	}
	A.push_back(A.back());
	while (A.back() <= m) {
		dfs(A);
		A.back()++;
	}
}

int main()
{

	cin >> n >> m >> q;
	a = b = c = d = vector<int>(q);
	rep(i, q) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
	}

	dfs(vector<int>(1, 1));
	cout << ans << endl;
}


Measured memory_bytes: 3588
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>

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


// 68 11 55 - rank 3
// 69 12 19 - rank 3
// 70 12 34 - rank 100
// 71 12 58 -

ull gcd(ull a, ull b) {
    while (b != 0) {
        auto na = a % b;
        a = b;
        b = na;
    }
    return a;
}


void oneCase() {
    int x, a, b;
    cin >> x >> a >> b;
    if (abs(x - a) <= abs(x - b)) {
        cout << "A" << "\n";
    } else {
        cout << "B" << "\n";
    }

}


int main() {
    int t = 1;
//    cin >> t;
    while (t--) {
       oneCase();
    }

    return 0;
}

ll fact(ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        res = (res * n) % mod;
        --n;
    }
    return res;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define INF 1000000000
#define MOD 100000007

int n, k, m=0x7fffffff, mi, ans;
int a[222222];
int s, e, mid;
int possible(){
  int dap = mid;
  for(int i=1; i<n; i+=k-1)
    dap--;
  return dap >= 0;
}
int main(){
    scanf("%d%d", &n, &k);
    for(int i=1; i<=n; i++){
        scanf("%d", &a[i]);
        if (m > a[i] ){
          m = a[i];
          mi = i;
        }
    }
    s = 1;
    e = n;
    while (s<=e){
      mid = (s+e)/2;
      if ( possible() ){
        ans = mid;
        e = mid - 1;
      }
      else 
        s = mid + 1;
    }
    
    printf("%d", ans);
    return 0;
}

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

using namespace std;

#define ll unsigned long long
#define lop(a, b) for(int i = a; i < b; i++)
#define lopj(a, b) for(int j = a; j < b; j++)

int main()
{
//    ios_base::sync_with_stdio(0);
//    cin.tie(0);
//    cout.tie(0);

    //freopen("input.txt", "r", stdin)

    ll n, digits = 0;

    cin >> n;

    string ch = "abcdefghijklmnopqrstuvwxyz", res = "";

    while(n)
    {
        n--;
        ll x = n % 26;

        //if(n < 26 and k % 26 == 0) x = n - 1;
        n /= 26;

        //if(x == 0) x = 26;

        res += ch[x];
    }

    //for(int i = digits - 1; i >= 0; i--) cout << nam[i];

    reverse(res.begin(), res.end());

    cout << res << '\n';
//main();
    return 0;
}



Measured memory_bytes: 3592
#include <iostream>
using namespace std;
int n;
int m =0;
int *a;
//int  G[16] = { 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 };
int G[100] = {};
int Gn = 0;

void insert_sort(int g)
{
	for(int i=g;i<n;i++)
	{
		int key = a[i];
		int j=i-g;
		while(j>=0)
		{
			if(a[j]<=key) 
			{
  			  break;
			}
			a[j+g] = a[j];
			m++;
			j -= g;
		}
		a[j+g] = key;
	}
}

void shell_sort()
{
	for (int i=0; i<Gn;i++)
	{
		insert_sort(G[Gn-1-i]);
	}
}

int main()
{
	cin >> n;
	a = new int[n];
	for (int i = 0; i < n;	i++)
	{
		cin >> a[i];
	}
	
	Gn = 1;
	G[0] = 1;
	int g = 2;
	while (g + 1< n)
	{
		G[Gn++] = g + 1;
		g *= 2;
	}
	
	shell_sort();
	
	cout << Gn << endl;
	for (int i=0; i<Gn;i++)
	{
		if (i) cout << ' ';
		cout << G[Gn-1-i];
	}
	cout << endl;
	
	cout << m << endl;
	
	for (int i=0; i<n;	i++)
	{
		cout << a[i] << endl;
	}
	
	return 0;
}

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

int main() {
  int N, T;
  cin >> N >> T;
  vector<int> c(N), t(N);
  for (int i = 0; i < N; i++) cin >> c[i] >> t[i];
  int ans = 10000;
  for (int i = 0; i < N; i++) {
    if (T >= t[i]) {
      if (ans > c[i]) ans = c[i];
    }
  }
  if (ans != 10000) cout << ans << endl;
  else cout << "TLE" << endl;
}


Measured memory_bytes: 3636
#include<stdio.h>

int main(void){
  int a,b;
  int add,sub,mul;
  
  scanf("%d %d",&a,&b);
  
  add = a + b;
  sub = a - b;
  mul = a * b;
  
  if( add < mul && sub < mul ) printf("%d\n",mul);
  else if( add < sub && mul < sub ) printf("%d\n",sub);
  else printf("%d\n",add);
  
  return 0;
}

Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static bool Solve(int X)
        {
            int n = X / 100;
            int m = X % 100;
            return (m + 4) / 5 <= n;
        }

        static void Main(string[] args)
        {
            int X = ReadInt();
            Console.WriteLine(Solve(X) ? 1 : 0);
        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
int main(void) {
	string a;
	getline(cin, a);
	for (int i = 0; i < a.length(); i++) {
		if (a[i] >= 'a' && a[i] <= 'z') {
			a[i] += 'A' - 'a';
		}
		else if (a[i] >= 'A' && a[i] <= 'Z') {
			a[i] += 'a' - 'A';
		}
		cout << a[i];
	}
	cout << endl;
}


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

int main()
{
  int n;
  cin>>n;
  int A[n];
  int count =0;
  for(int i=0;i<n;i++)
    cin>>A[i];

  for(int i=0;i<n;i++)
    {
      int mini =i;
      for(int j=i;j < n; j++)
	{
	  if(A[j]<A[mini])
	    mini=j;
	}
	    
	  swap(A[i],A[mini]);
	  if(i!=mini)
	    count++;

    }

   for(int i=0;i<n;i++)
     {
       cout<<A[i];
       if(i==n-1)
	 cout<<endl;
       else
	 cout<<" ";
     }
   cout<<count<<endl;
}

Measured memory_bytes: 1160
#import<bits/stdc++.h>
using namespace std;
typedef int64_t l;
typedef vector<l> q;
#define r(i,n)for(i=0;i<n;i++)
void c(l &a,l b){if(a>b)a=b;}
main(){l n,s,k,v,i,j,b;cin>>n;q x(n),y(n),p(n),a(n+1,1LL<<60);vector<q>X(n),Y(n);r(i,n)cin>>x[i]>>y[i]>>p[i];r(i,n){X[i]=q(1<<n,abs(x[i])),Y[i]=q(1<<n,abs(y[i]));r(b,1<<n)r(j,n)if(b&1<<j)c(X[i][b],abs(x[i]-x[j])),c(Y[i][b],abs(y[i]-y[j]));}r(b,1<<n){s=b;do{k=__builtin_popcountl(b),v=0;r(i,n)v+=p[i]*min(X[i][s],Y[i][b&~s]);c(a[k],v),s=(s-1)&b;}while(s!=b);}r(i,n+1)cout<<a[i]<<" ";}

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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define dump(x) cerr << #x " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define endl '\n'

#ifdef _DEBUG27_
    //#define STRESS 1
#endif

typedef long long llong;

const int INF = 2e9 + 999;
const llong LINF = 2e18 + 999;

void inv(bool e);
template<typename T> T sign(T a);
template<typename T> void die(T &a);
template<typename T> void umax(T &a, T b);
template<typename T> void umin(T &a, T b);

bool brute, alter;
int cnt_tests = 1;

// Atcoder 2018

// Code below

string s;

void inp() {
    cin >> s;
}

void solve() {
    s[3] = '8';
    cout << s;
}

void stress() {

}

void naive() {

}

void run();
int main() {
    #ifdef _DEBUG27_
        if (1)
            freopen("input.txt", "r", stdin);
    #else
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        if (0) {
            freopen("palindrome.in", "r", stdin);
            freopen("palindrome.out", "w", stdout);
        }
    #endif
    srand(time(0));
    #ifdef STRESS
        brute = true;
    #else
        brute = false;
    #endif

    for (int i = 0; (i < cnt_tests); i++) {
        run();
    }

    #ifdef _DEBUG27_
        cout << endl << "Time: " << clock() / 1000.0 << " ms";
    #endif
    return 0;
}

void run() {
    if (!brute) {
        inp();
    }
    else {
        stress();
    }
    solve();
    cout << endl;
}

template<typename T>
void die(T &a) {
    cout << a;
    exit(0);
}

template<typename T>
T sign(T a) {
    if (a == 0)
        return 0;
    if (a < 0)
        return -1;
    return 1;
}

template<typename T>
void umax(T &a, T b) {
    if (b > a)
        a = b;
}

template<typename T>
void umin(T &a, T b) {
    if (b < a)
        a = b;
}

void inv(bool e) {
    if (!e) {
        vector<int> a;
        a[-1] += 1;
    }
}

/** CLEARING BUFFER

    cout << VAL << flush;

    OR

    printf(VAL);
    fflush(stdout);
*/


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

    int n;
    cin >> n;

    map<pair<int, int>, int> m; 
    for(int i=1; i<=n; ++i){
        string s = to_string(i);
        int a = s[0] - '0';
        int b = s.back() - '0';
        m[make_pair(a, b)]++;
    }
    int ans = 0;
    for(int i=1; i<=n; ++i){
        string s = to_string(i);
        int a = s[0] - '0';
        int b = s.back() - '0';
        ans += m[make_pair(b, a)];
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import math

n, a, b = map(int, input().split())
hs = list(map(int, (input() for _ in range(n))))

m = sum(hs) // (a + (n-1)*b) - 10
M = sum(math.ceil(h/a) for h in hs)

def killable(p, hs, a, b):
    x = sum(max(0, math.ceil((h-p*b) / (a-b))) for h in hs)
    return x <= p

while(m+1 < M):
    c = (m+M) // 2
    if killable(c, hs, a, b):
        M = c
    else:
        m = c
print(M)

Measured memory_bytes: 55896
/******************************************
* NICK : nikhilsinghh59 *
******************************************/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"

#define PB push_back
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
const int M = 1e9+7;

int main()
{   
    

    ll t;
    cin >> t;

    double pi = 3.14159265;
    cout << 2*pi*t ;
    
    return 0;
}


Measured memory_bytes: 3776
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int MOD = 1e9+7, MAX = 1e9, larg = 1e5, INF = -1e9;
long long A,B,C,D,E,F,G,H,I,J,K,L,N,M,O,P,Q,R,S,T,U,V,W,X,Y,Z;
long long max_value = INF, max_index = -1;
long long min_value = MAX, min_index = -1;
long long sum = 0;

typedef pair<int, int> Pa;
typedef long long ll;

int main() {
    int sum = 0;
    cin >> N;
    rep(i, N){
        cin >> X;
        sum += X-1;
    }
    cout << sum;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int a;
	int b;
	int d;
	int r;
	double f;
	
	scanf("%d %d", &a, &b);
	
	d = a / b;
	r = a % b;
	f = 1.0 * a / b;
	
	printf("%d %d %lf\n", d, r, f);
	
	return (0);
}

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

int main(){
    using namespace std;
    unsigned long N;
    cin >> N;
    if(N & 1)return 0 & puts("0");
    unsigned long a{0};
    N /= 2;
    while(N)a += (N /= 5);
    cout << a << endl;
    return 0;
}

Measured memory_bytes: 256
/*
1. a??¨1???int?????§???1/a=0.001?????????0???????????????????????????????????????1??§?????????
2. (1/a+1)?????¨?????????????????°??????2?????°???2?????????????????°??????????????£?????????????????§1.001????????????????????¨????§????(1/a+1-1)??¨a???2?????°??§?????????????????????????????°??§???????????£????????????????????¨????????????????????????????????????????°????????????????????????????1??§????????????
3.????°???°????¨????????????????2?????°???????????????????¨???????????????§??????????¨?????????????????????????????????§???????????????
4.
5.
*/
#include <iostream>
 #include <complex>
 #include <stdio.h>
 #include<cmath>
 using namespace std;
 typedef complex<double>xy_t;
 xy_t P[110];

 double dot_product(xy_t a, xy_t b) //??????
 { return (conj(a) * b).real(); }

 double cross_product(xy_t a, xy_t b) //??????
 { return (conj(a) * b).imag(); }

 xy_t projection(xy_t p, xy_t b) //????????¨ p ????????¶??´?????? b ????°???±
 { return b * dot_product(p,b)/norm(b); }



int main(){
    int n=0;
    double x,y,sum=0.0;
    while(scanf("%lf,%lf",&x,&y)!=EOF)
        {
            P[n++]=xy_t(x,y);
        }
    for(int i=0;i+2<n;i++)
        {
            xy_t a=P[0],b=P[i+1],c=P[i+2];
            sum+=cross_product(b-a,c-a);
        }
        cout<<sum/2<<endl;
 }

Measured memory_bytes: 3240
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INTINF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

//gcdをユークリッド互除法で求める。O(log n)
int euclid(int x, int y){
    if(min(x, y) ==  0) return max(x, y);
    else return euclid(max(x, y)% min(x, y) , min(x, y));
}

int main() {
	int ans = 0;
	int a, b, c;
	cin >> a >> b >> c;
	int gc = euclid(a, b);
	if (c % gc == 0) cout << "YES" << endl;
	else cout << "NO" << endl;
	
	//cout << ans << endl;
}

Measured memory_bytes: 256