akhauriyash/Code-Regression huggingface dataset:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix

# strlist = "abcdefghijklmnopqrstuvwxyz"
S = input()

if len(S) == len(set(S)):
    ans = "yes"
else:
    ans = "no"

print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))


Measured memory_bytes: 2940
#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const long long INF = 1e9 + 7;
using namespace std;
typedef long long ll;
map<int, int> mp;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	int counter = 0;
	for (int i = 0; i < 3; i++) {
		if (s.at(i) == '1') counter++;
	}
	cout << counter << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int main()
{
	ll N, A, B;
	cin >> A >> B >> N;
	ll x = min(N, B - 1);
	cout << (A * x / B) - A * (x / B) << endl;
}

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

public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);

        int n = in.nextInt(),  m = in.nextInt(), l = in.nextInt();
        int[][] m1 = new int[n][m], m2 = new int[m][l], m3 = new int[n][l];
        for(int i = 0; i<n;i++){
            for(int j = 0; j<m;j++) m1[i][j]= in.nextInt();
        }

        for(int i = 0; i<m;i++){
            for(int j = 0; j<l;j++) m2[i][j]= in.nextInt();
        }

        for(int i = 0; i<n;i++){
            for(int j = 0; j<l;j++){
                long sum = 0;
                for(int k = 0; k < m; k++)sum += m1[i][k] * m2[k][j];
                System.out.printf("%d%s", sum, (j==l-1) ? "\n":" ");
            }
        }


    }
}


Measured memory_bytes: 73188
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var n = o.a();
  var k = o.a();
  var u = (n-1)*(n-2)/2;
  if(u < k)return -1;
  var ans = [];
  for(var i = 2; i <= n; i++){
    ans.push("1 "+i);
  }
  var l = 2, r = 3;
  while(k < u){
    u--;
    ans.push(l+" "+r);
    r++;
    if(r > n)l++, r = l+1;
  }
  console.log(ans.length);
  return ans.join("\n");
}

Measured memory_bytes: 11468
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

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

#define POS(i,j) ((i)*n+(j))

int isSymmetric(const int k,const char *board,const int n){
  int i;
  for(i=0;i<n;i++){
    int x=i;
    int y=(k+i)%n;
    int j=1;
    while(j<n && board[POS((x+j)%n,(y-j+n)%n)]==board[POS((x-j+n)%n,(y+j)%n)]){
      j++;
    }
    if(j<n){
      //printf("%d %d error\n",k,i);
      return 0;
    }
  }
  for(i=0;i<n-1;i++){
    int x=i;
    int y=(k+i+1)%n;
    int j=0;
    while(j<n && board[POS((x+j)%n,(y-j+n)%n)]==board[POS((x+1-j+n)%n,(y-1+j+n)%n)]){
      j++;
    }
    if(j<n) return 0;
  }
  return 1;
}

void run(void){
  int n;
  scanf("%d",&n);
  char board[90001];
  int i;
  for(i=0;i<n;i++) scanf("%s",board+POS(i,0));

  int ans=0;
  for(i=0;i<n;i++){
    ans+=n*isSymmetric(i,board,n);
  }
  printf("%d\n",ans);
  return;
}

int main(void){
  run();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char* argv[])
{
	int N,M;
	cin>>N>>M;
	vector<int> ab(N,0);
	int a,b;
	int i,j;
	for (i=0;i<M;i++){
		cin>>a>>b;
		if (a==1){
			ab[b-1]++;
			continue;
		}
		if (b==1){
			ab[a-1]++;
			continue;
		}
		ab[a-1]++;
		ab[b-1]++;
	}

	bool flag=true;
	for (j=0;j<N;j++){
		if (ab[j]%2!=0){
			flag=false;
			break;
		}
	}
	if (flag){
		cout<<"YES"<<endl;
	}else{
		cout<<"NO"<<endl;
	}


	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    vector<int> c(26,0);
    for(int i = 0; i < s.size(); i++){
        c[s[i]-'a']++;
        if(c[s[i]-'a'] > 1){
            cout<<"no";
            return 0;
        }
    }
    cout<<"yes";
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>

int N;
long long nCk[200005];
long long n1Ck[200005];
long long mod = (long long)1e9+7;

// a^n mod を計算する
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;
}

// a^{-1} mod を計算する
long long modinv(long long a, long long mod) {
  return modpow(a, mod - 2, mod);
}


void calc(){
  nCk[0] = 1;
  n1Ck[0] = 1;
  for (int i=1; i<=N-1; i++){
    nCk[i] = (nCk[i-1]*((N-i+1)%mod)%mod)*modinv(i, mod);
    n1Ck[i] = (n1Ck[i-1]*((N-i)%mod)%mod)*modinv(i, mod);
    nCk[i] %= mod;
    n1Ck[i] %= mod;
  }
  nCk[N] = 1;
  return;
}

int main(){
  scanf("%d",&N);
  long long K;
  scanf("%lld", &K);
  //printf("N=%d, K=%lld\n", N, K);
  calc();
  K = std::min(K, (long long)N-1);
  long long ans = 0;
  for (int i=0; i<=K; i++){
    //printf("ans += %lld*%lld\n",nCk[i], n1Ck[i]);
    ans += (nCk[i]*n1Ck[i])%mod;
    ans %= mod;
  }
  printf("%lld\n", ans);
  return 0;
}


Measured memory_bytes: 3328
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var S = ReadLine();

        var ans = 0;

        for (int i = 0; i < S.Length / 2; i++)
        {
            if (S[i] != S[S.Length - i - 1])
                ans++;
        }

        WriteLine(ans);
    }
}


Measured memory_bytes: 25944
#include<stdio.h>
#include<stdlib.h>
 
int top,S[10000];
 
void push(int x){
  S[++top]=x;
}
 
int pop(){
 return S[top--];
}
 
int main(){
  int a,b;
  char s[200];
  top=0;
   
  while(scanf("%s",s)!=EOF){
    if(s[0]=='+'){
      b=pop();
      a=pop();
      push(a+b);
    }else if(s[0]=='-'){
      b=pop();
      a=pop();
      push(a-b);
    }else if(s[0]=='*'){
      b=pop();
      a=pop();
      push(a*b);
    }else{
      push(atoi(s));
    }
  }
  printf("%d\n",pop());
  return 0;
}

Measured memory_bytes: 548
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        long n = sc.NextLong();

        Tuple<long, long>[] f = new Tuple<long,long>[n];

        for(int i= 0; i < n; i++)
        {
            long x = sc.NextLong();
            long y = sc.NextLong();
            f[i] = Tuple.Create(x - y, x + y);
        }

        long answer = long.MinValue;

        long max1 = long.MinValue;
        long min1 = long.MaxValue;
        for (int i = 0; i < n; i++)
        {
            max1 = Math.Max(max1,f[i].Item1);
            min1 = Math.Min(min1,f[i].Item1);
        }
        answer = Math.Max(answer, max1 - min1);

        long max2 = long.MinValue;
        long min2 = long.MaxValue;
        for (int i = 0; i < n; i++)
        {
            max2 = Math.Max(max2, f[i].Item2);
            min2 = Math.Min(min2, f[i].Item2);
        }
        answer = Math.Max(answer, max2 - min2);

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


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

int a[100001],f[100001];

int main(){
	int N,k;
	scanf("%d%d",&N,&k);
	for(int i=1;i<=N;++i)
		scanf("%d",&a[i]);
	for(int i=2;i<=N;++i){
		int j=i-1;
		f[i]=1<<30;
		for(int s=0;s<k&&j>0;++s,--j){
			int tmp=abs(a[j]-a[i])+f[j];
			if(tmp<f[i])f[i]=tmp;
		}
	}
	printf("%d\n",f[N]);
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
using namespace std;
const int N=100;

int main(){
    int n,p[N+1],m[N+1][N+1];

    cin>>n;

    for(int i=1;i<=n;i++)
        cin>>p[i-1]>>p[i];

    for(int i=1;i<=n;i++)
        m[i][i]=0;

    for(int l=2;l<=n;l++)
        for(int i=1;i<=n-l+1;i++){
            int j=i+l-1;
            m[i][j]=(1<<21);
            for(int k=i;k<=j-1;k++)
                m[i][j]=min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
        }

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

}

Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int N;
    cin >> N;
    vector<string> S(N);
    rep(i,N) cin >> S[i];
    map<char,int> M;
    for(int i=0;i<N;i++){
        map<char,int> m;
        for(int j=0;j<S[i].size();j++){
            m[S[i][j]]++;
            if(i==0){
                M[S[i][j]]++;
            }
        }
        for(char k='a';k<='z';k++){
            M[k]=min(M[k],m[k]);
        }
    }
    string ans = "";
    for(char k='a';k<='z';k++){
        int num = M[k];
        rep(i,num){
            ans+=k;
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

const int maxn=5e3+5;

typedef long long ll;

char s[maxn];


inline int read(){
    int x=0; bool f=0; char ch=getchar();
    while (ch<'0' || '9'<ch) f|=ch=='-', ch=getchar();
    while ('0'<=ch && ch<='9') x=x*10+ch-'0', ch=getchar();
    return f?-x:x;
}

void out(int a)///????
{
    if(a>9)
        out(a/10);
    putchar(a%10+'0');
}

int main(){
	int n;
	n=read();
	scanf("%s",s);
	int ans=0;
	for(int i=0;i<n;++i){
		for(int j=i+1;j<n;++j){
			if(s[j]!=s[i]) continue;
			if(j-i<ans||n-j<ans) continue;
			int tmp=1;
			int k=i+1;int kk=j+1;
			while(k<j&&kk<n){
				if(s[k]==s[kk]) ++tmp;
				else break;
				++k;++kk;
			}
			ans=max(ans,tmp);
		}
	}
	out(ans);
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
#define Nmax 200010
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define RFOR(i,a,b) for(long long i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<P> Graph;

int main() {
	string s;
	cin >> s;
	bool flag=false;
	int cnt=0,cnt2=0;
	if(s[0]=='A'){
		cnt=0,cnt2=0;
		FOR(i,2,s.length()-1) if(s[i]=='C') cnt++;
		REP(i,s.length()) if(s[i]>='A' && s[i]<='Z') cnt2++;
	}
	if(cnt==1 && cnt2==2) flag=true;
	if(flag) cout << "AC" << endl;
	else cout << "WA" << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

/**
 * Card Game is Fun
 * --------------------
 * JOI 11th, Fin.2
 */
public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		String[] words;

		line = br.readLine();

		int A, B;

		//??\????????????????????????
		if (line.indexOf(' ') >= 0) {
			A = parseInt(line.substring(0, line.indexOf(' ')));
			B = parseInt(line.substring(line.indexOf(' ') + 1));
		} else {
			A = parseInt(line);
			B = parseInt(br.readLine());
		}

		int[] CA = new int[A + 1];
		int[] CB = new int[B + 1];

		StringTokenizer st;
		st = new StringTokenizer(br.readLine());
		for (int i = 1; i <= A; i++) {
			CA[i] = parseInt(st.nextToken());
		}
		st = new StringTokenizer(br.readLine());
		for (int i = 1; i <= B; i++) {
			CB[i] = parseInt(st.nextToken());
		}

		int[][] dp = new int[A + 1][B + 1];
		int ans = 0;

		for (int i = 1; i <= A; i++) {
			for (int j = 1; j <= B; j++) {
				if (CA[i] == CB[j]) {
					dp[i][j] = dp[i - 1][j - 1] + 1;
				} else {
					dp[i][j] = dp[i - 1][j];
				}
				ans = Math.max(ans, dp[i][j]);
			}
		}

		System.out.println(ans);
	}
}

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

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(obj) obj.begin(), obj.end()
#define fcout cout << setprecision(10)

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

const int iINF = 1e9;
const long long llINF = 1e18;
const int MOD = 1e9 + 7;

using namespace std;

long long gcd(long long a, long long b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b;
}

int main() {
    long long A, B;
    cin >> A >> B;
    cout << lcm(A, B) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<string>
#include<set>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<functional>
using namespace std;
#define LL long long
#define MOD 100000
#define inf 1999999999
#define ALL(x) (x).begin(), (x).end()
#define LBi(x, n) lower_bound(ALL(x), n) - (x).begin()
#define ZIP(x) (x).erase(unique(ALL(x)), (x).end())
#define Pi pair<int, int>
#define Vi vector<int>

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

string s = "";
char ch[10];
int n, a, b, c, d, x, m[5];

int main() {
	cin >> a >> b;
	cout << (a + b + 1) / 2 << endl;
	return 0;
}


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

const int N = (1e5) + 5;
pair<int, int> a[N];

int main() { // claudio van
  int n, m; scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &a[i].first, &a[i].second);
  }
  sort(a, a + n);
  ll sum = 0;
  for (int i = 0; i < n; ++i) {
    if (m - a[i].second >= 0) {
      sum += 1LL * a[i].first * a[i].second;
      m -= a[i].second; 
    } else {
      sum += 1LL * a[i].first * m;
      m = 0;
    }
  }
  printf("%lld\n", sum);
  return 0;
}

Measured memory_bytes: 1024
fn main() {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    let v: Vec<i32> = buf
        .trim()
        .split_whitespace()
        .map(|e| e.parse().unwrap())
        .collect();
    println!("{}", v[0] - v[1] + 1);
}


Measured memory_bytes: 4352
#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,string>;

int main() {
    int a,b,m; cin >> a >> b >> m;
    int rmin = INT32_MAX;
    int lmin = INT32_MAX; 
    int r[a],l[b]; 
    rep(i,a) {
        cin >> r[i];
        rmin = min(rmin,r[i]);
    }
    rep(i,b) {
        cin >> l[i];
        lmin = min(lmin,l[i]);
    } 

    int mi = rmin + lmin; 
    rep(i,m) {
        int x,y,c; cin >> x >> y >> c;
        --x; --y;
        mi = min(mi,r[x]+l[y]-c);
    }
    cout << mi << endl;
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	private static Scanner sc=new Scanner(System.in);
	private static int n=sc.nextInt();
	private static int[] a=new int[n];
	public static void main(String[] args){
		int count=1;
		int ans;
		for(int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		quicksort(a,0,n-1);
		for(int i=0;i<n-1;i++){
			if(a[i]<a[i+1]) count++;
		}
		if(count%2==0) ans=count-1;
		else ans=count;
		System.out.println(ans);
	}
	private static void quicksort(int[] a,int left,int right){
		int s,i,j;
		if(left<right){
			s=a[(left+right)/2];
			i=left-1; j=right+1;
			while(true){
				while(a[++i]<s);
				while(a[--j]>s);
				if(i>=j) break;
				int t=a[i];
				a[i]=a[j];
				a[j]=t;
			}
			quicksort(a,left,i-1);
			quicksort(a,j+1,right);
		}
	}
}

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

#define pb push_back

using ll=long long;
using vll=vector<ll>;
using vvll=vector<vll>;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vpii=vector<pii>;
using vvpii=vector<vpii>;

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

    int n;
    cin >> n;
    vi xs(n);
    for(auto& xi: xs)
        cin >> xi;
    vi sorted = xs;
    sort(sorted.begin(), sorted.end());
    for (int i=0; i<n; ++i) {
        if (xs[i] != sorted.back())
            cout << sorted.back() << "\n";
        else
            cout << sorted[n-2] << "\n";
    }
}


Measured memory_bytes: 3200
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

int a[3];
int main() {
	cin >> a[0] >> a[1] >> a[2];
	sort(a, a+3);
	cout << 10*a[2] + a[0] + a[1];
	return 0;
}


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

int main() {
int N;
  cin >> N;
  int a = N%1000;
  if(a != 0){
 cout << 1000-a << endl;
}
else{
cout << 0 << endl;
}
}



Measured memory_bytes: 3632
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <iomanip>
#include <bitset>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>

using namespace std;

int main() {
  string a;
  cin >> a;
  sort(a.begin(), a.end());
  if (a[0] == a[1] && a[2] == a[3] && a[0] != a[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string to_string(const string& s) {
	return '"' + s + '"';
}
string to_string(const bool b) {
	return (b ? "true" : "false");
}
string to_string(const char* s) {
	return to_string((string)s);
}
string to_string(const char c) {
	string s = "'";
	s += c;
	s += "'";
	return s;
}
template<class T, class U>
string to_string(const pair<T, U>& p) {
	string s = "(";
	s += to_string(p.first);
	s += ", ";
	s += to_string(p.second);
	s += ")";
	return s;
}
template<class T>
string to_string(const T& a) {
	bool first = true;
	string s = "{";
	for (const auto& x : a) {
		if(!first){
			s += ", ";
		}
		first = false;
		s += to_string(x);
	}
	s += "}";
	return s;
}
void debug_out() {cerr << '\n';}
template<class Head, class... Tail>
void debug_out(Head head, Tail... tail) {
	cerr << ' ' << to_string(head);
	debug_out(tail...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "] = ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const int inf = 1e9 + 100;
const ll inf64 = 7e18l;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(20);
	ll n;
	cin >> n;
	ll answer = inf64;
	for (ll i = 1; i * i <= n; ++i) {
		if (n % i == 0) {
			answer = min(answer, i + n / i);
		}
	}
	cout << answer - 2 << '\n';
	
 	return 0;
}


Measured memory_bytes: 256
// 5/10 リアルタイム参加
#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>;
using Graph = vector<vector<int>>;
// #include <math.h>

static const double pi = 3.141592653589793;

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

    double rA = 2.0 * pi * ((double)H + (double)M / 60.0) / 12.0;
    double rB = 2.0 * pi * (double)M / 60.0;

    double ax, ay;
    double bx, by;

    ax = A * cos(rA);
    ay = A * sin(rA);

    bx = B * cos(rB);
    by = B * sin(rB);

    double ans = pow(ax - bx, 2.0);
    ans += pow(ay - by, 2.0);
    ans = sqrt(ans);

    cout << fixed << setprecision(20) << ans << endl;
}

Measured memory_bytes: 4064
import java.io.*;
 
class Main
{
  public static void main(String args[])
  {
    int num;
    String buf;
    try {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      buf = br.readLine();
      num = Integer.parseInt(buf);
      System.out.println(num * num * num);
    } catch(Exception e) {}
  }
}


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

int main(){
    int A,B,C;
    cin >> A >> B >> C;
    long long X,Y;
    cin >> X >> Y;

    int total=0,a=0,b=0,c=0;

    if((A + B) > 2*C ){
        if(X >Y){
            if((X - Y)*2 *C < (X - Y)*A){
               c = 2 *  X;
               total = c * C;
            }else{
                a = X - Y;
                c = 2 * Y;
                total = A * a + C * c;
            }
        
        }else{
            if((Y - X)*2*C < (Y - X)*B){
                c = 2 * Y;
                total = c * C;
            }else{
                b = Y - X;
                c = 2 * X;
                total = B * b + C * c;
            }
        }
    }else{
        a = X;
        b = Y;
        total = A * a + B * b;
    }

    cout << total << endl;
}

Measured memory_bytes: 256
<?php
list($n,$m) = explode(" ",trim(fgets(STDIN)));

$i = 1;
while($i <= $n){
$w[$i] = array_fill(1,$n,3141592);
++$i;
}

$i = 0;
while($i < $m){
list($a[$i],$b[$i],$c[$i]) = explode(" ",trim(fgets(STDIN)));
$w[$a[$i]][$b[$i]] = $c[$i];
$w[$b[$i]][$a[$i]] = $c[$i];
++$i;
}

$i = 1;
while($i <= $n){
$s = 1;
while($s <= $n){
$e = 1;
while($e <= $n){
$w[$s][$e] = min($w[$s][$e] ,$w[$s][$i] + $w[$i][$e]);
++$e;
}
++$s;
}
++$i;
}

$ans = 0;
$i = 0;
while($i < $m){
if($c[$i] > $w[$a[$i]][$b[$i]]){
++$ans;
}
++$i;
}
echo $ans;

Measured memory_bytes: 5620
#[allow(unused_imports)]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input!(n: usize, mut l: [isize; n]);
    let mut count = 0;
    l.sort_unstable();

    for i in 0..n {
        for j in i + 1..n {
            let a1 = l[i] - l[j];
            let a2 = l[j] - l[i];
            let a3 = l[i] + l[j];
            for k in j + 1..n {
                if a1 < l[k] && a2 < l[k] && l[k] < a3 {
                    count += 1;
                }
            }
        }
    }

    println!("{}", count);
}


Measured memory_bytes: 2208
#include<bits/stdc++.h>
using namespace std;
int main(void){
  long n;
  cin>>n;
  long arr[n],x=0;
  for(int i=0;i<n;i++){
    cin>>arr[i];
    x^=arr[i];
  }
  if(!x) cout<<"Yes";
  else cout<<"No";
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()

typedef long long lint;

using namespace std;

int main(){
  int N,K;
  cin>>N>>K;
  int A[N];
  REP(i,N)cin>>A[i];
  REP(i,N-K){
    cout<<(A[i]<A[K+i]?"Yes":"No")<<endl;
  }
  return 0;
}


Measured memory_bytes: 4368
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<climits>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<numeric>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i = m; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a)  (a).rbegin(),(a).rend()
#define PI 3.14159265359
#define MOD 1000000007
typedef long long LL;

template<class T> inline void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> inline void chmin(T& a, T b) { if (a > b) { a = b; } }
template<class T> void print_vector(vector<T> vec) {
	cout << "[ ";
	for (int i = 0; i < vec.size(); i++) {
		cout << vec[i] << " ";
	}
	cout << "]" << endl;
}
template<class T> void print_pair_vector(vector<pair<T, T> > vec) {
	cout << "[ ";
	for (int i = 0; i < vec.size(); i++) {
		cout << "(" << vec[i].first << "," << vec[i].second << ") ";
	}
	cout << "]" << endl;
}

const int INF = 1 << 30;

int main(void) {
	LL N;
	cin >> N;
	vector<LL> a(N);//帽子
	rep(i, N) cin >> a[i];
	
	vector<LL> XOR_a(N);
	rep(i, N) XOR_a[i] = a[i]^a[i];

	LL sum1 = 0;
	rep(i, N) sum1 ^= a[i];

	LL sum2 = 0;
	rep(i, N) sum2 ^= XOR_a[i];

	bool is_exist = sum1 == sum2;
	if (is_exist) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pll pair<long long, long long>
#define f first
#define s second
#define debug cout<<"here\n" 
#define MOD 1000000007

const int MAXN = 2e5 +15;
 
using namespace std;

ll modexp(ll a, ll p, ll mod){
	if(p == 0) return 1;
	ll ans = modexp(a,p/2,mod);
	ans = (ans*ans)%mod;
	if(p%2) return (a*ans)%mod;
	else return ans;
}

void solve(){	
	int n; cin>>n;
	ll s = 0, t=0;
	for(int i=0; i<n; i++){
		ll y; cin>>y;
		s += y;
		s %= MOD;
		t += (y*y)%MOD;
		t %= MOD;
	}
	cout<<(((s*s)%MOD-t+MOD)%MOD*modexp(2,MOD-2,MOD))%MOD;
}
 
int main(){
	ios_base::sync_with_stdio(false);
	cout.tie(0); cin.tie(0);	
	cout<<fixed<<setprecision(12);

	int t =1; //cin>>t;
	for(int i=1; i<= t; i++){
		solve();
		cout<<"\n";
	}
	
	return 0;
}

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

int main() {
  int N;
  cin >> N;
  map<string, int> mp;
  rep(i, N) {
    string s;
    cin >> s;
    mp[s]++;
  }
  
  cout << "AC x " << mp["AC"] << endl;
  cout << "WA x " << mp["WA"] << endl;
  cout << "TLE x " << mp["TLE"] << endl;
  cout << "RE x " << mp["RE"];
}



Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m; i<n; i++)
#define ci(n) cin << n
#define co(n) cout << n << endl
using namespace std;

int main(){
  char a, b;
  cin >> a;
  b=a+1;
  co(b);
  return 0;
}


Measured memory_bytes: 256
import itertools
l=['M','A','R','C','H']
c = itertools.combinations(l, 3)
MARCH = {'M':0,'A':0,'R':0,'C':0,'H':0}
N=int(input())
for i in range(N):
  s=str(input())
  if s[0]=='M':
    MARCH['M']+=1
  elif s[0]=='A':
    MARCH['A']+=1
  elif s[0]=='R':
    MARCH['R']+=1
  elif s[0]=='C':
    MARCH['C']+=1
  elif s[0]=='H':
    MARCH['H']+=1
ans=0
for i in c:
  ans+=MARCH[i[0]]*MARCH[i[1]]*MARCH[i[2]]
print(ans)

Measured memory_bytes: 9120
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define pb push_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef multiset<ll> S;
typedef priority_queue<ll> PQ;
typedef priority_queue<P,vector<P>,greater<P>> SPQ;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<endl;}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<endl;}
template<class T> void outvp(T v){rep(i,v.size())outp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
template<class T> void outvv(T v){rep(i,v.size()){rep(j,v[i].size()){if(j)cout<<' ';cout<<v[i][j];}cout<<endl;}}
ll modpow(ll a,ll b){
    a%=mod;
    if(b==0)return 1;
    if(b&1)return a*modpow(a,b-1)%mod;
    ll k=modpow(a,b/2);
    return k*k%mod;
}
vi fac;
ll modcom(ll n,ll r){
    if(n<r||r<0)return 0;
    return fac[n]*modpow(fac[r],mod-2)%mod*modpow(fac[n-r],mod-2)%mod;
}
int main(){
    ll a,b;cin>>a>>b;
    ll n=a+b;
    vi white(n),black(n);
    fac.resize(n+2);
    rep(i,n+2){
        if(i)fac[i]=fac[i-1]*i%mod;
        else fac[i]=1;
    }
    rep(i,n){
        if(i)out(((1+white[i-1]-black[i-1])%mod+mod)%mod*modpow(2,mod-2)%mod);
        else out(modpow(2,mod-2));
        if(i)white[i]=white[i-1];
        white[i]+=modpow(modpow(2,i+1),mod-2)%mod*modcom(i,b-1)%mod;
        if(i)black[i]=black[i-1];
        black[i]+=modpow(modpow(2,i+1),mod-2)%mod*modcom(i,a-1)%mod;
    }
}

Measured memory_bytes: 6912
//made by Sert
#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 34;
const int N = (int)1e6 + 34;

typedef long long ll;

void solve() {
    int n;
    string s;
    cin >> n >> s;
    int ans = n;
    int sumW = 0, sumE = 0;
    for (int i = 0; i < n; i++) if (s[i] == 'E') sumE++;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'E') sumE--;
        int cur = sumW + sumE;
        ans = min(ans, cur);
        if (s[i] == 'W') sumW++;
    }

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

int main() {
#ifdef SERT
    freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    solve();
    solve();
    //solve();
    //solve();
#endif
    solve();
    return 0;
}

Measured memory_bytes: 900
#include <bits/stdc++.h> 
using namespace std; 
void pairsort(int a[], int b[], int n) 
{ 
    pair<int, int> pairt[n]; 
  
    // Storing the respective array 
    // elements in pairs. 
    for (int i = 0; i < n; i++)  
    { 
        pairt[i].first = a[i]; 
        pairt[i].second = b[i]; 
    } 
  
    // Sorting the pair array. 
    sort(pairt, pairt + n); 
      
    // Modifying original arrays 
    for (int i = 0; i < n; i++)  
    { 
        a[i] = pairt[i].first; 
        b[i] = pairt[i].second; 
    } 
} 
int main()
{
    int n,i,j=0,ans=1,count=0;
    scanf("%d",&n);
    int a[n],b[n];
    for(i=0;i<n;i++)
    {
    scanf("%d",&a[i]);
    b[i]=a[i];
    }
    sort(a,a+n);
    sort(b,b+n);
    while(ans)
    {
        for(i=0;i<n;i++)
        {
            if(a[i]!=0)
            {
                j=i;
                break;
            }
        }
        for(i=j+1;i<n;i++)
        {
            a[i]=a[i]%a[j];
        }
        for(i=0;i<n;i++)
        {
            if(a[i]==0)
            count++;
        }
        if(count==n-1)
        {
            ans=0;
            printf("%d",a[j]);
            break;
        }
        pairsort(a, b, n);
        count=0;
    }
    return 0;
}


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

    expo[1]=1;
    for(int b=2;b<=x;b++){
        int v=b*b;
        while(v<=x){
            expo[v]=1;
            v*=b;
        }
    }
    for(int i=x;i>=1;i--) {
        if(expo[i]){
            cout << i << endl;
            return 0;
        }
    }
}




Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll MOD = 1e9+7;
//LLONG_MIN

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

int main(void){
	bool ok=true;
	ll n,m,n2,m2,g,ans;
	string s,t;
	cin>>n>>m;
	cin>>s>>t;
	g=gcd(n,m);
	n2=n/g;
	m2=m/g;
	ans=g*n2*m2;
	rep(i,n){
		if(n2*i>=n)break;
		if(s[n2*i]!=t[m2*i])ok=false;
	}
	cout<<(ok?ans:-1)<<endl;
	return 0;
}

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

int main(){
  double x1,x2,x3,x4,y1,y2,y3,y4;
  while(1){
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
    if(cin.eof())break;
    if(fabs((x2 - x1)*(x4 - x3)+(y2 - y1)*(y4 - y3)) < 10e-12)cout << "YES" << endl;
    else cout << "NO" << endl;
  }
  return 0; 
}

Measured memory_bytes: 1216
#include <iostream>
#include <string>
using namespace std;
int main(){
  string s,t;
  int i,n,result=0;
  cin >> s;
  cin >> t;
  n = s.size();
  for(i=0;i<n;i++){
    if(s[i]!=t[i]) result++;
  }
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 3912
#include <stdio.h>
#define swap(type, x, y)  do{ type t = x; x = y; y = t; }while(0)

int main(){
  long a[4] = {0}, n;
  for(int i=1; i<=3; i++)  scanf("%ld", a+i);
  scanf("%ld", &n);
  
  for(int i=1; i<3; i++)
    for(int j=i+1; j<=3; j++)
      if(a[i] < a[j])
	swap(long, a[i], a[j]);
  long ans = 0;
  for(long i=0; i<=n/a[1]; i++){
    for(long j=0; j<=(n-a[1]*i)/a[2]; j++){
      if((n-a[1]*i-a[2]*j) % a[3] == 0)
	ans++;
    }
  }
  printf("%ld\n", ans);
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll n;
    cin >> n;

    ll ans = 0;
    rep(i, n) {
        ll a;
        cin >> a;
        while(a%2 == 0) {
            a /= 2;
            ans++;
        }
    }
    
    out(ans);
    re0;
}

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

int main(void){
    double x1,y1,x2,y2;
    cin >> x1 >> y1;
    cin >> x2 >> y2;
    double d = pow(x1-x2,2) + pow(y1-y2,2);
    cout << fixed << setprecision(5) << sqrt(d);
    cout << d << endl;
}


Measured memory_bytes: 3272
#include<iostream>
    #include<string>
    using namespace std;
    int main(){
        string s;
        cin >> s;
        int n=s.size();
        int count=0;
        for(int i=0;i<n/2;i++){
            if(s[i]!=s[n-i-1]){count++;}
        };
        cout<< count;
        return 0;
    }

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
#define		CH		ch=(getchar())

inline		int		IN(){
	int x=0,f=1;char ch;
	for (CH;ch>'9'||ch<'0';CH) if (ch=='-') f=-1;
	for (;ch>='0'&&ch<='9';CH) (x*=10)+=ch-'0';
	return x*f;
}

int i,j,k,l,n,m,x,y,X,Y,a,b;


int main(){
	scanf("%d%d%d",&x,&a,&b);
	X=fabs(x-a);
	Y=fabs(x-b);
	if (X>Y) puts("B");
	else puts("A"); 
}


Measured memory_bytes: 128
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
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;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
struct UnionFind{
    vector<int> data;
    UnionFind(int size) : data(size, -1) {}
    bool unionSet(int x,int y){
        x=root(x);y=root(y);
        if(x==y)return 0;
        if(data[y]<data[x])swap(x,y);
        data[x]+=data[y],data[y]=x;
        return 1;
    }
    bool findSet(int x,int y){
        return root(x)==root(y);
    }
    int root(int x){
        return data[x]<0 ? x : data[x]=root(data[x]);
    }
    int size(int x){
        return -data[root(x)];
    }
};
int main(){
	int n,m;
	cin>>n>>m;
	vi in(n);rep(i,n)cin>>in[i];
	UnionFind uf(n);
	rep(i,m){
		int a,b;cin>>a>>b;
		uf.unionSet(a-1,b-1);
	}
	int co=0;
	rep(i,n)if(uf.findSet(i,in[i]-1))co++;
	cout<<co<<endl;
}










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

void Main()
{
    int x;
    cin >> x;
    if(x < 600) cout << 8 << endl;
    else if(x < 800) cout << 7 << endl;
    else if(x < 1000) cout << 6 << endl;
    else if(x < 1200) cout << 5 << endl;
    else if(x < 1400) cout << 4 << endl;
    else if(x < 1600) cout << 3 << endl;
    else if(x < 1800) cout << 2 << endl;
    else if(x < 2000) cout << 1 << endl;
}

int main(int argc, char **argv)
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    Main();
    return 0;
}


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

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define FOR(i, a, b) for (int i = a; i <= (int)(b); i++)
#define FORD(i, a, b) for (int i = a; i >= (int)(b); i--)

#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))
using Lint = long long;
#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法

#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

#define PB push_back
#define MP make_pair
using P=pair<int, int>;
using V=vector<int>;
using M=map<int, int>;
using S=set<int>;

#define COUT(x) cout << (x) << endl
#define SCOUT(x) cout << (x) << " "

#define DUMP(x) cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
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 (b < a){a = b;return 1;}return 0;}
/* vector<T>のイテレータはvector<T>::iterator型
vector<int>::iterator it = vc.begin();  // begin()はvectorの最初の要素を指すイテレータを返す。
vector<int>::iterator endIt = vc.end(); // end()はvectorの終端位置を指すイテレータを返す。
while (it != endIt)
{
  cout << *it << '\n'; // イテレータの指す要素は、ポインタのように*演算子でアクセスします。
  it++;                // インクリメントすることで次の要素を指します。
}
}*/
int main()
{
  
  int a,b,c,d,e,rel;
  cin >>a>>b>>c>>d>>e;
  if(a==0)rel=1;
  if(b==0)rel=2;
  if(c==0)rel=3;
  if(d==0)rel=4;
  if(e==0)rel=5;
  COUT(rel); 
}

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

import sys
import math
import pprint

sys.setrecursionlimit(10 ** 6)

class Logger:
	def __init__(self, debug):
		self.debug = debug
	def print(self, *args):
		if self.debug:
			pprint.pprint(args)



def main():
	log = Logger(0)
	n = int(sys.stdin.readline())
	a = [1]*n
	if n == 1:
		print(1)
		exit()
	for i in range(2, n+1):
		for j in range(i, n+1, i):
			a[j-1] += 1
	log.print(a)
	ans = 0
	for i in range(n):
		ans += a[i] * (i+1)
	print(ans)




main()

Measured memory_bytes: 153272
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
int n; 
inline void read(int &x)
{
	int f;char c;
	for (f=1,c=getchar();c<'0'||c>'9';c=getchar()) if(c=='-') f=-1;
	for (x=0;c<='9'&&c>='0';c=getchar()) x=x*10+(c&15);x*=f;
}
inline int mn(int _x,int _y)
{
	return _x<_y?_x:_y;
}
inline int mx(int _x,int _y)
{
	return _x>_y?_x:_y;
}
inline int ab(int _x)
{
	if(_x<0) return -_x;
	else return _x;
}
int main()
{
	read(n);
	printf("%d\n",(n-1)/2+1);
	return 0;
}



Measured memory_bytes: 256
#include <cstdio>
#include <cstring>

int n,k,m;
int prev[10001],next[10001];
bool used[10001];
int main(void){
	while(1){
		scanf("%d %d %d",&n,&k,&m);
		if(n+m+k==0)break;
		for(int i=0;i<n;i++){
			prev[i]=(i+n-1)%n;
			next[i]=(i+1)%n;
		}
		int now=m-1;
		next[prev[now]]=next[now];
		prev[next[now]]=prev[now];
		for(int i=0;i<n-1;i++){
			for(int j=0;j<k;j++){
				now=next[now];
			}
			next[prev[now]]=next[now];
			prev[next[now]]=prev[now];
			//printf("%d\n",now);
		}
		printf("%d\n",next[now]+1);
	}
	return 0;
}

Measured memory_bytes: 1108
#include <bits/stdc++.h>
#pragma GCC optimize("O3")  
#define pb push_back
#define F first
#define S second
using ll = long long;
using namespace std;



void solve(){
	  string s;
	  string r;
	  cin>>s>>r;
	  int cnt=0;
	  for(int i=0;i<s.size();i++){
	  	if(r[i]!=s[i]) cnt++;
	  }
	  cout<<cnt<<'\n';
	
	






	
}


int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}






Measured memory_bytes: 3764
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))

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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	ll a, b;
	cin >> a >> b;
	vector<ll> num(50, 0LL);
	rep(i, 45){
		ll cur = (b / (1LL << (i + 1))) * (1LL << i) + max(0LL, (b % ((1LL << (i + 1))) - (1LL << i)) + 1) * ((b / (1LL << i) ? 1LL : 0));
		num[i] += cur;
	}
	ll ans = 0;
	rep(i, 45){
		int f = 1;
		if(!num[i]) f = 0;
		ll cur = ((a - 1) / (1LL << (i + 1))) * (1LL << i) + max(0LL, ((a - 1) % ((1LL << (i + 1))) - (1LL << i)) + 1) * (((a - 1) / (1LL << i) ? 1LL : 0));
		num[i] -= cur;
		if(f && (num[i] & 1)) ans |= (1LL << i);
	}
	cout << ans << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


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

lines = []
for _ in range(M):
	lines.append(list(map(lambda x: int(x) - 1, input().split())))

def root(x):
	if par[x] == x:
		return x
	
	par[x] = root(par[x])
	return par[x]

def unite(x, y):
	rx = root(x)
	ry = root(y)
	if rx != ry:
		par[rx] = ry

def same(x, y):
	rx = root(x)
	ry = root(y)
	return rx == ry


ans = 0

for i in range(M):
	par = [x for x in range(N)]
	
	for j in range(M):
		if i != j:
			unite(lines[j][0], lines[j][1])
	
	flag = True
	for j in range(1, N):
		if not same(0, j):
			flag = False
	if not flag:
		ans += 1

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include<iostream>
using namespace std;
 
int main() {
  int x,a,b;
  cin >> x >> a >> b;
  b = b-a;
  if(b <= 0){
    cout << "delicious"<<endl;
  }else  if(x >=b){
    cout << "safe"<<endl;
  }else{
    cout << "dangerous"<<endl;
  }
 
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using Int = int64_t;
using UInt = uint64_t;
using C = std::complex<double>;
#define rep(i, n) for(Int i = 0; i < (Int)(n); ++i)
#define guard(x) if( not (x) ) continue;
#ifndef LOCAL_
#define fprintf if( false ) fprintf
#endif

int main() {
   Int n;
   std::cin >> n;
   std::string ss[312];
   rep(i,n) {
      std::cin >> ss[i];
   }
   Int res = 0;
   for(Int i = 0; i < n; ++i) {
      bool flag = true;
      rep(x,n) {
         rep(y,n) {
            if( ss[(x+i)%n][y] != ss[(y+i)%n][x] ) {
               flag = false;
            }
         }
      }
      if( flag ) {
         res += n;
      }
   }
   printf("%ld\n", res);
}



Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
using namespace std;

string s;

int main() {
    ios_base::sync_with_stdio(0);
    int n;
    cin >> n;
    cin >> s;
    int curr = 0;
    string ans = "";
    for (int i = 0; i < s.length(); i++) {
    	if (s[i] == '(') {
    		curr++;
    		ans += '(';
		} else {
			ans += ')';
			curr--;
			if (curr == -1) {
				curr = 0;
				ans = '(' + ans;
			}
		}
	}
	if (curr != 0) {
	    for (int i = 0; i < curr; i++) {
	        ans = ans + ')';
	    }
	}
	cout << ans;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#pragma GCC optimize("O3")
#define MOD 1000000007
#define pb push_back
#define fi first
#define se second
#define fr front()
#define ba back()
#define tp top()
#define mem(x,n) memset(x,n,sizeof(x));
#define sz(x) (int)((x).size())
#define all(x) (x).begin(),(x).end()
#define foreach(it,l) for(auto it=l.begin();it!=l.end();it++)
#define pnl printf("\n")
#define len(x) x.length()
 
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
const int inf=(1<<30);
const LL llinf=(1ll<<60);
const double eps=(1e-10);
//const double pi=2*acos(0.0);
//const double GOLD=((1+sqrt(5))/2);
const int xx[8]={1,0,-1,0,1,-1,1,-1};
const int yy[8]={0,1,0,-1,-1,1,1,-1};
 
/* \( ·w·)~ Clapie ~(·w· )/ */
 
int H,W;
char input[1005][1005];
LL arr[1005][1005];

int main(){
	scanf("%d%d",&H,&W);
	getchar();
	for(int i=0;i<H;i++){
		scanf("%s",input[i]);
	}
	
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(input[i][j]!='.') arr[i][j]=0;
			else if(i==0&&j==0) arr[i][j]=1;
			else if(i==0) arr[i][j]=arr[i][j-1]%MOD;
			else if(j==0) arr[i][j]=arr[i-1][j]%MOD;
			else arr[i][j]=(arr[i-1][j]+arr[i][j-1])%MOD;
		}
	}
	
	printf("%lld\n",arr[H-1][W-1]%MOD);
}

Measured memory_bytes: 9088