akhauriyash/Code-Regression huggingface dataset:
/**
class cfmaster {
 public:
  struct code {
  	see the details down there !
  };
};
**/
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b, c;
  cin >> a >> b >> c;
  if (a == b && a != c || a != b && b == c || a == c && a != b) {
    cout << "Yes" << '\n';
    return 0;
  }
  cout << "No" << '\n';
  return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

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

		Boolean x = a % 2 == 0;
		Boolean y = b % 2 == 0;

		if (x || y) {
			System.out.println("Even");
		} else {
			System.out.println("Odd");
		}

	}
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int P[101010];
int ask(int X) {
	string S;
	cout<<X<<endl;
	/*
	if(P[X]>=0) {
		if(P[X]==2) exit(0);
		return P[X];
	}
	*/
	cin>>S;
	if(S=="Vacant") exit(0);
	if(S=="Male") return P[X]=0;
	return P[X]=1;
}

void hoge(int L,int R) {
	if(L+1==R) ask(L);
	
	int M=(L+R)/2;
	ask(M);
	
	if((P[M]==P[L])==(L%2==M%2)) {
		hoge(M,R);
	}
	else {
		hoge(L,M);
	}
	
}


void solve() {
	int i,j,k,l,r,x,y; string s;
	
	MINUS(P);
	cin>>N;
	/*
	cin>>N>>x>>y;
	P[x]=2;
	FOR(i,N-1) {
		P[(x+1+i)%N]=y;
		y^=1;
	}
	*/
	ask(0);
	hoge(0,N);
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 1236
#include<stdio.h>

int cnt;
void InsertionSort(int* a, int n, int g){
	int i,j,key;
	for(i=1;i<n;i++){
		key=a[i];
		j=i-g;
		while(j>=0 && a[j]>key){
			a[j+g]=a[j];
			j-=g;
			cnt++;
		}
		a[j+g]=key;
	}
}

void ShellSort(int* a, int n){
	int i;	int m=1;
	int G[100];
	G[1]=n;
	while(1){
		++m;
		G[m]=G[m-1]/3;
		//printf("G[%d]=%d\n",m,G[m]);
		if(G[m]<=1){
			//printf("ERROR: G[%d]=%d\n",m,G[m]);
			G[m]=1;
			break;
		}
	}
		printf("%d\n",m);

	for(i=1;i<=m;i++){
		if(i>1)printf(" ");
		printf("%d",G[i]);
	}printf("\n");
	cnt=0;
	for(i=1;i<=m;i++){
		if(G[i]<=n)InsertionSort(a,n,G[i]);
	}
	printf("%d\n",cnt);
}

int main(){
	int i,n;	scanf("%d",&n);
	int array[1000000];
	for(i=0;i<n;i++)scanf("%d",&array[i]);
	ShellSort(array, n);

	for(i=0;i<n;i++){
		printf("%d\n",array[i]);
	}


	return 0;
}



Measured memory_bytes: 6512
// 🐋💭
import Foundation

func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func readInt() -> Int {
    return Int(readLine()!)!
}

func readDoubles () -> [Double] {
    return readLine()!.split(separator: " ").map { Double($0)! }
}

func readDouble() -> Double{
    return Double(readLine()!)!
}

func readLines() -> [String] {
    return readLine()!.map { String($0) }
}

///最大公約数を返す
func gcd(_ m:Int, _ n:Int) -> Int {
    if n == 0 {return m}
    return gcd(n, m % n)
}

///最大公約数を返す
func gcd(_ array: [Int]) -> Int {
    var value = array[0]
    if array.count > 1 {
        for i in 1..<array.count {
            value = gcd(value, array[i])
        }
    }
    return value
}

///最小公倍数を返す
func lcm(_ m:Int, _ n:Int) -> Int {
    return m * n / gcd(m, n)
}

///素数判定(試し割り)
func isPrime(_ x:Int) -> Bool {
    if x <= 1 || x % 2 == 0 { return false }
    if x == 2 { return true }
    for i in stride(from: 3, to: Int(ceil(sqrt(Double(x)))), by: 2){
        if x % i == 0 {
            return false
        }
    }
    return true
}

//https://program-life.com/669
///実行速度の計測
func exectionTime(action: () -> Void) {
    let startDate = Date()
    action()
    let endDate = Date()
    print(endDate.timeIntervalSince(startDate))
}

//https://riptutorial.com/ja/swift/example/14738/インデックスを知らずに配列から要素を削除する
extension Array where Element: Equatable {
    
    mutating func remove(_ element: Element) {
        _ = firstIndex(of: element).flatMap {
            self.remove(at: $0)
        }
    }
}

func binarySearch(right:Int, key:Int, ary:[String]) -> Int{
    var left = 0
    var right = right
    
    while abs(right - left) > 1 {
        let mid = left + (right - left) / 2
        
        if Int(ary[mid])! < key {
            left = mid
            
        } else {
            right = mid
        }
    }
    return left
}

func arrangement (prev:String, ary:[String], returnVal:[String]) -> [String] {
    var returnVal = returnVal
    if ary.count == 0 {
        returnVal.append(prev)
        return returnVal
    }
    
    for s in ary {
        let wprev = prev + s
        var wary = ary
        wary.remove(s)
        returnVal = arrangement(prev: wprev, ary: wary, returnVal: returnVal)
    }
    return returnVal
}
// https://algo-logic.info/divisor/
/// 約数の配列を返す
func divisor(_ n:Int) -> [Int] {
    var ret = [Int]()
    var i = 1
    while i * i <= n {
        if n % i == 0 {
            ret.append(i)
            if i * i != n {
                ret.append(n / i)
            }
        }
        i += 1
    }
    return ret.sorted()
}

func main() {
    let s = readLine()!
    //＿＿＿＿＿＿＿＿＿＿＿＿＿＿＿ここまで入力
    
    if s == "RRR" {
        print(3)
    } else if s == "RRS" || s == "SRR" {
        print(2)
    } else if s.contains("R") {
        print(1)
    } else {
        print(0)
    }
    
}
main()


Measured memory_bytes: 14176
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cassert>
#include <numeric>
#include <queue>
#include <unordered_set>

using namespace std;

int solve(int a, int b) {
    return (a + b + 1) / 2;
}

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

    cout << solve(a, b) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(ll i = m, i##_len = (n); i < i##_len; ++i)
#define reprev(i, n) for(ll i = (n-1LL); i >= 0; --i)
#define all(x) (x).begin(), (x).end()
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 (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int m;
	cin >> m;
	ll w = 0, s = 0;
	rep (i, m) {
		ll d, c;
		cin >> d >> c;
		w += c; s += d * c;
	}
	cout << (w - 1) + (s - 1) / 9 << "\n";
	return 0;
}

Measured memory_bytes: 256
import itertools


n = int(input())

all = list(itertools.product([0,1], repeat=n))
xy,xyz = [],[]
for _ in range(n):
    a = int(input())
    for i in range(a):
        x,y = map(lambda x: int(x),input().split())
        xy.append([x,y])
    xyz.append(xy)
    xy = []


test = ['None']*n
ans = []
ans_list = []
j_list = []
bool = True
hoge = 0
for i in range(len(all)):
    for j,k in enumerate(all[len(all) - 1 - i]):
        if k == 1:
            ans.append(xyz[j])
            j_list.append(j)
    ans = list(itertools.chain.from_iterable(ans))

    test = all[len(all) - 1 - i]
    for x in range(len(ans)):
        if test[ans[x][0]-1] != ans[x][1]:
            bool = False
            break

    if bool :
        hoge = all[len(all) - 1 - i]
        break
    bool = True
    test = ['None']*n
    ans = []
    j_list = []
print(sum(hoge))


Measured memory_bytes: 8932
#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define INF 2e9
#define LINF 1e18
#define mod 1e9+7
template<class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> P;


int main() {
    int n; cin >> n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    int mini = n+1;
    int ans = 0;
    rep(i,n) {
        if (p[i] <= mini) {
            mini = p[i];
            ans++;
        }
    }
    cout << ans << endl;
} 

Measured memory_bytes: 4028
#include <bits/stdc++.h>
using namespace std;
#define rep2(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,n) rep2(i,0,n-1)
#define ll long long
ll INF = 1e9;
const int N = 1e6+100;
int i,ans;
char s[N];
map<char,int> mp;
ll expr();
ll number(){
    if(mp.count(s[i])) return mp[s[i++]];
    else return (s[i++]-'0');
}
ll factor(){
    if(s[i]=='('){
        i++;
        ll res = expr();
        i++;
        return res;
    }
    else return number();
}
ll term(){
    if(s[i]=='-'){
        i++;
        return 2-term();
    }
    else return factor();
}
ll expr(){
    ll res = term();
    for(;;){
        if(s[i]=='+') i++,res = max(res,term());
        else if(s[i]=='*') i++,res = min(res,term());
        else break;
    }
    return res;
}

main(){
    while(1){
        scanf("%s",s);
        if(s[0]=='.')return 0;
        i=0,ans=0;
        rep(ii,3)rep(j,3)rep(k,3){
            i=0;
            mp['P']=ii;
            mp['Q']=j;
            mp['R']=k;
            if(expr()==2)ans++;
        }
        cout<<ans<<endl;
        for(;i>=0;i--)s[i]=' ';
    }
}


Measured memory_bytes: 3120
import java.io.*;
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();
		int topping = 0;

		for(int i=0; i<3; i++) {
			if(s.charAt(i) == 'o') topping += 100;
		}
		System.out.println(topping + 700);
	}
}


Measured memory_bytes: 21716
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

# 最小公倍数
def gcd(a, b):
  if a < b:
      a, b = b, a
  while a % b != 0:
      a, b = b, a % b
  return b
 
# 最大公約数 
def lcm(a, b):
  y = a*b / gcd(a, b)
  return int(y)

n = INT()
s = input()

count = 0
abc = "ABC"
for i in range(n-2):
  if s[i:i+3] == abc:
    count += 1
print(count)



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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;

#define rep(a,n) for(int a = 0;a < n;a++)
#define repi(a,b,n) for(int a = b;a < n;a++)

struct UnionFind {
public:
	vector <ll> par; // 
	vector <ll> siz; // 

	UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
		for (ll i = 0; i < sz_; ++i) par[i] = i;
	}
	void init(ll sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);
		for (ll i = 0; i < sz_; ++i) par[i] = i;
	}

	ll root(ll x) {
		while (par[x] != x) {
			x = par[x] = par[par[x]];
		}
		return x;
	}

	bool merge(ll x, ll y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;
		if (siz[x] < siz[y]) swap(x, y);
		siz[x] += siz[y];
		par[y] = x;
		return true;
	}

	bool issame(ll x, ll y) {
		return root(x) == root(y);
	}

	ll size(ll x) {
		return siz[root(x)];
	}
};
int main(void)
{
	ll n,m;
	cin >> n >> m;
	vector<unordered_set<ll>> o(n);
	rep(i, m) {
		ll a, b;
		cin >> a >> b;
		a--; b--;
		o[a].insert(b);
		o[b].insert(a);
	}
	UnionFind uf(n+1);
	for (int i = 1; i < n; i++) {
		auto left = uf.root(i - 1);
		auto& s = o[left];
		if (s.count(i)) {
			continue;
		}
		uf.merge(i - 1, i);
		for (auto& e : o[i]) {
			s.insert(e);
		}
	}
	unordered_set<ll> c;
	rep(i, n) {
		c.insert(uf.root(i));
	}
	cout << c.size()-1 << endl;
	return 0;
}


Measured memory_bytes: 25984
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;

int main() {
	int A, B, M;
	cin >> A >> B >> M;
	vector<int> a(A), b(B);
	rep(i, A) cin >> a[i];
	rep(i, B) cin >> b[i];
	vector<vector<int>> xyc(M, vector<int>(3));
	rep(i, M) rep(j, 3) cin >> xyc[i][j];

	vector<int> nebikigo(M);
	rep(i, M) nebikigo[i] = a[xyc[i][0]-1] + b[xyc[i][1]-1] - xyc[i][2];
	sort(all(nebikigo));
	sort(all(a));
	sort(all(b));
	int wm = a[0] + b[0];

	int ans = min(nebikigo[0], wm);

	dunk(ans);

}


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

using namespace std;

int main() {
  int n;cin>>n;
  vector<int>l(n);
  int cnt=0;
  rep(i,n)   cin>>l[i];
  sort(l.begin(),l.end());
  rep(i,n-1){
    cnt+=l[i];
  }
  if(l[n-1]<cnt)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 3556
while True:
    try:
        n = int(input())
        if n==0:
            break
        S = list(map(int,input().split()))
    except:
        break
    mean = sum(S)/len(S)
    tmp = 0
    for s in S:
        tmp += ((s-mean)**2)/n
    print(tmp**0.5)


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

void push(int);
int pup();

int atama;
int A[199];

int main(int argc, char *argv[]){
  int x,y;
  char a[100];
  
  atama=0;
  
  while(scanf("%s",a)!=EOF){
    if(a[0]=='+'){
      x=pop();
      y=pop();
      push(x+y);
    }
    else if(a[0]=='-'){
      y=pop();
      x=pop();
      push(x-y);
    }
    else if(a[0]=='*'){
      x=pop();
      y=pop();
      push(x*y);
    }
    else {
      push(atoi(a));
    }
  }

  printf("%d\n",pop());

  return 0;

}

void push(int a){
  A[++atama]=a;
}

int pop(){
  atama--;
  return A[atama+1];
}
    



Measured memory_bytes: 2100
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int unsigned long long
#define ld long double
#define endl "\n"
using namespace std;

int32_t main() {
  int k;
  cin>>k;
  int num = 0;
  int i = 1;
  bool found = false;
  while(i <= k) {
    num = (num*10+7)%k;
    if(num == 0) {
      found = true;
      break;
    }
    i++;
  }
  cout<<(found?to_string(i):"-1");
  cout<<endl;
  return 0;
}

Measured memory_bytes: 3652
#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 pair<int,int> P;
constexpr int mod = 1e9+7;

int dp[88][88][14000];

int main(){
  int h, w;
  cin >> h >> w;
  vector<vector<int>> a(h, vector<int>(w)), b(h, vector<int>(w));
  rep(i,h) rep(j,w) cin >> a[i][j];
  rep(i,h) rep(j,w) cin >> b[i][j];

  dp[0][0][7000 + (a[0][0] - b[0][0])] = 1; 
  dp[0][0][7000 + (b[0][0] - a[0][0])] = 1;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      for (int k = 200; k <= 13000; k++) {
        if (i > 0) {
          dp[i][j][k + (a[i][j] - b[i][j])] |= dp[i - 1][j][k];
          dp[i][j][k + (b[i][j] - a[i][j])] |= dp[i - 1][j][k];
        }
        if (j > 0) {
          dp[i][j][k + (a[i][j] - b[i][j])] |= dp[i][j - 1][k]; 
          dp[i][j][k + (b[i][j] - a[i][j])] |= dp[i][j - 1][k];
        }
      }
    }
  }

  int res = 2e9;
  for (int k = 0; k < 14000; k++) {
    if (!dp[h - 1][w - 1][k]) continue;
    res = min(res, abs(7000 - k));
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 385280
#include<stdio.h>

int n,q;
int A[2000];
int m[2000];

int solve(int i, int m)
{
	if(m==0)
	{
		return 1;
	}
	if(i>=n)
	{
		return 0;
	}
	int res=solve(i+1,m)||solve(i+1,m-A[i]);
	return res;
}

int main(void)
{
	int i;
	scanf("%d",&n);
	
	for(i=0;i<n;i++)
	{
		scanf("%d",&A[i]);
	}
	
	scanf("%d",&q);
	
	for(i=0;i<q;i++)
	{
		scanf("%d",&m[i]);
	}
	
	int check;
	for(i=0;i<q;i++)
	{
		check=solve(0,m[i]);
		if(check==1)
		{
			printf("yes\n");
		}
		else if(check==0)
		{
			printf("no\n");
		}
	}
}


Measured memory_bytes: 2140
#include<bits/stdc++.h>
using namespace std;
#define M 1000000000000000000
typedef long long ll;
#define pb push_back
#define F first
#define S second
#define M6 3000009
#define M5 500009
#define pi 3.14159265
typedef pair<ll,ll> pll;
ll power(ll x,ll n){
    ll ret=1;
    x%=M;
    while(n>0){
        if(n&1) ret=(ret*x)%M;
        x=(x*x)%M;
        n/=2;
    }
    return ret;
}
ll m,n,ar[M5],pr[M5];
int  main()
{   ios_base::sync_with_stdio (0), cin.tie (0);
    ll test=1,t=1,flag,i,j,k,l,a,b,c,ans=0,p;
    while(test--){
        cin>>n; ans=0;
        for(i=1;i<=n;i++) cin>>ar[i];
        for(i=1;i<=n;i++){
            pr[ar[i]]=1+pr[ar[i]-1];
            ans=max(ans,pr[ar[i]]);
        }
        cout<<n-ans;
    }
    return 0;
}  

Measured memory_bytes: 5888
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long n,k,p,q;
  cin>>n>>k;
  if(n>=k){
    p=n%k;
    q=abs(p-k);
    cout<<min(p,q)<<"\n";
  }else{
      
      q=abs(n-k);
      cout<<min(n,q)<<"\n";
    }
  return 0;
}


Measured memory_bytes: 256
let () =
  let counter = ref 0 in
  let rec msort (array : int array) left right =
    let merge (array : int array) left mid right =
      let init n p = Array.init (n+1) (fun i -> if i=n then max_int else array.(p+i)) in
      let xs = init (mid-left) left in
      let ys = init (right-mid) mid in
      let rec loop i j k =
        if k < right then
          (incr counter;
           if xs.(i) <= ys.(j) then (array.(k) <- xs.(i); loop (i+1) j (k+1))
           else (array.(k) <- ys.(j); loop i (j+1) (k+1)) )
      in loop 0 0 left in
    if left+1 < right then
      let mid = (left+right)/2 in
      msort array left mid;
      msort array mid right;
      merge array left mid right in
  let n = read_int () - 1 in
  let (l : int array) = Array.init (n+1) (fun _ -> Scanf.scanf "%d " (fun x -> x)) in
  msort l 0 (n+1);
  Array.iteri (fun i v -> Printf.printf (if i = n then "%d\n" else "%d ") v) l;
  Printf.printf "%d\n" !counter

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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#define all(x) (x).begin(),(x).end()

void solve(){

}
int main(){
    string s;
    cin >> s;

    //substr(x,y)
    //index = x<=x+y-1
    int ans = 0;
    for (int i = 1; i < (int)s.size(); i++){
        string ss = s.substr(0,(int)s.size()-i);
        int size = (int)ss.size();
        if (size % 2 == 0){
            string s1 = ss.substr(0,size/2);
            string s2 = ss.substr(size/2);
            if (s1 == s2){
                ans = size;
                break;
            }
        }
    }
    cout << ans << endl;
                


    return 0;
}


Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    a,b=map(int, input().split())
    l=list(map(int,input().split()))
    cnt1=0
    cnt2=0
    cnt3=0

    for i in l:
        if i<=a:
            cnt1+=1
        elif a+1<=i<=b:
            cnt2+=1
        else:
            cnt3+=1
    print(min(cnt1,cnt2,cnt3))


resolve()

Measured memory_bytes: 3064
n = int(input())
list_a = list(map(int, input().split()))
max_a = max(list_a)

max_k = max_a / 2
min_diff = [-1, max_a]
for i, one_a in enumerate(list_a):
  if one_a != max_a:
    temp_diff = abs(one_a - max_k)
    if temp_diff < min_diff[1]:
      min_diff = [i, temp_diff]

print("{} {}".format(max_a, list_a[min_diff[0]]))

Measured memory_bytes: 14052
S = input()

odd_cond = True
even_cond = True

for i,s in enumerate(S):
    if (i+1)%2 == 1:
        if s not in ["R", "U", "D"]:
            odd_cond = False
            break
    else:
        if s not in ["L", "U", "D"]:
            even_cond = False
            break
        
            
if odd_cond and even_cond:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 2940
#include<iostream>
#include<string>

using namespace std;

int main(){
    
    string str;
    int cnt = 0;

    cin >> str;

    for(auto&& e : str){
        if(e == 'o') cnt++;
    }

    cout << 700 + 100 * cnt << endl;
    
    return 0;
}

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

int main() {
  int n,x;
  cin >> n >> x;
  vector<int> a(n);
  REP(i,n) cin >> a[i];
  a.push_back(x);
  
  sort(a.begin(), a.end(),greater<int>());
  
  int ans = a[0]-a[1];
  REP(i,n){
    ans = gcd(ans,(a[i]-a[i+1]));
  }
  cout << ans << endl;           
              
}

Measured memory_bytes: 3980
#include <iostream>
#include <vector>
#include <utility>
#include <queue>
using namespace std;
typedef long long ll;

vector<vector<pair<ll, ll>>> dp;
vector<ll> d;
ll N;

void bfs(ll pos){
    d[pos] = 0;
    queue<ll> q;
    q.push(pos);
    while(!q.empty()){
        ll t = q.front();
        q.pop();
        for(auto next : dp[t]){
            if(d[next.first] != -1)
                continue;
            d[next.first] = d[t] + next.second;
            q.push(next.first);
        }
    }
}

int main(){
    cin >> N;
    d.resize(N+1, -1);
    dp.resize(N);
    for (int i = 0; i < N-1;i++){
        ll a, b,d;
        cin >> a >> b >> d;
        a--;
        b--;
        dp[a].push_back(make_pair(b, d));
        dp[b].push_back(make_pair(a, d));
    }
    bfs(0);

    for (int i = 0; i < N;i++)
        if(d[i] % 2 == 0)
            cout << 0 << endl;
        else
            cout << 1 << endl;
    return 0;
}

Measured memory_bytes: 8704
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
        int q = sc.nextInt();
        char[] s = S.toCharArray();
        char[] t = T.toCharArray();
        int[] fs = new int[s.length+1];
        int[] ft = new int[t.length+1];
        for(int i=1;i<=s.length;i++) fs[i] = fs[i-1]+(s[i-1]=='A'?1:2);
        for(int i=1;i<=t.length;i++) ft[i] = ft[i-1]+(t[i-1]=='A'?1:2);
        for(int i=0;i<q;i++){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int d = sc.nextInt();
            int curS = fs[b]-fs[a-1];
            int curT = ft[d]-ft[c-1];
            String ans = (curS%3)==(curT%3)?"YES":"NO";
            System.out.println(ans);
        }
    }
}


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

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

    string s, t;
    cin >> s >> t;
    
    int ans = 0x3f3f3f3f;
    for (int i = 0; i + (int) t.length() <= (int) s.length(); i++){
        int cnt = 0;
        for (int j = 0; j < (int) t.length(); j++){
            if (s[i + j] != t[j])
                cnt += 1;
        }

        ans = min(ans, cnt);
    }

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 3636
#include<iostream>
#include<cstdio>
#include<ctype.h>
#include<map>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
inline ll read(){
	ll x=0;char ch=getchar();
	while(!isdigit(ch))ch=getchar();
	while(isdigit(ch))x=x*10+(ch^48),ch=getchar();
	return x;
}
map<ll,int> g;
int work(ll x){
	return g[x]?g[x]:g[x]=((1ll*work(x>>1)+work((x-1)>>1)+work((x-2)>>1)))%mod;
}
int main(){
    g[0]=1;g[1]=2;
	printf("%d\n",work(read()));
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include <cassert>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
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 (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int,int> P;

int main(){
    int n,m;
    cin >> n >> m;
    int l = 1;
    int r = n;
    rep(i,m){
        int lt,rt;
        cin >> lt >> rt;
        chmax(l,lt);
        chmin(r,rt);
    }
    int ans = r-l+1;
    if(ans<0)cout << 0 << endl;
    else cout << ans << endl;
}

Measured memory_bytes: 3604
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
#include<string>
#include<queue>
#include<set>
#include<tuple>

using namespace std;

int main(){
    int N;
    cin>>N;
    vector<int> prime;
    bool IsPrime[101];
    fill(IsPrime,IsPrime+101,true);
    IsPrime[2]=true;
    for(int i=2;i<101;i++){
        if(IsPrime[i]){
            prime.push_back(i);
            int j=2*i;
            while(j<101){
                IsPrime[j]=false;
                j+=i;
            }
        }
    }
    vector<int> factor;
    for(int i=0;i<prime.size();i++){
        int p=prime[i];
        int tmp=0;
        while(p<=N){
            tmp+=N/p;
            p*=prime[i];
        }
        factor.push_back(tmp);
    }
    /*
    for(int i=0;i<factor.size();i++){
        cout<<prime[i]<<' '<<factor[i]<<endl;
    }
     */
    //75=(74+1)
    //75=(24+1)*(2+1)
    //75=(14+1)*(4+1)
    //75=(4+1)*(4+1)*(2+1)
    int ans=0;
    int num[5]={};//0は2以上の数，1は4以上の数，2は14以上の数，3は24以上の数，4は74以上の数
    const int a[5]={2,4,14,24,74};
    for(int i=0;i<factor.size();i++){
        for(int t=0;t<5;t++){
            if(factor[i] >= a[t]){
                num[t]++;
            }
        }
    }
    ans += num[4]+num[3]*(num[0]-1)+num[2]*(num[1]-1)+num[1]*(num[1]-1)*(num[0]-2)/2;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

def main():
    N=int(input())
    ans=0
    if N==1:
        print(ans)
        return 
    t=prime_decomposition(N)
    if len(t)==1:
        print(1)
        return 
    dic={}
    for a in t:
        if not a in dic.keys():
            dic[a]=1
            continue
        else:
            dic[a]+=1
    ans=0
    for i in dic.keys():
        num=dic[i]
        tmp=1
        c=1
        while True:
            if num >=c:
                num-=c
                c+=1
                ans+=1
            else:
                break
    print(ans)
main()


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

using namespace std;

int main(void) {
    int N, K;
    cin >> N >> K;
    vector< vector<int> > white(2*K+1, vector<int>(2*K+1));
    vector< vector<int> > black(2*K+1, vector<int>(2*K+1));
    while(N--) {
        int x, y;
        char c;
        cin >> x >> y >> c;
        if(c == 'W') {
            white[x%(2*K)+1][y%(2*K)+1]++;
        } else {
            black[x%(2*K)+1][y%(2*K)+1]++;
        }
    }

    for(int i=0; i<white.size(); i++) {
        for(int j=1; j<white.size(); j++) {
            white[i][j] += white[i][j-1];
            black[i][j] += black[i][j-1];
        }
    }
    for(int j=0; j<white.size(); j++) {
        for(int i=1; i<white.size(); i++) {
            white[i][j] += white[i-1][j];
            black[i][j] += black[i-1][j];
        }
    }

    int ans = 0;
    for(int i=1; i<=K; i++) {
        for(int j=1; j<=K; j++) {
            int cnt = 0;
            cnt += white[2*K][2*K] - white[i+K-1][2*K] - white[2*K][j+K-1] + 2*white[i+K-1][j+K-1] + white[i-1][2*K] + white[2*K][j-1] - 2*white[i-1][j+K-1] - 2*white[i+K-1][j-1] + 2*white[i-1][j-1];
            cnt += black[2*K][2*K] - (black[2*K][2*K] - black[i+K-1][2*K] - black[2*K][j+K-1] + 2*black[i+K-1][j+K-1] + black[i-1][2*K] + black[2*K][j-1] - 2*black[i-1][j+K-1] - 2*black[i+K-1][j-1] + 2*black[i-1][j-1]);
            ans = max(ans, cnt);
        }
    }
    for(int i=1; i<=K; i++) {
        for(int j=1; j<=K; j++) {
            int cnt = 0;
            cnt += black[2*K][2*K] - black[i+K-1][2*K] - black[2*K][j+K-1] + 2*black[i+K-1][j+K-1] + black[i-1][2*K] + black[2*K][j-1] - 2*black[i-1][j+K-1] - 2*black[i+K-1][j-1] + 2*black[i-1][j-1];
            cnt += white[2*K][2*K] - (white[2*K][2*K] - white[i+K-1][2*K] - white[2*K][j+K-1] + 2*white[i+K-1][j+K-1] + white[i-1][2*K] + white[2*K][j-1] - 2*white[i-1][j+K-1] - 2*white[i+K-1][j-1] + 2*white[i-1][j-1]);
            ans = max(ans, cnt);
        }
    }

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


Measured memory_bytes: 31616
#include<cstdio>
using ull = unsigned long long;

ull solve(unsigned level, ull layer){
	if(!level) return layer;
	if(layer == 1) return 0ull;
	if(layer == (1ull << level + 2) - 3) return (1ull << level + 1) - 1;
	if(layer <= (1ull << level + 1) - 2) return solve(level - 1, layer - 1);
	if(layer >= 1ull << level + 1) return (1ull << level) + solve(level - 1, layer - (1ull << level + 1) + 1);
	return 1ull << level;
}

int main(){
	unsigned N;
	ull X;
	scanf("%u %llu", &N, &X);
	printf("%llu\n", solve(N, X));
	return 0;
}

Measured memory_bytes: 128
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())
a = input()
r = []
b = []
for i in list(a):
    if i == "R":
        r.append(1)
    else:
        b.append(1)
if len(r) > len(b):
    print("Yes")
else:
    print("No")



Measured memory_bytes: 6352
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int N,M;cin>>N>>M;
	vector<vector<int>> vec(M);
 
	for(int i=0;i<M;++i){//i番の電球について
		int k;cin>>k;//Switchの個数
		vec[i].resize(k);
		for(int j=0;j<k;++j){
			cin>>vec[i][j];//どのSwitchとつながっているのか(電球番号)
			--vec[i][j];
		}
	}
 
	vector<int> p(M);//電球の偶奇
	for(int i=0;i<M;++i){cin>>p[i];}
 
	int ans=0;
	for(int i=0;i<(1<<N);++i){//n個のSwitchについてon/offで全探索
		bool ok=true;//全電球がSwitchの偶奇と一致していればtrue
		
        for(int j=0;j<M;++j){
			int c=0;
			for(int id:vec[j]){//iはon/offについて
                               //vec[j]番目の電球について
				if((i>>id)&1){++c;}//id=電球の番号を表す数字(2進数では桁数)
                                   //よってi>>idは点灯しているかどうかを表している。
			}
			c%=2;
			if(c!=p[j]){ok=false;}//偶奇は一致しなければならない
		}
		if(ok){++ans;}
	}
 
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(lint (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
const lint MOD =1000000007;
const lint MAX = 1000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;
 
 
lint fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return 0;
        }
    }
 
    return 1;
}
   long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
    lint lcm(lint a,lint b){
        return a/__gcd(a,b)*b;
    }
     lint gcd(lint a,lint b){
        return __gcd(a,b);
    } 
   

  int main(){      
     lint a,b,n;
     cin>>a>>b>>n;
     n=min(n,b-1);
    lint x=a*n/b;
    lint y=n/b;
    y*=a;
    cout<<x-y;
  }
          
  

Measured memory_bytes: 3628
#include <stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main(){
     int t,i,j,n,k=0,len;
     char s[10005];
     scanf("%s",&s);
     len=strlen(s);
     for(i=0;i<=(len-1)/2;i++){
        if(s[i]!=s[len-i-1]) k++;
     }
     printf("%d",k);
     return 0;
}

Measured memory_bytes: 128
h,w=map(int,input().split())
a=[list(map(int,input().split()))for _ in range(h)]
b=[list(map(int,input().split()))for _ in range(h)]
d=[[a[i][j]-b[i][j]for j in range(w)]for i in range(h)]
dp=[w*[0]for _ in range(h)]
dp[0][0]=1<<(80+d[0][0])|1<<(80-d[0][0])
for i in range(h):
  for j in range(w):
    if i!=0:
      dp[i][j]|=(dp[i-1][j]<<80+d[i][j])
      dp[i][j]|=(dp[i-1][j]<<80-d[i][j])
    if j!=0:
      dp[i][j]|=(dp[i][j-1]<<80+d[i][j])
      dp[i][j]|=(dp[i][j-1]<<80-d[i][j])
n=dp[-1][-1]|(1<<15000)
ans=1<<1000
for i in range(15000):
  if n&(1<<i):ans=min(ans,abs(i-(h+w-1)*80))
print(ans)

Measured memory_bytes: 53468
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; for(auto v : V) os << v << " "; return os << "]"; }
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; for(auto s:S) os<<s<<" ";return os<<"}"; }
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) { return os << "(" << P.first << "," << P.second << ")";}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) { os << "{ "; for(auto m:M) os<<"("<<m.first<<":"<<m.second<<") "; return os<<"}"; }
#ifdef LMAO
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){ const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | "; __f(comma+1, args...); }
#else
    #define trace(...) 42
#endif
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define endl "\n"
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
#define all(x) x.begin(), x.end()
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAX = 1000010;
const int MOD2 = 998244353;
const int MOD = 1000000007; 
const int INF = 1e8;    
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const ld EPS = 1e-7;
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)   
/*****************start************/

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cout<<fixed<<setprecision(25);cerr<<fixed<<setprecision(10);
    int n,W,tot;
    cin>>n>>W;
    vector<ll> u(n),w(n);
    vector<ll> dp;
    for(int i=0;i<n;i++)
    {
        cin>>w[i]>>u[i];
        tot+=u[i];
    }
    dp.resize(tot+1,LLINF);    
    dp[0]=0ll;
    for(int j=0;j<n;j++)
    {
        int rem=tot-u[j];
        for(int i=rem;~i;i--)
            dp[i+u[j]]=min(dp[i+u[j]],dp[i]+w[j]);
    }

    ll ans=0;
    for(int i=0;i<=tot;i++)
    {
        if(dp[i]<=W)
            ans=i;
    }
    cout<<ans<<endl;
    return 0;
}


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

using namespace std;

int n;

double a[505];

int main () {
	cin >> n;
	for (int i = 1;i <= n;i ++) {
		cin >> a[i];
	}sort (a + 1, a + n + 1);
	for (int i = 2;i <= n;i ++) {
		a[i] = (a[i - 1] + a[i]) / 2;
	}
	cout << fixed << setprecision (-1e5) << a[n];
}


Measured memory_bytes: 256
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
using vi = vector<ll>;
using pi = pair<int, int>;
using vpi = vector<pi>;
using ld = long double;
const int maxn = 3e5 + 10, mlg = 20, mod = 1e9 + 7;
ll fact[maxn], inv[maxn];
ll bp(ll a, ll p) {
	ll r = 1;
	while(p) {
		if(p&1) r = (r*a)%mod;
		a = (a*a)%mod, p>>=1;
	}
	return r;
}
void setup(){
	fact[0] = inv[0] = 1;
	for(int i = 1; i < maxn; i++) fact[i] = (fact[i-1]*i)%mod, inv[i] = bp(fact[i], mod-2);
}
ll nck(ll n, ll k) {
	if(k>n) return 0;
	ll res = 1;
	for(ll i = n; i > n-k; i--)
		res = (res*i)%mod;
	return (res*inv[k])%mod;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	setup();
	ll n, a, b;
	cin >> n >> a >> b;
	ll pw = bp(2, n);
	pw--;
	cout << (10ll*mod + pw - nck(n, a) - nck(n, b))%mod;
	return 0;
}


Measured memory_bytes: 5120
#include    <stdio.h>

int main(void)
{
    int	n;
    unsigned long	ans = 0;

    if (fscanf(stdin, "%d", &n) != 1) {
	return 0;
    }

    for (int i = 1; i <= n; i++) {
	if (i % 3 != 0 && i % 5 != 0) {
	    ans += i;
	}
    }
    printf("%ld\n", ans);
    return 0;
}

/*
 * vim:smartindent:sw=4:sts=4:co=84:nu:wm=78:
 */


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

using namespace std; 

#define pb push_back
#define fi first
#define se second
#define all(vec) vec.begin(),vec.end()
#define f(i,a,b) for(int i=a;i<b;i++)
#define fr(i,a,b) for(int i=a;i>=b;i--)
#define fp(i,a,b,p) for(int i=a;i<b;i+=p)
#define SZ(x) (int)x.size()

typedef  vector<string> vs;
typedef  vector<int> vi;
typedef  vector<long long> vl;	


int main(){
	
	
	int n; 
	
	cin >> n; 
	
	int aux = n; 
	int cont = 0; 
	while(aux){
		
		cont+=aux%10;
		aux/=10;
	}
	
	if(n%cont==0){
		cout <<"Yes" << endl;
	}else{
		cout <<"No" << endl;
	} 

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
#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 eb emplace_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 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])>);}

inline void solve(void){
  int N;
  in(N);
  out(N*N*N);
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 256
n,m,k = map(int,input().split())
arr = list(map(int,input().split()))
brr = list(map(int,input().split()))

aarr = [0]
total = 0
for a in arr:
    total+=a
    aarr.append(total)
bbrr = [0]
total = 0
for b in brr:
    total+=b
    bbrr.append(total)

ans = 0
bi = len(brr)
for ai in range(len(arr)+1):
    while aarr[ai]+bbrr[bi]>k:
        if bi == 0:
            break
        bi -= 1

    if bi==0 and aarr[ai]+bbrr[bi]>k:
        break
    ans = max(ans,ai+bi)

print(ans)

Measured memory_bytes: 47296
#include<iostream>
using namespace std;
int main(){
  long long  n,k,cnt=0,num;
  cin >> n >> k;
  if(k==0){
    num  = n * n;
    cout << num<<endl;
    return 0;
  }
  for(int i=k+1;i<=n;i++){
    cnt += (i-k)*(n/i);
    num = n%i;
    if(num!=0){
      num = num-k+1;
      if(num>0) cnt+=num;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		boolean first = true;
		while(true){
			int a = cin.nextInt();
			int b = cin.nextInt();
			if(a+b==0){
				break;
			}
			if(!first){
				System.out.println();
			}
			first=false;
			boolean isNA = true;
			for(int i = a;i <= b;i++){
				if(uruu(i)){
					System.out.println(i);
					isNA = false;
				}
			}
			if(isNA){
				System.out.println("NA");
			}
		}

	}
	static boolean uruu(int a){
		if(a%400==0){
			return true;
		}
		else if(a%100==0){
			return false;
		}
		else if(a%4==0){
			return true;
		}
		else{
			return false;
		}
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
  ll N;
  cin >> N;
  ll A[N];
  ll ans = 0;
  ll pw[62];
  pw[0] = 1;
  for (int i = 1; i < 62; i++) {
    pw[i] = pw[i-1] * 2;
    pw[i] %= Mod;
  }
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (ll bit = 0; bit < 60; bit++) {
    ll one = 0;
    ll zero = 0;
    for (ll i = 0; i < N; i++) {
      if ((A[i] & (1LL << bit))) {
        one++;
      } else {
        zero++;
      }
    }
    ll res = (one * zero);
    res %= Mod;
    res *= pw[bit];
    res %= Mod;
    ans += res;
    ans %= Mod;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
typedef vector<double> vec;
typedef vector<vec> mat;
vec gauss_jordan(const mat& A, const vec& b){
  int n = A.size();
  mat B(n, vec(n + 1));
  for(int i = 0; i < n; i++){
    for(int j = 0; j < n; j++){
      B[i][j] = A[i][j];
    }
  }
  for(int i = 0; i < n; i++) B[i][n] = b[i];
  for(int i = 0; i < n; i++){
    int pivot = i;
    for(int j = i + 1; j < n; j++){
      if(abs(B[j][i]) > abs(B[pivot][i])) pivot = j;
    }
    swap(B[i], B[pivot]);

    if(abs(B[i][i]) < EPS) return vec();

    for(int j = i + 1; j <= n; j++) B[i][j] /= B[i][i];
    for(int j = 0; j < n; j++){
      if(i != j){
        for(int k = i + 1; k <= n; k++) B[j][k] -= B[j][i] * B[i][k];
      }
    }
  }
  vec x(n);
  for(int i = 0; i < n; i++) x[i] = B[i][n];
  return x;
}
bool ok(int x, double v, vec k){
  vec tmp(k.size());
  tmp[0] = 1;
  tmp[1] = x;
  REP(j, k.size() - 2) tmp[j + 2] = tmp[j + 1] * x;
  double sum = 0;
  REP(i, k.size()) sum += k[i] * tmp[i];
  if(abs(sum - v) < 1e-3) return true;
  else return false;
}

int main(){
  int D;
  while(cin>>D && D){
    int N = D + 3;
    vector<double> v(N);
    REP(i, N) cin>>v[i];
    REP(s1, N)FOR(s2, s1 + 1, N){
      vec b;
      mat a;
      REP(i, N){
        if(i == s1 || i == s2) continue;
        vec tmp(D + 1);
        tmp[0] = 1;
        tmp[1] = i;
        REP(j, D - 1) tmp[j + 2] = tmp[j + 1] * i;
        a.push_back(tmp);
        b.push_back(v[i]);
      }
      vec k = gauss_jordan(a, b);
      if(!ok(s1, v[s1], k) && ok(s2, v[s2], k)){
        cout<<s1<<endl;
        goto END;
      }else if(ok(s1, v[s1], k) && !ok(s2, v[s2], k)){
        cout<<s2<<endl;
        goto END;
      }else if(ok(s1, v[s1], k) && ok(s2, v[s2], k)){
        //cout<<"ok"<<endl;
      }else{
        //cout<<"ng"<<endl;
      }
    }
END:;
  }
  return 0;
}

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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	998244353;

// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n;
string s;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	ll n, k;
	cin >> n >> k;
	vll a(n);
	


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

	while (k--) {
		vll prefix(n + 1, 0);


		for (ll i = 0; i < n; i++) {
			ll x = a[i];
			prefix[max(0ll, i - x)] += 1;
			prefix[min(n, i + x + 1)] -= 1;
		}

		for (ll i = 1; i < n; i++) {
			prefix[i] += prefix[i - 1];
		}

		for (ll i = 0; i < n; i++) {
			a[i] = prefix[i];
		}
		//DISP(a);
		bool flag = true;
		for(ll i=0;i<n;i++) {
			if(a[i]!=n) { flag=false; break; }
		}

		if(flag) break;
	}

	DISP(a);
}

int main() {
	fastio; randomINT;
	//cin >> T;
	while (T--) {
		MAIN();
	}
	return 0;
}


Measured memory_bytes: 6364
N = int(input())
L = list(map(int,input().split()))
count = 0
for i in range(N):
    for j in range(i+1,N):
        if L[i] == L[j]:
            continue
        for k in range(j+1,N):
            if L[j] == L[k] or L[i] == L[k]:
                continue
            a = L[i]; b = L[j]; c = L[k]
            if a+b > c and b+c > a and c+a > b:
                count += 1
print(count)

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

int main() {
  char s;
  cin >> s;
  if(s=='a'||s=='i'||s=='e'||s=='u'||s=='o'){
    cout << "vowel" << endl;
  }else{
    cout << "consonant" << endl;
  }
}




Measured memory_bytes: 3604