akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define inf INT_MAX
#define sc(a) scanf("%d",&a)
#define scc(a,b) scanf("%d %d",&a,&b)
#define sccc(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pf(a) printf("%d",a)
#define pff(a,b) printf("%d %d",a,b)
#define pfff(a,b,c) printf("%d %d %d",a,b,c)
#define pb(a) push_back(a)
#define em empty()
#define fr front()
#define cl clear()
#define sz size()
#define mp(a,b) make_pair(a,b)
#define fri(b) freopen(b,"r",stdin)
#define fro(b) freopen(b,"w",stdout)
/*
ID: uslusam1
TASK: test
LANG: C++
*/
using namespace std;

int main(){
	//fri("a.gir");
	//fro("a.cik");
	int n,m;
	cin>>n>>m;
	if(n>9 || m>9){
		cout<<-1;
		return 0;
	}
	cout<<m*n;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	vector<long> jointo;
	long siz;
	long dummy;
	long num;
	long amo;
	while(cin>>num&&num!=0){
		siz=0;
		for(int i=0;i<num;++i){
			cin>>dummy;
			siz+=dummy;
		}
		for(int i=0;i<num-1;++i){
			cin>>dummy;
			jointo.push_back(dummy);
		}
		amo=num;
		sort(jointo.begin(),jointo.end());
		for(int i=num-2;i>=0;--i){
			if((siz+jointo[i])*(amo-1)>siz*amo){
				siz+=jointo[i];
				--amo;
			}
		}
		cout<<siz*amo<<endl;
		jointo.clear();
	}
	return 0;
}

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

#define ll long long
#define ull unsigned ll

#define vi vector <int>
#define ii pair <int, int>
#define vii vector <ii>
#define INFLL 9e18
#define INF 2e9
#define EPS 1e-9
#define pb push_back
#define emp emplace_back
#define PI acos(-1.0)
#define endl "\n"
#define mp make_pair
#define DEBUG 0



int main ()

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

    //freopen("input.txt", "r", stdin); 
    //freopen("output.txt", "w", stdout);

    ll a, b, n;
    cin >> a >> b >> n;
    ll p = min(b-1, n);

    ll function = floor((a*p)/(double)b);
    cout << function << endl;
    
       
    
    return 0;
}

Measured memory_bytes: 3728
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
typedef long long ll;
#define  rep(i,a,b)for(long long i=a;i<b;++i)
#define  rrep(i,a,b)for(int i=a;i>=b;--i)
#define  yesno(flag)if(flag)cout<<"Yes"<<endl; else cout<<"No"<<endl;
using namespace std;
const ll INF=1000000000000LL;
const ll r197=1000000007;
typedef pair<ll,ll>P;
typedef pair<P,P>Pa;
bool Inframe(int a,int b,int c,int d,int h,int w){
	if(a+b>=0&&a+b<h&&c+d>=0&&c+d<w)return true;
	return false;
}
vector<int> v[100005];
ll dp[100005][2]={};
int n;
bool c[100005]={};
ll reg(int m,bool s,int f){
	if(dp[m][s]!=-1)return dp[m][s];
	if(v[m].size()==1&&v[m][0]==f){
		if(s)return 1;
		return 2;
	}
	ll res=0;
	ll res2=1;
	if(!s){
		for(int i:v[m]){
			if(i==f)continue;
			res2*=reg(i,1,m);
			res2%=r197;
		}
		res+=res2;
	}
	res2=1;
	for(int i:v[m]){
		if(i==f)continue;
		res2*=reg(i,0,m);
		res2%=r197;
	}
	res+=res2;
	res%=r197;

//	cout<<m<<" "<<s<<" "<<f<<" "<<res<<endl;
	return dp[m][s]=res;
}

int main() {
	memset(dp,-1,sizeof(dp));
	cin>>n;
	int a,b;
	rep(i,0,n-1){
		cin>>a>>b;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	cout<<reg(1,0,0)<<endl;
	return 0;
}


Measured memory_bytes: 14208
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner stdin = new Scanner(System.in);
		
		int X = stdin.nextInt();
		String dp[] = new String[110000];
		
		for(int i=0;i<110000;i++) {
			dp[i] = "No";
		}
		
		dp[0] = "Yes";
		dp[100] = "Yes";
		dp[101] = "Yes";
		dp[102] = "Yes";
		dp[103] = "Yes";
		dp[104] = "Yes";
		dp[105] = "Yes";
		
		for(int i=0;i<=X;i++) {
			if(dp[i].equals("Yes")) {
				for(int j=0;j<=5;j++) {
					if(dp[i].equals("Yes"));
						dp[i+100+j] = "Yes";
				}
			}
		}
		if(dp[X].contentEquals("Yes")) {
			System.out.println(1);
		}
		else {
			System.out.println(0);
		}
	}
}


Measured memory_bytes: 22736
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define long long long 

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update> pref_trie;
typedef tree<long int,null_type,less<long int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef cc_hash_table<long int,long int, hash<long int>, equal_to<long int>, direct_mask_range_hashing<long int>, 
hash_standard_resize_policy<hash_exponential_size_policy<>, hash_load_check_resize_trigger<true>, true>> ht;


int main(){
   IOS;
 /*    #ifndef ONLINE_JUDGE
         freopen("in.txt",  "r",  stdin);
         freopen("out.txt", "w", stdout);
     #endif */
   
   long int n,k;
   cin>>n>>k;

   vector<bool> done(n,1);

   for(long int i = 0; i < k; i++){
    long int x;
    cin>>x;

    while(x--){
      long int y;
      cin>>y;
      done[y-1] = 0;
    }
   }

   cout<<accumulate(done.begin(),done.end(),0LL);

   return 0;
}

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

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

	int N;
	cin >> N;
	vector<int>u(N);
	for (int i = 0; i < N; i++)
	{
		cin >> u[i];
	}

	sort(u.begin(), u.end());
	double ans = u[0];

	for (int i = 1; i < N; i++)
	{
		ans = (double)(ans + u[i]) / 2;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
 
// GNU C Compiler
//template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
 
 
/*
--------------------------------------------
 
	type
 
--------------------------------------------
*/
using LL = long long;
using ULL = unsigned long long;
//using pair<T1, T2> = p12;
 
/*
--------------------------------------------
 
	container
 
--------------------------------------------
*/
#define PB emplace_back
#define MP make_pair 
#define SZ(a) int((a).size())
 
/*
--------------------------------------------
 
	repetition
 
--------------------------------------------
*/
#define MAX(a,b) (a>b)?a:b
#define MIN(a,b) (a>b)?b:a
#define REP(n) for(int i=0; i<n; i++)
#define REPj(n) for(int j=0; j<n; j++)
#define REPinit(a,n) for(int i=a; i<n; i++)
#define REPinitj(a,n) for(int j=a; j<n; j++)
 
//algorithm
//#define SORT(c) sort((c).begin(),(c).end())
 
/*
--------------------------------------------
 
	constant
 
--------------------------------------------
*/
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
/*
 
	Optimizer
 
*/
//#pragma GCC optimize("Ofast")


/*
 
	Utility Algorithm
 
*/
template <typename T>
void swapAlgorithm(T& a, T& b) {
    T tmp = a;
    a = b;
    b = tmp;
}

LL euclideanAlgorithm(LL a, LL b) {
    LL a_tmp = a;
    LL b_tmp = b;

    if (a_tmp > b_tmp) {
        swapAlgorithm<LL>(a_tmp, b_tmp);
    }

    LL r = a_tmp % b_tmp;
    while (r != 0) {
        a_tmp = b_tmp;
        b_tmp = r;
        r = a_tmp % b_tmp;
    }
    return b_tmp;    
}

LL getLCM(LL a, LL b) {
    return (a * b)/(euclideanAlgorithm(a, b));
}

/*
  Code
*/

double eauclidDistance(pair<double, double>& x1, pair<double, double>& x2) {
  return sqrt((x1.first - x2.first) * (x1.first - x2.first) + (x1.second - x2.second) * (x1.second - x2.second));
}

void swap(int& a, int& b) {
  int tmp;
  tmp = a;
  a = b;
  b = tmp;
}

int main(int argc, char const *argv[])
{
  int N;
  cin >> N;

  vector<int> X(N);
  REP(N) cin >> X[i];

  sort(X.begin(), X.end());
  X.erase(std::unique(X.begin(),X.end()),X.end());

  cout << X.size() << endl;
  
  return 0;
}


Measured memory_bytes: 256
#ifdef _DEBUG
#include ".vscode/debug_print.hpp"
#else
#define debug(...)
#endif
#include <bits/stdc++.h>

using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1050000000;
constexpr long long INF64 = 4000000000000000000;
constexpr int MOD7        = 1000000007;
constexpr int MOD53       = 998244353;
constexpr long double PI  = 3.14159265358979323846;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}

void vprint() { std::cout << '\n'; }
template <class H, class... T> void vprint(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << '\n';
    vprint(std::forward<T>(args)...);
}
template <class T> void vprint(std::vector<T> &v) {
    for (auto &&i : v) {
        std::cout << i << '\n';
    }
}

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

    int N;
    scan(N);
    set<string> s;
    for (size_t i = 0; i < N; i++) {
        string x;
        scan(x);
        s.insert(x);
    }
    print(s.size());

    return 0;
}

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

int main() {

int A;
int B;
int C;

  cin>>A;
  cin>>B;
  cin>>C;
  
  int sum=A+B;

if(sum>C){
  cout<<B+C<<endl;
}
if(sum==C){
  cout<<B+C<<endl;
}
if(sum<C){
  cout<<sum+B+1<<endl;
}
}

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        LinkedList<Character> display = new LinkedList<>();
        
        for(int i=0;i<s.length();i++){
        	if(s.charAt(i)=='B') display.pollLast();
        	else display.addLast(s.charAt(i));
        }
        for(char c:display) System.out.print(c);
        System.out.println();
    }
}

Measured memory_bytes: 23252
#include<cstdio>
#include<map>
#include<cassert>
#include<functional>
#include<string>
#include<cassert>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<queue>
using namespace std;
typedef long long ll;
const int MOD(1e9+7);

int n;
int main()
{
 char s[1000];
 scanf("%s", s);
 char *t = s, *u = s + 4;
 char q = s[4];
 s[4] = 0;
 printf("%s ", t);
 s[4] = q;
 printf("%s\n", u);
 return 0;
}


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

int main() {
	int N;
	string S;
    
    int p = 0; // Pink
    int w = 0; // White 
    int g = 0; // Green  
    int y = 0; // Yellow  
  
    int i = 0;
    bool Three = false; // Flag for 3
    bool Four = false; // Flag for 4

    cin >> N;  
      
    for (; i < N; i++){
    
    cin >> S;
      
    if (S == "P"){
      p++; // ping counter
      // cout << p << endl;
    }
      
    else if (S == "W"){
      w++; // white counter
     // cout << w << endl;
    }
    
    else if (S == "G"){
      g++; // green counter
    //  cout << g <<endl;
    }

    else if (S == "Y"){
      y++; // yellow counter
    //  cout << y << endl;
    }
    
    else{
      cout << "error1" << endl;
      break;}
    }

    if (p >= 1 && w >= 1 && g >= 1 && y >= 1){ // check if 4
    cout << "Four" << endl;
    } 
    
    else if (Four == false){
    	if (p >= 1 && w >= 1 && g >= 1){
        Three = true;
        }
      
    	else if (p >= 1 && w >= 1 && y >= 1){
        Three = true;
        }      

    	else if (p >= 1 && g >= 1 && y >= 1){
        Three = true;
        }
      
    	else if (y >= 1 && w >= 1 && g >= 1){
        Three = true;
        }      
      
        if (Three == true){
        cout << "Three" << endl;
        }
    }      
}


Measured memory_bytes: 256
M, D = map(int, input().split())

if D <= 21:
    print(0)
else:
    ans = 0
    for i in range(22, D+1):
        a = int(str(i)[0])
        b = int(str(i)[1])
        if a * b <= M and a >= 2 and b >= 2:
            ans += 1
    print(ans)

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#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 FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll n, d;
  cin >> n >> d;

  vector<vector<ll>> x(n, vector<ll>(d, 0));
  REP(i, n){
    REP(j, d)
      cin >> x[i][j];
  }

  ll ans = 0;
  REP(i, n){
    for(int j = i+1; j < n; j++){
      double sum = 0;
      REP(k, d){
        sum += pow((x[i][k]-x[j][k]), 2);
        //cout << sum << endl;
      }
      long double sumrt = sqrt(sum);
      //cout << endl;
      if(sumrt - (ll)sumrt == 0)
        ans++;

    }
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 256
package main

import "fmt"

var N int
var A []int

func main() {
	fmt.Scan(&N)
	A = make([]int, N)
	tmp := 0
	min := 1 << 30
	max := 0
	for i := 0; i < N; i++ {
		fmt.Scan(&tmp)
		if tmp > max {
			max = tmp
		}
		if tmp < min {
			min = tmp
		}
	}
	fmt.Println(max - min)
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 100100100100;


ll combination(ll n, ll r){
    if(n < r) return 0;
    if(r == 0||r == n) return 1;
    else if(r == 1) return n;
    return (combination(n - 1, r - 1) + combination(n - 1, r));
}

bool checkKaibun(string str){
    string checkStr = str;
    reverse(checkStr.begin(), checkStr.end());
    if(str == checkStr) return true;
    else return false;
}

int keta(ll num){
    int digits = 0;
    while(num > 0){
        num /= 10;
        digits++;
    }
    return digits;
}


int main(){
    ll N;
    cin >> N;
    vector<int> a(N + 2);
    for(int i = 1; i < N + 1; i++) cin >> a[i];
    a[0] = 0;
    a[N + 1] = 0;
    int nowPos = 0;
    int sumDist = 0;
    rep(i, N){
        sumDist += abs(a[i]- a[i + 1]);
    }
    sumDist += abs(a[N] - a[0]);
    for(int i = 1; i <= N; i++){
        int ans = sumDist;
        ans -= abs(a[i] - a[i - 1]) + abs(a[i] - a[i + 1]);
        ans += abs(a[i + 1] - a[i - 1]);
        cout << ans << endl;
    }
}

Measured memory_bytes: 1664
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;

public class Main {

	public static final int N = 100;
	public static final int WHITE = 0;
	public static final int GRAY = 1;
	public static final int BLACK = 2;

	static int n;
	static int tt;

	// グラフを示す二次元行列
	static int[][] M = new int[N][N];
	static int[] color = new int[N], d = new int[N], f = new int[N], nt = new int[N];

	public static void main(String[] args) throws IOException {

		int u,k,v;
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();

		for (int i = 0; i < n; i++) {
			u = sc.nextInt();
			k = sc.nextInt();
			u--;
			for (int j = 0; j < k; j++) {
				v = sc.nextInt();
				v--;
				M[u][v] = 1;
			}
		}
		dfs();
	}

	// uに隣接するvを番号順に取得
	private static int next (int u) {
		for (int v = nt[u]; v < n; v++) {
			nt[u] = v + 1;
			if (M[u][v] == 1) {
				return v;
			}
		}
		return -1;
	}

	// スタックを用いた深さ優先探索
	private static void dfsVisit(int r) {

		Stack<Integer> S = new Stack<Integer>();
		S.push(r);
		color[r] = GRAY;
		d[r] = ++tt;

		while (!S.empty()) {
			int u = S.peek();
			int v = next(u);
			if (v != -1) {
				if (color[v] == WHITE) {
					color[v] = GRAY;
					d[v] = ++tt;
					S.push(v);
				}
			} else {
				S.pop();
				color[u] = BLACK;
				f[u] = ++tt;
			}
		}
	}

	private static void dfs() {
		Arrays.fill(color, WHITE);

		// 未訪問のuを始点として深さ優先探索
		for (int u = 0; u < n; u++) {
			if (color[u] == WHITE) dfsVisit(u);
		}
		for (int i = 0; i < n; i++) {
			System.out.println(i+1 +" "+ d[i] + " " + f[i]);
		}
	}


}


Measured memory_bytes: 28536
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <valarray>
#include <utility>

using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define REP2(i,m,n) for(int i=m+1;i<=(int)(n);i++)
#define REP3(i,m,n) for(int i=m;i<=(int)(n);i++)
#define INF 2000000000
#define INFLL 9000000000000000000
#define MOD (1e9)+7

typedef long long int ll;

// a 0x61  z 0x7a  0 0x30

int main() {
    ll x;
    cin >> x;
    ll loop = x / 11;
    int r;
    if (x % 11 == 0) {
        r = 0;
    } else if (x % 11 <= 6) {
        r = 1;
    } else {
        r = 2;
    }

    cout << loop * 2 + r << endl;

    return 0;

}



Measured memory_bytes: 256
import fractions
from collections import defaultdict
a, b = map(int, input().split())

g = fractions.gcd(a, b)
l = defaultdict(int)
for i in range(2, int(g**0.5)+1):
    if g % i == 0:
        while g % i == 0:
            l[i] += 1
            g = g // i
if g != 1:
    l[g] += 1
print(len(l)+1)


Measured memory_bytes: 65768
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;

const ll MOD = 1e9 + 7;

ll modpow(ll a, ll n) {
  ll ret = 1;
  while (n > 0) {
    if (n & 1) ret = ret * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return ret;
}
ll modinv(ll a) { return modpow(a, MOD - 2); }

ll comb(ll n, ll r) {
  ll ret = 1;
  for (ll i = 0; i < r; i++) ret = ret * (n - i) % MOD;
  for (ll i = 1; i <= r; i++) ret = ret * modinv(i) % MOD;
  return ret;
}

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

  ll ans = modpow(2, n);
  ans -= 1;
  if (ans < 0) ans += MOD;
  ans -= comb(n, a);
  if (ans < 0) ans += MOD;
  ans -= comb(n, b);
  if (ans < 0) ans += MOD;

  cout << ans << endl;
}


Measured memory_bytes: 3628
#include <iostream>

using namespace std;

int main(void){

  char c[10];
  c[0] = '?'; 

  while( cin >> c[1] >> c[2] >> c[3] >> c[4] >> c[5] >> c[6] >> c[7] >> c[8] >> c[9] ){
 
    char m = 'd';
    if( c[1] == c[2] && c[2] == c[3] && c[3] != 's' ) m = c[1];
    else if( c[4] == c[5] && c[5] == c[6] && c[6] != 's' ) m = c[4];
    else if( c[7] == c[8] && c[8] == c[9] && c[9] != 's' ) m = c[7];
    else if( c[1] == c[4] && c[4] == c[7] && c[7] != 's' ) m = c[1];
    else if( c[2] == c[5] && c[5] == c[8] && c[8] != 's' ) m = c[2];
    else if( c[3] == c[6] && c[6] == c[9] && c[9] != 's' ) m = c[3];
    else if( c[1] == c[5] && c[5] == c[9] && c[9] != 's' ) m = c[1];
    else if( c[3] == c[5] && c[5] == c[7] && c[7] != 's' ) m = c[3];  
    cout << m << endl;
  }
  return 0;
}

Measured memory_bytes: 1136
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a=0;
    int b=0;
    int o=0;
    int ab=0;
    while(sc.hasNext()) {
      String line = sc.nextLine();
      String[] arr = line.split(",");
      if(arr[1].equals("A")) {
        a++;
      }
      else if(arr[1].equals("B")) {
        b++;
      }
      else if(arr[1].equals("O")) {
	o++;
      }
      else if(arr[1].equals("AB")) {
	ab++;
      }
    }
    System.out.println(a);
    System.out.println(b);
    System.out.println(ab);
    System.out.println(o);
  }
}

Measured memory_bytes: 25972
N = int(input())
apartment = [[0 for i in range(20)] for j in range(15)]
for n in range (N):
    b,f,r,v = map(int,input().split())
    apartment[4*(b-1)+f-1][r*2-1] += v 
for y in range(15):
    for x in range(20):
        if(y%4==3):
            apartment[y][x]='#'
        elif x%2==0 :
            apartment[y][x]=' '
        print(apartment[y][x],end='')
    print()



Measured memory_bytes: 5640
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input().strip())
    X_list = [int(i) for i in input().strip().split()]
    sorted_x = sorted(X_list)

    left = sorted_x[(N // 2)-1]
    right = sorted_x[N // 2]
    for x in X_list:
        if x <= left:
            print(right)
        else:
            print(left)


if __name__ == "__main__":
    main()


Measured memory_bytes: 30568
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
//mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
//int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int main() {
	int n;
	scanf("%d",&n);
	int a=n%10;
	if(a==3){
		printf("bon");
	}else if(a==0||a==1||a==6||a==8){
		printf("pon");
	}else{
		printf("hon");
	}
} 

Measured memory_bytes: 3808
def sep():
    return map(int,input().strip().split(" "))
def lis():
    return list(sep())

n=int(input())
from collections import Counter
ar=lis()
c=Counter(ar)
s=0
for i in c.values():
    s+=((i*(i-1))//2)
for i in ar:
    print(s-c[i]+1)


Measured memory_bytes: 102492
w,h,x,y = map(int,input().split())


if (x==0 and y==0) or (x==w and y==0) or (x==0 and y==h)or (x==w and y==h):
    print(h*w*0.5,0)

elif x==0 or y==0 or x==w or y==h:
    print(h*w*0.5,0)
elif h/w == y/x or -h/w == (y-h)/x:
    if x*2 ==w:
        print(w*h*0.5,1)
    else:
        print(w*h*0.5,0)
else:
    
    
    print(h*w*0.5,0)


Measured memory_bytes: 38256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>
#include <cstdint>

using namespace std;
using lli = long long int;
using i64 = int64_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

int main() {
  i64 n, k;
  cin >> n >> k;
  cout << n - k + 1 << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <climits>
#include <set>
#include <string>
#include <algorithm>
#include <vector>
#define MAX 1000000007


using namespace std;
#define ll long long
#define dbg if(0)
#define ISRANGE(val,lo,hi) ((lo<=val)&&(val<hi))



int main(){
    ll ans,five=0,seven=0;
    for(int i=0;i<3;i++){
        ll a;
        cin >> a;
        if(a==5)five++;
        if(a==7)seven++;
    }


    if(five==2&&seven==1)cout <<"YES"<<endl;
    else cout <<"NO"<<endl;

    dbg cout <<ans<<endl;

    return 0;

}

Measured memory_bytes: 256
n=int(input())
A=list(map(int,input().split()))

s=0
cap=[]
flag=False
for i,a in enumerate(A):
    s*=2
    s+=a
    cap.append(min(2**i-s,(n+1-i)*10**8))
    if s>2**i:
        flag=True
        break

if flag:
    print(-1)
else:
    remain=2**n-s
    ans=0
    node=0
    for i in range(n,-1,-1):
        a=A[i]
        c=cap[i]
        node=min(c,node)+a
        ans+=node
    print(ans)


Measured memory_bytes: 701808
object Main extends App {

  import scala.io.StdIn.readLine
  val Array(n, m) = readLine().trim.split(" ").map(_.toInt)
  val arr = Array.fill(n)((1, 0))
  arr(0) = (0, 1)
  (0 until m).foreach { i =>
    val Array(a, b) = readLine().trim.split(" ").map(_.toInt)
    val x = a - 1
    val y = b - 1
    if (0  < arr(x)._2) {
      arr(y) = (0, arr(y)._1 + arr(y)._2 + 1)
      arr(x) = (arr(x)._1, arr(x)._2 - 1)
    } else {
      if (0 < arr(y)._2) {
        arr(y) = (0, arr(y)._1 + arr(y)._2 + 1)
        arr(x) = (arr(x)._1 - 1, arr(x)._2)
      } else {
        arr(y) = (arr(y)._1 + 1, arr(y)._2)
        arr(x) = (arr(x)._1 - 1, arr(x)._2)
      }
    }
  }

  println(arr.count(t => t._2 > 0))

}


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

struct seed{
    string name;
    double ic;
};

bool cmp( const seed &a, const seed &b ){
    return a.ic == b.ic ? a.name < b.name : a.ic > b.ic;
}

int main(){
    int n;
    while( cin >> n && n ){
        vector<seed> data(n);
        for( int i = 0; i < n; i++ ){
            string l;
            int p, a, b, c, d, e, f, s, m;
            cin >> l >> p >> a >> b >> c >> d >> e >> f >> s >> m;
            data[i].name = l;
            //cout << f * m * s - p << ' ' << a + b + c + ( d + e ) * m << endl;
            data[i].ic = (double)( f * m * s - p ) / (double)( a + b + c + ( d + e ) * m );
        }
        sort( data.begin(), data.end(), cmp );
        for( int i = 0; i < n; i++ ){
            cout << data[i].name << endl;
        }
        cout << '#' << endl;
    }
}

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

#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
#define SP << " " <<
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v) {
  for (T& x: v) s >> v;
  return s;
}


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

    int a, b; cin >> a >> b;
    cout << ((a*b%2)?"Odd":"Even") << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define int long long
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define inf 1000000000000000007
#define f first
#define s second
#define mini(c,a,b) *min_element(c+a,c+b)
#define maxi(c,a,b) *max_element(c+a,c+b)
//printf("%.12Lf\n",);
int keta(int x){
	rep(0,i,30){
		if(x<10){
			return i+1;
		}
		x=x/10;
	}
}
int gcd(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return bb;
		}	
		bb=bb%aa;
		if(bb==0){
			return aa;
		}
	}
}	
int lcm(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return x/bb*y;
		}	
		bb=bb%aa;
		if(bb==0){
			return x/aa*y;
		}
	}
}
bool p(int x){
	if(x==1)return false;
	rep(2,i,sqrt(x)+1){
		if(x%i==0&&x!=i){
			return false;
		}
	}	
	return true;
}
int max(int a,int b){
	if(a>=b)return a;
	else return b;
}
int min(int a,int b){
	if(a>=b)return b;
	else return a;
}	
int n2[41];		
int nis[41]; 
int nia[41];
int mody[41];
int nn;
int com(int n,int y){
	int ni=1;
	for(int i=0;i<41;i++){
		n2[i]=ni;
		ni*=2;
	}
	int bunsi=1,bunbo=1;
	rep(0,i,y)bunsi=(bunsi*(n-i))%mod;
	rep(0,i,y)bunbo=(bunbo*(i+1))%mod;
	mody[0]=bunbo;
	rep(1,i,41){
		bunbo=(bunbo*bunbo)%mod;
		mody[i]=bunbo;
	}
	rep(0,i,41)nis[i]=0;
	nn=mod-2;
	for(int i=40;i>=0;i-=1){
		if(nn>n2[i]){
			nis[i]++;
			nn-=n2[i];
		}
	}
	nis[0]++;
	rep(0,i,41){
		if(nis[i]==1){
			bunsi=(bunsi*mody[i])%mod;
		}
	}
	return bunsi;
}
int yakuwa(int n){
	int sum=0;
	rep(1,i,sqrt(n+1)){
		if(n%i==0)sum+=i+n/i;
		if(i*i==n)sum-=i;
	}
	return sum;
}	
bool hei(int n){
	rep(0,i,100){
		if(i*i==n){
			return true;
		}
	}
	return false;
}
int pow(int b,int a){	
	int aa=1;
	rep(0,i,a)aa*=b;	
	return aa;
}
int a[114514];
int gc[114514];
signed main(){
	ic(n) ic(k)
	rep(0,i,n)cin>>a[i];
	if(n==1){
		if(k!=a[0])c("IMPOSSIBLE")
		else c("POSSIBLE")
		return 0;
	}		
	gc[0]=gcd(a[0],a[1]);
	rep(1,i,n-1)gc[i]=gcd(gc[i-1],a[i+1]);
	if(k%gc[n-2]!=0)c("IMPOSSIBLE")
	else if(maxi(a,0,n)<k)c("IMPOSSIBLE")
	else c("POSSIBLE")
}


Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

class Procon {
    static void Main (string[] agrs) {
        int A = Int ();
        int B = Int ();

        if ( A >= 13 ){
          Console.WriteLine(B);
        } else if ( 6 <= A ) {
          Console.WriteLine(B/2);
        } else {
          Console.WriteLine(0);
        }
    }

    static string String () => Scanner.nextString ();
    static int Int () => int.Parse (Scanner.nextString ());
    static long Long () => long.Parse (Scanner.nextString ());
    static double Double () => double.Parse (Scanner.nextString ());
    static char[] Chars () => String ().ToCharArray ();
    static string[] Strings () => Console.ReadLine ().Split (' ');
    static int[] Ints () => Strings ().Select (v => int.Parse (v)).ToArray ();
    static long[] Longs () => Strings ().Select (v => long.Parse (v)).ToArray ();
    static double[] Doubles () => Strings ().Select (v => double.Parse (v)).ToArray ();
    const int M = 1000000007;
}

class PriorityQueue<T> where T : IComparable<T> {
    public T[] heap;
    public int size;
    public int sign;
    public PriorityQueue (int N, bool descend = false) {
        heap = new T[N];
        sign = 1;
        if (descend) sign = -1;
    }
    public int Compare (T x, T y) {
        return x.CompareTo (y) * sign;
    }
    public void Push (T x) {
        int i = size++;
        while (i > 0) {
            int p = (i - 1) / 2;
            if (Compare (x, heap[p]) >= 0) {
                break;
            }
            heap[i] = heap[p];
            i = p;
        }
        heap[i] = x;
    }
    public T Pop () {
        T ret = heap[0];
        T x = heap[--size];
        int i = 0;
        while (i * 2 + 1 < size) {
            int a = i * 2 + 1;
            int b = i * 2 + 2;
            if (b < size && Compare (heap[a], heap[b]) > 0) {
                a = b;
            }
            if (Compare (heap[a], x) >= 0) {
                break;
            }
            heap[i] = heap[a];
            i = a;
        }
        heap[i] = x;
        return ret;
    }
    public int Count () {
        return size;
    }
}

class Scanner {
    static string[] s = new string[0];
    static int i = 0;
    static int max_i = 0;
    static public string nextString () {
        if (i >= s.Length) {
            s = Console.ReadLine ().Split (' ');
            max_i = s.Length;
            i = 0;
            if (max_i == 0) {
                return "";
            }
            return s[i++];
        }
        return s[i++];
    }
}


Measured memory_bytes: 11092
package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []byte {
	return []byte(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

func run(input io.Reader, output io.Writer) int {
	sc := NewScanner()
	H := sc.nextInt()
	W := sc.nextInt()

	if H == 1 || W == 1 {
		fmt.Println(1)
		return 0
	}

	if H*W%2 == 0 {
		fmt.Println(H * W / 2)
	} else {
		fmt.Println(H*W/2 + 1)
	}

	return 0
}

func main() {
	os.Exit(run(os.Stdin, os.Stdout))
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
typedef pair<int,int>P;
#define fi first
#define se second
#define mk make_pair
main(){string s;
	cin>>s;
	if(s.size()>=4&&s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I')cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 256
n = int(input())
a = input()
b = input()
c = input()
count = 0
for i in range(n):
    ai = a[i]
    bi = b[i]
    ci = c[i]
    if ai != bi and bi != ci and ai != ci:
        count += 2
    elif ai == bi and bi == ci and ai == ci:
        continue
    else:
        count +=1
print(count)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <regex>
#ifdef _DEBUG
#include "debug.h"
#endif
#define int ll
#define FOR(i, s, e) for (int i = int(s); i < int(e); ++i)
#define REP(i, e) FOR(i, 0, e)
#define all(v) (v).begin(),(v).end()
#define mkpr make_pair
#define mktp make_tuple
#define tv(tp, i) get<(i)>(tp)
#define CLEAR(obj) obj = decltype(obj)()
#define var auto
#define OUT(type) type &
#define IN(type) const type &
#define self (*this)
#define in :
#define True true
#define False false
using namespace std; using int32 = int32_t; using str = string; using cstr = const str;
using ll = long long; using ull = unsigned long long; using cint = const int; using cll = const ll;
using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>;
using vb = vector<bool>; using vvb = vector<vb>; using vd = vector<double>; using vvd = vector<vd>;
using vc = vector<char>; using vvc = vector<vc>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using psl = pair<string, ll>;
using tiii = tuple<int, int, int>; using tlll = tuple<ll, ll, ll>;
static const int MGN = 10; static const int ARYSZ_MAX = (int)1e7;
static const ll LINF = LLONG_MAX/2;
#ifdef int
static const int INF = LINF;
#else
static const int INF = INT_MAX/2;
#endif
static double EPS = 1e-9;
#define FASTCIN() cin.tie(0);ios::sync_with_stdio(false);
#ifdef IMPORT_SAMPLE
#define DEBUG_IMPORT(file) vs args(argv, argv+argc);str sample = make_sample(args, file);ifstream ifs(sample); cin.rdbuf(ifs.rdbuf());
#else
#define DEBUG_IMPORT(file)
#endif
static inline bool DBLEQ(double a, double b) {return abs(a - b) < EPS;}
static inline void EPR(str msg) {cerr << msg << endl;}
static inline void AST(bool exp, str msg) {if(!exp){EPR(msg);} assert(exp);}
static inline void TAST(bool exp, str msg) {if(!exp){EPR(msg);} while(!exp){}}


int32 main(int32 argc, char* argv[]) {
    FASTCIN();
    DEBUG_IMPORT("sample-1");


    int N, M;
    cin >> N >> M;
    vi W(N), V(N);
    REP(i, N) cin >> W[i] >> V[i];

    int VMAX = 1000;
    var dp = vvi(N + 1, vi(VMAX * N + 4, INF));
    // dp[i][j] := [0,i) の品で、価値 j 以上とできる重さの最小値

    REP(i, N)
        dp[i][0] = 0;

    REP(i, N) {
        REP(j, VMAX * N + 1) {
            if (j + V[i] < dp[0].size()) {
                dp[i + 1][j + V[i]] = dp[i][j] + W[i];
            }

            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j]);
        }
    }

    int ans = 0;
    REP(j, VMAX *N + 1) {
        if (dp[N][j] <= M)
            ans = max(ans, j);
    }
    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 80256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b;cin >> a >> b;
	cout << a+(b/2) << endl;
}

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

typedef vector<int> vi;
typedef pair<int, int> pi;

const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;

#define pb push_back
#define mp make_pair

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, b, e) for (int i = (b); i <= (int)(e); i++)
#define DEBUG(x) cout << #x << ": " << (x) << endl
#define DEBUGA(a) cout << #a << ": "; for (const auto& v: (a)) cout << v << endl

pi r[55];

signed main() {
    int N;
    cin >> N;
    REP(i, N) {
        int x, y; cin >> x >> y;
        r[i] = mp(x, y);
    }
    sort(r, r+N);
    map<pi, int> m;
    REP(i, N) {
        REP2(j, i + 1, N - 1) {
            int dx, dy;
            dx = r[j].first - r[i].first;
            dy = r[j].second - r[i].second;
            pi vec = mp(dx, dy);
            if (m.count(vec)) m[vec]++;
            else m[vec] = 1;
        }
    }
    int M = 0;
    for (auto c : m) {
        M = max(M, c.second);
    }
    int ans = N - M;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()



template< typename T >
struct edge {
  int src, to;
  T cost;

  edge(int to, T cost) : src(-1), to(to), cost(cost) {}

  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}

  edge &operator=(const int &x) {
    to = x;
    return *this;
  }

  operator int() const { return to; }
};

template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WeightedGraph = vector< Edges< T > >;
using UnWeightedGraph = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;


int main() {
    int n;
    cin >> n;
    WeightedGraph<int> G(n);
    rep (i, n-1) {
        int u, v, w;
        cin >> u >> v >> w;
        u--; v--;
        w %= 2;
        G[u].emplace_back(v, w);
        G[v].emplace_back(u, w);
    }
    vector<int> ans(n, -1);
    ans[0] = 0;
    queue<int> Q;
    Q.push(0);
    while(Q.size()) {
        int f = Q.front();
        Q.pop();
        for (auto e: G[f]) {
            int to = e.to;
            int weight = e.cost;
            if (ans[to] != -1) {
                continue;
            }
            if (weight == 0) {
                ans[to] = ans[f];
            } else {
                ans[to] = 1 - ans[f];
            }
            Q.push(to);
        }
    }
    rep (i, n) {
        cout << ans[i] << endl;
    }
}



Measured memory_bytes: 9952
N, A, B, C, D = map(int, input().split())
S = list(input())

# 3マス空きがあるか
white = []
for i in range(N - 2):
    if S[i] == "." == S[i + 1] == S[i + 2]:
        white.append(i + 1)

if C > D:
    # Aからスタート
    i = A - 1
    T = S.copy()
    T[B - 1] = "#"
    while C - 1 != i:
        if T[i + 1] == ".":
            i += 1
        elif T[i + 2] == ".":
            i += 2
        elif i + 1 == B - 1 or i + 2 == B - 1:
            es = False
            for w in white:
                if i < w:
                    if w <= D - 1:
                        es = True
            if es:
                i = B - 1
            else:
                break
        else:
            break
    if i == C - 1:
        print("Yes")
        exit()
else:
    i = B - 1
    T = S.copy()
    while D - 1 != i:
        if T[i + 1] == ".":
            i += 1
        elif T[i + 2] == ".":
            i += 2
        else:
            break
    if i == D - 1:
        T2 = S.copy()
        T2[D - 1] = "#"
        j = A - 1
        while C - 1 != j:
            if T[j + 1] == ".":
                j += 1
            elif T[j + 2] == ".":
                j += 2
            else:
                break
        if j == C - 1:
            print("Yes")
            exit()
print("No")


Measured memory_bytes: 7796
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> ipair;
typedef tuple<int, int, int> ituple;

// const int INF = INT_MAX;
// const ll INF = LLONG_MAX;
// const int MOD = ((int)1e9 + 7);
// const ld EPS = (1e-10);
#define PI acosl(-1)
#define MAX_N (400 + 2)
int h, w;
string s[MAX_N];
ll scc_num[MAX_N * MAX_N][2];
int indexes[MAX_N][MAX_N];

void rec(int y, int x, int index, char c){
  if (y < 0 || h <= y || x < 0 || w <= x){
    return;
  }

  if (s[y][x] == c){
    return;
  }

  if (indexes[y][x] != 0){
    return;
  }

  indexes[y][x] = index;
  scc_num[index][s[y][x] == '#' ? 0 : 1]++;

  rec(y + 1, x, index, s[y][x]);
  rec(y, x + 1, index, s[y][x]);
  rec(y, x - 1, index, s[y][x]);
  rec(y - 1, x, index, s[y][x]);
}

void exec(){
  cin >> h >> w;
  for (int i = 0; i < h; i++){
    cin >> s[i];
  }

  int index = 1;
  for (int i = 0; i < h; i++){
    for (int j = 0; j < w; j++){
      rec(i, j, index++, ' ');
    }
  }

  ll ans = 0;
  for (int i = 0; i < MAX_N * MAX_N - 1; i++){
    if (scc_num[i][0] != 0 || scc_num[i][1] != 0){
      // printf("scc_num[%d][0] = %lld, scc_num[%d][1] = %lld\n", i, scc_num[i][0], i, scc_num[i][1]);
      ans += scc_num[i][0] * scc_num[i][1];
    }
  }

  cout << ans << endl;
}

void solve(){
  int t = 1;
  // scanf("%d", &t);
  for (int i = 0; i < t; i++){
    exec();
  }
}

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


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

int main()
{
  string s;
  cin >> s;
  string ans = "WA";
  if (s.front() == 'A' && islower(s[1]) && islower(s.back())) {
    auto t = s.substr(2, s.size() - 3);
    bool f(true);
    int cnt(0);
    for (const auto& e : t) {
      if (e == 'C') {
	cnt++;
      } else if (!islower(e)) {
	f = false;
	break;
      }
    }
    if (f && cnt == 1) ans = "AC";
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#define ll				long long
#define MOD				1000000007

#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

typedef struct data {
	int a;
	int b;
} data;

FILE *in, *ans;
int tno;

int out(const char *s) {
#ifdef TEST
	char buf[8192];
	fgets(buf, sizeof(buf), ans);
	if (strcmp(buf, s)) {
		printf("err\n");
	}
#else
	printf(s);
#endif
	return 0;
}

int outi(int i) {
	char s[128];
	sprintf(s, "%d\n", i);
	out(s);
	return 0;
}

int outll(ll l) {
	char s[128];
	sprintf(s, "%lld\n", l);
	out(s);
	return 0;
}

int geti() {
	int i;
	fscanf(in, "%d", &i);
	return i;
}

ll getll() {
	ll l;
	fscanf(in, "%lld", &l);
	return l;
}

int getstr(char *s) {
	fscanf(in, "%s", s);
	return 0;
}

int fnc() {

	int n = geti();
	int k = geti();
	char s[128];
	getstr(s);

	s[k - 1] = (char)towlower(s[k - 1]);
	s[n] = '\n';
	s[n+1] = '\0';

	out(s);

	return 0;
}

int main() {

#ifdef TEST
	for (tno = TEST_SNO; tno <= TEST_ENO; tno++) {
		char str[128];
		sprintf(str, "test%d.txt", tno);
		in = fopen(str, "r");
		sprintf(str, "ans%d.txt", tno);
		ans = fopen(str, "r");
		fnc();
		fclose(in);
		fclose(ans);
	}
	printf("end\n");
#else
	in = stdin;
	fnc();
#endif

	return 0;
}


Measured memory_bytes: 128
#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std;

const int N=100010;

int n,a[N],cnt[N],f[N],xs[N],lst[N];

int main(){
  scanf("%d",&n);
  for(int i=1,x,y,w;i<n;i++)
    scanf("%d%d%d",&x,&y,&w),a[x]^=w,a[y]^=w;
  for(int i=0;i<n;i++) cnt[a[i]]++;
  int ans=cnt[0]; cnt[0]=0;
  for(int i=1;i<16;i++) ans+=cnt[i]/2,cnt[i]%=2;
  for(int i=1;i<(1<<15);i++){
    lst[i]=(i&1)?1:lst[i>>1]+1;
    xs[i]=xs[i-(1<<lst[i]-1)]^lst[i];
    for(int j=i;j;j=(j-1)&i)
      if(xs[j]==0) f[i]=max(f[i],f[i^j]+1);
  }
  int S=0;
  for(int i=1;i<16;i++) S|=cnt[i]*(1<<i-1);
  ans+=f[S];
  printf("%d\n",n-ans);
  return 0;
}


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

int p[100001]={0};

int main(){
    int n;
    cin >> n;
    for(int i=1;i<=n;++i){
        cin >> p[i];
    }
    int ans=0;
    for(int i=1;i<=n;++i){
        if(p[i] == i){
            if(i != n){
                int tmp = p[i];
                p[i] = p[i+1];
                p[i+1] = tmp;
            }else{
                int tmp = p[i];
                p[i] = p[i-1];
                p[i-1] = tmp;
            }
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}


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

int main() {
  int n, q, m, d;
  map<int, int>::iterator it;

  while (cin >> n >> q, n) {
    map<int, int> freq;
    rep (i, n) {

      cin >> m;
      rep (k, m) {
        cin >> d;

        it = freq.find(d);
        if (it == freq.end()) {
          freq[d] = 1;
        }
        else {
          freq[d]++;
        }
      }
    }

    int max_d = -1;
    int max_v = 0;

    for (pair<int, int> p : freq) {
      if (max_v < p.second) {
        max_d = p.first;
        max_v = p.second;
      }
    }

    if (max_v >= q) {
      cout << max_d << endl;
    }
    else {
      cout << 0 << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr long long INF = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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


    int N,K;
    cin>>N>>K;

    int A[N];
    rep(i,N){
        cin>>A[i];
    }

    sort(A,A+N);

    int ng=0,ok=A[N-1];
    while(ok-ng>1){
        int mid=(ok+ng)/2;

        int c=0;
        rep(i,N){
            c+=(A[i]-1)/mid;
        }
        if(c<=K)ok=mid;
        else ng=mid;
    }
    cout << ok << endl;
    



}


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

using namespace std;

int n, a[200005], ans[200005], ans_cnt;
bool mark[200005];

int main(void)
{
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
        scanf("%d", &a[i]);
    for (int i = n; i >= 1; --i)
    {
        int tmp = 0;
        for (int j = i; j <= n; j += i)
            if (mark[j]) tmp ^= 1;
        if (tmp != a[i])
        {
            mark[i] = true;
            ans[++ans_cnt] = i;
        }
    }
    printf("%d\n", ans_cnt);
    for (int i = ans_cnt; i >= 1; --i)
        printf("%d\n", ans[i]);
    return 0;
}


Measured memory_bytes: 2432