akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define HASH_M 9973
#define HASH_A 128
#define STR_SIZE 16

typedef struct DATA{
	struct DATA *next;
	char str[STR_SIZE];
}Data;

Data dlist[HASH_M];	//?????????????´?????????????????????????

int getHashAddr(char str[STR_SIZE], int M, int a){
	int i = 0, h = 0;
	if( M <= 0 ){ M = HASH_M; }
	if( a <= 0 ){ a = HASH_A; }
	for( i = 0; str[i] != '\0'; i++ ){ h = (a*h + str[i]) % M; }
	return h;
}

void hashShow(int addr){
	Data *tmp = &dlist[addr];
	printf("addr=%d\n", addr);
	if( tmp == NULL ){ return; }
	while( tmp->next != NULL ){
		tmp = tmp->next;
		printf("%s\n", tmp->str);
	}
	return;
}

void hashAdd(char str[STR_SIZE]){
	int addr = getHashAddr(str, HASH_M, HASH_A);
	Data *data = (Data*)malloc(sizeof(Data));
	strcpy(data->str, str);
	data->next = NULL;
	Data *tmp = &dlist[addr];
	while( tmp->next != NULL ){ tmp = tmp->next; }
	tmp->next = data;
	//hashShow(addr);
	return;
}

void hashRemove(char str[STR_SIZE]){
	int addr = getHashAddr(str, HASH_M, HASH_A);
	Data *tmp = &dlist[addr];
	Data *target;
	while( tmp->next != NULL ){
		if( strcmp(tmp->next->str, str) == 1 ){
			target = tmp->next;
			tmp->next = tmp->next->next;
			free(target);
			return;
		}
	}
	return;
}

int hashFind(char str[STR_SIZE]){
	int addr = getHashAddr(str, HASH_M, HASH_A);
	Data *tmp = &dlist[addr];
	while( tmp->next != NULL ){
		tmp = tmp->next;
		if( strcmp(tmp->str, str) == 0 ){ return 1; }
	}
	return 0;
}

int main(){
	int n, i;
	char com[128], str[STR_SIZE];
	Data dummy;
	dummy.next = NULL;
	dummy.str[0] = '\0';
	for( i = 0; i < HASH_M; i++ ){ dlist[i] = dummy; }
	scanf("%d", &n);
	for( i = 0; i < n; i++ ){
		scanf("%s %s", com, str);
		if( strcmp(com, "insert\0") == 0 ){
			hashAdd(str);
		}else if( strcmp(com, "remove\0") == 0 ){
			hashRemove(str);
		}else if( strcmp(com, "find\0") == 0 ){
			printf("%s\n", (hashFind(str)?"yes":"no"));
		}else{
			printf("it is not command\n");
		}
	}
	return 0;
}

Measured memory_bytes: 18668
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <numeric>
#include <regex>
#include <tuple>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
#define modulo 1000000007 // 10^9 + 7
#define INF 1000000000 // 10^9
#define LLINF 1LL<<60


const int MAX_N = 100000;
bool isPrime[MAX_N];

// n番目までの数について素数かどうか判断する
void primeTable(int n) {
	for (int i = 1; i <= n; i++) isPrime[i] = true;
	isPrime[0] = isPrime[1] = false;

	for (int i = 2; i <= n; i++) {
		if (isPrime[i]) {
			for (int j = 2 * i; j <= n; j += i) isPrime[j] = false; // iの倍数はすべて素数でない
		}
	}
}

int cntAns[MAX_N+1]; // i以下の素数の数
int Q;
P que[MAX_N+1];

void input() {
	cin >> Q;
	for (int i = 0; i < Q; i++) cin >> que[i].first >> que[i].second;
}

void solve() {

	primeTable(MAX_N);
	cntAns[0] = 0;
	for (int i = 1; i <= MAX_N; i++) {
		cntAns[i] = cntAns[i - 1];
		if (isPrime[i] && i % 2 == 1 && isPrime[(i + 1) / 2]) cntAns[i]++;
	}

	for (int i = 0; i < Q; i++) {
		cout << cntAns[que[i].second] - cntAns[que[i].first - 1] << endl;
	}
}

int main() {
	input();
	solve();

	return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a)      (a).begin(),(a).end()
#define debug_array(a,n) for (ll bccc=(0); bccc<(n); bccc++) cout<<a[bccc]<<" "<<"\n"
#define debug_vector(a) for(ll bccc=(0); bccc<(a.size());bccc++) cout<<a[bccc]<<" "<<"\n"
#define F           first
#define S           second
#define debug_set(s) for(auto p:s) cout<<p<<" "
#define debug_map(m) for(auto p:m) cout<<p.F<<" "<<p.S<<"\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl;
typedef long long ll;
using namespace __gnu_pbds;
typedef tree<pair<ll,ll>,null_type,less<pair<ll,ll> >,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;
/* ll t = 0;
ordered_multiset me;
...
me.insert({x, t++});
me.erase(me.lower_bound({x, 0}));
cout << me.order_of_key({x, 0}) << "\n";

///////////   t is insertion time
*/
// #pragma GCC optimize("Ofast")  // works very well
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
typedef long double lld;
lld pi=3.14159265358;
ll powr(ll a,ll b)
{
    ll c=1;
    ll kjk;
    for(kjk=0;kjk<b;kjk++)
        c*=a;
    return c;
}
ll hell=1000000007;
//ll hell=998244353   ;
ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
// to generate random number , use rng() ... eg cout<<rng();
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    ll n,i;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++)
        cin>>a[i];
    ll check=1;
    ll cnt=0;
    for(i=0;i<n;i++)
    {
        if(a[i]==check)
        {
            cnt++;
            check++;
        }
    }
    if(cnt==0)
    {
        cout<<"-1";
    }
    else
    {
        cout<<n-cnt;
    }


}


Measured memory_bytes: 1792
#include <stdio.h>

int main() 
{
	int N = 0;
	int number = 0;
	int i = 0;
	int divide = 0;
	int count = 0;
	int flag = 0;
	
	scanf("%d", &N);
	for(i = 0; i < N; i++) {
		scanf("%d", &number);
		divide = 2;
		flag = 0;
		while(divide * divide <= number) {
			if((number % divide )== 0) {
				flag = 1;
				break;
			}
			divide++;
		}
		
		if(flag != 1) {
			count++;
		}
	}
	
	printf("%d\n", count);
	
	return 0;
}


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

int main() {
  int N,ans=0;
  cin >> N;
  vector<int> a(N);
  rep(i,N) {
    int a;
    //cin >> a[N];
    cin >> a;
    if(i%2==0 && a%2!=0) ans++;
  }
  
  cout << ans << endl;

  return 0;
}

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

#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ld long double
#define forn(low,high,i) for(i = low; i < high; i++)
#define forrev(high,low,i) for(i = high; i >= low; i--)
#define all(v) v.begin(),v.end()
#define decimal_digits cout << fixed << setprecision(15);

string to_string(string s) { return '"' + s + '"';}
string to_string(char s) { return string(1, s);}
string to_string(const char* s) { return to_string((string) s);}
string to_string(bool b) { return (b ? "true" : "false");}
template <typename A> string to_string(A);
template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template <typename A> string to_string(A v) {bool f = 1; string r = "{"; for (const auto &x : v) {if (!f)r += ", "; f = 0; r += to_string(x);} return r + "}";}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {cerr << " " << to_string(H); debug_out(T...);}
#define pr(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

#define GOOGLE 0
#define MULTIPLE_TC 0

const int inf = 1e9;
const long long INF = 1e18;
const int mod = 2019;
const int bit32 = log2(inf) + 3;
const int bit64 = log2(INF) + 3;

inline int add(long long a, long long b){a += b; if(a >= mod) a -= mod; return a;}
inline int sub(long long a, long long b){a -= b; if(a < 0) a += mod; return a;}
inline int mul(long long a, long long b){a %= mod; b %= mod; return (int)((long long) a * b % mod);}
inline int modexpo(long long a, long long b){int res = 1; while(b > 0){ if(b & 1) res = mul(res, a); a = mul(a, a); b /= 2;} return res;}
inline int divide(long long a, long long b){return mul(a, modexpo(b, mod - 2));}
inline int inv(long long a){return modexpo(a, mod - 2);}

clock_t time_p = clock();

void ktj(){
  time_p = clock() - time_p;
  cerr << "Time elapsed : " << (float)(time_p)/CLOCKS_PER_SEC << "\n";
}

void pre(){ // Reset each global variable (esp. for graphs)
  
}

string s;
const int N = 200000 + 5;

void solve(){
  cin >> s;
  long long n = s.size(), i, j, k;
  long long ans = 0;
  int dp[2][mod];
  memset(dp, 0, sizeof dp);
  dp[0][s[0] - '0'] = 1;
  for(i = 1; i < n; i++){
    int val = s[i] - '0';
    int idx = i & 1;
    for(j = 0; j < mod; j++){
      dp[idx][j] = 0;
    }
    dp[idx][val] += 1;
    for(j = 0; j < mod; j++){
      if(dp[1 ^ idx][j]){
        dp[idx][(val + 10 * j) % mod] += dp[1 ^ idx][j];
      }
    }
    ans += dp[idx][0];
  }
  cout << ans << '\n';
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);cout.tie(NULL); 

  pre();

  int t = 1, T;

  if(MULTIPLE_TC)
    cin >> t;

  for(T = 1; T <= t; T++){
    if(GOOGLE)
      cout << "Case #" << T << ": ";
    solve();
  }

  ktj();
}


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

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MIN(a,b) ((a)>(b)? (b): (a))
#define MAX(a,b) ((a)<(b)? (b): (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

int main(){
    int n;
    cin >> n;
    ll cnt[1000000];
    rep(i,1000000) cnt[i] = 0;
    rep(i,n){
        int x;
        cin >> x;
        x--;
        cnt[x]++;
    }
    ll sub=0;
    rep(i,1000000){
        if(cnt[i]==0)continue;
        sub+=cnt[i]-1;
    }
    if(sub%2==1) sub++;
    cout << n - sub << endl;
    return 0;
}

Measured memory_bytes: 8064
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
# }}}

def solve():
    s = input()
    if s == "ABC":
        print("ARC")
    else:
        print("ABC")

    return 0

if __name__ == "__main__":# {{{
    solve()

# vim: set foldmethod=marker: }}}


Measured memory_bytes: 79452
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	int n;
	string s;
	cin >> n >> s;
	
	vector<int> sum(n + 1, 0);
	for(int i = 0; i < n; ++i) { 
		sum[i + 1] = sum[i] + (s[i] == 'W');
	}
	
	int ans = n;
	for(int i = 0; i <= n; ++i) {
		ans = min(ans, sum[i - 1] + (n - i) - (sum[n] - sum[i]));
	}
	
	cout << ans << endl;
	
	return 0;
}


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

ll gcd(ll a, ll b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
  ll g = gcd(a, b);
  return a / g * b;
}

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

  ll nc_a = (A - 1) / C;
  ll nc_b = B / C;
  ll nd_a = (A - 1) / D;
  ll nd_b = B / D;
  ll ncd_a = (A - 1) / lcm(C, D);
  ll ncd_b = B / lcm(C, D);

  ll ans = B - A + 1;
  ans -= nc_b - nc_a;
  ans -= nd_b - nd_a;
  ans += ncd_b - ncd_a;
  cout << ans << endl;
}

Measured memory_bytes: 256
while True:
    n, p = map(int, input().split())
    if n == 0 and p == 0:
        break
    kouho = [0 for i in range(n)]
    i = 0
    motokazu = p
    while True:
        if p == 0 and kouho[i] == motokazu:
            print(i)
            break
        elif not p == 0:
            kouho[i] += 1
            p -= 1
        elif p == 0 and kouho[i] >= 1:
            p += kouho[i]
            kouho[i] = 0
        else:
            pass
        i = (i + 1) % n



Measured memory_bytes: 5600
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
int N;
const int MN = 100010;
int a[MN+1];
int b[MN+1];

struct UnionFind{
	int par[MN],rank[MN];
	void init(int N){rep(i,N) par[i]=i,rank[i]=0;}
	int find(int x){
		if(par[x]==x) return x;
		return par[x]=find(par[x]);
	}
	bool same(int x,int y){
		return find(x)==find(y);
	}
	void unite(int x,int y){
		x=find(x),y=find(y);
		if(x==y) return;
		if(rank[x]<rank[y]) par[x]=y;
		else{
			par[y]=x;
			if(rank[x]==rank[y]) rank[x]++;
		}
	}
}UF;

int main(){
	cin>>N;
	int s = 0;
	rep(i,N) cin>>a[i],s^=a[i];
	a[N] = s;

	s = 0;
	rep(i,N) cin>>b[i],s^=b[i];
	b[N] = s;

	map<int,int> cnt;
	map<int,int> cand;

	rep(i,N+1){
		cnt[a[i]]++;
		cnt[b[i]]--;
	}
	for(auto it:cnt){
		if(it.sc!=0){
			puts("-1");
			return 0;
		}
	}
	int n = 0;
	rep(i,N+1) if(i==N || a[i]!=b[i]){
		n++;
		cand[a[i]] = i;
		cand[b[i]] = i;
	}

	UF.init(N+1);
	rep(i,N+1) if(i==N || a[i]!=b[i]){
		UF.unite(i,cand[a[i]]);
		UF.unite(i,cand[b[i]]);
	}
	int K = 0;
	rep(i,N+1) if(i==N || a[i]!=b[i]){
		if(UF.find(i)==i) K++;
	}
	cout<<n+K-2<<endl;
}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll INF = 1'010'000'000'000'000'017LL;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

int main() {
    string n;
    cin >> n;
    if(n.at(0) == '7' || n.at(1) == '7' || n.at(2) == '7')
        cout << "Yes";
    else
        cout << "No";
}


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

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

    int x = max(a,max(b,c));
    int value = 3 * x - (a + b + c);
    int ans;
    if(value % 2 == 0) ans = value / 2;
    else ans = (value + 3) / 2;

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


Measured memory_bytes: 256
import java.util.*;

public class Main {
    static int modP = 1000000007;

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();

        int idx = s.length();
        boolean cond = false;
        while(idx >= 0) {
            if(cond) break;
            if(idx < 5) {
                print("NO");
                return;
            }

            String last5 = s.substring(idx-5, idx);
            if(last5.equals("dream") || last5.equals("erase")) {
                idx -= 5;
                if(idx == 0) cond = true;
                continue;
            }

            String last6 = s.substring(idx-6, idx);
            if(last6.equals("eraser")) {
                idx -= 6;
                if(idx == 0) cond = true;
                continue;
            }

            String last7 = s.substring(idx-7, idx);
            if(last7.equals("dreamer")) {
                idx -= 7;
                if(idx == 0) cond = true;
                continue;
            }

            break;
        }

        if(cond) {
            print("YES");
        }else{
            print("NO");
        }
    }

    static void print(String s) {
        System.out.println(s);
    }

    static void print(int i) {
        System.out.println(i);
    }
}


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

using namespace std;

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

  std::vector<int> v(n,0);

  int a;
  for (auto i = 1; i != n; ++i) {
    cin >> a;
    ++v[a-1];
  }


  for(auto i: v) {
    cout << i << endl;
  }
  
  return 0;
}


Measured memory_bytes: 4032
#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 107,
              MAXK = 1e5 + 7;

int n, k;
int lst[MAXN], dp[MAXK] { -1 };

int winner(int rem)
{
    if (dp[rem])
        return dp[rem];
    bool canwin = false;
    for (int i = 0; i != n; ++i)
        if (lst[i] <= rem && winner(rem - lst[i]) == -1) {
            canwin = true;
            break;
        }
    return dp[rem] = (canwin ? 1 : -1);
}

int main()
{
#ifdef LOCAL
    freopen("data.txt", "r", stdin);
#endif
    scanf("%d%d", &n, &k);
    for (int i = 0; i != n; ++i)
        scanf("%d", &lst[i]);
    puts(winner(k) == 1 ? "First" : "Second");
}

Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[5];
    for(int i=0; i<5; i++)
    {
        cin>>a[i];
    }
    for(int i=0; i<5; i++)
    {
        if(a[i]==0)
        {
            cout<<i+1<<'\n';
            return 0;
        }
    }
}

Measured memory_bytes: 3524
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(read())

def main(N):
  A = [1]
  for _ in range(100):
    A.append(A[-1] * 26)
  for n in range(1, 100):
    if N > A[n]:
      N -= A[n]
      continue

    N -= 1
    ret = []
    
    for _ in range(n):
      N, r = divmod(N, 26)
      ret.append(r)
    break
  ret = [chr(ord('a') + x) for x in ret]
  return ''.join(reversed(ret))
 
print(main(N))
    

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


main(){
  int a[31],b[31];
  int w,n;
  int num[31]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
	       21,22,23,24,25,26,27,28,29,30};
  int temp;
  
  while(cin >> w){
    
    cin >> n;

    for(int i=1;i<=n;i++){
      //      cin >> a[i] >> ,>>b[i];
      scanf("%d,%d",&a[i],&b[i]);
    }

    for(int i=1;i<=n;i++){
      temp = num[a[i]];
      num[a[i]] =num[b[i]];
      num[b[i]] = temp;
    }

    for(int i=1;i<=w;i++){
      cout << num[i] << endl;
    }
  
  }



  
  return 0;

}

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


int main() {
    int a;
    cin >> a;
    cout << a / 3600 << ":" << (a % 3600) / 60 << ":" << (a % 60) << endl;
}



Measured memory_bytes: 3156
// ABC091B - Two Colors Card Game

#include <bits/stdc++.h>
using namespace std;

int main() {
	int N, M;
	cin >> N;
	map<string, int> card;
	for (int i = 0; i < N; i++) {
		string t;
		cin >> t;
		card[t]++;
	}
	cin >> M;
	for (int i = 0; i < M; i++) {
		string t;
		cin >> t;
		card[t]--;
	}

	int maxT = 0;
	for (map<string, int>::iterator it = card.begin(); it != card.end(); it++) {
		pair<string, int> temp = *it;
		maxT = max(maxT, temp.second);
	}

	cout << maxT << endl;

	return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

func main() {
	var x int
	fmt.Scan(&x)
	count := 0
	var sum float64 = 100

	for {
		if int(sum) >= x {
			break
		}
		sum = math.Floor(sum + sum*0.01)
		count++
	}

	fmt.Println(count)
}

Measured memory_bytes: 1756
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll = long long;
int main(void){
   int A,B;
   cin>>A>>B;
   if(A*B%2==1){
       cout<<"Yes"<<endl;
   }
   else{
       cout<<"No"<<endl;
   }
   
   
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define _abs(x)((x) < 0 ? (x) * -1 : (x))
#define _max(x, y)(max(0, max((x), (y))))
#define _min(x, y)(max(0, min((x), (y))))

int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    //freopen("debug.txt", "w", stderr);

    cin.tie(0);
    ios::sync_with_stdio(false);

    string s, s1, s2;

    cin >> s;

    s = s.substr(0, s.size() - 1);

    if (s.size() % 2 != 0) s = s.substr(0, s.size() - 1);

    s1 = s.substr(0, s.size() / 2);
    s2 = s.substr(s.size() / 2, s.size() / 2);

    while (s1 != s2) {
        s = s.substr(0, s.size() - 2);

        s1 = s.substr(0, s.size() / 2);
        s2 = s.substr(s.size() / 2, s.size() / 2);
    }

    cout << s.size() << endl;

    return 0;
}


Measured memory_bytes: 256
import numpy as np


def calc(r_num, l_num):
    r_num -= 1
    l_num -= 1
    rr = r_num//2 + l_num - l_num//2 + 1
    ll = l_num//2 + r_num - r_num//2 + 1
    return [rr, ll]


s = input()
ans = np.zeros(len(s), dtype=np.int)
r_now = 1
section_start = 0
r_num = 0
l_num = 0
rl_index = 0
for i in range(len(s)):
    if s[i] == "R":
        if r_now:
            r_num += 1
            pass
        else:
            ans[rl_index:rl_index+2] += calc(r_num, l_num)
            section_start = i
            r_num, l_num = 1, 0
            r_now += 1
    if s[i] == "L":
        if r_now:
            rl_index = i-1
            r_now -= 1
        else:
            pass
        l_num += 1

ans[rl_index:rl_index+2] += calc(r_num, l_num)

print(*ans)


Measured memory_bytes: 18808
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int A,B,C,D;
  cin >> A >> B >> C >> D ;
  
 if((A + B) > (C + D)){
 	cout << "Left" << endl;
 }
 else if ( (A + B) < (C + D)){
 	cout << "Right" << endl;
 }
 else{
   cout << "Balanced" << endl;
 }
  
}

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

int N;
map<string, int> m;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin >> N;
	while (N--) { string s; cin >> s; m[s]++; }
	int mx = max_element(m.begin(), m.end(), [](auto& m1, auto& m2) {return m1.second < m2.second; })->second;
	for (auto& v : m)
		if (v.second == mx) cout << v.first << "\n";
}

Measured memory_bytes: 23808
#include<bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout<<fixed;
  cout<<setprecision(8);
  int n;
  cin>>n;
  double ans = 0;
  for(int i=0;i<n;i++){
    double x;
    cin>>x;
    string y;
    cin>>y;
    if(y=="JPY"){
        ans+=x;
    }else{
        ans+=x*380000;
    }
  }
  cout<<ans<<endl;
  return 0;
}


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

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

        if ((a+b)>9)
            System.out.println("error");
        else
            System.out.println(a+b);

    }
}


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

int main(void){
	int n, k, c, idx;
	char str[200000];

	scanf("%d%d%d%s", &n, &k, &c, str);

	int fwd[n], bck[n];
	for(int i=0, idx = 0; i < n || idx < k; i++) {
		if(str[i] == 'o') {
			fwd[idx++] = i+1;
			i += c;
		}
	}

	for(int i=n-1, idx = 0; i >= 0 || idx < k; i--) {
		if(str[i] == 'o') {
			bck[k-1-idx++] = i+1;
			i -= c;
		}
	}

	for(idx=0; idx < k; idx++) {
		if(fwd[idx] == bck[idx])
			printf("%d\n", fwd[idx]);
	}

	return 0;
}


Measured memory_bytes: 3200
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
using namespace std;

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

    vector<vector<int>> v;
    for(int i=1; i<=N/2; i++){
        vector<int> tmp;
        tmp.push_back(i);
        tmp.push_back(2*(N/2)-i+1);
        v.push_back(tmp);
    }
    if(N % 2 == 1){
        vector<int> tmp = {N};
        v.push_back(tmp);
    }
    vector<pair<int, int>> edges;
    for(int i=0; i<v.size(); i++)
        for(int j=i+1; j<v.size(); j++){
            for(int x : v[i])
                for(int y : v[j])
                    edges.push_back(make_pair(x, y));
        }

    cout << edges.size() << endl;
    for(auto x : edges)
        cout << x.first << " " << x.second << endl;


    return 0;
}

Measured memory_bytes: 384
import sys
import numpy as np


def input():
    return sys.stdin.readline().rstrip()


def main():
    n = int(input())
    al = [int(e) for e in input().split()]
    bl = [int(e) for e in input().split()]

    poscnt = 0
    negcnt = 0
    for i in range(n):
        if al[i] > bl[i]:
            poscnt += al[i] - bl[i]
        elif al[i] < bl[i]:
            negcnt += (bl[i] - al[i]) // 2
    if poscnt <= negcnt:
        print("Yes")
    else:
        print("No")


main()


Measured memory_bytes: 13676
//g++ -std=gnu++14 a.cpp
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;

int main(){
  int N;
  cin >> N;
  bool hantei = false;
  for(int i = 1;i < 10;i++){
    if(N%i == 0 && N/i < 10){
      hantei = true;
      break;
    }
  }
  if(hantei){
    cout << "Yes" <<endl;
  }else{
    cout << "No" <<endl;
  }
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

const int MAX_P = 105000;
bool prime[MAX_P];
long long p[MAX_P + 1];


void init()
{
    for (int i = 0; i < MAX_P; i++)
        prime[i] = true;
    prime[0] = prime[1] = false;

    for (int i = 2; i * i < MAX_P; i++)
        if (prime[i]) 
            for (int j = 2 * i; j < MAX_P; j += i)
                prime[j] = false;
    int n = 1;
    for (int i = 0; i < MAX_P; i++)
        if (prime[i])
            p[n++] = i;
}

int main()
{
    int n;
    
    init();
    while (cin >> n, n) {
        long long sum = 0;

        for (int i = 1; i <= n; i++)
            sum += p[i];

        cout << sum << endl;
    }

    return 0;
}

Measured memory_bytes: 1340
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            long a = Integer.parseInt(sc.next());
            long b = Integer.parseInt(sc.next());
            long c = Integer.parseInt(sc.next());
            long d = Integer.parseInt(sc.next());

            // Solve
            long result = Math.max(a * c, a * d);
            result = Math.max(result, b * c);
            result = Math.max(result, b * d);
            System.out.println(result);
        }
    }

}

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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>
#define Graph vector<vector<int>>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

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

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


void func(long long A, long long B){

}

int main(){

    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    cout << A*B << endl;
    return 0;
}


Measured memory_bytes: 3696
#define _USE_MATH_DEFIMES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1'000'000'007;
const int INF = 1'000'000'000; //1e9
const int NIL = -1;
const long long LINF = 1'000'000'000'000'000'000; // 1e18
const long double EPS = 1E-10;

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








int main(){
    long long N, X, M; std::cin >> N >> X >> M;
    long long ans(0);
    std::vector<long long> a(1);
    std::map<long long, int> mp;
    for(long long i(1); i <= N; ++i){
        ans += X;
        a.emplace_back(ans);
        if(mp[X]){
            int lp(i - mp[X]);
            long long e(ans - a[mp[X]]);
            ans += ((N - i) / lp) * e;
            ans += a[(N - i) % lp + mp[X]] - a[mp[X]];
            std::cout << ans << std::endl;
            return 0;
        }
        mp[X] = i;
        X = X*X % M;
    }
    std::cout << ans << std::endl;
    return 0;
}


Measured memory_bytes: 6540
#define _USE_MATH_DEFINES // for C++  
#include "bits/stdc++.h"
#define LL long long
#define NUM 1000000007

using namespace std;

int main()
{
    int x, a, b;
    cin >> x >> a >> b;
    int tmp = x - a;
    cout << tmp % b << endl;
}

Measured memory_bytes: 256
using System;

namespace ConsoleApplication45
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            char[] ch = str.ToCharArray();
            int p = int.Parse(Console.ReadLine());
            for (int x = 0; x < p; x++)
            {
                string[] str2 = Console.ReadLine().Split(' ');
                // print???????????????
                if ("print" == str2[0])
                {
                    int a = int.Parse(str2[1]);
                    int b = int.Parse(str2[2]);
                    for (int j = a ; j < b + 1; j++)
                    {
                        Console.Write(ch[j]);
                    }
                    Console.WriteLine();
                }
                //reverse???????????????
                if ("reverse" == str2[0])
                {
                    int a = int.Parse(str2[1]);
                    int b = int.Parse(str2[2]);
                    string reverseA = string.Empty;
                    //a?????????????????????
                    reverseA = str.Substring(a, b + 1 - a);
                    //a????????\??????????????????
                   // reverseB = str.Remove(a, b + 1);
                    //reverseA?????????
                    char[] reverseAch = reverseA.ToCharArray();
                    Array.Reverse(reverseAch);
                    //reverseA??¨?????????reverseA??????????????????
                    str = str.Replace(reverseA, new string(reverseAch));
                    char[] ch2 = str.ToCharArray();
                    ch = ch2;
                }
                //replace?????????????????????
                if ("replace" == str2[0])
                {
                    int a = int.Parse(str2[1]);
                    int b = int.Parse(str2[2]);
                    //reverseA??¨?????????reverseA??????????????????
                    str = str.Remove(a, b + 1 - a);
                    str = str.Insert(a, str2[3]);
                    char[] ch2 = str.ToCharArray();
                    ch = ch2;
                }
            }
        }
    }
}

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

using namespace std;

string func(int a, int b, int c)
{
    if (a + b + c >= 22)
        return "bust";
    return "win";
}

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

    int a, b, c;

    cin >> a >> b >> c;

    cout << func(a, b, c) << "\n";

    return 0;
}


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

int main() {

	string S,A="";
	cin>>S;
  
     if(S.at(0)=='1'){A.push_back('1');}if(S.at(0)=='0'){A.push_back('0');}
  for(int i=1; i<S.length();i++){
     if(S.at(i)=='B'){if(A!=""){A.pop_back();}}
      if(S.at(i)=='1'){A.push_back('1');}if(S.at(i)=='0'){A.push_back('0');}
  }

	
	cout<<A<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void) 
{
  int A, B, sum, sub, mul, ans;
  scanf("%d %d", &A, &B);
  sum = A + B;
  sub = A - B;
  mul = A * B;
  ans = sum;
  if (sub > ans)
    ans = sub;
  if (mul > ans)
    ans = mul;
  printf("%d", ans);
  
  return 0;
}

  

Measured memory_bytes: 128
#include <stdio.h>

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

	if ((n % 10) == 2)
		puts("hon");
	else if ((n % 10) == 4)
		puts("hon");
	else if ((n % 10) == 5)
		puts("hon");
	else if ((n % 10) == 7)
		puts("hon");
	else if ((n % 10) == 9)
		puts("hon");
	else if ((n % 10) == 0)
		puts("pon");
	else if ((n % 10) == 1)
		puts("pon");
	else if ((n % 10) == 6)
		puts("pon");
	else if ((n % 10) == 8)
		puts("pon");
	else if ((n % 10) == 3)
		puts ("bon");

	return 0;
}

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

int main() {
    int r;
    cin >> r;
    int ans = 3*r*r;
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cmath>
#include<algorithm>
#include<functional>
typedef long long ll;
#define INF 99999999

int main() {
	std::string str;
	std::cin >> str;
	if (str.length() % 2 == 0) {
		for (int i = 0; i < str.length(); i+=2) {
			std::cout << str[i];
		}
	}
	else {
		for (int i = 0; i < str.length()+1; i+=2) {
			std::cout << str[i];
		}
	}
}

Measured memory_bytes: 512
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    a, b = input().split()
    a = int(a)
    b1, b2 = b.split(".")
    b3 = int(b1+b2)

    print(a*b3//100)
    return

if __name__ == '__main__':
    main()

Measured memory_bytes: 10388
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;

void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    vector<int> a(m+1);
    rep(i,n){
        int k;
        cin >> k;
        rep(i,k){
            int j;
            cin >> j;
            a[j]+=1;
        }
    }
    int cnt=0;
    rep(i,m+1){
        if(a[i]==n){
            cnt+=1;
        }
    }
    cout << cnt;


    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define MAX 100000

int main(){
  int i,n;
  int tree[MAX+1];

  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&tree[i]);
  }
  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,tree[i]);
    if(i/2>=1)printf("parent key = %d, ",tree[i/2]);
    if(i*2<=n)printf("left key = %d, ",tree[i*2]);
    if(i*2+1<=n)printf("right key = %d, ",tree[i*2+1]);
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 2048
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef pair<int, int> P;
int main(void){
    int n;
    vector<P> p;
    cin >> n;
    for(int i=0;i<n;i++){
        int a, b;
        cin >> a >> b;
        p.push_back(P(b, a));
    }
    sort(p.begin(), p.end());
    int t = 0;
    for(int i=0;i<n;i++){
        t += p[i].second;
        if(t > p[i].first){
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
}


Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,x;
cin >> a >> b >> c >> x;
int df = 0;
for(int p = 0;p <= a;p++){
    for(int q = 0;q <= b;q++){
        for(int r = 0;r <= c;r++){
            int jk = 500*p + 100*q + 50*r;
            if(jk == x){
                df++;
            }
        }
    }
}
cout << df << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
const int INF = 2147483647;
const ll MOD = 1000000007;

using namespace std;

int main() {
  ll h;
  cin >> h;
  int c = 0;
  ll tmp = h;
  while (tmp) {
    tmp /= 2;
    c++;
  }
  ll ans = 1;
  REP(i, c - 1) { ans = 1 + 2 * ans; }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n;
    cin>>n;
    ll sum=0;
    for(ll i=1;i<=n;i++)
    {
        for(ll j=1;j<=n;j++)
        {
            for(ll k=1;k<=n;k++)
            {
                sum+=(__gcd(i,__gcd(j,k)));
            }
        }
    }
    cout<<sum;
}


Measured memory_bytes: 3636
#include <iostream>
int main(int argc, char** argv){
	int n;
	std::cin >> n;
	int c = 0, f = 0;
	for(int i=0; i<n; i++){
		int a,b;
		std::cin >> a >> b;
		if(a == b) c++;
		else c = 0;
		if(c == 3) f = 1;
	}
	std::cout << (f ? "Yes":"No") << "\n";
}

Measured memory_bytes: 3588
//#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
//#include <queue>
//#include <stack>
#include <cstring>
#include <cassert>

using namespace std;

#ifdef LOCAL_DEBUG
#include <local_debug.h>
#define DEBUG(x...) {                                       \
   cerr << "\e[91m";                                        \
   cerr << __LINE__ << ": " << #x << " = "; DBG::_print(x); \
   cerr <<"\e[39m";                                         \
}
#else
#define DEBUG(x...)
#endif

#define SZ(a) int((a).size())
#define REP(i,n) for(int i=0,_n=(n);i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)

typedef long long llong;
typedef vector<int> VI;
typedef vector<VI> VVI;



int main(int argc, char* argv[]) {
   ios_base::sync_with_stdio(false); 
   cin.tie(nullptr);

   llong N;
   cin >> N;

   int len = 0;
   llong P26 = 1;
   llong sum = 0;
   while (true) {
      len++;
      P26 *= 26;
      if (sum + P26 >= N)
         break;
      sum += P26;
   }

   N -= sum;
   --N;

   DEBUG(len, sum, N);

   string res(len, '?');

   for (int k = len-1; k >= 0; --k) {
      res[k] = 'a' + (N % 26);
      N /= 26;
   }

   cout << res << endl;

   return 0;
}


Measured memory_bytes: 3636
import sys
readline = sys.stdin.readline

H,W,D = map(int,readline().split())

route = [0] * (H * W + 1)
for i in range(H):
  line = list(map(int,readline().split()))
  for j in range(len(line)):
    route[line[j]] = (i,j)

# 1,2,3 ... の頂点番号を格納した配列を作る
# D個おきに距離を格納する

dist = [0] * (H * W + 1)
for i in range(D + 1,len(route)):
  gy,gx = route[i]
  sy,sx = route[i - D]
  dist[i] = abs(gy - sy) + abs(gx - sx) 
  dist[i] = dist[i] + dist[i - D]


Q = int(readline())

for i in range(Q):
  l,r = map(int,readline().split())
  print(dist[r] - dist[l])


Measured memory_bytes: 14536
#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <cstring>
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <list>  
#include <cassert>
#include <ctime>
#include <climits>
using namespace std;  

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

const int MAXN=20*2;


int n;
char s[MAXN][MAXN+1];
bool can[MAXN][MAXN];

ll dp[MAXN][MAXN][MAXN]; // dp[a][b][c] = #ways to make a tree from vertices [a..c] given that a is connected with b

ll solve() {
	REP(i,n) REP(j,n) can[i][j]=s[i][j]=='1';

	for(int a=n-1;a>=0;--a) FOR(c,a+1,n) FORE(b,a+1,c) {
		int len=c-a+1;
		if(len==2) { dp[a][b][c]=b==c?1:0; continue; }
		dp[a][b][c]=0;
		FOR(x,a+1,b) FORE(y,b+1,c) if(can[x][y]) {
			FOR(aa,x,b) FORE(bb,b+1,y) dp[a][b][c]+=dp[a][x][aa]*dp[aa][b][bb-1]*dp[bb-1][y][c];
		}
	}

	ll ret=0; FOR(i,1,n) if(can[0][i]) ret+=dp[0][i][n-1]; return ret;
}

void run() {
	scanf("%d",&n); n*=2;
	REP(x,n) scanf("%s",s[x]);
	printf("%lld\n",solve());
}

void stress() {
	n=MAXN;
	REP(x,n) REP(y,n) s[x][y]=x==y?'0':'1';
	REP(x,n) s[x][n]='\0';
	ll ret=solve(); printf("ret=%lld\n",ret);
}

int main() {
	run();
	//stress();
	return 0;
}


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

#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

int main() {
  ll a, b, c;

  cin >> a >> b >> c;

  if (a == b + c) {
    cout << "Yes" << endl;
  } else if (b == a + c) {
    cout << "Yes" << endl;
  } else if (c == a + b) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3596
#include "bits/stdc++.h"

using namespace std;

void Main() {
    int A, B, T;
    cin >> A >> B >> T;
    cout << (T / A) * B << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3644
N = int(input())

def main():
    zorome = 0
    ans = 'No'
    for _ in range(N):
        x, y = list(map(int, input().split()))
        if x == y:
            zorome += 1
            if zorome >= 3:
                ans = 'Yes'
        else:
            zorome = 0
    return ans

print(main())




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

int main()
{
    int n;
    string s;
    map<string,int>m;

    cin>>n;

    while(n--){
        cin>>s;
        m[s]++;
    }
    cout<<"AC x "<<m["AC"]<<endl;
    cout<<"WA x "<<m["WA"]<<endl;
    cout<<"TLE x "<<m["TLE"]<<endl;
    cout<<"RE x "<<m["RE"]<<endl;

    return 0;
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d;
  int sum1,sum2;
  cin>>a>>b>>c>>d;
  sum1=a+b+c+d;
  cin>>a>>b>>c>>d;
  sum2=a+b+c+d;
  cout<<max(sum1,sum2)<<endl;
  return 0;
}

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

#define M_PI       3.14159265358979323846   // pi

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

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

const ll INF = 1LL << 61;

#include <bits/stdc++.h>
using namespace std;

const ll mod = 1000000007;


int main() {
	ll n, m;
	cin >> n >> m;
	if (n % 2 == 1) {
		for (int i = 0; i < m; i++) {
			cout << i + 1 << " " << n - i - 1 << endl;
		}
	}
	else {
		vector<bool> dist(n + 1, false);
		for (int i = 0, j = 0; i < m; i++, j++) {
			auto left = i + 1;
			auto right = n - j -1;
			while (true) {
				auto c1 = right - left;
				auto c2 = (left - right + n) % n;
				if (dist[c1] || dist[c2] || (c1==c2)) {
					right--;
					j++;
				}
				else {
					dist[c1] = true;
					dist[c2] = true;
					break;
				}
			}
			cout << left << " " << right << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3652
package main

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

var (
	sc = bufio.NewScanner(os.Stdin)
)

func main() {
	sc.Split(bufio.ScanWords)
	k := nextInt()
	c := 0
	for i := 0; i < k; i++ {
		c = c*10 + 7
		if c%k == 0 {
			fmt.Println(i + 1)
			return
		}
		c %= k
	}
	fmt.Println(-1)
}

func nextInt() int {
	i, err := strconv.Atoi(nextWord())
	pnc(err)
	return i
}

func nextWord() string {
	sc.Scan()
	return sc.Text()
}

func pnc(err error) {
	if err != nil {
		panic(err)
	}
}


Measured memory_bytes: 1788
#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 INF 999999999
#define M_PI 3.14159265358979323846

#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

using namespace std;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }



int main()
{
    fast_io();
    #ifdef __LOCAL
        fs::path p = __FILE__;
        fs::path input,output;
        input = output = p.parent_path();
        input += string("/input/") + string(p.stem()) + string(".txt");
        output += string("/output/") + string(p.stem()) + string(".txt");
        freopen(input.c_str(), "r", stdin);
        freopen(output.c_str(), "w", stdout);
    #endif
    int A,B;
    cin >> A >> B;

    cout << max(A+B,max(A*B,A-B))<< endl;

    return 0;


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
int mx[] = {-1, 1, 0, 0}, my[] = {0, 0, -1, 1};

int n;
int z, w;
int a[3000];

int main()
{
	cin >> n;
	cin >> z >> w;
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
	}
	if (n == 1)
	{
		cout << abs(a[0] - w);
	}
	else
	{
		cout << max(abs(a[n - 2] - a[n - 1]), abs(a[n - 1] - w));
	}
}

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

using namespace std;

void solve()
{
	int N, M;
	while(cin >> N >> M, N || M)
	{
		vector<int> Vec1(N);
		vector<int> Vec2(M);
		for(int i = 0; i < N; ++i)
		{
			cin >> Vec1[i];
		}
		for(int i = 0; i < M; ++i)
		{
			cin >> Vec2[i];
		}
		int pos = 0;
		for(int i = 0; i < M; ++i)
		{
			pos += Vec2[i];
			if(pos >= N - 1)
			{
				cout << i + 1 << endl;
				break;
			}
			pos += Vec1[pos];
			if(pos >= N - 1)
			{
				cout << i + 1 << endl;
				break;
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}

Measured memory_bytes: 0