akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int H, W;
    cin >> H >> W;
    string S[H][W];
    rep(i, H) rep(j, W) cin >> S[i][j];
    rep(i, H) {
        rep(j, W) {
            if (S[i][j] == "snuke") {
                char tmp = 'A' + j;
                cout << tmp << i+1 << endl;
                return 0;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 256
N=int(input())
*P,=map(int,input().split())
*Q,=map(int,input().split())
nl=[i for i in range(1,N+1)]

import itertools
per=list(itertools.permutations(nl,N))

PP=per.index(tuple(P))+1
QQ=per.index(tuple(Q))+1
print(abs(PP-QQ))

Measured memory_bytes: 8052
#include <bits/stdc++.h>
 
using namespace std;
#define int long long
#define INF 1ll<<60
#define pb push_back
#define mp make_pair
#define endl "\n"
signed main(){
	int vet[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	int n;
	cin>>n;
	cout<<vet[n-1]<<endl;

}

Measured memory_bytes: 256
/**
 * Created by hiramekun at 20:52 on 2019-08-24.
 */
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}


template<class T>
istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    ll n;
    cin >> n;
    ll ans = 1;
    while (n) {
        ans *= n;
        ans %= mod;
        n--;
    }
    cout << ans << '\n';
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Measured memory_bytes: 256
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

ll gcd(ll a,ll b){
	return (b==0?a:gcd(b,a%b));
}
ll lcm(ll a,ll b){
	return a/gcd(a,b)*b;
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n;
	cin>>n;
	int out=0;
	rep(i,n)rep(j,n)rep(k,n)out+=gcd(i+1,gcd(j+1,k+1));
	cout<<out<<endl;
}












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

int main(void){
    int a,b,c,x,y;
    long long result;
    cin >> a >> b >> c >> x >> y;
    if(a + b > c * 2){
        int min = (x > y)? y : x;
        int mina = (x > y)? b : a;
        int max = (x > y)? x : y;
        int maxa = (x > y)? a : b;
        long long temp = c * 2 * min;
        result = temp + (max - min) * maxa;
        for(int i = min + 1, j = 1; i <= max; i++, j++){
            int temp1 = temp + c * j * 2 + (max - i) * maxa;
            if(result > temp1) result = temp1;
        }
    } else {
        result = x * a + y * b;
    }
    cout << result << endl;
    return 0;
}


Measured memory_bytes: 256
# https://atcoder.jp/contests/abc075/tasks/abc075_c
# グラフの橋という概念を扱う問題 #関節点と似た概念

# 螺旋本の用語を使えば、prenum[p]<lowest[u]となるedge(p,u)が橋

import sys
sys.setrecursionlimit(2**16 - 1)
from collections import defaultdict

INF = 10**9
N, M = list(map(int, input().split()))
G = defaultdict(list)
for _ in range(M):
    a, b = list(map(int, input().split()))
    G[a].append(b)
    G[b].append(a)

# graph Gがdefaultdictで定義された隣接リストであること前提とする。
# n_Vは頂点数
prenum = defaultdict(lambda: None)
parent = defaultdict(lambda: None)
lowest = defaultdict(lambda: None)
timer = 0  # dfsに入った順番を記録(prenum用)
is_visited = defaultdict(lambda: False)  # 木を作るために循環してはいけない
root = 0

# 1のフェーズ、prenumとparent,lowestについて確定していく。


def dfs(cur, prev):  # 次に訪問するノードが以前のノードprevではないことを識別する必要があるので引数がこうなっている
    # 関数に入るときにprenumとparentを確定してく
    global timer
    prenum[cur] = lowest[cur] = timer  # 教科書の説明とは違ってprenumは0スタートだが本質的な違いはない
    timer += 1
    parent[cur] = prev
    is_visited[cur] = True

    # 次のノードに訪問していく
    for nx in G[cur]:  # nxは次に探索すべきノード
        if (not is_visited[nx]):
            dfs(nx, cur)
            lowest[cur] = min(lowest[cur], lowest[nx]
                              )  # 子のlowestの最小値が取得できる
        elif nx != prev:  # 探索済みにつながる木以外の経路 いわゆるback-edge
            # back-edge先のノードの方とどっちが小さいか比較
            lowest[cur] = min(lowest[cur], prenum[nx])


dfs(1, None)

# 2のフェーズ bredgeを見つけていく
# 螺旋本の用語を使えば、prenum[p]<lowest[u]となるedge(p,u)が橋
ans = 0
for u, p in parent.items():
    if p is None:
        continue
    if prenum[p] < lowest[u]:
        ans += 1
print(ans)


Measured memory_bytes: 3444
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;

#define INIT std::cin.tie(0);std::ios::sync_with_stdio(false);
#define ALL(c) (c).begin(), (c).end()
#define CALL(c) (c).cbegin(), (c).cend()
#define RALL(c) (c).rbegin(), (c).rend()
#define CRALL(c) (c).crbegin(), (c).crend()
#define REP(i, n) for (int i = 0; i < static_cast<int>(n); i++)
#define FOR(i, s, n) for (int i = s; i < static_cast<int>(n); i++)
#define ASC(t) [](t& x, t& y){ return x < y; }
#define DESC(t) [](t& x, t& y){ return x > y; }
#define PSORT(s,p,e) partial_sort((s), next((s), (p)), (e))
#define VIEW(v,t) for_each((v).begin(), (v).end(), [](t& a) { cout << a << " "; }); cout << endl;

#define IN(a, x, b) (a<=x && x<=b)
template<class T> inline T CHMAX(T& x, const T y){return x=(x<y)?y:x;}
template<class T> inline T CHMIN(T& x, const T y){return x=(x>y)?y:x;}
#define OUT(dist) std::cout<<(dist);
#define WS std::cout<<" ";
#define NL std::cout<<"\n"

using PII = pair<int, int>;
using PLL = pair<long long, long long>;
using LL = long long;
using ULL = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using V2 = vector<vector<T>>;
template<class T, int W=255> using A = array<T, W>;
template<class T, int W=255, int H=255> using A2 = array<array<T, W>, W>;



int main(){
    INIT;
    int p,q,r;
    cin >> p >> q >> r;
    int ans = std::min(p+q,q+r);
    ans = std::min(ans,p+r);
    cout << ans;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(100000)
from collections import defaultdict
edges = []
to = defaultdict(list) # 1から到達できるか
ot = defaultdict(list) # Nから到達できるか
N, M, P = map(int, input().split())
visited_toN = [False]*(N+1)
visited_fm1 = [False]*(N+1)    
for i in range(M):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    edges.append((a,b,-c+P))
    to[a].append(b)
    ot[b].append(a)

def dfs(v):
    global visited_fm1
    if visited_fm1[v]:return
    visited_fm1[v] = True
    for nxt in to[v]:
        dfs(nxt)
    
def dfs_r(v):
    global visited_toN
    if visited_toN[v]:return
    visited_toN[v] = True
    for nxt in ot[v]:
        dfs_r(nxt)
        
dfs(0)
dfs_r(N-1)
is_ok = []

for s, t in zip(visited_fm1,visited_toN):
    is_ok.append(s and t)


# BellmanFord    
INF = 10 ** 18
def bellmanFord(n, edges, s, g):
    """
    input
        n : 頂点の数
        edges : (始点, 終点, コスト)のリスト
        s : 探索の始点
        g : 探索の終点
    output
        sから各点への最短距離
    """    
    d = [INF] * n
    d[s] = 0
    cnt = 0
    while True:
        update = False
        for a, b, c in edges:
            if not is_ok[a]:continue
            if not is_ok[b]:continue
            if d[a] != INF and d[b] > d[a] + c:
                d[b] = d[a] + c
                update = True
        if not update:
            break
        cnt += 1
        # 負閉路の存在をチェック
        if cnt > n:
            print(-1)
            exit()
        # print(d,cnt)
    return d[g]



ans = bellmanFord(N,edges,0,N-1)
print(max(0,-ans))


Measured memory_bytes: 65880
t = lambda c: ord(c) - ord('A') + 1
h = lambda c: chr(c+64)
n = int(input())
a = input()
l = list(a)
f = []
for i in l:
    p = int(t(i))
    j = p+n
    while j >26:
        j-=26
    b = h(j)
    f.append(b)
print("".join(f))


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

int main(){
  int N;
  cin >> N;
  vector<int> Ls(N);
  for(int i = 0; i < N; i++){
    cin >> Ls.at(i);
  }
  
  sort(Ls.begin(), Ls.end());
  
  int sum = 0;
  for(int i = 0; i < N - 1; i ++){
    sum += Ls.at(i);
  }
  if(sum > Ls.at(N-1)){cout << "Yes" << endl;}
  else {cout << "No" << endl;}
  return 0;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main() {
  string S;
  int K;
  cin >> S >> K;
  vector<string> Ans(0);
  REP(i, 26) {
    char c = i + 'a';
    REP(j, S.size()) {
      if (S[j] == c) {
        for (int k = 1; k < 11; k++) {
          if (S.size() < j + k) break;
          Ans.push_back(S.substr(j,k));
        }
      }
    }
    if (10 < Ans.size()) break;
  }

  sort(Ans.begin(), Ans.end());
  string tmp = "";
  ll ans = 0;
  REP(i, Ans.size()) {
    if (Ans[i] != tmp) {
      tmp = Ans[i];
      ans++;
      if (ans == K) {
        cout << tmp << endl;
        return 0;
      }
    }
  }
  /*vector<string> s(0);
  REP(i, S.size()) {
    for (int j = 1; j <= S.size()-i; j++) {
      s.push_back(S.substr(i, j));
    }
  }
  sort(s.begin(), s.end());
  string tmp = "";
  ll ans = 0;
  REP(i,s.size()){
    if(s[i]!=tmp){
      tmp = s[i];
      ans++;
      if(ans==K){
        cout<<tmp<<endl;
        return 0;
      }
    }
  }*/
}

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

int main() {
  ll n,a,b;
  cin>>n>>a>>b;

  ll ans;
  if (a>b) ans=0;
  else if (n==1&&b!=a) ans=0;
  else ans=(n-2)*(b-a)+1;

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

Measured memory_bytes: 256
package main

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

func main() {
	S := sc.next()
	SArr := strings.Split(S, "")
	mmp := make(map[string]int)
	for i := 0; i < 4; i++ {
		mmp[SArr[i]]++
	}
	if len(mmp) != 2 {
		no()
		return
	}
	for _, v := range mmp {
		if v != 2 {
			no()
			return
		}
	}
	yes()
}

var (
	sc scanner
)

func init() {
	sc = scanner{
		buf: make([]string, 0, 0),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 0)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}
func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}
func (s *scanner) resetCur() {
	s.cur = 0
}
func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}
func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}
func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur],
		64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i],
			64)
	}
	s.resetCur()
	return res
}
func digits(x int) int {
	return len(strconv.Itoa(x))
}
func powInt(x, p int) (result int) {
	result = 1
	for i := 0; i < p; i++ {
		result *= x
	}
	return
}
func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}
func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}
func abs(x int) int {
	return int(math.Abs(float64(x)))
}
func varDump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}
func yes() {
	fmt.Println("Yes")
}
func no() {
	fmt.Println("No")
}

// Pair a
type Pair struct {
	first  int
	second int
}

// Queue a
type Queue struct {
	v []Pair
}

// Push for queue
func (q *Queue) Push(v Pair) {
	q.v = append(q.v, v)
}

// Pop for queue
func (q *Queue) Pop() Pair {
	r := q.v[0]
	q.v = q.v[1:]
	return r
}

// Front for queue
func (q Queue) Front() Pair {
	return q.v[0]
}

// Empty return true if empty
func (q Queue) Empty() bool {
	return len(q.v) == 0
}


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

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

const int MOD = 1e+9 + 7;

template <typename T>
T pow_mod( T n, T p, T m )
{
    if( p == 0 ) return 1;
    if( p%2 == 1 ) return pow_mod(n, p-1, m) * n % m;
    else{
        T tmp = pow_mod(n, p/2, m) % m;
        return tmp * tmp % m;
    }
}


int main()
{
    int N, K;
    cin >> N >> K;

    vector<long long> num_cases(K+1);
    long long ans = 0, one_cases = pow_mod<long long>(K, N, MOD);
    // gcd が i になるものの個数を求める
    for(int i = K; i >= 1; --i){
        num_cases[i] = pow_mod<long long>(K/i, N, MOD);
        int j = 2;
        while(i*j <= K){
            num_cases[i] -= num_cases[i*j];
            j++;
        }
        ans += (i * num_cases[i]) % MOD;
    }
    cout << ans % MOD << endl;
    

    return 0;
}

Measured memory_bytes: 3564
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define reps(i, m, n) for (int i = m; i <= n; ++i)
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;

ll x, y;

signed main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> x >> y;
  if (x % y == 0) {
    cout << -1 << endl;
  }
  else cout << x << endl;
  return 0;
}

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

typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

string s;

int main(){
  cin >> s;
  if(s == "Sunny"){
    cout << "Cloudy" <<endl;
  }else if(s == "Cloudy"){
    cout << "Rainy" <<endl;
  }else{
    cout << "Sunny" <<endl;
  }
}

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

int main(){
    string s;
    char a='a';
    cin>>s;
    sort(s.begin(),s.end());
    for(int i=0; i<s.size(); i++){
        if(s.at(i)==a){
            a++;
        }
    }
    if(a>'z'){
        cout<<"None"<<endl;
    }else{
        cout << a <<endl;
    }
}

Measured memory_bytes: 512
eval"N,C,*H="+`dd`.split*?,;g,*q=->i{x,y=q[i,2];1.0*($*[x]-$*[y])/(H[y]-H[x])-H[x]-H[y]};p$*[N.times{|i|q.shift while q[-2]&&g[0]>-2*H[i];$*<<(i>0?$*[q[0]]+C+(H[q[0]]-H[i])**2:0);q.pop 2while(q<<i)[-3]&&g[-2]>g[-3]}-1]

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

int L[MAX/2+2],R[MAX/2+2];

ll merge(int A[],int n,int left,int mid,int right){
    int i,j,k;
    ll cnt=0;
    int n1=mid-left;
    int n2=right-mid;
    rep(i,n1) L[i]=A[left+i];
    rep(i,n2) R[i]=A[mid+i];
    L[n1]=R[n2]=SENTINEL;
    i=j=0;

    for(k=left;k<right;k++){
        if(L[i]<=R[j]){
            A[k]=L[i++];
        }else{
            A[k]=R[j++];
            cnt+=n1-i;
        }
    }
    return cnt;
}

ll mergeSort(int A[],int n,int left,int right){
    int mid;
    ll v1,v2,v3;
    if(left+1<right){
        mid=(left+right)/2;
        v1=mergeSort(A,n,left,mid);
        v2=mergeSort(A,n,mid,right);
        v3=merge(A,n,left,mid,right);
        return v1+v2+v3;
    }else return 0;
}

int main(){
    int A[MAX],n,i;
    cin>>n;

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

    ll ans=mergeSort(A,n,0,n);

    cout<<ans<<endl;

    return 0;
}


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

int main(){
	int n;
	while(cin >> n && n){
		int a[100],b[100];
		string s; cin >> s;
		for(int i = 0 ; i < n ; i++){
			cin >> a[i] >> b[i];
			a[i]--,b[i]--;
		}
		for(int i = n-1 ; i >= 0 ; i--){
			int d = abs(a[i]-b[i]);
			s[a[i]] = (s[a[i]] - 'a' + d) % 26 + 'a';
			s[b[i]] = (s[b[i]] - 'a' + d) % 26 + 'a';
			swap(s[a[i]],s[b[i]]);
		}
		cout << s << endl;
	}
}

Measured memory_bytes: 0
import sys

input = sys.stdin.buffer.readline


def popcnt(n):
    c = (n & 0x5555555555555555) + ((n >> 1) & 0x5555555555555555)
    c = (c & 0x3333333333333333) + ((c >> 2) & 0x3333333333333333)
    c = (c & 0x0F0F0F0F0F0F0F0F) + ((c >> 4) & 0x0F0F0F0F0F0F0F0F)
    c = (c & 0x00FF00FF00FF00FF) + ((c >> 8) & 0x00FF00FF00FF00FF)
    c = (c & 0x0000FFFF0000FFFF) + ((c >> 16) & 0x0000FFFF0000FFFF)
    c = (c & 0x00000000FFFFFFFF) + ((c >> 32) & 0x00000000FFFFFFFF)
    return c


n = int(input())
A = [list(map(int, input().split())) for _ in range(n)]
mod = 10 ** 9 + 7
dp = [0] * (pow(2, n))
dp[0] = 1
saidai = pow(2, n)
# dp[i][j] 男i人に対して女の集合Sが合致
bitcnt = [0] * (saidai + 1)
for s in range(saidai):
    # otoko = bin(s).count("1")
    # bitcnt[s] = bitcnt[s // 2] + s % 2
    i = popcnt(s)
    for j in range(n):
        if (s >> j) & 1 == 0:
            if A[i][j] == 1:
                ns = s | 1 << j
                dp[ns] += dp[s]
                dp[ns] %= mod
print(dp[saidai - 1])


Measured memory_bytes: 74220
from heapq import heappush, heappop

x, y, z, k = map(int, input().split())
a = [int(m) for m in input().split()]
b = [int(m) for m in input().split()]
c = [int(m) for m in input().split()]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
Q = [[-(a[0] + b[0] + c[0]), 0, 0, 0]]
ansli = []
se = set()
se.add("0,0,0")
for i in range(k):
    tmp = heappop(Q)
    ansli.append(tmp)
    if tmp[1] != x - 1 and str(tmp[1] + 1) + "," + str(tmp[2]) + "," + str(tmp[3]) not in se:
        heappush(Q, [-(a[tmp[1] + 1] + b[tmp[2]] + c[tmp[3]]), tmp[1] + 1, tmp[2], tmp[3]])
        se.add(str(tmp[1] + 1) + "," + str(tmp[2]) + "," + str(tmp[3]))
    if tmp[2] != y - 1 and str(tmp[1]) + "," + str(tmp[2] + 1) + "," + str(tmp[3]) not in se:
        heappush(Q, [-(a[tmp[1]] + b[tmp[2] + 1] + c[tmp[3]]), tmp[1], tmp[2] + 1, tmp[3]])
        se.add(str(tmp[1]) + "," + str(tmp[2] + 1) + "," + str(tmp[3]))
    if tmp[3] != z - 1 and str(tmp[1]) + "," + str(tmp[2]) + "," + str(tmp[3] + 1) not in se:
        heappush(Q, [-(a[tmp[1]] + b[tmp[2]] + c[tmp[3] + 1]), tmp[1], tmp[2], tmp[3] + 1])
        se.add(str(tmp[1]) + "," + str(tmp[2]) + "," + str(tmp[3] + 1))

for i in range(k):
    print(-ansli[i][0])

Measured memory_bytes: 5432
var
  n:longint;
Procedure find(x:longint);
begin
  if x=0 then exit;
  if x mod -2<0 then
    begin
	  find(x div -2 +1);
	  write(x mod -2+2);
	end else
	begin
	  find(x div -2);
	  write(x mod -2);
    end;
end;
begin
  read(n);
  if n=0 then write(0) else
  find(n);
end.


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

#define INF 1e9
using namespace std;

#define REPR(i, n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()

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

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

typedef long long ll;

// 白いますの数を数えて、手数から引いた数をスコアとする。

void print(int N, int W, const vector<vector<char>> &M) {
    REP(i, N + 2) {
        REP(j, W + 2) {
            cout << M[i][j];
        }
        cout << endl;
    }
}

void print(int N, int W, const vector<vector<int>> &cost) {
    REP(i, N + 2) {
        REP(j, W + 2) {
            cout << cost[i][j] << ",";
        }
        cout << endl;
    }
}

const string VecStr = "UDLR";

int main() {
    vector<pair<int, int>> vec(4);
    vec[0] = make_pair(-1, 0);
    vec[1] = make_pair(1, 0);
    vec[2] = make_pair(0, -1);
    vec[3] = make_pair(0, 1);

    int H, W;
    cin >> H >> W;
    vector<vector<char>> M(H + 2, vector<char>(W + 2));
    vector<vector<int>> cost(H + 2, vector<int>(W + 2, -1));

    // 一旦変数に代入しないといけない
    auto s = string(W + 2, '#');
    vector<char> t(ALL(s));
    M[0] = t;
    M[H + 1] = t;
    int whiteCount = 0;
    FOR(i, 1, H + 1) {
        string str;
        string sharp = "#";
        cin >> str;
        str = sharp + str + sharp;
        M[i] = vector<char>(ALL(str));
        whiteCount += count(ALL(M[i]), '.');
    }
    queue<pair<int,int>> que;
    que.push(make_pair(1,1));
    while (!que.empty()) {
        auto now = que.front();
        que.pop();
        if (now.first == H && now.second == W) {
            cout << whiteCount-cost[now.first][now.second]-2 << endl;
            return 0;
        }
        REP(i,4) {
            pair<int,int> pos = make_pair(now.first+vec[i].first,now.second+vec[i].second);
            if (M[pos.first][pos.second]=='#') continue;
            if (cost[pos.first][pos.second]!=-1) continue;
            cost[pos.first][pos.second]=cost[now.first][now.second]+1;
            que.push(pos);
        }
    }

    cout << -1 << endl;

    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/ruby
#encoding: utf-8

if !ENV['RUBY_THREAD_VM_STACK_SIZE']
  exec({'RUBY_THREAD_VM_STACK_SIZE'=>'1000000000'}, '/usr/bin/ruby', $0)
end

n = gets.to_i
$fact = Array.new(1000000,-1)
MOD = 1e9.to_i + 7

def factorial(n)
  return 1 if n == 1
  return $fact[n] if $fact[n] != -1
  return $fact[n] = n * (factorial(n-1) % MOD)
end

puts factorial(n) % MOD

Measured memory_bytes: 26064
#include <stdio.h>
#include <string.h>
int i, n, itikara, zerokara;
char s[101010];
int main(void)
{
    scanf("%s", s);
    n = strlen(s);
  
    for (i = 0; i < n; i++)
    {
        if (i % 2+ '0' != s[i])
        {
            zerokara += 1;
        }
        else
        {
            itikara += 1;
        }
    }
 // printf("%d\n%d",itikara,zerokara);
    if(zerokara <= itikara){
        printf("%d",zerokara);
    }else{
        printf("%d",itikara);
    }
    return 0;
}


Measured memory_bytes: 256
N = int(input())
A, B = map(int, input().split())
p = list(map(int, input().split()))


x = 0
y = 0
z = 0

for i in sorted(p):
  if i <= A:
    x += 1
  elif i <= B:
    y += 1
  else:
    z += 1
    
print(min(x,y,z))

Measured memory_bytes: 3060
#include <stdio.h>

int main(void)
{
  int a,b;
  scanf("%d %d",&a,&b);
  
  int num[(2*a)-1];
  
  int i;
  int count=0;
  for(i=(b-a)+1;i<(b+a)+1;++i){
      num[count]=i;
      ++count;
  }
  
  for(i=0;i<2*a-1;++i){
      printf("%d",num[i]);
      
      if(i!=2*a-2){
          printf(" ");
      }
  }
  
  
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
long long App[100100];
int main()
{
	int N;
	cin>>N;
	long long Sum=0;
	while(N--)
	{
		int X;
		cin>>X;
		App[X]++;
		Sum+=X;
	}
	int Q;
	cin>>Q;
	while(Q--)
	{
		int F,T;
		cin>>F>>T;
		Sum-=App[F]*F;
		Sum+=App[F]*T;
		App[T]+=App[F];
		App[F]=0;
		cout<<Sum<<endl;
	}
	return 0;
}

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

using namespace std;
#define ll long long
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define PRINT(item) cout << (item) << endl;
#define PRINT_VEC(V) \
    for (auto v : (V)) cout << v << ' ';
const int MOD = 1000000007;
/* cout << fixed << setprecision(10) << decimal << endl; */

int main() {
    /* code */
    int N, R;
    cin >> N >> R;
    if (N >= 10) {
        cout << R << endl;
    } else {
        cout << R + (100 * (10 - N)) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
vector<int> adj[100005];
int indegree[100005];
bool vis[100005];
int dist[100005];
void dfs(int a) {
  vis[a] = true;
  for(int it: adj[a]) {
    dist[it] = max(dist[it],1+dist[a]);
    indegree[it]--;
    if(indegree[it]== 0 && !vis[it]) {
      dfs(it);
    }
  }
}
int main() {
  int n,m;
  cin>>n>>m;
  for(int i = 0;i<m;i++) {
    int u,v;
    cin>>u>>v;
    adj[u].push_back(v);
    indegree[v]++;
  }
  //printf("he;;\n");
  for(int i = 1;i<=n;i++) {
    if(indegree[i]==0 && !vis[i]) {
      dfs(i);
    }
  }
  int ans = 0;
  for(int i = 1;i<=n;i++) {
    ans = max(ans,dist[i]);
  }
  cout<<ans<<endl;
}

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

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

    int n, k; cin >> n >> k;
    map<int,int> m;
    rep(i,k){
        int d; cin >> d;
        vector<int> a(d); rep(j,d){
            cin >> a[j];
            if(m[a[j]] == 0) n--;
            m[a[j]]++;
        }
    }
    cout << n << endl;
}

Measured memory_bytes: 3656
N, = map(int, input().split())
X = list(map(int, input().split()))
from collections import defaultdict
d = defaultdict(int)
for i in range(N):
    d[X[i]] += 1

r = 0
for k in d:
    x = d[k]
    r += x*(x-1)//2

for i in range(N):
    x = d[X[i]]
    print(r - (x*(x-1)//2) + (x-1)*(x-2)//2)


Measured memory_bytes: 88140
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] A = new int [N];
        for(int i=0; i<N; i++){
            A[i] = sc.nextInt();
        }
        int ans = Integer.MAX_VALUE;
        for(int j=-100; j<=100; j++){
            int tmp=0;
            for(int i=0; i<N; i++){
                int d = j-A[i];
                tmp+=(d*d);
            }
            ans=Math.min(tmp,ans);
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 9812
n = gets.to_i
ww = gets.split.map(&:to_i)

min = 1000
0.upto(n-1-1) do |i|
  sum1 = ww[0..i].inject(:+)
  sum2 = ww[i+1..n-1].inject(:+)

  if (sum1-sum2).abs < min
    min = (sum1-sum2).abs
  end
end

puts min

Measured memory_bytes: 1916
#define Oo ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
#define PI acos(-1.0)
typedef long long ll;
string s, t;
ll f(int sta)
{
      int flag=0;
      for (int i=0; i<t.size(); i++)
      {
            if (s[i+sta]==t[i])flag++;
      }
      return t.size()-flag;
}
int main()
{
      Oo
      ll ans=INT_MAX;
      cin>>s >> t;
      for (int i=0; i<=s.size()-t.size(); i++)
      {
            ans=min(ans, f(i));
      }cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define maxn 205
using namespace std;
int n,m,a[maxn],lk[maxn];
vector<int>G[maxn];
bool vis[maxn];
bool dfs(int u){
	for(int v:G[u]) if(!vis[v]){
		vis[v]=1;
		if(!lk[v]||dfs(lk[v])) return lk[v]=u,1;
	}
	return 0;
}
inline bool check(int x){
	if(x<=2) return 0;
	for(int i=2;i*i<=x;i++) if(x%i==0) return 0;
	return 1;
}
int main()
{
	scanf("%d",&n);
	for(int i=1,pre=-1,now;i<=n;i++,pre=now){
		scanf("%d",&now);
		if(pre<now-1) a[++m]=now,a[++m]=now+1;
		else a[m]=now+1;
	}
	int cnt[2]={0},ans=0;
	for(int i=1;i<=m;i++) cnt[a[i]&1]++; 
	for(int i=1;i<=m;i++) if(!(a[i]&1))
		for(int j=1;j<=m;j++) if((a[j]&1)&&check(abs(a[j]-a[i])))
			G[i].push_back(j);
	for(int i=1;i<=m;i++) if(!(a[i]&1)) memset(vis,0,sizeof vis),ans+=dfs(i);
	printf("%d\n",ans+(m-2*ans)+(cnt[0]-ans)%2);
}

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

int		main(void)
{
	long long n, a, b;
	cin >> n >> a >> b;
	long long ans;
	long long tmp = 0;
	ans = 0;

	tmp = n % (a + b);
	if (tmp <= a)
		ans = a * (n / (a + b)) + n % (a + b);
	else
		ans = a * (n / (a + b) + 1);
	cout << ans;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <iomanip>
#include <queue>
#define inp(X) cin >> X
#define out(X) cout << X << endl
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define MAX(A) *max_element(A.begin(),A.end())
#define MIN(A) *min_element(A.begin(),A.end())
#define SORT(A) sort(A.begin(),A.end())
using namespace std;

typedef long long int ll;
#define MOD 1000000007
#define INF 1000000001

ll gcd(ll x, ll y){
	if(y==0) return x;
	return gcd(y,x%y);
}

bool bfs(vector<vector<int>> g, vector<int> &dist, int sv)
{
	queue<int> q;
	q.push(sv);
	dist[sv]=0;
	while(!q.empty()){
		int now = q.front(); q.pop();
		for(auto v : g[now]){
			if(dist[v]!=-1) continue;
			dist[v] = dist[now]+1;
			q.push(v);
		}
	}
}

int main(void) {
	int n; cin >> n;
	vector<pair<int,int>> p;
	rep(i,n){
		int a; cin >> a;
		p.emplace_back(a,i);
	}
	SORT(p);
	rep(i,n){
		if(p[n-1].second==i) out(p[n-2].first);
		else out(p[n-1].first);
	}
}




Measured memory_bytes: 3312
#include <bits/stdc++.h>
#include <vector>
 
using namespace std;
const double PI=3.14159265358979323846;
 
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (n); ++i)

int main() {

	string s;

	cin >> s;

	string ans = "ARC";
	if (ans == s) ans = "ABC";

	cout << ans << endl;
}



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

using namespace std;

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

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

int main() {
  int N, W;
  cin >> N >> W;
  vector<int> WS(N), VS(N);
  for (int i = 0; i < N; i++) {
    cin >> WS[i] >> VS[i];
  }
  int MAX_V = 100005;
  vector<vector<long long>> dp(N + 5, vector<long long>(MAX_V, 1e15));
  dp[0][0] = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < MAX_V; j++) {
      chmin(dp[i + 1][j], dp[i][j]);
      if (j + VS[i] < MAX_V) {
        chmin(dp[i + 1][j + VS[i]], dp[i][j] + WS[i]);
      }
    }
  }
  int ans = 0;
  for (int j = 0; j < MAX_V; j++) {
    if (dp[N][j] <= W) {
      chmax(ans, j);
    }
  }
  cout << ans << endl;

  return 0;
}
/* vim:set fdm=marker: */


Measured memory_bytes: 83328
#include<iostream>
#include<math.h>
using namespace std;
int main(){
    int a,b,c;
    int k;
    cin>>a>>b>>c;
    cin>>k;
    int i;
    int nb,nc;
    int count=0;
    for(i=0;i<=k;i++){
        nb=b*pow(2,i);
        nc=c*pow(2,(k-i));
        if((int)nb>a&&(int)nc>(int)nb){
            count++;
        }
    }
    if(count==0){
        cout<<"No";
    }
    else{
        cout<<"Yes";
    }
}

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

int main ()
{
	int a[4];
	for(int i = 0; i < 3; i++)
		cin >> a[i];
	sort(a, a+3);
	for(int i = 0; i < 3; i++)
	{
		if(i)
			cout << " ";
		cout << a[i];
	}
	cout << endl;
	return 0;
} 


Measured memory_bytes: 3052
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long int ll;
typedef long double ld;
#define pii pair<int,int>
#define pll pair<ll,ll>
ll ten[11];
ll chk(ll x)
{
	vector<ll> v;
	ll a,f=1;
	while(x)
	{
		a = x%10;
		v.pb(a);
		x/=10;
	}
	for(ll i=0;i<v.size()-1;i++)
	{
		if(abs(v[i+1] - v[i]) > 1)
		{
			f=0;
			break;
		}
	}
	return f;
}

ll next(ll x)
{
	for(ll i=0;i<11;i++)
	{
		ll a = x + ten[i];
		if(chk(a))
		{
			ll b;
			vector<ll> v;
			while(a)
			{
				b = a%10;
				v.pb(b);
				a/=10;
			}
			for(ll j=i-1;j>=0;j--)
			{
				v[j] = max(v[j+1]-1ll,0ll);
			}
			b = 0;
			for(ll j=v.size()-1;j>=0;j--)
			{
				b = 1LL *(v[j] + 10*b);
			}
			return b;
		}
	}
	return -1;
}

int main()
{
	ten[0] = 1;
	for(ll i=1;i<11;i++)
		ten[i] = ten[i-1]*10ll;
	ll n,a;

	cin >> n;
	a = 0;
	for(int i=0;i<n;i++)
	{
		a = next(a);
		// cout << a << endl;
	}
	cout << a << endl;
	return 0; 
}


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

using namespace std;

typedef long long ll;

int main() {
  int N;
  cin>>N;
  vector<tuple<string, int, int>> tuples;
  for (int i = 0; i < N; i++) {
    string s;
    int t;
    cin>>s>>t;
    tuples.emplace_back(s,-t,i+1);
  }
  sort(tuples.begin(),tuples.end());
  for (auto x : tuples) {
    cout<<get<2>(x)<<endl;;
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#define maxn 200010
#define mod 1000000007
#define inf 2000000007
using namespace std;
int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch-'0'<0||ch-'0'>9){if(ch=='-') f=-1;ch=getchar();}
    while(ch-'0'>=0&&ch-'0'<=9){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,X,Y;
struct P{
    int c,w;
}b[maxn];
int a[maxn],top;
int findx(int x)
{
    return lower_bound(a+1,a+top+1,x)-a;
}
int fac[maxn],inv[maxn];
int fa[maxn],mn[maxn],id[maxn];
vector<int>v[maxn];
int find(int x)
{
    if(fa[x]==x)  return x;
    return fa[x]=find(fa[x]);
}
void merge(int x,int y)
{
    int u=find(x),v=find(y);
    if(u==v)  return;
    fa[u]=v;
}
int quick_pow(int x,int p)
{
    int an=1,po=x;
    while(p)
    {
        if(p&1)  an=1ll*an*po%mod;
        po=1ll*po*po%mod;
        p>>=1;
    }
    return an;
}
int res[maxn],cnt[maxn];
int size[maxn];
int main()
{
    fac[0]=1;
    for(int i=1;i<=200000;i++)  fac[i]=1ll*fac[i-1]*i%mod;
    inv[200000]=quick_pow(fac[200000],mod-2);
    for(int i=199999;i>=0;i--)  inv[i]=1ll*inv[i+1]*(i+1)%mod;
    n=read();X=read();Y=read();
    for(int i=1;i<=n;i++)  b[i].c=read(),b[i].w=read();
    for(int i=1;i<=n;i++)  a[++top]=b[i].c;
    sort(a+1,a+top+1);
    top=unique(a+1,a+top+1)-a-1;
    for(int i=1;i<=n;i++)  b[i].c=findx(b[i].c);
    for(int i=1;i<=n;i++)  fa[i]=i;
    for(int i=1;i<=n;i++)  v[b[i].c].push_back(i);
    for(int i=1;i<=top;i++)  mn[i]=inf;
    for(int i=1;i<=n;i++)
    {
        if(b[i].w<mn[b[i].c])
        {
            mn[b[i].c]=b[i].w;
            id[b[i].c]=i;
        }
    }
    int mn1=inf,mn2=inf,id1,id2;
    for(int i=1;i<=top;i++)
    {
        if(mn[i]<mn1)
        {
            mn2=mn1;
            id2=id1;
            mn1=mn[i];
            id1=i;
        }
        else if(mn[i]<mn2)  mn2=mn[i],id2=i;
    }
    for(int i=1;i<=n;i++)
    {
        int x=id[b[i].c];
        if(b[i].w+b[x].w<=X)  merge(i,x);
        if(id1==b[i].c&&b[i].w+b[id[id2]].w<=Y)    merge(id[id2],i);
        else if(id1!=b[i].c&&b[i].w+b[id[id1]].w<=Y)    merge(id[id1],i);
    }
    for(int i=1;i<=n;i++)  size[find(i)]++;
    for(int i=1;i<=n;i++)  res[i]=fac[size[i]];
    for(int i=1;i<=top;i++)
    {
        for(int j=0;j<v[i].size();j++)
        {
            int x=v[i][j];
            int u=find(x);
            res[u]=1ll*res[u]*fac[cnt[u]]%mod;
            cnt[u]++;
            res[u]=1ll*res[u]*inv[cnt[u]]%mod;
        }
        for(int j=0;j<v[i].size();j++)  cnt[find(v[i][j])]=0;
    }
    int ans=1;
    for(int i=1;i<=n;i++)  ans=1ll*ans*res[i]%mod;
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

int main() {
    int n; cin >> n;
    bool found = false;
    for (int i = 1; i <= 9; ++i) {
        if (found) {
            break;
        }
        for (int j = 1; j <= 9; ++j) {
            if (i * j == n) {
                found = true;
                break;
            }
        }
    }

    cout << (found ? "Yes\n" : "No\n");
}

Measured memory_bytes: 3140
X,Y = map(int,input().split())

key1 = Y - 2*X
key2 = 4*X - Y



if key1 % 2 != 0:
    print('No')
elif key2 % 2 != 0:
    print('No')
elif key1 < 0:
    print('No')
elif key2 < 0:
    print('No')
else:
    print('Yes')

Measured memory_bytes: 61928
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef vector<llong> V;

#define _ cin.tie(0);ios::sync_with_stdio(false);
llong n;
int main(){ _;
  cin>>n;
  if(n<1200)
    cout<<"ABC"<<endl;
  else if(n<2800)
    cout<<"ARC"<<endl;
  else
    cout<<"AGC"<<endl;
  

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#define MINR 1
#define MAXR 200000
#define MAXMIN -1000000000
using namespace std;

int main() {
    // input
    int n;
    cin >> n;

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

    // solve
    int min = r[0];
    int max = MAXMIN;
    for (int i = 1; i < n; i++) {
        if (max < r[i] - min) {
            max = r[i] - min;
        }
        if (min > r[i]) {
            min = r[i];
        }
    }

    // output
    cout << max << endl;
}


Measured memory_bytes: 3812
N, M = gets.split.map(&:to_i)
H = gets.split.map(&:to_i)

E = Hash.new { |h, k| h[k] = Hash.new(false) }

M.times do
  a, b = gets.split.map(&:to_i)

  E[a][b] = E[b][a] = true
end

puts (1..N).count { |n|
  good = true
  h = H[n - 1]

  E[n].each_key do |u|
    good &= h > H[u - 1]
  end

  good
}


Measured memory_bytes: 38764
#include <bits/stdc++.h>
 
// limit
#define mod1 22439423LL
#define mod2 42342432LL
#define mod3 56454765LL
#define mod4 66867574LL
#define oo 1000000007LL
#define OO 1000000000000000007LL
#define maxN 1007
 
// loop
#define fto(i, x, y) for(int i = (x); i <= (y); ++i)
#define fdto(i, x, y) for(int i = (x); i >= (y); --i)
#define ftoa(i, x, y, a) for(int i = (x); i <= (y); i += a)
#define fdtoa(i, x, y, a) for(int i = (x); i >= (y); i -= a)
#define ftosqrt(i, x, y) for(int i = (x); i*i <= (y); ++i)
#define ftoit(it, var) for (__typeof(var.begin()) it = var.begin(); it != var.end(); ++it)
#define fdtoit(rit, var) for (__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); ++rit)
 
// debug
#define debug cout << "*" << endl;
#define bug1d(a, x, y) { cout << #a << ": "; fto(_, x, y) cout << a[_] << ' '; cout << endl; }
#define bug2d(a, x, y, u, v) { cout << #a << ": " << endl; fto(i, x, y) {fto(j, u, v) cout << a[i][j] << ' '; cout << endl;}; cout << endl;}
#define bug(a) cout << #a << " = " << a << endl;
#define bug2(a, b) cout << #a << " = " << a << "; "; cout << #b << " = " << b << endl;
#define bug3(a, b, c) cout << #a << " = " << a << "; "; cout << #b << " = " << b << "; "; cout << #c << " = " << c << endl;
 
// operation
#define mp make_pair
#define pb push_back
#define pf push_front
// structure
#define ii pair<int, int>
#define iii pair<ii, int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>
#define matrix vector<vi>
 
// get value
#define FF first
#define SS second
 
// data type
#define ll long long
#define ull unsigned long long
 
// function
#define lb lower_bound
#define ub upper_bound
 
// const value
#define pi 3.14159265358979323846264338327950288419716939937510
 
using namespace std;
 
template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}
 
template <class T>
T min(T a, T b, T c, T d) {
    return min(a, min(b, min(c, d)));
}
 
template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}
 
template <class T>
T max(T a, T b, T c, T d) {
    return max(a, max(b, max(c, d)));
}
 
bool cmp(const ii& a, const ii& b) {return (a.FF > b.FF || (a.FF == b.FF && a.SS >= b.SS));}
ll GCD(ll a, ll b) {return (a%b) ? GCD(b, a%b) : b;}
 
const string namePro = "tmp";

ll f[maxN][2];
int a[maxN];

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

    fto (i, 1, n) scanf("%d", &a[i]);
    f[0][0] = 1LL;

    fto (i, 1, n) {
        f[i][0] = f[i-1][0];
        f[i][1] = f[i-1][1];

        if (a[i]%2) {
            f[i][0] += f[i-1][1];
            f[i][1] += f[i-1][0];
        }
        else {
            f[i][0] += f[i-1][0];
            f[i][1] += f[i-1][1];
        }
    }

    printf("%lld\n", f[n][p]);
    return 0; 
} 

Measured memory_bytes: 256
/* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
 
#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d",&n)
#define lscf(n) scanf("%lld",&n)
#define lpri(n) printf("%lld ",n)
#define pri(n) printf("%d ",(int)n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define rep(i,ini,n) for(int i=ini;i<(int)n;i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x)     x.begin(),x.end()
#define tc   int tt; scf(tt); while(tt--)
#define inf INT_MAX
#define ninf INT_MIN
#define gcd __gcd
#define bitcount(n) __builtin_popcount(n)
typedef double dd;
using namespace std;
const ll mod =1e9+7;
const int N =1e5+3;

int a[N],ctr[N]; 
  
int main()
{
    
     int n;
     scf(n);
     
     ll ans=-1,x=1;
    
     ll a[n];
     
    rep(i,0,n)
    {
         lscf(a[i]);
         
         if(a[i]==0)
         {
             ans=0;
             prin(0);
             return 0;
         }
         

    }
    
    if(ans!=0)
    {
        long double val=0;
        
        rep(i,0,n)
        val+=log10(a[i]);
        
        if(val>18.1)
        {
            prin(-1);
            return 0;
        }
        
        else
        {
            rep(i,0,n)
            {
                x*=a[i];
            
                if(x>1000000000000000000)
                {
                    prin(-1);
                    return 0;
                }
            }
            
            lprin(x);
        
        }
    }
         

}

Measured memory_bytes: 4772
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
    int n,d;
    cin>>n>>d;
    int x[n][d];
    for(int i=0;i<n;i++){
        for(int j=0;j<d;j++){
            cin>>x[i][j];
        }
    }

    int c=0;
    int s=0;
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            s=0;
            for(int k=0;k<d;k++){
                s+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
            }
            for(int k=0;k<200;k++){
                if(k*k==s){
                    c+=1;
                    break;
                 }
            }
        }
    }

    cout<<c<<endl;

}

Measured memory_bytes: 256
n = int(input())
h = list(map(int, input().split()))
dp = [0]*n
dp[1] = abs(h[1]-h[0])
for i in range(2, n):
  dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n-1])


Measured memory_bytes: 13980
#include<iostream>
#include<limits.h>
using namespace std;

int main(void){
    int N, X[100], count = 0, min = INT_MAX;
    cin >> N;

    for(int i = 0; i < N; i++) cin >> X[i];

    for(int i = 1; i < 101; i++){
        for(int j = 0; j < N; j++){
            count += (X[j] - i) * (X[j] - i);
        }
        if(min > count) min = count;
        count = 0;
    }

    cout << min << endl;
    return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstring>

#define roop(i,n,k) for(i=k;i<n;i++)

using namespace std;

int myPower(int a, int n) { // aのn乗の計算
	int x = 1;
	while (n > 0) { // 全てのbitが捨てられるまで
		if ( n & 1) { // 一番右のbitが１のとき
			x *= a;
		}
		a *= a;
		n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
	}
	return x;
}

int main() {
	char s[101];
	int i;
	cin >> s;
	int flag = 0;
	for (i = 0; s[i] != '\0'; i++) {
		if (i % 2 != 0) {
			if (s[i] != 'L'
			 && s[i] != 'U'
			 && s[i] != 'D') {
				flag = 1;
			}
		} else {
			if (s[i] != 'R'
			 && s[i] != 'U'
			 && s[i] != 'D') {
				flag = 1;
			}
		}
	}
	if (flag == 0) {
		cout << "Yes";
	} else {
		cout << "No";
	}
	return 0;
}


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

//#define DEBUG

using namespace std;

template <class T>
void print_vect(std::vector<T> v){
    for(int i = 0 ; i < v .size(); i++) cout << v[i] << " ";
    cout << endl;
}


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

    int taka_timing = C / B;

    if( C % B){
        taka_timing++;
    }

    int aoki_timing = A / D;
    if(A % D){
        aoki_timing++;
    }
    //cout << "Taka timing " << taka_timing << " Aoki timing " << aoki_timing << endl;
    if( taka_timing < aoki_timing + 1){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}
int main()
{
    //making data IO Fast
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    /****************************/

    #ifdef DEBUG
    int TEST_CASES = 2;
    while(TEST_CASES--){
    #endif // DEBBUG

    func_to_create();

    #ifdef DEBUG
    }
    #endif // DEBUG
    
    return 0;
}


Measured memory_bytes: 3612
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let d: usize = iterator.next().unwrap().parse().unwrap();
    let n = 25 - d;

    let mut result = String::from("Christmas");
    for _ in 0..n {
        result.push_str(" Eve");
    }
    return result;
}


Measured memory_bytes: 2048