akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }
typedef long long ll;
const ll MOD=1e+9+7;
struct mint{
  ll x;
  mint(ll x=0):x(x%MOD){}
  mint& operator+=(const mint a){
    if((x+=a.x)>=MOD) x-=MOD;
    return *this;
  }
  mint& operator-=(const mint a){
    if((x += MOD-a.x)>=MOD) x-=MOD;
    return *this;
  }
  mint& operator*=(const mint a){
    (x*=a.x)%=MOD;
    return *this;
  }
  mint operator+(const mint a) const{
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const{
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const{
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const{
    if(!t) return 1;
    mint a = pow(t>>1);
    a*=a;
    if(t&1) a*=*this;
    return a;
  }
  
  //for prime mod
  mint inv() const{
    return pow(MOD-2);
  }
  mint& operator/=(const mint a){
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const{
    mint res(*this);
    return res/=a;
  }
};


int main()
{
  int n,k;cin >> n >> k;
  vector<int> a(n);
  rep(i,n) cin >> a[i];

  vector<vector<mint>> dp(n+1, vector<mint>(k+1));
  vector<vector<mint>> sum(2, vector<mint>(k+2));
  rep1(i,k+1) {
    sum[0][i].x = 1;
  }
  rep1(i,n) {
    rep(j,k+1) {
      dp[i][j] += sum[0][j+1] - sum[0][max(0, j - a[i-1])];
      sum[1][j+1] = sum[1][j] + dp[i][j];
    }
    sum[0] = sum[1];
    sum[1].assign(k+2, 0);
  }

  cout << dp[n][k].x << "\n";
  
  return 0;
}


Measured memory_bytes: 81776
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<map>

using namespace std;
#define endl '\n'
#define pb push_back
#define fst first
#define scd second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MOD (1e9 + 7)
#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 FOR(i,a,b) for(int i = (a);i <= (b);i++)
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl


typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vector<int>> vii;

template <class T = int> T in() { T x; cin >> x; return (x); }
template <class T = int> void out(T x) { cout << (x) << endl; }

int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

void solve() {

	string s, t;
	cin >> s >> t;

	bool ans = false;

	int n = s.size();

	REP(i, n) {
		if (s == t) {
			ans = true;
			break;
		}
		s.insert(s.begin(), s.back());
		s.pop_back();
	}

	Yes(ans);

	return;

}

int main() {

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

	solve();

	return 0;

}

Measured memory_bytes: 256
import java.util.*;

public class Main{
	Scanner sc = new Scanner(System.in);
	int wid = 1500000;

	private void doit(){
		while(true){
			int m = sc.nextInt();
			int n = sc.nextInt();
			if((n|m) == 0) break;
			int [] data = new int[n];
			for(int i = 0 ; i < n; i++){
				data[i] = sc.nextInt();
			}
			int [] acc = new int[n];
			acc[0] = data[0];
			for(int i = 1 ; i < n; i++){
				acc[i] = acc[i-1] + data[i];
			}
			int [][] dp = new int[n][m];
			int INF = 1 << 24;
			for(int i = 0 ; i < n; i++){
				Arrays.fill(dp[i], INF);
			}
			for(int i = 0 ; i < n; i++){
				if(acc[i] >= wid) break;
				dp[i][0] =  acc[i];
			}
			
			for(int i = 0 ; i < m-1; i++){
				for(int j = 0; j < n; j++){
					if(dp[j][i] == INF) continue;
					for(int k = j + 1 ; k < n; k++){
						int value = Math.max(dp[j][i], acc[k] - acc[j]);
						if(value >= wid) continue;
						dp[k][i + 1] = Math.min(dp[k][i + 1], value);
					}
				}
			}
			int ans = INF;
			for(int i = 0 ; i < m; i++){
				ans = Math.min(dp[n-1][i], ans);
			}
			System.out.println(ans);
		}
	}
	

	private void debug(Object... o) { System.out.println("debug = " + Arrays.deepToString(o)); }

	public static void main(String[] args) {
		new Main().doit();
	}
}

Measured memory_bytes: 22552
function Handstand2()
    N = parse(Int, readline())
    C = zeros(Int, 10, 10)
    for n in 1:N
        s = string(n)
        h, t = parse(Int, s[1]), parse(Int, s[end])
        C[h+1, t+1] += 1
    end
    ans = 0
    for i in 1:10
        for j in 1:10
            ans += C[i, j] * C[j, i]
        end
    end
    println(ans)
end
Handstand2()

Measured memory_bytes: 181804
#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}

template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}


signed main(void) {
	int n;
	cin >> n;
	map<int, int>a;
	rep(i, n) {
		int tmp;
		cin >> tmp;
		a[tmp]++;
	}
	int ret = 0;
	for (auto itr = a.begin(); itr != a.end(); itr++) {
		//int key = itr->first;
		int value = itr->second;
		if (value % 2 == 1)ret++;
	}
	print(ret);
}

Measured memory_bytes: 9872
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A = sc.nextInt()-1;
    int B = sc.nextInt()-1;
    int C = sc.nextInt()-1;
    int D = sc.nextInt()-1;
    String S = sc.next();
    boolean twoRock = false;
    for (int i = 1; i < N; i++) {
      if (A < i && i < Math.max(C, D)
          && S.charAt(i-1) == '#'
          && S.charAt(i) == '#') {
        twoRock = true;
      }
    }
    boolean overtake = false;
    for (int i = 1; i < N-1; i++) {
      if (B <= i && i <= D && i+1 <= C
          && S.charAt(i-1) == '.'
          && S.charAt(i) == '.'
          && S.charAt(i+1) == '.') {
        overtake = true;
      }
    }
    if (twoRock) {
      System.out.println("No");
    } else if (C < D) {
      System.out.println("Yes");
    } else {
      System.out.println(overtake ? "Yes" : "No");
    }
  }
}

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


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

	long long diff = M / 2 - N;
	long long out = 0;
	if(diff <= 0){
		out = M / 2;
	}else{
		out = N;
		M -= 2 * out;
		out += M / 4;
	}
	cout << out << endl;

	return 0;
}

Measured memory_bytes: 256
s = input()
t = input()

def cycshift(s) :
    s0 = s[0]
    ss = s[1::]
    return(ss + s0)

p = (s==t)

for i in range(len(s)):
    s = cycshift(s)
    p = (p or s==t)

if p:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
#include<stdio.h>

int main(){
	int a=0,b=0,n,i;
	char s[101];
	scanf("%d%s",&n,s);
	for(i=0;i<n;i++){
		if(s[i]=='(')b++;
		else if(b>0)b--;
	}
	for(i=n-1;i>=0;i--){
		if(s[i]==')')a++;
		else if(a>0)a--;
	}
	for(i=0;i<a;i++)printf("(");
	printf("%s",s);
	for(i=0;i<b;i++)printf(")");
	puts("");
	return 0;
}

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

int main(){
    int N,T;
    cin>>N>>T;
    int c[1000],t[1000];
    int MIN=10000;
    for(int i=0;i<N;i++){
        cin>>c[i]>>t[i];
        if(T>=t[i]){
            MIN=min(MIN,c[i]);
        }
    }
    if(MIN==10000) cout<<"TLE"<<endl;
    else cout<<MIN<<endl;
}

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

int main() {
  int a,b;
  cin>>a>>b;
  if(a+b<24)cout<<a+b<<endl;
  else cout<<a+b-24<<endl;
  return 0;
}

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

A_before=0
full_price=0
for i in range (N):
    full_price=full_price+abs(A[i]-A_before)
    A_before=A[i]
full_price=full_price+abs(A[N-1])

total_price=0
#No.1
negative=abs(A[0]-0)+ abs(A[1]-A[0])-abs(A[1]-(0))
total_price=full_price-negative
print(total_price)

for j in range (1,N-1):
    negative=abs(A[j]-A[j-1])+ abs(A[j+1]-A[j])-abs(A[j+1]-(A[j-1]))
    total_price=full_price-negative
    print(total_price)
    
#No.Last
negative=abs(0-A[N-1])+ abs(A[N-1]-A[N-2])-abs(0-A[N-2]) 
total_price=full_price-negative
print(total_price)

Measured memory_bytes: 14048
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
import string

alphabet = string.ascii_lowercase
char_count = dict()
for c in alphabet:
    char_count[c] = 0

for s in sys.stdin:
    s = s.strip().lower()
    for c in s:
        if c in alphabet:
            char_count[c] += 1

for c in alphabet:
    print(c, ':', char_count[c])



Measured memory_bytes: 6688
strr = input().strip()
n = len(strr)

last_pair = -1
count = [0, 0]
ans = [0]*n

cur ="R"

for i in range(n):
	if strr[i]==cur:
		count[i%2] += 1
	else:
		if strr[i]=="L":
			last_pair = i - 1
			ans[last_pair] += count[last_pair%2]
			ans[last_pair+1] += count[(last_pair+1)%2]
		else:
			ans[last_pair] += count[last_pair%2]
			ans[last_pair+1] += count[(last_pair+1)%2]
		count = [0, 0]
		count[i%2] += 1
		cur = strr[i]
ans[last_pair] += count[last_pair%2]
ans[last_pair+1] += count[(last_pair+1)%2]
print(*ans)

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

int main(){
    cin>>N>>M;
    int yes=0;
    int pen=0;
    vector<int> p(M);
    vector<string> s(M);
    for(int i=0;i<M;i++)cin>>p.at(i)>>s.at(i);
    vector<int> count(N);
    for(int i=0;i<N;i++)count.at(i)=0;
    vector<bool> check(N);
    for(int i=0;i<N;i++)check.at(i)=true; 
    for(int i=0;i<M;i++){
        if(s.at(i)=="AC"&&check.at(p.at(i)-1)){
            check.at(p.at(i)-1)=false;
            yes++;
        }
        else if(s.at(i)=="WA"&&check.at(p.at(i)-1)){
            count.at(p.at(i)-1)++;
        }
    } 
    for(int i=0;i<N;i++){
        if(!check.at(i)){
            pen+=count.at(i);
        }
    }
    cout<<yes<<" "<<pen;
}




Measured memory_bytes: 6528
#include<iostream>
using namespace std;
int main() {
	string S;
	string A;
	string B;
	cin >> S >> A >> B;
	
	char a = 'a' - 'A';
	printf("%c%c%c\n", S[0] - a, A[0] - a, B[0] - a);
	return 0;
}


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

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define debug(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<< '\n'

typedef long long int ll;
typedef pair<int, int> P;

const long long INF = 3e18 + 12;
const int inf = 1e9;

// ----------------------------------------------



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

int n, k;
cin >> n >> k;

map<ll, ll> mm;

rep(i,k){
  int a;
  cin >> a;
  debug(a);
  rep(j, a) {
    int b;
    cin >> b;

    mm[b]++;
    debug2(b,mm[b]);
  }
}

debug(mm[2]);

int sum = 0;
REP(i, n) {
  debug(mm[i]);
  if (mm[i] == 0) {
    sum++;
  };
}

cout << sum << endl;

return 0;
}



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

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

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define endl "\n"

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

  int N;
  cin>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++)cin>>A[i];
  sort(rng(A));
  ll ans=0;
  if(N%2==0){
    ans=-A[N/2-1]+A[N/2];
    for(int i=0;i<N/2-1;i++)ans-=2*A[i];
    for(int i=N/2+1;i<N;i++)ans+=2*A[i];
  }
  else{
    ll ans1=-A[N/2-1]-A[N/2];
    for(int i=0;i<N/2-1;i++)ans1-=2*A[i];
    for(int i=N/2+1;i<N;i++)ans1+=2*A[i];
    ll ans2=A[N/2]+A[N/2+1];
    for(int i=0;i<N/2;i++)ans2-=2*A[i];
    for(int i=N/2+2;i<N;i++)ans2+=2*A[i];
    ans=max(ans1,ans2);
  }
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int ans;
const int N=21234;
map<int,int>mp;
void dfs(int x){
    if(x>=N)return;
    if(mp[x])return;
    mp[x]=1;
    dfs(x+4);
    dfs(x+9);
}
int main(){
    int n,k;
    dfs(0);
    int cnt=0;
    cin>>k>>n;
    n/=1000;
    //cout<<mp[45]<<endl;
    if(n<k)cout<<-1<<' '<<-1<<' '<<-1<<endl;
    else{
        ans=n-k;
       // cout<<ans<<' '<<mp[ans]<<endl;
        if(mp[ans]){
            int rem=ans%4;
            int nn=rem;
            int ff=(ans/4)-(rem*2);
            while(ff>=9 && k<nn+ff){
                ff-=9;
                nn+=4;
            }
            int oo=k-(nn+ff);
            if(ff+nn>k)cout<<-1<<' '<<-1<<' '<<-1<<endl;
            else cout<<nn<<' '<<ff<<' '<<oo<<endl;

        }else cout<<-1<<' '<<-1<<' '<<-1<<endl;
    }
}


Measured memory_bytes: 1664
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long lint;
typedef vector<lint> vl;

#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) REP(i,0,b)
#define maxn 100010

int main(){
	string a,b,c;
	while(cin>>a>>b>>c){
		int na,nb,nc;
		if(a[a.length()-1]==b[0]&&b[b.length()-1]==c[0]){
			puts("YES");
		}else{
			puts("NO");
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cmath>
#include <map>
#include <set>
#include <ctype.h>
#include <numeric>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;
const int INF = 1e9;

int dx4[4] = { 0, -1, 1, 0 };
int dy4[4] = { -1, 0, 0, 1 };
int dx8[8] = { 0, -1, 1, 0, -1, 1, -1, 1 };
int dy8[8] = { -1, 0, 0, 1, -1, -1, 1, 1 };

bool isEvenStr(string ss) {
  bool res = false;
  int len = ss.size() / 2;
  if (ss.size() % 2 == 0) {
    if (ss.substr(0, len) == ss.substr(len, len)) {
      res = true;
    }
  }
  return res;
}

int main() {
  string s;
  cin >> s;
  while (s.size() > 1) {
    s.pop_back();
    if (isEvenStr(s)) {
      cout << s.size() << endl;
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
 
int main()
{
    int x, a, b, c; // put space after ","
    std::cin >> x;
    for (int i = 0; i < x;i++) { // put space after ";" and after ")"
        std::cin >> a >> b >> c;
        if ( a * a + b * b == c * c || b * b + c * c == a * a || c * c + a * a == b * b) {
            std::cout << "YES" << std::endl;
        } else {              // indent is like this;this "}" ends "if () {" structure.
                              // put space at both sides of "else"
            std::cout << "NO" << std::endl;
        } // indent is like this; this "}" ends "else {" structure
    } // indent is like this.
    return 0;
}

Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
ll N;
  cin>>N;
  ll ans=0;
  if(N>9) {
    ans+=9;
  }
  else {
cout<<N<<endl;
  return 0;
  }
  
  if(N>99) {
    if(N>999) {
ans+=900;
    }
    else {
ans+=N-99;
    }
  }
  
  if(N>9999) {
if(N>99999) {
ans+=90000;
}
    else {
ans+=N-9999;
    }
  }
  
  
  cout<<ans<<endl;
}
     
     
     


Measured memory_bytes: 3548
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <vector>

std::vector<int> break_number(int num)
{
	std::vector<int> elements;
	for (int i = 2; i <= num; )
	{
		if (num % i == 0)
		{
			elements.push_back(i);
			num /= i;
			continue;
		}

		++i;
	}

	return elements;
}

void multiplies(const std::vector<int>& elements, int value, int index, std::vector<int>& result)
{
	if (index == elements.size() - 1)
	{
		result.push_back(value);
		result.push_back(value * elements[index]);
		return;
	}

	multiplies(elements, value, index + 1, result);
	multiplies(elements, value * elements[index], index + 1, result);
}

std::vector<int> multiplies2(const std::vector<int>& elements)
{
	std::vector<int> result;
	result.resize(static_cast<size_t>(std::round(std::pow(2, elements.size()))));

	for (int i = 0; i < result.size(); ++i)
	{
		int value = 1;
		for (int j = 0; j < elements.size(); ++j)
		{
			if ((1 << j & i) != 0)
			{
				value *= elements[j];
			}
		}

		result[i] = value;
	}

	return result;
}

int main()
{
	int N, X;
	std::cin >> N >> X;

	std::vector<int> cities;
	cities.resize(N);

	for (int i = 0; i < N; ++i)
	{
		std::cin >> cities[i];
	}

	std::vector<int> diffs;
	diffs.resize(N);

	for (int i = 0; i < N; ++i)
	{
		diffs[i] = std::abs(cities[i] - X);
	}

	auto min = *std::min_element(diffs.cbegin(), diffs.cend());

	//数の候補を作る
	auto elements = break_number(min);
	//std::vector<int> candidates;
	//multiplies(elements, 1, 0, candidates);
	auto candidates = multiplies2(elements);

	std::sort(candidates.begin(), candidates.end());
	auto it = std::unique(candidates.begin(), candidates.end());
	candidates.erase(it, candidates.end());
	std::reverse(candidates.begin(), candidates.end());

	for (auto c : candidates)
	{
		bool result = true;
		for (auto diff : diffs)
		{
			if (diff % c != 0)
			{
				result = false;
				break;
			}
		}

		if (result)
		{
			std::cout << c << std::endl;
			return 0;
		}
	}

	std::cout << 1 << std::endl;
	return 0;
}



Measured memory_bytes: 1024
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A = [list(map(int,input().split())) for _ in range(N)]
ans = 0

for i in range(N):
    if sum(list([a*b for (a,b) in zip(A[i],B)]))+C > 0:
        ans += 1

print(ans)

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

int main(){
  int n,m;cin>>n>>m;
  int l,r;
  int a,b;
  cin>>l>>r;
  for(int i=1;i<m;++i){
    cin>>a>>b;
    r=min(r,b);
    l=max(l,a);
  }
  if(r<l) cout << 0 << endl;
  else cout << r-l+1 << endl;
  return 0;
}

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

struct h{
	double l;
	double m;
	double n;
	double k;
};

void getl(h *len, const double x, const double y){
	len->l = x;
	len->m = y;
	len->n = 1.0;
	len->k = -(x*x + y*y);
}

void calc(h *len, double *xp, double *yp, double *r){
	struct h th;

	for(int i=0;i<3; ++i){
		if(len[i].l != 0.0){
			if(i != 0){
				th = len[i];
				len[i] = len[0];
				len[0] = th;
			}
			len[0].m /= len[0].l;
			len[0].n /= len[0].l;
			len[0].k /= len[0].l;
			len[0].l = 1.0;
			break;
		}
	}
	for(int i=1;i<3;++i){
		if(len[i].l != 0.0){
			len[i].m -= len[0].m*len[i].l;
			len[i].n -= len[0].n*len[i].l;
			len[i].k -= len[0].k*len[i].l;
			len[i].l = 0.0;
		}
	}

	for(int i=1; i<3; ++i){
		if(len[i].m != 0.0){
			if(i != 1){
				th = len[i];
				len[i] = len[1];
				len[1] = th;
			}
			len[1].n /= len[1].m;
			len[1].k /= len[1].m;
			len[1].m = 1.0;
			break;
		}
	}
	if(len[0].m != 0.0){
		len[0].n -= len[1].n*len[0].m;
		len[0].k -= len[1].k*len[0].m;
		len[0].m = 0.0;
	}
	if(len[2].m != 0.0){
		len[2].n -= len[1].n*len[2].m;
		len[2].k -= len[1].k*len[2].m;
		len[2].m = 0.0;
	}

	if(len[2].n != 1.0){
		len[2].k /= len[2].n;
		len[2].n = 1.0;
	}
	if(len[0].n != 0.0){
		len[0].k -= len[2].k*len[0].n;
		len[0].n = 0.0;
	}
	if(len[1].n != 0.0){
		len[1].k -= len[2].k*len[1].n;
		len[1].n = 0.0;
	}
	*xp = -len[0].k / 2;
	*yp = -len[1].k / 2;
	*r  = (*xp)*(*xp) + (*yp)*(*yp) - len[2].k;
	*r = sqrt(*r);

	*xp = floor((*xp * 1000 + 0.5))/1000;
	*yp = floor((*yp * 1000 + 0.5))/1000;
	*r = floor((*r * 1000 + 0.5))/1000;
}

int main(void){
	int n=0;
	double x[6];
	double xp,yp,r;
	struct h len[3];

	scanf("%d", &n);
	for(int i=0;i<n;++i){
		scanf("%lf %lf %lf %lf %lf %lf", x, x+1, x+2, x+3, x+4, x+5);
		getl(len  , x[0], x[1]);
		getl(len+1, x[2], x[3]);
		getl(len+2, x[4], x[5]);
		calc(len, &xp, &yp, &r);
		printf("%.3f %.3f %.3f\n", xp, yp, r);
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <unordered_set>
#include <cstdint>
#include <vector>
#include <string>
#include <climits>
#include <set>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <numeric>
using namespace std;

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

	if (n >= 10)
		cout << r;
	else cout << r + 100 * (10 - n);
}

Measured memory_bytes: 3564
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

from decimal import getcontext, Decimal
getcontext().prec = 15

def count5(n):
    count = 0
    while n%5 == 0:
        count += 1
        n //= 5
    return count

def count2(n):
    count = 0
    while n%2 == 0:
        count += 1
        n //= 2
    return count

N = I()
A = []
for i in range(N):
    A.append(int(10**9*Decimal(input())))

counter = [[0]*30 for _ in range(50)]
for i in range(N):
    c2 = count2(A[i])
    c5 = count5(A[i])
    counter[c2][c5] += 1

same = 0
diff = 0
for i in range(50):
    for j in range(30):
        if counter[i][j]:
            for p in range(18-i,50):
                for q in range(18-j,30):
                    if i != p or j != q:
                        diff += counter[i][j]*counter[p][q]
                    else:
                        same += counter[i][j]*(counter[p][q]-1)//2

print(diff//2+same)

Measured memory_bytes: 290324
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
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; }

using ll = long long;
using P = pair<ll, ll>;

constexpr double PI = 3.14159265358979323846;
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

int dp[501][501];

class DClassified {
public:
    void dfs(int left, int right, int level) {
      if (left == right) return;
      int med = (left+right)/2;
      debug(left, med, right);
      for(int i=left; i<=med; i++) {
        for(int j=med+1; j<=right; j++) {
          dp[i][j] = level;
        }
      }
      dfs(left, med, level+1);
      dfs(med+1, right, level+1);
    }

    void solve(istream& cin, ostream& cout) {
      SPEED;
      int n; cin >> n;
      dfs(1, n, 1);
      for(int i=1; i<=n; i++) {
        for(int j=i+1; j<=n; j++) {
          cout << dp[i][j] << ' ';
        }
        cout << '\n';
      }
    }
};

signed main() {
  DClassified solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

Measured memory_bytes: 1536
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  double x, h;
  while (cin >> x >> h, x) {
    cout << prec(8) << x * x + x * hypot(h, x / 2) * 2 << endl;
  }
}

Measured memory_bytes: 3212
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;

int main(){
    int n;
    vector<string> w;
    cin >> n;
    w.resize(n);
    for(int i=0; i<n; i++){
        cin >> w[i];
    }

    string s;
    bool flag = true;
    for(int i=0; i<n-1; i++){
        s = w[i];
        for(int k=i+1; k<n; k++){
            if(s == w[k]){
                flag = false;
                break;
            }
        }
    }
    if(!flag){
        cout << "No" << endl;
        return 0;
    }

    char ch = w[0].back();
    for(int i=1; i<n; i++){
        if(ch != w[i][0]){
            flag = false;
            break;
        }
        ch = w[i].back();
    }

    if(!flag){
        cout << "No" << endl;
        return 0;
    }

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

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<utility>
#include<algorithm>
using namespace std;
#define MS(m,z) memset(m,z,sizeof(m))
typedef unsigned U;typedef long long ll;typedef pair<int,int > P;
void inp();
int main(){
#ifdef XS
	//freopen(".in","r",stdin);
#endif
	//int ttt;scanf("%d",&ttt);for(int i=1;i<=ttt;i++)
	inp();
	return 0;
}
const int N = 1e5 + 100;
P P1[N],P2[N];
#define A first
#define B second
bool getI( P &a, P &b, P &ans){
	int x, y;
	x = max(a.A, b.A);
	y = min(a.B, b.B);
	if( x < y ){
		ans.A = x,ans.B = y;
		return true;
	}
	return false;
}
void pP( P * arr, int n ){
	printf("vvv\n");
	for(int i =0;i<n;i++){
		printf("%d %d\n", arr[i].A, arr[i].B);
	}
	printf("^^^\n");
}
void inp(){
	int n,m; scanf("%d%d",&n,&m);
	int bkm = m;
	P * p1 = P1, *p2 = P2;
	for(int i =0 ;i<m;i++){
		scanf("%d%d",&p1[i].A, &p1[i].B);
	}
	int next_m = 0;
	P ans;
	int flag = true;
	while(flag){
		flag = false;
		sort(p1, p1+m);
		P cur = p1[0];
		next_m = 0;
		for(int i = 1;i<m;i++){
			if( getI(cur, p1[i], ans ) ){
				cur = ans;
				flag = true;
			}
			else {
				p2[next_m++] = cur;
				cur = p1[i];
			}
		}
		p2[next_m++] = cur;
		swap(next_m, m);
		swap(p1, p2);
		//pP(p1, m);
	}
	printf("%d",  m );
}
//d.cc by xsthunder at Wed Jul 25 23:18:28 2018


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

int main() {
    int N,K;
    int tmp;
    int waru;
    int test=0;
    cin >> N >> K;
    vector<int>s;

    tmp = N;
    waru = N;
while(waru>=K){
    tmp = waru%K;
    s.push_back(tmp);
    waru = waru/K;
    test++;
}
//cout << "test" << test<<endl;

    cout << s.size()+1;

    return 0;
    
  
}


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

using namespace std;

#define MAX_H 30
#define MAX_W 30
#define INF (1<<29)

struct State{
  int cost,x,y,dir;
  State(int cost,int x,int y,int dir) :
    cost(cost),x(x),y(y),dir(dir) {}

  bool operator < (const State &s)const{
    return cost > s.cost;
  }
};

int H,W,c[4];
int s[MAX_H][MAX_W];
int dx[] = {-1,0,1,0};
int dy[] = {0,-1,0,1};

bool inField(int x,int y){
  return (0 <= x && x < W && 0 <= y && y < H);
}

int dijkstra(){
  int d[MAX_H][MAX_W][4];
  fill(d[0][0],d[0][0]+MAX_H*MAX_W*4,INF);
  d[0][0][2] = 0;
  priority_queue<State> Q;
  Q.push(State(0,0,0,2));
  while(!Q.empty()){
    State cur = Q.top(); Q.pop();
    int x = cur.x,y = cur.y,dir = cur.dir;
    if(d[y][x][dir] < cur.cost) continue;
    if(x == W-1 && y == H-1) return d[y][x][dir];
    for(int i = 0 ; i < 4 ; i++){
      int ndir = (dir+i)%4;
      int nx = x + dx[ndir];
      int ny = y + dy[ndir];
      if(!inField(nx,ny)) continue;
      if(s[y][x] == i){
        if(d[y][x][dir] < d[ny][nx][ndir]){
          d[ny][nx][ndir] = d[y][x][dir];
          Q.push(State(d[ny][nx][ndir],nx,ny,ndir));
        }
      }else{
        if(d[y][x][dir] + c[i] < d[ny][nx][ndir]){
          d[ny][nx][ndir] = d[y][x][dir] + c[i];
          Q.push(State(d[ny][nx][ndir],nx,ny,ndir));
        }
      }
    }
  }
  return -1;
}

int main(){
  while(true){
    cin >> W >> H;
    if(W == 0 && H == 0) break;
    for(int i = 0 ; i < H ; i++){
      for(int j = 0 ; j < W ; j++){
        cin >> s[i][j];
      }
    }
    for(int i = 0 ; i < 4 ; i++){
      cin >> c[i];
    }
    cout << dijkstra() << endl;
  }
  return 0;
}

Measured memory_bytes: 1328
//FIRST THINK THEN CODE.

#include <bits/stdc++.h>
 
 
using namespace std;
 
typedef long long ll;
 
#define MOD 998244353
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define rrep(i,a,b) for(ll i=a;i>b;--i)
#define FOR(i,n)  for(ll i=0;i<n;i++)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f
#define all(x) x.begin(),x.end()
#define endl "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
ll newmod(ll a,ll b)
 {
  return ((a%b)+b)%b;
}
 
 
ll powM(ll a,ll b,ll m )
{ 
  a%=m;
  ll ans=1LL;
  while(b)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }
 
return ans;
}


 
ll poww(ll a,ll b)
{ 
  
  ll ans=1;
  while(b)
  {
    if(b&1)ans=ans*a;
    a=a*a;
    b>>=1;
  }
 
return ans;

}

template<typename T,typename F>
void chmax( T &a,F b){
  if(b>a)a=b;
}

template<typename T,typename F>
void chmin( T &a,F b){
  if(b<a)a=b;
}

const ll N=3e5+5;


int main()
{ 

IOS;


ll n;cin>>n;

ll x=1;

for(int i=1;i<=n;i++){
  ll d;cin>>d;
  x=lcm(x,d);
}

d1(x);

return 0;
 
}



Measured memory_bytes: 3640
class Dice
    @faces = nil
 
    def initialize arr
        @faces = arr
    end
 
    def top
        @faces[0]
    end
 
    def rotate news
        f = @faces.dup
        case news
        when "North"
            @faces = [f[1], f[5], f[2], f[3], f[0], f[4]]
        when "East"
            @faces = [f[3], f[1], f[0], f[5], f[4], f[2]]
        when "West"
            @faces = [f[2], f[1], f[5], f[0], f[4], f[3]]
        when "South"
            @faces = [f[4], f[0], f[2], f[3], f[5], f[1]]
        when "Right"
            @faces = [f[0], f[2], f[4], f[1], f[3], f[5]]
        when "Left"
            @faces = [f[0], f[3], f[1], f[4], f[2], f[5]]
        end
    end
end

while true
    n = gets.to_i
    break if n == 0
    sum = 1
    dice = Dice.new [1,2,3,4,5,6]
    n.times{
        dice.rotate gets.chomp
        sum += dice.top
    }
    puts sum
end



Measured memory_bytes: 6892
//============================================================================
// Name        : hoba.cpp :)
// Author      : (O_O Diab) (Why_not) (el 3AQ)
// Version     :
// Copyright   : please, Don't touch me :(
// Description : problem in C++
// MAIN IDEA   : combinatorics NCR
//============================================================================
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define rw freopen("graphs_as_a_service.txt","r",stdin),freopen("output.txt","w",stdout);
#define pb push_back
#define F first
#define S second
#define pf push_front
#define lp(i,a,b) for (int i=a;i<=(int)b;++i)
#define lp2(i,a,b) for (int i=a;i>=b;--i)
#define f(x) return cout<<x<<"\n",0
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
#define p(x) cout<<#x<<" = { "<<x<<" } \n"
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define EPS 1e-6
// to convert string to number use int a = stoi(string);
// to convert number to string use string s = to_string(int);
#define FAST ios::sync_with_stdio(0),ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define clr(c,x) memset(c,x,sizeof(c));
using namespace __gnu_pbds;
using namespace std;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const int dx[] = { 0, 1, 0, -1, 1, -1, 1, -1 };
const int dy[] = { 1, 0, -1, 0, 1, -1, -1, 1 };
const int N = 1e2 + 10, mod = (int) 1e9 + 7, INF = 0x3f3f3f3f;
int cnt = 1, vis[N][N] = { }, h, w, n, a[N * N] = { };
inline bool ongrid(int r, int c) {
	return (r >= 0 && r < h && c >= 0 && c < w && !vis[r][c]);
}
inline void dfs(int r, int c) {
	if (!ongrid(r, c))
		return;
	vis[r][c] = cnt;
	a[cnt]--;
	if (!a[cnt])
		cnt++;
	lp(i,0,3)
	{
		int x = r + dx[i];
		int y = c + dy[i];
		dfs(x, y);
	}
}
int main() {
#ifdef ONLINE_JUDGE
	FAST
#endif
	cin >> h >> w >> n;
	lp(i,1,n)
		cin >> a[i];
	dfs(0, 0);
	lp(i,0,h-1)
	{
		lp(j,0,w-1)
			cout << vis[i][j] << " ";
		cout << "\n";
	}
	return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long result = 0;
    for (int i = 1, N = sc.nextInt(); i <= N - 1; i++)
      result += i;
    System.out.println(result);
  }
}

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

int main() {
	int d, n;
	cin >> d >> n;
	int ans = 1;
	for (int i = 0;i < d;++i)ans *= 100;
	if (n != 100)cout << ans * n << endl;
	else cout << ans * 101 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
        using namespace std;
        int main()
        {
          int a,b,maxs=0;
          cin>>a>>b;
          int c[b];
          for(int i=0;i<b;i++) cin>>c[i];
          for(int i=1;i<b;i++) maxs=max(maxs,c[i]-c[i-1]);
          maxs=max(maxs,a+c[0]-c[b-1]);
          cout<<a-maxs;
          return 0;
        }

Measured memory_bytes: 1152
#include <iostream>
#include <vector>
#include <string>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main(void) {
  int h, w; cin >> h >> w;
  vector<string> c(h);
  REP(i, h) cin >> c[i];
  REP(i, h) cout << c[i] << "\n" << c[i] << endl;
  return 0;
}


Measured memory_bytes: 256
import sys, math, itertools, bisect, copy, re
from collections import Counter, deque, defaultdict

# from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
# from functools import reduce
# from math import ceil, floor, log10, log2, factorial
# from pprint import pprint

INF = float('inf')
MOD = 10 ** 9 + 7
EPS = 10 ** -7
sys.setrecursionlimit(1000000)

# N = int(input())
# N,M = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]
# DP = [[0] * 100 for _ in range(100)]
# DP = defaultdict(lambda: float('inf'))

S = int(input())

x2 = 10 ** 9
y2 = 1
x3 = 10 ** 9 - S % (10 ** 9)
y3 = S // (10 ** 9) + 1

if S == 1000000000000000000:
    x2 = 10 ** 9
    y2 = 0
    x3 = 0
    y3 = 10 ** 9

print("{} {} {} {} {} {}".format(0, 0, x2, y2, x3, y3))

# print((x2 * y3 - x3 * y2))


Measured memory_bytes: 3700
from typing import List

INT_INF = -1

class Graph:
    v_num: int
    edges: List[List[int]]

    def __init__(self, v_num: int):
        self.v_num = v_num
        self.edges = [[INT_INF for c in range(v_num)] for r in range(v_num)]

    def setDist(self, src: int, dest: int, dist: int):
        self.edges[src][dest] = dist


class TSPSolver:
    g: Graph

    def __init__(self, g: Graph):
        self.g = g

    def solve(self) -> int:
        """

        :param v:
        :param state:
        :return: -1 means INF
        """
        N = self.g.v_num
        dp = [[INT_INF for c in range(N)] for r in range(1 << N)]

        dp[(1 << N) - 1][0] = 0

        for state in range((1 << N) - 2, -1, -1):
            for v in range(N):
                for u in range(N):
                    if ((state >> u) & 1) == 0:
                        if dp[state | 1 << u][u] != INT_INF and self.g.edges[v][u] != INT_INF:
                            if dp[state][v] == INT_INF:
                                dp[state][v] = dp[state | 1 << u][u] + self.g.edges[v][u]
                            else:
                                dp[state][v] = min(dp[state][v], dp[state | 1 << u][u] + self.g.edges[v][u])
        return dp[0][0]


def main():
    V, E = map(int, input().split())
    g: Graph = Graph(V)
    for _ in range(E):
        src, dest, dist = map(int, input().split())
        g.setDist(src, dest, dist)

    tsp: TSPSolver = TSPSolver(g)
    print(tsp.solve())


if __name__ == "__main__":
    main()



Measured memory_bytes: 21648
#include <iostream>

int main()
{
    int x, y;
    std::cin >> x >> y;

    if ((x % 1 == 1) || (x * 2 > y) ||  (x * 4 < y))
    {
        std::cout << "No";
        return 0;
    }

    for (int two = 0; two <= x; ++two)
    {
        const auto four = x - two;
        if (two * 2 + four * 4 == y)
        {
            std::cout << "Yes";
            return 0;
        }
    }

    std::cout << "No";
}

Measured memory_bytes: 3620
n,m = map(int, input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        flag = True
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] != b[k][l]:
                    flag = False
                    break
            if not flag:
                break
        if flag:
            print("Yes")
            exit()
print('No')


Measured memory_bytes: 3060
import java.util.*;

public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		int k = sc.nextInt();
		
		boolean flag = false;
		if(e - a > k) {
			flag = true;
		}
		
		if(flag) {
			System.out.println(":(");
		}else {
			System.out.println("Yay!");
		}
		
	}
}

Measured memory_bytes: 23764
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
    	InputStream inputStream = System.in;
    	OutputStream outputStream = System.out;
    	Scanner sc = new Scanner(inputStream);
    	PrintWriter out = new PrintWriter(outputStream);
      	String N = sc.next();
      	if(N.charAt(0) == N.charAt(2)){
          	out.print("Yes");
        }else{
        	out.print("No");
        }
    	out.close();
    }
}

Measured memory_bytes: 22996
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
typedef long long lint;
const int N=1e5+5;
int n,cnt,pos[N];
char str[N];

namespace utils{
	template <class T> inline void apn(T &x,const T y){x=x<y?x:y;}
	template <class T> inline void apx(T &x,const T y){x=x>y?x:y;}
	inline int nxi(){
		int x=0;
		char c;
		while(((c=getchar())>'9'||c<'0')&&c!='-');
		const bool f=c=='-'&&(c=getchar());
		while(x=x*10-48+c,(c=getchar())>='0'&&c<='9');
		return f?-x:x;
	}
}
using namespace utils;

int main(){
	scanf("%s",str+1);
	n=strlen(str+1);
	str[n+1]='0';
	int ans=n;
	for(int i=1; i<=n+1; ++i){
		if(str[i]!=str[i-1]){
			apn(ans,std::max(i-1,n+1-i));
		}
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 384
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        int a = inp.nextInt();
        int b = inp.nextInt();
        int c = inp.nextInt();
        inp.close();
        System.out.println(Math.min(Math.min(a + b, a + c), b + c));
    }
}

Measured memory_bytes: 21716
/*BISMILLAH
THE WHITE WOLF
NO DREAM IS TOO BIG AND NO DREAMER IS TOO SMALL*/

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<long long> vll;
typedef vector<int> vi;

#define io ios_base::sync_with_stdio(false)
#define pb push_back
#define eb emplace_back
#define mod   998244353
#define PI 2*acos(0.0)
#define dbg(a) cout<<#a<<" ->->->-> "<<a<<"\n"
int dirx[] = {1, -1,0, 0}, diry[] = {0, 0, 1, -1};

ll bigmod(ll x, ll p)
{
    ll res = 1;
    while(p)
    {
        if(p&1)
            res = (res*x)%mod;
        x = (x*x)%mod;
        p >>= 1;
    }
    return res;
}

//=============================================ASIFAZAD==============================================//


int32_t main()
{
    io;
    string a, b;
    cin>>a>>b;
    int al = a.size(), bl = b.size();
    int dp[al+1][bl+1];
    for(int i = 0;i<= al; i++)
    {
        for(int j = 0; j<= bl; j++)
        {
            if(i == 0 || j == 0)
                dp[i][j] = 0;
            else if(a[i-1] == b[j-1])
                dp[i][j] = 1 + dp[i-1][j-1];
            else
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
        }
    }
    string ans;
    int i = al, j  =bl;
    while(i > 0 && j > 0)
    {
        if(dp[i][j] == dp[i-1][j])
            i--;
        else if(dp[i][j] == dp[i][j-1])
            j--;
        else
        {
            ans += a[i-1];
            i--;
            j--;
        }
    }
    reverse(ans.begin(), ans.end());
    cout<<ans;
    return 0;
}


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

int main() {
  int n, k;
  cin >> n >> k;
  priority_queue<int, vector<int>, greater<int>> pq;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    m[a]++;
  }

  for (auto mm : m) {
    pq.push(mm.second);
  }

  if (pq.size() <= k) {
    cout << 0 << endl;
    return 0;
  }

  int ans = 0;
  while (!pq.empty()) {
    int q = pq.top();
    pq.pop();
    ans += q;
    if (pq.size() <= k) {
      cout << ans << endl;
      return 0;
    }
  }

  return 0;
}

Measured memory_bytes: 10748
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
using vll=vector<ll>;
using vvll=vector<vll>;
using vi=vector<int>;
using vvi=vector<vector<int>>;
using vb=vector<bool>;
using pii=pair<int,int>;
using vpii=vector<pair<int,int>>;

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

//pow(llpow,modpow)
template<class T> ll llpow(ll x,T n){ll ans=1;if(x==0)ans=0;while(n){if(n&1)ans*=x;x*=x;n>>=1;}return ans;}
long long modpow(long long a, long long n, long long mod) {long long res = 1;while (n > 0) {if (n & 1) res = res * a % mod;a = a * a % mod;n >>= 1;}return res;}
//最大公約数
template<class T> inline T gcd(T x,T y){if(y==0)return x; else {return gcd(y,x%y);}}
//最小公倍数
template<class T> inline T lcm(T x,T y){return x/gcd(x,y)*y;}
//逆元
long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}

#define rep(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)
//試験導入
#define irep(i, end_i, begin_i) for (ll i = (ll)begin_i-1; i >= (ll)end_i; i--)

long long INF = 1LL<<60;
int main( ){
    int n,k;
    cin>>n>>k;
    ll res=0;
    rep(i,0,n){
        int x;
        cin>>x;
        res+=min(2*(k-x),2*x);
    }
    cout<<res<<endl;
    return 0;
}




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

int main() {
  string s;
  cin >> s;
  if(s[0] == s[1] && s[1] == s[2])
    cout << "Yes" << endl;
  else if(s[1] == s[2] && s[2] == s[3])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<ii> vii;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fr(be, en) for(int i = be; i <= en; i++) 
ll mod = LLONG_MAX;
ll power(ll a, ll b)
{
	if(b == 0) return 1;
	ll ans = power(a, b/2);
	ans = (ans*ans)%mod;
	if(b%2) ans*=a;
	return ans%mod;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cout.tie(NULL);
	cin.tie(NULL);
	double r;
	cin >> r;
	cout << setprecision(6) << std :: fixed << (double)2*3.14159265358979323846*r ;
}

Measured memory_bytes: 3792
N = int(input())
A = list(map(int, input().split()))
Am = [n for n in A if n < 0]
if len(Am) % 2 == 0:
    print(sum([abs(n) for n in A]))
else:
    m = min([abs(n) for n in A])
    print(sum([abs(n) for n in A]) - 2 * m)

Measured memory_bytes: 14332
#include "bits/stdc++.h"
using namespace std;
#define int long long
#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 FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define RFOR(i, s, n) for (int i = (int)n - 1; i >= s; --i)
#define ALL(a) a.begin(), a.end()
#define IN(a, x, b) (a <= x && x < b)
template<class T>inline void out(T t){cout << t << "\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout << t << " ";out(ts...);}
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;}
constexpr int INF = 1e18;

signed main(){
	int N,K;
    cin >> N >> K;
    vector<int>a(N);
    REP(i,N){
        cin >> a[i];
        --a[i];
    }
    int LOG = log2(K) + 1;
    vector<vector<int>>dp(LOG,vector<int>(N,-1));
    REP(i,N)dp[0][i] = a[i];
    REP(i,LOG - 1){
        REP(j,N){
            if(dp[i][j] == -1)dp[i + 1][j] = -1;
            else dp[i + 1][j] = dp[i][dp[i][j]];
        }
    }
    int ans = 0;
    REP(i,LOG){
        if(K & (1ll << i))ans = dp[i][ans];
    }
    out(ans + 1);
}

Measured memory_bytes: 100256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
char s[305][305];
int  a[305][305];
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H,W,K;
	cin >> H >> W >> K;
	rep(i,H)rep(j,W)cin >> s[i][j];
	int cnt = 1;
	rep(i,H)rep(j,W){
		if(s[i][j]=='#'){
			a[i][j] = cnt;
			cnt++;
		}
	}
	rep(i,H)rep(j,W){
		int k;
		if(a[i][j]){
			int x = a[i][j];
			k = j;
			while(k-1>=0&&a[i][k-1]==0){
				a[i][k-1]= x;
				k--;
			}
			k = j;
			while(k+1<W&&a[i][k+1]==0){
				a[i][k+1]= x;
				k--;
			}
		}
	}
	rep(i,H){
		int x;
		if(a[i][0]){
			x = i;
			while(x-1>=0&&a[x-1][0]==0){
				rep(j,W)a[x-1][j]=a[x][j];
				x--;
			}
			x = i;
			while(x+1<H&&a[x+1][0]==0){
				rep(j,W)a[x+1][j]=a[x][j];
				x++;
			}
		}
	}
	rep(i,H){
		rep(j,W)cout << a[i][j] << " ";
		cout << endl;
	}
}

Measured memory_bytes: 1280