akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    Func cin2;
    void calc()
    {
        cin = new Scanner();
        cin2 = new Func();
        int N=cin.nextInt();
        int[] a=cin.ArrayInt(N,0);
        bool[] x=new bool[1000000001];
        string ans ="YES";
        for(int i=0;i<N;i++)
        {
            if(x[a[i]]==false)x[a[i]]=true;
            else ans="NO";
        }
        Console.WriteLine(ans);
    }
}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Answer
{
    public void Int2DArrayAns(int[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
    public void Char2DArrayAns(char[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
}

class Func
{
    public long GCDLong(long a, long b)
    {
        while(a!=0)
        {
          long t=a;
          a=b%a;
          b= t;
        }
      
        return b;        
    }
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define MAX (int)1e9 + 99
#define vi vector<int>
#define vb vector<bool>
#define ll long long
#define ull unsigned long long
#define vll vector<ll>
#define pa pair<int, int>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define MOD 998244353
#define bitcnt(x) __builtin_popcount(x)
#define gcd(a,b) __gcd(a,b)
#define all(x) (x).begin(),(x).end()
#define ts(x) to_string(x)
ll fastPowMod(ll a, ll p,ll mod){ if(p==0) return 1; ll z = fastPowMod(a,p/2,mod); z = (z*z)%mod; if(p%2) z = (z*a)%mod; return z; }
template<class T> istream &operator>>(istream &is, vector<T> &v) { for (T &x : v) is >> x; return is;}
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) {if (!v.empty()) {os << v.front();for (int i = 1; i < v.size(); ++i) os << ' ' << v[i];} return os;}


void solve()
{
    int n;
    cin>>n;
    vll a(n+1),b(n+1),c(n+1);
    srep(i,1,n) cin>>a[i]>>b[i]>>c[i];
    ll dp[n+1][3];
    memset(dp,0,sizeof(dp));
    int x=1,y=1,z=1;
    dp[1][1] = a[1];
    dp[1][2] = b[1];
    dp[1][3] = c[1];
    srep(i,2,n)
    {
        dp[i][1] = a[i]+max(dp[i-1][2],dp[i-1][3]); 
        dp[i][2] = b[i]+max(dp[i-1][1],dp[i-1][3]); 
        dp[i][3] = c[i]+max(dp[i-1][2],dp[i-1][1]); 
    }
    cout<<max(dp[n][1],max(dp[n][2],dp[n][3]));
}

int main()
{
    fastio
    /*int t;
    cin>>t;
    
    rep(i,t)
    {*/
        solve();
        cout<<"\n";
    //}
    return 0;
}

Measured memory_bytes: 4992
def abc157_b():
    grid = [list(map(int, input().split())) for _ in range(3)]
    bingo = [[False]*3 for _ in range(3)]
    N = int(input())
    for _ in range(N):
        b = int(input())
        for i in range(3):
            for j in range(3):
                if b == grid[i][j]:
                    bingo[i][j] = True

    for i in range(3):
        if bingo[i][0] and bingo[i][1] and bingo[i][2]:
            return 'Yes'
        if bingo[0][i] and bingo[1][i] and bingo[2][i]:
            return 'Yes'
    if bingo[0][0] and bingo[1][1] and bingo[2][2]:
        return 'Yes'
    if bingo[0][2] and bingo[1][1] and bingo[2][0]:
        return 'Yes'
    return 'No'

print(abc157_b())

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
long long t1,t2,a1,b1,a2,b2;
int main()
{
    cin>>t1>>t2>>a1>>b1>>a2>>b2;
    if (a1*t1+b1*t2==a2*t1+b2*t2) puts("infinity");
    else {
        long long res=0;
        long long f1=t1*a1,f2=t2*b1;
        long long g1=t1*a2,g2=t2*b2;
        if (f1<g1) {
            swap(f1,g1);
            swap(f2,g2);
        }
        if (f1+f2<g1+g2) {
            res+=2*((f1-g1)/(g1+g2-f1-f2));
            if ((f1-g1)%(g1+g2-f1-f2))
                ++res;
        }
        cout<<res<<endl;
    }
    return 0;
}


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

const int N = 200100;

int n;
int a[N];
int ans[N];

int main() {
	memset(ans, 0, sizeof(ans));
	cin >> n;
	for(int i = 1 ; i <= n ; i++) {
		cin >> a[i];
		assert(a[i] >= 1 and a[i] <= n);
	}

	int mx = 0;
	for(int i = n ; i >= 1 ; i--) {
		ans[a[i]] = 1 + ans[a[i]+1];
		assert(ans[a[i]] >= 0 and ans[a[i]] <= n);
		mx = max(mx, ans[a[i]]);
	}
	cout << n - mx;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;

    int a[N], b[N], c[N];
    for (int i = 0; i < N; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < N; i++)
    {
        cin >> b[i];
    }
    for (int i = 0; i < N; i++)
    {
        cin >> c[i];
    }   
    sort(a, a + N);
    sort(b, b + N);
    sort(c, c + N);

    int64_t ans = 0;
    for (int i = 0; i < N; i++)
    {
        int64_t j = lower_bound(a, a + N, b[i]) - a;
        int64_t k = lower_bound(c, c + N, b[i] + 1) - c;
        ans += j * (N - k);
    }
    cout << ans << endl;

}

Measured memory_bytes: 1408
import java.util.Scanner;
public class Main {
	void howmany(){
		int a,b,c,cnt;
		Scanner s = new Scanner(System.in);
		a = s.nextInt();
		b = s.nextInt();
		c = s.nextInt();
		cnt = 0;
		for(int i = a ; i <= b ; i++){
			if((c%i)==0){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	public static void main(String args[]){
		Main m = new Main();
		m.howmany();
	}
}

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

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

using namespace std;

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

int main() {
  int n;
  cin >> n;
  vector<ll> lucas;
  lucas.push_back(2);
  lucas.push_back(1);
  for (int i = 2; i <= n; i++) {
    ll tmp = lucas.at(i - 1) + lucas.at(i - 2);
    lucas.push_back(tmp);
  }
  cout << lucas.at(n) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

int main() {
    
    string name1,name2;
    cin >> name1;
    cin >> name2;
    // insert code here...
    if(name1[0] == name2[2] && name1[1] == name2[1] && name1[2] == name2[0]){
        cout << "YES" << endl;
    }else{
    cout << "NO" << endl;
    }
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <climits>
#include <cstdio>
#include <utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PLL;
const int maxn = 2e5 + 5;
int a[maxn];
long long s[maxn];
PLL getmid(int l,int r,ll mid)
{
	ll ret = 0;
	int pos = upper_bound(s + l,s + r,mid / 2) - s;
	if(pos < r)
	{
		ret = max(ret,mid - s[pos]);
	}
	if(pos > l)
	{
		ret = max(ret,s[pos - 1]);
	}
	return {mid - ret,ret};
}
int main(int argc, char const *argv[])
{
	int n;
	scanf("%d",&n);
	for(int i = 0;i < n; ++i)
	{
		cin>>a[i];
	}
	for(int i = 0;i < n; ++i)
	{
		s[i + 1] = s[i] + a[i];
	}
	ll ans = LLONG_MAX;
	for(int i = 2;i <= n - 2; ++i)
	{
		auto u = getmid(1,i,s[i]);
		auto v = getmid(i + 1,n,s[i] + s[n]);
		v.first -= s[i];
		v.second -= s[i];
		// printf("i = %d,u = {%d,%d},v = {%d,%d}\n",i,u.first,u.second,v.first,v.second);
		ans = min(ans,max(u.first,v.first) - min(u.second,v.second));
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include<set>
using namespace std;
int main(void){
    int a[4]={0};
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        string s;
        cin>>s;
        if(s=="P") a[0]++;
        else if(s=="W") a[1]++;
        else if(s=="G") a[2]++;
        else if(s=="Y") a[3]++;
    }
    for(int i=0;i<4;i++){
        if(a[i]==0){
            cout<<"Three"<<endl;
            return 0;
        }
    }
    cout<<"Four"<<endl;
    return 0;
}


Measured memory_bytes: 256
import sys

read = sys.stdin.read


def main():
    N, K = map(int, read().split())

    dp1 = [0] * (K + 1)
    dp2 = [0] * (K + 1)
    dp1[0] = 1

    for x in map(int, str(N)):
        for j in range(K, -1, -1):
            if j > 0:
                dp2[j] += dp2[j - 1] * 9
                if x != 0:
                    dp2[j] += dp1[j - 1] * (x - 1) + dp1[j]
                    dp1[j] = dp1[j - 1]
            else:
                dp1[j] = 0
                dp2[j] = 1

    print(dp1[K] + dp2[K])
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 62144
n = int(input())
l = [int(_) for _ in input().split()]

dict_e = {}
for i in range(1, n, 2):
    if l[i] in dict_e.keys():
        dict_e[l[i]] += 1
    else:
        dict_e[l[i]] = 1

even_key, even_value = max(dict_e.items(),key = lambda x:x[1])

dict_a = {}
for i in range(0, n, 2):
    if l[i] in dict_a.keys():
        dict_a[l[i]] += 1
    else:
        dict_a[l[i]] = 1

add_key, add_value = max(dict_a.items(),key = lambda x:x[1])

if even_key != add_key:
    ans = n - even_value - add_value
else:
    if even_value > add_value:
        if len(dict_a) >= 2:
            add_value = sorted(dict_a.items(), key = lambda x:x[1])[-2][1]
        else:
            add_value = 0
        ans = n - even_value - add_value
    elif even_value == add_value:
        if len(dict_e) == 1:
            even_value = 0
            ans = n - add_value - even_value
        else:
            even_value = sorted(dict_e.items(), key = lambda x:x[1])[-2][1]
            add_value = sorted(dict_a.items(), key = lambda x:x[1])[-2][1]
            if even_value > add_value:
                add_value = max(dict_a.items(),key = lambda x:x[1])[1]
                ans = n - even_value - add_value
            else:
                even_value = max(dict_e.items(),key = lambda x:x[1])[1]
                ans = n - even_value - add_value
    else:
        if len(dict_e) >= 2:
            even_value = sorted(dict_e.items(), key = lambda x:x[1])[-2][1]
        else:
            even_value = 0
        ans = n - even_value - add_value

print(ans)

Measured memory_bytes: 18144
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vl vector<LL>
#define vii vector<vi>
#define vll vector<vl>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

int main(){
	LL a,b,v,w,t;
    cin>>a>>v>>b>>w>>t;
    if((v-w)*t>=abs(a-b)){
        cout<<"YES";
    }else{
        cout<<"NO";
    }

}


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

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

  int H[100010];
  for (int i = 1; i <= N; i++) cin >> H[i];

  int res[100010] = {};
  for (int i = 1; i <= N; i++) res[i] = 1;
  for (int i = 0; i < M; i++) {
    int A, B;
    cin >> A >> B;
    if (H[A] > H[B])
      res[B] = 0;
    else if (H[B] > H[A])
      res[A] = 0;
    else if (H[A] == H[B])
      res[A] = res[B] = 0;
  }

  int counter = 0;
  for (int i = 1; i <= N; i++) {
    if (res[i] == 1) counter++;
  }
  cout << counter << endl;
  return 0;
}


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

int main(){
#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\User\\Documents\\input.txt","r",stdin);
#endif
	int T,i,j;
	int n,wt;
	cin>>n>>wt;
	vector<ll> w(n+1),v(n+1);
	for(i=1;i<=n;++i){
	    scanf("%lld %lld",&w[i],&v[i]);
	}

	vector<vector<ll> > dp(n+1,vector<ll> (wt+1,0));

	for(i=1;i<=n;++i){
	    for(j=1;j<=wt;++j){
	        if(w[i]>j) dp[i][j]=dp[i-1][j];
	        else{
	        	if(dp[i-1][j-w[i]]+v[i]<dp[i-1][j]) dp[i][j]=dp[i-1][j];
	        	else dp[i][j]=dp[i-1][j-w[i]]+v[i];
	        }
	    }
	}
	printf("%lld\n",dp[n][wt]);

		
	return 0;
}

Measured memory_bytes: 83216
#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;cin>>S;int i;
  for(i=1;i<S.size();i++)if(S.at(i-1)=='A'&&S.at(i)=='C')break;
  if(i==S.size())cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
using namespace std;
typedef long long int llint;
typedef vector<int> vint;
typedef vector<llint> vllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i,n) for(int i=0;i<n;i++)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

//aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long &x, long long &y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a%b, y, x);
	y -= a / b * x;
	return d;
}

bool check(int a, int b) {
	return a > b;
}

int main() {
	llint n, m;
	cin >> n >> m;
	if (n == 2 || m == 2) {
		cout << 0 << endl;
	}
	else if (n == 1 && m == 1) {
		cout << 1 << endl;
	}
	else if (n == 1) {
		cout << m - 2 << endl;
	}
	else if (m == 1) {
		cout << n - 2 << endl;
	}
	else {
		cout << (n - 2)*(m - 2) << endl;
	}
	return 0;
}

Measured memory_bytes: 256
from heapq import*

class median_tree(object):
    def __init__(self):
        self.lower_than_med=[]
        self.higher_than_med=[]
        self.count=0
        self.low=0
        self.high=0
        self.median=0
    def push(self,x):
        self.count=1-self.count
        if self.count:
            y=heappushpop(self.higher_than_med,x)
            heappush(self.lower_than_med,-y)
            self.low +=-y
            self.high+=x-y
        else:
            y=heappushpop(self.lower_than_med,-x)
            heappush(self.higher_than_med,-y)
            self.low -=x+y
            self.high-=y
        self.median=-self.lower_than_med[0]

from heapq import*
n=int(input())
m=median_tree()

B=0
for i in range(n):
    I=input()
    if I[0]=="1":
        a,b,c=map(int,I.split())
        B+=c
        m.push(b)
    else:
        print(m.median,m.count*m.median+B+m.low+m.high)

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

struct Edge {
	int src, dst;
	Edge(int src, int dst) { this->src = src; this->dst = dst; }
	Edge() { }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

Graph g;	//????????°??????, g[v]????????????v??????????????????????????????????????\???
Graph rg;	//????????????????????°??????, rg[v]????????????v??????????????????????????????????????\???

int timer;
bool visited[10000];
int vnum[10000];		//??°????????????i --> ????????????vnum[i]
int sccId[10000];		//????????????i --> ????????????sccId[i]

void dfs1(int u) {
	visited[u] = true;
	for (int i = 0; i < g[u].size(); i++) {
		int v = g[u][i].dst;
		if (!visited[v]) {
			dfs1(v);
		}
	}
	vnum[timer] = u;
	timer++;
}

void dfs2(int u) {
	visited[u] = true;
	sccId[u] = timer;
	for (int i = 0; i < rg[u].size(); i++) {
		int v = rg[u][i].dst;
		if (!visited[v]) {
			dfs2(v);
		}
	}
}

int main () {
	int n, m;
	int src, dst;
	
	cin >> n >> m;
	g.resize(n);
	rg.resize(n);
	for (int i = 0; i < m; i++) {
		cin >> src >> dst;
		g[src].push_back(Edge(src, dst));
		rg[dst].push_back(Edge(dst, src));
	}
	
	//?????£?????????????§£
	timer = 0;
	for (int i = 0; i < n; i++) { visited[i] = false; }
	for (int i = 0; i < n; i++) {
		if (!visited[i]) {
			dfs1(i);
		}
	}
	
	for (int i = 0; i < n; i++) { visited[i] = false; }
	timer = 0;
	for (int i = n - 1; i >= 0; i--) {
		if (!visited[vnum[i]]) {
			dfs2(vnum[i]);
			timer++;
		}
	}
	
	//?????¨???
	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		int u, v;
		cin >> u >> v;
		cout << (sccId[u] == sccId[v]) << endl;
	}
	return 0;
}

Measured memory_bytes: 2592
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 1000000000
#define LLINF 100000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N;
double p[3010];
double dp[3010][3010];
int main(){
	scanf("%d",&N);
	for(int i=0;i<N;i++)cin >> p[i];
	dp[0][0]=1.0;
	for(int i=0;i<N;i++){
		for(int j=0;j<=i+1;j++){
			dp[i+1][j]+=dp[i][j]*(1.0-p[i]);
			if(j>0)dp[i+1][j]+=dp[i][j-1]*p[i];
		}
	}
	double ans = 0.0;
	for(int i=0;i<=N;i++){
		if(i>N-i)ans += dp[N][i];
	}
	printf("%.12f\n",ans);
	return 0;
}

Measured memory_bytes: 69120
n=int(input())
a=list(map(int,input().split()))
f=0
ans=1
for i in range(1,n):
    if a[i]>a[i-1]:
        if f==0 or f==1:
            f=1
        else:
            ans+=1
            f=0
    elif a[i]<a[i-1]:
        if f==2 or f==0:
            f=2
        else:
            ans+=1
            f=0
    else:
        continue
print(ans)


Measured memory_bytes: 62704
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(void) {
	int n,w = 0,b = 0;
	scanf("%d", &n);
	char s[n + 1];
	scanf("%s", s);
	for (int i = 0;i < n;i++) {
		if (s[i] == '.') {
			w++;
		}
	}
	if (w == 0 || w == n) {
		printf("0");
		return 0;
	}
	int ans = w;
	for (int i = 0;i < n;i++) {
		if (s[i] == '.') {
			w--;
		}
		else {
			b++;
		}
		if (ans > w + b) {
			ans = w + b;
		}
	}
	printf("%d", ans);
	return 0;
}

Measured memory_bytes: 384
#include<iostream>
using namespace std;
int main(){
  int H,W;
  while(cin>>H>>W){
    if(H==0&&W==0) break;
    for(int i=0;i<H;i++){    
      for(int j=0;j<W;j++){
	if(j==W-1){
	  cout << "#" << endl;
	  break;
	}
	cout << "#";
      } 
    }
    cout << endl;  
  }
  return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i ++)
#define MP make_pair
 
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int MOD = 1e9 + 7;
 
int n, m;
char S[200005];
vector<int> sizs;
int dp[200005], prs[200005];

int main()
{
	scanf("%d%d%s", &n, &m, S);
	
	int ccnt = 1;
	for(int i = 1; i < m; i ++)
	if(S[i] != S[i - 1]) {
		sizs.push_back(ccnt);
		ccnt = 1;
	} else ccnt ++;
	sizs.push_back(ccnt);
	
	if(sizs.size() == 1) {
		dp[1] = 2;
		dp[2] = MOD - 1;
		rep(i, n) {
			if(i >= 1) dp[i] = (dp[i] + dp[i - 1]) % MOD;
		}
		rep(i, n) {
			if(i >= 1) dp[i] = (dp[i] + dp[i - 1]) % MOD;
			if(i >= 2) dp[i] = (dp[i] + dp[i - 2]) % MOD;
		}
		printf("%d\n", dp[n - 1] + 1);
	} else {
		int maxl = min(n, sizs[0] + 2);
		rep(i, sizs.size()) if(i + 1 < sizs.size() && !(i & 1) && (sizs[i] & 1))
		maxl = min(maxl, sizs[i] + 1);
		
		rep1(i, maxl) if(!(i & 1)) dp[i] = i;
		
		rep1(i, n) {
			if(i >= 2) dp[i] = (dp[i] + prs[i - 2]) % MOD;
			if(i >= 2 + maxl) dp[i] = (dp[i] + (MOD - 1LL) * prs[i - 2 - maxl]) % MOD;
			if(i >= 2) prs[i] = (dp[i] + prs[i - 2]) % MOD;
		}
		
		printf("%d\n", dp[n]);
	}
	return 0;
}

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

int pos[100][100];

int main() {
    int N, D;
    cin >> N >> D;
    rep(i, N) rep(j, D) {
        cin >> pos[i][j];
    }

    int ans = 0;
    rep(i, N) for (int j=i+1; j<N; ++j) {
        double dist = 0;
        rep(k, D) {
            dist += (pos[i][k] - pos[j][k]) * (pos[i][k] - pos[j][k]);
        }
        int tmp = sqrt(dist);
        int tmp2 = ceil(sqrt(dist));
        if (tmp == tmp2) ans++;

    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = (a); i < int(b); ++i)
#define rrep(i, a, b) for(int i = (a) - 1; i >= int(b); --i)
vector<int> adj[100005];
int minDis[100005],color[100005],v[100005],d[100005],c[100005],N,M,Q;
void dfs(int node, int Dleft, int Cin){
	if(Dleft <= minDis[node]) return;
	minDis[node] = Dleft;
	if(color[node] == 0) color[node] = Cin;
	rep(i,0,adj[node].size()){
		int to=adj[node][i];
		dfs(to, Dleft-1, Cin);
	}
}
int main()
{
	scanf("%d%d", &N, &M);
	rep(i,0,N) minDis[i]=-1;
	rep(i,0,M)
	{
		int a, b;
		scanf("%d%d", &a, &b);
		--a;--b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	scanf("%d", &Q);
	rep(i,0,Q) scanf("%d%d%d", v+i, d+i, c+i);
	rrep(i,Q,0) dfs(v[i]-1, d[i], c[i]);
	rep(i,0,N) printf("%d\n", color[i]);
}

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

fn solve() -> u32{
    0
}

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();

    let a:usize = iter.next().unwrap().parse().unwrap();
    let p:usize = iter.next().unwrap().parse().unwrap();
    println!("{}", (a*3+p)/2);
}

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

long digit(long n, long k)
{
	long cnt = 1;
	while (n >= k)
	{
		n /= k;
		cnt++;
	}
	return cnt;
}

int  main()
{
	long n;
	long k;
	cin >> n >> k;
	long ans = digit(n, k);
	cout << ans << endl;
	return (0);
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int min(int a,int b){
  if(a>b) return b;
  else return a;
}

int main(){
  int N;
  int A[111],B[111];
  cin >> N;
  int i;
  for(i=0;i<=N-2;i++)
    cin >> B[i];
  A[0] = B[0];
  A[N-1] = B[N-2];
  for(i=1;i<=N-2;i++)
    A[i] = min(B[i-1],B[i]);
  int sum = 0;
  for(i=0;i<=N-1;i++)
    sum += A[i];
  cout << sum << endl;
}

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

using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}
template<class T> void chmax(T& a, T b){ if(a<b){a=b;} }
template<class T> void chmin(T& a, T b){ if(a>b){a=b;} }
const ll MOD = 1e9+7;

#define pll pair<ll,ll>

ll dp1[51][51];
ll dp2[51][51];
ll v[51];
priority_queue<ll,vector<ll>,greater<ll>> pq;


int main(){
    int N,K; cin>>N>>K;
    for(int i=1;i<=N;++i){
        cin >> v[i];
    }
    
    dp1[0][0] = 0;    
    for(int i=1;i<=N;++i){
        dp1[i][0] = dp1[i-1][0]+v[i];
        for(int j=1;j<=i;++j){
            pq.push(v[j]);
        }
        
        for(int j=1;j<=i;++j){
            dp1[i][j] = dp1[i][j-1] - pq.top();
            pq.pop();
        }
    }
    
    
    dp2[0][0] = 0;
    for(int i=1;i<=N;++i){
        dp2[i][0] = dp2[i-1][0]+v[N-i+1];
        for(int j=1;j<=i;++j){
            pq.push(v[N-j+1]);
        }
        
        for(int j=1;j<=i;++j){
            dp2[i][j] = dp2[i][j-1] - pq.top();
            pq.pop();
        }
    }
    
    ll ans = 0;
    for(int Lget=0;Lget<=K;++Lget){
        for(int Rget=0;Rget<=K;++Rget){
            if(Lget+Rget>N){ break;}
            
            for(int Lth=0;Lth<=Lget;Lth++){
                for(int Rth=0;Rth<=Rget;++Rth){
                    if(Lget+Rget+Lth+Rth>K){break;}
                    chmax(ans, dp1[Rget][Rth] + dp2[Lget][Lth]  );
                }
            }
        }
    }
    
    

    cout << ans << "\n";
}


Measured memory_bytes: 256
fn main() {
    let mut buf = String::new();

    std::io::stdin().read_line(&mut buf).unwrap();

    let str = buf.trim();

    let full_second: i32 = str.parse().unwrap();
    let hour = full_second / 3600;
    let minute = full_second % 3600 / 60;
    let second = full_second % 3600 % 60;
    println!("{}:{}:{}", hour, minute, second);
}


Measured memory_bytes: 5032
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);(i)++)
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);(i)--)
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);(i)--)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; }return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; }return 0; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }

template<typename T> class BIT {
    int n;
    vector<T> dat;
public:
    void init(int in) {
        n = in + 1;
        dat.clear();
        dat.resize(n + 1, 0);
    }
    T sum(int i) {
        T ret = 0;
        while (i >= 0) {
            ret += dat[i];
            i = (i & (i + 1)) - 1;
        }
        return ret;
    }
    void add(int i, T x) {
        while (i <= n) {
            dat[i] += x;
            i |= i + 1;
        }
    }
};

int main() {
    ll n;
    cin >> n;
    VI a(n), sorted(n);
    FOR(i, 0, n) {
        cin >> a[i];
        sorted[i] = a[i];
    }
    SORT(sorted);
    int ok = 0, ng = n;
    BIT<ll> bit;

    ll border = ((n * (n + 1) / 2) + 1) / 2;
    while (ng - ok > 1) {
        int mid = (ng + ok) / 2;
        int midnum = sorted[mid];
        bit.init(2 * n + 1);
        int sum = 0;
        bit.add(sum + n, 1);
        ll result = 0;
        FOR(i, 0, n) {
            sum += (a[i] >= midnum ? 1 : -1);
            result += bit.sum(sum + n);
            bit.add(sum + n, 1);
        }
        if (result >= border)ok = mid;
        else ng = mid;
    }
    cout << sorted[ok] << endl;
}


Measured memory_bytes: 2688
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

template<typename T>
struct BinaryIndexedTree{
    vector<T> data;
    int sz;

    BinaryIndexedTree(int n){
        sz = n + 1;
        data.assign(sz, 0);
    }

    void add(int i, T x){
        ++i;
        while(i < sz){
            data[i] += x;
            i += i & -i;
        }
    }

    // [0, i] の区間和
    T sum(int i){
        T res = 0;
        ++i;
        while(i > 0){
            res += data[i];
            i -= i & -i;
        }
        return res;
    }

    T sum(int l, int r){
        return sum(r - 1) - sum(l - 1);
    }

    // val 以上を満たす 0-indexed の位置を返す
    int lower_bound(T val){
        // if(val <= 0)    return -1;
        int res = 0;
        int n = 1;
        while(n < sz)   n <<= 1;
        for(int k = n >> 1; k > 0; k >>= 1){
            if(res + k < sz && data[res + k] < val){
                val -= data[res + k];
                res += k;
            }
        }
        return res;     // 1-indexed であれば、res + 1 を返す
    }
};

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

    int n, m, q;
    cin >> n >> m >> q;
    vector<tuple<int, int, int>> table;
    // bit.data[i] := 右端が i である列車の個数
    BinaryIndexedTree<int> bit(n + 1);
    for(int i = 0; i < m; ++i){
        int l, r;
        cin >> l >> r;
        table.emplace_back(l, q, r);
        bit.add(r, 1);
    }
    for(int i = 0; i < q; ++i){
        int l, r;
        cin >> l >> r;
        table.emplace_back(l, i, r);
    }
    // 列車とクエリを左端昇順ソート (左端が同じものはクエリが先にくるようにする。)
    // こうすることで、クエリの区間に対して左端がはみ出たものを考慮せずに済む。
    sort(table.begin(), table.end());

    vector<int> ans(q);
    for(auto tup : table){
        int i = get<1>(tup);
        // 列車であれば、以降は利用しないので減算しておく。
        if(i == q)  bit.add(get<2>(tup), -1);
        // クエリであれば、[l, r] に含まれる列車の個数を取得する。
        else{
            int l = get<0>(tup), r = get<2>(tup);
            ans[i] = bit.sum(l, r + 1);
        }
    }
    for(int x : ans)    cout << x << '\n';
}

Measured memory_bytes: 9472
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <cstring>
using namespace std;
#define sci(n) scanf("%lld", &(n))
#define scd(n) scanf("%Ld", &(n))
typedef long long LL;
typedef long double LD;
typedef pair<LL, LL> pll;
int a[500], t[500];
int n, k;
bool chk(int x)
{
	LL c = 0;
	for(int i =0;i<n;i++){
		t[i] = a[i] % x;
	}
	sort(t, t + n);
	int l = 0, r = n - 1;
	while (l<r){
		int tt = min(t[l], x - t[r]);
		c += tt;
		t[l] -= tt, t[r] += tt;
		if (t[l] == 0)l++;
		if (t[r] == x)r--;
	}
	return c <= k;
}
int main() {
	scanf("%d%d", &n, &k);
	int sum = 0;
	for(int i=0;i<n;i++){
		scanf("%d", a + i);
		sum += a[i];
	}
	int ans = 1;
	for (int i = 1; i*i <= sum; i++)
	{
		if (i<ans)break;
		if (sum%i == 0)
		{
			if (chk(i))ans = max(ans, i);
			if (chk(sum / i))ans = max(ans, sum / i);
		}
	}
	printf("%d", ans);
}

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

int main()
{
    long long n, min, max, sum = 0;
    //輸入陣列數量為n
    scanf("%lld", &n);
    long long a[n - 1];
    //輸入n個陣列的每格數字
    for (int i = 0; i < n; i++)
    {
        scanf("%lld", &a[i]);
    }
    //雙重for迴圈把陣列數字從小排到大
    for (int j = 0; j < n; j++)
    {
        for (int k = 0; k < n; k++)
        {
            if (a[k] > a[j])
            {
                long long temp = a[k];
                a[k] = a[j];
                a[j] = temp;
            }
        }
    }
    //總數總和for迴圈
    for (int l = 0; l < n; l++)
    {
        sum = sum + a[l];
    }
    min = a[0];
    max = a[n - 1];
    printf("%lld %lld %lld\n", min, max, sum);

    return 0;
}



Measured memory_bytes: 2756
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T>
using vec = std::vector<T>;

struct P {
    int h;
    int w;
    int c;
};

int main() {
    int H,W;
    cin >> H >> W;
    vec<string> s(H);
    rep(i,H) cin >>s[i];
    int dot = 0;
    rep(i,H)rep(j,W){
        if(s[i][j]=='.') ++dot;
    }
    queue<P> q;
    q.push({0,0,1});
    s[0][0] = '#';

    while(!q.empty()){
        int h = q.front().h;
        int w = q.front().w;
        int c = q.front().c;
        if(h==H-1&&w==W-1){
            cout << dot - c << endl;
            return 0;
        }
        q.pop();
        if(h>0&&s[h-1][w]=='.'){
            q.push({h-1,w,c+1});
            s[h-1][w] = '#';
        }
        if(w>0&&s[h][w-1]=='.'){
            q.push({h,w-1,c+1});
            s[h][w-1] = '#';
        }
        if(h<H-1&&s[h+1][w]=='.'){
            q.push({h+1,w,c+1});
            s[h+1][w] = '#';
        }
        if(w<W-1&&s[h][w+1]=='.'){
            q.push({h,w+1,c+1});
            s[h][w+1] = '#';
        }
    }
    cout << -1 << endl;
}

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

using namespace std;

char s[100005];

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

    scanf("%s", s);

    int res = 0;
    int ch = 0;

    for (int i = 1; i < n; i++) {
        if (s[i] != s[i - 1]) ch++;
        else res++;
    }

    res += min(k * 2, ch);

    printf("%d\n", res);
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <utility>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <iterator>
#include <random>
#include <fstream>
#include <chrono>
#include <math.h>
#include <cctype>
using namespace std;
#define int long long
#define forn(i, n) for (int i = 0; i < n; ++i)
int n, mod;
vector<vector<int>> g;
vector<int> dp;
vector<int> ans;

void dfs1(int v, int p) {
    dp[v] = 1;
    for (int to: g[v]) {
        if (to == p) {
            continue;
        }
        dfs1(to, v);
        dp[v] *= dp[to] + 1;
        dp[v] %= mod;
    }
}

void dfs2(int v, int p, int cur) {
    ans[v] = dp[v] * cur % mod;
    //cerr <<v + 1 << " " <<  dp[v] << " " << cur << endl;
    vector<int> sons;
    for (int to: g[v]) {
        if (to != p) {
            sons.push_back(to);
        }
    }
    vector<int> pref(sons.size() + 1, 1), suf(sons.size() + 1, 1);
    for (int i = 0; i < sons.size(); i++) {
        pref[i + 1] = pref[i] * (dp[sons[i]] + 1) % mod;
    }
    for (int i = sons.size() - 1; i >= 0; i--) {
        suf[i] = suf[i + 1] * (dp[sons[i]] + 1) % mod;
    }
    for (int i = 0; i < sons.size(); i++) {
        dfs2(sons[i], v, (cur * pref[i] % mod * suf[i + 1] % mod + 1) % mod);
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin >> n >> mod;
    g.resize(n);
    ans.resize(n);
    dp.resize(n);
    for (int i = 0; i < n-1; i++) {
        int a, b;
        cin >> a >> b;
        --a;
        --b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    dfs1(0, -1);
    dfs2(0, -1, 1);
    for (int i = 0; i < n; ++i) {
        cout << ans[i] << "\n";
    }
    //cout << endl;
    return 0;
}


Measured memory_bytes: 25076
#include <iostream>
#include <vector>
#include <algorithm>
#define F(i,a,n) for(long long i = (a); i < (n); ++i)
using namespace std;
int main(){
  long long N;
  long long ans = 0;
  cin >> N;
  long long arr[N];
  F(i,0,N) cin >> arr[i];
  long long c[N+1] = {};
  F(i,0,N){
    if(arr[i] <= N){
      c[arr[i]] +=1;
    }else{
      ans++;
    }
  }
  F(i,0,N+1){
    if(c[i] < i){
      ans += c[i];
    }else{
      ans += c[i] -i;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>

int nextInt();
void sort(int *a, int size);

int N, i;
int A, B, C[100000];
long long int a, b;

int main(){
	N=nextInt();
	for(i=0; i<N; i++){
		A=nextInt();
		B=nextInt();
		C[i] = A + B;
		b += B;
	}
	sort(C, N);
	for(i=0; i<N; i+=2){
		a += C[i];
	}
	printf("%lld\n", a-b);
	return 0;
}

int nextInt(){
	int f=0; char c=getchar();
	while((c<'0')||('9'<c)){c=getchar();}
	while((c>='0')&&(c<='9')){f=f*10+(c-'0'); c=getchar();}
	return f;
}

char compare(int *x, int *y){
	return *x > *y;
}

int* med3(int *x, int *y, int *z){
	if(compare(x, y)){
		if (compare(y, z)){return y;}else if(compare(z, x)){return x;}else{return z;}
	} else {
		if (compare(z, y)){return y;}else if(compare(x, z)){return x;}else{return z;}
	}
}

void quickSort(int *left, int *right){
	if(left >= right){return;}
	int *pivot = left+(right-left)/2;
	int *l=left, *r=right;
	int t;
	while(1){
		while (compare(l, pivot)){l++;}
		while (compare(pivot, r)){r--;}
		if(l>=r){break;}
		t=*l; *l=*r; *r=t;
		if(pivot == l){
			pivot = r;
		}else if(pivot == r){
			pivot = l;
		}
		l++; r--;
	}
	quickSort(left, l-1);
	quickSort(r+1, right);
}

void sort(int *a, int size){
	quickSort(a, a+size-1);
}


Measured memory_bytes: 512
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
#define endl "\n"
//#define int long long
#define ALL(x) begin(x),end(x)
#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279;
int fact(int i) {
    if (i == 0) return 1;
    return ((fact(i - 1)) * i) % MOD;
}
int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int keta(int n) {
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
int ketasum(int n) {
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
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;
}
char toSmall(char c) { // 大文字を小文字へ
    return (c + 0x20);
}
char toLarge(char c) { // 小文字を大文字へ
    return (c - 0x20);
}
float myPower(int a, int n) { // aのn乗の計算
    float x = 1;
    while (n > 0) { // 全てのbitが捨てられるまで
        if (n & 1) { // 一番右のbitが１のとき
            x *= a;
        }
        a *= a;
        n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
    }
    return x;
}
bool is_prime(const unsigned n) {
    switch (n) {
    case 0: // fall-through
    case 1: return false;
    case 2: // fall-through
    case 3: return true;
    } // n > 3 が保証された
    if (n % 2 == 0 || n % 3 == 0) return false;
    // n は 2 と 3 のいずれの倍数でもないことが保証された
    // これより n は (6の倍数)-1 か (6の倍数)+1 である
    // 6の倍数前後の数を使って試し割りをする
    for (unsigned i = 5; i * i <= n; i += 6) {
        if (n % i == 0) return false; // (6の倍数)-1
        if (n % (i + 2) == 0) return false; // (6の倍数)+1
    }
    return true;
}

/*signed*/int main(void) {   
    int a, b;
    cin >> a >> b;
    if (a + b == 15) puts("+");
    else if (a * b == 15) puts("*");
    else puts("x");
    return 0;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;


typedef complex<double> Point;
const double EPS = 1e-8;
typedef vector<Point> Polygon;
Point curr(const Polygon& a, int x){ return a[x]; }
Point next(const Polygon& a, int x){ return a[(x + 1) % a.size()]; }
double cross(Point a, Point b){
    return imag(conj(a) * b);
}
double area(const Polygon& P) {
    double A = 0;
    for(int i = 0; i < P.size(); i++){
        A += cross(curr(P, i), next(P, i));
    }
    return abs(A) / 2.0;
}


int main(){
    double x, y;
    Polygon P;
    while(scanf("%lf,%lf", &x, &y) != EOF){
        P.push_back(Point(x, y));
    }
    printf("%.12f\n", area(P));
    return 0;
}

Measured memory_bytes: 1244
package main

import (
	"fmt"
)

func main() {
	var A, B int
	fmt.Scan(&A, &B)

	for C := 1; C <= 3; C++ {
		if (A*B*C)%2 == 1 {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}


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

int main () {
    string S;
    cin >> S;
    int ans = 700;
    if (S[0] == 'o') {
        ans += 100;
    } 
    if (S[1] == 'o') {
        ans += 100;
    }
    if (S[2] == 'o') {
        ans += 100;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pf push_front
#define ff first
#define ss second
#define mkp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define nmbr(c) (int)(c-'0')
#define ltr(c) (int)(c-'a')
#define INF 1e18+5
#define mod 10000007
#define fast() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
template <typename T> T max(T a, T b, T c){ return max(a, max(b, c));}
template <typename T> T min(T a, T b, T c){ return min(a, min(b, c));}
ll lcm(ll a,ll b){return (a*b)/__gcd(a,b);}
inline int INT(){int x;scanf("%d",&x);return x;}
inline long long LONG(){long long x;scanf("%lld",&x);return x;}
inline double DOUBLE(){double x;scanf("%llf",&x);return x;}
inline string STRING (){string x;fast()cin>>x;return x;}





/*-------------------------------------debug--------------------------------------------------------*/
#define bug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout << endl ;}
template<typename T, typename... Args>void err(istream_iterator<string> it, T a, Args... args) {cerr << *it << " = " << a << ' ' ;err(++it, args...);}
template <typename T>ostream& operator<<(ostream& os, const vector<T>& v){os << "[";for (int i = 0; i < v.size(); ++i) {os << v[i];if (i != v.size() - 1)os << ", ";}os << "]\n";return os;}
template <typename T>ostream& operator<<(ostream& os, const set<T>& v){os << "[";for (auto it : v) {os << it;if (it != *v.rbegin())os << ", ";}os << "]\n";return os;}
template <typename T, typename S>ostream& operator<<(ostream& os, const map<T, S>& v){for (auto it : v)os << it.first << " : "<< it.second << "\n";return os;}
template <typename T, typename S>ostream& operator<<(ostream& os, const pair<T, S>& v){os << "(";os << v.first << ", "<< v.second << ")";return os;}
long long powr(long long a, long long b) {a%=mod;long long res = 1;while (b > 0) {if (b & 1)res = res * a%mod;a = a * a%mod;b >>= 1;}return res;}
/*---------------------------------------------------------------------------------------------------*/






int main(){
    //fast()
    int a,b,c;
    while(cin>>a>>b>>c){
    if(a-b==0&&a-c!=0||a-c==0&&a-b!=0||b-c==0&&b-a!=0)cout<<"Yes\n";
    else cout<<"No\n";
    }


}


Measured memory_bytes: 256
//{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a,b,c,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,n,0)
#define rrep3(i,begin,end) for(int i=(int)(begin-1),i##_end=(int)(end);i>=i##_end;--i)
#define foreach(x,a) for(auto&x:a)
using ll=long long;

class in {
  int n;
public:
  in() {}
  in(int n_) : n(n_){};
  template <class T> operator T() { T ret; cin >> ret; return ret; }
  template <class T> operator vector<T>() { vector<T> ret(n); for (int i = 0; i < n; i++) cin >> ret[i]; return ret; }
};

template <std::uint_fast64_t Mod> class modint {
  using u64 = std::uint_fast64_t;
  u64 a;
  friend ostream& operator<<(ostream& os, const modint& m);
public:
  constexpr modint(const u64 x = 0) noexcept : a(x % Mod) {}
  constexpr u64 val() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept { return modint(*this) += rhs; }
  constexpr modint operator-(const modint rhs) const noexcept { return modint(*this) -= rhs; }
  constexpr modint operator*(const modint rhs) const noexcept { return modint(*this) *= rhs; }
  constexpr modint operator/(const modint rhs) const noexcept { return modint(*this) /= rhs; }
  constexpr bool operator==(const modint rhs) const noexcept { return modint(*this).val() == rhs.val(); }
  modint &operator+=(const modint rhs) noexcept { a += rhs.a; if (a >= Mod) a -= Mod; return *this; }
  modint &operator-=(const modint rhs) noexcept { if (a < rhs.a) a += Mod; a -= rhs.a; return *this; }
  modint &operator*=(const modint rhs) noexcept { a = a * rhs.a % Mod; return *this; }
  modint &operator/=(modint rhs) noexcept { u64 exp = Mod - 2; while (exp) { if (exp % 2) *this *= rhs; rhs *= rhs; exp /= 2; } return *this; }
};
const ll mod=(ll)1e9+7;
using mint = modint<mod>;
ostream& operator<<(ostream& os, const mint& m){ return os << m.a; }
//}}}

int main(){
  string S = in();

  ll ans = 0;
  rep(i, S.size()){
    if(S[i] != S[S.size() - 1 - i]) ans++;
  }
  ans /= 2;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256