akhauriyash/Code-Regression huggingface dataset:
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF (LLONG_MAX - 1e5)
#define fcout cout << fixed << setprecision(10)

using namespace std;

int N;

typedef pair<string, string> P;

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

    string s;
    cin >> N;
    cin >> s;

    vector<P> v1;
    REP(i, 1 << N) {
        string r, b;
        REP(j, N) {
            if (i & 1 << j) {
                r += s[j];
            } else {
                b += s[j];
            }
        }
        v1.push_back({r, b});
    }
    reverse(s.begin(), s.end());

    vector<P> v2;
    REP(i, 1 << N) {
        string r, b;
        REP(j, N) {
            if (i & 1 << j) {
                r += s[j];
            } else {
                b += s[j];
            }
        }
        v2.push_back({r, b});
    }

    sort(v1.begin(), v1.end());
    sort(v2.begin(), v2.end());

    int ans = 0;
    REP(i, v1.size()) {
        auto tv = v1[i];
        ans += upper_bound(v2.begin(), v2.end(), tv) -
               lower_bound(v2.begin(), v2.end(), tv);
    }

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


Measured memory_bytes: 69452
using System;
using System.Collections.Generic;
using System.Linq;
using static Constans;

public static class Constans
{
    public const long Mod = (long)1e9 + 7;
}

public struct ModInt
{
    public long Num;

    public ModInt(long num)
    {
        Num = num;
    }

    // x^n
    public static long Power(long x, long n)
    {
        long pow = 1;
        while (n > 0)
        {
            if (n % 2 == 0)
            {
                x *= x;
                x %= Mod;
                n /= 2;
            }
            else
            {
                pow *= x;
                pow %= Mod;
                n--;
            }
        }

        return pow;
    }

    public static ModInt GetInv(long f)
    {
        // フェルマーの小定理 a^(-1) = a^(mod-2)
        return new ModInt(Power(f, Mod - 2));
    }

    public ModInt GetInv()
    {
        return GetInv(Num);
    }

    public override string ToString()
    {
        return Num.ToString();
    }

    public static ModInt operator +(ModInt l, ModInt r)
    {
        l.Num += r.Num;
        if (l.Num >= Mod)
        {
            l.Num -= Mod;
        }
        return l;
    }

    public static ModInt operator -(ModInt l, ModInt r)
    {
        l.Num -= r.Num;
        if (l.Num < 0)
        {
            l.Num += Mod;
        }
        return l;
    }

    public static ModInt operator *(ModInt l, ModInt r)
    {
        return new ModInt(l.Num * r.Num % Mod);
    }

    public static implicit operator ModInt(long n)
    {
        n %= Mod;
        if (n < 0)
        {
            n += Mod;
        }
        return new ModInt(n);
    }
}

public class Solution
{
    public static void Main()
    {
        var N = int.Parse(Console.ReadLine());
        var x = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var p = Enumerable.Range(1, N).Select(v => new ModInt(v).GetInv()).ToArray();
        for (int i = 1; i < p.Length; i++)
        {
            p[i] += p[i - 1];
        }

        ModInt sum = 0;
        for (int i = 0; i < N - 1; i++)
        {
            var d = x[i + 1] - x[i];
            sum += d * p[i];
        }
        for (int i = 1; i < N; i++)
        {
            sum *= i;
        }


        Console.WriteLine(sum);
    }
}

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

int main() {
  int N, M, L[100005], R[100005];

  cin >> N >> M;
  rep(i, M) cin >> L[i] >> R[i];

  sort(L, L+M);
  reverse(L, L+M);
  sort(R, R+M);

  int maxL = L[0], minR = R[0];

  int ans = minR - maxL + 1;

  if (ans < 0) ans = 0;

  cout << ans << endl;


  return 0;

}

Measured memory_bytes: 1024
c = 3.times.map { gets.split.map(&:to_i) }
x = []; y = []
x[0] = 0

3.times { |i| y[i] = c[0][i] - x[0] }
3.times { |i| x[i] = c[i][0] - y[0] }

res = 'Yes'
(0..2).each do |i|
  (0..2).each do |j|
    res = 'No' if x[i]+y[j] != c[i][j]
  end
end
puts res

Measured memory_bytes: 1788
H,W,k = map(int, input().split())
# アイテムが何処に何個あるか
fs = [[0]*(W+1) for i in range(H+1)]
for i in range(k):
    h, w, v = map(int, input().split())
    h -= 1
    w -= 1
    fs[h][w] = v

mvs = [(0,1),(1,0)]
dp = [[[-1<<50 for i in range(W+1)] for j in range(H+1)] for k in range(4)]
# dp[n][i][j] n個取ったときの、i,jにおけるアイテム価値の最大値
from collections import deque
q = deque([])
q.append((0,0))
dp[0][0][0] = 0
dp[1][0][0] = fs[0][0]
for h in range(H):
    for w in range(W):
        dp[0][h][w+1] = max(dp[0][h][w+1], dp[0][h][w])
        dp[1][h][w+1] = max(dp[1][h][w+1], dp[1][h][w], dp[0][h][w] + fs[h][w+1])
        dp[2][h][w+1] = max(dp[2][h][w+1], dp[2][h][w], dp[1][h][w] + fs[h][w+1])
        dp[3][h][w+1] = max(dp[3][h][w+1], dp[3][h][w], dp[2][h][w] + fs[h][w+1])
    for w in range(W):
        mx = 0
        for i in range(4):
            # print("fe",i,h,w,"dp",dp[i][h][w])
            mx = max(mx,dp[i][h][w])
        dp[0][h+1][w] = mx
        dp[1][h+1][w] = mx + fs[h+1][w]

H -= 1
W -= 1
ans0 = dp[0][H][W]
ans1 = dp[1][H][W]
ans2 = dp[2][H][W]
ans3 = dp[3][H][W]
# print(fs)
# for i in range(3):
#     d = dp[i]
#     for r in d:
#         print(*r)
#     print("----------")
print(max(ans1,ans2,ans3))

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

using namespace std;

int main(void) {
  int table[205];

  int m, min, max, ans_n;

  while(1){
    cin >> m >> min >> max; if(m == 0) break;

    for(int i = 0; i < m; i++) cin >> table[i];

    int ans = 0;
    for(int n = min - 1; n < max; n++){
      if(ans <= table[n] - table[n + 1]){
	ans = table[n] - table[n + 1];
	ans_n = n;
      }
    }

    cout << ans_n + 1 << endl;

  }

  return 0;
}

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

using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  int a[3];
  for (int i = 0; i < 3; i++) cin >> a[i];
  sort(a, a + 3);

  if (a[0] % 2 == 0) {
    cout << a[0] / 2 * a[1] << endl;
  } else {
    cout << a[1] / 2 * a[0] << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  string s;
  cin>>s;
  int cnt=0;
  for(int i=0;i<=s.size()-1;i++){
    if(s[i]==s[s.size()-i-1]){
      continue;
    }
    else{
      cnt=-1;
    }
  }
  for(int i=0;i<=(s.size()-1)/2-1;i++){
    if(s[i]==s[(s.size()-1)/2-i-1]){
      continue;
    }
    else{
      cnt=-1;
    }
  }
  for(int i=(s.size()+3)/2-1;i<=s.size()-1;i++){
    if(s[i]==s[s.size()-1+(s.size()+3)/2-1-i]){
      continue;
    }
    else{
      cnt=-1;
    }
  }
  
  if(cnt==0){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
//A,Elebereth Gilthoniel mantae!
//For Temeria!
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<cstdio>
#include<map>
#include<stack>
#include<queue>
#include<cstring> 
using namespace std;

int main()
{
 	//freopen("","r",stdin);
	//freopen("","w",stdout);
	 long long a,b,c;cin>>a>>b>>c;long long k;cin>>k;
	 if(k%2==0)
	 {
	cout<<a-b;
	 }
	 else
	 {
	 	cout<<b-a;
	 }
	return 0;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
    cout << fixed << setprecision(10);
    ll h;
    cin >> h;
    ll ans = 1;
    while(h > 1){
        h /= 2;
        ans *= 2;
        ans += 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main()
{
    string s;
    cin >> s;
    int sum = 0;
    for(int i = 0; i < s.size(); i++)
    {
        int j = s[i] - '0';
        sum += j;
    }
    if(sum % 9 == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}



Measured memory_bytes: 3700
#include<iostream>
#include<math.h>
#include<algorithm>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)

using namespace std;
#define INF 1001001001

int main(){
	int N;
	cin >> N;
	int h[N];
	REP(i,N) cin >> h[i];
	int dp[N + 1];
	REP(i,N+1) dp[i] = INF;
	dp[0] = 0;
	//dp[1] = min(h[1], abs(h[0] - h[1]));
	REP(i,N){
		dp[i+1] = min(dp[i+1], dp[i]+abs(h[i] - h[i+1]));
		dp[i+2] = min(dp[i+2], dp[i]+abs(h[i] - h[i+2]));
	}
	cout << dp[N - 1] << endl;
	return 0; 
}




Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007  // 1e9+7
using namespace std;
typedef long long ll;
typedef vector<bool> vecbool;
typedef vector<int> vecint;
typedef vector<ll> vecll;
typedef vector<string> vecstr;
typedef vector<vecint> vec2int;
typedef vector<vecbool> vec2bool;
int dx[4]{-1, +1, 0, 0};
int dy[4]{0, 0, -1, +1};
ll gcd(ll a, ll b) {
  if (b == 0) {
    return a;
  }
  if (a < b) return gcd(b, a);
  return gcd(b, a % b);
}
void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
int main() {
  init();
  ll n, k;
  cin >> n >> k;
  ll g = gcd(n, k);
  // cout << g << endl;
  if (n < k) {
    cout << min(n, abs(n - k)) << endl;
  } else if (n % k == 0) {
    cout << 0 << endl;
  } else {
    ll ans = 1e18;
    ans++;
    n /= g;
    k /= g;
    n = n - k * (n / k);
    while (true) {
      n = abs(n - k);
      ans = min(ans, n);
      if (ans < n) {
        cout << ans * g << endl;
        return 0;
      } else if (k % n == 0) {
        cout << min(n, abs(n - k)) * g << endl;
        return 0;
      }
    }
  }
}


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

using namespace std;
#define intMax 2147483647
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repp(i, a, b) for (int i = a; i >= b; i--)
#define be(a) (a.begin(), a.end())
#define rbe(p) (p.rbegin(), p.rend())
#define pb push_back

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin >> n;
    vector<int> A(n), B(n);
    rep(i, 0, n)
    {
        cin >> A[i];
    }
    rep(i, 0, n)
    {
        cin >> B[i];
    }
    int counter1 = 0, counter2 = 0;
    do
    {
        counter1++;
    } while (next_permutation(A.begin(), A.end()));
    do
    {
        counter2++;
    } while (next_permutation(B.begin(), B.end()));
    cout << abs(counter1 - counter2);
}

Measured memory_bytes: 256
#include <stdio.h>

int asc(const void *a, const void *b) {
  return *(long long int *)a - *(long long int *)b;
}

int main() {
  int number, i;
  scanf("%d", &number);
  long long int number_array[number];
  for(i = 0; i < number; i++) {
    scanf("%lld", &number_array[i]);
  }
  qsort(number_array, number, sizeof(long long int), asc);
  printf("%lld\n", number_array[number-1] - number_array[0]);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll unsigned long long
using namespace std;

long long power(long long a, long long b, long long m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
    }
    
  ll int binomial(ll int n, ll int k) 
{ 
    ll int C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll int i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (int j = min(i, k); j > 0; j--) 
            C[j] = C[j] + C[j-1]; 
    } 
    return C[k]; 
} 
  vector<int> pr;
void Sieve(ll int n) 
{ 
    bool prime[10000000];
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            pr.push_back(p);
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
}
 




//It reurns Fn,Fn+1
pair<int, int> fib (int n) {
    if (n == 0)
        return {0, 1};

    auto p = fib(n >> 1);
    int c = p.first * (2 * p.second - p.first);
    int d = p.first * p.first + p.second * p.second;
    if (n & 1)
        return {d, c + d};
    else
        return {c, d};
}


  
int main() {
  ll int n;
  cin>>n;
  ll int a[n];
  ll int l=1;
  int p=0;
   for(int i=0;i<n;i++)
  {
      cin>>a[i];
      if(a[i]==0)
      {
          p=1;
          cout<<0<<endl;
          break;
      }
  }
  if(p==0)
  {
  for(int i=0;i<n;i++)
  {
      if(a[i]<=1000000000000000000/l)
      {
          l*=a[i];
      }
      else
      {
          p=1;
          cout<<-1<<endl;
          break;
      }
  }
  if(p==0)
  {
      cout<<l<<endl;
  }
}
}

Measured memory_bytes: 4408
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	i64 n; scanf("%lld", &n);
	
	std::vector<i64> vec;
	for(i64 i = 1; i * i <= n; i++) {
		if(n % i) continue;
		vec.push_back(i);
		vec.push_back(n / i);
	}
	sort(begin(vec), end(vec)); vec.erase(unique(begin(vec), end(vec)), end(vec));
	
	i64 ans = 0;
	for(i64 i = 1; i * i <= n; i++) {
		i64 R = n / i, L = n / (i + 1) + 1;
		if(L >= R) continue;
		if((n - i) % i) continue;
		ans += (n - i) / i;
	}
	
	printf("%lld\n", ans);
	return 0;
}


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

int main() {
  int N;
  cin >> N;
  if(N / 1000 == (N % 100) / 10 && (N % 1000) / 100 == (N % 100) / 10){
  cout << "Yes" << endl;
  }
  else if((N % 1000) / 100 == (N % 1000) % 100 / 10 && (N % 1000) / 100 == (N % 10) / 1 ){
  cout << "Yes" << endl;
  }
  else{
  cout << "No" << endl;
  }
}

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

using namespace std;
typedef long long int lli;

int n;

lli ans;

string s;

map< string , int > freq;

int main()
{
	scanf("%d",&n);

	for(int i = 1 ; i <= n ; i++)
	{
		cin >> s;

		sort(s.begin() , s.end());

		ans += freq[ s ];
		freq[ s ]++;
	}

	printf("%lld\n",ans);
}

Measured memory_bytes: 11136
#include <iostream>

using namespace std;

int main()
{
    uint64_t x;

    cin >> x;

    uint64_t money = 100;
    int y = 0;

    while (money < x)
    {
        money = money * 1.01;
        y++;
    }
    
    cout << y << endl;

    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define ALL(a) (a).begin(), (a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll, ll> pii;
const ll INF = 1LL << 58;
const ll MOD = 1000000007;
typedef vector<pii> vpii;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

signed main()
{
    //  以降 cin の入力元が 'input.txt' になる
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    int N, X, Y;
    cin >> N >> X >> Y;
    int ans[50000];
    X--;
    Y--;

    REP(i, 50000)
    ans[i] = 0;

    REP(i, N)
    {
        for (int j = i; j < N; j++)
        {
            int tmp = min(abs(j - i), min(abs(i - X) + 1 + abs(Y - j), abs(i - Y) + 1 + abs(X - j)));
            ans[tmp]++;
        }
    }
    REP(i, N - 1)
    {
        cout << ans[i + 1] << endl;
    }
    return 0;
}

Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        char[] chars = sc.next().toCharArray();
        int c;
        for (int i = 0; i < chars.length; i++) {
            c = ((int) chars[i] + n);
            if (c > 90) {
                c -= 26;
            }
            System.out.print((char) c);
        }
    }
}

Measured memory_bytes: 26324
#include<stdio.h>
#define MAX 100000000


int Match[MAX] = { 0 };



int main() {
	int N, M;
	int input_lack, ans = 0;

	scanf("%d %d", &N, &M);
	for (int i = N; i < N * 2; i++) {
		Match[i] = 1;
	}
	for (int i = 0; i < M; i++) {
		scanf("%d", &input_lack);
		Match[N + input_lack] = 0;
	}
	for (int i = 2 * N - 2; i >= 2; i -= 2) {
		if (Match[i] == 1 && Match[i + 1] == 1) {
			Match[i / 2] = 1;
			ans++;
		}
		else if (Match[i] == 0 && Match[i + 1] == 0) {
			continue;
		}
		else Match[i / 2] = 1;
	}
	printf("%d\n", ans);



	return 0;
}


Measured memory_bytes: 2140
#include<stdio.h>

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



Measured memory_bytes: 2104
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

static const int mod = 1e9 + 7;

int fast_power(int a, int b) {
  long long p = 1, q = a;
  while (b) {
    if (b & 1) p = p * q % mod;
    q = q * q % mod;
    b >>= 1;
  }
  return p;
}

int c(int n, int k, const vector<int> &f, const vector<int> &g) {
  return 1LL * f[n] * g[k] % mod * g[n - k] % mod;
}

int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  
  vector<int> f(n + 1), g(n + 1);
  f[0] = 1, g[0] = 1;
  for (int i = 1; i <= n; i++) {
    f[i] = 1LL * f[i - 1] * i % mod;
    g[i] = 1LL * g[i - 1] * fast_power(i, mod - 2) % mod;
  }
  
  int ans = n > 1 ? 1 : 0;
  for (int i = 1; i <= min(k, n - 1); i++) {
    ans = (ans + 1LL * c(n, i, f, g) * c(n - 1, n - i - 1, f, g) % mod) % mod;
  }
  printf("%d\n", ans);

  return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
const int MOD=1000000007;
int64_t a,b;
//O(5√N) = 多くて100
bool is_five_square(int64_t k){
    if(k==1){
        a=1;
        return true;
    }
    int64_t fivejk = round(pow(k,1.0/5.0));
    if(pow(fivejk,5)==k){
        a = fivejk;
        return true;
    }
    else{
        return false;
    }
}
int main(){
    int64_t x;
    cin>>x;
    b=0;
    while(1){
        if(is_five_square(x+b*b*b*b*b)){
            break;
        }
        if(is_five_square(x-b*b*b*b*b)){
            b *= -1;
            break;
        }
        b++;
    }
    cout<<a<<" "<<b<<endl;
}


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

	public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int a=scan.nextInt();
int b=scan.nextInt();
int c=scan.nextInt();
int d=0;//1?????§??????
int e=0;//2
int f=0;//3
if(a>=b&&b>=c){
	d=a;
	e=b;
	f=c;
}
if(a>=c&&c>=b){
	d=a;
	e=c;
	f=b;
}
if(b>=a&&a>=c){
	d=b;
	e=a;
	f=c;
}
if(b>=c&&c>=a){
	d=b;
	e=c;
	f=a;
}
if(c>=a&&a>=b){
	d=c;
	e=a;
	f=b;
}
if(c>=b&&b>=a){
	d=c;
	e=b;
	f=a;
}
System.out.println(f+" "+e+" "+d);
	}
}

Measured memory_bytes: 26160
function main(s) {
	s = s.split("\n")[0];
	var h = new Set();
	for (var i = 97; i <= 97+25; i++) {
		h.add(String.fromCharCode(i));
	}
	for (var i = 0; i < s.length; i++) {
		if (h.has(s[i])) {h.delete(s[i]);}
	}
	console.log(h.size === 0 ? "None" : Array.from(h).sort()[0]);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));



Measured memory_bytes: 22212
class MultipleOf9
  def initialize(n)
    @n = n
  end

  def solve
    if @n.chars.reduce(0){|r, c| (c.to_i + r) % 9} == 0
      "Yes"
    else
      "No"
    end
  end
end

def run
  puts MultipleOf9.new(gets).solve
end

run


Measured memory_bytes: 24640
#include <iostream>                                                       
                                                                          
using namespace std;                                                      
                                                                          
void Watch(int);                                                          
                                                                          
int main (void) {                                                         
  int S;                                                                  
  cin >> S;                                                               
  Watch(S);                                                               
}                                                                         
                                                                          
void Watch(int x) {                                                       
  int h = x/3600;                                                         
  int m = (x%3600)/60;                                                    
  int s = x%3600%60;                                                      
  cout << h << ":" << m << ":" << s << endl;                              
}                                                                         
                                                                          
                                                                          
                                                                          
                                                                          
                                

Measured memory_bytes: 3096
import Control.Monad
type Coord = (Int, Int)

main:: IO ()
main = do
    [n,m] <- readLine <$> getLine
    s1s <- replicateM n getLine
    s2s <- replicateM m getLine
    let as = map readLine2 s1s
    let cs = map readLine2 s2s
    mapM_ print $ solve m cs as

solve :: Int -> [Coord] -> [Coord] -> [Int]
solve m cs = map (nearest m cs)

nearest :: Int -> [Coord] -> Coord -> Int
nearest m cs ab = fst $ foldl f (0,dmax) (zip [1..m] ds)
    where
        ds = [dist ab cd | cd <- cs]
        f (j',d') (j, d) = if d < d' then (j,d) else (j',d')
        dmax = 4 * 100000000

readLine :: String -> [Int]
readLine = map read . words

readLine2 :: String -> (Int,Int)
readLine2 = tuplify2 . map read . words

tuplify2 :: [a] -> (a,a)
tuplify2 (x:y:_) = (x,y)

dist :: Coord -> Coord -> Int
dist (x1,y1) (x2,y2) = abs (x1-x2) + abs (y1-y2)


Measured memory_bytes: 1020
# Union-Find木
class UnionFind:
    # 経路圧縮・ランク
    # クエリO(α(N))
    # original: http://at274.hatenablog.com/entry/2018/02/02/173000

    def __init__(self, n):
        self.n = n
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

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

    def groups(self):
        ret = set()
        for i in range(1, self.n+1):
            ret.add(self.find(i))
        return len(ret)


n, m = map(int, input().split())
data = [list(map(int, input().split())) for _ in range(m)]
uf = UnionFind(n)
for x, y, _ in data:
    uf.union(x, y)
print(uf.groups())


Measured memory_bytes: 41064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	map<ll,ll>a;
	ll n,m;
	cin>>n>>m;
	ll N=min(sqrt(n),sqrt(m));
	ll ans=1;
	for(ll i=2;i<=N;i++){
		if(n%i==0&&m%i==0){
			ans++;
		}
		while(n%i==0){
			n/=i;
		}
		while(m%i==0){
			m/=i;
		}
	}
	if(n>m){
		swap(n,m);
	}
	if(n!=1&&m%n==0){
		ans++;
	}
	cout <<ans;
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    n = A[-1]
    r = 0
    b = n  / 2
    temp = 10**20
    for i in A:
        if temp > abs(i - b):
            temp = abs(i-b)
            r = i
    print(n, r)

if __name__ == '__main__':
    main()

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

flaga=0
flagw=0
flagt=0
flagr=0


for _ in range(N):
    K = str(input())

    if(K=='AC'):
        flaga+=1

    if(K=='WA'):
        flagw+=1

    if(K=='TLE'):
        flagt+=1

    if(K=='RE'):
        flagr+=1

print("AC x "+str(flaga))
print("WA x "+str(flagw))
print("TLE x "+str(flagt))
print("RE x "+str(flagr))

Measured memory_bytes: 69860
//teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx


using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);   
ll a[200][20],p[200][20],n;
ll calc(int num){
	ll ans=0;
	int i,j;
	int haha[200]={0};
	rep(j,10){
		ans=0;
		if(num&(1<<j))
			ans=1;
		if(ans==0)
			continue;
		rep(i,n){
			
			if(a[i][j]){
				haha[i]++;
			}
		}
	}
	ans=0;
	rep(i,n){
		ans+=p[i][haha[i]];
	}
	return ans;
}
int main(){
    std::ios::sync_with_stdio(false);
    
    cin>>n;
    int i,j;
    rep(i,n){
    	rep(j,10){
    		cin>>a[i][j];
    	}
    }
    rep(i,n){
    	rep(j,11){
    		cin>>p[i][j];
    	}
    }
    ll maxi=inf;
    maxi*=inf;
    maxi*=-1;
    f(i,1,(1<<10)){
    	maxi=max(maxi,calc(i));
    }
    cout<<maxi<<endl;
    return 0;  
    
}



Measured memory_bytes: 256
#include<stdio.h>

int main(){

  int x,y,r;

  scanf("%d %d",&x,&y);

  if(x <= y){

    while(x!=0){
      r=y%x;
      y=x;
      x=r;
    }

    printf("%d\n",y);
  }

  else{

    while(y!=0){
      r=x%y;
      x=y;
      y=r;
    }

    printf("%d\n",x);
  }
  return 0;
}

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







int main()
{


int x;
cin >> x;
long long ans = 0;
for(int i = 1 ; i * i <= x ; i++){
	for(int j = 1 ; j * j<= x ; j++){
          long long n = pow(i,j);
		 if(n <= x) {
		 	ans = max(ans,n);
		 }
	}
}


cout << ans; 

	return 0;
}		


Measured memory_bytes: 384
/*
 * A.cpp
 *
 *  Created on: 2017/09/30
 *      Author: litmc
 */

#define MYDEBUG
#include <bits/stdc++.h>

#ifdef MYDEBUG
#define dbp(x) cout<<#x<<": "<<x<<endl
#define dbp2(x,y) cout<<#x<<","<<#y<<": "<<x<<","<<y<<endl
#define dbp3(x,y,z) cout<<#x<<","<<#y<<","<<#z<<": "<<x<<","<<y<<","<<z<<endl
#define dbp4(w,x,y,z) cout<<#w<<","<<#x<<","<<#y<<","<<#z<<": "<<w<<","<<x<<","<<y<<","<<z<<endl
#define ifcin(x) std::ifstream cin(x)
#else
#define dbp(x)
#define dbp2(x,y)
#define dbp3(x,y,z)
#define dbp4(w,x,y,z)
#define ifcin(x)
#endif
#define ll long long
#define ull unsigned long long
#define all(x) x.begin(), x.end()
#define rep(i, from, to) for(int i=from; i<to; ++i)
#define REP(i, from, to) for(int i=from; i<=to; ++i)
#define EPS = 1e-14;
using namespace std;

template<typename T>
ostream& operator<<(ostream& out, const vector<vector<T> >& v) {
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i] << endl;
  }
  return out;
}

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

ll N, h, n, w;
ll MAX = 3500;
void solve() {
  cin >> N;
  for (h = 1; h <= MAX; ++h) {
    for (n = 1; n <= h; ++n) {
      ll ue = N * h * n;
      ll shita = 4 * h * n - N * n - N * h;
      if (shita > 0 && ue % shita == 0) {
        w = ue / shita;
        printf("%lld %lld %lld\n", h, n, w);
        return;
      }
    }
  }
  while (true) {
    //TLE
  }
}

int main() {
  solve();
}



Measured memory_bytes: 256
import Data.List

main = interact $ show . sol . read

sol n = d $ product [1..n]

d 1 = 1
d n = foldr1 prod . fmap (succ . length) . group $ primeFactors n

prod a b = a*b `mod` md

md = 10^9+7 :: Int

-- | Prime numbers
primes :: Integral a => [a]
primes = 2 : filter ((==1) . length . primeFactors) [3,5..]

primeFactors :: Integral a => a -> [a]
primeFactors 1 = []
primeFactors n = factor n primes

factor :: Integral a => a -> [a] -> [a]
factor n (p:ps) 
  | p*p > n        = [n]
  | n `mod` p == 0 = p:factor (n `div` p) (p:ps)
  | otherwise      = factor n ps 


Measured memory_bytes: 1020
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include<math.h>
#include<map>
#include<set>
using namespace std;
#define INF 11000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;

int main(){
  int x,a,b;
  cin>>x>>a>>b;

  if(abs(x-a)<abs(x-b)) cout<<"A"<<endl;
  else cout<<"B"<<endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    static int INF = 1001001009;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        int sum = 0;
        int minnotzero = INF;
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
            if (array[i] % 10 != 0) {
                minnotzero = Math.min(minnotzero, array[i]);
            }
            sum += array[i];
        }
        
        if (minnotzero == INF) {
            System.out.println(0);
        } else {
            if (sum % 10 == 0) sum -= minnotzero;
            System.out.println(sum);
        }
    }
}


Measured memory_bytes: 25172
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
  
int main() {
  int N;
  cin >> N;
  vvi F(N,vi(10));
  rep(i,N) {
    rep(j,10) {
      cin >> F[i][j];
    }
  }
  vvi P(N,vi(11));
  rep(i,N) {
    rep(j,11) {
      cin >> P[i][j];
    }
  }
  int ans = -INF;
  for(int b = 1; b < (1<<10); b++) {
    int cc = 0;
    rep(i,N) {
      int c = 0;
      rep(j,10) {
        if((b>>j & 1) && F[i][j] == 1) {
          c++;
        }
      }
      cc += P[i][c];
    }
    ans = max(ans,cc);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

#define M 10000000/* your task*/
#define L 14

char H[M][L]; /* Hash Table */
int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
  else return 0;
}
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}
int h1(int key){ return key%M; }
int h2(int key){ return 1+(key%(M-1)); }
int find(char str[]){
  long long key, i, h;
  key=getKey(str);
  for(i=0;;i++){
    h=(h1(key)+i*h2(key))%M;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0)return 0;
  }
  return 0;
}

int insert(char str[]){
  long long key,i,h;
  key=getKey(str);
  for(i=0;;i++){
    h=(h1(key)+i*h2(key))%M;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0){
      strcpy(H[h],str);
      return 0;
    }
  }
  return 0;
}
int main(){
  int i, n, h;
  char str[L], com[9];
    
  scanf("%d", &n);
    
  for ( i = 0; i < n; i++ ){
    scanf("%s %s", com, str);
	
    if ( com[0] == 'i' ){
      insert(str);
    } else {
      if (find(str)==1){
	printf("yes\n");
      } else {
	printf("no\n");
      }
    }
  }

  return 0;
}

Measured memory_bytes: 118560
(defun EatingSymbolsEasy (count)
  (let ((c (read-char *standard-input* nil)))
    (cond
      ((null c) count)
      ((char= c #\+) (incf count)(EatingSymbolsEasy count))
      ((char= c #\-) (decf count)(EatingSymbolsEasy count))
      (t count))))

(format t "~A~%" (EatingSymbolsEasy 0))


Measured memory_bytes: 11748
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, k, a[100005] = {}, b[100005] = {}, x, l = 0, m = 0, z = mod;
    cin >> n >> k;
    while (n--) {
        cin >> x;
        if (x >= 0) a[++l] = x;
        else b[++m] = -x;
    }
    sort(a + 1, a + l + 1); sort(b + 1, b + m + 1);
    for (int i = 0; i <= l; i++) if (k - i <= m) z = min(z, a[i] + b[k - i] + min(a[i], b[k - i]));
    cout << z;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
int main()
{
    int a, b, c, d;
    cin >> a >> b >> c>> d;
    while(1){
        c -= b;
        if(c<=0){
            cout << "Yes" << endl;
            return 0;
        }
        a -= d;
        if(a<=0){
            cout << "No" << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 3608
N=io.read("n")
M=io.read("n")
X=io.read("n")
Y=io.read("n")
x={}
y={}
for i=1,N do 
  x[i]=io.read("n")
end
for i=1,M do 
  y[i]=io.read("n")
end
table.insert(x,X)
table.insert(y,Y)
table.sort(x)
table.sort(y)
if y[1]-x[#x]>=1 then
  print("No War")
  else 
  print("War")
end

Measured memory_bytes: 888
from sys import stdin
input = stdin.readline

def main():
    S = input().rstrip()
    ans = 0
    cnt = 0
    isR = False
    for s in S:
        if s == 'R':
            if isR:
                cnt += 1
            else:
                cnt = 1
                isR = True
        else:
            isR = False
            ans = max(ans, cnt)
    ans = max(cnt, ans)
    print(ans)

if __name__ == "__main__":
    main()
    


Measured memory_bytes: 61860
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


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

  string A = S.substr(0,N);
  string B = S.substr(N);
  reverse(ALLOF(B));
  
  map<string,ll> memo;
  for(int i=0; i<(1<<N); i++){
    string x, y;
    rep(j,B.size()){
      if((i>>j)&1) x += B[j];
      else y += B[j];
    }

    memo[x + "_" + y]++;
  }

  ll ret = 0;
  for(int i=0; i<(1<<N); i++){
    string x, y;
    rep(j,A.size()){
      if((i>>j)&1) x += A[j];
      else y += A[j];
    }

    //cout << x + "_" + y << "\t" << memo[x + "_" + y] << endl;
    
    ret += memo[x + "_" + y];
  }

  cout << ret << endl;
  
  return 0;
}


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

int main() {
  int n,m,sum;
  cin >> n >> m;
  
  vector<int> vec(n);
  sum = 0;
  for(int i=0; i < n; i++){
  	cin >> vec.at(i);
    sum += vec.at(i);
  }
  
  sort(vec.begin(), vec.end(), greater<int>() );
  
  if(vec.at(m-1)*4*m < sum){
  	cout << "No" << endl;
  }else{
  	cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
// ABC176A - 

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

typedef unsigned long long int ull;
typedef long long int ll;

int main() {
	int N, X, T;
	cin >> N >> X >> T;

	if (N % X == 0) {
		cout << (N/X)*T << endl;
	} else {
		cout << (N/X+1)*T << endl;
	}

	return 0;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

struct Cumusum {
	vector<LL>csum;
	Cumusum(vector<LL>&a) {
		csum.assign((int)a.size(), 0);
		for (int i = 0; i < (int)a.size(); i++) {
			csum[i + 1] = csum[i] + a[i];
		}
	}
	LL query(int l, int r) {
		return csum[r] - csum[l];
	}
};

auto  make_prime(long long  N) {
	vector<long long >a;
	vector<bool> prime(N + 1);
	FOR(i, 0, N + 1) {
		prime[i] = 1;
	}prime[0] = prime[1] = 0;

	for (LL i = 2; i <= N; i++) {
		if (prime[i]) {
			a.push_back((long long)i);
			for (LL j = i * 2; j <= N; j += i)
				prime[j] = 0;
		}
	}
	return prime;
}


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

	auto is_prime = make_prime(1e5);
	VL a(1e5 + 1,0);
	FOR(i, 3, 1e5 + 1) {
		if (is_prime[i] && is_prime[(i + 1) / 2]) {
			a[i] = 1;
		}
	}

	Cumusum csum(a);

	int Q; cin >> Q;

	FOR(_, 0, Q) {
		int l, r; cin >> l >> r;
		r++;
		cout << csum.query(l, r) << endl;
	}


	return 0;
}


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

using namespace std;

#define DIM 1000009
#define INF ((long long)1e18+9ll)
#define pairll pair<long long,long long>
#define fi first
#define se second
#define ld long double
#define amen exit(0)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define endl '\n'
#define y1 trymax_lox
#define y2 sijgkvdfbo
#define MODULO 1000000007

long long i,j,k,l,n,m,res,sum=1;

long long mpow(long long n,long long m){
    long long res=1,curr=n;
    while(m){
        if(m&1)res=(res*curr)%MODULO;
        curr=(curr*curr)%MODULO;
        m/=2;
    }
    return res;
}

long long a[DIM],cnt[DIM],vis[DIM];

int main(){

   // freopen("boards.in","r",stdin);
   // freopen("boards.out","w",stdout);
  //  fast;

    cin>>n;

    for(i=1;i<=n;i++){
        cin>>a[i];
        k=a[i];
        for(j=2;j*j<=k;j++){
            long long cntt=0;
            while(k%j==0){
                k/=j;
                cntt++;
            }
            cnt[j]=max(cnt[j],cntt);
        }   
        if(k>1)cnt[k]=max(cnt[k],1ll);
       // cout<<
    }

    for(i=2;i<=1000000;i++){
        if(cnt[i]==0)continue;
        long long num=1;

     //   cout<<i<<' '<<cnt[i]<<endl;

        for(j=1;j<=cnt[i];j++)num=(num*i)%MODULO;
        sum=(sum*num)%MODULO;
    }

    for(i=1;i<=n;i++){
        res=(res+(sum*mpow(a[i],MODULO-2))%MODULO)%MODULO;
    }

    cout<<res<<endl;

    amen;
}

Measured memory_bytes: 10496
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cstdint>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <chrono>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <random>
#include <utility>
#include <limits>
#include <list>

/* template start */
 
#define rep(i, a, b) for (long long i = (a); (i) < (b); (i)++)
#define all(i) i.begin(), i.end()

#ifdef LOCAL
#define debug(...) std::cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out(){std::cerr<<std::endl;}

template<typename Head,typename... Tail>
void debug_out(Head h,Tail... t){
  std::cerr<<" "<<h;
  if(sizeof...(t)>0)std::cout<<" :";
  debug_out(t...);
}
 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}

template<typename Num>
constexpr Num mypow(Num a, unsigned long long b) {
  if(b==0)return 1;
  if (a==0)return 0;
  Num x = 1;
  while (b > 0) {
    if(b & 1)x*=a;
    a*=a;
    b >>= 1;
  }
  return x;
}

/* template end */

using ll = long long;

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

  ll n;
  std::cin>>n;

  std::vector<ll> a(n+1);
  for(auto&& e:a)std::cin>>e;

  std::vector<ll> sum(n+1,0);
  sum[n]=a[n];
  for(ll i=n-1;i>=0;i--)sum[i]=sum[i+1]+a[i];

  ll now=1;
  ll ans=0;

  rep(i,0,n){
    ans+=now;
    if(now < a[i]){
      std::cout<<-1<<"\n";
      return 0;
    }
    now-=a[i];
    now=std::min(2*now,sum[i+1]);
  }

  if(now!=a[n]){
    std::cout<<-1<<"\n";
    return 0;
  }

  std::cout<<ans+now<<"\n";

  return 0;
}

Measured memory_bytes: 4784
answer = 0
while True:
    a_b_op = input()
    abop_list = a_b_op.split(" ")
    a = int(abop_list[0])
    op = abop_list[1]
    b = int(abop_list[2])
    if op == "+":
        answer = a + b
    elif op == "-":
        answer = a - b
    elif op == "/":
        answer = int((a -(a % b)) / b)
    elif op == "*":
        answer = a * b
    elif op == "?":
        break
    print(answer)


Measured memory_bytes: 5600
#include <iostream>
#include <bits/stdc++.h>
 
using namespace std;
 
 
int main() {
     
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); 
    
    string a,b,c;
    cin>>a;
    cin>>b;
    cin>>c;
    int flag=0;
    int cnt=1;

    while(1)
    {
        if(cnt==1)
          {
             if(a.length()==0)
                {
                    cnt=1;
                    flag=1;
                    break;
                }
              
             else if(a[0]=='a')
                {
                    cnt=1;
                    a.erase(a.begin()+0);
                }
                
             else if(a[0]=='b')
                {
                    cnt=2;
                    a.erase(a.begin()+0);
                }  
                
              else if(a[0]=='c')
                {
                    cnt=3;
                    a.erase(a.begin()+0);
                }  
                
             
          }
          
     else if(cnt==2)
          {
              
               if(b.length()==0)
                {
                    cnt=2;
                    flag=1;
                    break;
                }
              
              
             else if(b[0]=='a')
                {
                    cnt=1;
                    b.erase(b.begin()+0);
                }
                
             else if(b[0]=='b')
                {
                    cnt=2;
                    b.erase(b.begin()+0);
                }  
                
              else if(b[0]=='c')
                {
                    cnt=3;
                    b.erase(b.begin()+0);
                }  
                
             
          }
          
          else if(cnt==3)
          {
               if(c.length()==0)
                {
                    cnt=3;
                    flag=1;
                    break;
                }
              
              
              
             else if(c[0]=='a')
                {
                    cnt=1;
                    c.erase(c.begin()+0);
                }
                
             else if(c[0]=='b')
                {
                    cnt=2;
                    c.erase(c.begin()+0);
                }  
                
              else if(c[0]=='c')
                {
                    cnt=3;
                    c.erase(c.begin()+0);
                }  
                
            
          }
    }
    
    if(cnt==1)
       printf("A");
       
    else if(cnt==2)
       printf("B");
       
    else
      printf("C");

    
	return 0;
}

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

num=[0,0,0,0,0,0,0,0,0]
counter=0

for i in a:
    if 1<=i and i<=399:
        num[0]+=1
    elif 400 <= i and i <= 799:
        num[1] += 1
    elif 800 <= i and i <= 1199:
        num[2] += 1
    elif 1200 <= i and i <= 1599:
        num[3] += 1
    elif 1600 <= i and i <= 1999:
        num[4] += 1
    elif 2000 <= i and i <= 2399:
        num[5] += 1
    elif 2400 <= i and i <= 2799:
        num[6] += 1
    elif 2800 <= i and i <= 3199:
        num[7] += 1
    elif 3200 <= i:
        num[8] += 1

for i in range(0,8):
    if num[i]!=0:
        counter+=1

if counter==0 and num[8]==0:
    min=0
    max=0

elif counter==0 and num[8]!=0:
    min=1
    max=num[8]

else:
    min=counter
    max=counter+num[8]

#print(num)
print(str(min)+" "+str(max))


Measured memory_bytes: 3064