akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    string S;
    cin >> S;
    if ((S[0]=='A' && S[1]=='A' && S[2]=='A') || (S[0]=='B' && S[1]=='B' && S[2]=='B')){
        cout << "No";
    }
    else{
        cout << "Yes";
    }
}

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

int main()
{
	string s;
	cin >> s;
	for(int i = 0;i < s.length();i++){
		if(i % 2 == 0){
			if(s[i] == 'R' || s[i] == 'U' || s[i] == 'D')
				continue;
			else{
				cout << "No" << endl;
				return 0;
			}
		}
		else{
			if(s[i] == 'L' || s[i] == 'U' || s[i] == 'D')
				continue;
			else{
				cout << "No" << endl;
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
const ll INF = 1LL<<60;


int main()
{
  ll n;cin>>n;
  cout<<(n-1)*n/2<<endl;
  return 0;
}


Measured memory_bytes: 256
import sys
import numpy as np
import math  # gcdもあるよ
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化

def main():
    n = int(sys.stdin.readline())
    print(n+n**2+n**3)
    return 0

if __name__ == "__main__":
    main()

Measured memory_bytes: 27172
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def build_grid(H, W, intv, _type, space=True, padding=False):
    # 入力がスペース区切りかどうか
    if space:
        _input = lambda: input().split()
    else:
        _input = lambda: input()
    _list = lambda: list(map(_type, _input()))
    # 余白の有無
    if padding:
        offset = 1
    else:
        offset = 0
    grid = list2d(H+offset*2, W+offset*2, intv)
    for i in range(offset, H+offset):
        row = _list()
        for j in range(offset, W+offset):
            grid[i][j] = row[j-offset]
    return grid

N, M = MAP()
grid1 = build_grid(N, N, '', str, space=0)
grid2 = build_grid(M, M, '', str, space=0)

def check(i, j):
    for k in range(i, i+M):
        for l in range(j, j+M):
            if grid1[k][l] != grid2[k-i][l-j]:
                return False
    return True

for i in range(N-M+1):
    for j in range(N-M+1):
        if check(i, j):
            Yes()
            exit()
No()


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

using namespace std;

#define int long long

const int MAX_N = 200009;
int a[MAX_N];
int sum[MAX_N];

signed main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int l, n;
    cin >> l >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    if (n == 1)
    {
        cout << max(a[0], l - a[0]);
        return 0;
    }
    sum[0] = a[0];
    for (int i = 1; i < n; i++)
        sum[i] = sum[i - 1] + a[i];
    int ans = 0;
    for (int i = 1; i < n - 1; i++)
    {
        /*int k = min(i, n - i - 1);
        int cur = sum[i + k] - sum[i];
        cur = l * k - cur;
        cur += sum[i];
        if (i - k > 0)
            cur -= sum[i - k - 1];
        cur -= a[i];
        cur *= 2;
        cur += max(a[i], l - a[i]);
        ans = max(ans, cur);*/
        int k = min(i, n - i - 1);
        int cur = (sum[i - 1] + (l * k - (sum[i + k] - sum[i]))) * 2 + max(a[i], l - a[i]);
        //cout << i << " " << i - 1 << " " << i - k - 1 << " " << i + k << endl;
        if (i - k > 0)
            cur -= sum[i - k - 1] * 2;
        ans = max(ans, cur);
        if (i < n - i - 1)
        {
            cur = (sum[i - 1] + (l * (i + 1) - (sum[i + (i + 1)] - sum[i]))) * 2 + a[i];
            ans = max(ans, cur);
        }
        else if (i > n - i - 1)
        {
            k = n - i - 1;
            cur = (sum[i - 1] + (l * k - (sum[n - 1] - sum[i]))) * 2 + (l - a[i]);
            if (i - k - 1 > 0)
                cur -= sum[i - k - 2] * 2;
            ans = max(ans, cur);
        }
        //cout << ans << endl;
    }
    int cur = a[n - 2] * 2 + l - a[n - 1];
    ans = max(ans, cur);
    ans = max(ans, a[n - 1]);
    cur = (l - a[1]) * 2 + a[0];
    ans = max(ans, cur);
    ans = max(ans, l - a[0]);
    cout << ans;
}


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

typedef long long ll;
const int MOD = 1e9 + 7;
typedef vector<ll> vll;
typedef vector<int> vi;

static int speedUp = []() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    return 0;
}();

int main() {
    int n;
    cin >> n;
    int t, a;
    cin >> t >> a;
    int hi;
    int cur;
    int ansT = INT_MAX;
    int index;
    for (int i = 1; i <= n; ++i) {
        cin >> hi;
        cur = abs((1000 * t - hi * 6) - a * 1000);
        if (cur < ansT) {
            ansT = cur;
            index = i;
        }
    }
    cout << index << endl;
    return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxn=2e5+10;
struct node{
    int x,h;
    bool operator < (const node a)const{
        return a.x>x;
    }
}mo[maxn];
main(){
    int n,d,a;
    scanf("%lld%lld%lld",&n,&d,&a);
    for(int i=1;i<=n;++i){
        scanf("%lld%lld",&mo[i].x,&mo[i].h);
        mo[i].h=(mo[i].h-1)/a+1;
    }
    sort(mo+1,mo+n+1);
    int len=2*d+1;
    int ans=0;
    map<int,int>pos;
    int efc=0;
    for(int i=1;i<=n;++i){
        while(!pos.empty()&&mo[i].x>=pos.begin()->first){
            efc-=pos.begin()->second;
            pos.erase(pos.begin());
        }
        int hp=mo[i].h-efc;
        if(hp<=0){
            continue;
        }
        else {
            ans+=hp;
            efc+=hp;
            pos[mo[i].x+len]+=hp;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 9600
#!/usr/bin/env python3

if __name__ == '__main__':
    w, h, x, y = list(map(int, input().split()))

    s = float(w) * float(h) / 2

    og = 0
    if x + x == w and y + y == h:
        og = 1

    print('{:.6f} {}'.format(s, og))

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

using namespace std;

long long lcm(long long a, long long b) {
    long long g = __gcd(a, b);
    return (a / g) * b;
}

void Main() {
    int N;
    cin >> N;
    vector<long long> T(N, 0LL);
    for (int i = 0; i < N; ++i) {
        cin >> T[i];
    }

    if (N == 1) {
        cout << T[0] << endl;
        return;
    }
    long long ans = lcm(T[0], T[1]);
    for (int i = 2; i < N; ++i) {
        ans = lcm(ans, T[i]);
    }
    cout << ans << endl;
}

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


Measured memory_bytes: 3608
#include <stdio.h>

int main(){
    int a[4],b[4],i,A,B;
    A=0;
    B=0;
    for (i=0;i<4;i++) {
        scanf("%d",&a[i]);
        A+=a[i];
    }
    for (i=0;i<4;i++) {
        scanf("%d",&b[i]);
        B+=b[i];
    }
    if (A>=B) {printf("%d\n",A);}
    else {printf("%d\n",B);}
    return 0;
}

Measured memory_bytes: 1020
using System;
using System.Collections.Generic;
using System.Linq;

namespace D_ABC131
{
    class MainClass
    {

        static int[] s;

        public static void Main(string[] args)
        {
            s = Array.ConvertAll(Console.ReadLine().Split().ToArray(), int.Parse);
            var abl = new List<long[]>();
            for(int i =0;i<s[0];i++){
                long[] ab =  Array.ConvertAll(Console.ReadLine().Split().ToArray(), long.Parse);
                abl.Add(ab);
            }

            var sabl = abl.OrderBy(x=>x[1]).ThenBy(x=>x[0]).ToList();
            long tmp = 0;
            for(int i=0;i<s[0];i++){
                //Console.WriteLine("a:{0} b:{1}",sabl[i][0],sabl[i][1]);
                tmp += sabl[i][0];
                if(tmp>sabl[i][1]){
                    Console.WriteLine("No");
                    return;
                }
            }
            Console.WriteLine("Yes");

            
        }
    }
}


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

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

bool nextvect(vector<int>& A, int N, int M) {
	if (A[N - 1] < M) A[N - 1]++;
	else {
		int i = N - 2;
		while (i >= 0 && A[i] == M) i--;
		if (i == -1) return false;
		A[i]++;
		for (int j = i + 1; j < N; j++)A[j] = A[i];
	}
	return true;
}

int main() {
	int N, M, Q;
	cin >> N >> M >> Q;

	vector<vector<int>> Queries(Q, vector<int>(4));
	for (int i = 0; i < Q; i++) cin >> Queries[i][0] >> Queries[i][1] >> Queries[i][2] >> Queries[i][3];
	vector<int>A(N, 1);
	int MAX = 0;
	while (1) {
		int sum = 0;
		for (int i = 0; i < Q; i++) if (A[Queries[i][1] - 1] - A[Queries[i][0] - 1] == Queries[i][2]) sum += Queries[i][3];
		MAX = max(MAX, sum);
		if (!nextvect(A, N, M)) break;
	}
	cout << MAX << endl;


}

Measured memory_bytes: 3632
#典型ナップザック
#10**9はMLE(pypyではRE)

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    N, W = map(int, input().split())
    w = [0]*N
    v = [0]*N
    for i in range(N):
        w[i], v[i] = map(int, input().split())
    V = 10**5+1
    inf = float('inf')
    dp = [inf]*V
    dp[0] = 0
    for i in range(N):
        for j in range(V, v[i]-1, -1):
            if dp[j-v[i]]+w[i]<=W:
                dp[j] = min(dp[j], dp[j-v[i]]+w[i])
    for i in range(V):
        if dp[-(i+1)]<=W:
            print(V-(i+1))
            exit()
            
if __name__ == '__main__':
    main()

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

int main(void) {
    int x;
    for (int i=1;;i++) {
        cin >> x;
        if(x == 0) break;
        cout << "Case " << i << ": " << x << endl;
    }
    return 0;
}

Measured memory_bytes: 2988
import sys
import re
import math
import collections
import decimal
import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    a, b, c = ns()

    flg = a**2+b**2+c**2-2*a*b-2*a*c-2*b*c>0 and -a - b + c > 0

    print("Yes" if flg else "No")


if __name__ == '__main__':
    main()


Measured memory_bytes: 5076
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define drep(i,a,b) for(int i=(a); i>=(b);i--) 

const int maxn = 2e5 + 5;
const int MOD = 1e9 + 7;

int n;
int a[maxn];
vector<int>ans;

int main()
{
   ios::sync_with_stdio(false); cin.tie(0);cout.tie(0);
   cin >> n;
   rep(i,1,n) cin >> a[i];
   drep(i,n,1){
      if(a[i]){
          for(int j = 1; j * j <= i; j++){
            if(i % j == 0){
                a[j] = (a[j] + 1) % 2;
                if(j * j != i)a[i / j] = (a[i / j] + 1) % 2;
            }
          }
          ans.push_back(i);
      }
   }
   int t = ans.size();
   cout << t << endl;
   if(t){ rep(i,0,ans.size()- 1) cout << ans[i] << " "; }
   return 0;
}

Measured memory_bytes: 2424
#include <iostream>
using namespace std;
int main(void){
    int n;
    cin >> n;
    int d1[n],d2[n],cnt=0;
    for(int i=0;i<n;i++){
        cin >> d1[i] >> d2[i];
        if(cnt==3){
            break;
        }else if(d1[i]==d2[i]){
            cnt++;
        }else{
            cnt = 0;
        }
    }
    if(cnt==3){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

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

// 最小公倍数を求める
int euqlid (int a, int b){
  int temp;
  temp = a % b;
  if(temp == 0)return b;
  return euqlid(b,temp);
}

int main(){
  string s;
  cin >> s;
  rep(i,s.length()){
    cout << "x";
  }
  cout << endl;
}

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

min_n = s[1:].count('E')
tmp_n = min_n
for i in range(1, n):
    tmp_n += s[i-1].count('W') - s[i].count('E')
    min_n = min(tmp_n, min_n)

print(min_n)

Measured memory_bytes: 3700
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = scanInt()
	}
	return a
}

func debug(a ...interface{}) {
	if os.Getenv("ONLINE_JUDGE") == "false" {
		fmt.Fprintln(os.Stderr, a...)
	}
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	a := scanInts(n)
	b := scanInts(n)

	am := make([]int, n+1)
	bm := make([]int, n+1)
	for i := 0; i < n; i++ {
		am[a[i]]++
		bm[b[i]]++
	}

	for i := 1; i <= n; i++ {
		if am[i]+bm[i] > n {
			fmt.Fprintln(wr, "No")
			return
		}
	}

	x := 0
	c := 0
	for i := 0; i < n; i++ {
		c += am[i+1] - bm[i]
		x = max(x, c)
	}

	fmt.Fprintln(wr, "Yes")
	for i := 0; i < n; i++ {
		fmt.Fprint(wr, b[(i-x+n)%n], " ")
	}
	fmt.Fprintln(wr)

}


Measured memory_bytes: 10872
import Data.List
main=do
    line<-getLine
    let ipn=[read x::Int|x<-words line]
    let iipn=(sort $ init ipn)
    let vr=iipn!!2
    let vg=iipn!!1
    let vb=iipn!!0
    let n=ipn!!3
-- can do some optimisim because of (vr,vg,vb) symmetry of functional displacement
    print $ length [nr|nr<-[0..(div n vr)],ng<-[0..(div n vg)],n-nr*vr-ng*vg>=0,mod (n-nr*vr-ng*vg) vb ==0]
    



Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll X;
  cin >> X;
  ll cnt = 0;
  ll now = 100;
  while (now < X) {
    now += (now / 100);
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 3620
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(I, a, b) for (int i = (a); i < (b); ++i)
using namespace std;
using ll = long long;

int main() {
  int n,m; 
  cin >> n >> m;
  
  if(n == m) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define Rep(i,a,b) for(register int i=(a);i<=int(b);++i)
#define dis(i,a,b) for(register int i=(a);i>=int(b);--i)
#define rep(i,a,b) for(register int i=(a);i<int(b);++i)
#define mem(x,v) memset(x,v,sizeof(x))
#define gc getchar
#define pc putchar
inline ll rd(){
    ll x=0,f=1;char c=gc();
    for(;!isdigit(c);c=gc())if(c=='-')f=-1;
    for(;isdigit(c);c=gc())x=(x<<1)+(x<<3)+(c^48);
    return x*f;
}
void write(ll x){if(x<0)x=-x,pc('-');if(x>=10)write(x/10);putchar(x%10+'0');}
void writeln(ll x){write(x);puts("");}
const int maxn = 4e5+233;
int L[22][maxn],R[22][maxn];
int f[maxn],g[maxn];
int ans[maxn]; 
int n,V,tmp,x[maxn],v[25];
int main(){
	n = rd(),V = tmp = rd();
	Rep(i,1,n) x[i] = rd();
	tmp /= 2;
	while(tmp){
		v[++v[0]] = tmp;
		tmp /= 2;
	}
	v[++v[0]] = 0;
	Rep(d,1,v[0]){
		for(int i=1,j=-1;i<=n;i=j+1){
			for(j=i+1;j<=n && x[j]-x[j-1]<=v[d];j++);j--;
//			printf("[%d %d]\n",i,j);
			Rep(k,i,j){
				L[d][k] = i;
				R[d][k] = j;
			}
		}R[d][n+1] = n;L[d][0] = 1;
	}
	
	for(int i=1,j=-1;i<=n;i=j+1){
		for(j=i+1;j<=n && x[j]-x[j-1]<=V;j++);j--;
//		printf("[%d %d][%d %d]\n",i,j,x[j]-x[i],x[j+1]-x[i]);
		Rep(k,i,j){
			L[0][k] = i;
			R[0][k] = j;
//			printf("L[%d][%d] = %d\n",V,k,L[0][k]);
		}
	}R[0][n+1] = n;L[0][0] = 1;
	rep(i,0,1<<v[0]) f[i] = 0;
	rep(i,0,1<<v[0]){
		for(int j=1;j<=v[0];++j){
			if(i>>(j-1)&1^1){
				f[i|(1<<(j-1))] = max(f[i|(1<<(j-1))],R[j][f[i]+1]);
			}//如果不包括，那么可以选择 
		}
	}
	rep(i,0,1<<v[0]) g[i] = n+1;
	rep(i,0,1<<v[0]){
		for(int j=1;j<=v[0];++j){
			if(i>>(j-1)&1^1){
				g[i|(1<<(j-1))] = min(g[i|(1<<(j-1))],L[j][g[i]-1]);
			}
		}
	}
//	rep(i,0,1<<v[0]){
//		printf("[%d%d%d%d%d] : %d,%d\n",i/16%2,i/8%2,i/4%2,i/2%2,i%2,f[i],g[i]);
//	}
	rep(i,0,1<<v[0]){
		int j=((1<<v[0])-1)^i;
//		printf("[%d %d]\n",i,j);
		int pos = f[i]+1;
	//	printf("[%d %d]\n",f[i],g[j]);
		if(f[i]+1 > g[j]){
			Rep(i,1,n) puts("Possible");
			return 0;
		} else
		if(L[0][pos] <= f[i]+1 && g[j]-1 <= R[0][pos]){
			ans[L[0][pos]]++;
			ans[R[0][pos]+1]--;
		}//区间可行 
	}
	Rep(i,1,n) ans[i] += ans[i-1];
	Rep(i,1,n){
//		printf("{%d %d}\n",L[0][i],R[0][i]);
		if(ans[i]) puts("Possible");
			  else puts("Impossible");
	}
	return 0;
}
/*
5 3
-4 0 1 2 6

11 12
*/


Measured memory_bytes: 69248
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEBUG
	#define debug printf
#else
	#define debug(...)
#endif
const int maxn = 1e5 + 5;
int a[maxn];
map<int,int> mp;
int main(int argc, char const *argv[])
{
	int n,k;
	cin>>n>>k;
	for(int i = 0;i < n; ++i)
	{
		scanf("%d",&a[i]);
	}
	sort(a,a + n);
	int ans = INT_MAX;
	for(int i = 0;i + k <= n; ++i)
	{
		ans = min(ans,a[i + k - 1] - a[i]);
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 640
#include <algorithm>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;

int main()
{
    LLONG N;
    cin >> N;
    LLONG power = 1;
    for (LLONG i = 1; i <= N; ++i)
    {
        power *= i;
        power %= 1000000007;
    }
    cout << power << endl;

    return 0;
}

Measured memory_bytes: 256
#define Z(l,L)for(;l--;)scanf("%d",&x),L[x]=1;
double P[102][101];L[101],B[101],N,T,l,b,t,n,k;main(x){for(;scanf("%d%d%d%d",&N,&T,&l,&b),N;printf("%f\n",P[T][N])){
for(n=0;n<=N;n++)for(L[n]=B[n]=t=0;t<=T;t++)P[t][n]=0;
Z(l,L)Z(b,B)
for(P[t=0][0]=1;t<T;P[t+1][N]+=P[t][N],t++)for(n=0;n<N;n++)for(k=0;++k<7;P[t+1+L[x]][x]+=P[t][n]/6)x=n+k,x=B[x=x>N?2*N-x:x]?0:x;
}exit(0);}

Measured memory_bytes: 716
#include<iostream>

using namespace std;

int edge[4];

int main(){
	long long k,a,b;
	cin>>k>>a>>b;

	if(k < a){
		cout<<(k+1)<<endl;
		return 0;
	}

	if(a+2 >= b){
		cout<<(k+1)<<endl;
		return 0;
	}

	long long ans = 0;

	ans += a;
	k-=a-1;

	ans += k%2LL;

	long long cnt = k/2LL;

	ans += cnt*(b-a);

	cout<<ans<<endl;

	return 0;
}

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

using namespace std;

unordered_map<int, int> nsticks;

bool isGreater(string& s1, string& s2) {
    if(s1.size() > s2.size()) {
        return true;
    } else if(s1.size() < s2.size()) {
        return false;
    }
    
    for(int i = 0; i < s1.size(); ++i) {
        if(s1[i] > s2[i]) {
            return true;
        } else if(s1[i] < s2[i]) {
            return false;
        }
    }
    return false;
}

string getMaxNumber(int n, vector<int>& va) {
    vector<string> vs(n + 1, "");
    sort(va.begin(), va.end());
    
    for(int i = 2; i <= n; ++i) {
        for(int j = va.size() - 1; j >= 0; --j) {
            int num = va[j];
            int stick = nsticks[num];
            if(i - stick >= 0) {
                if(vs[i - stick].size() == 0 && i != stick) {
                    continue;
                }
                string copy = vs[i - stick];
                copy.push_back(char('0' + num));
                if(isGreater(copy, vs[i])) {
                    vs[i] = copy;
                }
            }
        }
    }
    
    return vs[n];
}

int main() {
    nsticks[1] = 2;
    nsticks[2] = 5;
    nsticks[3] = 5;
    nsticks[4] = 4;
    nsticks[5] = 5;
    nsticks[6] = 6;
    nsticks[7] = 3;
    nsticks[8] = 7;
    nsticks[9] = 6;
    
    int n = 0, m = 0;
    cin >> n >> m;
    vector<int> va(m, 0);
    for(int i = 0; i < m; ++i) {
        cin >> va[i];
    }
    
    string maxNum = getMaxNumber(n, va);
    cout << maxNum.c_str() << endl;
    
    return 0;
}

Measured memory_bytes: 35968
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <utility>
#include <vector>

using namespace std;

int main() {
  char s[8];
  scanf("%s", s);
  if (s[2] == s[3] && s[4] == s[5]) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
}

Measured memory_bytes: 128
import sys
input = sys.stdin.readline
s = list(input())[: -1]
t = list(input())[: -1]
dp = [[0] * (len(t) + 1) for _ in range(len(s) + 1)]
mx = 0
res = []
for i in range(len(s)):
  for j in range(len(t)):
    if s[i] == t[j]:
      dp[i + 1][j + 1] = max(dp[i][j] + 1, dp[i + 1][j + 1])
      mx = max(mx, dp[i + 1][j + 1])
    dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
    dp[i][j + 1] = max(dp[i][j + 1], dp[i][j])
for i in range(len(s), 0, -1):
  for j in range(len(t), 0, -1):
    if dp[i - 1][j - 1] + 1 == dp[i][j]:
      if dp[i][j] == mx and (s[i - 1] == t[j - 1]):
        res += s[i - 1]
        mx -= 1
        break


print("".join(res[: : -1]))

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

using namespace std;

int main() {
  int n;
  cin >> n;
  vector <int> niz(n);
  for (int i = 0; i < n; i++)
    cin >> niz[i];
  int s = 1, tlen = 0, mlen = 0;
  while (s < n){
    if (niz[s] > niz[s-1]){
      mlen = max(mlen,tlen);
      tlen = 0;
    } else{
      tlen++;
      mlen = max(mlen,tlen);
    }
    s++;
  }
  cout << mlen;
}

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

int main(void)
{
	double x1, y1, x2, y2, d;
	scanf("%lf %lf %lf %lf",&x1, &y1, &x2, &y2);
	d = sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) );
	printf("%f\n",d);
	return 0;
}

Measured memory_bytes: 652
N,T = map(int,input().split())
cnt = 0
minc = 10**9
for i in range(N):
    c,t = map(int,input().split())
    if t<=T:
        minc = min(minc,c)
    else:
        cnt+=1
if cnt == N:
    print("TLE")
else:
    print(minc)

Measured memory_bytes: 3060
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <iostream>
#include <stack>

using namespace std;

int main(){
    long long w, h, x, y;
    cin >> w >> h >> x >> y;
    double ans_area = (double)(w)/ 2.0 * (double)(h);
    bool multi = (w == x * 2) && (h == y * 2);
    cout << ans_area << ' ' << (int)(multi) << endl;
    return 0;
}


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

using namespace std;

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

    int i = 0, j = 0;
    float ret = 0;
    int maxX = 0;
    int maxY = 0;
    bool full = false;

    float x = 0;
    float y = 0;

    for (int i = 0; i < 30; i++) {
        for (int j = 0; j < 30; j++) {

            // cout << "i: " << i << endl;
            // cout << "j: " << j << endl;

            x = 100 * a * i + 200 * b * j;
            // y = c * i + d * j;

            if (x > f) break;

            for (int k = 0; ; k++) {
                if (x + c * k > f) break;

                for (int l = 0; ; l++) {
                    y  = c * k + d * l;
                    if (x + y > f) break;
                    // x, yのどちらも0だった場合、濃度が計算できない
                    if (x != 0 && (100 * y) / x <= e) {

                        // cout << "x: " << x << endl;
                        // cout << "y: " << y << endl;

                        if (ret <= (100 * y) / (x + y)) {
                            ret = (100 * y) / (x + y);
                            // cout << "ret: " << ret << endl;
                            maxX = x;
                            maxY = y;
                        }
                    }                   
                }
            }
        }
    }

    cout << (maxX + maxY) << " " << maxY << endl;

    return 0;
}

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

int main()
{
    int i,cnt;
    string str,st;
    cnt=0;
    cin>>str>>st;
    for(i=0;i<str.size();i++)
        if(str[i]!=st[i])cnt++;
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 3840
s=gets.chomp
k=gets.to_i
 
ord_a = 'a'.ord
ret = []
s.each_char do |c|
    n = (26 - (c.ord - ord_a))%26
    if n <= k
        ret << 'a'
        k -= n
    else
        ret << c
    end
end
 
ret[-1] = (ret[-1].ord + (k%26)).chr
puts ret.join

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

int a[3];

int main() {
	for (int i=0;i<3;i++) cin>>a[i];
	sort(a,a+3);
	for (int i=0;i<3;i++) if (!i) cout<<a[i];
	else cout<<' '<<a[i];
	cout<<'\n';
}


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

typedef long long ll;


struct Node{
    ll key;
    Node *parent,*left,*right;
};


struct Tree{
    Node *nil,*root;

    void init(){
        root=nil;
    }

    void add(ll key){
        Node *newnode;
        Node *p;
        newnode = (Node*)malloc(sizeof(Node));

        newnode->key = key;
        newnode->parent = newnode->right = newnode->left = nil;

        Node *pa = find_parent(key);
        if(pa == nil){
            root = newnode;
        }else if(key < pa->key){
            pa->left = newnode;
        }else{
            pa->right = newnode;
        }
    }

    Node *find_parent(int key){
        Node *pa=nil;
        Node *loc=root;
        while(loc != nil){
            pa = loc;
            if(key < loc->key){
                loc = loc->left;
            }else{
                loc = loc->right;
            }
        }
        return pa;
    }

    Node *find_x(int x){
        Node *p=root;
        bool flg = false;
        while(p != nil){
            if(x == p->key){
                flg = true;
                break;
            }else if(x < p->key){
                p = p->left;
            }else{
                p = p->right;
            }
        }
        return p;
    }

    void del(int k){
        return;
    }


    void print_in(Node *r){
        if(r==nil)return;
        print_in(r->left);
        cout << " " << r->key;
        print_in(r->right);
    }

    void print_pre(Node *r){
        if(r==nil)return;
        cout << " " << r->key;
        print_pre(r->left);
        print_pre(r->right);
    }
    void print(){
        print_in(root);
        cout << endl;
        print_pre(root);
        cout << endl;
    }
};


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

    Tree tree;
    tree.init();
    int n;
    cin >> n;
    string s;
    int k;
    for(int i=0;i<n;i++){
        cin >> s;
        if(s=="insert"){
            cin >> k;
            tree.add(k);
        }else if(s=="find"){
            cin >> k;
            Node *p = tree.find_x(k);
            if(p != tree.nil)cout << "yes\n";
            else cout << "no\n";
        }else if(s=="delete"){
            cin >> k;
            tree.del(k);
        }else{
            tree.print();
        }
    }
    return 0;
}



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

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

//#define int long long
//signed main(){
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int h,w;
    cin >> h >> w;
    bool smc[(h+2)*(w+2)]={};
    vector<int> fr;
    string tmp;
    for(int i = 0; i < h; i++) {
        cin >> tmp;
        for(int j = 0; j < w; j++) {
            if(tmp[j]=='.'){
                smc[(i+1)*(w+2)+(j+1)]=true;
                fr.emplace_back((i+1)*(w+2)+(j+1));
            }
        }
    }
//    for(int i = 0; i < (h+2)*(w+2); i++) {
//        cout << smc[i];
//        if(i%(w+2)==w+1) cout << "\n";
//    }
//    cout << fr.size() << "\n";

    int ans=0;
    for(int i = 0; i < fr.size()-1; i++) {
        for(int j = i+1; j < fr.size(); j++) {
            queue<int> que;
            vector<int> dist((h+2)*(w+2),-1);
            dist[fr[i]]=0;
            que.push(fr[i]);
            while(!que.empty()){
                int v=que.front();
                que.pop();
                if(smc[v+1] && dist[v+1]==-1){
                    dist[v+1]=dist[v]+1;
                    que.push(v+1);
                }
                if(smc[v-1] && dist[v-1]==-1){
                    dist[v-1]=dist[v]+1;
                    que.push(v-1);
                }
                if(smc[v+w+2] && dist[v+w+2]==-1){
                    dist[v+w+2]=dist[v]+1;
                    que.push(v+w+2);
                }
                if(smc[v-w-2] && dist[v-w-2]==-1){
                    dist[v-w-2]=dist[v]+1;
                    que.push(v-w-2);
                }
            }
//            cout << i << " " << j << " " << dist[j] << "\n";
            ans=max(ans,dist[fr[j]]);
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
import bisect
n = int(input())
dat = list(map(int, input().split()))
dat.sort(reverse=True)
dat = list(map(lambda x: -x, dat))
#print(dat)
res = 0
for a in range(n):
    #print("a={0}, [{1}]".format(dat[a],a))
    for b in range(a+1, n):
        #print("b={0}, [{1}]".format(dat[b],b))
        cind = bisect.bisect_left(dat, dat[a] - dat[b], b)
        cannum = cind - (b+1)
        cannum = 0 if cannum < 0 else cannum
        #print("cind", cind)
        #print("cannum", cannum)
        res += cannum
print(res)

Measured memory_bytes: 45096
while(1):
    s,d=[int(x) for x in input().split()]
    A=[999 for x in range(d)]
    if s==0:    break
    for j in range(s):
        l=[int(x) for x in input().split()]
        for i in range(d):
            if l[i]!=0:
                A[i]=min(A[i], l[i]) 
    B=[[999 for x in range(d)] for y in range(d)]
    for j in range(d-1):
        l=[int(x) for x in input().split()]
        for i in range(d-1-j):
            if l[i]!=0:
                B[j][i+j+1]=l[i]
                B[i+j+1][j]=l[i]
    notevaled=[1 for x in range(d)]
    ans=0
    for i in range(d):
        mini=A.index(min(A))
        ans+=A[mini]
        notevaled[mini]=0
        A[mini]=999
        for x in range(d):
            if notevaled[x]:
                A[x]=min( A[x], B[mini][x] )
    print(ans)
        


Measured memory_bytes: 5608
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>

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

int main()
{
    int A, B;
    cin >> A >> B;

    cout << (2 * A - 1 <= 16 && 2 * B <= 16 ? "Yay!" : ":(");

    return 0;
}

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

int main(){
    int c=0;
    string s;
    cin>>s;
    for(int i=0;i<s.length();i++){
        if(s[i] == '+')
            c++;
        else
            c--;
    }
    cout<<c<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int a[3];
    
    for(int i = 0;i < 3;i++){
        cin >> a[i];
    }
    sort(a, a + 3);

    for(int i = 0; i < 3; i++){
        if(i != 2){
            cout << a[i] << " " << flush;
        }else{
            cout << a[i] << endl;
        }
    }
}


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

    int main(){
        int n;
        int a;
        vector<int> l;
        cin >> n;
        double avg;
        
        while (n--){
            cin >> a;
            l.push_back(a);
        }

        sort(l.begin(),l.end());
        avg =  (double)l[0] ;
        
        for ( auto it = l.begin()+1; it != l.end(); it++ ){
            avg = ( avg + (*it) )/2;
        }

        cout << avg;
        
        return 0;
    }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct ceva
{
    int x,poz;
}v[100010];
int n,i;

int cmp(ceva a,ceva b)
{
    return a.x<b.x;
}

int main()
{
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>v[i].x , v[i].poz=i;
    sort(v+1,v+n+1,cmp);
    for(i=1;i<=n;i++)
        cout<<v[i].poz<<" ";
    return 0;
}


Measured memory_bytes: 1536
#include<math.h>
#include <iostream>
using namespace std;

int minc(int *h,int n)
  {
      int res[n];
      res[n-1]=0;
      res[n-2]=abs(h[n-1]-h[n-2]);
      for(int i=n-3;i>=0;i--)
       {
           res[i]=min(res[i+1]+abs(h[i+1]-h[i]),res[i+2]+abs(h[i+2]-h[i]));
       }
      return res[0]; 
  }

int main() {
	// your code goes here
	int n;
	cin>>n;
	int h[n];
	for(int i=0;i<n;i++)
	   cin>>h[i];
	cout<<minc(h,n);   
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k+k)
#define sag (k+k+1)
#define orta ((bas+son)/2)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;
 
typedef long long ll;
typedef pair < int , int > ii;

int n,d,ar[100][100],z,ans,c;

int main() 
{	
	cin >> n >> d;
	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < d; ++j)
		{
			cin >> ar[i][j];
		}
	}

	for (int i = 0; i < n; ++i)
	{
		for (int j = i+1; j < n; ++j)
		{
			z = 0;
			for (int k = 0; k < d; ++k)
			{
				z += abs(ar[i][k] - ar[j][k]) * abs(ar[i][k] - ar[j][k]);
			}

			c = sqrt(z);
			if (z == c*c) ans++;
		}
	}

	cout << ans;
	return 0;
}

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

import sys
sys.setrecursionlimit(10**7)
from pprint import pprint as pp
from pprint import pformat as pf
# @pysnooper.snoop()
#import pysnooper # debug

import math
#from sortedcontainers import SortedList, SortedDict, SortedSet # no in atcoder
import bisect
from fractions import Fraction
from collections import defaultdict

def is_same_sign(a, b):
    if a > 0 and b > 0:
        return True
    if a < 0 and b < 0:
        return True
    return False

def fraction_taple(a, b):
    g = math.gcd(a, b)
    if is_same_sign(a, b):
        s = 1
    else:
        s = -1
    a = abs(a) // g
    b = abs(b) // g
    return (s, a, b)

def mode(a, b):
    # retrun dict_key, arr_key
    if a == 0 and b == 0:
        return 0, 0
    if a == 0:
        return 'ab', 0
    if b == 0:
        return 'ab', 1
    x = fraction_taple(a, b)
    y = fraction_taple(-1 * b, a)
    if x > y:
        return x, 0
    else:
        return y, 1

MOD = 1000000007

if __name__ == '__main__':

    n = int(input())

    d = defaultdict(lambda: [0, 0])
    zero = 0
    for _ in range(n):
        a, b = list(map(int, input().split()))
        dkey, akey = mode(a, b)
        if dkey == 0:
            zero += 1
        else:
            d[dkey][akey] += 1
    #print('d') # debug
    #pp(d) # debug

    ans = 1
    for pair in d.values():
        tmp = pow(2, pair[0], MOD) - 1 + pow(2, pair[1], MOD) - 1 + 1
        ans *= tmp
    ans += zero - 1
    ans %= MOD
    #print('ans') # debug
    print(ans)

    #print('\33[32m' + 'end' + '\033[0m') # debug


Measured memory_bytes: 61804
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,m,cnt,la,a[200010][2],rt;
char s[200010];
void build(int x,int y){
	a[++cnt][0]=x;a[cnt][1]=y;
}
int main(){
	int i,j;
	scanf("%s",s+1);
	n=strlen(s+1);
	for(i=1;i<n;i++)if(s[i]!=s[n-i])return puts("-1"),0;
	if(s[1]=='0'||s[n]=='1')return puts("-1"),0;
	m=1;rt=1;la=1;
	for(i=2;i<=n;i++)if(s[i]=='1'){
		build(rt,++m);rt=m;
		for(j=1;j<i-la;j++)build(rt,++m);la=i;
	}
	build(rt,++m);
	rt=m;
	for(i=m+1;i<=n;i++)build(rt,i);
	for(i=1;i<n;i++)printf("%d %d\n",a[i][0],a[i][1]);
}

Measured memory_bytes: 2304
from math import atan, degrees

a, b, x = map(int, input().split())
S = x / a
if S - a * b / 2 > 0:
    h = 2 * b - 2 * x / (a * a)
    ans = atan(h / a)
else:
    h = 2 * x / (a * b)
    ans = atan(b / h)
print(degrees(ans))

Measured memory_bytes: 3060
def resolve():
    n = int(input())
    x = list(map(int, input().split()))
    xs = sorted(x, reverse=True)
    for i in range(n):
        if x[i] < xs[n // 2 - 1]:
            print(xs[n // 2 - 1])
        else:
            print(xs[n // 2])


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 93780
import java.util.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int n = sc.nextInt();
        int a[] = new int[110];
        int sum = 0;
        for (int i = 1;i <= n;i++) {
            a[i] = sc.nextInt();
            sum += a[i];
        }
        int m = sc.nextInt();
        for (int i = 1;i <= m;i++) {
            int p = sc.nextInt();
            int x = sc.nextInt();
            System.out.println(sum-a[p]+x);
        }
    }
}


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

int main() {
  string S;
  cin>>S;
  for(char c='a'; c<='z'; c++) {
    if(S.find(c)==string::npos) {
      cout<<c;
      return 0;
    }
  }  
  cout<<"None";
  return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>

using namespace std;

int main(){
    int n;
    scanf("%d",&n);
    vector<int> h(102,0);
    int i;
    priority_queue<int,vector<int>,greater<int>> q;
    for(i=1;i<=n;i++){
        scanf("%d",&h[i]);
        q.push(h[i]);
    }
    int a=0;
    int b;
    int x=0;
    int y=0;
    while(q.size()>0){
        x=0;
        b=q.top();
        q.pop();
        if(b!=a){
            for(i=1;i<=n;i++){
                if(h[i-1]<b){
                    if(h[i]>=b){
                        x=x+1;
                    }
                }
            }
            y=y+x*(b-a);
        }
        a=b;
    }
    printf("%d\n",y);
    return 0;
}


Measured memory_bytes: 256
k = int(input())
if k%2==0 or k%5==0:
    print(-1)
elif k==1:
    print(1)
elif k==7:
    print(1)
else:
    x = 7
    c=1
    while True:
        x = 10*x+7
        x%=k
        if x==0:
            print(c+1)
            break
        c+=1

Measured memory_bytes: 63028
#include<iostream>

using namespace std;

int main(){
    int a,b,c;
    int X;
    int count = 0;

    cin >>a>>b>>c>>X;

    for(int i= 0;i <= a; i++){
        for(int j= 0;j <= b; j++){
            for(int k= 0;k <= c; k++){
                int total  = 500*i + 100*j + 50*k;
                if (total == X) count++;

            }
        }
    }
    cout << count <<"\n";

}

Measured memory_bytes: 256
N = gets.to_i
names = {}
N.times do |n|
  name = gets.chomp
  if names[name].nil?
    names[name] = 1
  else
    names[name] += 1
  end
end
ary = names.sort_by{ |_, v| -v }
count = ary[0][1]
tops = []
ary.each do |elm|
  break if count != elm[1]
  tops << elm[0]
end
tops.sort.each do |name|
  puts name
end


Measured memory_bytes: 39692
/* Sudipta Banik Trisha */
/*Sylhet Engineering College */

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

int main()
{
	ll n;
	cin >> n;
	
	string res;
	
	while(n>0){
		n = n - 1;
		res += 97 + (n%26);
		n = n / 26;
		
	}
	
	reverse(res.begin(), res.end());
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 3584
s = input()
mr = s[::-1]
n = len(s)
f = 1

if s == mr:
  pass
else:
  f = 0
  
# ------------------------------

s2 = s[:((n-1)//2)]
mr = s2[::-1]

if s2 == mr:
  pass
else:
  f = 0


# ------------------------------
  
s3 = s[((n+3)//2)-1:]
mr = s3[::-1]

if s3 == mr:
  pass
else:
  f = 0
  
if f == 1:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<random>
#include<numeric>
#include<string>
#include<cstring>
typedef long long ll;
typedef long double ld;
using namespace std;
ll dx[] = { 0,0,1,-1 };
ll dy[] = { 1,-1,0,0 };

ll gcd(ll a, ll b) {
	if (a<b) { return gcd(b, a); }
	else if (a%b) { return gcd(b, a%b); }
	else { return b; }
}
int main() {
	string S;
	cin >> S;
	map<char, ll>mp;
	for (ll i = 0; i < S.size(); i++) {
		for (char c = 'a'; c <= 'z'; c++) {
          if(S[i]==c){
			mp[S[i]]++;
          }
		}
	}
	string t = "";
	for (char c = 'a'; c <= 'z'; c++) {
		if (mp[c] == 0)
			t += c;
	}
	if (t.size() > 0)
		cout << t[0] << endl;
	else
		cout << "None" << endl;
}


Measured memory_bytes: 512
#![allow(unused_imports)]
#![allow(dead_code)]
use proconio::input;
use proconio::fastout;
#[macro_use] extern crate text_io;
use proconio::marker::*;
use std::mem::*;
use std::collections::*;
use std::cmp::*;
#[fastout]
fn main() {
    const MOD:i64=1000000007;
    input!{
        n:usize,
        v:[i64;n],
    }
    let mut a:i64=0;
    let mut b:i64=0;
    for i in 0..n{
        a+=v[i];
        b+=v[i]*v[i]%MOD;
        a%=MOD;b%=MOD;
    }
    println!("{}",(a*a%MOD+(MOD-b))%MOD*500000004%MOD);
}

Measured memory_bytes: 5732
n = int(input())
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(l[n-1])

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

using namespace std;

#define sp(x) cout<<setprecision(x);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define all(a) (a).begin(), (a).end()
#define inf 10000000
#define linf INT64_MAX*0.99
#define print(s) cout<<(s)<<endl
#define lint long long
#define yes "Yes"
#define no "No"

typedef pair<int, int> P;

double prob(int n,int k, int i){
    lint a = i;
    double memo = 1;
    while(a<k){
        a*=2;
        memo/=2;
    }
    return memo;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k; cin>>n>>k;
    double ans = 0;
    FOR(i,1,n+1){
        ans += prob(n,k,i);
    }
    ans/=n;
    cout<<fixed;
    cout<<setprecision(10)<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
import itertools
n,m,q = map(int,input().split())
mx = 0
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
  ai,bi,ci,di = map(int,input().split())
  a[i] = ai-1
  b[i] = bi-1
  c[i] = ci
  d[i] = di
mx = 0
l = [i for i in range(m)]
for v in itertools.combinations_with_replacement(l, n):
  s = 0
  for i in range(q):
    if v[b[i]] - v[a[i]] == c[i]:
      s += d[i]
  if s > mx:
    mx = s
print(mx)

  


Measured memory_bytes: 73636
#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


int main(){
  int X; cin >> X;
  cout << 360/gcd(X, 360) << endl;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1000000000; 

int main(){
  ll h,n;
  cin >> h >> n;
  ll a[n];
  ll ans = 0;
  for(int i=0; i<n; i++){
    cin >> a[i];
    ans += a[i];
    if(ans >= h){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

int main(){

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

    ll r; cin >> r;

    cout << r*r;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>

using namespace std;

using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

void debug_out() { cout << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define Rep(i, n) for (long long i = 0; i< (long long)(n); i++)
#define RRep(i,n) for (long long i = ((long long)(n)-1); i>=0; i--)
#define all(v) (v).begin(),(v).end()

struct Edge{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    int weight;
    edge(int f,int t,int w) : from(f), to(t), weight(w){ }
};

using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

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;
}

template <class T>
T gcd(T a, T b){
    if( b==0 ) return a;
    return gcd(b, a%b);
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

constexpr int INF = 1e9+7;

vector<int> dx = {-1,0,1,0};
vector<int> dy = {0,-1,0,1};

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    double l;
    cin >> l;
    double a = l/3;
    double ans = a*a*a;
    cout << fixed << setprecision(15) << ans << endl;
}

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

#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)

using namespace std;
using ll = long long;
using pos = pair<ll, ll>;

vector<ll> a;
ll n;
ll it;

void solve();

int main() {

   solve();
   return 0;

}

void solve() {

    cin >>n;
    a.resize(n+1);
    REP(i,n+1){
        cin >>a[i+1];
    }
    it=1;
    REP(i,n+1){
        it=a[it];
        if(it==2){cout << i+1 << endl;exit(0);}
    }
    cout << -1 <<endl;

}

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


int main(){
    string o,e;
    cin>>o>>e;

    int le = e.length(); 
    int lo = o.length(); 

    rep(i,lo){
        cout<<o[i];
        if(i<le) cout<<e[i];
    }

    return 0;
}

Measured memory_bytes: 256