akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <numeric>
#include <limits>
#include <type_traits>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

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


const long long int mod = 1000000007;
const long long int INF = 1e18;

long long int H,W,N,A,B,M,sum=0,res=0;
string str[1234];
int main()
{
    cout << fixed << setprecision(18);
    cin>>N>>A>>B;
    for(long long int i = 1; i <= N; i++){
        string S=to_string(i);
        long long int memo=0;
        for(long long int j = 0; j < S.size(); j++){
            memo+=S[j]-'0';
        }
        if(A<=memo&&memo<=B){res+=i;}
    }
    cout<<res<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double[] v = new double[n];
		for (int i = 0; i < n; i++) {
			v[i] = (double)sc.nextInt();
		}
		Arrays.sort(v);
		double ans = v[0];
		for (int  i = 1; i < n; i++) {
			ans = (v[i] + ans) / 2; 
		}
		System.out.println(ans);
	}
}

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

int main() {
  ll n;
  int x, m;
  cin >> n >> x >> m;

  vector<vector<ll>> to(40, vector<ll>(m, 0)), sum(40, vector<ll>(m, 0));
  rep(i,m) {
    to[0][i] = (ll)i * i % m;
    sum[0][i] = i;
  }

  for (int i = 0; i < 39; i++) {
    for (int j = 0; j < m; j++) {
      to[i + 1][j] = to[i][to[i][j]];
      sum[i + 1][j] = sum[i][j] + sum[i][to[i][j]];
    }
  }

  int cur = x;
  ll res = 0;
  for (int j = 0; j < 40; j++) {
    if ((n >> j) & 1) {
      res += sum[j][cur];
      cur = to[j][cur];
    }
  }
  cout << res << endl;
  return 0; 
}

Measured memory_bytes: 66696
def solve():
    a, b, c, d = map(int, input().split())
    a -= 1
    b -= 1
    c -= 1
    d -= 1
    if a > c:
        a, b, c, d = c, d, a, b
    for k in range(30, -1, -1):
        def check(a, b, c, d):
            if a // 3 ** k == c // 3 ** k and a // 3 ** k % 3 == 1 \
                    and (min(b, d) // 3 ** k % 3 == 0 and max(b, d) // 3 ** k % 3 == 2
                            or max(b, d) // 3 ** k - min(b, d) // 3 ** k >= 3):
                print(min(a % 3 ** k + 1 + c % 3 ** k + 1 + abs(b - d),
                    3 ** k - a % 3 ** k + 3 ** k - c % 3 ** k + abs(b - d)))
                return True
        if check(a, b, c, d) or check(b, a, d, c):
            return
    print(abs(a - c) + abs(b - d))

q = int(input())
for _ in range(q):
    solve()

Measured memory_bytes: 82520
package main

import "fmt"

// lcm は最小公倍数を求める関数
func lcm(x int, y int) int {
	return (x * y) / gcd(x, y)
}

// gcd は最大公約数を求める関数
func gcd(x int, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func main() {
	var xNum, yNum int
	fmt.Scan(&xNum, &yNum)

	fmt.Println(lcm(xNum, yNum))
}


Measured memory_bytes: 512
#include<stdio.h>

int F[45];

int fibonacci(int n){
  int i;
  F[0] = 1;
  F[1] = 1;
  for(i = 2; i <= n ;i++) F[i] = F[i - 2] + F[i - 1];
  return F[n];
}

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

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

}



Measured memory_bytes: 2108
n,m,v,p,*a=map(int,open(0).read().split())
a=sorted(a)[::-1]
ok=p-1
ng=n
while ng-ok>1:
  mid=(ok+ng)//2
  c=a[mid]+m
  s=f=0
  for t in a[p-1:mid]:
    if t>c:break
    s+=c-t
  else:f|=(p-1+n-mid)*m+s>=v*m
  if f:ok=mid
  else:ng=mid
print(ok+1)

Measured memory_bytes: 14052
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define mod 1000000007
 
#define p(x) cout<<x<<" ";
#define p2(x,y) cout<<x<<" "<<y<<" "
#define p3(x,y,z) cout<<x<<" "<<y<<" "<<z<<" "
#define F(i,a,b) for(ll i=a;i<=b;i++)
#define RF(i,a,b) for(ll i=a;i>=b;i--)
 
#define ff first
#define ss second
#define mp(x,y) make_pair(x,y)
#define pi pair<ll,ll>
#define ppi pair<ll,pi>
#define pb push_back
#define all(v) v.begin(), v.end() 




vector<int> v[100005];
list<int>topo;
bool visited[100005];


void dfs(int s){
  visited[s]=true;
  for(auto i:v[s]){
    if(!visited[i])
      dfs(i);
  }
  topo.push_front(s);
}

int main()
{

ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cout<<fixed<<setprecision(6);

// #ifndef ONLINE_JUDGE
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
// #endif
  
    ll t=1;
    //cin>>t;
    
    while(t--)
    {
      int n,m;
      cin>>n>>m;
      F(i,0,m-1){
        int a,b;
        cin>>a>>b;
        v[a].pb(b);
      }
      F(i,1,n)
      if(!visited[i])
      dfs(i);
    int dist[100005];
    memset(dist,0,sizeof(dist));

    dist[topo.front()]=0;

    for(auto i:topo){
      for(auto j:v[i]){
        if(dist[j]<dist[i]+1)
          dist[j]=dist[i]+1;
      }
    }

    int ans=0;
    F(i,1,n){
      ans=max(ans,dist[i]);
    }
    cout<<ans<<"\n";
    }
        
}

Measured memory_bytes: 10752
result = []
while True:
    count, target = map(int, input().split())
    if count == target == 0: break
    lis = [i for i in range(1, count+1)]

    result = 0
    for n1 in lis:
        for n2 in lis[n1:]:
            for n3 in lis[n2:]:
                if n1+n2+n3 == target:
                    result += 1
    
    print(result)


Measured memory_bytes: 5604
#include<cstdio>
#include<cstring>
#include<iostream>
#include<queue>
#include<vector>
#include<cmath>
#include<algorithm>
using namespace std;
const int N=101;
int line[N][N]={0};
int girl[N]={0},used[N];
int k,m,n;
int a[N], b[N], c[N], d[N];
bool found(int x)
{
    for(int i=1; i<=n; i++)
    {
        if(line[x][i]&&!used[i])
        {
            used[i]=1;
            if(girl[i]==0||found(girl[i]))
            {
                girl[i]=x;
                return 1;
            }
        }
    }
    return 0;
}
int main()
{
    
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%d %d",a+i,b+i);
    for(int i=0;i<n;i++)
        scanf("%d %d",c+i,d+i);
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(a[i]<c[j]&&b[i]<d[j])
                line[i+1][j+1]=1;
        }
    }
    
        int sum=0;
        for(int i=1; i<=n; i++)
        {
            memset(used,0,sizeof(used));
            if(found(i)) sum++;
        }
        printf("%d\n",sum);
}


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

int main()
{
    map<string,int> map;
    int N;
    string S;

    cin>>N;

    for(int i=1;i<=N;i++){

        cin>>S;

        map[S]+=1;

    }

    int max=0;

    for(auto itr = map.begin(); itr != map.end(); itr++) {
        if(max<itr->second){
            max=itr->second;
        }
    }

    for(auto itr = map.begin(); itr != map.end(); itr++) {
        if(max==itr->second){
            cout << itr->first<<endl;
        }
    }

    return 0;
}

Measured memory_bytes: 25216
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B;
  char op;
  cin >> A >> op >> B;
  
  if(op == '+'){
  	cout << A + B << endl;
  }
  
  if(op == '-'){
  	cout << A - B << endl;
  }
}

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

int main()
{
	int n, d;
	int x[102], y[102];
	bool s = 1;

	cin >> n;

	for (int i = 0; i < n; i++)
		cin >> x[i] >> y[i];

	x[n] = x[0];
	y[n] = y[0];
	x[n + 1] = x[1];
	y[n + 1] = y[1];

	for (int i = 0; i < n; i++) {
		d = (x[i + 1] - x[i]) * (y[i + 2] - y[i]) - (x[i + 2] - x[i]) * (y[i + 1] - y[i]);
		if (d < 0) {
			s = 0;
			break;
		}
	}

	cout << s << endl;

	return 0;
}


Measured memory_bytes: 3112
from collections import defaultdict


def dfs(s, t):
    visited = 0
    q = [(s, 0)]
    while q:
        v, used = q.pop()
        if v == t:
            return used
        visited |= used
        for lb, u in graph[v]:
            if lb & visited:
                continue
            q.append((u, used | lb))


n = int(input())
graph = [[] for _ in range(n + 1)]
for i in range(n - 1):
    a, b = map(int, input().split())
    lb = 1 << i
    graph[a].append((lb, b))
    graph[b].append((lb, a))

conditions = []
m = int(input())
for i in range(m):
    u, v = map(int, input().split())
    conditions.append(dfs(u, v))

link_conditions = [int(''.join(i), 2) for i in zip(*[bin(j)[2:].zfill(n - 1) for j in conditions])]

dp = defaultdict(int)
dp[0] = 1
for lc in link_conditions:
    for fulfilled, pattern in list(dp.items()):
        dp[fulfilled | lc] += pattern
print(dp[(1 << m) - 1])

Measured memory_bytes: 216796
#define PROB ChangingChange

#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
#define rep(i, l, r) for (int i = l; i<r;i++)
#define all(b) b.begin() , b.end()
#define mp(a, b) make_pair(a,b)
#define pb(a) push_back(a)
#define vi vector<int>
#define vd vector<double>
#define vs vector<string>
#define vii vector<pair<int,int>>
#define vvi vector<vector<int>>
#define ii pair<int,int>
#define turnOff(k, i) (k&(~(1<<(i-1))))
#define isOn(k, i) (k&&(1<<i-1)?true:false)
#define pll pair<long long int , long long int>
#define ull unsigned long long int
#define ll  long long int
#define add(a, b) ((a+b)%MOD)
#define sub(a, b) ((a-b+MOD)%MOD)
#define mul(a, b) ((a*b)%MOD)
#ifdef  DEBUG
#define MAXN 105
#else
#define MAXN 5000020
#endif
#define MAXLG 20
#define endl '\n'
#define PI 3.141592653589793238
#define MOD (1000000007)
#define INF (2000000000)
#define EPS (0.00000001)
#define treap treapNode*


int gcd(int a, int b) {
    while (a != 0) {
        int c = a;
        a = b % a;
        b = c;
    }
    return b;

}


vi getAllDivisors(int num) {
    vector<int> divs;
    int square_root = (int) sqrt(num) + 1;
    for (int i = 1; i < square_root; i++) {
        if (num % i == 0) {
            if (i * i != num) {
                divs.pb(i);
            }
            divs.pb(num / i);
        }

    }
    return divs;
}

class PROB {
public:

};


ll mod_pow(long x, int y) {
    // exponentiation by squaring
    ll r = 1;
    while (y > 0) {
        if (y % 2 == 1) {
            r = (r * x) % MOD;
        }
        x = (x * x) % MOD;
        y /= 2;
    }
    return r;
}

int max_x = 100, max_y = 100;
int tree[11][101][101];


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

#ifdef DEBUG
    freopen("input", "r", stdin);
#endif
    int row, cols, n;
    cin >> row >> cols >> n;
    int arr[n];
    rep (i, 0, n) {
        int c;
        cin >> c;
        arr[i] = c;
    }
    int R = 0, C = 0, color = 0;
    int ans[row][cols];
    int trend = cols - 1;
    while (true) {
        int paint = arr[color];

        while (paint) {
            ans[R][C] = color + 1;

            if (C == abs (trend)) {
                R++, C = trend;
                if (trend==0) trend = cols-1;
                else trend = 0;

            } else {
                if (trend>0) C = C + 1;
                else C = C - 1;
            }
            paint--;

        }
        color++;
        if (R==row)break;
    }
    rep (i,0,row) {
        rep(j, 0, cols) {
            cout << ans[i][j] << " ";
        }
        cout<<endl;
    }
    return 0;

}

Measured memory_bytes: 384
import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;

bool check(string s, string t) {
    foreach (i; 0 .. t.length) {
        foreach (j; 0 .. t.length - i) {
            foreach (k; 0 .. s.length) {
                if (i + j * k >= t.length) goto next;
                if (s[k] != t[i + j * k]) goto next;
            }
            return true;
            next:;
        }
    }
    return false;
}

void main() {
    int N; scanf("%d\n", &N);
    string s = readln.chomp;
    int ans = 0;
    foreach (_; 0 .. N) {
        string t = readln.chomp;
        if (check(s, t)) ans++;
    }
    ans.writeln;
}

Measured memory_bytes: 1048
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pb push_back
#define pll pair<ll, ll> 
#define tri pair<pll, ll>
#define vl vector<ll> 
#define vvl vector< vector<ll> > 
#define vlp vector< pair<ll, ll> >
#define vllp vector<pair<pll, ll> > 
#define mll map<ll, ll> 
#define rep(i,a)  for(ll i=0; i< a; i++)
#define rep1(i,a)   for(ll i = 1; i< a; i++)
#define foi(i, a, b)    for(ll i = a; i<b ; i++)
#define fod(i, a, b)    for(ll i = a; i>=b ; i--)
#define mp make_pair
#define all(v)  (v).begin(), (v).end()
#define fst first
#define sec second
#define ff first.first
#define fs first.second
#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)
#define MAX 1000001
#define MOD 1000000007
// #define MOD 998244353
#define endl "\n"
#define INF (ll)1e18
#define s(v) (ll)v.size()
#define e(v) v.empty()
#define bscount(x) __builtin_popcountll(x)
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
// using namespace __gnu_pbds;

ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll cpow(ll a, ll b, ll M){ll ans = 1;while(b){if(b&1) ans = ans*a%M; b/=2;a=a*a%M;}return ans;}
void ingraph(vvl& graph, ll m){ll x, y;rep(i, m){cin>>x>>y;x--, y--;graph[x].pb(y);graph[y].pb(x);}}
ll modify(ll n){ll res = n;res%=MOD;res+=MOD;res%=MOD;return res;}
ll fexp(ll a, ll b) {return cpow(a, b, MOD);}
ll cinv(ll a, ll p){return cpow(a, p-2, p);} 
ll inverse(ll a)    {return cinv(a, MOD);}

int main(){
    // #ifndef ONLINE_JUDGE
    //     freopen("../input.txt", "r", stdin);
    //     freopen("../output.txt", "w", stdout);
    // #endif
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll t;
    // cin>>t;
    t = 1;
    while(t--){
        ll n;
        cin>>n;
        ll u, v;
        ll ans = (n*(n+1)*(n+2))/6;
        rep(i, n-1){
            cin>>u>>v;
            if(u > v)   swap(u, v);
            ans -= u*(n-v+1);
        }
        cout<<ans;
    }
}

Measured memory_bytes: 3652
long long int A[99999],r=0,s=0;
#define tri(a,b,c) (a<b+c)
int compare(const void *a, const void *b){
	long long int val=*(long long int*)b - *(long long int*)a;
	return val<0?-1:val>0?1:0;
}
main(){
	int N,i=0;
	scanf("%d",&N);
	if(N<6)puts("0"),exit(0);
	for(i=0;i<N;i++)scanf("%lld",A+i);
	qsort(A,N,8,compare);
	for(i=0;i<N-5;i++) //single*2
		if(tri(A[i],A[i+1],A[i+2])){s=A[i]+A[i+1]+A[i+2];break;}
	if(s)for(i+=3;i<N-2;i++)
		if(tri(A[i],A[i+1],A[i+2])){r=s+A[i]+A[i+1]+A[i+2];break;}
	for(s=i=0;i<N-5;i++)
		if(
			(tri(A[i],A[i+1],A[i+4])&&tri(A[i+2],A[i+3],A[i+5]))|| //type3 AABBAB
			(tri(A[i],A[i+1],A[i+5])&&tri(A[i+2],A[i+3],A[i+4]))|| //type4 AABBBA
			(tri(A[i],A[i+3],A[i+4])&&tri(A[i+1],A[i+2],A[i+5]))   //type8 ABBAAB
		){s=A[i]+A[i+1]+A[i+2]+A[i+3]+A[i+4]+A[i+5];r=r>s?r:s;break;}
	printf("%lld\n",r);exit(0);
}

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

const int Maxn = 82;
const int Maxm = Maxn * 2 * 80 + 3;

int n, m;
int A[Maxn][Maxn];
int B[Maxn][Maxn];
bool has[Maxn][Maxn][Maxm];

void Read(int A[][Maxn])
{
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            scanf("%d", &A[i][j]);
}

void Add(int r, int c, int val)
{

    has[r][c][abs(val - (A[r][c] - B[r][c]))] = true;
    has[r][c][abs(val + (A[r][c] - B[r][c]))] = true;
}

int main()
{
    scanf("%d %d", &n, &m);
    Read(A);
    Read(B);
    Add(0, 0, 0);
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++) {
            int lim = (i + j + 1) * 80;
            for (int k = 0; k <= lim; k++) if (has[i][j][k]) {
                if (i + 1 < n) Add(i + 1, j, k);
                if (j + 1 < m) Add(i, j + 1, k);
            }
        }
    int pnt = 0;
    while (!has[n - 1][m - 1][pnt]) pnt++;
    printf("%d\n", pnt);
    return 0;
}


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

using int64 = long long;

int64 diff(int64 a, int64 b, int64 c) {
  if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0)
    return 0;
  return min(a * b, min(b * c, c * a));
}

int main() {
  int64 a, b, c;
  cin >> a >> b >> c;
  cout << diff(a, b, c) << "\n";
  return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))


int main() {

  int N,i,tmp,r,b;
  cin >> N;
  
  string s;
  cin >> s ;
  r=0;
  b=0;
  for( i=0;i<N;i++){
    if(s[i]=='R') r++;
    if(s[i]=='B') b++;
  }
  
  if (r>b){
    std::cout << "Yes" << endl;
    return 0;
  }else{
    std::cout << "No" << endl;
    return 0;
  }
}


Measured memory_bytes: 256
// AtCoder template
// 世界はとっても美しい！
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < n; ++i)

int k;
vector<ll> ans;
void dfs(string s){
    ans.push_back(stoll(s));
    int n = s.size();
    if(n >= 10) return;
    if(s[n-1] == '0') rep(i,2) dfs(s+char(s[n-1]+i));
    else if(s[n-1] == '9') rep(i,2) dfs(s+char(s[n-1]+i-1));
    else rep(i,3) dfs(s+char(s[n-1]+i-1));
}

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

    cin >> k;
    for(char c = '1'; c <= '9'; ++c) dfs(string(1,c));
    sort(ans.begin(), ans.end());
    cout << ans[k-1] << endl;
}

Measured memory_bytes: 2420
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>


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

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)
















int main(){
    ll h, w, n;
    cin >> h >> w >> n;
    ll t = max(h, w);
    cout << ((n % t == 0)? n / t : n / t + 1) << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int INF = numeric_limits<int>::max() / 2;
using ll = long long;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a;
    a.push_back(0);
    for(int i = 0; i < n; i++){
        int b;
        cin >> b;
        a.push_back(b);
    }
    a.push_back(0);
    int ideal = 0;
    for(int i = 1; i < n+2; i++){
        ideal += abs(a[i] - a[i-1]);
    }
    for(int i = 0; i < n; i++){
        cout << ideal - abs(a[i+1] - a[i]) - abs(a[i+2] - a[i+1]) + abs(a[i+2] - a[i]) << '\n';
    }
    return 0;
}

Measured memory_bytes: 1784
n=int(input())
Rb=sorted([list(map(int,input().split())) for _ in range(n)],key=lambda x:x[1],reverse=True)
Bc=sorted([list(map(int,input().split())) for _ in range(n)])

cnt=0
for c,d in Bc:
  for a,b in Rb:
      if a<c and b<d:
          Rb.remove([a,b])
          cnt+=1
          break
print(cnt)

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(void){
    int n;
    cin >> n;
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        s[i] = (s[i] - 'A' + n) % 26 + 'A';
    }
    cout<<s<<endl;
}


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

#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)

mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

template <typename T>
inline void chkmax(T &x, T y) { if (x < y) x = y; }

template <typename T>
inline void chkmin(T &x, T y) { if (x > y) x = y; }

inline int read() {
  #define nc getchar()
  int x = 0;
  char c = nc;
  while (c < 48) c = nc;
  while (c > 47) x = x * 10 + (c ^ 48), c = nc;
  return x;
  #undef nc
}

#define int long long

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

void solve() {
  int n = read();
  int mx1 = -1e18, mx2 = -1e18, mn1 = 1e18, mn2 = 1e18;
  rep(i, 1, n) {
    int x = read(), y = read();
    chkmax(mx1, x + y), chkmin(mn1, x + y);
    chkmax(mx2, x - y), chkmin(mn2, x - y);
  }
  int ans = max(mx1 - mn1, mx2 - mn2);
  cout << ans << endl;
}

signed main() {
//  int T = read();
//  while (T--) solve();
  solve();
  return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
 
#define ll          long long  int
#define ld          long double
#define pb          push_back
#define mp          make_pair
#define ff          first
#define se          second
#define endl        '\n'
#define fd(n)       fixed<<setprecision(n)
#define MAX         100000000000000000
#define MAXN        300005
#define mod         998244353  
 
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,i;
    cin>>n;
    string s;
    
    set<string> st;
    for(i=0;i<n;i++){
        cin>>s;
        st.insert(s);
    }
    n=st.size();
    cout<<n;
}

Measured memory_bytes: 19256
package main

import (
  "fmt"
  "strings"
)

func main(){
  var a,b,c string
  fmt.Scan(&a, &b, &c)
  fmt.Println(strings.ToUpper(string(a[0])) + strings.ToUpper(string(b[0])) + strings.ToUpper(string(c[0])))
}

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

int main(void)
{
	//変数の宣言
	int d,g;
	int p[10];
	int c[10];
	int total[10];
	int sum,sum1;
	int mondaisu,mondaisu1;
	int min=1000;
	int i,j,k;
	
	//データの読み込み
	
	scanf("%d %d",&d,&g);
	
	for(i=0;i<d;i++){
		scanf("%d %d",&p[i],&c[i]);
	}
	
//	printf("nは%dです\n", n);
//	printf("データの読み込み終了\n");
	//実際の処理
	
	for(i=0;i<d;i++){
		total[i]=p[i]*(i+1)*100+c[i];
	}
	
//	printf("100点問題を全部とくと%d点",total[0]);
	
	for(i=0;i<(1<<d);i++){
//		printf("i=%dのループ開始\n",i);
		sum=0;
		mondaisu=0;
		for(j=0;j<d;j++){
//			printf("i=%d,1<<j=%d,i&(1<<j)=%d\n",i,1<<j,i&1<<j);
			if(i&(1<<j)){
//				printf("%d00点問題は解く\n",i);
				sum=sum+total[j];
				mondaisu=mondaisu+p[j];
			}
		}
		
//		printf("sum=%d\n",sum);
		
		if(sum<g){
			for(j=0;j<d;j++){
//				printf("OK1\n");
				if(~i&(1<<j) && sum+total[j]+1>g){
					k=0;
					sum1=sum;
					mondaisu1=mondaisu;
					
//					printf("sum=%d\n",sum);
					
					for(k=1;k<p[j]+1;k++){
//						printf("OK4 %d回目のループ\n",k);
						mondaisu1++;
						sum1=sum1+(j+1)*100;
//						printf("sum1=%d,g=%d,k=%d,p[j]=%d,mondaisu1=%d\n",sum1,g,k,p[j],mondaisu1);
						if(sum1+1>g || k==p[j]){
//							printf("breakします");
							break;
						}else{
//							printf("もう一周\n");
						}
					}
					
//					printf("i=%d,解いた問題数=%d\n",i,mondaisu1);
					
					if(mondaisu1<min){
						min=mondaisu1;
					}
				}
			}
		}
	}
	
	
//	printf("計算部分終了\n");
	
	//出力
	
	printf("%d\n",min);
	
//	printf("結果の出力終了\n");

	return 0;
}



Measured memory_bytes: 128
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var (
	BufferSize = 10 * 10 * 10 * 10 * 10 * 10 * 10
)

func scanStr(sc *bufio.Scanner) string {
	if !sc.Scan() {
		panic(nil)
	}

	return sc.Text()
}

func scanInt(sc *bufio.Scanner) int {
	if !sc.Scan() {
		panic(nil)
	}

	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}

	return i
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	buf := make([]byte, BufferSize)
	sc.Buffer(buf, BufferSize)
	sc.Split(bufio.ScanWords)

	n := scanInt(sc)
	a := make([]int, n, n)

	sumX0 := 0
	a[0] = scanInt(sc)
	sum := a[0]
	for i := 1; i < n-1; i++ {
		a[i] = scanInt(sc)
		if i%2 == 1 {
			sumX0 += a[i]
		}
		sum += a[i]
	}
	a[n-1] = scanInt(sc)
	sum += a[n-1]

	x := make([]int, n, n)
	x[0] = sum - 2*sumX0
	fmt.Printf("%d", x[0])
	for i := 1; i < n-1; i++ {
		x[i] = 2*a[i-1] - x[i-1]
		fmt.Printf(" %d", x[i])
	}
	x[n-1] = 2*a[n-1-1] - x[n-1-1]
	fmt.Printf(" %d\n", x[n-1])
}


Measured memory_bytes: 8960
/*
  NAME : RISHABH SINGH
  INSTITUTION : DELHI TECHNOLOGICAL UNIVERSITY
*/
#include "bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define pii pair<int, int>
#define bi __builtin_inf()
#define ll long long
#define mp make_pair
#define ss second
#define pb push_back
#define ff first
#define speed_cubing ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define um unordered_map
#define us unordered_set
#define bp __builtin_popcount
#define ld long double
#define rep(n) for (int i = 0; i < n; i++)
#define pll pair<ll, ll>
#define mx = 1e18;
#define lb(v, val) (lower_bound(v.begin(), v.end(), val) - v.begin())
#define ub(v, val) (upper_bound(v.begin(), v.end(), val) - v.begin())
#define PI 3.1415926535
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> pbds;
ll powmod(ll base,ll exp,ll MOD){ll res=1;while(exp>0){if(exp%2==1) res=(res*base)%MOD;base=(base*base)%MOD;exp/=2;}return (res%MOD);}
#define sz(v) (int)v.size()
#define endl '\n'
const int mod = 1e9+7;
ll mul_inv(ll a,ll b = mod) {ll t1=a,t2=b,t3,v1=1,v2=0,v3;while(t2!=1){ll x=t1/t2;t3=t1-x*t2;v3=v1-x*v2;t1=t2,t2=t3;v1=v2,v2=v3;}return(v2+b)%b;}
const int N = 5e5+5;
 
int32_t main(){
   
   speed_cubing
   
   
   string s,t;
   cin>>s>>t;

   int mini = INT_MAX;

   for(int i=0;i<=(int)s.size()-(int)t.size();i++){
      
      int cnt = 0;

      for(int j=i;j<i+t.size();j++){
         
         if(s[j]!=t[j-i])
           cnt++;

      }

      mini = min(mini,cnt);

   }

   cout<<mini;


   return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define BIT(n) (1LL << (n))
#define INF 2e9
#define MOD (1000000007)
#define EPS 1e-9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long long int lli;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M, C;
    cin >> N >> M >> C;
    vector<int> B(M);
    REP(i, M)
    {
        cin >> B[i];
    }
    int count = 0;
    REP(i, N)
    {
        int val = C;
        REP(j, M)
        {
            int p;
            cin >> p;
            val += B[j] * p;
        }
        count += (val > 0) ? 1 : 0;
    }
    cout << count << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#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,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)

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

    string s; cin >> s;
    int cnt0 = 0;
    int cnt1 = 0;
    rep(i,s.size()){
        if(s[i] == '1') cnt1++;
        else cnt0++;
    }
    cout << 2 * min(cnt0, cnt1) << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD (int) (1e9+7)
#define INF (int) 2e9

int main(){
    int h, w;
    cin >> h >> w;

    char s[h][w];
    int ans = 0;
    rep(i, h){
        rep(j, w){
            char c; cin >> c;
            s[i][j] = c;
            if(c=='.') ans++;
        }
    }

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

    queue<P> q;
    q.push(P(0, 0));

    int d[h][w];
    rep(i, h) rep(j, w) d[i][j] = INF;
    d[0][0] = 0;
    while(!q.empty()){
        P p = q.front(); q.pop();
        int x = p.first;
        int y = p.second;
        
        rep(i, 4){
            int nx = x+dx[i];
            int ny = y+dy[i];

            if(nx>=0 && nx<h && ny>=0 && ny<w && s[nx][ny]=='.' && d[nx][ny]==INF){
                d[nx][ny] = d[x][y] + 1;
                q.push(P(nx, ny));
            }
        }
        if(d[h-1][w-1]!=INF) break;
    }

    if(d[h-1][w-1]==INF){
        cout << -1 << endl;    
    }else{
        cout << ans - d[h-1][w-1] -1 << endl;
    }
    // printf("%d\n", N);
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys,fractions
from functools import reduce
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))

    _l = 0
    L = []
    for i in range(N-1):
        _l = fractions.gcd(_l, A[i])
        L.append(_l)
    L.insert(0,0)

    _r = 0
    R = []
    for i in range(N-1):
        _r = fractions.gcd(_r, A[N-i-1])
        R.append(_r)
    R.reverse()
    R.append(0)

    print(max([fractions.gcd(l,r) for l, r in zip(L,R)]))



lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Measured memory_bytes: 16156
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <random>
#include <utility>
#include <map>
#include <vector>
#define REP(i,x) for(int i=0; i<(x); i++)

using namespace std;

int main(int argc, const char * argv[]) {
    int n,h;
    cin >> n >> h;
    int a[n],b[n];
    REP(i, n){
        cin >> a[i] >> b[i];
    }
    sort(a, a+n);
    sort(b, b+n);
    int cnt =0;
    int pt = -1;
    REP(i, n){
        if (a[n-1] > b[i]){
            pt = i;
        } else {
            break;
        }
    }
    if (pt < n-1) {
        for (int i = n-1; i>pt; i--) {
            h-=b[i];
            cnt++;
            if (h<=0) {
                cout << cnt << endl;
                return 0;
            }
        }
    }
    double dc = h/double(a[n-1]);
    cnt += ceil(dc);
    cout << cnt << endl;
    
    return 0;
}


Measured memory_bytes: 1024
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
using namespace std;
typedef long long ll;

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

int main(){
    int X,Y,Z;
cin>>X>>Y>>Z;
cout<<Z<<" "<<X<<" "<<Y<<endl;


    return 0;
}

Measured memory_bytes: 256
from operator import itemgetter

N, C = map(int, input().split())
STC = [list(map(int, input().split())) for _ in range(N)]

P = [[] for _ in range(C)]
for s, t, c in STC:
    P[c-1].append((s, t))

Q = []
for ps in P:
    ps.sort(key=itemgetter(0))
    if not ps:
        continue
    for i, (s, t) in enumerate(ps):
        if i == 0:
            pres = s
            pret = t
            continue
        if s == pret:
            pret = t
            continue
        Q.append((pres-1, pret))
        pres = s
        pret = t
    Q.append((pres-1, pret))

imos = [0 for _ in range(100003)]
for qx, qy in Q:
    imos[qx] += 1
    imos[qy] -= 1

for i in range(100002):
    imos[i] += imos[i-1]
print(max(imos))

Measured memory_bytes: 46112
X = int(input())

for b in range(-10**6, 10**6):
    a5 = abs(b**5 + X)
    a = pow(a5, 1 / 5)

    if a5 < 0:
        a = -a

    a = int(a)
    if a**5 - b**5 == X:
        print(a, b)
        exit()


Measured memory_bytes: 9564
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 10000000000
using namespace std;
using ll = long long;
int main()
{
    string s;
    cin >> s;
    string t = "abc";
    map<char, int> mp;
    rep(i,3){
        mp[s[i]]++;
    }
    int cnt = 0;
    rep(i,3){
        if(mp[t[i]]){
            cnt++;
        }
    }
    if(cnt == 3){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }
//****************************************
// Graph template
//****************************************

// status of edge
template <typename X>
struct Edge{
  int from;
  int to;
  X cost;

  Edge() = default;

  Edge(int from, int to, X cost) : from(from), to(to), cost(cost) {}
};

// status of node
template <typename X>
struct Node{ 
  int idx;
  vector<Edge<X>> edge;
  bool visit;
  
  Node() = default;

  explicit Node(int idx) : idx(idx) {}
};

template <typename X>
class Graph{
private:
  int n; // number of node
  int m; // number of edge
  vector<Node<X>> node; 

  void Init_Node() {
    rep(i,n) node.emplace_back(i);
  }
public:
  explicit Graph(int n) : n(n) {
    Init_Node();
  }

  // edges have no-weight 
  Graph(int n, int m, vector<int> from, vector<int> to) : n(n), m(m) {
    Init_Node();
    rep(i,m) {
      add_edge(from[i], to[i]);
      add_edge(to[i], from[i]);      
    }
  }  

  // edges have weight
  Graph(int n, int m, vector<int> from, vector<int> to, vector<X> cost) : n(n), m(m) {
    Init_Node();
    rep(i,m) {
      add_edge(from[i], to[i], cost[i]);
      add_edge(to[i], from[i], cost[i]);      
    }
  }

  void add_edge(int from, int to, X cost = 1) {
    node[from].edge.emplace_back(from, to, cost);
  }

  void solve() {
    rep(i,n) node[i].visit = false;
    int s = 0, t;
    t = node[s].edge[0].to;
    vector<int> res;
    res.push_back(s);
    res.push_back(t);
    node[s].visit = true;
    node[t].visit = true;
    queue<int> q;
    q.push(t);
    while( !q.empty() ) {
      int v = q.front(); q.pop();
      for(auto next: node[v].edge) {
	int w = next.to;	
	if( !node[w].visit ) {
	  node[w].visit = true;
	  res.push_back(w);
	  q.push(w);
	  break;
	}
      }
    }
    reverse(res.begin(), res.end());
    q.push(s);
    while( !q.empty() ) {
      int v = q.front(); q.pop();
      for(auto next: node[v].edge) {
	int w = next.to;
	if( !node[w].visit ) {
	  node[w].visit = true;
	  res.push_back(w);
	  q.push(w);
	  break;
	}
      }
    }
    int ans = res.size();
    cout << ans << "\n";
    rep(i,ans) {
      cout << res[i] + 1 << " ";
    }
    cout << "\n";
  }
  
};


int main()
{
  int n,m;cin >> n >> m;
  vector<int> a(m), b(m);
  rep(i,m) {
    cin >> a[i] >> b[i];
    a[i]--; b[i]--;
  }

  Graph<int> gp(n, m, a, b);
  gp.solve();
  return 0;
}


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

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x)  cerr << #x << " = " << x << endl
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ld PI = 3.14159265359;

const ll MOD = (ll) 1e9 + 7;
const ll MAXN = (ll) 2e5 + 10;
const ll INF = (ll) 2242545357980376863;
const ld EPS = (ld) 1e-8;

ll bt[20];

ll p2(ll x){
	ll cnt = 0;
	while(x % 2 == 0) x /= 2, cnt++;
	return cnt;
}

vector<ll> ans, rem, rem2;
void solve(ll a, ll b, ll n){
	if(n == 1){
		ans.pb(a);
		ans.pb(b);
		return ;
	}
	ll dif = a ^ b;
	ll bit;
	for(int i = 0; i < n; i++){
		if(dif & bt[rem[i]]) bit = rem[i];
	}
	rem2.clear();
	for(auto x : rem) if(x != bit) rem2.pb(x);
	
	ans.pb(a);
	ll del;
	for(int i = 1; i <= (1ll << (n - 1)) - 1; i++){
		del = bt[rem2[p2(i)]];
		ans.pb(ans.back() ^ del);
	}
	rem.clear();
	for(auto x : rem2) rem.pb(x);
	solve(ans.back() ^ bt[bit], b, n - 1);
}

int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	for(int i = 0; i< 19; i++) bt[i] = (1ll << i);
	ll n;
	cin >> n;
	ll A;
	ll B;
	cin >> A >> B;
	for(int i = 0; i < n; i++) rem.pb(i);
	if(__builtin_popcount(A ^ B) % 2 == 0) return cout << "NO", 0;
	solve(A, B, n);
	cout << "YES\n";
	//reverse(all(ans));
	for(auto x : ans) cout << x << " ";
	return 0;
}


/*

                                 ____              ,----..               ,----..
   ,---,                       ,'  , `.           /   /   \             /   /   \
  '  .' \                   ,-+-,.' _ |          /   .     :           /   .     :
 /  ;    '.              ,-+-. ;   , ||         .   /   ;.  \         .   /   ;.  \
:  :       \            ,--.'|'   |  ;|        .   ;   /  ` ;        .   ;   /  ` ;
:  |   /\   \          |   |  ,', |  ':        ;   |  ; \ ; |        ;   |  ; \ ; |
|  :  ' ;.   :         |   | /  | |  ||        |   :  | ; | '        |   :  | ; | '
|  |  ;/  \   \        '   | :  | :  |,        .   |  ' ' ' :        .   |  ' ' ' :
'  :  | \  \ ,'        ;   . |  ; |--'         '   ;  \; /  |        '   ;  \; /  |
|  |  '  '--'          |   : |  | ,             \   \  ',  /          \   \  ',  /
|  :  :                |   : '  |/               ;   :    /            ;   :    /
|  | ,'                ;   | |`-'                 \   \ .'              \   \ .'
`--''                  |   ;/                      `---`                 `---`
                       '---'

*/


Measured memory_bytes: 2164
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
using namespace std;

typedef long long ll;

#define min(a, b) (((a) < (b))? (a):(b))
#define max(a, b) (((a) > (b))? (a):(b))
#define REP(i, a, n) for(int i=(a); i<(n); i++)
#define rep(i, n) REP(i, 0, (n))
#define square(a) (a)*(a)
#define pb push_back

string s,t;
int main(){
    cin >> s >> t;
    sort(s.begin(),s.end());
    sort(t.rbegin(),t.rend());
    cout << (s < t ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}

int main() {
  int N,L;
  cin>>N>>L;
  vector<string>S(N);
  for(int i=0;i<N;i++){
    cin>>S[i];
  }
  sort(S.begin(),S.end());
  string t;
  for(int i=0;i<N;i++){
    t+=S[i];
  }
  cout<<t<<endl;
  return 0;
}

Measured memory_bytes: 3640
def solve():
    inputstr = input()
    N = int(inputstr)
    L = len(inputstr)
    list = [dsum(mfloor(N,k)) for k in range(1,L)]
    list.append(dsum(N))
    ans = max(list)
    print(str(ans))

def dsum(n):
    ans = 0
    for d in str(n):
        ans += int(d)
    return ans

def mfloor(n,k):
    import math
    ans = math.floor(n/(10**k))*(10**k) - 1
    return ans

solve()


Measured memory_bytes: 3064
import Data.Bool
import Data.List

half = flip div 2

readInt :: String -> Int
readInt = read
main = do
  n <- readInt<$>getLine
  s <- getLine
  putStrLn $ solve n s

solve :: Int -> String -> String
solve n s = bool "No" "Yes" (judge) where
 judge = half n < length(filter(=='R')s)

Measured memory_bytes: 508
#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
//#include <chrono>
//#include <random>
#include <bitset>
#include <cstdio>
#include <vector>
#include <string>
#include <ctime>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <list>
#include <map>
#include <set>

using namespace std;

const int N = 100005;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;

int n;
string s;

int main() {
	//mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
	cin>>n>>s;
	int r = 0;
	int b = 0;
	for(int i=0;i<n;i++){
        if(s[i] == 'R')
            ++r;
        else
            ++b;
	}
	if(r > b)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }

map<vint,int> dp[110];

int n;
int D[110], A[110];

int main() {
    //freopen( "/Users/macuser/Dropbox/Contest/input.in", "r", stdin );
    while (cin >> n) {
        for (int i = 0; i < n; ++i) cin >> D[i];
        for (int i = 0; i < n; ++i) cin >> A[i];
        for (int i = 0; i < 110; ++i) dp[i].clear();
        
        int res = 0;
        
        vint start(7);
        for (int i = 0; i < 7; ++i) start[i] = i-7;
        dp[0][start] = 0;
        for (int i = 0; i < n; ++i) {
            EACH(it, dp[i]) {
                vint vec = it->first;
                
                //cout << i << ", " << vec << " : " << dp[i][vec] << endl;

                for (int j = 0; j < 8; ++j) {
                    vint nvec;
                    int add = 0;
                    for (int k = 0; k < j; ++k) {
                        if (vec[k] != i-7) nvec.PB(vec[k]);
                        if (vec[k] < 0) continue;
                        if ( abs( i - vec[k] ) <= D[vec[k]] ) add += A[vec[k]];
                    }
                    nvec.PB(i);
                    for (int k = j; k < vec.size(); ++k) {
                        if (vec[k] != i-7) nvec.PB(vec[k]);
                        if (vec[k] < 0) continue;
                        if ( abs( vec[k] - i ) <= D[i] ) add += A[i];
                    }
                    
                    //cout << vec << " ; " << j << " ::: " << nvec << endl;
                    
                    chmax(dp[i+1][nvec], it->second + add);
                    chmax(res, dp[i+1][nvec]);
                }
            }
        }
        cout << res << endl;
    }
    return 0;
}


Measured memory_bytes: 61524
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
    int x,y;
    cin>>x>>y;
    while(true){
        if(max(x,y)%min(x,y)==0){
            cout<<min(x,y)<<endl;
            return 0;
        }
        else{
            if(x>y){
                x=x%y;
            }
            else{
                y=y%x;
            }
        }
    }
}



Measured memory_bytes: 3124
#include<stdio.h>

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

	return 0;
}


Measured memory_bytes: 2104
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

eps = 10**-7
a,b = nm()
for i in range(10000):
    if int(i*.08 + eps) == a and int(i*.1 + eps) == b:
        print(i); break
else:
    print(-1)


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


int main(){
	string str1, str2;
	cin >> str1 >> str2;
	sort(str1.begin(), str1.end());
	sort(str2.begin(), str2.end(), greater<>());
	if (str1 < str2) { cout << "Yes"; }
	else { cout << "No"; }
	return 0;
}

Measured memory_bytes: 256