akhauriyash/Code-Regression huggingface dataset:
class Dice(object):
    def __init__(self,num):
        self.n = num[4]
        self.e = num[2]
        self.w = num[3]
        self.s = num[1]
        self.center = num[0]
        self.back = num[5]

    def number(self):
        number = [self.center, self.s, self.e, self.w, self.n, self.back]
        return number

    def move(self,str):
        if str == 'N':
            x = self.n
            self.n = self.center
            self.center = self.s
            self.s = self.back
            self.back = x
            return self.center
        elif str == 'S':
            x = self.s
            self.s = self.center
            self.center = self.n
            self.n = self.back
            self.back = x
            return self.center
        elif str== 'E':
            x = self.e
            self.e = self.center
            self.center = self.w
            self.w = self.back
            self.back = x
            return self.center
        elif str == 'W':
            x = self.w
            self.w = self.center
            self.center = self.e
            self.e = self.back
            self.back = x
            return self.center


n = int(input())
dice = []
for i in range(n):
    dice.append([int(j) for j in input().split()])

bool = False
d = []


for dice1 in range(len(dice)-1):
    d1 = Dice(dice[dice1])
    for dice2 in range(len(dice)-1-dice1):
        d2 = Dice(dice[dice2+dice1+1])
        for i in range(4):
            for j in range(4):
                for k in range(4):
                    # print(d1.number(), d2.number())
                    if d1.number() == d2.number():
                        bool = True
                    else:
                        d1.move('N')
                        d1.move('E')
                        d1.move('S')
                d1.move('E')
            d1.move('N')

print('Yes') if bool == False else print('No')

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

struct Card { char suit, value; };

void bubble(struct Card A[], int N) {
	for (int i = 0; i < N; i++) {
		for (int j = N - 1; j >= i + 1; j--) {
			if (A[j].value < A[j - 1].value) {
				Card t = A[j]; A[j] = A[j - 1]; A[j - 1] = t;
			}
		}
	}
}

void selection(struct Card A[], int N) {
	for (int i = 0; i < N; i++) {
		int minj = i;
		for (int j = i; j < N; j++) {
			if (A[j].value < A[minj].value) minj = j;
		}
		Card t = A[i]; A[i] = A[minj]; A[minj] = t;
	}
}

void print(struct Card A[], int N) {
	for (int i = 0; i < N; i++) {
		if (i > 0) cout << " ";
		cout << A[i].suit << A[i].value;
	}
	cout << endl;
}

bool isStable(struct Card C1[], struct Card C2[], int N) {
	for (int i = 0; i < N; i++) {
		if (C1[i].suit != C2[i].suit) return false;
	}
	return true;
}

int main()
{
	Card C1[100], C2[100];
	int N;
	char ch;

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> C1[i].suit >> C1[i].value;
	}

	for (int i = 0; i < N; i++) {
		C2[i] = C1[i];
	}
	bubble(C1, N);
	selection(C2, N);

	print(C1, N);
	cout << "Stable" << endl;
	print(C2, N);
	if (isStable(C1, C2, N)) {
		cout << "Stable" << endl;
	}
	else {
		cout << "Not stable" << endl;
	}
    return 0;
}




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

int main(){
  vector<int> v(3);
  cin >> v.at(0) >> v.at(1) >> v.at(2);
  sort(v.begin(),v.end());
  cout << v.at(0) + v.at(1) << endl;
  return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#pragma _attribute_((optimize("-O2")))
#pragma comment(linker, "/STACK:102400000,102400000")

#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <cstdio>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <string>
#include <sstream>
#include <ctime>
#include <complex>
#include <iomanip>
#include <stdio.h>
#define Endl endl
#define int long long

//#define Local

using namespace std;


signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input1.txt", "r", stdin);
	//freopen("output1.txt", "w", stdout);

	int n;
	cin >> n;
	int res = 0;
	while(n--)
	{
		int tmp;
		cin >> tmp;
		while (!(tmp & 1))
			tmp >>= 1, res++;
	}
	cout << res << endl;


#ifdef Local
	cout << "time: " << (long long)clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl;
#endif
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    int S=scan.nextInt();
    scan.nextLine();
    String[] N=scan.nextLine().split("");
    int count=0;

    for(int i=0;i<N.length-1;i++){
      if(!N[i].equals(N[i+1])){
          count++;
      }
    }
      System.out.println(count+1);
  }
}

Measured memory_bytes: 34132
#include <iostream>
#include <string>
using namespace std;
int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a>c){
        swap(a,c);
        swap(b,d);
    }

    if(b>c){
        if(b>d)cout<<d-c<<endl;
        else cout<<b-c<<endl;
    }
    else cout<<0<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MAX_INT 2100000000
#define rep(i,n) for (i=1;i<=(n);++i)
using namespace std;
typedef long long int ll;
#ifdef COMPILE_IN_VCPP
#include <windows.h>
HWND GetConsoleHwnd(void)
{
#define MY_BUFSIZE 1024 // Buffer size for console window titles.
	HWND hwndFound;         // This is what is returned to the caller.
	char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated// WindowTitle.
	char pszOldWindowTitle[MY_BUFSIZE]; // Contains original// WindowTitle.
	ULARGE_INTEGER nt;
	nt.QuadPart = GetTickCount64();
	GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
	wsprintf(pszNewWindowTitle, "%d%d/%d", nt.HighPart, nt.LowPart, GetCurrentProcessId());
	SetConsoleTitle(pszNewWindowTitle);
	Sleep(40);
	hwndFound = FindWindow(NULL, pszNewWindowTitle);
	SetConsoleTitle(pszOldWindowTitle);
	return(hwndFound);
}
#endif
ll mod = 1e9 + 7;
/* CELEBW23 */
#include <stdio.h>                                                              
#include <wchar.h>                                                              

int main(void)
{
	static int n, b[110], ans = 0, i, j, k;
	cin >> n;
	for (i = 2; i <= n; i++)
	{
		cin >> b[i];
	}
	b[1] = b[2];
	b[n + 1] = b[n];
	for (i = 1; i <= n; i++)
	{
		ans += min(b[i], b[i + 1]);
	}
	cout << ans << endl;
}

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

int done[100000];
vector< vector<int> > g;
vector< vector<int> > g_c;
int bfs(int x){
	queue<int> Q;
	vector<int> vec;
	Q.push(x);
	while(Q.size()){
		int q = Q.front(); Q.pop();
		if( done[q] ) continue;
		else done[q] = true;
		for(int i = 0 ; i < g[q].size() ; i++){
			Q.push(g[q][i]);
			vec.push_back(g_c[q][i]);
		}
	}
	//cout << x << " " << vec.size() << endl;
	sort(vec.begin(),vec.end());
	int answer = 0;
	for(int i = 0 ; i < vec.size() ; i++){
		if( vec[i] == vec.back() ) answer++;
	}
	return answer/2;
}


int main(){
	int n;
	while(cin >> n && n){
		for(int i = 0 ; i < 100000 ; i++)
			done[i] = 0;
		g.clear();
		g_c.clear();
		g.resize(n);
		g_c.resize(n);
		for(int i = 0 ; i < n ; i++){
			
			for(int j = 0 ; j < 2 ; j++){
				int a,b;
				cin >> a >> b;
				g[i].push_back(a);
				g_c[i].push_back(b);
			}
		}
		long long ans = 1;
		for(int i = 0 ; i < n ; i++){
			if( done[i] == 0 ){
				ans *= bfs(i);
				ans %= 10007;
			}
		}
		cout << ans << endl;
		
		
	}
}

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

typedef long long int ll;
#define pb push_back
#define ff first
#define ss second
#define INF 1999999999
#define MODA 1000000007
#define PI 3.1415926535897932384626433
//cout << fixed << setprecision(2);


int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll a, ans;
    long double b;
    cin >> a >> b;
    ans = a * b;
    cout << ans << endl;
    return 0;
}


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

int main(){
    int n,a,b;
    cin>>n>>a>>b;
    vector<int>v;
    for(int i=0;i<=n;i++){
        int temp=0;
        int x=i;
        while(x>0){
            int r=x%10;
            x=x/10;
            temp+=r;
        }
        if(temp>=a && temp<=b)v.push_back(i);
    }
    int sum=0;
    for(int i=0;i<v.size();i++)sum+=v[i];
    cout<<sum;
}

Measured memory_bytes: 384
#include"stdio.h"
int main(){
    char a[101],b[101];
    scanf("%s %s",a,b);
    int cnt_a=0,cnt_b=0,i;
    while(a[cnt_a]!='\0')  cnt_a++;
    while(b[cnt_b]!='\0')  cnt_b++;
    if(cnt_a>cnt_b){
        printf("GREATER\n");
    }else if(cnt_a<cnt_b){
        printf("LESS\n");
    }else{
        for( i=0;i<cnt_a;i++){
            if(a[i]>b[i]){
                printf("GREATER\n");
                break;
            }else if(a[i]<b[i]){
                printf("LESS\n");
                break;
            }
        }
        if(i==cnt_a) printf("EQUAL\n");
    }
}


Measured memory_bytes: 1660
#include<stdio.h>

const int mod = 1000000007;

int main(){
  int H, W, K;
  scanf("%d %d %d", &H, &W, &K);
  
  int num_of_amida[H + 1][W];
  for(int i = 0; i <= H; i++) for(int j = 0; j < W; j++) num_of_amida[i][j] = 0;
  num_of_amida[0][0] = 1;
  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      for(int b = 0; b < (1 << (W - 1)); b++){
        int valid = 1;
        for(int l = 0; l < W - 2; l++){
          if((b & (1 << l)) && (b & (1 << (l + 1)))){
            valid = 0;
            break;
          }
        }
        if(!valid) continue;
        
        if(j > 0 && (b & (1 << (j - 1)))){
          num_of_amida[i + 1][j - 1] += num_of_amida[i][j];
          num_of_amida[i + 1][j - 1] %= mod;
        }else if(j < W - 1 && (b & (1 << j))){
          num_of_amida[i + 1][j + 1] += num_of_amida[i][j];
          num_of_amida[i + 1][j + 1] %= mod;
        }else{
          num_of_amida[i + 1][j] += num_of_amida[i][j];
          num_of_amida[i + 1][j] %= mod;
        }
      }
    }
  }
  
  printf("%d", num_of_amida[H][K - 1] % mod);
  
  return 0;
}

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

int main() {
	string s;
	cin >> s;
	
	if (s.length() % 2 != 0) {
		cout << "No" << endl;
		return 0;
	}
	
	for (int i = 0; i < s.length(); i += 2) {
		if (s[i] != 'h' || s[i + 1] != 'i') {
			cout << "No" << endl;
			return 0;
		}
	}
	
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 764
import fractions
n,x = [int(x) for x in input().split()]
X = [int(x) for x in input().split()]
X.append(x)
X.sort()

x_diff = [int(X[i+1] - X[i]) for i in range(n)]

ans = x_diff[0]
for y in range(1,n):
    ans = fractions.gcd(ans, x_diff[y])

print(ans)

Measured memory_bytes: 16280
module Main (main) where

import qualified Data.ByteString.Char8 as C8
import Data.Maybe

main :: IO ()
main = readInts >>= print . solve

solve [a,b]
  | b == 1 = 0
  | a > b  = 1
  | otherwise = q + signum r + 1
  where
    (q,r) = (b-a) `divMod` (a-1)

-- utils
readInts :: IO [Int]
readInts = map (fst . fromJust . C8.readInt) . C8.words <$> C8.getLine

Measured memory_bytes: 380
#include<cstdio>
#include<iostream>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<deque>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<limits>
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef unsigned long long ull;
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 T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
inline                                              void out(double p){printf("%.10f\n",p);}
template<class T>inline                             void outs(T p){for_each(all(p),out<decltype(p[0])>);}
template<class T>inline void outs(vector<T> V){int n=V.size();rep(i,n)cout<<V[i]<<" \n"[i==n-1];}
//const long mod=(long)1e9+7;
inline void solve(void){
  int N,K;in(N,K);
  vector<int>A(N);ins(A);
  if(N<=K){
    out(0);
    return;
  }
  ull ans=0;
  sort(all(A));
  rep(i,N-K)ans+=A[i];
  out(ans);
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 1024
k = int(input())

d = {1:1, 2:1, 3:1, 4:2, 5:1, 6:2, 7:1, 8:5,9:2, 10:2, 11:1, 12:5, 13:1, 14:2, 15:1, 16:14, 17:1, 18:5, 19:1, 20:5, 21:2, 22:2, 23:1, 24:15, 25:2, 26:2, 27:5, 28:4, 29:1, 30:4, 31:1, 32:51}

print(d[k])


                
                
                              
                           
                                  

Measured memory_bytes: 3064
#include <iostream>
#include <utility>

using namespace std;

int t1, t2, r1, r2;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> t1 >> t2 >> r1 >> r2;
	if(r1 == -1 || r2 == -1){
		r1 = -t1, r2 = -t2;
	}
	
	if(r1 > r2){
		cout << "Alice" << endl;
	}
	else if(r1 < r2){
		cout << "Bob" << endl;
	}
	else cout << "Draw" << endl;
	
	return 0;
}


Measured memory_bytes: 3212
#include <bits/stdc++.h>
using namespace std;
struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20);} } fast;


int main() {
    int n, st = 0, sh = 0;
    cin >> n;
    string t, h;
    for (int i = 0; i < n; i++){
        cin >> t >> h;
        if (t < h){
            sh += 3;
        }
        if (t == h){
            st += 1;
            sh += 1;
        }
        if  (h < t){
            st += 3;
        }
    }
    cout << st << " " << sh << endl;
}


Measured memory_bytes: 3244
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<string>
#include<vector>
using namespace std;

int main(void){
	int a, b;
	cin >> a >> b;
	if (a % 2 == 0 || b % 2 == 0) {
		cout << "Even";
	}
	else {
		cout << "Odd";
	}

	return 0;
}

Measured memory_bytes: 256
import itertools
def sol():
    n=int(input())
    d=list(itertools.permutations([i for i in range(n)]))
    w=[]
    for i in range(n):
        x,y=map(int,input().split())
        w.append((x,y))
    ans=chk=0
    for i in d:
        for j in range(len(i)-1):
            ans+=((w[i[j]][0]-w[i[j+1]][0])**2+(w[i[j]][1]-w[i[j+1]][1])**2)**0.5
    print(ans/len(d))

if __name__=="__main__":
    sol()


Measured memory_bytes: 45168
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

bool isPrime(ll x){
	for(ll i = 2; i*i<=x; i++){
		if(x%i==0) return false;
	}
	return true;
}

int main(){
	ll x;
	cin>>x;
	ll res = 1;
	for(ll i = 2; i <= x; i++){
		if(!isPrime(i)) continue;
		ll cnt = 0;
		for(ll j = i; j <= x; j*=i){
			cnt += x/j;
		}
		(res*=cnt+1)%=mod;
	}
	cout<<res<<endl;
	return 0;
}


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

int main(){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<max(max(a*c, b*d), max(a*d, b*c))<<endl;
    return 0;
}

Measured memory_bytes: 3628
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <queue>
#include <set>

using namespace std;

#define MOD 1000000007

long long int intpow(int base, int p)
{
	if (0 == p) return 1;

	if (0 == p % 2){
		long long int val = intpow(base, p / 2);
		return (val*val) % MOD;
	}
	else{
		return (intpow(base, p - 1)*base) % MOD;
	}
}

long long int comb(int n, int k)
{
	if (0 == k){
		return 1;
	}

	return (((comb(n - 1, k - 1)*(long long int)n) % MOD) * intpow(k, MOD - 2)) % MOD;
}

void solv()
{
	int X, Y; scanf("%d%d", &X, &Y);

	if (0 != (X + Y) % 3 || X * 2 < Y || Y * 2 < X){
		printf("0");
		return;
	}

	int n, k;
	n = (X + Y) / 3;
	k = n * 2 - X;
	printf("%lld", comb(n, k));

	return;
}

int main()
{
	FILE *fin = NULL, *fout = NULL;
	//fin = freopen("input.txt", "r", stdin);
	//fout = freopen("output.txt", "w", stdout);

	solv();

	//finalize
	if (NULL != fin) fclose(fin);
	if (NULL != fout) fclose(fout);

	return 0;
}

Measured memory_bytes: 13312
#include<cstdio>
typedef long long ll;
int n;
int isEven;
ll ans=1;
int main(){
	scanf("%d",&n);
	for(int i=1,x;i<=n;i++){
		scanf("%d",&x);
		if(!(x&1)) isEven++;
		ans*=3;
	}
	ll tmp=1;
	while(isEven--) tmp*=2;
	printf("%I64d",ans-tmp);
	return 0;
}

Measured memory_bytes: 128
#include "stdio.h"

int main() {

	int i,sum[26];
	char s, a[53] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	for (i = 0; i < 26; i++) {
		sum[i] = 0;
	}

	while (scanf("%c", &s) != EOF) {
		for (i = 0; i < 53; i++) {
			if (a[i] == s) {
				sum[i % 26]++;
			}
		}
	}


	for (i = 0; i < 26; i++) {
		printf("%c : %d\n", a[i], sum[i]);
	}
	return 0;
}


Measured memory_bytes: 2128
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>

using namespace std;

long long MOD = 1000000007;

int main(){
    int X, Y;
    cin >> X >> Y;

    int ans=0;
    if(X==1 && Y==1){
        ans=400000+2*300000;
    }else{
        ans=max(4-X,0)*100000+max(4-Y,0)*100000;
    }
    cout << ans << endl;
}

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

using namespace std;

int main() {
  vector<int> a(26, 0), b(26, 0);
  int N;
  cin >> N;
  string S;
  cin >> S;
  int maxCnt = 0;
  for (int i = 0; i < N; ++i) {
    int cnt = 0;
    for (int j = 0; j < i; ++j) {
      a[(int)S[j] - (int)'a']++;
    }
    for (int j = i; j < N; ++j) {
      b[(int)S[j] - (int)'a']++;
    }
    for (int j = 0; j < 26; ++j) {
      if (a[j] != 0 && b[j] != 0) {
	cnt++;
      }
      a[j] = 0;
      b[j] = 0;
    }
    maxCnt = max(maxCnt, cnt);
  }

  cout << maxCnt << endl;
  return 0;
}



Measured memory_bytes: 256
# coding:utf8
from collections import  Counter
import numpy as np

a,b,x=map(int,input().split())
t=a*a*b
ct=t/2

ans=0

if ct>=x:
    g=(a*b*b)/(2*x)
    h=a*a*b/(2*x)
    g=np.arctan(g)*180.00/np.pi

    ans=g
else:
    q=2*b/a-(2*x/a/a/a)
    r=2-(2*x/a/a/b)
    q=np.arctan(q)*180.00/np.pi

    ans=q

print(ans)




Measured memory_bytes: 12496
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def main():
    a,s,b = input().split()
    print("A"+s[0]+"C")
    return

if __name__=='__main__':
    main()

Measured memory_bytes: 38636
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 素因数, ...]の1次元リスト"""
"""12 => [2, 2, 3]"""
def factorizeFlat(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                arr.append(i)
                temp //= i

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)

    return arr


x = int(input())
n = len(factorizeFlat(x))
while n > 1:
    x += 1
    n = len(factorizeFlat(x))
print(x)


Measured memory_bytes: 3188
#include <algorithm>
#include <bitset>
#include <cfloat>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define ll long long
#define eps LDBL_EPSILON
#define mod 1000000007
#define double long double
#define INF LLONG_MAX/10
#define P pair<int,int>
#define prique priority_queue
using namespace std;
signed main() {
	int a, b, c;
	cin >> a >> b >> c;
	c -= a - b;
	cout << max((ll)0, c) << endl;
	return 0;
}

Measured memory_bytes: 256
from itertools import combinations
from collections import defaultdict

n = int(input())

xy = [0] * n
for i in range(n):
    xy[i] = list(map(int, input().split()))

conter = defaultdict(int)
for com in combinations(range(n), 2):
    x1, y1 = xy[com[0]]
    x2, y2 = xy[com[1]]
    conter[(x2-x1, y2-y1)] += 1
    conter[(x1-x2, y1-y2)] += 1

ans = 0
for k, v in conter.items():
    ans = max(ans, v)

print(n - ans)


Measured memory_bytes: 3828
import java.util.*;
public class Main {

	    public static void main(String[] args) throws java.io.IOException{
	        Scanner scan = new Scanner(System.in);
	        while(scan.hasNext()){
	        	
	        	int n=scan.nextInt();
	        	int pre = n%39;
	        	if(pre==0)pre=39;
	        	System.out.printf("3C%02d\n",pre);
	        	
	        }
	    }
}
	    

Measured memory_bytes: 12000
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;





int main(){
    ll n;
    cin>>n;
    string s,t;
    cin>>s>>t;
    ll mx=0;
    for(int i=1;i<=n;i++){
        bool judge=true;
        for(int j=0;j<i;j++){
            if(s[n-i+j]!=t[j]){judge=false;}
        }
        if(judge){mx=i;}
    }
    cout<<2*n-mx<<endl;
    
    
    return 0;
}


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

int main() {
	
	int n, cnt=0;
	cin >> n;
	vector<int> a(n), b(n), c(n-1);
	for(auto &i : a) cin >> i;
	for(auto &i : b) cin >> i;
	for(auto &i : c) cin >> i;
	for(int i=0; i<n; i++){
		cnt+=b.at(a.at(i)-1);
		if(i==n-1) break;
		if(a.at(i)+1==a.at(i+1)) cnt+=c.at(a.at(i)-1);
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
#define toupper(S) transform(S.begin(),S.end(),S.begin(),toupper)
#define tolower(S) transform(S.begin(),S.end(),S.begin(),tolower)

lint sumrank(lint n) {
	//各位の和を返す
	string s = to_string(n);
	lint ret = 0;
	for (int i = 0; i < s.size(); i++)ret += (s[i] - '0');
	return ret;
}

int main() {
	lint N;
	cin >> N;
	lint ans = 1000000;
	for (lint i = 1; i < N; i++) {
		ans = min(ans, sumrank(i)+sumrank(N-i));
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int n,sum=0;
	string s;
	cin>>n;
	cin>>s;
	vector<long long int> a(3,0);
	for(int i=0;i<s.length();i++){
		if(s[i]=='R')
		a[0]++;
		else if(s[i]=='G')
		a[1]++;
		else a[2]++;
	}
	sum=a[0]*a[1]*a[2];
	for(int i=0;i<n;i++){
		for(int k=i+2;k<n;k++){
			if(((i+k)/2)==((i+k)/2.0)){
				if((((i+k)/2)!=i)&&(((i+k)/2)!=k)&&(s[(i+k)/2]!=s[i])&&(s[(i+k)/2]!=s[k])&&(s[i]!=s[k])){
					sum--;
				}
			}
		}
	}
	cout<<sum<<endl;
}

Measured memory_bytes: 3632
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		Integer[] m = new Integer[N];
		int M = 0;
		for (int i=0; i<N; i++) {
			m[i] = sc.nextInt();
			M += m[i];
		}
		Arrays.sort(m);
		int S = m[0];
		int res = N + (X-M)/S;
		System.out.println(res);
	}
}


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

using namespace std;

#define int long long

const int N = 2007;

int dp[N][N], val[N], pos[N];
pair<int,int> a[N];

signed main(){
    int n;
    cin >> n;
    for(int i=1;i<=n;++i){
        cin >> a[i].first;
        a[i].second = i;
    } 
    sort(begin(a)+1,begin(a)+n+1);
    reverse(begin(a)+1,begin(a)+n+1);

    for(int i=1;i<=n;++i) tie(val[i],pos[i]) = a[i];

    for(int l=0;l<=n;++l){
        for(int r=0;r<=n;++r){
            int s = l+r+1;
            if(s>n) break;
            dp[l+1][r] = max(dp[l+1][r],dp[l][r]+val[s]*abs(pos[s]-(l+1)));
            dp[l][r+1] = max(dp[l][r+1],dp[l][r]+val[s]*abs(pos[s]-(n-r)));
        }
    }
    int ans = 0;
    for(int i=0;i<=n;++i) ans = max(ans,dp[i][n-i]);
    cout << ans;
}

Measured memory_bytes: 26348
import sys

# import re
# import math
# import collections
# import decimal
# import bisect
# import itertools
# import fractions
# import functools
# import copy
# import heapq
# import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()
    a = na()

    d = [0, 0, 0]

    ans = 1
    for ai in a:
        ans *= d.count(ai)
        ans %= MOD
        for i in range(3):
            if d[i] == ai:
                d[i] += 1
                break

    print(ans)


if __name__ == '__main__':
    main()


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

namespace ABC127_A
{
    class Program
    {
        static void Main(string[] args)
        {
            var AB = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var A = AB[0];
            var B = AB[1];

            Console.WriteLine(A<=5?0:A<=12?B/2:B);

        }
    }
}


Measured memory_bytes: 13268
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
//#include <bits/stdc++.h>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()

typedef long long ll;

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

string yn(bool x){
    return x ? "YES" : "NO";
}

int main(){
    int a,b; cin >> a >> b;
    
    if(a*b %2 == 0) cout << "No" << endl;
    else cout << "Yes" << endl;
}






Measured memory_bytes: 256
from collections import Counter
from operator import itemgetter

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

B = Counter(A)
B = list(B.items())
B1 = sorted(B,key=itemgetter(1),reverse = True) 

ans = 0
for i in range(len(B1)):
    if B1[i][1] % 2 != 0:
        ans +=1
print(ans)

Measured memory_bytes: 20472
#include "iostream"
#include "algorithm"
using namespace std;

int main() {
  int n;
  cin >> n;
  int a[100100];
  for (int i = 0; i < n; i++) cin >> a[i];
  int even[100100] = {0};
  int odd[100100] = {0};
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) even[a[i]]++;
    else odd[a[i]]++;
  }
  int max_e = 0;
  int max_o = 0;
  int c, d;
  int sec_e = 0;
  int sec_o = 0;
  for (int i = 0; i < 100100; i++) {
    if (max_e < even[i]) {
      max_e = even[i];
      c = i;
    }
    if (max_o < odd[i]) {
      max_o = odd[i];
      d = i;
    }
  }
  if (c != d) cout << n - max_e - max_o << endl;
  else {
    for (int i = 0; i < 100100; i++) {
      if (sec_e < even[i] && i != c) sec_e = even[i];
      if (sec_o < odd[i] && i != d) sec_o = odd[i];
    }
    cout << min({n - max_e - sec_o, n - sec_e - max_o}) << endl;
  }
}

Measured memory_bytes: 1408
#D
import math
N = int(input())
fact = []
n2 = math.ceil(math.sqrt(N))
n = N
for i in range(n2):
    I = i+1
    if I == 1:
        continue
    flag = 0
    if N%I == 0:
        flag = 1
    count = 0
    while N%I == 0:
        N = N//I
        count+=1
    if flag == 1:
        fact.append([I,count])
    
if N != 1:
    fact.append([N,1])
#print(fact)
    
ans = n
for f in fact:
    p,c = f
    ans*=(1-1/p)
    
print(int(ans))



Measured memory_bytes: 5672
#include <bits/stdc++.h>
#define ll          long long
#define int 		long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define ff           first
#define ss           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;

void solve(){
	//write here
	int temp;
	cin>>temp;
	if (temp>=30)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return;
}

int32_t main(){
	cin.tie(NULL);
	ios::sync_with_stdio(false);
	//insert code
	
		solve();
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <algorithm>
typedef long long lint;
const int N=1e5+5;
int n,val[N];

namespace utils{
	template <class T> inline void apn(T &x,const T y){x>y?x=y:0;}
	template <class T> inline void apx(T &x,const T y){x<y?x=y:0;}
	inline int nxi(){
		int x=0;
		char c;
		while(((c=getchar())>'9'||c<'0')&&c!='-');
		const bool f=(c=='-')&&(c=getchar());
		while(x=x*10-48+c,(c=getchar())>='0'&&c<='9');
		return f?-x:x;
	}
}
using namespace utils;

int main(){
	n=nxi();
	for(int i=1; i<=n; ++i){
		val[i]=nxi();
	}
	std::sort(val+1,val+n+1);
	int r1=0,r2=0;
	for(int i=n,s=-1,r=n+1; (!r1||!r2)&&i>=1; --i){
		if(val[i]!=s) r=i,s=val[i];
		if(i<r){
			r-=2;
			if(r1) r2=val[i];
			else r1=val[i];
		}
	}
	printf("%lld\n",(lint)r1*r2);
	return 0;
}


Measured memory_bytes: 640
#!/usr/bin/env python
from collections import defaultdict, deque
import math
from math import factorial
import fractions
import re
import bisect

BIGNUM = 10 ** 9 + 7

def main():
    K, X = map(int, input().split())
    #N = int(input())
    #Hs = list(map(int, input().split()))

    left = max([X-K+1, -2000000])
    right = min([X+K-1, 2000000])

    nums = list(range(left, right+1))

    print(" ".join(map(str, nums)))


if __name__ == '__main__':
    main()


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

int kazoeage(int now, int sum, int res)
{
    if (res == 0)
        return sum + 1;

    if (now == 1)
        sum = kazoeage(0, sum, res - 1);
    else
    {
        sum = kazoeage(0, sum, res - 1);
        sum = kazoeage(1, sum, res - 1);
    }
    return sum;
}

int memo[10];
int pat(int num)
{
    if (num < 0)
        num = 0;
    if (memo[num] != -1)
    {
        return memo[num];
    }
    else
    {
        memo[num] = kazoeage(0, 0, num);
        return memo[num];
    }
}

signed main()
{
    int H, W, K;
    cin >> H >> W >> K;

    REP(i, 10)
    memo[i] = -1;

    int a[10], tmp[10];
    a[1] = 1;
    FOR(i, 2, W + 1)
    a[i] = 0;

    int num;
    FOR(i, 1, H + 1)
    {
        REP(i, 10)
        tmp[i] = 0;

        FOR(j, 1, W + 1)
        {
            //左に行く
            if (j != 1 and j - 1 >= K - (H - i))
            {
                num = a[j];
                if (j - 1 == 1 or j == W)
                {
                    num *= pat((W - 1) - 2);
                }
                else
                {
                    num *= pat(j - 3);
                    num *= pat((W - 1) - (j - 3) - 3);
                }
                tmp[j - 1] += num;
                tmp[j - 1] %= MOD;
            }
            //下に行く
            if (j >= K - (H - i) and j <= K + (H - i))
            {
                num = a[j];
                if (j == W or j == 1)
                {
                    num *= pat((W - 1) - 1);
                }
                else
                {
                    num *= pat(j - 2);
                    num *= pat((W - 1) - (j - 2) - 2);
                }
                tmp[j] += num;
                tmp[j] %= MOD;
            }

            //右に行く
            if (j != W and j + 1 <= K + (H - i))
            {
                num = a[j];
                if (j + 1 == W or j == 1)
                {
                    num *= pat((W - 1) - 2);
                }
                else
                {
                    num *= pat(j - 2);
                    num *= pat((W - 1) - (j - 2) - 3);
                }
                tmp[j + 1] += num;
                tmp[j + 1] %= MOD;
            }
        }
        REP(j, 10)
        a[j] = tmp[j];
    }

    cout << a[K] << endl;

    // system("pause");
}

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }
    else{
      x = x->right;
    }
  }

  z->parent = y;
  if(y == NIL){
    root = z;
  }
  else{
    if(z->key < y->key){
      y->left = z;
    }
    else{
      y->right = z;
    }
  }

}

void inorder(Node u){
  if(u == NIL)return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(Node u){
  if(u == NIL)return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if(strcmp(com,"insert") == 0){
      scanf("%d",&x);
      insert(x);
    }
    else if(strcmp(com,"print") == 0){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }

  return 0;
}



Measured memory_bytes: 25132
#include <iostream>
#include <vector>

const int N = 1e9 + 7;

long solve(int s) {
  std::vector<long> a(s + 1, 1);
  if (s < 3)
    return 0;
  if (s < 6)
    return 1;

  a.at(1) = 0;
  a.at(2) = 0;
  a.at(3) = 1;
  a.at(4) = 1;
  a.at(5) = 1;

  for (int i = 6; i <= s; ++i)
    a.at(i) = (a.at(i - 1) + a.at(i - 3)) % N;

  return a.at(s);
}

int main() {
  int s;
  std::cin >> s;
  std::cout << solve(s) << std::endl;
}


Measured memory_bytes: 3156
S = input()
f = int(S[:2])
g = int(S[2:])
yymm = False
mmyy = False
if f >= 1 and f <= 12:
  mmyy = True
if g >= 1 and g <= 12:
  yymm = True
if yymm:
  if mmyy:
    print("AMBIGUOUS")
  else:
    print("YYMM")
else:
  if mmyy:
    print("MMYY")
  else:
    print("NA")



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

using namespace std;

#define ll long long int

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

    int num=1;
    int count=0;

    while(num<b){
        num-=1;
        num+=a;
        count++;
    }

    cout << count << endl;

}

Measured memory_bytes: 256
procedure quickly_sort(var a:array of longint;l,r:longint);inline;
var i,j,x,y:longint;
begin
  while true do
  begin
    if r<l+74 then
      exit;
    i:=l;j:=r;
    x:=a[(l+r)>>1];
    repeat
      while a[i]<x do inc(i);
      while x<a[j] do dec(j);
      if not(i>j) then
      begin
        y:=a[i];a[i]:=a[j];
        a[j]:=y;inc(i);dec(j);
      end;
    until i>j;
    if l<j then quickly_sort(a,l,j);
    if not(i<r) then
      exit;
    l:=i;
  end;
end;
procedure sort(var a:array of longint;l,r:longint);inline;
var i,j,t:longint;
begin
  if r>l then
  begin
    quickly_sort(a,l,r);
    i:=l;
    for i:=l to r do
    begin
      j:=i; 
      while j>pred(l) do
        if a[j]<a[pred(j)] then
        begin
          t:=a[pred(j)];a[pred(j)]:=a[j];a[j]:=t;
          dec(j);
        end
        else
          break;
    end;
  end;
end;
var a:array[0..10000]of longint;
    n,k,sum,i:longint;
begin
  readln(n,k);
  for i:=1 to n do
    read(a[i]);
  sort(a,1,n);
  for i:=n downto n-k+1 do
    inc(sum,a[i]);
  writeln(sum);
end.

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		int L = sc.nextInt();
		int R = sc.nextInt();
		int d = sc.nextInt();

		int ans = 0;

		for (int i = L; i <= R; i++) {

			if (i % d == 0) {
				ans++;
			}

		}
		System.out.println(ans);

	}

}


Measured memory_bytes: 26916
import java.util.Scanner;

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

        int n = sc.nextInt();
        int[] a = new int[n];
        double ans = 0;

        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
            ans += 1.0 / a[i];
        }

        System.out.println(1.0 / ans);
    }
}

Measured memory_bytes: 24276
A, B, C = map(int, input().split())

if A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
    print(0)

else:
    if A >= B and A >= C:
        print(B * C)

    elif B >= C:
        print(A * C)

    else:
        print(A * B)

Measured memory_bytes: 9092
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <cassert>
#include <random>
#include <time.h>
#include <unordered_set>
// #include <boost/multiprecision/cpp_int.hpp>



using namespace std;
using Int = long long;
// using namespace boost::multiprecision;

const double EPS = 1e-10;
long long const MOD = 1000000007;

typedef vector<int> vec;
typedef vector<vec> mat;

long long mod_pow(long long x, long long n) {
    long long res = 1;
    for (int i = 0;i < 60; i++) {
        if (n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

long long my_mod_pow(long long x, long long n) {
	long long ret = 1;
	for (; n > 0; n >>= 1, x = x * x % MOD) {
		if (n & 1) {
			ret = ret * x % MOD;
		}
	}
	return ret;
}

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

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

void fastInput() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}


int main(void) {
    Int N, D, A; cin >> N >> D >> A;
    vector<Int> X(N);
    vector<Int> H(N);

    vector<pair<Int, Int>> input(N);
    for (int i = 0; i < N; i++) {
        cin >> input[i].first >> input[i].second;
    }
    sort(input.begin(), input.end());
    for (int i = 0; i < N; i++) {
        X[i] = input[i].first;
        H[i] = input[i].second;
    }

    Int damage_sum = 0;
    Int ans = 0;
    vector<pair<Int, Int>> vp;
    int vp_pointer = 0;
    for (int i = 0; i < N; i++) {
        while (vp_pointer != vp.size() && vp[vp_pointer].second + D < X[i]) {
            damage_sum -= vp[vp_pointer].first;
            vp_pointer++;
        }
        H[i] -= damage_sum;
        if (H[i] <= 0) continue;
        ans += (H[i]+A-1) / A;
        damage_sum += A * ((H[i]+A-1) / A);
        vp.push_back({A * ((H[i]+A-1) / A), X[i] + D});
    }
    cout << ans << endl;
}

Measured memory_bytes: 12400
#include <iostream>

using namespace std;

int main() {
    int H, N;
    cin >> H >> N;
    int S=0;
    for(int n=0; n<N; n++) {
        int s;
        cin >> s;
        S += s;
    }
    
    if(H>S) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
    }



    return 0;
    
}

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

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

int main() {
  int n, k;
  cin >> n >> k;
  ll h[n];
  ll dp[n];

  rep(i, n) { cin >> h[i]; }
  rep(i, n) { dp[i] = INF; }

  dp[0] = 0;

  for (int i = 1; i < n; i++) {
    for (int j = 1; j < k + 1; j++) {
      if (i >= j) {
        chmin(dp[i], dp[i - j] + abs(h[i] - h[i - j]));
      }
    }
  }
  cout << dp[n - 1] << endl;
  return 0;
}


Measured memory_bytes: 1792
/* << IN THE NAME OF GOD >> */
#include <bits/stdc++.h>
using namespace std;



#define err(x) cerr << #x  << " = "<<  x << '\n'
#define out(x) cout << x << '\n'
#define forp(i, r, l) for(int i = int(r); i < int(l); i++)
#define forn(i, r, l) for(int i = int(r); i > int(l); i--)
#define FAST ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll ,ll> pll;
const int maxn = 1e5 + 120;
 
int n;
bool a ,b ,c;
int main(){FAST;
    cin >> n;

    int x  = n/100 ,y = n%100;

    if(n >= 100 && n <= 1299) b = 1;
    if(y <= 12 && y)         c = 1;

    if(b && c) cout << "AMBIGUOUS";
    else if(c) cout << "YYMM" ;
    else if(b) cout << "MMYY" ;
    else cout << "NA";  
 
   return 0;
}
 












Measured memory_bytes: 256
package main

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

func ceil(a interface{}) float64 {
	if a, ok := a.(int); ok {

		return math.Ceil(float64(a))
	}
	if a, ok := a.(float64); ok {
		return math.Ceil(float64(a))
	}
	return 0
}

func main() {
	var scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	var A, B int
	if scanner.Scan() {
		A, _ = strconv.Atoi(scanner.Text())
	}
	if scanner.Scan() {
		B, _ = strconv.Atoi(scanner.Text())
	}
	var ans int
	if (B-1)%(A-1) == 0 {
		ans = (B - 1) / (A - 1)
	} else {
		ans = (B-1)/(A-1) + 1
	}

	fmt.Println(ans)
	os.Stdout.Sync()
	/*
		var wtr = bufio.NewWriter(os.Stdout)
		fmt.Fprintln(wtr, ans)
		_ = wtr.Flush()
	*/
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pb push_back
const ll mod = 998244353;
const int N = 2e5+5;
const int M = 1e9+7;
int a[N];
int lst[N];
ll iv[N], f1[N], f2[N];
ll nck(int n, int k){
    if(k>n)return 0;
	return f1[n]*f2[k]%M*f2[n-k]%M;
}
void solve(){
    iv[1]=1;
	for(int i=2; i<N; ++i)
		iv[i]=M-M/i*iv[M%i]%M;
	f1[0]=f2[0]=1;
	for(int i=1; i<N; ++i) {
		f1[i]=f1[i-1]*i%M;
		f2[i]=f2[i-1]*iv[i]%M;
	}
    int n;
    cin>>n;
    int del = -1;
    for(int i=0;i<=n;i++){
        int x;
        cin>>x;
        a[x]++;
        if(a[x]==2){
            del = n-i+lst[x];
        }
        lst[x] = i;
    }
    assert(del>=0);
    for(int i=0;i<=n;i++){
        int trt = nck(n+1,i+1);
        trt = ((trt-nck(del,i))%M+M)%M;
        cout<<trt<<endl;
    }
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
//    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 9032
#include "bits/stdc++.h"
using namespace std;

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int price = 0;
    if (a<b) price += a;
    else price += b;
    if (c<d) price += c;
    else price += d;
    cout << price << endl;
}

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

using namespace std;

int main(void)
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    int ans = 0;
    if (B <= C || D <= A)
    {
        ans = 0;
    }
    else if (A <= C)
    {
        if (B <= D)
        {
            ans = B - C;
        }
        else
        {
            ans = D - C;
        }
    }
    else
    {
        if (B <= D)
        {
            ans = B - A;
        }
        else
        {
            ans = D - A;
        }
    }

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

Measured memory_bytes: 256