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

using namespace std;
typedef long long ll;
#define DBG(v) cerr << #v << " = " << (v) << endl;


const int MxN = (int) 1e5 + 9;
ll dp1[MxN + 9];
ll dp0[MxN + 9];
const int mod = (int) 1e9 + 7;

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

    string s;
    cin >> s;
    const int n = (int) s.size();

    dp0[n] = dp1[n] = 1;
    for (int i = n - 1; i >= 0; --i) {
        dp0[i] = dp0[i + 1] * 3 % mod;
        if(s[i] == '0')
            dp1[i] = dp1[i+1];
        else
            dp1[i] = (dp0[i+1] + 2*dp1[i+1]) % mod;
    }
    cout << dp1[0];
    return 0;
}

Measured memory_bytes: 2000
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
    public static void main (String[] args) throws IOException {
        final String s;
        try (BufferedReader reader =
                 new BufferedReader (new InputStreamReader (System.in))) {
            s = reader.readLine();
        }
        int           N    = Integer.parseInt (s);
        StringBuilder sb   = new StringBuilder();
        int           base = 2;
        while (0 != N) {
            sb.insert (0, String.valueOf (Math.abs (N % base)));
            N -= Math.abs (N % base);
            N /= -base;
        }
        if (sb.length() == 0) sb.append ("0");
        System.out.println (sb);
    }
}


Measured memory_bytes: 21076
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    int n,k;cin>>n>>k;
    vector<int> a(n);
    rep(i,n) cin>>a[i];
    if(n<=k){
        cout<<1<<endl;
        return 0;
    }
    n-=k;
    int res=1;
    res+=(n+k-2)/(k-1);
    cout<<res<<endl;
}


Measured memory_bytes: 640
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define MIN_LONG -9223372036854775808L
#define MAX_LONG 9223372036854775807L
#define PI 3.141592653589793238462643383279502884L

#define long long long int

using std::vector;
using std::map;
using std::set;
using std::string;
using std::pair;
using std::cin;
using std::cout;
using std::cerr;

// @author: pashka

vector<vector<int> > g;

int res = 0;
int t = 0;
vector<int> in;
vector<int> up;
vector<bool> z;

void dfs(int x, int p) {
	if (z[x]) return;
	z[x] = true;
	in[x] = t++;
	up[x] = in[x];
	for (int y : g[x]) {
		if (y == p) continue;
		if (z[y]) {
			up[x] = std::min(up[x], in[y]);
		} else {
			dfs(y, x);
			if (up[y] == in[y]) res++;
			up[x] = std::min(up[x], up[y]);
		}
	}
}

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
#endif
    std::ios::sync_with_stdio(false);

    int n, m;
    cin >> n >> m;

    g.resize(n);
    in.resize(n);
    up.resize(n);
    z.resize(n);
    for (int i = 0; i < m; i++) {
    	int x, y;
    	cin >> x >> y;
    	x--; y--;
    	g[x].push_back(y);
    	g[y].push_back(x);
    }

    for (int i = 0; i < n; i++) {
    	dfs(i, -1);
    }

    cout << res << "\n";

    return 0;
}

Measured memory_bytes: 256
import bisect

n = int(input())
l = list(map(int, input().split()))
l.sort()

'''
リストをソートし、a, b <= cとなるようにa, bを取り出せば、
a < b + c, b < c + a という条件は満たすので、
a, bを取り出したとき、c < a + b を満たすcを二分探索で探す
'''

ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        ans += bisect.bisect_left(l, l[i]+l[j]) - j - 1
print(ans)

Measured memory_bytes: 3188
#include<iostream>
#include<cstdio>
#define dff 1e-19
using namespace std;
struct vec{
  double x;
  double y;
};
bool cross(vec a, vec b, vec x, vec y);
int main(){
  for(;;){
    vec a,b,c,d;
    if(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&(a.x),&(a.y),&(b.x),&(b.y),&(c.x),&(c.y),&(d.x),&(d.y)) == EOF) break;
    if(cross(a,c,b,d) && cross(b,d,a,c)) cout <<"YES"<<endl;
    else cout <<"NO"<<endl;
  }
  return 0;
}
bool cross(vec a, vec b, vec x, vec y){
  vec p,q,r;
  p.x = b.x-a.x;
  p.y = b.y-a.y;
  q.x = x.x-a.x;
  q.y = x.y-a.y;
  r.x = y.x-a.x;
  r.y = y.y-a.y;
  if((p.x*q.y-p.y*q.x)*(p.x*r.y-p.y*r.x)<dff) return true;
  return false;
}

Measured memory_bytes: 1224
#include <algorithm>
#include <iostream> //標準入出力
#include <fstream>  //ファイルでの入出力
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <utility> //pair
#include <cmath>  //sqrt 
#include <iomanip> //setprecision
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define MOD 1000000007
#define pair(a) pair<a,a>

void _main(){
    ll n,m; cin >> n>>m;
    vector<bool> ac(n,false);
    vector<ll> wa(n,0);
    rep(i,m){
        ll p; cin >> p;
        string s ; cin >> s;
        if(s=="AC") ac[p-1]=true;
        else if(!ac[p-1]) wa[p-1]++;
    }
    ll acs=0,pas=0;
    rep(i,n){
        if(ac[i]){acs++;pas+=wa[i];}
    }
    cout << acs << ' ' << pas <<endl;
    return;
}
int main() {
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

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

// ----------- define --------------
#define int long long
#define ii pair<int,int>
#define fi first
#define sc second
#define all(x) (x).begin(),(x).end()
// ---------------------------------

#define pow abcdef
int pow(int a, int b) {
  if (b == 0) return 1;
  int t = pow(a, b / 2);
  t = (t * t) % 2019;
  if (b % 2) return (a * t) % 2019;
  return t;
}

void MAIN() {
  string s;
  cin >> s;
  reverse(all(s));
  vector<int> a(s.size());
  int ans = 0;
  map<int, int> m; m[0] = 1;
  for (int i = 0; i < s.size(); i++) {
    a[i] = (s[i] - '0') * pow(10, i);
    if (i) a[i] += a[i - 1];
    a[i] %= 2019;
    ans += m[a[i]];
    m[a[i]]++;
  }
  cout << ans << '\n';
}

signed main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 5200
#include <bits/stdc++.h>
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define lli  int
using namespace std;
const lli MAX = 1e7+7;
lli l,tl,n=0,m=0;
lli len, sp[MAX],p2[25];
std::vector<int> v;


int main(){
   std::vector<lli> pf;
   p2[0] = 1;
   for(int i = 1; i<21; i++) p2[i] = 2*p2[i-1];
   std::cin >> l;
   int r = 1, bnd=0, tt=0;
   n = 1;
   while (r*2<=l) r*=2, n++;
   while (l) {
     v.push_back(l%2);
     if(l%2) m++;
     l/=2;
   }
   v.pop_back();
   printf("%d %d\n", n, 2*n-3+m);
   for(int i = 1; i<=n-1; i++){
     printf("%d %d %d\n", i, i+1, 0);
     printf("%d %d %d\n", i, i+1, p2[i-1]);
     tt+=2;
     bnd+=p2[i-1];
   }
   for(int i = 0; i<v.size(); i++){
     if(!v[i]) continue;
     printf("%d %d %d\n", i+1, n, bnd+1);
     tt++;
     bnd+=p2[i];
   }
}


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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

ll A[100005];

ll gcd(ll a, ll b)
{
    if (a < b)
        swap(a, b);
    ll c = a % b;
    if (c == 0)
        return b;
    return gcd(b, c);
}

int main()
{
    int N;
    cin >> N;
    REP(i, N)
    {
        cin >> A[i];
    }
    ll m = A[0];
    REP(i, N)
    {
        m = gcd(A[i], m);
    }
    cout << m << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define S second
#define INF (1e9)
#define N 105
using namespace std;

int n, m, d[N][N];
int used[N], ans=0;

set<vector<int> > memo;

void dfs(int x,vector<int> G){
  
  if(x>=2){

    int sum=0;

    for(int i=0;i<G.size();i++){
      
      int mincost=INF;
      
      for(int j=0;j<G.size();j++){
      
	if(G[i]!=G[j])
	  mincost=min(mincost,d[G[i]][G[j]]);
      
      }

      if(mincost!=INF) sum+=mincost;
    
    }
  
    ans=max(ans,sum);

  }
  
  sort(G.begin(),G.end());
  
  if(memo.count(G)) return ;
  memo.insert(G);
  
  for(int i=0;i<n;i++){

    if(used[i]) continue;

    used[i]=1;
    
    int mincost=INF;

    vector<int> nG=G;

    nG.push_back(i);
    
    for(int j=0;j<nG.size();j++)
      
      if(i!=nG[j]&&used[nG[j]])
	mincost=min(mincost,d[i][nG[j]]);
    
    if(!x||(mincost&&mincost!=INF)) dfs(x+1,nG);
    
    used[i]=0;
    
  }
  
}

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

  int a, b , f;

  for(int i=0;i<m;i++){
    
    cin>>a>>b>>f;
    
    d[a-1][b-1]=d[b-1][a-1]=f;
    
  }

  vector<int> init;
  
  dfs(0,init);

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

Measured memory_bytes: 4884
#include<bits/stdc++.h>
using namespace std;
int a,n,cant,fo;
int main() {
	scanf("%d",&n);
	for(int i=1; i<=n; i++) {
		scanf("%d",&a);
		if(a<fo)cant=1;
		else if(a!=fo)fo=max(a-1,fo);
	}
	if(cant)printf("No");
	else printf("Yes");
	return 0;
}

Measured memory_bytes: 256
// ?????¬???????????¬??????

#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>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int 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;}

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

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

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

    string ans = "";

    int ub = 3000000, lb = 0;
    while(ub - lb > 1) {
        int mid = (ub + lb) / 2;
        int val = mid * (mid + 1) / 2;
        if(val >= N) ub = mid;
        else lb = mid;
    }

    string pat = string(ub, ')') + string(ub, '(');
    ans += pat;

    int diff = ub * (ub + 1) / 2 - N;
    int idx = ub;
    rep(i,0,diff) {
        swap(ans[idx-1], ans[idx]);
        idx--;
    }

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

Measured memory_bytes: 3332
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <deque>
//#include "D:\C++\test_lib_projects\testlib.h"
using namespace std;
#define ll long long
#define pii pair<int,int>

bool debug=true;
/*
   Write In New Computer
    By XiaoGeNintendo
	     gwq2017
	Type:
*/

/*
void fo(int id){
	freopen((toString(id)+".txt").c_str(),"w",stdout);
}
*/
int a;
int main(int argc,char* argv[]){
	string s;
	cin>>s;
	sort(s.begin(),s.end());
	if(s=="abc"){
		cout<<"Yes";
	}else{
		cout<<"No";
	}
	return 0;
}


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

using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)
#define MOD 1000000007

//debug
#define debug(arr) cerr<<#arr<<"(l"<<__LINE__<<") : ";for(auto x:arr)cerr<<x<<" ";cerr<<endl;

int main(){
  ll N;
  cin >> N;
  ll A[N], count[N+1] = {};
  rep(i, N) cin >> A[i];
  rep(i, N) count[A[i]]++;

  ll comb[N+1];
  ll comb_sum = 0;
  rep(i, N+1) comb_sum += (comb[i] = count[i] * (count[i] - 1) / 2);

  rep(i, N) cout << (comb_sum - comb[A[i]] + (count[A[i]] - 1) * (count[A[i]] - 2) / 2) << endl;
  return 0;
}


Measured memory_bytes: 7296
#include <iostream>
#include <algorithm>
using namespace std;
int max1(int a, int b, int c)
{
    return max(a, max(b, c));
}
#define ll long long int
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
   // freopen("test.inp", "r", stdin);
    int n;
    cin >> n;
    int a[n + 10], b[n + 10], c[n + 10];
    int A[n + 1], B[n + 1], C[n + 1];
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i] >> b[i] >> c[i];
    }
    A[1] = a[1];
    B[1] = b[1];
    C[1] = c[1];

    for (int i = 2; i <= n; i++)
    {
        A[i] = max(B[i - 1], C[i - 1]) + a[i];
        B[i] = max(C[i - 1], A[i - 1]) + b[i];
        C[i] = max(B[i - 1], A[i - 1]) + c[i];
    }
    cout << max1(A[n],B[n], C[n]) << endl;
}

Measured memory_bytes: 2560
#include <iostream>
#include <algorithm>

using namespace std;
int N;
const int MAX_N = 100000;
long long A[MAX_N+1];

void solve() {
	int cnt = 1, ans = 0;
	for (int i = 0; i < N; i++) {
		if (A[i] == A[i + 1]) {
			cnt++;
		}
		else {
			if (cnt % 2 == 1) {
				ans++;
			}
			cnt = 1;
		}
	}
	//if (cnt % 2 == 1) {
	//	ans++;
	//}
	cout << ans << endl;
}

int main(void) {
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	
	sort(A, A + N);
	A[N] = -1;
	solve();
	return 0;
}

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

using namespace std;

int main(){
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    #endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;*/

    long long n;cin>>n;
    long long r=sqrt(n);
    vector<long long> a;
    if(n%r==0){
        a.push_back(r);
    }
    for(long long i=1;i<=r;i++){
        if(i*i==n)continue;
        if(n%i==0){
            a.push_back(i);
            a.push_back(n/i);
        }
    }
    sort(a.begin(),a.end());
    long long ans=0;
    for(int i=0;i<a.size();i++){
        if(a[i]==1)continue;
        if(n/(a[i]-1)==n%(a[i]-1)){
            ans+=(a[i]-1);
        }
    }
    cout<<ans;

    return 0;
}

Measured memory_bytes: 384
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return list(sys.stdin.readline())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
mod = 1000000007

#A

#B

#C
"""
n,a,b,c = LI()
l = IR(n)
f = [True for i in range(3)]
ans = 0
for i in range(n):
    for d in range(3):
        if abs(l[i]-[a,b,c][d]) <= 10 and f[d]:
            ans += abs(l[i]-[a,b,c][d])
            f[d] = False
            l[i] = -float("inf")
k = False
for i in f:
    if i:
        k = True
        break
if not k:
    print(ans)
    quit()
"""
#D
a,b,q = LI()
s = IR(a)
t = IR(b)
for i in range(q):
    x = I()
    c = bisect.bisect_left(s,x)
    ans = float("inf")
    if c == a:
        k = abs(x-s[-1])
        y = s[-1]
        d = bisect.bisect_left(t,y)
        if d == b:
            k += abs(y-t[-1])
        else:
            if abs(y-t[d-1]) < abs(y-t[d]):
                k += abs(y-t[d-1])
            else:
                k += abs(y-t[d])
        ans = min(k,ans)
    else:
        k = abs(x-s[c-1])
        y = s[c-1]
        d = bisect.bisect_left(t,y)
        if d == b:
            k += abs(y-t[-1])
        else:
            if abs(y-t[d-1]) < abs(y-t[d]):
                k += abs(y-t[d-1])
            else:
                k += abs(y-t[d])
        ans = min(k,ans)
        k = abs(x-s[c])
        y = s[c]
        d = bisect.bisect_left(t,y)
        if d == b:
            k += abs(y-t[-1])
        else:
            if abs(y-t[d-1]) < abs(y-t[d]):
                k += abs(y-t[d-1])
            else:
                k += abs(y-t[d])
        ans = min(k,ans)
    c = bisect.bisect_left(t,x)
    if c == b:
        k = abs(x-t[-1])
        y = t[-1]
        d = bisect.bisect_left(s,y)
        if d == a:
            k += abs(y-s[-1])
        else:
            if abs(y-s[d-1]) < abs(y-s[d]):
                k += abs(y-s[d-1])
            else:
                k += abs(y-s[d])
        ans = min(k,ans)
    else:
        k = abs(x-t[c-1])
        y = t[c-1]
        d = bisect.bisect_left(s,y)
        if d == a:
            k += abs(y-s[-1])
        else:
            if abs(y-s[d-1]) < abs(y-s[d]):
                k += abs(y-s[d-1])
            else:
                k += abs(y-s[d])
        ans = min(k,ans)
        k = abs(x-t[c])
        y = t[c]
        d = bisect.bisect_left(s,y)
        if d == a:
            k += abs(y-s[-1])
        else:
            if abs(y-s[d-1]) < abs(y-s[d]):
                k += abs(y-s[d-1])
            else:
                k += abs(y-s[d])
        ans = min(k,ans)
    print(ans)
#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


Measured memory_bytes: 12960
//NOT MY CODE
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

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

int main(void){
	int n, m, i;
	int x[200000][2];
	scanf("%d%d", &n, &m);
	for(i=0; i<n; i++){
		int A;
		scanf("%d", &A);
		x[i][0]=A;
		x[i][1]=1;
	}
	for(i=n; i<=n+m; i++){
		int B, C;
		scanf("%d%d", &B, &C);
		x[i][0]=C;
		x[i][1]=B;
	}
	qsort(x, n+m, sizeof(int)*2, comp);
	int j=n;
	long sum=0;
	for(i=0; i<n; i++){
		if(x[i][1]<j){
			sum += ((long)x[i][0])*x[i][1];
			j -= x[i][1];
		}else{
			sum += ((long)x[i][0])*j;
			break;
		}
	}
	printf("%ld\n", sum);
}


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

int main()
{
  int n, m;
  cin >> n >> m;
  vector<string> a(n);
  for(int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  string ans;
  for(string s: a) {
    ans += s;
  }
  cout << ans;
}

Measured memory_bytes: 3620
function main(input) {
    var nums = input.split('\n')[1].split(' ').map((n) => parseInt(n, 10));

    var count = 0;
    while(nums.every((n) => (n % 2) === 0)) {
        count++;
        nums = nums.map((n) => n / 2);
    }

    console.log(count);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 11596
import itertools

N = int(input())
S = [int(input()) for _ in range(N)]
ans = 0

for i in range(N-1,N+1):
  c = itertools.combinations(S, i)
  for s in c:
    sn = list(s)
    if sum(sn) % 10 != 0:
      ans = max(ans, sum(sn))
      
print(ans)

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

ll knapSack(ll n,ll v[],ll W,ll w[])
{
    ll K[n+5][W+5];
    for (ll i=0; i<=n; i++)
    {
        for (ll wt=0; wt<=W; wt++)
        {
            if (i==0 || wt==0)
                K[i][wt]=0;
            else if(w[i-1]<=wt)
                K[i][wt]=max(v[i-1]+K[i-1][wt-w[i-1]],K[i-1][wt]);
            else
                K[i][wt]=K[i-1][wt];
        }
    }
    return K[n][W];
}

int main(){
    ll n,W;
    cin>>n>>W;
    ll v[n+5],w[n+5];
    for(int i=0; i<n; i++)
        cin>>w[i]>>v[i];
    ll ans=knapSack(n,v,W,w);
    cout<<ans<<endl;
    return 0;
}


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

int n, q;
int tree[100005];

void add(int d, int y) {
	while (d <= n) {
		tree[d] += y;
		d += d&(-d);
	}
}

int getSum(int d) {
	int sum = 0;
	while (d > 0) {
		sum += tree[d];
		d -= d&(-d);
	}
	return sum;
}

int main() {
	ios_base::sync_with_stdio(0);

	cin >> n >> q;

	int com, x, y;
	for (int i = 0; i < q; i++) {
		cin >> com >> x >> y;

		if (com == 0) {
			add(x, y);
		}
		else{
			cout << getSum(y) - getSum(x - 1) << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 3584
import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int p[]=new int[n];
    for (int i=0;i<n;i++) {
      p[i]=sc.nextInt();
    }
    int[] min = new int[n];
    min[0] = p[0];
        for (int i = 1; i < n; i++) {
            min[i] = Math.min(min[i - 1], p[i]);
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            if (p[i] <= min[i]) ans++;
        }
        System.out.println(ans);
  }
}


Measured memory_bytes: 65212
#include <bits/stdc++.h>
using namespace std;
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; }

// 再帰関数を作ってDFSをスマートに描く練習
int n, u, v;
vector< vector<int> > graph(100100, vector<int>());
vector<int> Tgraph(100100, -1);
vector<int> Agraph(100100, -1);

void dfs(vector<int> &vec, int start, int len) {
    for(int i = 0; i < (int)graph.at(start).size(); ++i) {
        int next = graph.at(start).at(i);
        int nlen = len+1;
        if(vec.at(next) == -1) {
            vec.at(next) = nlen;
            dfs(vec, next, nlen);
        }
    }
}

int main() {
    cin >> n >> u >> v;
    u--; v--;
    for(int i = 0; i < n-1; ++i) {
        int aa, bb; cin >> aa >> bb;
        aa--; bb--;
        graph.at(aa).emplace_back(bb);
        graph.at(bb).emplace_back(aa);
    }
    Tgraph.at(u) = 0; Agraph.at(v) = 0;
    dfs(Tgraph, u, 0);
    dfs(Agraph, v, 0);

    int goal = 0;
    int Alen = 0;
    for(int i = 0; i < n; ++i) {
        if(Agraph.at(i) > Tgraph.at(i)) {
            if(Alen < Agraph.at(i)) {
                goal = i;
                Alen = Agraph.at(i);
            }
        }
    }

    cout << Alen-1 << endl;
}

Measured memory_bytes: 11648
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <limits>
#include <algorithm>
#include <utility>
#include <sstream>
#include <numeric>
#include <iterator>

using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef pair<int, int> P;


struct UnionFind {
  vector<int> d;
  UnionFind(int n=0): d(n,-1){}
  int find(int x){
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  bool unite(int x, int y){
    x = find(x); y = find(y);
    if(x == y) return false;
    if(d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return find(x) == find(y);}
  int size(int x) {return -d[find(x)];}
};

int deg[100005];
vector<int> to[100005];

int main(int argc, const char * argv[]) {
  int n, m, k;
  cin >> n >> m >> k;
  // vector<bool> reco(n);
  UnionFind uf(n);
  rep(i, m){
    int a, b;
    cin >> a >> b;
    --a; --b;
    deg[a]++;
    deg[b]++;
    uf.unite(a,b);
  }
  rep(i,k){
    int a, b;
    cin >> a >> b;
    --a; --b;
    to[a].push_back(b);
    to[b].push_back(a);
  }
  rep(i, n){
    int ans = uf.size(i)-1-deg[i];
    for (int u : to[i]){
      if(uf.same(i,u)) --ans;
    }
    printf("%d%c", ans, i==n-1?'\n':' ');
  }
  return 0;
}


Measured memory_bytes: 6784
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);
    int N = scn.nextInt();
    int M = scn.nextInt();
    int[] k = new int[M];
    ArrayList<int[]> s = new ArrayList<>();

    for (int i = 0; i < M; i++) {
      k[i] = scn.nextInt();
      int[] s_forLine = new int[k[i]];
      for (int j = 0; j < k[i]; j++) {
        s_forLine[j] = scn.nextInt();
      }
      s.add(s_forLine);
    }

    int[] p = new int[M];
    for (int i = 0; i < M; i++) {
      p[i] = scn.nextInt();
    }

    ArrayList<ArrayList<Boolean>> switchState = new ArrayList<>();
    fullSearch(new ArrayList<>(), switchState, N);

    int validCombiCount = 0;
    for (ArrayList<Boolean> state : switchState) {
      int glowingBulbCount = 0;
      for (int bulbNum = 0; bulbNum < M; bulbNum++) {
        int onSwitchCount = 0;
        for (int switchNum = 0; switchNum < k[bulbNum]; switchNum++) {
          if (state.get(s.get(bulbNum)[switchNum] - 1)) {
            onSwitchCount++;
          }
        }
        if (onSwitchCount % 2 == p[bulbNum]) {
          glowingBulbCount++;
        }
      }
      if (glowingBulbCount == M) {
        validCombiCount++;
      }
    }

    System.out.println(validCombiCount);
  }

  public static void fullSearch(ArrayList<Boolean> state, ArrayList<ArrayList<Boolean>> allStates, int M) {
    if (M == 0) {
      allStates.add(state);
    } else {
      ArrayList<Boolean> state0 = (ArrayList<Boolean>) state.clone();
      state0.add(false);
      fullSearch(state0, allStates, M - 1);

      ArrayList<Boolean> state1 = (ArrayList<Boolean>) state.clone();
      state1.add(true);
      fullSearch(state1, allStates, M - 1);

    }
  }
}

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

using namespace std;

#define int long long

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

    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int ans = 0;
    for (int i = 0; i < n; i++) {
        ans += a[i] / 2;
        a[i] %= 2;
        if (i != n - 1 && a[i] > 0 && a[i + 1] > 0) {
            ans++;
            a[i + 1]--;
        }
    }

    cout << ans << '\n';
}


Measured memory_bytes: 1024
def main():
  ## IMPORT MODULE
  #import sys

  #sys.setrecursionlimit(100000)
  #input=lambda :sys.stdin.readline().rstrip()

  #f_inf=float("inf")
  #MOD=10**9+7
  
  if 'get_ipython' in globals(): 
    ## SAMPLE INPUT
    n = 5
    A = [24, 11, 8, 3, 16]

  else:
    ##INPUT 
    n = int(input())
    A = list(map(int, input().split()))

  ## SUBMITION CODES HERE
  MAX_N = max(A)+1
  cnt = [0] * MAX_N 

  for a in A:
    for i in range(a, MAX_N, a):
      if cnt[i] <= 2: cnt[i] += 1

  ans = 0
  for a in A:
    if cnt[a] == 1: ans += 1
  print(ans)
  
main()

Measured memory_bytes: 32208
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a), i##_max = (b); i < i##_max; ++i)
#define RFOR(i, a, b) for (int i = (b)-1, i##_min = (a); i >= i##_min; --i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define RREP(i, n) for (int i = (n)-1; i >= 0; --i)
#define ALL(obj) (obj).begin(), (obj).end()

using namespace std;
using vi = vector<int>;
using vd = vector<double>;
using i64 = int64_t;

constexpr int INF = 1 << 30;
constexpr int MOD = 1000000007;

template <typename T>
void print(vector<T> &v) {
  REP(i, v.size()) {
    if (i) cout << " ";
    cout << v[i];
  }
  cout << endl;
}

int main() {
  int n;
  cin >> n;
  vector<vi> dp(n + 1, vi(n, 0));
  vi p(n + 1);
  REP(i, n) cin >> p[i] >> p[i + 1];
  FOR(s, 2, n + 1) {     // 掛ける個数
    REP(l, n - s + 1) {  // 掛け始めるidx
      dp[s][l] = INF;
      FOR(ls, 1, s) {  // 分割
        auto r = l + ls;
        auto rs = s - ls;
        dp[s][l] =
            min(dp[s][l], dp[ls][l] + dp[rs][r] + p[l] * p[r] * p[l + s]);
      }
    }
  }
  cout << dp[n][0] << endl;
}


Measured memory_bytes: 3196
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
#include <queue>
using namespace std;

int64_t min(int64_t a,int64_t b) {
    if (a > b)
    {
        return b ;
    }else
    {
        return a ;
    }
}

int main(){
    int n ;
    cin >> n ;
    vector<int> a(n) ;
    for (int i = 0; i < n; i++)
    {
        cin >> a.at(i) ;
    }
    
    int ans = 0 ;
    for (size_t i = 0; i < n; i++)
    {
        if (i % 2 == 0)
        {
            if (a.at(i) % 2 == 1)
            {
                ans ++ ;
            }
            
        }
        
    }
    
    cout << ans << endl ;
}


Measured memory_bytes: 3628
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Map.Strict as M

type Count = Int
type Counter a = M.Map a Count

addElement :: Ord a => a -> Counter a -> Counter a
addElement x = M.insertWith (+) x 1

countElements :: Ord a => [a] -> Counter a
countElements = foldr addElement M.empty

canBackHome :: String -> Bool
canBackHome ds
    | n * s == 0 && n /= s = False
    | w * e == 0 && w /= e = False
    | otherwise = True
    where
        ctr = countElements ds
        n = M.findWithDefault 0 'N' ctr
        s = M.findWithDefault 0 'S' ctr
        w = M.findWithDefault 0 'W' ctr
        e = M.findWithDefault 0 'E' ctr

main :: IO ()
main = putStrLn . (\x -> if x then "Yes" else "No") . canBackHome =<< getLine


Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
typedef long long int llint;

int main(){
	int n, i, ans=0;
	int d[110], num[110]={};
	cin>>n;
	for(i=0; i<n; i++) cin>>d[i];
	for(i=0; i<n; i++) num[d[i]]++;
	for(i=1; i<=100; i++){
		if(num[i]>0) ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;

int main() {
#ifdef HIRO
  string file_path(QUIZ);
  ifstream cin(file_path + "/input.txt");
  std::cin.rdbuf(cin.rdbuf());
#endif
  int n;
  // int m;
  cin >> n;
  // cin >> m;
  vector<int> arr(n);
  while(n--)
    cin >> arr[n];
  sort(arr.begin(), arr.end(), greater<int>());
  int ans = 0;
  for(int i = 0;i<arr.size();i++){
    if(i%2)ans-=arr[i];
    else ans+=arr[i];
  }


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



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

using namespace std;


int GetDigit(long long int num){
    long long int digit=0;
    while(num>0){
        num /= 10;
        digit++;
    }
    return digit;
}

int main (void){
  
  long long int a;
  
  cin >> a;
  
  int abc = GetDigit(a);
  
  for(long long int i=1;i*i<=a;i++){
    
    if(a%i != 0) continue;
    
    const long long int j = a/i;
    
    const int def = max(GetDigit(i),GetDigit(j));
    
    if(abc > def){
      abc = def;
    }
  }
    
  cout << abc << endl;
}
  
  

Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int n;

	while (true)
	{
		cin >> n;

		if (n == 0) { break; }

		vector<int> v(n);

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

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

		
		long long sum = 0;

		for (int i = 0; i < n; i++)
		{
			sum += (n - i - 1) * v[i];
		}

		cout << sum << endl;
	}

	return 0;
}

Measured memory_bytes: 3096
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

string a, b;

int dp[3005][3005]; // max len
pair<int, int> prv[3005][3005];

int lcs(int x, int y) {
	if (x == 0 || y == 0) return 0;
	if (dp[x][y] != -1) return dp[x][y];

	if (a[x] == b[y]) {
		prv[x][y] = {x-1, y-1};
		return dp[x][y] = lcs(x-1, y-1) + 1;
	}
	int r1 = lcs(x-1, y);
	int r2 = lcs(x, y-1);
	if (r1 >= r2) {
		prv[x][y] = {x-1, y};
		return dp[x][y] = r1;
	}
	prv[x][y] = {x, y-1};
	return dp[x][y] = r2;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin >> a >> b;
	a = " " + a;
	b = " " + b;
	for (int i = 0; i <= a.length(); ++i) {
		for (int j = 0; j <= b.length(); ++j) {
			dp[i][j] = -1;
		}
	}

	int cx = a.length()-1;
	int cy = b.length()-1;

	lcs(cx, cy);

	vector<char> res;
	while (cx > 0 || cy > 0) {
		auto nxt = prv[cx][cy];
		int nx = nxt.first;
		int ny = nxt.second;
		if (nx == cx-1 && ny == cy-1) {
			res.push_back(a[cx]);
		}
		cx = nx;
		cy = ny;
	}
	if (res.empty()) return 0;

	for (int i = res.size()-1; i >= 0; --i) {
		cout << res[i];
	}
	cout << "\n";
	return 0;
}

/*
	dp[i][j] = length of the lcs with prefix 1..i of a and 1..j of b

	lcs(a, b):
		- jos toinen empty, ""
		- jos viimeiset merkit samat, lcs(a-1, b-1) + vika merkki
		- jos vikat merkit eri, max(lcs(a-1, b), lcs(a, b-1))
*/


Measured memory_bytes: 106496
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<math.h>
#include<iomanip>
#include<stdio.h>
using namespace std;

int main(){

  string s;
  cin >> s;
  int n=s.size();

  for(int i=0; i<n; i+=2){
    cout << s[i];
  }

  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cstring>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define ll long long
#define ull unsigned long long
#define push(a) push_back(a)
#define pop(a) pop_back(a)
#define debug(x) cout << #x << ": " << x << endl
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int n,sum=0;

int main(){
    cin>>n;
    rep(i,1,n+1){
        sum+=i;
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll GCD(ll a, ll b){ return a ? GCD(b % a, a) : b; }
int main(){
    ll n,k;
    cin>>n>>k;
    ll b=n%k;
    cout<<min(b,abs(b-k))<<endl;
}

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

int main(){
	int n;
	cin>>n;
	int e=0,o=0;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		if(x%2==0){
			e++;
		}else{
			o++;
		}
	}
	if(o%2==1){
		cout<<"NO";
	}else{
		cout<<"YES";
	}
	return 0;
}

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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

    int n, l;
    cin >> n >> l;
    vector<int> taste(n);
    int ans = 0;
    int ab = INF;
    for(int i = 0; i < n; i++){
        taste[i] = l + (i + 1) - 1;
        ans += taste[i];
        if(abs(ab) > abs(taste[i])) ab = taste[i];
    }
    ans -= ab;

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

Measured memory_bytes: 256
#include<stdio.h>
char changesize(char a){
    if(65 <= a && a <= 90){
        return a + 32;
    }
    else if(97 <= a && a <= 122){
        return a - 32;
    }
    else{
        return a;
    }
    return 0;
}

int main(void){
    char a[1201];
    int i = 0;
    for (i = 0; i < 1200; i++)
    {
        a[i] = '\0';
    }
    fgets(a, sizeof(a), stdin);
    i = 0;
    while (a[i] != '\0'){
        printf("%c", changesize(a[i]));
        i++;
    }
    //printf("\n");
    return 0;
}


Measured memory_bytes: 2048
#include<stdio.h>
#include<fstream>
#include<algorithm>
using namespace std;
int a[2000005];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    sort(a,a+n);
    for(int i=0;i<n;i++)
    {
        if(i) printf(" ");
        printf("%d",a[i]);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 10508
#include<bits/stdc++.h>
using namespace std; 
#define int long long 
vector<int> a;

struct LCA {
    vector<int> height, euler, first, segtree;
    vector<bool> visited;
    int n;

    LCA(vector<vector<int>> &adj, int root = 0) {
        n = adj.size();
        height.resize(n);
        first.resize(n);
        euler.reserve(n * 2);
        visited.assign(n, false);
        dfs(adj, root);
        int m = euler.size();
        segtree.resize(m * 4);
        build(1, 0, m - 1);
    }

    void dfs(vector<vector<int>> &adj, int node, int h = 0) {
        visited[node] = true;
        height[node] = h;
        first[node] = euler.size();
        euler.push_back(node);
        for (auto to : adj[node]) {
            if (!visited[to]) {
                dfs(adj, to, h + 1);
                euler.push_back(node);
            }
        }
    }

    void build(int node, int b, int e) {
        if (b == e) {
            segtree[node] = euler[b];
        } else {
            int mid = (b + e) / 2;
            build(node << 1, b, mid);
            build(node << 1 | 1, mid + 1, e);
            int l = segtree[node << 1], r = segtree[node << 1 | 1];
            segtree[node] = (height[l] < height[r]) ? l : r;
        }
    }

    int query(int node, int b, int e, int L, int R) {
        if (b > R || e < L)
            return -1;
        if (b >= L && e <= R)
            return segtree[node];
        int mid = (b + e) >> 1;
        int left = query(node << 1, b, mid, L, R);
        int right = query(node << 1 | 1, mid + 1, e, L, R);
        if (left == -1) return right;
        if (right == -1) return left;
        return height[left] < height[right] ? left : right;
    }

    int lca(int u, int v) {
        int left = first[u], right = first[v];
        if (left > right)
            swap(left, right);
        return query(1, 0, euler.size() - 1, left, right);
    }

    int dist(int u,int v){
        int lc = lca(u,v);
        return height[u]+height[v]-2*height[lc];
    }
};

vector<vector<int>> g;

int32_t main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); cout.tie(NULL);
    int n,a,b;
    cin>>n>>a>>b;
    a--;b--;g.resize(n);
    for(int i=0;i<n-1;++i){
    	int u,v;
    	cin>>u>>v;--u;--v;
    	g[u].push_back(v);
    	g[v].push_back(u);
    }
    LCA t(g);
    int ans = 0;
    for(int i=0;i<n;++i){
    	if(t.dist(i,a)<t.dist(i,b))
    		ans = max(ans,t.dist(i,b)-1);
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

typedef long long ll;

#define INF (int)1e9+7
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f

ll powM(ll a,ll b,ll m )
{ 
  a%=m;
  ll ans=1;
  while(b>0)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }

return ans;
}






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

    ll a,b;
    cin>>a>>b;

    ll ans=max((ll)0,a-b);

    cout<<ans<<"\n";

return 0;

}

Measured memory_bytes: 256
//
//  main.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

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


int main()
{
    
    double N,D;
    cin >> N >> D;
    
    cout << ceil( N / (2*D + 1) ) << endl;
    
    return 0;
}


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

int main(){
    string s;
    cin >> s;
    int size = s.size();
    set<char> C;
    for (auto si:s){
        C.insert(si);
    }
    int csize = C.size();
    if (csize == size) cout << "yes" << endl;
    else cout << "no" << endl;
}

Measured memory_bytes: 256
import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		String v = "aeiou";
		System.out.println(v.indexOf(sc.next().charAt(0))==-1 ? "consonant" : "vowel");
		sc.close();			
	}

	public static void main(String args[]) {
		solve();
	}

}

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

using namespace std;

typedef long long ll;

const double pi = 3.14159265358979323846;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define MOD 1000000007LL
#define PS(p) cout << setprecision(15) << fixed << p << endl;
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
#define ALL(c) c.begin(), c.end()
#define CIN(v) cin >> v;
#define COUT(v) cout << v << "\n";

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

  int r;
  CIN(r);

  COUT(r * r);

  return 0;
}


Measured memory_bytes: 256
/**********************************************************/
/**            Bismillahir-rahmanir-rahim                **/
/**  In the name of Allah, the Beneficent, the Merciful. **/
/**********************************************************/
/**@author: Sayed Sohan*/
/**status : */
/**url: */
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
typedef long long  ll;
typedef unsigned long long ull;
#define FOR(i,x,n) for(ll i=(x);i<(n);i++)
#define IFOR(i,n,x) for(ll i=(n-1);i>=(x);i--)
#define REP(i,n) for(ll i=0;i<n;i++)
#define IREP(i,n) for(ll i = n-1;i>=0;i--)
#define cas(c,x)  cout<<"Case "<<c++<<": "<<x<<NL;
#define clr(arr,value) memset(arr,value,sizeof(arr))
#define MOD 1000000007
#define PI acos(-1.0)
#define rtod 180/PI
#define DIF if(0)
#define PB push_back
#define MP make_pair
#define SP " "
#define NL "\n"
#define DE cout<<"HERE"<<endl;
#define F first
#define S second
#define INF 1e18
#define Pause system("pause")
#define __FAST_IO ios_base::sync_with_stdio(0);
#define clr2V(x,sz) for(int iii=0;iii<=sz;iii++) x[iii].clear();
#define NUM1(x) __builtin_popcount(x)
#define MAX 100010/** can increase another 0 */

//** your code goes from here



int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    __FAST_IO;
    ll i,j,k,arr[MAX],l,m,n,x,y,coun,sum,ans,T,check;
    vector<ll> v;
    string s;

    cin>>n>>m;
    cin>>l;

    x = max(n,m);

    x = ceil(l/double(x));
    cout<<x<<NL;




    return 0;
}



Measured memory_bytes: 256
// ABC169-F Knapsack for All Subsets

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

const int MOD = 998244353;

int main() {
    int N, S, A[3000];
    cin >> N >> S;

    vector<vector<long long>> dp(N+1, vector<long long>(S+1, 0));
    // dp[i][j] := 最初のi個の数のみついて考えたとき、総和がjであるように選んでできる部分集合全てについての、それを含むような集合の総和

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

    dp[0][0] = 1; 

    for (int i=0 ;i<N ;i++ ) {
        for (int j=0 ;j<=S ;j++ ) {
            dp[i+1][j] += dp[i][j] * 2 % MOD;

            if (j-A[i] >= 0) {
                dp[i+1][j] += dp[i][j-A[i]];
            }
            dp[i+1][j] %= MOD;
        }
    }

    cout << dp[N][S] << '\n';
}

Measured memory_bytes: 73756
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    x = I()
    y = 100
    for i in range(1,5000):
        y = int(y*1.01)
        if y >= x:
            print(i)
            return
    return

#Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 68020
#include<stdio.h>
int main()
{
	long long int a, b, k;
	scanf("%lld %lld %lld", &a, &b, &k);
	if (a < k)
	{
		k -= a;
		a = 0;
	}
	else
	{
		a -= k;
		k = 0;
	}
	if (b < k)
		b = 0;
	else
		b -= k;
	printf("%lld %lld\n", a, b);
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace lean {
    class Program {
        static void Main() {
            //int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            string str = Console.ReadLine();
            if (Char.IsUpper(str[0]))
            {
                Console.WriteLine("A");
            }
            else
            {
                Console.WriteLine("a");
            }
        }
    }
}

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

int main() {
  int min_amari = 10;
  int min_amariplace = -1;
  int sum = 0;
  vector<int> data(5);
  for (int i = 0; i < 5; i++) {
    cin >> data.at(i);
  }
  vector<int> mod10(5);
  for(int i = 0; i < 5; i++){
    mod10.at(i) = data.at(i) % 10; //10で割った余りが0でない最小のものを知りたい
    if(mod10.at(i) != 0){
      min_amari = min(min_amari,mod10.at(i));
    }
  }
  
  for(int i = 0; i < 5; i++){
    if(data.at(i) % 10 == min_amari){
      min_amariplace = i;
    }
  }
  for(int i = 0; i < 5; i++){//そうでないやつ全部切り上げる
    if(i != min_amariplace){
      if(data.at(i) % 10 != 0){
        data.at(i) = data.at(i) - mod10.at(i) + 10;
      }
    }
  }
  for(int i = 0; i < 5; i++){
    sum += data.at(i);
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#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 k;
  cin >> k;
  auto s = [](ll n){
    ll res = 0;
    while(n>0){
      res += n%10;
      n/=10;
    }
    return res;
  };
  auto f = [&](ll n,ll m){  return n*s(m) > m*s(n); };
  ll x = 0, d = 1;
  rep(i,k){
    if(f(x+d,x+10*d)) d*=10;
    x+=d;
    cout << x << endl;
  }
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

const int inf = 1e9;

int n;
int x[301][301];

int main(){
	scanf("%d", &n);
	rep(i, n){
		rep(j, n){
			scanf("%d", &x[i + 1][j + 1]);
		}
	}
	rep(i, n){
		rep(j, n){
			x[i + 1][j + 1] += x[i + 1][j];
		}
	}
	rep(i, n){
		rep(j, n){
			x[i + 1][j + 1] += x[i][j + 1];
		}
	}

	int ans = -inf;
	rep(i, n){
		int p = -inf;
		rep(j, n){
			p = max(x[i][j] - x[i + 1][j], p);
			ans = max(x[i + 1][j + 1] - x[i][j + 1] + p, ans);
		}
	}
	rep(i, n){
		int p = -inf;
		rep(j, n){
			p = max(x[j][i] - x[j][i + 1], p);
			ans = max(x[j + 1][i + 1] - x[j + 1][i] + p, ans);
		}
	}
	rep(i, n){
		for(int j = i + 1; j < n; ++j){
			int p = -inf;
			for(int k = 1; k < n; ++k){
				p = max(x[i][k - 1] - x[j + 1][k - 1] + x[j][k] - x[i + 1][k], p);
				ans = max(x[j + 1][k + 1] - x[i][k + 1] + x[i + 1][k] - x[j][k] + p, ans);
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 1380
N = gets.to_i
i = 0
while i*7 <= N
	j = 0
	while i*7 + j*4 <= N
		if i*7 + j*4 == N
			print("Yes\n")
			exit
		end
		j += 1
	end
	i += 1
end

print("No\n")

Measured memory_bytes: 1788
#include <stdio.h>

int main(void){
	int n, mark, rank;
	int m, r;
	char ch[32];

	int card [4] [13];

	for(m = 0; m < 4; m++){
		for(r = 0; r < 13; r++){
			card [m] [r] = 0;
		}
	}

	scanf("%d", &n);

	for(m = 0; m < n; m++){
		scanf("%s %d", ch, &rank);

		if(ch[0] == 'S') mark = 0;
		else if(ch[0] == 'H') mark = 1;
		else if(ch[0] == 'C') mark = 2;
		else if(ch[0] == 'D') mark = 3;

		card [mark] [rank - 1] = 1;
	}

	for(m = 0; m < 4; m++){
		for(r = 0; r < 13; r++){
			if (card [m] [r] == 0){
				switch(m){
				case 0 : putchar('S'); break;
				case 1 : putchar('H'); break;
				case 2 : putchar('C'); break;
				case 3 : putchar('D'); break;
				}

				printf(" %d\n", r + 1);
			}
		}
	}

	return 0;
}

Measured memory_bytes: 1772
#include<iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <set>

using namespace std;

int main()
{
        // 整数の入力
    string ABCD,plus,minus;
    plus = "+";
    minus = "-";
    long A,B,C,D;
    cin >> ABCD;
    A = ABCD[0] - '0';
    B = ABCD[1] - '0';
    C = ABCD[2] - '0';
    D = ABCD[3] - '0';
    if (A+B+C+D==7){
        cout << to_string(A) + plus + to_string(B) + plus + to_string(C) + plus + to_string(D) + "=7" << endl;
    }else if(A+B+C-D==7){
        cout << to_string(A) + plus + to_string(B) + plus + to_string(C) + minus + to_string(D)  + "=7"<< endl;
    }else if(A+B-C+D==7){
        cout << to_string(A) + plus + to_string(B) + minus + to_string(C) + plus + to_string(D)  + "=7"<< endl;
    }else if(A+B-C-D==7){
        cout << to_string(A) + plus + to_string(B) + minus + to_string(C) + minus + to_string(D) + "=7" << endl;
    } else if (A-B+C+D==7){
        cout << to_string(A) + minus + to_string(B) + plus + to_string(C) + plus + to_string(D) + "=7" << endl;
    }else if(A-B+C-D==7){
        cout << to_string(A) + minus + to_string(B) + plus + to_string(C) + minus + to_string(D) + "=7" << endl;
    }else if(A-B-C+D==7){
        cout << to_string(A) + minus + to_string(B) + minus + to_string(C) + plus + to_string(D) + "=7" << endl;
    }else if(A-B-C-D==7){
        cout << to_string(A) + minus + to_string(B) + minus + to_string(C) + minus + to_string(D) + "=7" << endl;
    }

    return 0;
}

Measured memory_bytes: 256