akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const long long INF = 1e9;
const long long MOD = 1e9+7;
using Graph = vector<vector<ll>>;
template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true;} return false;}

// 0 false, 1 true 
// string to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    std::cout << std::fixed << std::setprecision(15);
    string s;
    cin >> s;
    if(s == "AAA" || s == "BBB"){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }

}

Measured memory_bytes: 256
/*                    */
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
namespace my {
char itoc(int i) { return i + '0'; }
int ctoi(char c) { return c - '0'; }
lint gcd(lint a, lint b) {
  a = abs(a);
  b = abs(b);
  if (a < b) swap(a, b);
  while (b != 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
lint lcm(lint a, lint b) { return a * b / my::gcd(a, b); }
}  // namespace my
/*                    */

void choufukucomb(vector<vector<int>> &zembu, vector<int> tmp, int &n, int &m) {
  if (tmp.size() == n)
    zembu.push_back(tmp);
  else if (tmp.empty()) {
    for (int i = 1; i <= m; i++) {
      tmp.push_back(i);
      choufukucomb(zembu, tmp, n, m);
      tmp.pop_back();
    }
  } else {
    for (int i = *tmp.rbegin(); i <= m; i++) {
      tmp.push_back(i);
      choufukucomb(zembu, tmp, n, m);
      tmp.pop_back();
    }
  }
}

int main() {
  int n, m, q;
  cin >> n >> m >> q;
  vector<int> a, b, c, d;
  for (int i = 0; i < q; i++) {
    int tmp;
    cin >> tmp;
    a.push_back(--tmp);
    cin >> tmp;
    b.push_back(--tmp);
    cin >> tmp;
    c.push_back(tmp);
    cin >> tmp;
    d.push_back(tmp);
  }

  vector<vector<int>> zembu;
  vector<int> kyomu;
  choufukucomb(zembu, kyomu, n, m);

  lint ans = 0;
  for (int i = 0; i < zembu.size(); i++) {
    lint tmp = 0;
    for (int j = 0; j < q; j++) {
      if (zembu.at(i).at(b.at(j)) - zembu.at(i).at(a.at(j)) == c.at(j))
        tmp += (lint)d.at(j);
    }
    if (tmp > ans) ans = tmp;
  }

  cout << ans << endl;
}


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

int main(){
    int n;
    cin >> n;
    ll ans = 0;
    string s[n];
    rep(i, n) cin >> s[i];
    string t[n];
    rep(i, n){
        bool flag = true;
        rep(j, n){
            if (i + j < n) t[j] = s[i + j];
            else t[j] = s[i + j - n];
        }
        rep(y, n){
            rep(x, n){
                if (t[x][y] != t[y][x]) flag = false;
            }
        }
        if (flag) ans ++;
    }
    cout << ans * n << endl;
    return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
using namespace std;
using ll = long long int;

int main(){
    ll n;
    cin >> n;
    ll ans = n * (n+1) * (n+1) / 2 - n * (2*n+1) * (n+1) / 6;

    for(int i = 0; i < n-1; i++){
        int u, v;
        cin >> u >> v;
        int a = max(u, v);
        int b = min(u, v);
        ans -= b * (n-a+1);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include<vector>
#include<climits>
using namespace std;
int fun(vector<int> height,int n)
{
    vector<int> dp(n+1);
    dp[1]=0;
    int c=9999999;
    for(int i=2;i<=n;i++)
    {
        int option1=abs(height[i]-height[i-1])+dp[i-1];
        
        int option2=((i==2)?c:abs(height[i]-height[i-2])+dp[i-2]);


        dp[i]=min(option1,option2);
    }
    return dp[n];

}



int main() {
    int n;
    cin>>n;
    vector<int> height(n+1);
    for(int i=1;i<=n;i++)
    {
        cin>>height[i];
    }
    cout<<fun(height,n);
}


Measured memory_bytes: 1408
/////////////////////////   _LeMur_
#define _CRT_SECURE_NO_WARNINGS
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
#include <chrono>
#include <random>
#include <bitset>
#include <cstdio>
#include <vector>
#include <string>
#include <ctime>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <list>
#include <map>
#include <set>

using namespace std;

const int N = 100005;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;

long long n;
long long answ = 0;

void update(long long y){
    long long x = n / y;
    --x;
    if(x == 0)return ;
    if(n % x != y)return ;
    if((n / x) != y)return ;
    answ += x;
}

int main() {
    mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
    cin >> n;
    for(long long i=1;i*i<=n;i++){
        if(n % i)continue;
        update(i);
        if(i * i != n) update(n / i);
    }
    cout << answ << endl;
	return 0;
}


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

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let mut ans = 1;
    for _ in 0..n {
        let t:usize = read();
        ans = ans / gcd(ans, t) * t;
    }
    println!("{}", ans);
}

fn gcd(a:usize, b:usize) -> usize {
    if b == 0 {
        return a
    }
    return gcd(b, a%b);
}

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

res = 1 << 40
num_black = 0
num_white = s.count('.')
for i in range(n):
    res = min(res, num_black + num_white)
    if s[i] == '.':
        num_white -= 1
    else:
        num_black += 1
        
res = min(res, num_black + num_white)
print(res)

Measured memory_bytes: 66740
// abc102_b
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int N;
    cin >> N;
    vector<int> A(N);
    REP(i, N) cin >> A[i];

    int ans = 0;
    REP(i, N) REP(j, N){
        ans = max(ans, abs(A[i] - A[j]));
    }
    print(ans);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf INT_MAX-2
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define pb push_back
#define f first
#define s second
#define fast_cin ios_base::sync_with_stdio(false);cin.tie(NULL);
#define precise fixed(cout);cout<<setprecision(16);
using namespace std;
const int MAXN= 100010;


int n;
int v[MAXN],dp[MAXN];


int main()
{
  cin >> n;
  for(int i=0;i<=n+5;i++) dp[i]=inf;

  for(int i=0;i<n;i++) cin >> v[i];
  dp[0]=0;

  for(int i=0;i<n;i++)
  {
    for(int j: {i+1, i+2})
    {
      if(j<n) dp[j]=min(dp[j],dp[i]+abs(v[j]-v[i]));
    }
  }
  cout << dp[n-1]<<endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
using msi=map<string,int>;
using mii=map<int,int>;
using psi=pair<string,int>;
using pii=pair<int,int>;
using vlai=valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1e9
#define EPS 1e-9
#define MOD ((ll)1e9+7)
void get(){}template<class H,class...T>void get(H&h,T&...t){cin>>h;get(t...);}
template<class T>void geti(T&a){for(auto&_:a)cin>>_;}
template<class T>void getii(T&a){for(auto&_:a)geti(_);}
void put(string d){}template<class H,class...T>void put(string d,H&h,T&...t){cout<<h;if(sizeof...(t))cout<<d;put(d,t...);}
template<class T>void puti(T&a,string d=" "){bool f=1;for(auto&_:a)cout<<(exchange(f,0)?"":d)<<_;cout<<endl;}
template<class T>void putii(T&a,string d=" "){for(auto&_:a)puti(_,d);}
#define dcl(...) ll __VA_ARGS__;get(__VA_ARGS__)
#define dclt(t,...) t __VA_ARGS__;get(__VA_ARGS__)
template<class F,class S>void add(map<F,S>&mp,F f,S s){if(mp.find(f)==mp.end())mp[f]=F();mp[f]+=s;}

int main(){
    dcl(n);
    map<char,ll> mp;
    rep(i,n){
        string s;
        cin>>s;
        add(mp,s[0],1ll);
    }
    vector<ll> v={mp['M'],mp['A'],mp['R'],mp['C'],mp['H']};
    ll ans=0;
    vvi st={{0,1,2},{0,1,3},{0,1,4},{0,2,3},{0,2,4},{0,3,4},{1,2,3},{1,2,4},{1,3,4},{2,3,4}};
    for(vi t:st){
        ans+=v[t[0]]*v[t[1]]*v[t[2]];
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.util.*;

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

        int c = A+B;
        int d = A-B;
        int e = A*B;
			System.out.println(Math.max(e,Math.max(c,d)));
    }
}


Measured memory_bytes: 23892
#include<stdio.h>
int main(void)
{
	int a,b,c,i,j,div=0;
	scanf("%d %d %d",&a,&b,&c);
	
	for(i=1;i<=c;i++){
		if(c%i==0){
			for(j=a;j<=b;j++){
				if(i==j){
					div++;
				}
			}
		}
	}
	
	printf("%d\n",div);
	
				
		
	return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <string>
int main()
{
    std::string s,t;
    std::cin >> s >> t;

    t.pop_back();

    if(s==t){
        std::cout << "Yes" << std::endl;
        return 0;
    }

    std::cout << "No" << std::endl;
    return 0;
}

Measured memory_bytes: 3556
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N, K;
  cin>>N>>K;
  if(0<=K && K<=(N-1)*(N-2)/2) {
    cout<<N-1+(N-1)*(N-2)/2-K<<endl;
    for(int i=2;i<=N;++i) {
      cout<<1<<" "<<i<<endl;
    }
    int tmp1=2, tmp2=3;
    for(int i=0;i<(N-1)*(N-2)/2-K;++i) {
      cout<<tmp1<<" "<<tmp2<<endl;
      if(tmp2==N) {
        tmp1++;
        tmp2 = tmp1+1;
      }
      else tmp2++;
    }
  }
  else {
    cout<<-1<<endl;
  }
}



Measured memory_bytes: 3604
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7

def main():
  A, B, C, D = map(int, readline().split())
  
  def F(x):
    y = x//C
    y += x//D
    lcm = C*D//gcd(C,D)
    y -= x//lcm
    return x-y
  ans = F(B) -F(A-1)
  print(ans)
  
  
if __name__ == '__main__':
  main()

Measured memory_bytes: 5060
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    x=I()
    ans=(x//11)*2
    b=x%11
    if b==0:
        pass
    elif b<=6:
      ans+=1
    else:
        ans+=2
        
    print(ans)  
    

main()


Measured memory_bytes: 38448
#include <iostream>
using namespace std;
int main()
{
    int a,b,c,d,i,j=0;
    cin>>a>>b;
    int ara[b+1];
    for(i=0;i<b;i++){
        cin>>ara[i];
       j=j+ara[i];
    }
    c=a-j;
    if(c>=0)
      cout<<c;
    else 
       cout<<"-1";
    return 0;
}

Measured memory_bytes: 3176
n = gets.to_i
a = gets.split(' ').map{|x| x.to_i}
b = gets.split(' ').map{|x| x.to_i}
c = gets.split(' ').map{|x| x.to_i}
r = 0
n.times do |i|
  if (i > 0 && a[i]-a[i-1] == 1)
    r += b[a[i]-1]+c[a[i-1]-1]
  else
    r += b[a[i]-1]
  end
end
puts r

Measured memory_bytes: 1788
import java.util.Scanner;

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

    	for(int i = 1; i <= n; i++){
    		int x = i;

    		if(x % 3 == 0){
    			System.out.print(" " + i);
    		}else{
    			for(;;){
    				if(x % 10 == 3){
    					System.out.print(" " + i);
    					break;
    				}
    				x /= 10;
    				if(x < 1) break;
    			}
    		}

    	}
    	System.out.println("");
     }
}

Measured memory_bytes: 28676
#include <bits/stdc++.h>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
using namespace std;
 
#define li long long int
#define ld long double
const int MX1=1e5+5;
const int MX2=1e6+5;
const li inf=4e18;
const li mod=1e9+7;

li power(li a,li b){li res=1;while(b){if(b%2)res=(res*a)%mod;
a=(a*a)%mod;b/=2;}return res;}
 
li mmi(li a){return power(a,mod-2);}
 
li cntbit(li n){li cnt=0;while(n){n&=(n-1);cnt++;}return cnt;}

int n,a;

void solve(){
	cin>>n>>a;
	for(int i=0;i<=a;i++){
		if(n-i>=0 and (n-i)%500==0){
			cout<<"Yes";
			return ;
		}
	}
	cout<<"No";
}

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

Measured memory_bytes: 256
from sys import stdin
import math
N = int(stdin.readline().rstrip())
t,a = [int(x) for x in stdin.readline().rstrip().split()]
 
for _ in range(N-1):
    T,A = [int(x) for x in stdin.readline().rstrip().split()]
    n = max((t + T - 1) // T,(a + A - 1) // A)
    t = n*T
    a = n*A
    
print(t+a)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int (i)=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1'000'000'007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }

int main(){
    long long A, B, N;
    cin >> A >> B >> N;
    long long C = min(N, B-1);
    long long ans = (A*C/B) - A*(C/B);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3568
#include<bits/stdc++.h>
#define ll long long int

using namespace std;

const ll mod=1000000007;
const ll inf=1e18;

int main(){

  ll n;
  cin >> n;
  vector<vector<ll>> v;
  for(int i=0;i<n;i++){
    ll a,b;
    cin >> a >> b;
    v.push_back({b,a});
  }
  sort(v.begin(),v.end());
  ll s=0;
  bool kanou=true;
  for(int i=0;i<n;i++){
    s+=v[i][1];
    if(s<=v[i][0]);
    else{
      kanou=false;
      break;
    }
  }

  if(kanou)cout << "Yes" << endl;
  else cout << "No" << endl;



}

Measured memory_bytes: 14240
#include<iostream>
#include <string>
#include<algorithm>
#include <set>
#include <cmath>
using namespace std;
typedef long long lint;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rep0(i,n) rep(i,0,n)

int main(void) {
	ios::sync_with_stdio(false);
	long N, i, j, k, max_num;
	cin >> N;
	long H[N];
	for (i = 0; i < N; i++) cin >> H[i];
	i = 0;
	j = 0;  // j=0ならカウント厨 j=1ならカウント後
	max_num = 0;
	do {
		if (H[i] >= H[i + 1]) {
			j++; 
			if (max_num <= j) max_num = j;
		}else {
			if (max_num <= j) max_num = j;
			j = 0;
		}
		i++;
	} while (i <= N - 2);

	cout << max_num;
	return 0;
}
//
////sort Ｎ個の配列a
//sort(a, a + N); //昇順
//sort(a, a + N, greater<int>()); //降順
//
////最大公約数（ユークリッドの互除法利用）
//int gcd(int a, int b) {
//	if (a == 0) return b;
//	if (b == 0) return a;
//	int m = max(a, b);
//	int n = min(a, b);
//	if (m%n == 0) return n;
//	else return gcd(n, m%n);
//
//}
//
////最小公倍数
//int lca(int a, int b) {
//	if (a == 0) return 0;
//	if (b == 0) return 0;
//	return a * b / gcm(a, b);
//}
//
////n^k(整数)
//int pow_int(int n, int k) {
//	int re = 1;
//	for (int i = 0; i < k; i++) re *= n;
//	return re;
//}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    ll N,M;
    cin >> N >> M;
    ll sum = M * 1900 + (N-M) * 100;
    sum <<= M;
    cout << sum << endl;
}

Measured memory_bytes: 256
import numpy as np
a, b, c, d = map(int, input().split())

list = np.array([a,b,c])
if(b == np.min(list))|(b == np.max(list)):
  if abs(a-c) <= d:
    print("Yes")
    exit()
else:
  if(b - np.min(list) <= d)&(np.max(list) - b <= d):
    print("Yes")
    exit()
    
print("No")
  

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

typedef long long ll;
long long arr[100001];

int main() {
	ll a,ans=-10000000,prog=0;
	cin>>a;
	if(a==0) ans=0;
	for(ll i=0;i<a;i++) {
		cin>>arr[i];
		if(a==1) {
			ans=0;
			break;
		}
		if(i>0) {
			if(arr[i]<=arr[i-1]) {
				prog++;
			} else {
				ans=max(ans,prog);
				prog=0;
			}
			if(i==a-1) ans=max(ans,prog);
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1024
import math

n = int(input())

x = n/1.08
t1 = math.ceil(x)
t2 = math.floor(x)

if math.floor(t1 * 1.08) == n:
    print(t1)
elif math.floor(t2*1.08) == n:
    print(t2)
else:
    print(':(')

Measured memory_bytes: 9152
let k, t = Scanf.scanf " %d %d" @@ fun a b -> a, b
let a_s = Array.init t @@ fun _ -> Scanf.scanf " %d" (+) 0
let m, s = Array.(fold_left max a_s.(0) a_s, fold_left (+) 0 a_s)
let _ = Printf.printf "%d\n" @@ max 0 @@ 2 * m - s - 1

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;

vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main() {
ll N;
cin>>N;
if(N%2==1){
    cout<<0<<endl;
}
else{
    ll div=10,ans=0;
    while(true){
        ans+=N/div;
        div*=5;
        if(div>N){
            break;
        }

    }
    cout<<ans<<endl;
}
    
return 0;
}




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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

const int dx[2] = {1, 0};
const int dy[2] = {0, 1};
const int INF = 1<<30;
const ll mod = 998244353LL;

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

ll N,L,Q;
vector<ll> x;
ll rnex[30][100005];

int main() {
    cin>>N;
    x.resize(N);
    rep(i,N) cin>>x[i];
    cin>>L;
    rep(i,N){
        rep(j,30) {
            rnex[j][i] = INF;
        }
    }
    rep(i,N){
        if(i!=N-1) {
            auto rite = upper_bound(x.begin(),x.end(),x[i]+L);
            rnex[0][i] = rite-x.begin()-1;
        }
    }
    rep(i,29){
        rep(j,N){
            if(rnex[i][j]!=INF) rnex[i+1][j] = rnex[i][rnex[i][j]];
        }
    }
    cin>>Q;
    rep(i,Q){
        ll a,b;
        cin>>a>>b;
        a--;
        b--;
        ll s = min(a,b);
        ll t = max(a,b);
        ll l = 0, r = N;
        while(r-l>1){
            ll mid = (r+l)/2;
            ll L = s;
            rep(i,30){
                if(mid&(1<<i)&&L!=INF) {
                    L = rnex[i][L];
                }
            }
            if(L<t) l = mid;
            else r = mid;
        }
        cout<<r<<endl;
    }
}

Measured memory_bytes: 27512
s=list(input())
h=len(s)
def ans(s):
    n=len(s)//2
    f=0
    for i in range(n):
        if s[i]!=s[i+n]:
            f+=1
            break
    if f==0:
        return True
    else:
        return False
      
s.pop(-1)
s.pop(-1)
kai=2
while not ans(s):
    s.pop(-1)
    s.pop(-1)
    kai+=2
print(h-kai)

Measured memory_bytes: 3064
fn main() {
    let x = read();
    let mut n = 0;
    let mut count = 0;
    let mut c = 1;
    while x > n {
        n += c;
        count += 1;
        c += 1;
    }
    println!("{}", count);
}

fn read() -> u32 {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}


Measured memory_bytes: 4352
n = int(input())
l = []
ls = [0]*(n+1)

def cul(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x

for i in range(1,int(n**0.5)):
    for j in range(1,int(n**0.5)):
        for k in range(1,int(n**0.5)):
            a = cul(i,j,k)
            if a <= n:
                ls[a] += 1
for i in ls[1::]:
    print(i)

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

int main() {
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    int ans = 0;
    for (int i = 1; i <= n-2; i++) {
        if (p[i-1]<p[i] && p[i]<p[i+1]) ans++;
        if (p[i-1]>p[i] && p[i]>p[i+1]) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  LL n, m;
  cin >> n >> m;
  vector<LL> a(m);
  for (int i = 0; i < m; i ++) {
    cin >> a.at(i);
  }

  LL ans = 0;
  if (n < m) {
    LL x = n;
    sort(a.begin(), a.end());
    vector<int> b(0);
    for (int i = 1; i < m; i ++) {
      int tmp = a.at(i) - a.at(i - 1);
      b.push_back(tmp);
    }
    sort(b.begin(), b.end());
    for (int i = 0; i < m - x; i ++) {
      ans += b.at(i);
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 1660
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
#define MAXN 100
#define MAXM 10000
 
typedef long long ll;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
 
double dp[MAXN][MAXM]; // dp[n][m]はn回サイコロをふったとき合計値がmになる確率
 
int n, m, k;
 
int main(void) {
    while (cin >> n >> m >> k) {
        if (n == 0 && m == 0 && k == 0) break;
        for (int i = 0; i < MAXN; i++) 
            for (int j = 0; j < MAXM; j++) 
                dp[i][j] = 0;
 
        dp[0][0] = 1;
        int ma = n * m;
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= ma; j++) {
                for (int k = 1; k <= m; k++) {
                    if (j - k >= 0) {
                        dp[i][j] += dp[i-1][j-k] / m;
                    }
                }
            }
        }
        //for (int i = 0; i <= ma; i++) cout << dp[n][i] << endl;
        double ans = 0;
        for (int i = 1; i <= ma; i++) {
            if (i <= k) ans += 1.0*dp[n][i];
            else ans += (i-k) * dp[n][i];
        }
        printf("%.10f\n", ans);
    }
    return 0;
}

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

int main(void){
	int a, b;
	cin >> a >> b;

	if(a > b){
		cout << "a > b\n";
	}else if(a < b){
		cout << "a < b\n";
	}else{
		cout << "a == b\n";
	}

	return 0;
}

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

using namespace std;

int main(){

    int N;
    cin >> N;
    vector<string> s(N);

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

    int ans = 0;
    int cntA = 0;
    int cntB = 0;
    int same = 0;

    for(int i = 0; i < N; i++){
        string str = s[i];
        for(int j = 1; j < (int)str.size(); j++){
            if(str[j - 1] == 'A' && str[j] == 'B'){
                ans++;
            }
        }

        if(str[0] == 'B'){
            cntB++;
        }
        if(str[(int)str.size() - 1] == 'A'){
            cntA++;
        }
        if(str[0] == 'B' && str[(int)str.size() - 1] == 'A'){
            same++;
        }
    }

    /*if(same > 0){
        ans += (same - 1);
    }

    if(same >= 1 && cntA > 0){
        ans++;
        cntA--;
    }

    if(same >= 1 && cntB > 0){
        ans++;
        cntB--;
    }*/

    //ans += min(cntA, cntB);

    if(cntA == N && cntB == N){
        ans += (N - 1);
    }
    else if(same >= 1 && cntA == cntB && cntA == same){
        ans += (cntA - 1);
    }
    else{
        ans += min(cntA, cntB);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 768
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

int[2][10^^5*2] DP;

void main()
{
    auto S = readln.chomp.to!string;

    foreach_reverse (i; 0..S.length) {
        if (i == S.length-1) {
            DP[i][0] = 1;
            DP[i][1] = int.min;
        } else if (i == S.length-2) {
            DP[i][0] = S[i] == S[i+1] ? int.min : 2;
            DP[i][1] = 1;
        } else {
            if (S[i] == S[i+1]) {
                DP[i][0] = DP[i+1][1] + 1;
            } else {
                DP[i][0] = max(DP[i+1][0], DP[i+1][1]) + 1;
            }
            if (i >= S.length-3 || (DP[i] == DP[i+2] && S[i+1] == S[i+3])) {
                DP[i][1] = DP[i+2][0] + 1;
            } else {
                DP[i][1] = max(DP[i+2][0], DP[i+2][1]) + 1;
            }
        }
    }

    writeln(max(DP[0][0], DP[0][1]));
}

Measured memory_bytes: 2300
/*
 * Author: .-O_O-.
 */
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()
#define f first
#define s second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define nx cout<<"\n"
#define int long long
// void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
                                                     
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]"<<endl;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
const ll mod = 1000000007;
const ll N = 200005;
const ll mm = 1e+18;
void solve()
{
    int n;
    cin>>n;
    int x,y;
    cin>>x>>y;
    rep0(i,n-1){
        int xx,yy;
        cin>>xx>>yy;
        int x1=x/xx;
        if(x%xx) x1++;
        int y1=y/yy;
        if(y%yy) y1++;
        x=xx*max(x1,y1);
        y=yy*max(x1,y1);
        //deb(x,y);
    }
    pr(x+y);
}
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    rep1(_i,t){
        //cout<<"Case #"<<_i<<": ";
        solve();
        //nx;
    }
    return 0;
}


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

int f(int a,int c);

int main(){
  int x;
  cin >> x;
  int ans=1;
  for(int i=2; i<32; i++){
    int tmp=f(x,i);
    if(tmp>ans) ans=tmp;
  }
  cout << ans << endl;
  return 0;
}

int f(int a,int c){
  int ret=1;
  int count=0;
  while(ret<a){
    ret*=c;
    count++;
  }
  if(ret>a){
    ret/=c;
    count--;
  }
  if(count<2)ret=0;
  return ret;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int k = parseInt(sc.next());
		double[] p = new double[n];
		for (i = 0; i < n; i++) {
			p[i] = (1.0d + parseInt(sc.next()))/2;
		}
		sc.close();
		double sum = 0.0;
		for (i = 0; i < k; i++) {
			sum +=  p[i];
		}
		double max = sum;
		double tmp = 0.0;
		for (i = 0; i+k < n; i++) {
			sum -= p[i];
			sum += p[i+k];
			tmp = sum;
			if(max<tmp) {
				max = tmp;
			}
		}
		out.println(max);
	}
}


Measured memory_bytes: 63540
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
int main(){
	int s,i,j,count=0;
	// int count = 0;
	static int m[1000001];
	// int m = [1000001];
	scanf("%d",&s);
	m[0] = s;
	bool flag = true;
	while (flag){
		if (m[count]%2 == 0){
			m[count+1] = m[count]/2;
		}
		else{
			m[count+1] = m[count]*3 + 1;
		}
		for(j=0;j<count;j++){
			if (m[count+1] == m[j]){
				printf("%d",count+2);
				flag = false;
				exit(0);
			}
		}
		count += 1 ;
	}
	// printf("%d",count);
	return 0;
}

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

using namespace std;
using ll = long long int;
ll ara[2050];

int main()
{
    ll r,d,x2000,i,j;
    cin>>r>>d>>x2000;
    ara[2000]=x2000;
    for(i=2001; i<=2010; i++)
    {
        ara[i]=(r*ara[i-1])-d;
        cout<<ara[i]<<endl;
    }
}


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

int main()
{
  int K, A, B;
  cin >> K >> A >> B;
  
  bool flag = false;
  for (int i = A; i <= B; i++)
  {
    if (0 == i % K)
    {
      flag = true;
      break;
    }
  }
  
  if (flag)
  {
    printf("OK");
  }
  else {
    printf("NG");
  }

  return 0;
}

Measured memory_bytes: 3760
#include <iostream>
#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

int main (void) {
    int n;
    cin >> n;
    int a[n+2];
    a[0] = a[n+1] = 0;
    rep(i, n) cin >> a[i+1];

    int s = 0;
    rep(i, n+1) s += abs(a[i+1] - a[i]);
    rep(i, n) {
        i++;
        cout << s - abs(a[i] - a[i-1]) - abs(a[i+1] - a[i]) + abs(a[i+1] - a[i-1]) << endl;
        i--;
    } 
    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
 
int main() {
  int n;
  string s;
  cin >> n >> s;
  
  int count = 0;
  
  for (int i = 0; i < n - 2;){
    if (s.substr(i, 3) == "ABC") {
      count++;
      i += 3;
    } else {
      i++;
    }
  }
  
  cout << count << endl;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
 
bool SecondCompare(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}
 
bool SecondCompareDes(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second>b.second;
}
 
int n;
long long ans, mem;
int a[200000], b[200000], c[200000];

int main(){
   cin >> n;
   for(int i = 0; i < n; i++)   cin >> a[i];
   for(int i = 0; i < n; i++)   cin >> b[i];

    for(int i = 1; i <= 29; i++){
        mem = 0;
        for(int j = 0; j < n; j++)  c[j] = b[j]%(1<<i);
        sort(c, c+n);

        for(int j = 0; j < n; j++){
            if((a[j] & (1<<(i-1))) == 0){
                mem += lower_bound(c, c+n, (1<<i) - (a[j]%(1<<i))) - lower_bound(c, c+n, (1<<(i-1)) - (a[j]%(1<<i)));
            }
            else{
                mem += (lower_bound(c, c+n, (1<<i) - (a[j]%(1<<i)))-c);
                if(i != 1){
                    mem += n-(lower_bound(c, c+n, (1<<i)+(1<<(i-1)) - (a[j]%(1<<i)))-c);
                }
            }
        }

        if(mem%2 == 1){
            ans ^= 1<<(i-1);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 2560
// By Atul Rathore
 
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define f(n) for(int i=0;i<n;i++)
#define p(x) cout<<x<<endl;
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
 
int main()
{
	fastio;
	int r;
	cin>>r;
	double x=(double)6.28*r;
	cout<<fixed<<setprecision(2)<<x;
	
		
	
	
	
}


Measured memory_bytes: 3792
n = int(input())
l = list(map(int, input().split()))

ans = 0
l = sorted(l)
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i]!=l[j] and l[j]!=l[k] and l[k] != l[i]:
         if l[i]+l[j]>l[k] and l[j]+l[k]>l[i] and l[k]+l[i]>l[j]:
            ans += 1
          
print(ans)

Measured memory_bytes: 9200
from heapq import heappop, heappush
n, k = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(n)]
lst = sorted(lst, reverse=True, key=lambda x:x[1])
q = []
v = set()
cnt = 0
for t, d in lst[:k]:
    cnt += d
    if t in v:
        heappush(q, d)
    else:
        v.add(t)
cnt += len(v)**2
ans = cnt
for t, d in lst[k:]:
    if t not in v and len(q)!=0:
        x = heappop(q)
        cnt += d + 2*len(v) + 1 - x
        v.add(t)
        ans = max(ans, cnt)
print(ans)

Measured memory_bytes: 31692
import Control.Applicative
import Control.Monad
import Control.Monad.ST
-- import qualified Data.ByteString as BS
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
--import qualified Data.Sequence as Sequence
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
--import Data.Array.Unboxed
--import Data.Array.IArray
import Data.Array.MArray
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
import GHC.ST
-- import System.IO.Unsafe
 
-- templete
readInt = read :: String -> Int
readInteger = read :: String -> Integer
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getInteger = readLn :: IO Integer
getIntegers = map readInteger . words <$> getLine
getDouble = readLn :: IO Double
getDoubles = map readDouble . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
tjoin :: (Show a, Show b) => (a, b) -> String
tjoin (x, y) = show x ++ (' ' : show y)
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
apply4 :: (a -> a -> a -> a -> b) -> [a] -> b
apply4 f [x,y,z,w] = f x y z w
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
binMap :: (a -> a -> b) -> [a] -> [b]
binMap f (x:xs@(y:_)) = f x y : binMap f xs
binMap _ _ = []
splitRec :: Int -> [a] -> [[a]]
splitRec _ [] = []
splitRec n xs = let (y,ys) = splitAt n xs in y : splitRec n ys
infixl 7 `divCeil`
divCeil :: Integral a => a -> a -> a
x `divCeil` y = (x+y-1) `div` y
coverC :: Ord a => (a, a) -> a -> Bool
coverC (l,r) x = l<=x && x<=r
coverH :: Ord a => (a, a) -> a -> Bool
coverH (l,r) x = l<=x && x<r
ibsearch :: (Int -> Bool) -> (Int,Int) -> Int
ibsearch f (ok,ng) = if abs (ok-ng) <= 1 then ok else let mid = (ok + ng) `div` 2 in ibsearch f (if f mid then (mid,ng) else (ok,mid))
whenM :: Monad m => m Bool -> m () -> m ()
whenM c a = c >>= flip when a
-- templete

calc m f b
  | m >= b = Just 0
  | m+f >= b = Just (b - m)
  | otherwise = Nothing

main = getInts >>= putStrLn . maybe "NA" show . apply3 calc



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

using namespace std;

int main(void) {
  int A, B, C, K;
  cin >> A >> B >> C >> K;

  if (A >= K) {
    cout << K;
  } else if (A+B >= K) {
    cout << A;
  } else {
    cout << A - (K-(A+B));
  } cout << endl;

  return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<59;
const double pi=acos(-1);
const double eps=1e-7;
const ll mod=1e5;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

char x,y;

int main(){
	cin>>x>>y;
	char c;
	if(x==y) c='=';
	else if(x<y) c='<';
	else c='>';
	cout<<c<<endl;
}

Measured memory_bytes: 256
#include <iostream> 
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
using namespace std;

int n, k, a, b;
double ans;
int main() {
	cin >> n >> k;
	vector<int>vec1(n+1), vec2(n - k + 1);
	for (int i = 0; i < n; i++) {
		vec1[0] = 0;
		cin >> a;
		b += a;
		vec1[i+1] = b;
	}
	for (int i = 0; i < n - k + 1; i++) {
		vec2[i] = vec1[k + i] - vec1[i];
	}
	sort(vec2.begin(), vec2.end());
	reverse(vec2.begin(), vec2.end());
	ans = (k +(double) vec2[0]) / 2;
	printf("%.10lf", ans);
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
bool dp1[5001][5000], dp2[5001][5000];
signed main() {
  cin.tie(0); ios::sync_with_stdio(false);
  int n, k; cin >> n >> k;
  vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  // vector< vector<char> > dp1(n + 1, vector<char>(k, 0));
  // vector< vector<char> > dp2(n + 1, vector<char>(k, 0)); 
  dp1[0][0] = dp2[n][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = k - 1; j >= 0; j--) {
      dp1[i + 1][j] = dp1[i][j] or j - a[i] >= 0 and dp1[i][j - a[i]];
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = k - 1; j >= 0; j--) {
      dp2[i][j] = dp2[i + 1][j] or j - a[i] >= 0 and dp2[i + 1][j - a[i]];
    }
  }
  auto needed = [&](int i) {
    if (a[i] >= k) return true;
    int x = 0, y = k - 1;
    while (true) {
      while (x < k and not dp1[i][x]) x++;
      if (x == k) break;
      while (x + y >= k - a[i]) {
        if (y >= 0 and dp2[i + 1][y]) return true;
        y--;
      }
      x++;
    }
    return false;
  };
  int l = -1, r = n;
  while (true) {
    int m = (l + r) / 2;
    if (needed(m)) r = m;
    else l = m;
    if (r - l == 1) break;
  }
  cout << r << '\n';
  return 0;
}

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

int main(){
	int n, k;
  	cin >> n >> k;
  	vector<int> p(n), c(n);
  	rep(i, n) cin >> p[i];
    rep(i, n) cin >> c[i];
  	rep(i, n) p[i]--;
  	
  	ll ans = -1e18;
  	rep(si, n){
    	int x = si;
      	vector<int> s;
      	ll tot = 0;
      
      	while(1){
        	x = p[x];
          	s.push_back(c[x]);
          	tot += c[x];
          	if(x == si) break;
        }
      
      	int l = s.size();
      	ll t = 0;
      	rep(i, l){
          	t += s[i];
          	if(i+1 > k) break;
          	ll now = t;
        	if(tot > 0){
              	ll e = (k-i-1) / l;
            	now += tot * e; 
            }
          	ans = max(ans, now);
        }
    }
  
  	cout << ans << endl;
}

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

namespace Atcoder_0404
{
    class Program
    {
        static void Main(string[] args)
        {
           var input= GetInput_string()[0];
            if(input[0]=='7'||
                input[1]=='7'||
                input[2] == '7')
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
        #region input
        

        static string[] GetInput_string()
        {
            var input = Console.ReadLine().Split(' ');
            return input;
        }

        static int[] GetInput_int()
        {
            var input = GetInput_string();
            var result = new int[input.Length];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = int.Parse(input[i]);
            }
            return result;
        }
        static long[] GetInput_long()
        {
            var input = GetInput_string();
            var result = new long[input.Length];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = long.Parse(input[i]);
            }
            return result;
        }
        #endregion
        #region sonota
        static void Swap_array<T>(T[] target, int a, int b)
        {
            T temp = target[a];
            target[a] = target[b];
            target[b] = temp;
        }
        static void Swap_list<T>(List<T> target, int a, int b)
        {
            T temp = target[a];
            target[a] = target[b];
            target[b] = temp;
        }
        #endregion
    }
}

Measured memory_bytes: 25896
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <bitset>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, 1, 0, -1};

int main(void){
    ll a, b;
    cin >> a >> b;
    ll check = a*b;
    if(check%2==0)
        cout << "Even" << endl;
    else
        cout << "Odd" << endl;
    return 0;
}


Measured memory_bytes: 256
from collections import deque
n = int(input())

r=[]
b=[]
for i in range(n):
  r.append(list(map(int, input().split())))
for i in range(n):
  b.append(list(map(int, input().split())))
r.sort(key=lambda x: x[1], reverse=True)
b.sort()
for bi in b:
  for i in range(len(r)):
    if r[i][0] < bi[0] and r[i][1] < bi[1]:
      r = r[:i] + r[i+1:]
      break
print(n - len(r))

Measured memory_bytes: 3316
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(non_snake_case)]

use std::collections::{BinaryHeap,HashMap,HashSet};
use std::fmt::Debug;
use std::io::stdin;
use std::str::FromStr;
use std::borrow::Borrow;

/*
i32 = 10^9 (-2147483648 < x < 2147483647)
i64 = 10^18 (-9223372036854775808 < x < 9223372036854775807)
u32 = 10^9 (0 < x < 4294967295)
u64 = 10^19 (0 < x < 18446744073709551615)
*/

macro_rules! read {
  ($($t: ty),+) => ({
    let mut input = String::new();
    stdin().read_line(&mut input).expect("read error");
    let mut iter = input.split_whitespace();
    ($(iter.next().unwrap().parse::<$t>().expect("parse error"),)+)
  })
}

macro_rules! puts {
  ($($t:expr),+) => {
    $(print!("{} ", &$t);)+
    print!("\n");
  }
}

macro_rules! entry {
  ($map:expr, $idx:expr) => {(*$map.entry($idx).or_insert(0))}
}

fn main() {
  let (N, K, Q) = read!(i32, i32, i32);

  let mut score = HashMap::<i32, i32>::new();
  for _ in 0..Q {
    entry!(score, read::<i32>() - 1) += 1;
  }
  
  for i in 0..N {
    if K - (Q - entry!(score, i)) > 0 {
      print("Yes");
    } else {
      print("No");
    }
  }
}

fn print<T: std::fmt::Display>(target: T)  {
  println!("{}", target);
}

fn debug<T: Debug>(target: &T) {
  println!("{:?}", target);
}

// read from stdin
fn read<T: FromStr>() -> T {
  let mut s = String::new();
  stdin().read_line(&mut s).ok();
  s.trim().parse().ok().unwrap()
}

// read from stdin as whitespace separated vector
fn read_hvec<T: FromStr>() -> Vec<T> {
  let mut s = String::new();
  stdin().read_line(&mut s).ok();
  s.trim()
    .split_whitespace()
    .map(|e| e.parse().ok().unwrap())
    .collect()
}

// read from stdin as line separated vector
fn read_vseq<T: FromStr>(n: u64) -> Vec<T> {
  let mut v = Vec::new();
  for _ in 0..n {
    let mut text = String::new();
    stdin().read_line(&mut text).ok();
    let parsed = text.trim().parse().ok().unwrap();
    v.push(parsed);
  }
  v
}

fn read_matrix<T: FromStr>(n: u32) -> Vec<Vec<T>> {
  let mut v2 = Vec::new();
  for _ in 0..n {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    let v = s
      .trim()
      .split_whitespace()
      .map(|e| e.parse().ok().unwrap())
      .collect();
    v2.push(v);
  }
  v2
}

Measured memory_bytes: 8700
/**
*    created: 12.05.2020 09:12:50
**/
#include <bits/stdc++.h>
#define int long long
const int INF = 1e18L + 5;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;

signed main() {

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

    int x, a; cin >> x >> a;
    if (x < a) cout << 0 << endl;
    else cout << 10 << endl;
    return 0;
}

Measured memory_bytes: 256