akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
using ull = unsigned long long;
using ll = long long;
using lli = long long int;
using ld = long double;
using pa = pair<int, int>;
using ppa = pair<pa, int>;
#define SORT(v, n) sort(v, v + n);
#define ALL(v) v.begin(), v.end()
#define VSORT(v) sort(ALL(v))
#define GRESORT(v) sort(ALL(v), greater<ll>())
#define REVERSE(v) reverse(ALL(v))
#define overlap(v) v.erase(unique(ALL(v)), v.end())
#define debug(x) cout << #x << ": " << x << endl
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for (int i = (b - 1); i >= a; i--)
#define rrep(i, n) RFOR(i, 0, n)
#define INF INT_MAX
#define SUP INT_MIN
#define mins(a, b) a = min(a, b)
#define maxs(a, b) a = max(a, b)

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

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

const ll MOD = 1000000007;

ll pow_mod(ll a, ll b, ll mod) {
    ll tmp = 1;
    a %= mod;
    if (b > 0) {
        tmp = pow_mod(a, b / 2, mod);
        if (b % 2)
            tmp = (((tmp * tmp) % mod) * a) % mod;
        else
            tmp = (tmp * tmp) % mod;
    }
    return tmp;
}

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


vector<ll> prime(1010);

void solve(){
    int n;
    cin >> n;
    for(int i = 2; i <= n; i++){
        int tmp = 2;
        for(int j = i; j > 1;){
            if(j%tmp == 0){
                prime[tmp]++;
                j /= tmp;
            }else{
                tmp++;
            }
        }
    }
    ll ans = 1;
    for(int i = 2; i <= 1000; i++){
        if(prime[i]) ans = ans * (prime[i]+1) % MOD;
    }
    cout << ans << endl;
}

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

    solve();

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int a,b;
    
    scanf("%d",&a);
    scanf("%d",&b);
    
    if((a+b) == 15)
    {
        printf("+\n");
    }
    else if((a*b) == 15)
    {
        printf("*\n");
    }
    else
    {
        printf("x\n");
    }
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin>>N;
    int a[N];
    for(int i=0;i<N;i++){
        cin>>a[i];
    }
    map<int,int> m;
    int p=1;
    for(int i=0;i<N+2;i++){
        if(p==2){cout<<i<<endl;exit(0);}
        if(m[p]==1){cout<<"-1"<<endl;exit(0);}
        m[p]++;
        p=a[p-1];
    }
}

Measured memory_bytes: 5376
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <string>
#include <fstream>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int,int>
#define MA make_pair
#define LL long long
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int MOD=1e9+7;
//
int N,C;
int S[100000],T[100000],c[100000];
int sm[200002],tt[200002];
int main(){
  cin>>N>>C;
  FOR(i,0,N){
    cin>>S[i]>>T[i]>>c[i];
  }
  FOR(i,1,C+1){
    fill(tt,tt+200002,0);
    FOR(j,0,N){
      if(c[j]==i){
        tt[S[j]*2-1]++;
        tt[T[j]*2]--;
      }
    }
    FOR(j,1,200002){
      tt[j]+=tt[j-1];
    }
    FOR(j,0,200002){
      if(tt[j]>0){
        sm[j]++;
      }
    }
  }
  int M=0;
  FOR(i,0,200002){
    M=max(M,sm[i]);
  }
  cout<<M<<endl;
  return 0;
}


Measured memory_bytes: 2944
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	void solve() throws IOException {
		int[] a = nia( ni());
		Arrays.sort(a);
		out.println(a[a.length-1]-a[0]);
	}

	String ns() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine(), " ");
		}
		return tok.nextToken();
	}

	int ni() throws IOException {
		return Integer.parseInt(ns());
	}

	long nl() throws IOException {
		return Long.parseLong(ns());
	}

	double nd() throws IOException {
		return Double.parseDouble(ns());
	}

	String[] nsa(int n) throws IOException {
		String[] res = new String[n];
		for (int i = 0; i < n; i++) {
			res[i] = ns();
		}
		return res;
	}

	int[] nia(int n) throws IOException {
		int[] res = new int[n];
		for (int i = 0; i < n; i++) {
			res[i] = ni();
		}
		return res;
	}

	long[] nla(int n) throws IOException {
		long[] res = new long[n];
		for (int i = 0; i < n; i++) {
			res[i] = nl();
		}
		return res;
	}

	public static void main(String[] args) throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		tok = new StringTokenizer("");
		Main main = new Main();
		main.solve();
		out.close();
	}
}

Measured memory_bytes: 23252
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 1000000007;

int sum[2001][2001];

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

    int n, m;
    cin >> n >> m;

    vector<int> s(n), t(m);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        sum[i + 1][0] = 1;
    }
    for (int j = 0; j < m; j++) {
        cin >> t[j];
        sum[0][j + 1] = 1;
    }
    sum[0][0] = 1;

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            int x = sum[i][j + 1] + sum[i + 1][j] - sum[i][j];
            if (x < 0) x += P;
            if (x >= P) x -= P;

            if (s[i] == t[j]) {
                x += sum[i][j];
                if (x >= P) x -= P;
            }
            sum[i + 1][j + 1] = x;
        }
    }

    cout << sum[n][m] << endl;

    return 0;
}

Measured memory_bytes: 15872
#include <bits/stdc++.h>
#define ll long long int
#include<list>
#include<algorithm>
#define ld long double
#define pb push_back
#define FF first
#define SS second
#define rep(a,b,c) for(a=b;a<c;a++)
#define repr(a,b,c) for(a=b-1;a>=c;a--)
#define PLL pair<ll, ll>
#define inf 100000001
#define mod 1000000007
#define LB lower_bound
#define UB upper_bound
#define MP make_pair
#define PQ priority_queue
#define rep1 for(i=1;i<=n;i++)
#define VLL vector<ll>
#define EF else if
const double pi  =3.141592653589793238463;
#define all(x) (x).begin(), (x).end()
#define SORT(A) sort(A.begin(), A.end());
#define REVERSE(A) reverse(A.begin(), A.end());
#define UMP unordered_map
#define MAX LLONG_MAX
#define MIN LLONG_MIN
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define test1(x)                cerr<<#x<<": "<<x<<endl
#define test2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define test3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define test4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define test5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define test6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
using namespace std;
/*
    //string with spaces
    std::string str;
    std::getline(std::cin >> std::ws, str);
*/
ll myXOR(unsigned long long int x, unsigned long long int y)
{
    return (x|y)&(~x|~y);   
}
ll powerLL(ll x, ll n) 
{ 
    ll result = 1; 
    while (n) { 
        if (n & 1) 
            result = result * x % mod; 
        n = n / 2; 
        x = x * x % mod; 
    }
    return result; 
}
int main()
{
    fastio
    ll a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r, t,u,w,x,y,z;
    string str, ss, str1;
    cin>>n;
    ll arr[n];
    ll res=0;
    rep(i,0,n){
        cin>>arr[i];
    }
    for(i=0;i<n-1;i++){
        if(arr[i] > arr[i+1]){
            j = i+1;
            while(j<n && arr[j]<=arr[i]){
                res += abs(arr[i]-arr[j]);
                j++;
            }
            i = j-1;
        }
    }
    cout<<res;
}

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

/* メモリ食い過ぎ注意 */
#define int long long

typedef long long ll;

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

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

    int cnt = 0;
    for (int i = 1; i <= n; i++)
    {
        if (i % 2 == 0)
            continue;
        int tmp = 0;
        for (int j = 1; j <= n; j++)
        {
            if (i % j == 0)
            {
                tmp++;
            }
        }
        if (tmp == 8)
            cnt++;
    }
    cout << cnt << endl;
}


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

nmax = max(nlist)
nmin = min(nlist)

costs = []

for i in range(nmin,nmax + 1):
    p = 0
    for j in range(len(nlist)):
        p = p + (i-nlist[j]) ** 2
    costs.append(p)
    
print(min(costs))
    

Measured memory_bytes: 3060
import sys
from collections import Counter
from collections import deque
import math
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

a,b,h,m=mp()
print((a**2+b**2-2*a*b*math.cos(2*math.pi*(abs(h+m/60)/12-m/60)))**0.5)

Measured memory_bytes: 9788
#include<bits/stdc++.h>
using namespace std;
long long gcd(long long a,long long b)
{
	if(b==0) return a;
	else gcd(b,a%b);
}
int main()
{
	int n;
	cin>>n;
	long long a[105];
	long long ans,gg;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		if(n==1)
		{
			ans=a[0];
			break;
		}
		if(i==1)
		{
			ans=gcd(a[0],a[1]);
			ans=a[0]/ans*a[1];
		}
		else if(i>1)
		{
			gg=gcd(ans,a[i]);
			ans=a[i]/gg*ans;
		}
	}
	cout<<ans<<endl;
	
	
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <cassert>
#include <queue>
//#include "optimization.h"

using namespace std;

const int mod = 1000000007;

int32_t main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    #else
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif // LOCAL
    string s;
    cin >> s;
    for (int i = 0; i + 8 < s.size(); i++)
        cout << s[i];
    #ifdef LOCAL
    cout.flush();
    _Exit(0); //GLIBCXX_DEBUG not working without it
    #endif // local
    return 0;
}



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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)

int main()
{
    lint n;cin >> n;
    lint ans=0;
    ans = n / 2 + !!(n % 2);

    cout << ans <<"\n";

    return 0;
}

Measured memory_bytes: 256
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

int compare_f(const void *a, const void *b) {
	return *((size_t *)a) > *((size_t *)b) ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
	size_t result = 1;

	for (size_t i = 0; i < r; i++) {
		result *= n - i;
		result /= i + 1;
	}

	return result;
}

static size_t countDivisors(const size_t n)
{
	size_t count = 1;

	for (size_t i = 2; i <= n; i++) {
		if (n%i == 0) {
			count++;
		}
	}

	return count;
}

int main(void) {
	size_t N;

	scanf("%zu", &N);

	size_t count = 0;

	for (size_t i = 1; i <= N; i += 2) {
		if (countDivisors(i) == 8) {
			count++;
		}
	}

	printf("%zu\n", count);

	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define pi acos(-1.0)
#define eps 1e-9
#define ll long long
#define ull unsigned long long
#define sf scanf
#define pf printf
#define nl printf("\n")
#define ps(s) printf("%s",s.c_str())
#define	inf (ll)1e15
#define mod 1000000007
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend() 
#define sz(x) (int)(x).size()
#define test_case int ___t;scanf("%d", &___t);for(int cs=1;cs<=___t;cs++)

using namespace __gnu_pbds;
using namespace std;

inline string str_inp(int n){char ch[n+5];sf(" %s",ch);return string(ch);}
inline string line_inp(int n)
{char ch[n+5];fgets(ch,n+5,stdin);string s=string(ch);s.pop_back();return s;}

//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set;


const int S=100100;

double Find_side(double b,double c,double theta)
{
	double a=(b*b)+(c*c)-2.0*b*c*cos((theta*pi)/180.0);
	return a;
}

double Find_angle(double h,double m)
{
	double mAngle=m*6;
	double hAngle=h*30;
	double hExtra=(m/60.0)*30;
	hAngle+=hExtra;
	return abs(hAngle-mAngle);
}

int main()
{
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt","r",stdin);
    //#endif
	double A,B,H,M;
	while(~sf("%lf %lf %lf %lf",&A,&B,&H,&M))
	{
		double theta=Find_angle(H,M);
		if(theta>180.0)theta=360.0-theta;
		//pf("%f\n",theta);
		double a=Find_side(A,B,theta);
		a=sqrt(a);
		pf("%.10f\n",a);
	}
    return 0;
}
 






































Measured memory_bytes: 4316
alphabet=dict.fromkeys("abcdefghijklmnopqrstuvwxyz",0)
t=list(alphabet)
while True:
    try:
        N = input()
    except:
        break
    N=N.lower()
    z = list(N)
    if N=='':
        break
    for i in range(len(z)):
        for j in range(len(t)):
            if z[i]==t[j]:
                alphabet[t[j]]+=1
for key, value in alphabet.items():
    print(key, ':', value)


Measured memory_bytes: 5572
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <cmath>
#include <queue>
#include <ctime>
#include <utility> // std::pair
#include <functional> // std::greater <int> ()
#define int long long
#define inf 1000000000000000001
#define BASE 29 // hashings mod, can be rand'd
#define mod 998244353 // can be 1000000007
#define pi 3.1415926535897
#define pii pair <int, int>
#define fii first
#define see second

typedef long long ll;
typedef long double ld;
using namespace std;

int n;
int sum=0;

// functions
void input(){
	cin >> n;
	int x;
	for(int i=1; i<=n; i++){
		cin >> x;
		sum+=x-1;
	}
	return;
}

void solve(){
	cout << sum;
	return;
}

void output(){
	return;
}

signed main(){
/*
//  REMEMBER TO TURN OFF IFDEF IN PROBLEMS WITH FILE I/O
*/
#ifdef sheeep
	freopen("forces.inp", "r", stdin);
	freopen("forces.out", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
//	int t;
//	cin >> t;
//	for(int i=1; i<=t; i++){
		input();
		solve();
		output();
//	}
	return 0;
}
// Author: NamSPro


Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 1e-5
#define LONG_INF 1000000000000000000LL
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144*4
#define REP(a,b) for(long long a = 0;a < b;++a)
int main(){
#define int long long
	long long n, k;
	cin >> n >> k;
	int ans = 0;
	long long geko = 0;
	for (int i = 0; i < n-2; ++i) {
		for (int q = 0; q < 5; ++q) {
			int now_value = 81 + 63 * i + 9 * q;
			if (now_value % 11 == k) {
				ans++;
				geko++;
			}
		}
		if (i == 10) {
			long long next_i = (n - 2) / 11;
			next_i *= 11;
			long long hoge = next_i / 11 - 1;
			ans += geko * hoge;
			i = next_i-1;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 888
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,m = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    d = defaultdict(int)
    sm = 0
    d[0] += 1
    for ai in a:
        sm = (sm+ai)%m
        d[sm] += 1
    ans = 0
    for i in d.values():
        ans += i*(i-1)//2
    print(ans)


    return

if __name__ == '__main__':
    main()


Measured memory_bytes: 91916
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
from collections import deque

def main():
    s = IS()
    dq = deque()
    for c in s:
        if c == 'B':
            if dq: dq.pop()
            else: continue
        else: dq.append(c)
    print(''.join(dq))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3316
n = int(input())
p = input().split()
p = [int(num) for num in p]
t = 0
for i in range(1,n-1):
  if ((p[i-1] < p[i] and p[i] < p[i+1])
      or (p[i+1] < p[i] and p[i] < p[i-1])):
    t += 1
print(t)

Measured memory_bytes: 3060
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace AtCoder
{
	class Program
	{
		static void Main(string[] args)
		{
			var Instance = new Question();
			Instance.Exec();
		}
	}

	public class Question
	{
		public void Exec()
		{
			List<double> stdevs = new List<double>();
			while (true) {
				string str = Console.ReadLine();
				if (str == "0") {
					break;
				}

				long n = long.Parse(str);
				var array = Console.ReadLine().Split(' ').Select(i => double.Parse(i)).ToArray();
				double ave = array.Average();
				double stdev = 0.0;
				for (var i = 0; i < array.Length; ++i) {
					stdev += (array[i] - ave) * (array[i] - ave);
				}

				stdev /= array.Length;
				stdevs.Add(Math.Sqrt(stdev));
			}

			
			foreach (var item in stdevs) {
				Console.WriteLine($"{item:f6}");
			}
			
			Console.ReadKey();
		}
	}
}


Measured memory_bytes: 20516
#include <iostream>
#include <string>
#include <vector>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main()
{
  int MOD = 998244353;

  int N, S;
  cin >> N >> S;
  vector<int> A(N);
  rep(i, N) cin >> A[i];

  vector<vector<long long>> m(N + 1);
  rep(i, N + 1) m[i].resize(S + 1, 0);

  m[0][0] = 1;
  rep(i, N)
  {
    rep(j, S + 1)
    {
      m[i + 1][j] += 2 * m[i][j];
      m[i + 1][j] %= MOD;
      if (j + A[i] <= S)
      {
        m[i + 1][j + A[i]] += m[i][j];
        m[i + 1][j + A[i]] %= MOD;
      }
    }
  }

  cout << m[N][S] << endl;

  return 0;
}


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

typedef pair<int, int> P;
vector<vector<char>> field;
vector<vector<int>> dist;



int main() {
  int h, w;
  cin >> h >> w;
  field.resize(h, vector<char>(w));
  dist.resize(h, vector<int>(w, -1));

  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> field[i][j];
    }
  }

  int ans = 0;
  int cnt = 0;
  for (int ii = 0; ii < h; ii++) {
    for (int jj = 0; jj < w; jj++) {
      if (field[ii][jj] == '#') continue;
      dist[ii][jj] = 0;
      queue<P> que;
      que.push(P(ii, jj));
      
      int dy[4] = {1, 0, -1, 0}, dx[4] = {0, 1, 0, -1};
      while (!que.empty()) {
        P p = que.front(); que.pop();
        int y = p.first, x = p.second;
        for (int k = 0; k < 4; k++) {
          int ny = y + dy[k], nx = x + dx[k];
          if (ny >= 0 && ny < h && nx >= 0 && nx < w && field[ny][nx] == '.' && dist[ny][nx] == -1) {
            dist[ny][nx] = dist[y][x] + 1;
            ans = max(ans, dist[ny][nx]);
            que.push(P(ny, nx));
          }
        }

      }
      for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
          dist[i][j] = -1;
        }
      }
      
    }
   
  }
  cout << ans << endl;  
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

struct Edge
{
    int to,w;
};

int n,x,y,z;
vector<Edge> e[100010];
int ans[100010];

void dfs(int p,int fa,int col)
{
    ans[p]=col;
    for (Edge nxt:e[p])
    {
        int nxtp=nxt.to;
        if (nxtp==fa) continue;
        if (nxt.w&1)
        {
            dfs(nxtp,p,!col);
        }
        else
        {
            dfs(nxtp,p,col);
        }
    }
}

void add_edge(int u,int v,int w)
{
    e[u].push_back({v,w});
    e[v].push_back({u,w});
}

int main()
{
    scanf("%d",&n);
    for (int i=1;i<n;i++)
    {
        scanf("%d%d%d",&x,&y,&z);
        add_edge(x,y,z);
    }
    dfs(1,0,0);
    for (int i=1;i<=n;i++)
    {
        printf("%d\n",ans[i]);
    }
    getchar(); getchar();
    return 0;
}

Measured memory_bytes: 8320
/*  -*- coding: utf-8 -*-
 *
 * 3027.cc: OOllOll
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

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

  int k = 0;
  for (int b = 2; b - 1 <= n; k++, b <<= 1);

  printf("%d\n", k);
  return 0;
}



Measured memory_bytes: 3220
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <queue>
using namespace std;
int main(){
    int x,y;
    cin >> x >> y;
    int c=1e18;
    if(y>=x){
        c=min(c,y-x);
        if(y>=-x){
            c=min(c,y+x+1);
        }
        if(-y>=x){
            //cout<<"sjhc"<<endl;
           // cout<<-y+x+1<<endl;
            c=min(c,-y-x+1);
        }
    }else{
        c=min(c,x-y+2);
        if(-y>=x){
            c=min(c,-y-x+1);
        }
        if(y>=-x){
            c=min(c,y+x+1);
        }
    }
    cout<<c<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

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

int main() {

    ll a, b, c;
    cin >> a >> b >> c;

    ll tmp = (c - a - b) * (c - a - b)  - 4 * a * b;
    if (tmp > 0 && (c - a - b) >= 0) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
	public static void main(String args[]){
    	Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        
        if((a*b)%2==0){
          	System.out.println("No");
        }else{
        	System.out.println("Yes");
        }      
    }
}

Measured memory_bytes: 23764
//#include <algorithm>
//#include <cstdio>
//#include <functional>
#include <iostream>
//#include <cfloat>
//#include <climits>
//#include <cstdlib>
//#include <cstring>
//#include <cmath>
#include <map>
//#include <queue>
//#include <set>
//#include <sstream>
//#include <stack>
//#include <string>
//#include <time.h>
//#include <vector>
//#include <random>
//#include <unordered_set>
//#include <complex>
#define WAIT system ("pause")
#define rt0 return 0
using namespace std;
int main()
{
    int n,m;
    map <string,int> mp;
    string tmp[200];
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>tmp[i];
        mp[tmp[i]]++;
    }
    cin>>m;
    for(int i=0;i<m;i++)
    {
        cin>>tmp[n];
        mp[tmp[n]]--;
    }
    int mx=0;
    for(int i=0;i<n;i++) if(mp[tmp[i]]>mx) mx=mp[tmp[i]];
    cout<<mx;
    WAIT;
    rt0;
}

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

const int N_MAX = 26;

int main(){
    int N;  string S;
    cin >> N >> S;
    int len = S.size();

    for(int i = 0; i < len; i++){
        S[i] += N;
        if(S[i] > 'Z')
            S[i] -= N_MAX;
    }  
    cout << S << endl;
}


Measured memory_bytes: 256
n = int(input())
flag = False

for i in range(int(n / 4 + 1)):
    for j in range(int(n / 7 + 1)):
        if(flag == False):
            if(i * 4 + j * 7 == n):
                print("Yes")
                flag = True

if(flag == False):
    print("No")


Measured memory_bytes: 9136
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
#define IOS cin.tie(0),ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
template<class Type>struct is_vector : std::false_type {};
template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T> inline ostream& operator << (ostream& out, const vector<T>& v) {
	if (v.empty())return out;
	constexpr bool is_vector_v = is_vector<T>::value;
	if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
	else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
	return out;
}
inline void put() {}
template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }
inline void putn() {}
template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first << "\n"; putn(rest...); }

int main() {
	IOS;
	int n;
	ll k;
	cin >> n >> k;
	vector<ll> a(n), f(n);
	priority_queue<P> q;
	REP(i, n) {
		cin >> a[i];
	}
	REP(i, n) {
		cin >> f[i];
	}
	sort(all(a));
	sort(all(f), greater<ll>());
	ll sum = 0;
	REP(i, n) {
		P temp = P(a[i] * f[i], f[i]);
		sum += a[i] * f[i];
		q.push(temp);
	}
	ll lb = -1, ub = 1e18;
	while (ub - lb > 1) {
		ll mid = (lb + ub) / 2;
		ll temp = 0;
		REP(i, n) {
			ll t = mid / f[i];
			ll t2 = max<ll>(a[i] - t,0);
			temp += t2;
		}
		if (temp <= k) {
			ub = mid;
		} else {
			lb = mid;
		}
	}
	put(ub);
	return 0;
}


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

int main()
{
    std::string s;
    std::cin >> s;
    bool res = true;
    if(s[0] != 'A')res = false;
    s.erase(s.begin());
    int cnt = 0;
    for(int i = 1; i < (int)s.size() - 1; i++){
        if(s[i] == 'C'){
            cnt++;
        }
    }
    if(cnt != 1)res = false;
    for(int i = 0; i < (int)s.size(); i++){
        if('A' < s[i] && s[i] < 'Z' && s[i] != 'C')res = false;
    }
    std::cout << (res ? "AC" : "WA") << std::endl;
}

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

#define ll long long
#define all(x) (x).begin(),(x).end()
#define SZ(x) (x).size()
#define fir first
#define sec second

void scan() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}


using namespace std;
const int maxn = 2e5 + 7;
int a[maxn], pre[maxn];

int main() {
    //scan();

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

    int a,b,c;cin>>a>>b;
    for(int i=b-a+1;i<=b+a-1;i++) cout<<i<<" ";
    cout<<endl;


    return 0;
}




















Measured memory_bytes: 256
import java.util.*;
import java.text.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
   static final double T = 3.305785;
   public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String[] arr = sc.nextLine().split(" ");
    double a = Double.parseDouble(arr[0]);
    double b = Double.parseDouble(arr[1]);
    
    System.out.println(a*b/T);
    
   }//main
}//class

Measured memory_bytes: 26408
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pll;



int main(){

    ll n;
    cin >> n;

    vector<ll> h(n);
    for(int i = 0; i< n; i++){
        cin >> h.at(i);
    }

    vector<ll> hkai(1);

    hkai.at(0) = h.at(0);
    for(int i = 0; i< n-1; i++){
        if(h.at(i)!=h.at(i+1)){
            hkai.push_back(h.at(i+1));
        }
    }

    for(int i = 0; i< hkai.size()-1; i++){
        if(hkai.at(i) > hkai.at(i+1)){
            hkai.at(i)--;
        }
    }

    for(int i = 0; i< hkai.size()-1; i++){
        if(hkai.at(i) > hkai.at(i+1)){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    return 0;
    

}


Measured memory_bytes: 2168
#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;

int main() {
    int N, Q, li, ri;
    string S;
    cin >> N >> Q >> S;

    int cumsum[N] = {0}, cs=0;
    for (int i=1; i<N; i++) {
        if (S.substr(i-1, 2) == "AC") cs++;
        cumsum[i] = cs;
    }

    for (int i=0; i<Q; i++) {
        cin >> li >> ri;
        cout << cumsum[ri-1] - cumsum[li-1] << endl;
    }

    return 0;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,x;
  int mn=0,mx=0,tp;
  cin>>n>>m>>x;
  for (int i=0;i<m;i++){
    cin>>tp;
    if(tp>x)mx++;
    if(tp<x)mn++;
  }
  cout<<(mn>mx?mx:mn)<<endl;
  return 0;
}

Measured memory_bytes: 256
import sys
from math import sqrt, gcd, ceil, log
from bisect import bisect
from collections import defaultdict
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)



def solve():
	print(read().index(0)+1)






if __name__ == "__main__":
	solve()

Measured memory_bytes: 9464
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
x,y = map(int,input().split())
if (x+y)%3 != 0:
  print(0)
else:
  n = (x+y)//3
  r = min(abs(2*n-x),abs(n-x))
  if 2*n < x or x < n:
    print(0)
  else:
    a = cmb(n,r,mod)
    print(a)

Measured memory_bytes: 128584
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n = read::<usize>();
    let t = read::<i64>() * 1000;
    let a = read::<i64>() * 1000;
    let mut hs = vec![0; n];
    for i in 0..n {
        hs[i] = read::<i64>();
    }
    let mut ans_index = 0;
    let mut ans = 1 << 30;
    for i in 0..n {
        let v = (a - (t - hs[i] * 6)).abs();
        if v < ans {
            ans = v;
            ans_index = i;
        }
    }
    println!("{}", ans_index + 1);
}


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

int main(){
  
  long long N; long long K;
  cin >> N >> K;
  long long J;
  J = N+1-K;
  cout << ((J*(J+1)/2)*(N+1)-J*(J+1)*(2*J+1)/6+J+1)%1000000007 << endl;
  
}

Measured memory_bytes: 3592
package main

import (
	"fmt"
)

func main() {
	var input string
	fmt.Scanf("%s", &input)

	s := ""
	for i := 0; i < len(input); i++ {
		switch string(input[i]) {
		case "0":
			s += "0"
		case "1":
			s += "1"
		case "B":
			if s != "" {
				s = s[0 : len(s)-1]
			}
		}
	}
	fmt.Println(s)
}


Measured memory_bytes: 512
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if B > A :
    if A + V*T >= B + W*T :
        print('YES')
    else :
        print('NO')
elif A > B :
    if B - W*T >= A - V*T :
        print('YES')
    else :
        print('NO')

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

int main()
{
	int h, w;
	while (true) {
		cin >> h >> w;
		if (h == 0 && w == 0) { break; }

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if (i % 2 == 0) {
					if (j % 2 == 0) {
						cout << '#';
					}
					else {
						cout << '.';
					}
				}
				else {
					if (j % 2 == 0) {
						cout << '.';
					}
					else {
						cout << '#';
					}
				}
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
#define ll long long
#define lld long long double
#define pb push_back
#define mp make_pair
#define M 1000000007
using namespace std;



int f(int n, int k, int a[]) {
	ll dp[n + 2][k + 2];
	for (int j = 0; j <= k; j++)
		dp[1][j] = (j > a[1]) ? 0 : 1;
	for (int i = 2; i <= n; i++) {
		for (int j = 0; j <= k; j++) {
			if (j == 0) dp[i][j] = dp[i - 1][j];
			else {
				dp[i][j] = (M + dp[i][j - 1] + dp[i - 1][j] - ((j - a[i] - 1 >= 0) ? dp[i - 1][j - a[i] - 1] : 0)) % M;
			}
		}
	}
	return dp[n][k];
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	int n, k;
	cin >> n >> k;
	int a[n + 1];
	for (int i = 1; i <= n; i++) cin >> a[i];
	cout << f(n, k, a);
	return 0;
}

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

int main() {
    int N,D; cin >> N >> D;
    if(N%(D*2+1)==0){
        cout << N/(D*2+1) << endl;
    }
    else cout << N/(D*2+1)+1 << endl;

    return 0;
}

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

int main()
{
    string s;
    cin >> s;
    vector<int> abcd(4);
    for (int i = 0; i < 4; i++)
    {
        abcd[i] = s[i] - '0';
    }
    
    for (int i = 0; i < (1 << 3); i++)
    {
        bitset<3> bit(i);
        int num = abcd[0];
        for (int j = 0; j < 3; j++)
        {
            if(bit[j])num += abcd[j + 1];
            else num -= abcd[j + 1];
        }
        
        if(num == 7)
        {
            cout << s[0];
            for (int j = 0; j < 3; j++)
            {
                if(bit[j])cout << "+" << s[j + 1];
                else cout << "-" << s[j + 1];
            }
            cout << "=7" << endl;
            break;
        }
    }
    
    
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#define MAX_N (int)1e5+5
using namespace std;
typedef long long ll;
typedef pair<double, int> P;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(8);
    int N, W;
    cin >> N >> W;
    int v[MAX_N], w[MAX_N];
    vector<P> d;
    for(int i = 0; i < N; i++)
    {
        cin >> v[i] >> w[i];
        double tmp = (double)v[i] / w[i];
        d.push_back(P(tmp, w[i]));
    }
    sort(d.begin(), d.end(), greater<P>());
    double ans = 0;
    for(int i = 0; i < d.size(); i++)
    {
        if(W <= 0) break;
        int tmp = min(d[i].second, W);
        ans += d[i].first * tmp;
        W -= tmp;
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 5468
w,h,n = map(int,input().split())
mdx = [0]
pdx = [w]
mdy = [0]
pdy = [h]
for i in range(n):
    x,y,a = map(int,input().split())
    if a == 1:
        mdx.append(x)
    elif a == 2:
        pdx.append(x)
    elif a == 3:
        mdy.append(y)
    else:
        pdy.append(y)
print(max(0,min(pdx)-max(mdx))*max(0,min(pdy)-max(mdy)))  

Measured memory_bytes: 3064
#include <iostream>

using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 10;

int n;
ll a[MAXN];
ll l[MAXN], r[MAXN];

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

void solve() {
  l[0] = 0;
  r[0] = 0;
  l[1] = a[0];
  r[1] = a[n-1];

  for (int i=2;i<=n;i++) {
    l[i] = gcd(l[i-1], a[i-1]);
    r[i] = gcd(r[i-1], a[n - i]);
  }

  ll maxG = 1;
  for (int i=1;i<=n;i++) {
    ll g = gcd(l[i-1], r[n - i]);
    maxG = max(maxG, g);
  }
  cout << maxG << endl;
}

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


Measured memory_bytes: 2560
def solve(n, x, a):
	costs = []
	cost_min = 0
	for k in range(n):
		if k == 0:
			costs = a.copy()
		else:
			for i in range(n):
				costs[i] = min(costs[i], a[(i-k)%n])
		cost_k = sum(costs) + k*x
		if k == 0:
			cost_min = cost_k
		else:
			cost_min = min(cost_min, cost_k)
			if cost_min != cost_k:
				break
		if cost_min < (k+1) *x:
			break
 
	return cost_min
n, x = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
print(solve(n,x,a))

Measured memory_bytes: 3188
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int a=0;
    string s;
    cin>>s;
    if(s[2]==s[3]&&s[4]==s[5]){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    
}

Measured memory_bytes: 256
// Problem : A - Calc
// Contest : AtCoder - AtCoder Beginner Contest 172
// URL : https://atcoder.jp/contests/abc172/tasks/abc172_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define eb emplace_back
#define pb push_back
#define size(s) (int)s.size()
#define int long long
#define vi vector<int>
#define vs vector<string>
#define vv vector<vector<int>>
#define pii pair<int,int>
#define m_p(x,y) make_pair(x,y)
#define vp vector<pair<int,int>>
#define setbits(x) __builtin_popcountll(x)
#define f first
#define se second
#define inc(v,n,x) v.assign(n,x)
#define incd(v,n) v.resize(n)
#define iniz(n) memset(n,0,sizeof(n))
#define inin(n) memset(n,-1,sizeof(n))
#define inimi(n) memset(n,0xc0,sizeof(n))
#define inima(n) memset(n,0x3f,sizeof(n))
#define all(v) (v).begin(),(v).end()

using namespace std;

template<typename T1,typename T2>istream &operator>>(istream &is, vector<pair<T1,T2>> &v) { for (pair<T1,T2> &t : v) is >> t.f>>t.se; return is; }
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }

const int N=200001;
double pi=acos(-1.0);
int md=1e9+7;
const int INF=1e15;
int dx1[]={0,0,-1,1};
int dy1[]={1,-1,0,0};

template<class T>
T abst(T a)
{return a<0?-a:a;}

template<class T>
T max2(T a,T b){return a>b?a:b;}
template<class T>
T min2(T a,T b){return a<b?a:b;}

void solve()
{
int a;cin>>a;
cout<<a+a*a+a*a*a;
}

int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int t=1;
//cin>>t;
for(int i=1;i<=t;i++)
{
    solve();
}
return 0;
}


Measured memory_bytes: 3636
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    auto abk = readints;
    int a = abk[0], b = abk[1], k = abk[2];

    for (int i = 0; i < k; i++) {
        if (i % 2 == 0) {
            if (a % 2 == 1) a--;
            b += a / 2;
            a /= 2;
        }
        else {
            if (b % 2 == 1) b--;
            a += b / 2;
            b /= 2;
        }
    }
    writeln(a, " ", b);
}


Measured memory_bytes: 256
def ok(s: str) -> str:
    char_count = {}
    for c in s:
      if c not in char_count:
        char_count[c] = 0
      if c in char_count.keys():
        char_count[c] += 1
    
    return all([count == 2 for count in char_count.values()])

numbers_str = input()
result = ok([c for c in numbers_str])
if result:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3060
a, b, k = [int(i) for i in input().split()]

lim_1 = min(a + k, b)
lim_2 = max(b - k + 1, a)
ans = set(list(range(a, lim_1)) + list(range(lim_2, b + 1)))

for n in ans:
    print(n)


Measured memory_bytes: 62484
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int a, b, c; cin >> a >> b >> c;
	int ans = 0;
	set<tuple<int,int,int>> s;
	while(1){
		if(a % 2 || b % 2 || c % 2){
			cout << ans << endl;
			return 0;
		}
		if(s.count(make_tuple(a, b, c))){
			cout << -1 << endl;
			return 0;
		}
		s.emplace(a, b, c);
		int na = b / 2 + c / 2;
		int nb = a / 2 + c / 2;
		int nc = a / 2 + b / 2;
		a = na; b = nb; c = nc; ans++;
	}
	
	return 0;
}

Measured memory_bytes: 256
import java.io.*;

class Main{
 public static void main(String[] args)throws IOException{
   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  
   
   while(true){   
    String str = br.readLine(); 
    String[] strAry = str.split(" ");
    int a = Integer.parseInt(strAry[0]); 
    String op = strAry[1];
    int b = Integer.parseInt(strAry[2]);
 
     if(op.equals("+")){
       System.out.println(a+b);
     }else if(op.equals("-")){
       System.out.println(a-b);
     }else if(op.equals("*")){
       System.out.println(a*b);
     }else if(op.equals("/")){
       System.out.println(a/b);
     }else if(op.equals("?")){ 
       break;
     }
   }   

  }
}

Measured memory_bytes: 24292
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }

int main(){
    ll N;
    cin >> N;
    vector<string> s(N);
    rep(i,N){
        cin >> s[i];
    }
    ll cnt=0;
    ll a[3]={};
    rep(i,N){
        ll M = s[i].size();
        rep(j,M-1){
            if(s[i].substr(j,2) == "AB"){
                cnt++;
            }
        }
        if(s[i][0] == 'B' && s[i][M-1] == 'A'){
            a[0]++;
        }else if(s[i][0] == 'B'){
            a[1]++;
        }else if(s[i][M-1] == 'A'){
            a[2]++;
        }
    }
    bool flag = false;
    if(a[0] > 0){
        cnt += a[0]-1;
        flag = true;
    }
    if(flag){
        if(a[1]>0 && a[2]>0){
            cnt += min(a[1], a[2]) + 1;
        }else if(!(a[1] == 0 && a[2] == 0)){
            cnt += 1;
        }
    }else{
        cnt += min(a[1], a[2]);
    }
    cout << cnt << endl;
}


Measured memory_bytes: 896
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int mod = 1e9 + 7;

int main(void)
{
    char x, y;
    cin >> x >> y;
    if(x>y)
        cout << '>' << endl;
        else if(x==y)
            cout << '=' << endl;
            else
                cout << '<' << endl;
            return 0;
} 

Measured memory_bytes: 256