akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>

using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }

template<uint MD>
struct ModInt {
    uint v;
    ModInt() : v{0} {}
    ModInt(ll v) : v{normS(v%MD+MD)} {}
    static uint normS(const uint &x) {return (x<MD)?x:x-MD;};
    static ModInt make(const uint &x) {ModInt m; m.v = x; return m;}
    ModInt operator+(const ModInt &r) const {return make(normS(v+r.v));}
    ModInt operator-(const ModInt &r) const {return make(normS(v+MD-r.v));}
    ModInt operator*(const ModInt &r) const {return make((ull)v*r.v%MD);}
    ModInt& operator+=(const ModInt &r) {return *this=*this+r;}
    ModInt& operator-=(const ModInt &r) {return *this=*this-r;}
    ModInt& operator*=(const ModInt &r) {return *this=*this*r;}
    static ModInt inv(const ModInt &x) {
        return pow(ModInt(x), MD-2);
    }
};
using Mint = ModInt<TEN(9)+7>;
const int MN = 3030;
int co;
int A[MN], B[MN];

Mint calc(int n, int b);
//calc sm
Mint casm(int n, int b) {
  static Mint dp[MN][MN];
  static bool used[MN][MN];
  if (b == MN-4) return 0;
  if (used[n][b]) return dp[n][b];
  used[n][b] = true;
  Mint &ans = dp[n][b];
  ans = calc(n, b) + casm(n, b+1);
  return ans;
}

Mint calc(int n, int b) {
  static Mint dp[MN][MN];
  static bool used[MN][MN];
  if (n == co) return 1;
  if (used[n][b]) return dp[n][b];
  used[n][b] = true;
  Mint &ans = dp[n][b]; ans = 0;
/*  for (int i = max(A[n], b); i < B[n]; i++) {
    ans += calc(n+1, i+1);
  }*/
  int l = max(A[n], b), r = B[n];
  if (r <= l) return ans;
  ans = casm(n+1, l+1) - casm(n+1, r+1);
  return ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  string t = s;
  for (int i = 0; i < m; i++) {
    int l, r;
    cin >> l >> r; l--;
    sort(s.begin()+l, s.begin()+r);
    sort(t.begin()+l, t.begin()+r, greater<char>());
  }
  co = 0;
  for (int i = 0; i < n; i++) {
    if (t[i] == '0')continue;
    A[co++] = i;
  }
  co = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') continue;
    B[co++] = i+1;
  }
/*  cout << co << endl;
  for (int i = 0; i < co; i++) {
    cout << A[i] << " " << B[i] << endl;
  }*/
  cout << calc(0, 0).v << endl;
    return 0;
}


Measured memory_bytes: 81408
#include <bits/stdc++.h>
using namespace std ;
//#define int long long
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define loop(it, v) for (auto it = v.begin(); it != v.end(); it++)
#define cont(i, x) for (int i = head[x]; i; i = e[i].nxt)
#define clr(a) memset(a, 0, sizeof(a))
#define ass(a, sum) memset(a, sum, sizeof(a))
#define lowbit(x) (x & -x)
#define all(x) x.begin(), x.end()
#define SC(t, x) static_cast <t> (x)
#define ub upper_bound
#define lb lower_bound
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define pof pop_front
#define pob pop_back
#define fi first
#define se second
#define y1 y1_
#define Pi acos(-1.0)
#define iv inline void
#define enter cout << endl
#define siz(x) ((int)x.size())
#define file(x) freopen(x".in", "r", stdin),freopen(x".out", "w", stdout)
typedef long double ld ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair <int, int> pii ;
typedef pair <ll, int> pli ;
typedef pair<int, pii> tri ;
typedef vector <int> vi ;
typedef vector <pii> vii ;
typedef vector <vi> vvi ;
typedef vector <string> vst ;
typedef queue <int> qi ;
typedef queue <pii> qii ;
typedef set <int> si ;
typedef map <int, int> mii ;
typedef map <string, int> msi ;
const int N = 100010 ;
const int INF = 0x3f3f3f3f ;
const int iinf = 1 << 30 ;
const ll linf = 2e18 ;
const int mod = 1000000007 ;
const double eps = 1e-7 ;
void douout(double x){ printf("%lf\n", x + 0.0000000001) ; }
template <class T> void print(T a) { cout << a << endl ; exit(0) ; }
template <class T> void chmin(T &a, T b) { if (a > b) a = b ; }
template <class T> void chmax(T &a, T b) { if (a < b) a = b ; }
template <class T> void Tmin(T &a, T &b, T &c) { return min(a, min(b, c)) ; }
template <class T> void Tmax(T &a, T &b, T &c) { return max(a, max(b, c)) ; }
void add(int &a, int b) { a = a + b < mod ? a + b : a + b - mod ; }
void sub(int &a, int b) { a = (a - b + mod) % mod ; }
void mul(int &a, int b) { a = (ll) a * b % mod ; }
int addv(int a, int b) { return (a += b) >= mod ? a -= mod : a ; }
int subv(int a, int b) { return (a -= b) < 0 ? a += mod : a ; }
int mulv(int a, int b) { return (ll) a * b % mod ; }
int read() {
    int f = 1, x = 0 ;
    char ch = getchar() ;
    while (!isdigit(ch)) { if (ch == '-') f = -1 ; ch = getchar() ; }
    while (isdigit(ch)) { x = x * 10 + ch -'0' ; ch = getchar() ; }
    return x * f ;
}
int pw(int a, int b) {
    int s = 1 ;
    for (; b; b >>= 1, a = (ll) a * a % mod)
    if (b & 1) s = (ll) s * a % mod ;
    return s ;
}

int n, m ; ll ans ;
int a[N] ;
pqueue <int, vi, less<int> > q ; 

signed main() {
	scanf("%d%d", &n, &m) ;
	rep(i, 1, n) scanf("%d", &a[i]), ans += a[i] ;
	rep(i, 1, n) q.push(a[i]) ;
	while (m && !q.empty()) {
		int cur = q.top() ; q.pop() ;
		m-- ;
		ans -= (cur) - (cur / 2) ;
		if (cur != cur / 2) q.push(cur / 2) ;
	}
	printf("%lld\n", ans) ;
	return 0 ; 
} 

Measured memory_bytes: 1276
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG 
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, s, n) for (int i = s; i < n; i++)
#define all(v) v.begin(), v.end() // sort(all(array))
#define INF 1000000000
#define mod 1000000007
using namespace std;
using ll = long long;
using vi = vector<int>; //vi array(要素数, 初期値)
using pll = pair<ll, ll>;
using pii = pair<int, int>;
using vc = vector<char>;
using vs = vector<string>;
using vb = vector<bool>;
using vvi = vector<vi>; //vvi table(行数, vi(列数, 初期値))
using vvc = vector<vc>;
using vvs = vector<vs>;
using vvb = vector<vb>;

int main() {
    int n, x, t; cin >> n >> x >> t;
    
    if(n % x == 0) {
        cout << (n / x) * t << endl;
    }
    else cout << t + (n / x) * t << endl;
}


Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		long possession = 1000;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] stock = new long[n];
		for (int i = 0; i < n; i++) {
			stock[i] = sc.nextLong();
		}
		for (int i = 0; i < stock.length - 1; i++) {
			long stocks = 0;
			//翌日が今よりも高かったら即購入
			//
			if(stock[i] < stock[i + 1]) {
				stocks = possession / stock[i];
			}
			possession += (stock[i + 1] - stock[i])  * stocks;
		}
		
		System.out.println(possession);
	}

}


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

using namespace std;



int main()
{
    int n;
    cin >> n;
    if(n % 10 == 7 || n / 10 % 10 == 7 || n / 100 % 10 == 7)
        cout << "Yes\n";
    else cout << "No\n";
    return 0;
}


Measured memory_bytes: 3588
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
#include <stdio.h>
#include <bitset>
#include<math.h>
#include<list>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pair_t;
bool comp(const pair_t &a, const pair_t &b) {
	return a.first < b.first;
}
int main() {
	int n;
	cin >> n;
	vector<pair<int, int> > pairs(n);
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		pairs[i] = make_pair(a, i+1);
	}
	sort(pairs.begin(), pairs.end(), comp);
	for (int i = 0; i < n; i++) {
		cout << pairs[i].second<<" ";
	}
}

Measured memory_bytes: 1536
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))
import math
from decimal import Decimal
'''
A, B = map(str, sys.stdin.readline().split())
A = Decimal(A)
B = Decimal(B)
print(A * B//1)
'''
A, B = map(str, sys.stdin.readline().split())
A = int(A)
B = int(float(B)*100+0.1)
print(A*B//100)


Measured memory_bytes: 9948
def solve(): # 070A - Palindromic Number
    A, B, C, D = list(map(int, input().split(" ")))

    if A < C <= B < D:
        print(B - C)
    elif C < A <= D < B:
        print(D - A)
    elif A < C < D < B:
        print(D - C)
    elif C < A < B < D:
        print(B - A)
    elif (A == C)  and (B == D):
        print(B - A)
    elif A == C or B == D:
        print(min(abs(B-A), abs(D-C)))
    else:
        print(0)
        
        
solve()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef pair<int,int> P;
const int inf = 1e6;
#define rep(i,n) for(int i = 0;i < n;i++)
#define rrep(i,n) for(int i = 1;i <= n;i++)

int used[100000];

int calc(int k, vector<P> x, int f, int a, int b){
	int n = x.size();
	for(int i = 0;i < n;i++){
		if(x[0].fi+k < x[i].fi){
			int u = x[i].se;
			if(used[u] == b || x[i].fi+k < x[n-1].fi)return 0;
			if(f)used[u] = a;
		}
	}
	for(int i = n-1;i >= 0;i--){
		if(x[i].fi+k < x[n-1].fi){
			int u = x[i].se;
			if(used[u] == a)return 0;
			if(f)used[u] = b;
		}
	}
	return 1;
}

vector<P> x, y;
int solve(int k){
	int t[3] = {}; 
	t[0] = calc(k, x, 1, 1, 2);
	t[1] = calc(k, y, 0, 1, 2);
	t[2] = calc(k, y, 0, 2, 1);
	if(t[0] == 0)return 0;
	if(t[1] || t[2])return 1;
	return 0;
}

int main(){
	int n, a, b;
	
	scanf("%d", &n);
	for(int i = 0;i < n;i++){
		scanf("%d%d", &a, &b);
		x.push_back(P(a+b, i));
		y.push_back(P(b-a, i));
	}
	sort(x.begin(), x.end());
	sort(y.begin(), y.end());
	
	
	int lb = 0, ub = inf;
	while(ub-lb > 1){
		fill(used, used+100000, 0);
		int mid = (lb+ub)/2;
		int res = solve(mid);
		if(res)ub = mid;
		else lb = mid;
	}
	
	printf("%d\n", ub);
	return 0;
}


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

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

//prototype declaration
int iin();
long long llin();
double din();
char cin();
void stin(char *s);
void iout(int i);
void llout(long long i);
void dout(double i);
void cout(char c);
void stout(char *s);
int gcd(int a, int b);
int lcm(int a, int b);
long long llgcd(long long a, long long b);
long long lllcm(long long a, long long b);
int asc(const void *a, const void *b);
int desc(const void *a, const void *b);
double to_deg(double rad);
double distance(int xi, int yi, int xj, int yj);

//main function
int main() {
    int N = iin();
    int n =(int) (double)N / (double)1.08;
    if ((int)(n * 1.08) == N) iout(n);
    else if ((int)((n + 1) * 1.08) == N) iout(n + 1);
    else stout(":(");
    return 0;
}

//body function
int iin() {
    int i;
    scanf("%d", &i);
    return i;
}

long long llin() {
    long long i;
    scanf("%lld", &i);
    return i;
}

double din() {
    double i;
    scanf("%lf", &i);
    return i;
}

char cin() {
    char c;
    scanf("%c", &c);
    return c;
}

void stin(char *s) {
    scanf("%s", s);
}

void iout(int i) {
    printf("%d\n", i);
}

void llout(long long i) {
    printf("%lld\n", i);
}

void dout(double i) {
    printf("%lf\n", i);
}

void cout(char c) {
    printf("%c\n", c);
}

void stout(char *s) {
    printf("%s\n", s);
}

/*
    int型の最大公約数
*/

int gcd(int a, int b) {
    int r;

    if (a < b) {
        r = a;
        a = b;
        b = r;
    }

    r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

/*
    int型の最小公倍数
*/

int lcm(int a, int b) {
    int r = llgcd(a, b);
    a /= r;
    return a * b;
}

/*
    long long型の最大公約数
*/

long long llgcd(long long a, long long b) {
    long long r;

    if (a < b) {
        r = a;
        a = b;
        b = r;
    }

    r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

/*
    long long型の最小公倍数
*/

long long lllcm(long long a, long long b) {
    long long r = llgcd(a, b);
    a /= r;
    return a * b;
}

/*
    int型の昇順用比較関数
*/

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

/*
    int型の降順用比較関数
*/

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

/*
    弧度法を度数法に
*/

double to_deg(double rad) {
    return rad * 180.0 / (atan(1.0) * 4.0);
}

double distance(int xi, int yi, int xj, int yj) {
    return hypot(xj - xi, yj - yi);
}


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

int main() {
    int n;
    scanf("%d",&n);
    printf("%d",10-n/200);
}

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

/*
struct Edge
{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w) {}
};
using Graph = vector<vector<Edge>>;
*/

using Graph = vector<vector<int>>;

const long long INF = 1LL << 60;
const int INT_INF = 1000000000;

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

const int MOD = 1000000007;

class mint
{
    ll x;

public:
    mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
    mint operator-() const
    {
        return mint(-x);
    }

    mint &operator+=(const mint &a)
    {
        if ((x += a.x) >= MOD)
            x -= MOD;
        return *this;
    }

    mint &operator-=(const mint &a)
    {
        if ((x += MOD - a.x) >= MOD)
            x -= MOD;
        return *this;
    }

    mint &operator*=(const mint &a)
    {
        (x *= a.x) %= MOD;
        return *this;
    }

    mint operator+(const mint &a)
    {
        mint res(*this);
        return res += a;
    }

    mint operator-(const mint &a)
    {
        mint res(*this);
        return res -= a;
    }

    mint operator*(const mint &a)
    {
        mint res(*this);
        return res *= a;
    }

    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const
    {
        return pow(MOD - 2);
    }

    mint &operator/=(const mint &a)
    {
        return (*this) *= a.inv();
    }

    mint operator/(const mint &a)
    {
        mint res(*this);
        return res /= a;
    }

    friend ostream &operator<<(ostream &os, const mint &m)
    {
        os << m.x;
        return os;
    }
};

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N;
    cin >> N;
    mint sum = 0;
    vector<int> A(N);
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        sum += A[i];
    }

    mint ans = sum;
    ans *= sum;
    // 中央の正方形を取り除く
    for (int i = 0; i < N; i++)
    {
        mint tmp = A[i];
        tmp *= A[i];
        ans -= tmp;
    }

    // 2で割る
    ans /= 2;
    cout << ans << endl;
    return 0;
}

// 面積を計算する．全てを足して2乗．真ん中(i = j)を抜いて/2をする(mod 1000000007で)


Measured memory_bytes: 3992
using System;
using System.Linq;

public class App
{
    public static void Main(string[] args)
    {
        int[] a = new int[5];
        a[0]=int.Parse(Console.ReadLine());
        a[1]=int.Parse(Console.ReadLine());
        a[2]=int.Parse(Console.ReadLine());
        a[3]=int.Parse(Console.ReadLine());
        a[4]=int.Parse(Console.ReadLine());
        Console.WriteLine(a.Max()-a.Min() > int.Parse(Console.ReadLine())?":(":"Yay!");
    }
}

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

/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define isin(a, b, c) (b <= a && a <= c)
#define println cout << "\n";
#define sz(v) (int)v.size()
#define bin(x) static_cast<bitset<16> >(x)



/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;
typedef map<int, int> mi;
typedef set<int> si;


/* constant */
const int inf = 1LL << 62;
const int mod = 1e9 + 7;
const int dx[8]={1,0,-1,0,-1,1,-1,1};
const int dy[8]={0,1,0,-1,-1,-1,1,1};
const string alphabet = "abcdefghijklmnopqrstuvwxyz";

/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T, class U, class V> void printx(tuple<T, U, V> t){cout << "{" << get<0>(t) << "," << get<1>(t) <<"," << get<2>(t) << "}" << endl;}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}
template<class T> void printans(vec<T> v){rep(i,0,sz(v)){cout << v[i] << (i == sz(v) - 1 ? "" : " ");}cout << endl;}


/* general_method */
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 cut(T &a, int l, int r){return T(a.begin()+l, a.begin()+r);}

/* main */

int n, m;
map<int,int> mp;
void in(){
    cin >> n >> m;
    rep(i,0,m){
        int f, t;
        cin >> f >> t;
        mp[f]++;
        mp[t]++;
    }

}

void solve(){
    bool isok = true;
    for(auto e : mp){
        if(e.second % 2 == 1) isok = false;
    }

    cout << (isok ? "YES" : "NO") << endl;


}

signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);
    in();
    solve();
    
}

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

int main() {
  string S, T, U;
  int A, B;
  cin >> S >> T;
  cin >> A >> B;
  cin >> U;
  
  if(S==U){
    cout << A-1 << " " << B << endl;
  }
  else {
    cout << A << " " << B-1 << endl;
  }
  
   
 
  
}



Measured memory_bytes: 3600
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <deque>
using namespace std;
using P = pair<int,int>;
typedef long long int ll;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
ll gcd(ll a, ll b) {//最大公約数
    if(a<b){
        ll tmp = a;
        a = b;
        b = tmp; 
    }
    if (b==0) return a;
    else return gcd(b, a%b);
}
ll lcm(ll a, ll b) {//最小公倍数
    return a * b / gcd(a, b);
}

int main(){
    int x; cin >> x;
    int ans=0;
    while(x>=500){
        x-=500;
        ans+=1000;
    }
    while(x>=5){
        x-=5;
        ans+=5;
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 256
def d_insertion(N, S):
    need_left, need_right = 0, 0  # Sの左右にほしい'(', ')'の個数
    for c in S:
        if c == '(':
            # '('と対応する')'を仮に右端に補充することにする。
            # あとで')'が出てきたなら補充量を減らせばいい。
            need_right += 1
        else:
            if need_right == 0:
                need_left += 1  # 今出た')'と対応する'('がない。左に補充する
            else:
                need_right -= 1
    return '(' * need_left + S + ')' * need_right

N = int(input())
S = input()
print(d_insertion(N, S))

Measured memory_bytes: 2940
#include<iostream>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if (a==b && a!=c)
        cout<< c<<endl;
    else if (a==c&& a!=b)
        cout<<b<<endl;
    else 
        cout<<a<<endl;
return 0;
}

Measured memory_bytes: 256
x, y = list(map(int, input().split()))

a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]


if ((x in a) and (y in a)) or ((x in b) and (y in b)) or ((x in c) and (y in c)):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 9156
N = int(input())
A = sorted(list(map(int,input().split())),reverse=True)
B = []
cur = 0
for i in range(1,N):
    if A[i]!=A[i-1]:
        n = i-cur
        if n>=2:
            B.append((A[i-1],n))
        cur = i
if N-cur>=2:
    B.append((A[-1],N-cur))
if len(B)<2:
    print(0)
else:
    if B[0][1]>=4:
        s = B[0][0]**2
    else:
        s = B[0][0]*B[1][0]
    print(s)

Measured memory_bytes: 14224
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

int check(string s) {
	string temp;
	for (int i = 2; i < s.length(); i=i+2) {
		temp = s.substr(0, s.length() - i);
		if (temp.substr(0, temp.length() / 2) == temp.substr(temp.length() / 2, temp.length() / 2)) {
			return (temp.length());
		}
	}
}

int main()
{
	string s;
	cin >> s;
	cout << check(s) << endl;
	return 0;
}

Measured memory_bytes: 256
s = input()
n = len(s)

ans = True


def check(s):
    length = len(s)
    ans2 = True
    for i in range(length//2):
        # print("{}:{}".format(s[i], s[length-i-1]))
        if s[i] != s[length-i-1]:
            ans2 = False
    return ans2


ans = check(s)

if ans:
    # print(s[0:n//2])
    ans = check(s[0:n//2])
# else:
    # print("cond1 fail")

if ans:
    # print(s[((n+3)//2-1):n])
    ans = check(s[((n+3)//2-1):n])
# else:
    # print("cond2 fail")

if ans:
    print("Yes")
else:
    print("No")

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

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

using namespace std;
using ll = long long int;

int main(void) {
    int n, m;
    cin >> n >> m;
    vector<int> h(n);
    vector<vector<int>> to(n);
    rep(i, n) cin >> h[i];
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    int cnt = 0;
    rep(i, n) {
        bool b = true;
        for (int j = 0; j < to[i].size(); j++) {
            if (h[i] <= h[to[i][j]]) b = false;
        }
        if (b) cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 8804
N,M = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(M)]

def judge(ab,idx):
    memo = [True] * (N+1)
    al = [[] for _ in range(N+1)]
    for i in range(M):
        if i == idx:continue
        al[ab[i][0]].append(ab[i][1])
        al[ab[i][1]].append(ab[i][0])
            
    child = al[ab[idx][1]]
    memo[ab[idx][1]] = True
    while child:
        pi = child.pop()
        if memo[pi]:
            memo[pi] = False
        else:
            continue
        child = child + al[pi]
        
    if memo[ab[idx][0]] == True:
        return False
    else:
        return True
    
    
    
cnt = 0
for i in range(M):
    if not judge(ab,i):
        cnt += 1
        

print(cnt)
    
    
    
    


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
using namespace std;
 
int main() {
  int a;
  cin >> a;
  if(a==3||a==5||a==7) cout << "YES" << endl;
  else cout << "NO" << endl;
}


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

int kaijou(int x){
    if(x==1) return 1;
    else return (x * kaijou(x-1));
}

double distance(P p1, P p2){
    return sqrt( pow(p1.first-p2.first,2) + pow(p1.second-p2.second,2));
}

int main()
{
    // input
    int n;
    cin >> n;
    vector<pair<ll,ll>> town(n);
    rep(i,n) cin >> town[i].first >> town[i].second;

    // solve
    double sum=0;
    vector<int> route(n);
    iota(ALL(route), 0);
    do{
        for(int i=0; i<n-1; i++) sum+=distance(town[route[i]], town[route[i+1]]);
    }while(next_permutation(ALL(route)));

    double ans=sum/kaijou(n);
    // output
    cout << fixed << setprecision(15) << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using namespace std;

struct BoolName : numpunct<char> {
  string t, f;
  BoolName (string t = "Yes", string f = "No") : t(t), f(f) {}
  string do_truename() const {return t;}
  string do_falsename() const {return f;}
};

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
    cout.imbue(locale(cout.getloc(), new BoolName));
  }
} initializer;

template<typename T> istream& operator>>(istream &s, vector<T> &v) {
  for (T &t : v) s >> t;
  return s;
}

template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
  for (const T &t : v) s << t << endl;
  return s;
}

void set_bool_name(string t, string f) {
  cout.imbue(locale(cout.getloc(), new BoolName(t, f)));
}

template<typename T> bool chmin(T& a, T b) {return a > b ? a = b, true : false;}

template<typename T> bool chmax(T& a, T b) {return a < b ? a = b, true : false;}

template<typename T> void sort(vector<T>& v) {sort(v.begin(), v.end());}

int main() {
  int n, res = 0;
  cin >> n;
  vector<int> p(n);
  cin >> p;
  for (int i = 0; i < n - 1; ++i) {
    if (p[i] != i + 1) continue;
    ++res;
    if (p[i + 1] == i + 2) p[i + 1] = -1;
  }
  if (p[n - 1] == n) ++res;
  cout << res << endl;
}



Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

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

    int n;
    ll k;
    cin >> n >> k;
    vector<int> a(n), f(n);
    for(int i = 0; i < n; ++i)  cin >> a[i];
    for(int i = 0; i < n; ++i)  cin >> f[i];
    sort(a.begin(), a.end());
    sort(f.rbegin(), f.rend());
    
    ll lb = -1, ub = 1e+12;
    while(ub - lb > 1){
        ll mid = (lb + ub) / 2;
        ll sum = 0;
        for(int i = 0; i < n; ++i){
            sum += max(0LL, a[i] - mid / f[i]);
        }
        if(sum <= k)    ub = mid;
        else    lb = mid;
    }
    cout << ub << endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
int count=0;
for(int i=0;i<s.size();i++){
	if(s[i]!=t[i]){
		count++;
	}
}
cout<<count<<endl;
	return 0;
}

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

int main()
{
	int H, W;
	while (cin >> H >> W, H || W) {
		for (int i = 0; i < H; i++) {
			cout << '#';
			for (int j = 1; j + 1 < W; j++) {
				cout << (i > 0 && i + 1 < H ? '.' : '#');
			}
			if(W != 1) cout << '#' << endl;
			else cout << endl;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 3060
#include<stdio.h>
int main () {
    int n;
    int k;
    scanf("%d %d",&n,&k);
    int score[n];
    for(int i=0;i<n;i++){
        scanf("%d",&score[i]);
    }
    for(int i=0;i<n-k;i++){
        if(score[i]<score[i+k]){
            puts("Yes");
        }
        else {
            puts("No");
        }
    }
    return 0;
}

Measured memory_bytes: 2404
n = int(input())
a = list(map(int, input().split()))
a2 = [0]
cnt = 0
tmp = 0
for i in a:
    a2.append(a2[-1] + i)

a2.sort()
for j in range(n):
    if a2[j] == a2[j+1]:
        tmp += 1
    else:
        if tmp >= 2:
            cnt += tmp*(tmp+1)//2
            tmp = 0
        else:
            cnt += tmp
            tmp = 0
if tmp != 0:
    if tmp >= 2:
        cnt += tmp*(tmp+1)//2
        tmp = 0
    else:
        cnt += tmp
        tmp = 0
print(cnt)

Measured memory_bytes: 25976
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; using ll = long long; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int main() {
    int N;
    cin >> N;
    set<string> S;
    rep(i, N) {
        string s;
        cin >> s;
        S.insert(s);
    }
    write(S.size());
}

Measured memory_bytes: 19232
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using static System.Math;

class P
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        long l1 = 2;
        long l2 = 1;
        for (int i = 2; i <= n; i++)
        {
            long next = l1 + l2;
            l1 = l2;
            l2 = next;
        }
        Console.WriteLine(l2);
    }
}

Measured memory_bytes: 13140
#include<stdio.h>
#include<math.h>

bool isprime(int x){
  if (x == 2)return true;
   else if (x ==3) return true;
  else if (x < 2 ) return false;
  else if (x % 2==0 ) return false;
  else if(x>3){ 
 for(int i=3;i*i<=x;i=i+1){

	 if (x %i==0){return false;break;}
	 }
	 return true;}
}

int main(){
int N,x,cou;
bool f;//
//scanf("%d",&x);
//N=sqrt((double)x);
//printf("%d",N);

f=false;cou=0;
scanf("%d",&N);
for(int i=0;i<N;i++)
{scanf("%d",&x);
f=isprime(x);
if(f==true)cou++;
}
printf("%d\n",cou);

return 0;
}

Measured memory_bytes: 1024
import sys
input = sys.stdin.readline

class segtree:
    x_unit=0 # 単位元
    x_func=max  # 関数
    def __init__(self,n,seq): # 元のseqと要素数n
        self.n=n
        self.x=[self.x_unit]*(2*n)
        for i,j in enumerate(seq, self.n): # n番目からseqをx配列に移していく
            self.x[i] = j
        for i in range(self.n-1, 0, -1):
            self.x[i] = self.x_func(self.x[i*2], self.x[i*2+1])
    def update(self,i,j): # 1点更新
        i += self.n
        self.x[i]=j
        while i>1:
            i//=2 # 更新後、木の上へと登っていくついでに更新
            self.x[i]=self.x_func(self.x[i*2], self.x[i*2+1])
    def get(self, i): # 値を入手
        return self.x[i+self.n] 
    def fold(self,l,r): # 区間[l, r)の最小値などを取得 
        l+=self.n
        r+=self.n
        val_l=self.x_unit
        val_r=self.x_unit
        while l<r:
            if l & 1: # lが奇数
                val_l=self.x_func(val_l,self.x[l])
                l+=1 # 偶数に調節
            if r & 1: # rが奇数
                r-=1 # 開区間なので1個前は偶数番目の要素
                val_r=self.x_func(val_r,self.x[r])
            l //= 2
            r //= 2
        return self.x_func(val_l,val_r)
    def max_right(self, l, v, condition): 
        # index lから右にある値の中でa[j]>=vを満たす最小のjを求める
        r=self.n
        if condition(self.fold(l, r),v)==False:
            return r
        else:
            while r-l>1:
                l1=l
                r1=l+(r-l)//2
                l2=l+(r-l)//2
                r2=r
                if condition(self.fold(l1, r1),v)==True:
                    l=l1
                    r=r1
                else:
                    l=l2
                    r=r2
            return l

n,q=map(int,input().split()) 
*a,=map(int,input().split())
seg=segtree(n,a)
condition=lambda x,y:x>=y


for i in range(q):
    t,x,y=map(int,input().split()) 
    if t==1:
        x-=1
        seg.update(x, y)
    elif t==2:
        print(seg.fold(x-1,y))
    else:
        print(seg.max_right(x-1, y, condition)+1)

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

using namespace std;

int n, cur = 200002, id = 0;
char x[200005];
vector<int> v[400006];
long long ans;

int main() {
	scanf("%s", x);
	n = strlen(x);
	v[cur].push_back(id);
	for (int i = 0; i < n; i++) {
		if (x[i] == '(')
			v[++cur].push_back(++id);
		else if (x[i] == ')') {
			v[--cur].push_back(++id);
			int tmp = v[cur - 1].empty() ? -1 : v[cur - 1].back();
			ans += v[cur].end() - lower_bound(v[cur].begin(), v[cur].end(), tmp) - 1;
		} else {
			int tmp = v[cur - 1].empty() ? -1 : v[cur - 1].back();
			ans -= v[cur].end() - lower_bound(v[cur].begin(), v[cur].end(), tmp) - 1;
			v[cur].pop_back();
			id--;
			if (v[cur + 1].empty() || v[cur + 1].back() != id)
				cur--;
			else
				cur++;
		}
		printf("%lld\n", ans);
	}
}



Measured memory_bytes: 18964
#include<bits/stdc++.h>
#include<iomanip>
#define fast {ios_base::sync_with_stdio(false);cin.tie(NULL);}
#define mxn 1000005
#define mod 1000000007
#define ld long double
#define pb push_back
#define inf 1e18
#define fi first
#define se second
typedef long long int ll;
int bit[130][8];
using  namespace std;
int main(void){
	#ifndef ONLINE_JUDGE
	freopen("input1.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	fast;
	ll k,ans=1;
	cin>>k;
	ll m=7%k;
	ll d=1;
	while(m){;
		m=(m*10+7)%k;
		ans++;
		d++;
		if(d>mxn)
		break;
	}
	if(m==0)
	cout<<ans;
	else
	cout<<-1;
	
}


Measured memory_bytes: 3684
/*
ID: learnin7
TASK: test
LANG: C++                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include<bits/stdc++.h>

/*  Macros from Endagorion */
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;


int main(){
        
    ios_base::sync_with_stdio(0);
    
    //ofstream fout ("test.out");
    //ifstream fin ("test.in");
    //fin >> a >> b;
    //fout << a+b << endl;
    int a,b,c;
    cin>>a>>b>>c;
    if(a+b+c>=22){
        cout<<"bust\n";
    }
    else{
        cout<<"win\n";
    }
    return 0;
}



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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
	ll K; cin >> K;
	set<int> cnt;
	ll ans = 1, m = 7;
	while(1) {
		m = m % K;
		if(cnt.count(m)) {
			ans = -1;
			break;
		}
		cnt.insert(m);
		if(m == 0) break;
		m = (m * 10) % K;
		m = (m + 7) % K;
		ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 50468
import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr = new int[n];
       	Arrays.fill(arr, -1);
        while(m-- > 0) {
        	int idx = sc.nextInt() - 1;
        	int num = sc.nextInt();
        	if(n > 1 && idx == 0 && num == 0 || arr[idx] > -1 && arr[idx] != num) {
        		System.out.println(-1);
        		return;
        	}
        	arr[idx] = num;
        }
        if(n == 1 && arr[0] == -1) {
            System.out.println(0);
            return;
        }
        for(int i = 0; i < n; i++) {
        	if(i == 0 && arr[i] == -1) {
        		System.out.print(1);
        		continue;
        	} 
        	if(arr[i] == -1)
        		System.out.print(0);
        	else
        		System.out.print(arr[i]);
        }
        System.out.println();
    }
}


Measured memory_bytes: 23636
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>

//#include <tuple>

//#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

int main() {
  string s;
  cin >> s;
  int cnt = 0;
  int n = s.size();
  for (int i = 0; i < n/2; i++) {
    if (s.at(i) != s.at(n-i - 1)) cnt++;
  }
  
  cout << cnt << endl;

}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(){
  int N,*A,i,j,minj,c=0,a=0;

  scanf("%d",&N);

  A=(int*)malloc(N*sizeof(int));

 
  for(i=0;i<N;i++)scanf("%d",&A[i]);

  
  for(i=0;i<N;i++){

    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj]) minj=j;
        }


    a=A[i];
  
    A[i]=A[minj];
    A[minj]=a;
    if(i!=minj) c++;
  }
  printf("%d",A[0]);
  for(i=1;i<N;i++)printf(" %d",A[i]);
  printf("\n%d\n",c);
  free(A);
  return 0;
  
}

Measured memory_bytes: 600
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

X,Y = map(int,input().split())
a = (2*Y-X)/3
b = (2*X-Y)/3
if (X == 0 or Y == 0):
    print(0)
    exit()
if is_integer(a):
    a = (2*Y-X)//3
else:
    print(0)
    exit()
if is_integer(b):
    b = (2*X-Y)//3
else:
    print(0)
    exit()
n = a+b
mod = 10**9+7 
ans = cmb(n,a,mod)
print(ans)

Measured memory_bytes: 123808
#include <stdio.h>

int main() {
  int array_size, number_k;
  scanf("%d %d", &array_size, &number_k);
  char str[array_size+1];
  scanf("%s", str);
  str[number_k-1] -= ('A' - 'a');
  printf("%s\n", str);
  return 0;
}


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

typedef long long ll;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999


int main(){
	for(int i=1;i<=9;i++){
		for(int j=1;j<=9;j++){
			cout<<i<<"x"<<j<<"="<<i*j<<endl;
		}
	}
}

Measured memory_bytes: 1120
#include <stdio.h>
#include <algorithm>
#include <math.h>
using namespace std;

int main()
{
int x1,y1,x2,y2;
scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
int vx=x2-x1;
int vy=y2-y1;
int x3=x2-vy;
int y3=y2+vx;
int x4=x3-vx;
int y4=y3-vy;
printf("%d %d %d %d\n",x3,y3,x4,y4);
}

Measured memory_bytes: 128
from collections import defaultdict

n, k, q = map(int, input().split())
C = defaultdict(int)
for _ in range(q):
    a = int(input())
    C[a] += 1
for i in range(1, n + 1):
    cnt = q - C[i]
    if k - cnt > 0:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 16160
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"

int main(){
    string s;
    cin >> s;
    int k;
    cin >> k;
    set<string> set1;
    REP(i,s.size()){
        REP(j,6){
            string str = s.substr(i,j);
            set1.insert(str);
        }
    }
    auto itr = set1.begin();
    for(int i=0;i<k;i++){
        ++itr;
    }
    COUT(*itr);
    return 0;
}

Measured memory_bytes: 4752
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
using namespace std;

void solve() {
	int N;
	cin >> N;
	cout << N * N * N << endl;
	return;
}

//////////////////////////////
//////////////////////////////

int main() {
#ifdef DEBUGTIME
	for (int time = 0; time < DEBUGTIME; time++) {
		solve();
		cout << "####################" << endl;
	}
#else
	solve();
#endif
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <bitset>
#include <map>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int main() {
  int m, n;
  while(cin>>m>>n,m||n) {
    int ba[m][n];
    int num = 0;
    int sx,sy;
    REP(i,n) {
      REP(j,m) {
        int a;
        cin >> a;
        if (a==1) {
          ba[j][i] = ++num;
        } else {
          ba[j][i] = 0;
          if (a == 2) {
            sx=j;sy=i;
          }
        }
      }
    }
    const int dx[] = {0,1,0,-1};
    const int dy[] = {-1,0,1,0};
    map<int, int> mp;
    mp[((1<<num)-1)*100+sx*10+sy] = 1;
    REP(i, num) {
      map<int, int> nextmp;
      FOR(it, mp) {
        int hoge = it->first;
        int S = hoge/100;
        int x = (hoge%100)/10;
        int y = hoge%10;
//        cout << bitset<7>(S) << " " << x << " "<<y << " " << it->second << endl;
        REP(k,4) {
          int xx = x, yy = y;
          while(1) {
            xx += dx[k]; yy += dy[k];
            if (xx<0 || xx>=m || yy<0||yy>=n) break;
            if (ba[xx][yy]) {
              if (S&(1<<(ba[xx][yy]-1))) {
                nextmp[(S-(1<<(ba[xx][yy]-1)))*100+xx*10+yy] += it->second;
                break;
              }
            }
          }
        }
      }
      //  cout << endl;
      mp = nextmp;
    }
    int res = 0;
    REP(y,n) {
      REP(x,m) {
        if (x==sx || y==sy)
          res += mp[x*10+y];
      }
    }
    cout << res << endl;
  }

}

Measured memory_bytes: 12000
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

X,Y = MI()

ans = "No"
for i in range(X+1):
    j = X - i

    if j*4 + i*2 == Y:
        ans = "Yes"

print(ans)

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


int main() {
    int n; cin >> n;
    vector<int> a(n);
    vector<int> v(100003,0);
    rep(i,n){
        cin >> a[i];
    }
    rep(i,n){
        v[a[i]+1]++;
    }
    vector<int> kari(100001,0);
    rep2(i,100002){
        kari[i-1]=v[i]+v[i-1]+v[i+1];
    }
    int ans=0;
    rep(i,100001){
        if(ans<kari[i]){
            ans=kari[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1408
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#define pb push_back
using namespace std; 
char a[4005], b[4005]; 
int pre[2005], suf[2005], n, ans; 
bool vis[2005]; 
inline bool comp(int x, int y)
{
	return pre[x] > pre[y]; 
}
void work()
{
	memset(vis, false, sizeof(vis)); 
	for (int i = 0; i < n; i++)
		b[i + n] = b[i]; 
	int lst = -1; 
	for (int i = 0; i < n; i++)
	{
		if (b[i])
			lst = i; 
	}
	for (int i = n; i < n << 1; i++)
	{
		if (b[i])
			lst = i; 
		pre[i - n] = i - lst; 
	}
	lst = n; 
	for (int i = n * 2 - 1; i >= n; i--)
	{
		if (b[i])
			lst = i; 
	}
	for (int i = n - 1; i >= 0; i--)
	{
		if (b[i])
			lst = i; 
		suf[i] = lst - i; 
	}
	for (int i = 0; i < n; i++)
	{
		int res = i; 
		vector<int> vec; 
		for (int j = 0; j < n; j++)
		{
			if (b[i + j])
				vis[j] = true; 
			if (a[j] ^ b[i + j])
			{
				res++; 
				if (!vis[j])
					vec.pb(j); 
			}
		}
		if (vec.size() && lst == n)
			continue; 
		sort(vec.begin(), vec.end(), comp); 
		int mx = 0; 
		for (int j = 0; j < vec.size(); j++)
		{
			ans = min(ans, res + mx * 2 + pre[vec[j]] * 2); 
			mx = max(mx, suf[(i + vec[j]) % n]); 
		}
		ans = min(ans, res + mx * 2); 
	}
}
int main()
{
	// freopen("ARC019-D.in", "r", stdin); 
	scanf("%s%s", a, b); 
	n = strlen(a); 
	for (int i = 0; i < n; i++)
	{
		a[i] -= '0'; 
		b[i] -= '0'; 
	}
	ans = 1e9; 
	work(); 
	reverse(a, a + n); 
	reverse(b, b + n); 
	work(); 
	printf("%d\n", ans == 1e9 ? -1 : ans);
	return 0; 
}


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

int main(){
    int a,b; cin >> a >> b;
    int x;
    if(b < 10){
        x = 10*a + b;
    }else if(b < 100){
        x = 100*a + b;
    }else{
        x = 1000*a + b;
    }
    for(int i=0;i<317;i++){
        if(i*i == x){
            cout << "Yes" << endl;
            x = 0;
            break;
        }
    }
    if(x != 0){
        cout << "No" << endl;
    }
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <bitset>

using namespace std;
typedef long long ll;

int main() {
	int N; cin >> N;
	vector<string> name(N);
	vector<ll> len(N);
	for (int i = 0; i < N; i++) {
		cin >> name[i];
		cin >> len[i];
	}
	string X; cin >> X;
	for (int i = 0; i < N; i++) {
		if (name[i] == X) {
			ll s = 0;
			for (int j = i + 1; j < N; j++) {
				s += len[j];
			}
			cout << s << endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d %d %d %d", $H, $W, $A, $B);
for ($i = 0; $i < $H; $i++) {
    $tmp = [];
    for ($j = 0; $j < $W; $j++) {
        $x = ($i < $B) + ($j < $A);
        $tmp[] = $x % 2;
    }
    echo implode("", $tmp) . PHP_EOL;
}


Measured memory_bytes: 5624