akhauriyash/Code-Regression huggingface dataset:
# AOJ 1044: CamelCase
# Python3 2018.7.6 bal4u

while True:
	n, t = input().split()
	if t == 'X': break
	ans, n = '', list(n)
	if t == 'U':
		ans += n.pop(0).upper()
		while n != []:
			while n != [] and n[0] != '_': ans += n.pop(0)
			if len(n) > 1 and n[0] == '_':
				del n[0]
				ans += n.pop(0).upper()
	elif t == 'L':
		ans += n.pop(0).lower()
		while n != []:
			while n != [] and n[0] != '_': ans += n.pop(0)
			if len(n) > 1 and n[0] == '_':
				del n[0]
				ans += n.pop(0).upper()
	else:
		ans += n.pop(0).lower()
		while n != []:
			while n != [] and n[0].isupper() == False: ans += n.pop(0)
			if n != [] and n[0].isupper(): ans += '_' + n.pop(0).lower()
	print(ans)




Measured memory_bytes: 5564
#include<iostream>
#include<algorithm>

typedef unsigned long long ULL;
typedef long long LL;

using namespace std;

int main(){
    int a,b;
    int temp;

    cin >> a >> b;
    if( (a + b ) % 2 == 0 ){
        cout << ( a + b ) / 2 << endl;
    }else{
        cout << "IMPOSSIBLE" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class Main {

	public static void main(String[] args) {
		Task task = new Task();
		task.solve();
	}

	public static class Task {
		static final long MOD = (long) 1e9 + 7;

		public void solve() {
			Scan sc = new Scan();
			char[] carr = sc.scanString().toCharArray();
			int n = carr.length;
			int[] as = new int[n];
			long res = 0;
			for (int i = 0; i < n; ++i) {
				char curr = carr[i];
				if (curr == 'A') {
					int got = 1;
					got += (i > 0 ? as[i - 1] : 0);
					as[i] = got;
				} else if (curr == 'C') {
					if (i > 0 && carr[i - 1] == 'B') {
						if (i > 1) {
							as[i] = as[i - 2];
							res += as[i];
						}
					}
				}
			}
			System.out.println(res);
		}
	}

	public static class Scan {
		private byte[] buf = new byte[1024];
		private int index;
		private InputStream in;
		private int total;

		public Scan() {
			in = System.in;
		}

		public int scan() {
			if (total < 0)
				throw new InputMismatchException();
			if (index >= total) {
				index = 0;
				try {
					total = in.read(buf);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				if (total <= 0)
					return -1;
			}
			return buf[index++];
		}

		public long scanLong() {
			long integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public double scanDouble() throws IOException {
			double doub = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doub *= 10;
					doub += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doub += (n - '0') * temp;
						n = scan();
					} else
						throw new InputMismatchException();
				}
			}
			return doub * neg;
		}

		public String scanString() {
			StringBuilder sb = new StringBuilder();
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			while (!isWhiteSpace(n)) {
				sb.append((char) n);
				n = scan();
			}
			return sb.toString();
		}

		public char scanChar() {
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			return (char) n;
		}

		private boolean isWhiteSpace(int n) {
			if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
				return true;
			return false;
		}
	}
}


Measured memory_bytes: 35168
n = int(input())
N = str(n)
num = len(N)
ans = 0
if num == 1:
    ans += n
elif num == 2:
    ans += 9
elif num == 3:
    ans += 9
    ans += (n-100+1)
elif num == 4:
    ans += 9
    ans += 900
elif num == 5:
    ans += 909
    ans += (n-10000+1)
elif num == 6:
    ans += 90909
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}


vector<int> divisor(int n){
    vector<int> ret;
    for(int i=1;i*i<=n;i++){
        if(n%i==0){
            ret.PB(i);
            if(i*i!=n) ret.PB(n/i);
        }
    }

    sort(all(ret));

    return ret;
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(20);

    int n;
    cin>>n;

    
    
    /*
    FOR(k,2,n+1){
        int m=n;
        while(m>1){
            if(m%k==0) m=m/k;
            else m=m-k;
            //cout<<m<<endl;
        }
        if(m==1){
            cout<<k<<endl;
        }
    }
    */
    
    
    

    set<int> st;
    st.insert(2);
    if(n%3==1) st.insert(3);
    st.insert(n);
    if(n>2)st.insert(n-1);

    vi d = divisor(n-1);
    for(int i:d){
        if(i>1)st.insert(i);
    }

    FOR(i,2,n){
        if(i*i>n) break;
        int m=n;
        while(m%i==0) m/=i;
        if(m==1) st.insert(i);
    }

    //cout<<st.size()<<endl;
    //for(int i:st)cout<<i<<endl;
    
    vi di = divisor(n);
    for(int i:di){
        if(i==1) continue;
        int m=n;
        while(m%i==0) m/=i;
        if(m%i==1) st.insert(i);
    }

    cout<<st.size()<<endl;


}

Measured memory_bytes: 384
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
    char a[4];
    int book[3];
    cin>>a;
    for(int i=0;i<3;i++) book[i]=0;
    if(strlen(a)==3)
    {
        for(int i=0;i<3;i++)
            {if(a[i]=='a') book[0]++;
            if(a[i]=='b') book[1]++;
            if(a[i]=='c') book[2]++;}
        if(book[0]==1&&book[1]==1&&book[2]==1)
            cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
        else cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric> // accumulate(v.begin(), v.end(), 0)

using namespace std;
#define ll long long

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i=0; i<N; i++)
    cin >> A[i];
  cout << accumulate(A.begin(), A.end(), 0) - N << endl;
  return 0;
}


Measured memory_bytes: 256
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return

MOD = 10**9 + 7

def main():
    N, K = [int(n) for n in input().split()]
    A = [int(n) for n in input().split()]
    # 自分未満の数を数える配列を作りたい
    A_und = [0]*N
    for i in range(N):
        for j in range(N):
            if A[i] > A[j]:
                A_und[i] += 1
    # まず自分の中のてんとうを数える
    ans = 0
    for i in range(N):
        for j in range(i+1,N):
            if A[i] > A[j]:
                ans += 1
    ans *= K
    # 最初の列のnはKの回数だけn-1回必ず転倒する次はK-1回,,,
    N_rev = sum(A_und)
    K_time = 0 if K == 1 else max((K-1)*K//2,1)
    ans += N_rev*K_time

    print(ans % MOD)



if __name__ == "__main__":
    main()


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define ll long long
using namespace std;
  
int main() {
  int W,H,N; cin >> W >> H >> N;
  vector<vector<bool>> black(100,vector<bool>(100,false));
  
  int ans =0;
  for (int i =0; i<N; i++) {
    int x,y,a; cin >> x >> y >> a;
    for (int j =0; j<H; j++) {
      for (int k =0; k<W; k++) {
        if (a == 1 && k < x) black[j][k] = true;
        if (a == 2 && k >= x) black[j][k] = true;
        if (a == 3 && j < y) black[j][k] = true;
        if (a == 4 && j >= y) black[j][k] = true;
      }
    }
  }
  
  for (int i =0; i<H; i++) {
    for (int j =0; j<W; j++) {
      if (black[i][j] == false) ans++;
    }
  }
                            
  cout << ans << endl;
}

Measured memory_bytes: 3600
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>

using namespace std;

const int T = 86400;
const double EPS = 1e-8;
const int N = 3;

int n;
double m;
double data[T];

bool check(double d){
  double tmp[N];
  double sum = m;
  for(int j=0;j<N;j++){
    for(int i=0;i<T;i++){
      sum -= data[i];
      sum = min(sum + d, m);
      if(sum < 0.0 - EPS) return false;
    }
    tmp[j] = sum;
  }
  if(tmp[N-2] - EPS < tmp[N-1]) return true;
  return false;
}

main(){
  while(cin >> n >> m && n){
    fill(data, data+T, 0.0);
    for(int i=0;i<n;i++){
      int s, t;
      double r;
      cin >> s >> t >> r;
      for(int j=s;j<t;j++) data[j] = r;
    }
    double l = 0.0;
    double r = 1e8;
    while(abs(l-r) >= EPS){
      double mid = (l + r) / 2.0;
      if(check(mid)) r = mid;
      else l = mid;
    }
    printf("%.7f\n", l);
  }
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

ll N;
ll solve(ll h, ll n, ll w){
	ll res = 4LL * h * n * w - N * (n * w + h * w + h * n);
	return res;
} 

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> N;

	ll limit = 3500LL;

	for (ll h = 1LL; h <= limit; ++h){
		for (ll n = 1LL; n <= limit; ++n){
			ll ok = limit;
			ll ng = 0LL;
			int cnt = 0;
			while (abs(ok - ng) >= 1 && cnt < 20){
				ll mid = (ok + ng) / 2;
				ll ans = solve(h, n, mid);
				if (ans > 0){
					ok = mid;
				}else
				if (ans < 0){
					ng = mid;
				}else{
					cout << h << ' ' << n << ' ' << mid << endl;
					return 0;
				} // end if
				++cnt;
			} // end while
		} // end for
	} // end for
 
	return 0;
}

Measured memory_bytes: 256
from fractions import *
n = int(input())
a = [0]+list(map(int, input().split()))+[0]
b = [0]*(n+2)
c = [0]*(n+2)
for i in range(1, n+1):
	b[i] = gcd(b[i-1], a[i])
for i in range(n, 0, -1):
	c[i] = gcd(c[i+1], a[i])
print(max(gcd(b[i-1], c[i+1]) for i in range(1, n+1)))
#sample answer.


Measured memory_bytes: 16108
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

int A,B,C;

void func(){

	int left = -1*max(abs(B),abs(C));
	int right = max(abs(B),abs(C));
	int p,q;

	for(int r = 1; r*r <= A; r++){
		if(A%r != 0)continue;
		p = A/r;
		for(int s = left; s <= right; s++){
			if(s != 0 && C%s != 0)continue;
			if(s != 0)q = C/s;
			else{
				q = B/r;
			}
			if(q != 0 && C%q != 0)continue;
			if(p ==r && s > q)continue;

			if(p*r == A && (p*s+q*r) == B && q*s == C){
				printf("%d %d %d %d\n",p,q,r,s);
				return;
			}
		}
	}
	printf("Impossible\n");
}

int main(){

	while(true){
		scanf("%d %d %d",&A,&B,&C);
		if(A == 0 && B == 0 && C == 0)break;

		func();
	}

	return 0;
}

Measured memory_bytes: 3092
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;

ll a,b;
ll res=0,ans=0,sum=0;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>a>>b;
    cout<<max(a*b,max(a-b,a+b));
}


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

class Main {
    static int TABLE_SIZE = 500;

    public static void main(String[] args) throws Exception {
        BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(r.readLine());
        String[] str = r.readLine().split(" ");

        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = Integer.parseInt(str[i]);
        }

        LinkedList<Integer>[] listTable = generateHashedTable(arr);

        int q = Integer.parseInt(r.readLine());
        String[] str2 = r.readLine().split(" ");

        Integer[] arr2 = new Integer[q];
        for(int i = 0; i < q; i++) {
            arr2[i] = Integer.parseInt(str2[i]);
        }

        int count = 0;
        for(Integer v: arr2) {
            if (search(listTable, v)) {
                count ++;
            }
        }

        System.out.println(count);
    }

    private static LinkedList<Integer>[] generateHashedTable(Integer[] arr) {
        @SuppressWarnings("unchecked")
        LinkedList<Integer>[] listTable = (LinkedList<Integer>[]) new LinkedList[TABLE_SIZE];

        for (Integer v : arr) {
            int h = generateHash(v);
            if (listTable[h] == null) {
                listTable[h] = new LinkedList<>();
            }

            LinkedList<Integer> list = listTable[h];
            list.add(v);
        }

        return listTable;
    }

    private static boolean search(LinkedList<Integer>[] listTable, Integer searchNum) {
        int h = generateHash(searchNum);

        LinkedList<Integer> list = listTable[h];
        if (list == null) { return false; }

        return list.contains(searchNum);
    }

    private static int generateHash(Integer v) {
        int h = v.hashCode();
        if (h < 0) {  h = 0 - h; }
        return h % TABLE_SIZE;
    }
}

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

int main(){

    int A, B, K;
    cin >> A >> B >> K;

    int count = 0;
    while (count < K) {
        if (count%2 == 0) {
            B += A/2;
            A = A/2;
        } else {
            A += B/2;
            B = B/2;
        }
        count++;
    }
    cout << A << " " << B << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string.h>
#include <bits/stdc++.h> 
using namespace std;
// main() is where program execution begins.

int main() {
    int a,b,count=0;
    cin >> a >> b;
    int food[31] = {0};
    for (int i = 0; i < a; ++i)
    {
      int k;
      cin >> k;
      for (int j = 0; j < k; ++j)
      {
        int r;
          cin >> r;
        food[r-1]++;
      }
    }

    for (int i = 0; i < 31; ++i)
    {
      if (food[i] == a)
      {
        count++;
      }
    }
    cout<<count<<endl;
   
   return 0;
}

Measured memory_bytes: 256
N, M = map(int, raw_input().split())
A = map(int, raw_input().split())
all_cost = [-10**15, 2, 5, 5, 4, 5, 6, 3, 7, 6]

dp = [-10**15] * (N+1)

dp[0] = 0
for i in range(1, N+1, 1):
    max_val = -10**15
    for a in A:
        if i - all_cost[a] >= 0 and dp[i - all_cost[a]] != -10**15:
            val = dp[i - all_cost[a]] + 1
            if val > max_val: max_val = val
    dp[i] = max_val

A.sort(reverse=True)

result = ''
idx = N
while idx > 0:
    for a in A:
        if idx - all_cost[a] < 0: continue
        if dp[idx - all_cost[a]] == dp[idx] - 1:
            result += str(a)
            idx -= all_cost[a]
            break

print result

Measured memory_bytes: 3204
#include <stdio.h>

int main(void){

  long n;
  scanf("%ld", &n);
  long b[n-1];
  for (long i = 0; i < n-1; i++) {
    scanf("%ld", &b[i]);
  }

  long answer = b[0]+b[n-2];
  for (long i = 0; i < n-2; i++) {
    answer += b[i];
    if (b[i+1] < b[i]) {
      answer += b[i+1]-b[i];
    }
  }
  printf("%ld\n", answer);

  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#define _debug(fmt, ...) fprintf(stderr, "%s: " fmt "\n", __func__, ##__VA_ARGS__)
#define rep(i, n) for (int i=0; i<(n); i++)
#define Rep(i, n) for (int i=1; i<=(n); i++)
#define range(x) (x).begin(), (x).end()
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> pii;

tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> rkt;

int n;
int a[200005];

int main() {
  cin >> n;
  rep (i, n) {
    cin >> a[i];
    rkt.insert({a[i], i});
  }
  rep (i, n) {
    rkt.erase({a[i], i});
    cout << rkt.find_by_order(n/2-1)->first << endl;
    rkt.insert({a[i], i});
  }

  return 0;
}



Measured memory_bytes: 16000
n,m = map(int,input().split())
ls = [[x for x in input() + '#'] for i in range(n)] + [['#']*(m+1)]
yokodp = [[0 for x in range(m+1)] for i in range(n+1)]
for i in range(n+1):
    yoko = 0
    for j in range(m+1):
        if ls[i][j] == '#':
            yokodp[i][j] = yoko
            yoko = 0
        else:
            yoko += 1
for i in range(n,-1,-1):
    check = 0
    for j in range(m,-1,-1):
        if yokodp[i][j] != 0:
            check = yokodp[i][j]
        if ls[i][j] == '.':
            yokodp[i][j] = check
tatedp = [[0 for x in range(m+1)] for i in range(n+1)]            
for j in range(m+1):
    tate = 0
    for i in range(n+1):
        if ls[i][j] == '#':
            tatedp[i][j] = tate
            tate = 0
        else:
            tate += 1
for j in range(m,-1,-1):
    for i in range(n,-1,-1):
        if tatedp[i][j] != 0:
            check = tatedp[i][j]
        if ls[i][j] == '.':
            tatedp[i][j] = check
ans = 0
for i in range(n):
    for j in range(m):
        if ls[i][j] == '.':
            ans = max(ans,tatedp[i][j] + yokodp[i][j] - 1)
import time
time.sleep(0.05)
print(ans)


Measured memory_bytes: 249440
const main = (input) => {
  const [x, y] = input.trim().split(' ').map(Number)

  for (let t=0; t<=x; t++) {
    const c = x-t
    if (t + c === x && t*4 + c*2 === y) return console.log('Yes')
  }

  return console.log('No')
}

process.env.MYTEST
  ? (process.env.MYTEST === 'test' ? test() : main(require('fs').readFileSync('dev/stdin', 'utf8')))
  : main(require('fs').readFileSync('/dev/stdin', 'utf8'))


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

template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

int main(void){
    int n;
    cin >> n;
    vector<long> a(n);
    for(auto& i : a) cin >> i;
    long y = 0;
    int s = 1;
    for(int i = 0; i < n; i++){
        y += a.at(i) * s;
        s *= -1;
    }
    cout << y << endl;
    for(int i = 1; i < n; i++){
        y -= a.at(i-1);
        y *= -1;
        y += a.at(i-1);
        cout << y << endl;
    }
    return 0;
}


Measured memory_bytes: 2048
#include<stdio.h>

int main(void){
    int n = 'a' - 'A';
    char s1[11], s2[11], s3[11];
    scanf("%s %s %s", s1, s2, s3);

    printf("%c%c%c", s1[0] - n, s2[0] - n, s3[0] - n);

    return 0;
}

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

int main(){
  string str;
  cin >> str;
  
  for (int i=0;i<str.size();i++){
    if(str.at(i)=='7'){
      cout << "Yes" << endl;
      break;
    }
    if(i==str.size()-1)
      cout << "No" << endl;
  }
}


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

int main(void)
{
    intmax_t A, B, C;
    intmax_t ans = 0;

    scanf("%jd%jd%jd", &A, &B, &C);

    if (A == B && B != C) {
        puts("Yes");
        return 0;
    }
    if (B == C && C != A) {
        puts("Yes");
        return 0;
    }
    if (C == A && A != B) {
        puts("Yes");
        return 0;
    }

    puts("No");

    return 0;
}


Measured memory_bytes: 128
import sys
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def main():
    k = int(stdin.readline().rstrip())
    a,b = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    for i in range(1,1000):
        if a<=k*i<=b:
            print("OK")
            exit()
    print("NG")

main()


Measured memory_bytes: 9168
//package Contest077;

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String []args)
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
            int N = sc.nextInt();
            int  M = (int)Math.sqrt(new Double(N));
            out.println(M*M);
        out.flush();
    }
}


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

int main() {
	int t;
	cin>>t;
	string s;
	cin>>s;
	if(t%2==0){
    int n = s.length(); 
  
    char arr[n + 1]; 
  
    strcpy(arr, s.c_str());
    string a="";
    string b="";
    for(int i =0;i<n/2;i++)
    a+=s[i];
    
        for(int i =n/2;i<n;i++)
    b+=s[i];
    
    if(a==b)
    cout<<"Yes";
    
    else
    cout<<"No";
	}
	else
	cout<<"No"<<endl;
	return 0;
}

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


#define Seg_Max_N (1<<18) 

using Value = pair<long long int,int>;
const Value ini = (make_pair(1e18, 0));
struct segtree {
	int N;
	vector<Value>dat;

	segtree() {}
	segtree(int n) :dat(2 * Seg_Max_N) {
		N = 1;
		while (N < n) N *= 2;
		for (int i = 0; i < 2 * N - 1; i++) {
			dat[i] = ini;
			if (i >= N - 1) {
				dat[i].second = i - (N - 1);
			}
		}
	}
	Value connect(const Value&l, const Value&r) {
		
		return min(l, r);
	}
	// update k th element
	void update(int k, Value a) {
		k += N - 1;
		dat[k] = a;

		while (k > 0) {
			k = (k - 1) / 2;
			const Value al(dat[k * 2 + 1]);
			const Value ar(dat[k * 2 + 2]);
			dat[k] = connect(al, ar);
		}
	}
	// min [a, b)
	Value  query(int a, int b) { return query(a, b, 0, 0, N); }
	Value  query(int a, int b, int k, int l, int r) {
		if (r <= a or b <= l) return ini;
		if (a <= l and r <= b) return dat[k];
		const int m = (l + r) / 2;
		const Value al(query(a, b, k * 2 + 1, l, m));
		const Value ar(query(a, b, k * 2 + 2, m, r));
		return connect(al, ar);
	}
};
segtree seg;

vector<long long int>v;
int solve(int l, int r, long long int x) {
	if (l == r)return 0;
	Value av(seg.query(l, r));
	auto min_id = av.second;
	auto min_num =av.first;
	int ans=0;
	if (min_num >= x * 2) {
		ans= 1+solve(l, r, x * 2);
	}
	else if (min_num == x) {
		ans= solve(l, min_id ,x) + solve(min_id + 1, r,x);
	}else {
		int al = -1;

		int less2x_num = 0;
		vector<int>ts;
		for (int i = l; i < r; ++i) {
			if (v[i] >= 2*x) {
				if (al == -1)al = i;
			}
			else {
				less2x_num++;
				if (al == -1){}
				else {
					ts.push_back(0);
					ans += solve(al, i, 2 * x);
				}
				ts.push_back(1);
				al = -1;
			}
		}
		if (al == -1){}
		else {
			ts.push_back(0);
			ans += solve(al, r, 2 * x);
		}
		
		for (int aa = 0; aa < ts.size(); ++aa) {
			if (ts[aa] == 0) {
				aa++;
				if (aa == ts.size()) {
					ans++;
				}
				else {
					assert(ts[aa] == 1);
					ans++;
				}
			}
			else {
				aa++;
				ans++;
				if (aa == ts.size()) {
				}
				else {
					if (ts[aa] == 1) {
					}
					else {
						aa++;
						if (aa == ts.size()) {

						}
						else {
							assert(ts[aa] == 1);
						}
					}
				}
			}
		}
		return ans;
	}
	return ans;
}

int main() {
	int N; cin >> N;
	seg = segtree(N);

	v.resize(N);
	for (int i = 0; i < N; ++i) {
		cin >> v[i];
		seg.update(i, make_pair(v[i], i));
	}
	int ans = solve(0, N, 1);
	cout << ans << endl;

	return 0;
}

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

int main(){
    int64_t N;
    cin >> N;
    string S;
    cin >> S;
    
    int64_t Rnum = 0;
    int64_t Gnum = 0;
    int64_t Bnum = 0;
    for ( int64_t i = 0; i < S.size(); ++i ){
        if ( S.at(i) == 'R') {
            Rnum += 1;
        } else if ( S.at(i) == 'G'){
            Gnum += 1;
        } else {
            Bnum += 1;
        }
    }
    
    int64_t res = Rnum * Gnum * Bnum;
    
    int64_t count = 0;
    for ( int64_t i = 0; i < N - 2; ++i){
        for ( int64_t gap = 1; gap <= (int64_t)(N-i-1)/2; ++gap){
            //cout << S.at(i) << S.at(i+gap) << S.at(i+2*gap) << endl;
            if ( S.at(i) != S.at(i+gap) and S.at(i+gap) != S.at(i+2*gap) and S.at(i) != S.at(i+2*gap) ){
                count += 1;
            }
        }
    }
    
    cout << res - count << endl;
    
    
    return 0;
}


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

namespace _20180305_AOJ
{
    class ALDS1_4B
    {
        static void Main(string[] args)
        {
            for (;;)
            {
                string line = Console.ReadLine();
                if (string.IsNullOrEmpty(line))
                {
                    break;
                }

                //int n = int.Parse(line);
                int[] S = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                Console.ReadLine();
                int[] T = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

                int count = 0;
                foreach (var v in T)
                {
                    if (Array.BinarySearch(S, v) >= 0)
                    {
                        count++;
                    }
                }

                Console.WriteLine(count);
            }
        }
    }
}



Measured memory_bytes: 23324
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>

#define ll long long

using namespace std;

string s;
string out;

void ope(char a)
{
    if (a == '0' || a == '1') {
        out.push_back(a);
    } else if (!out.empty()) {
        out.pop_back();
    }
    return;
}


int main()
{
    cin >> s;
    for (size_t i = 0; i < s.size(); i++) {
        ope(s[i]);
    }

    cout << out << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
# define ll long long
# define int long long  //comment it out when MLE
//# define endl "\n"
#define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
# define mo 1000000007
# define mm 1000000007
# define pi acos(-1)
# define fi first
# define se second

using namespace std;

signed main()
{
    gok

       int n,k;
       cin>>n>>k;
       int an=0;
       for(int i=k;i<=n+1;i++)
       {
           int t1 = ((i-1)*i)/2,t2 = (n*(n+1))/2 - ((n-i)*(n-i+1))/2;
           an += (t2-t1+1);
           an %= mo;
       }
       cout<<an;





















      return 0;
    }


Measured memory_bytes: 3640
#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() {
    const ll mod = 1000000007;
    int h, w; cin >> h >> w;
    char grid[h][w];
    rep(i, h)rep(j, w) cin >> grid[i][j];

    ll dp[h][w];
    bool check[h][w];
    memset(dp, 0, sizeof(dp));
    memset(check, 0, sizeof(check));

    queue<P> q;
    q.push(make_pair(0, 0));
    dp[0][0] = 1;

    while(q.size()){
        P now = q.front(); q.pop();
        int i = now.first, j = now.second;
        if(grid[i+1][j] != '#' && i+1 < h) {
            dp[i+1][j] += dp[i][j];
            dp[i+1][j] %= mod;
            if(!check[i+1][j]) {
                q.push(make_pair(i+1, j));
                check[i+1][j] = true;
            }
        }
        if(grid[i][j+1] != '#' && j+1 < w) {
            dp[i][j+1] += dp[i][j];
            dp[i][j+1] %= mod;
            if(!check[i][j+1]) {
                q.push(make_pair(i, j+1));
                check[i][j+1] = true;
            }
        }
    }

    cout << dp[h-1][w-1] << endl;
    return 0;
}

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


int main(){
    ll x;cin>>x;
    ll ans=0;
    ans+=x/500*1000;
    x=x%500;
    ans+=x/5*5;
    cout<<ans<<endl;
}







Measured memory_bytes: 256
n,k=map(int,input().split())
a=list(map(int,input().split()))
min = 100001
d = 0
for i in range(n):
	if a[i]<min:
		min=a[i]
		d = n

b = int((n-1)/(k-1))
if (n-1)%(k-1) != 0:
	b += 1

print(b)

Measured memory_bytes: 14004
#include<stdio.h>
int main(){
	int a=1,b=1,c=0,i;
	for(i=0;i<81;i++){
		c=a*b;
		printf("%dx%d=%d\n",a,b,c);
		b++;
		if(b==10){
			b=1;
			a++;
		}
	}
	return 0;
}



Measured memory_bytes: 1992
n = int(input())
s = input()
open_ = 0
close_ = 0
for char in s:
    if char == "(":
        open_ += 1
    else:
        if open_ > 0:
            open_ -= 1
        else:
            close_ += 1
for i in range(open_):
    s += ")"
for i in range(close_):
    s = "(" + s
print(s)


Measured memory_bytes: 2940
#include<cstdio>

int main(void){
    int a,b,c,d;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    int x=c-a;
    int y=d-b;
    printf("%d %d %d %d",c-y,d+x,a-y,b+x);
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;

int main()
{
    // 整数の入力
    ll A,B;
    cin >> A >> B;
    cout << A * B << endl;

   return 0;
}

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

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

  vector<long long> v = vector<long long>(n);
  for (int i = 0; i < n; i++) {
    cin >> v.at(i);
  }
  sort(v.begin(), v.end(), greater<long long>());

  queue<long long> q;
  q.push(v.at(1));
  int qcouter = 0;
  long long ans = v.at(0);
  for(int i = 2; i < n; i++) {
    qcouter++;
    ans += q.front();
    q.push(v.at(i));
    if (qcouter >= 2) {
      q.pop();
      qcouter = 0;
    }
  }

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 5624
#include <bits/stdc++.h>
using namespace std;
#define fi			first
#define se			second
#define fz(i,a,b)	for(int i=a;i<=b;i++)
#define fd(i,a,b)	for(int i=a;i>=b;i--)
#define foreach(it,v) for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define all(a)		a.begin(),a.end()
#define giveup(...) return printf(__VA_ARGS__),0;
#define fill0(a)	memset(a,0,sizeof(a))
#define fill1(a)	memset(a,-1,sizeof(a))
#define fillbig(a)	memset(a,0x3f,sizeof(a))
#define fillsmall(a) memset(a,0xcf,sizeof(a))
#define mask(a)		(1ll<<(a))
#define maskx(a,x)	((a)<<(x))
#define _bit(a,x)	(((a)>>(x))&1)
#define _sz(a)		((int)(a).size())
#define filei(a)	freopen(a,"r",stdin);
#define fileo(a)	freopen(a,"w",stdout);
#define fileio(a) 	freopen(a".in","r",stdin);freopen(a".out","w",stdout)
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define put(x)		putchar(x)
#define eoln        put('\n')
#define space		put(' ')
#define y1			y_chenxiaoyan_1
#define y0			y_chenxiaoyan_0
#define int long long
typedef pair<int,int> pii;
inline int read(){
	int x=0,neg=1;char c=getchar();
	while(!isdigit(c)){
		if(c=='-')	neg=-1;
		c=getchar();
	}
	while(isdigit(c))	x=x*10+c-'0',c=getchar();
	return x*neg;
}
inline void print(int x){
	if(x<0){
		putchar('-');
		print(abs(x));
		return;
	}
	if(x<=9)	putchar(x+'0');
	else{
		print(x/10);
		putchar(x%10+'0');
	}
}
inline int qpow(int x,int e,int _MOD){
	int ans=1;
	while(e){
		if(e&1)	ans=ans*x%_MOD;
		x=x*x%_MOD;
		e>>=1;
	}
	return ans;
}
int x=read(),cur=100,cnt=0;
signed main(){
	while(cur<x){
		cur=(int)(1.01*cur);
		cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}

Measured memory_bytes: 3644
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  in n;
  cin>>n;
  in sm=1;
  in cr;
  cin>>cr;
  in a;
  bool up=0;
  bool dn=0;
  forn(z,n-1){
    cin>>a;
    if(a>cr)
      up=1;
    if(a<cr)
      dn=1;
    if(up && dn){
      up=dn=0;
      ++sm;
    }
    cr=a;
  }
  cout<<sm<<endl;
  return 0;
}


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

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

int main(){
    long n;cin >> n;
    vector<long> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    long c,i;
    c=0;i=0;
    while(c<=n){
        if(a[i]==2){
            c++;
            cout << c;
            return 0;
        }
        i=a[i]-1;
        c++;
    }
    cout << -1;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int n, c, k;
#define N 200000
int ti[N], ans;
int main()
{
    cin >> n >> c >> k;
    for (int i = 1; i <= n; ++ i) cin >> ti[i];
    sort(ti + 1, ti + n + 1);
    for (int i = 1, l = -1, s = 0; i <= n; ++ i)
    {
        if (l < ti[i] || s == c) ans ++, l = ti[i] + k, s = 1;
        else s ++;
    }
    cout << ans;
}


Measured memory_bytes: 640
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
#define int long  long int
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

signed main() {
	string S;
	cin >> S;
	bool can = true;
	if (S[0] != 'A')can = false;
	int cnt = 0;
	for (int i = 2; i <= S.size() - 2; i++) {
		if (S[i] == 'C')cnt++;
	}
	if (cnt != 1)can = false;
	for (auto i : S) {
		if (!(i == 'A' || i == 'C')) {
			if (!(i <= 'z' && i >= 'a'))can = false;
		}
	}
	if (can)cout << "AC";
	else cout << "WA";
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
    int n = 0;
    cin >> n;
    vector<long long> a(n);
    for (int i=0; i<n; i++) {
        cin >> a.at(i);
    }
    sort(a.begin(), a.end());
    long long now = 0, count = 0;
    long long ans = 0;
    for (int i=0; i<n; i++) {
        if (now != a.at(i)) {
            if (now > count) {
                ans += count;
            }
            else if (now < count) {
                ans += count - now;
            }
            count = 0;
            now = a.at(i);
        }
        count++;
    }
    if (now > count) {
        ans += count;
    }
    else if (now < count) {
        ans += count - now;
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
	bool ok = true;
	int n;
	cin >> n;
	for(int i = 1; i <= n; ++i) {
		int x;
		cin >> x;
		if(x % 2 == 0) 
			if(ok)
				ok = x % 3 == 0 || x % 5 == 0;
	}
	cout << (ok ? "APPROVED" : "DENIED");
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
signed main(){
	int a1,a2,a3,b1,b2,b3,c1,c2,c3;
	cin>>a1>>a2>>a3>>b1>>b2>>b3>>c1>>c2>>c3;
	if(a1+b2+c3==a1+b3+c2&&a1+b3+c2==a2+b1+c3&&a2+b1+c3==a2+b3+c1&&a2+b3+c1==a3+b1+c2&&a3+b1+c2==a3+b2+c1)puts("Yes");
	else puts("No");
}

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

int main()
{
	int n;
	std::string s;
	std::vector<std::string> vec;
	
	std::cin >> n;
	
	for( int i = 0; i < n + 1; i++ ){
		std::getline( std::cin, s );
		if( s.find( "\n" ) == std::string::npos )vec.push_back( s );
	}
	
	for( std::vector<std::string>::iterator it = vec.begin(); it != vec.end(); it++ ){
		while( it->find( "Hoshino" ) != std::string::npos ){
			it->replace( it->find( "Hoshino" ), 7, "Hoshina" );
		}
		if( *it != "" ) std::cout << *it << std::endl;
	}

 	return 0;
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll          long long
#define pb          push_back
#define eb 			emplace_back
#define mp 			make_pair
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pii>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define all(a)      (a).begin(),(a).end()
#define fi          first
#define si          second
#define sz(x)       (ll)x.size()
#define endl        '\n'
#define checkbit(n, b) ((n >> b) & 1)
#define mod        1000000007
#define puts(n)		cout<<n;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define setbits(x) __builtin_popcount(x)
#define mset(m,v) memset(m,v,sizeof(m))
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	ll n;
	cin>>n;
	ll hap[n][3];
	for(ll i=0;i<n;i++){
		for(ll j=0;j<3;j++){
			cin>>hap[i][j];
		}
	}
	ll dp[n][3];
	dp[0][0]=hap[0][0];dp[0][1]=hap[0][1];dp[0][2]=hap[0][2];
	for(ll i=1;i<n;i++){
		for(ll j=0;j<3;j++){
			ll p = (j+1)%3, q = (j+2)%3;
			dp[i][j] = max(dp[i-1][p],dp[i-1][q]) + hap[i][j];
		}
	}
	
	cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
	
	return 0;
}

Measured memory_bytes: 4992
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>

using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define RREP(i,n) for(int i = n - 1; i >= 0; i--)

#define ALL(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

#define UNIQUE(v) do{sort(v.begin(), v.end()); v.erase( unique(v.begin(), v.end()), v.end() );} while(0)


#define y0 y3487465
#define y1 y8687969

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

int r, D, x;

int main(){
  cin >> r >> D >> x;
  REP(i, 10) {
    x = x * r - D;
    cout << x << endl;
  }
  

  return 0;
}


Measured memory_bytes: 256
/***
 ** "Figure out how to distract yourself."
 **
***/

/**
  *  Author: dhruv_gheewala
  *  Problem: __________
  *  Date:   27.04.2020
  *  Time:   03:58:12
**/

#define header_file "Lib/debug.h"
#if __has_include(header_file)
	#include header_file
#else
	#include<bits/stdc++.h>
	using namespace std;
	
	#define fundri 108
	#define debug(...) 1729
#endif

#define int long long
typedef pair<int, int> pii;
typedef vector<int> vi;

const bool testcases = 0;
#define ff first
#define ss second
#define endl '\n'
#define all(s) s.begin(), s.end()

// if vector isn't soted then it will remove consecutive same elements
#define make_unique(vec) vec.erase(unique(all(vec)), vec.end())
#define test int TC = 1;if(testcases)cin >> TC;for(int tc = 1 ; tc <= TC ; tc++)
#define sort_by(cont,expr) sort(all(cont),[&](const auto &lhs,const auto &rhs){return expr;})

void online_judge();
int seed; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l = 0, int r = INT_MAX) {return uniform_int_distribution<int>(l, r)(rng);}

template<typename T>bool isPrime(T n) {for(T i = 2; i * i <= n; i++)if(n % i == 0)return 0; return 1;}
template<typename T>inline bool in_range(T a, T l, T r) {return (a >= l && a <= r);}
template<typename T, typename U>inline istream &operator >>(istream &in, pair<T, U> &a) {in >> a.ff >> a.ss; return in;}
template<typename T>inline istream &operator >>(istream &in, vector<T> &a) {for(auto &x : a)in >> x; return in;}

int32_t main(int32_t argc, char **argv)
{
	online_judge();
	
	int n;
	cin >> n;
	
	string str;
	set<string> s;
	
	while(n--) {
		cin >> str;
		s.insert(str);
	}
	
	cout << s.size() << endl;
	
	return 0;
}

void online_judge()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
#ifdef DHRUV_GHEEWALA
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
	freopen("debug.txt", "w", stderr);
#endif
	
}

Measured memory_bytes: 19156
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "KharYusuf", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastReader in = new FastReader(inputStream);
            PrintWriter out = new PrintWriter(outputStream);
            ERedScarf solver = new ERedScarf();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class ERedScarf {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int n = s.nextInt();
            int[] a = new int[n];
            int xor = 0;
            for (int i = 0; i < n; i++) {
                int x = s.nextInt();
                xor ^= x;
                a[i] = x;
            }
            for (int i : a) w.print((i ^ xor) + " ");
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 44980
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = Long.parseLong(sc.next());
		//String t = sc.next();
//		String buff="";
		long b = Long.parseLong(sc.next());
		//int c = Integer.parseInt(sc.next());
		//int n = Integer.parseInt(sc.next());
		//long res=n;
		//int l = Integer.parseInt(sc.next());
		//int sum=0;
		//String s = sc.next();
		//String t = sc.next();
		//String b = sc.next();
		//int a = Integer.parseInt(sc.next());
		//String t = sc.next();

		if(a+b>=24) {//a、e、i、o、u
			System.out.println(a+b-24);
		}else {
			System.out.println(a+b);
		}
		/*for(int i=0;i<t.length();i++) {
			if(t.substring(i,i+1).equals(",")) {
				buff+=" ";
			}else {
				buff+=t.substring(i, i+1);
			}
		}*/
		//System.out.println(a*800-(a/15)*200);
	}
}




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

public class Main {
	
	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int Q = sc.nextInt();
		int[][] range = new int[N][N];
		int tmp1, tmp2;
		for (int i = 0; i < M; i++) {
			tmp1 = sc.nextInt() - 1;
			tmp2 = sc.nextInt() - 1;
			range[tmp1][tmp2]++;
		}
		int[][] acum = new int[N][N];
		for (int i = 0; i < N; i++) {
			acum[i][i] = range[i][i];
		}
		int[] tmp = new int[N];
		for (int i = 0; i < N; i++) {
			tmp[i] = range[i][i];
		}
		for (int delta = 1; delta < N; delta++) {
			for (int i = 0; i + delta < N; i++) {
				tmp[i] += range[i][i+delta];
			}
			for (int i = 0; i + delta < N; i++) {
				acum[i][i+delta] = tmp[i] + acum[i + 1][i+delta];
			}
		}
		for (int i = 0; i < Q; i++) {
			tmp1 = sc.nextInt() - 1;
			tmp2 = sc.nextInt() - 1;
			out.println(acum[tmp1][tmp2]);
		}
		
		out.flush();
	}
	
	static class MyScanner {
		private BufferedReader br;
		private StringTokenizer tokenizer;
		
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		
		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}
	}
}


Measured memory_bytes: 61292
X, Y = list(map(int, input().split()))
s = (X + Y) // 3
if s * 3 < X + Y:
  print(0)
  exit()
a = Y - s
b = X - s
if a < 0 or b < 0:
  print(0)
  exit()
  
m = 1000000007

def qmul(x, k):
  if k == 0:
    return 1
  if k == 1:
    return x
  t = qmul(x, k // 2)
  t = t * t % m
  if k % 2 == 1:
    t = t * x % m
  return t
ans = 1
for i in range(a + b, a, -1):
  ans = ans * i % m
d = 1
for i in range(b):
  d = d * (i + 1) % m
ans = ans * qmul(d, m - 2) % m
print(ans)

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

int main() {
  long double a = 0, b = 0, c = 0;
  cin >> a >> b >> c;

  if(a + b - c + 2 * sqrt(a*b) < 0){
    cout << "Yes";
  }
  
  else{
    cout << "No";
  }
}


Measured memory_bytes: 256