akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

///******************************** C o n t a i n e r ********************************///

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

///*********************************** C o n s t ***********************************///

const int       N=1e6+123;
const double    PI = acos(-1);
const ll        MOD=1000000007;                 ///1e9+7
ll dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};       ///first 4 for adjacent
ll dy[] = {0, +1, 0, -1, +1, -1, +1, -1};
ll dx8[]= {+1, +1, -1, -1, +2, +2, -2, -2};    ///knights move
ll dy8[]= {+2, -2, +2, -2, +1, -1, +1, -1};

///********************************** M a r c o ***********************************///

#define pb push_back
#define F first
#define S second
#define test int tc; cin>>tc; while(tc--)
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define sp <<' '
#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}
#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///*********************************** F u n c t i o n ***********************************///

ll powmod(ll a,ll b){ a%=MOD;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=MOD;--b;}a*=a;a%=MOD;b/=2;}return pr;}
ll modinverse(ll a){return powmod(a,MOD-2);}
bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}
void seive(bool a[]){ll mx=sqrt(N),ii,jj;for(ii=3;ii<=mx;ii+=2)if(!a[ii])for(jj=ii*ii;jj<N;jj+=2*ii)a[jj]=true;}
void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}
void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}

///**************************************************** C o d e ****************************************************///
///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///



void _case()
{
    ll n,i,ans=0;
    cin>>n;
    ll a[n];
    forn(i,n) cin>>a[i];
    sort(a,a+n);
    if(a[n/2]==a[n/2-1]) cout<<0 el;
    else{
        ll x=a[n/2];
        while(x!=a[n/2-1]) x--,ans++;
        cout<<ans el;
    }
}

main()
{
    fastio();
    _case();

}


///Thank you.


///Brainless_Loco Terminates Here!


Measured memory_bytes: 4392
a = list(input())
i = int(a[0])
j = int(a[1])
k = int(a[2])
l = int(a[3])
if i+j+k+l == 7:
    print("%s+%s+%s+%s=7" % (i,j,k,l))
elif i+j+k-l == 7:
    print("%s+%s+%s-%s=7" % (i,j,k,l))
elif i+j-k+l == 7:
    print("%s+%s-%s+%s=7" % (i,j,k,l))
elif i+j-k-l == 7:
    print("%s+%s-%s-%s=7" % (i,j,k,l))
elif i-j+k+l == 7:
    print("%s-%s+%s+%s=7" % (i,j,k,l))
elif i-j+k-l == 7:
    print("%s-%s+%s-%s=7" % (i,j,k,l))
elif i-j-k+l == 7:
    print("%s-%s-%s+%s=7" % (i,j,k,l))
elif i-j-k-l == 7:
    print("%s-%s-%s-%s=7" % (i,j,k,l))


Measured memory_bytes: 3064
#define _USE_MATH_DEFINES
#include  <iostream>
#include  <algorithm>
#include  <climits>
#include  <vector>
#include  <string>
#include  <cstring>
#include  <stack>
#include  <queue>
#include  <cmath>
#include  <iomanip>
#include  <set>
#include  <map>
#include  <new>
#include <cstdint>
#include <cctype>
#include  <cstdio>
#include  <sstream>
#include  <bitset>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define lrep(i,n,m)  for(int i = n; i < m; i++)

using ll = long long;
using ld = long double;
using Vii = vector<vector<int> >;
using Gjudge = vector<vector<bool>>;
using Vi = vector<int>;
using Vl = vector<ll>;
using Vd = vector<double>;
using Vld = vector<long double>;
using Vll = vector<vector<ll> >;
using Vldd = vector<vector<ld> >;
using Vs = vector<string>;
using Vb = vector<bool>;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Pli = pair<ll, int>;
using VPi = vector<Pi>;
using VPl = vector<Pl>;
using VPli = vector<Pli>;
using Ti = tuple<int, int, int>;
using Tl = tuple<ll, ll, ll>;

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

const int Mod = static_cast<int>(1e9 + 7);
const int INF = INT_MAX;
const ll LINF = LLONG_MAX;
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };

int main()
{
	int n;
	cin >> n;
	Vl X(n), Y(n);
	rep(i, n) {
		cin >> X[i] >> Y[i];
	}

	Vl fp(n), fm(n);
	rep(i, n) {
		fp[i] = X[i] + Y[i];
		fm[i] = X[i] - Y[i];
	}
	sort(fp.begin(), fp.end());
	sort(fm.begin(), fm.end());

	cout << max(fp[fp.size() - 1] - fp[0], fm[fm.size() - 1] - fm[0]);
}


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

typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { //最大公約数
  if (b==0) return a;
  else return gcd(b, a%b);
}

ll lcm(ll a, ll b) { //最小公倍数
  return a * b / gcd(a, b);
}

ll digit_sum(ll a){ //10進桁和
  ll ans=0;
  while(a>0){
    ans+=a%10;
    a/=10;
  }
  return ans;
}



int main()
{
  ll n,k,a[100010];
  cin>>n>>k;
  rep(i,n)cin>>a[i];
  n-=k;
  ll ans=1;
  ans+=n/(k-1);
  if(n%(k-1)!=0)ans++;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 4316
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int N,M,K,A,B,C,ans=0,cnt=0;
string S,T;
vector<int> P,Q;
vector<pair<int,int>> PP;
bool CAN=false;


int main(){
  cin>>N;
  double n=N;
  if(N%2==0) cout<<0.5<<endl;
  else cout<<((n+1)/2)/n<<endl;
}


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


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<vector<ll> > mat;

const int N=1e6+5;

int dp[N];

int p(ll a,ll b,ll mod)
{
	ll r=1;
	while(b)
	{
		if(b%2)r=(r*a)%mod;
		a=(a*a)%mod;
		b/=2;
	}
	return r;
}


int main()
{ios_base::sync_with_stdio(false);
cin.tie(0);
dp[0]=0;
rep(i,1,N-1)dp[i]=1+dp[i%__builtin_popcount(i)];
int n;
string s;
cin>>n>>s;
int cnt=0;
rep(i,0,n-1)
{
	if(s[i]=='1')cnt++;
}
int a1=0,a2=0;


rep(i,0,n-1)
{
	if(s[i]=='1')
	{
		a1=(a1+p(2,n-1-i,cnt+1))%(cnt+1);
		if(cnt>1)
		a2=(a2+p(2,n-1-i,cnt-1))%(cnt-1);
	}
}

rep(i,0,n-1)
{
	if(s[i]=='1')
	{
		if(cnt==1)
		{
			ol("0\n");
		}
		else
		{
			int kk=(a2-p(2,n-1-i,cnt-1))%(cnt-1);
			if(kk<0)kk+=cnt-1;
			ol(1+dp[kk]);on;
		}
	}
	else
	{
		int kk=(a1+p(2,n-1-i,cnt+1))%(cnt+1);
		ol(1+dp[kk]);on;
		//ol(kk);on;
	}
}

return 0;
}



Measured memory_bytes: 7684
#include <bits/stdc++.h>
#define F first
#define S second
#define all(a) a.begin(),a.end()
#define setDP(arr) memset(arr,-1,sizeof arr)
#define Clear(arr) memset(arr,0,sizeof arr)
#define li(x) x.size()-1
#define oo 2000000000
#define inf 1000000000000000000
#define M 1000000007
typedef unsigned long long ll;
using namespace std;
const int N =3e5+10;
const int SQRTN = 320;
const int LOGN = 20;
const double PI = acos(-1);
const double Tau = 2*acos(-1);

int n , i;


int main() {
	cin >> n >> i ;
	cout << n-i+1;
    return 0;
}


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

using namespace std;

int main(void){
	int n;

	cin >> n;

	vector<int> a(n+1);

	for (int i = 1; i < n + 1; i++){
		cin >> a[i];
	}

	cout << 2*n-1 << endl;

	int absmax = 0, id = 1;
	for (int i = 1; i < n + 1; i++){
		if (abs(absmax) < abs(a[i])){
			absmax = a[i];
			id = i;
		}
	}

	for (int j = 1 ; j < n + 1; j++){
		cout << id << " " << j << endl;
	}

	if (a[id] < 0){
		for (int i = n; i > 1; i--){
			cout << i << " " << i - 1 << endl;
		}
	}
	else{
		for (int i = 1; i < n; i++){
			cout << i << " " << i + 1 << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
typedef long long ll;

int main() {
    const ll MAXX = 1000000000000001;
    ll N;
    cin >> N;
    vector<ll> v;
    v.push_back(26);
    while(v.back() <= MAXX)v.push_back(v.back() * 26);
    rep(i,v.size()-1)v[i+1] += v[i];
    ll len = 0;
    rep(i,v.size()){
        if(N<=v[i]){
            len = i+1;
            if(i >= 1)N -= v[i-1];
            break;
        }
    }
    string ans = "";
    N--;
    while(len--){
        ans.push_back(char('a' + N%26));
        N /= 26;
    }
    reverse(all(ans));
    cout << ans << endl;
}

Measured memory_bytes: 3596
#include <iostream>

using namespace std;

int main(void) {
    int N;
    cin >> N;
    double ans = 0;
    for(int i=0; i<N; i++) {
        double A;
        cin >> A;
        ans += 1.0/A;
    }
    cout << 1.0/ans << endl;
    return 0;
}

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

using namespace std;

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	
	int n;
	cin>>n;

	int ans = 0;
	for(int i = n; i > 0;i --)
	{
		if(i >= 10000 && i < 100000)
			ans ++;
		else if(i >= 1000);
			
		else if(i >= 100)
			ans ++;
		else if(i >= 10);
		else
			ans++;
	}

	cout<<ans;
	
}

Measured memory_bytes: 256
from operator import itemgetter
from collections import deque
import sys

# スペース区切りの整数入力
n,d,a = map(int, input().split())

#指定数分の2つの整数を順番に受けてリストに入力
e = []
for i in range(n):
    e.append([int(x) for x in input().split()])
e.sort(key=itemgetter(0))

atk_times_sum = 0
atk_que = deque()
atk_acm_p = 0

for i in range(n):
    while len(atk_que) > 0:
        if atk_que[0][0] < e[i][0]:
            atk_u,atk_p = atk_que.popleft()
            atk_acm_p -= atk_p
        else:
            break
    e[i][1] -= atk_acm_p
    if e[i][1] <= 0:
        continue
    atk_u = e[i][0] + d*2
    if e[i][1] % a == 0:
        atk_times = e[i][1] // a
    else:
        atk_times = e[i][1] // a + 1
    e[i][1] = 0 
    atk_times_sum += atk_times
    atk_p = a * atk_times
    atk_acm_p += atk_p
    atk_que.append([atk_u,atk_p])

print(atk_times_sum)

Measured memory_bytes: 95532
import java.util.Scanner;

public class Main {

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

		while (true) {
			int n = sc.nextInt();
			int[] s = new int[n];
			int sum = 0;

			if (n == 0) {
				break;
			}

			for (int i = 0; i < n; i++) {
				s[i] = sc.nextInt();
//点数を合計する
				sum += s[i];
			}
//平均を出す
			double ave = sum / (double) n;
			double a = 0;
			for (int i = 0; i < n; i++) {
//偏差求める
				a += (s[i] - ave) * (s[i] - ave);
			}
//分散を求める
			a = a / (double) n;
//分散の正の平方根を計算
			System.out.println(Math.sqrt(a));
		}

	}
}


Measured memory_bytes: 31208
A, B, C = map(int, input().split())
ans = 'NO'
loop = True
cnt = 1
remainder = (B+C)%A
while loop:
    if ((B*cnt)+C)%A == 0:
        ans = 'YES'
        loop = False
    elif (remainder == (((B*cnt)+C)%A)) and (1 < cnt):
        loop = False
    cnt += 1
print(ans)


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

string a,b,c;
bool ab[100000],ac[100000],bc[100000];

bool ok(char x,char y){
	return (x=='?' || y=='?' || x==y);
}

int main(){
	cin >> a >> b >> c;
	int A=a.size(),B=b.size(),C=c.size();
	
	for(int i=0;i<A;i++)for(int j=0;j<B;j++)if(!ok(a[i],b[j]))ab[i-j+50000]=true;
	for(int i=0;i<A;i++)for(int j=0;j<C;j++)if(!ok(a[i],c[j]))ac[i-j+50000]=true;
	for(int i=0;i<B;i++)for(int j=0;j<C;j++)if(!ok(b[i],c[j]))bc[i-j+50000]=true;
	
	int ans=6000;
	
	for(int i=-4000;i<=4000;i++)for(int j=-4000;j<=4000;j++){
		bool flag=true;
		if(ab[i+50000] || ac[j+50000] || bc[j-i+50000])flag=false;
		
		if(flag)ans=min(ans,max(A,max(B+i,C+j))-min(0,min(i,j)));
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define _READ freopen("input.txt", "r", stdin);
#define _FAST                         \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
int32_t main()
{
    int n;
    cin>>n;
    vector<vector<int>> ar;
    for(int i=0;i<n;i++)
    {
        int input;
        cin>>input;
        ar.push_back({input,i+1});
    }
    sort(ar.begin(),ar.end());
    for(auto &i:ar)
        cout<<i[1]<<" ";
    return 0;
}

Measured memory_bytes: 8776
s = int(input())
lst = [0 for i in range(s)]
def find(x):
    if (x < 6):
        return(1)
    else:
        ans = 0
        for i in range(x - 3):
            ans = ans + lst[i]
        return (ans + 1)

for i in range(s):
    if (i < 2):
        pass
    else:
        j = i + 1
        lst[i] = find(j)%(10**9 + 7)

print(lst[s - 1])


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

typedef long long ll;

int main() {
	string s; ll k;
	cin>>s>>k;
	int n=s.length(), ans1=0, ans2=0;
	if (s==string(n,s[0])) {
		cout<<1ll*k*n/2<<endl;
		return 0;
	}
	for (int i=0; i+1<n; i++)
		if (s[i]==s[i+1])
			ans1++,i++;
	for (int i=0; i+1<2*n; i++)
		if (s[i%n]==s[(i+1)%n])
			ans2++,i++;
	cout<<ans1+(ans2-ans1)*(k-1)<<endl;
	return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        a: [usize; n],
    }
    let mut b = a.iter().map(|&ai| ai).collect::<Vec<_>>();
    b.sort();
    b.reverse();
    let first = b[0];
    let second = b[1];
    for i in 0..n {
        if a[i] == first {
            println!("{}", second);
        } else {
            println!("{}", first);
        }
    }
}


Measured memory_bytes: 9724
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<string> VS;
typedef priority_queue<int> PQ;
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; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//priority_queue<int,vector<int>, greater<int> > q2;


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

	int N; cin >> N;
	int ans = 1;
	FOR(i, 2, N) {
		int cnt = i;
		while (1) {
			cnt *= i;
			if (cnt <= N) {
				chmax(ans, cnt);
			}
			else break;
		}
	}


	cout << ans << endl;

	return 0;
}

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

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

	long long A, B;

	for(long long i = 1; i * i <= N; i++){
		if(!(N % i)){
			A = N / i;
			B = i;
		}
	}

	int digits = 0;
	while(A != 0){
		A /= 10;
		digits++;
	}

	cout << digits << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

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

ll lcm(ll x, ll y) {
    return x / gcd(x,y) * y;
}

int main(void)
{
    IOS
    ll n, m;
    cin >> n >> m;

    ll ans = 1;
    if (n == 1) ans = m;
    else {
        ll d = 2;
        while(d*d <= m && d*n <= m) {
            if (m % d == 0) {
                if (m/d <= m/n) ans = max(ans,m / d);
                ans = max(ans,d);
            }
            d++;
        }
    }

    cout << ans << '\n';

    return 0;
}

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

void solve(std::string S)
{
    for (int i = 0; (unsigned)i < S.length(); i++)
    {
        cout << 'x';
    }
    // for (char &c : S)
    // {
    //     cout << 'x';
    // }
    cout << endl;
}

int main()
{

    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 3620
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, i = MAP()

print(N-i+1)


Measured memory_bytes: 3888
import math
n = int(input())
m = 0

for i in range(1,n+1):
  for j in range(i,n+1):
    for k in range(j,n+1):
#      print("{}{}{}".format(i,j,k))
      if i != j and j != k and k != i:  
        m += 6*math.gcd(i,math.gcd(j,k))
      elif i == j and j == k:  
        m += math.gcd(i,math.gcd(j,k))
      else:  
        m += 3*math.gcd(i,math.gcd(j,k))
#
print(m)


Measured memory_bytes: 9192
// https://ynucpc.github.io/blog/2018/04/15/cp_vscode/
// http://www.atmarkit.co.jp/ait/articles/1509/08/news019.html

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
int stoi (string s, int tmp=10){
	istringstream stm(s);
	int res;
	stm >> res;
	return res;
}
double stod(string s, int tmp=10){
	istringstream stm(s);
	double res;
	stm >> res;
	return res;
}


// 配列の総和
// greater



int main(){
	/*
	ll A;
    cin >> A;
	cout << "hello" << endl;
	cout << stoi("14") << endl;
	*/
	ll a, b, c;
	cin >> a >> b >> c;
	cout << a * b / 2;
	


}








Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;

int main()
{
    cin.tie(0);

    int x, k;
    cin >> x >> k;

    vector<int> rs(k);
    for (auto& r : rs)
        cin >> r;
    rs.push_back(1e9 + 1);

    int qn;
    cin >> qn;
    vector<pair<int, int>> qs(qn);
    for (auto& q : qs) {
        cin >> q.first >> q.second;
    }

    int lo = 0, hi = x;
    int qi = 0;
    int prev = 0;
    int base = 0;

    for (int i = 0; i < rs.size(); i++) {
        // cerr << "hi: " << hi << ", lo: " << lo << ", base: " << base << endl;

        int dir = i % 2 == 0 ? -1 : 1;
        int r = rs[i];
        while (qi < qs.size() && qs[qi].first < r) {
            int t = qs[qi].first - prev;
            int b = min(hi - lo, max(0, qs[qi].second - base)) + lo;
            int ans = min(x, max(0, b + t * dir));
            cout << ans << endl;
            qi++;
        }

        int ma = min(x, max(0, hi + (r - prev) * dir));
        int mi = min(x, max(0, lo + (r - prev) * dir));

        base += (mi - (r - prev) * dir) - lo;

        hi = ma;
        lo = mi;

        prev = r;
    }

    return 0;
}


Measured memory_bytes: 2424
///
// File:  d.go
// Author: ymiyamoto
//
// Created on Sat Apr  7 21:14:03 2018
//
package main

import (
	"fmt"
	"math"
)

var Q int
var A, B int64
var eps float64 = 1e-9

func main() {
	fmt.Scan(&Q)
	for i := 0; i < Q; i++ {
		fmt.Scan(&A, &B)
		if A > B {
			A, B = B, A
		}

		if A == B {
			fmt.Println(2*A - 2)
		} else if A+1 == B {
			fmt.Println(2*A - 2)
		} else {
			C := int64(math.Sqrt(float64(A * B)))
			if C*C == A*B {
				C--
			}
			if C*(C+1) >= A*B {
				fmt.Println(2*C - 2)
			} else {
				fmt.Println(2*C - 1)
			}
		}
	}
}


Measured memory_bytes: 512
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include<iostream>
#include<vector>
#define MAXN 500000
#define INF 0x3f3f3f3f
#include <algorithm>
using namespace std;
bool prime[MAXN];
int a[MAXN];
void getprime()
{
    memset(prime,true,sizeof(prime));
    int k=0;
    for(int i=2;i<MAXN;i++)
    {
        if(prime[i]) a[k++]=i;
        for(int j=0;j<k&&i*a[j]<MAXN;j++)
        {
            prime[i*a[j]]=false;
            if(i%a[j]==0)break;//cout<<"?";
        }
    }
}
int main()
{
    int tail=3;
    int n;
    cin>>n;
    int cnt=0;
    int k=0;
    getprime();
    while(1)
    {

        int x=cnt*10+tail;
        if(prime[x])a[k++]=x;
        cnt++;
        if(k==n)break;
    }
    for(int i=0;i<k-1;i++)
        cout<<a[i]<<" ";
    cout<<a[k-1];

}






Measured memory_bytes: 896
#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main(){
  ll N = 0,ans1 = 0,ans2 = 0,count = 0;
  cin >> N;
  vector<ll>P(N);
  rep(i,N){
    cin >> P[i];
  }
  vector<ll>Q(N);
  rep(i,N){
    cin >> Q[i];
  }
  vector<ll>R(N);
  rep(i,N){
    R[i] = i + 1;
  }
  do{
    count++;
    rep(i,N){
      if(P == R){
        ans1 = count;
      }
    }
    rep(i,N){
      if(Q == R){
        ans2 = count;
      }
    }
  }while(next_permutation(R.begin(),R.end()));
    cout << abs(ans1-ans2);
}

Measured memory_bytes: 256
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

vector<string> strings;

map<string,int> sol;

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

    int n;
    cin >> n;
    for(int i = 0; i< n; ++i)
    {
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        strings.push_back(s);
    }
    sort(strings.begin(),strings.end());

    long long ans = 0;
    int start = 0;
    int i;
    for(i = 1; i< n; ++i)
    {
        if(strings[start] != strings[i])
        {
            long long diff = i - start;
            ans += diff*(diff-1) / 2;
            start = i;
        }
    }

    long long diff = n - start;
    ans += diff*(diff-1) / 2;


    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 5748
#include <stdio.h>

int main()
{
    int i;
    char s[105];
    scanf("%s", s);

    for(i=0; s[i]!='\0'; i+=2)
    {
            if(s[i]=='L')
            {
                printf("No\n");
                return 0;
            }
    }
    for(i=1; s[i]!='\0'; i+=2)
    {
            if(s[i]=='R')
            {
                printf("No\n");
                return 0;
            }
    }
    printf("Yes\n");


    return 0;
}


Measured memory_bytes: 128
h,w = map(int,input().split())

if h == 1:
    print(1)
elif w == 1:
    print(1)
else:
    if h % 2 != 0 and w % 2 != 0:
        print(((h*w)//2)+1)
    else:
        print((h*w)//2)    

Measured memory_bytes: 3060
/*
If you want to shine like a sun, first burn like a sun.
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ii int,int 
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf 9000000000000000000
#define minf -inf
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
const ll infinity = 9e18;

/*
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/


int main()
{
    fast

/*
    #ifndef ONLINE_JUDGE
        freopen("input.txt",  "r",  stdin);
        freopen("output.txt", "w", stdout);
    #endif
//*/

        
	int n;
	cin>>n;

	int k;
	set<int> s;
	forn(i,0,n)
	{
		cin>>k;
		s.insert(k);
	}
        
    if(s.sze == n)
    {
    	cout<<"YES";
    }    
    else
    {
    	cout<<"NO";
    }
        












    return 0;
    
}	

Measured memory_bytes: 9600
#include <iostream>
#include <cstdio>

#define MOD 1000000007
#define SIZE 200005

using namespace std;
typedef long long ll;

ll inv[SIZE], fac[SIZE], finv[SIZE];

void com_init() {
		fac[0] = fac[1] = 1;
		finv[0] = finv[1] = 1;
		inv[1] = 1;

		for (int i = 2; i < SIZE; i++) {
				inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
				fac[i] = fac[i-1] * (ll)i % MOD;
				finv[i] = finv[i-1] * inv[i] % MOD;
		}
}

ll com(int a, int b) {
		if (a < b) return 0;
		return fac[a] * (finv[b] * finv[a-b] % MOD) % MOD;
}

ll mpow(ll x, ll t) {
		if (t == 0) return 1;
		ll ret = mpow(x, t/2);
		ret = ret * ret % MOD;
		if(t%2==1) ret = ret * x % MOD;
		
		return ret;
}

int main() {
		com_init();
		int n, A, B, DC;
		scanf("%d %d %d %d", &n, &A, &B, &DC);
		ll pa = (ll)A * inv[A+B] % MOD;
		ll pb = (ll)B * inv[A+B] % MOD;
		ll ret = 0;

		for (int k = 0; k < n; k++) {
				ret += com(k+n-1, k) * mpow(pb, k) % MOD * mpow(pa, n) % MOD * (ll)(k+n) % MOD;
				ret += com(k+n-1, k) * mpow(pa, k) % MOD * mpow(pb, n) % MOD * (ll)(k+n) % MOD;
				ret %= MOD;
		}

		ret = ret * inv[A+B] % MOD * 100LL % MOD;
		printf("%lld\n", ret);

		return 0;
}


Measured memory_bytes: 4992
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

l = [A, B, C, D, E]
min = 129
count = 0

for ll in l:
    if ll % 10 <= min % 10 and ll % 10 != 0:
        if min != 129:
            count += (int(min / 10) + 1) * 10
        
        min = ll
    
    else:
        if ll % 10 == 0:
            count += ll
        else:
            count += (int(ll / 10) + 1) * 10
    
if min == 129:
    print(count)
else:
    print(count + min)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
const int N = 1e7;

int prime[N];
bool is_prime[N];

int main(){

  //高速エラトステネスできるようになりたい
  int p = 0;
  fill(is_prime + 2,is_prime + N,1);
  for(int i = 2; i < N; i++){
    if(is_prime[i]){
      prime[p++] = i;
      for(int j = 2*i; j < N; j+=i) is_prime[j] = 0;
    }
  }

  int n;
  cin >> n;
  int cnt = 0;
  for(int i = 1; i < 1e6; i++){
    if(prime[i]+2 == prime[i+1] && prime[i] <= n) cnt++;
  }
  cout << cnt*2 << endl;

  return 0;
}



Measured memory_bytes: 15496
// --------------
// Tejas Pandey  |
// 14 - 06 - 20  |
// Atcoder BC 170|
// --------------

#include <bits/stdc++.h>
using namespace std;
     
#define mod 1000000007
#define vi vector<int>
typedef long long int ll;
     
int main (void){
  //freopen("in.txt","r",stdin);
  //freopen("out.txt","w",stdout);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<pair<int,int>> v(5);
  for(int i = 0;i < 5;i++) cin >> v[i].first,v[i].second = i + 1;
  sort(v.begin(),v.end());
  cout << v[0].second;
  return 0;
}


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

typedef long long ll;
typedef long double ld;

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


int main(){
  int A, P;
  cin >> A >> P;
  
  int parts_all;
  parts_all = 3*A + P;
  
  int number_of_pi = parts_all/2;
  cout << number_of_pi << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);    
    
    int A, B; cin >> A >> B;
    cout << max(A+B, max(A-B, A*B)) << endl;
    
    
    return 0;
}

Measured memory_bytes: 256
h, w = map(int, input().split())
mod = 10**9 + 7
g = [input() for _ in range(h)]
dp = [[0 for _ in range(w)] for _ in range(h)]
dp[0][0] = 1
for i in range(h):
    for j in range(w):
        if i > 0 and g[i - 1][j] == '.':
            dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod
        if j > 0 and g[i][j - 1] == '.':
            dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod
print(dp[-1][-1])
                

Measured memory_bytes: 54876
s = ""
while (line = gets)
  s += line
end

a_ord = "a".ord
len = "z".ord - a_ord + 1
table = Array.new(len) { 0 }
s.downcase.chars.select {|x| x =~ /[a-z]/ }.map {|x| x.ord - a_ord }.each {|x| table[x] += 1 }
len.times {|x| puts "#{(x + a_ord).chr} : #{table[x]}" }

Measured memory_bytes: 8704
#include <iostream>
#include <cstdio>
#include <map>
#include <algorithm>
#define N 100005
using namespace std;

typedef long long ll;
ll n, s, a[N], b[N], ans[N];
map<ll, ll> cnt, mn, k;
bool v[N];
int main()
{
    ll i, t, tt, num;
    map<ll, ll>::iterator it;
//    freopen ("input.txt", "r", stdin);
    cin >> n;
    for (i = 1; i <= n; i++) {
        scanf ("%lld", &a[i]);
        b[i] = a[i];
        if (mn[a[i]] == 0) mn[a[i]] = i;
        cnt[a[i]]++;
    }
    t = 0;
    sort(b + 1, b + n + 1);
    for (i = 1; i <= n; i++) {
        if (b[i - 1] != b[i]) {
            num = b[i];
            k[num] = t;
            t = num;
        }
    }
    t = -1;
    for (i = n; i >= 1; i--) {
        if (b[i] == b[i + 1]) continue;
        num = b[i];
        if (t != -1) mn[num] = min(mn[num], mn[t]);
        t = num;
        s += cnt[num];
        ans[mn[num]] += s * (num - k[num]);
    }
    for (i = 1; i <= n; i++) {
        printf("%lld\n", ans[i]);
    }
    return 0;
}


Measured memory_bytes: 22144
#include<iostream>
#include<algorithm>
#include<limits>
#include<iomanip>
#include<string>

using namespace std;
 
int main(void) {
  long long int n, tmp;
  cin >> n;
  
  for(int i=0;i<n;i++) {
    cin >> tmp;
    if(tmp%2==1) continue;
    if(tmp%3!=0 && tmp%5!=0) { cout << "DENIED" << endl; return 0;}
  }
  cout << "APPROVED" << endl;
}

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

using namespace std;

using ll = long long;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int main () {
  cin.tie(0);
  cout << fixed << setprecision(10);

  string s; cin >> s;

  map<char, int> mp;
  for(int i=0;i<4;++i) {
    mp[s[i]]++;
  }  
  for(auto i:mp) {
    if(i.second != 2) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 256
program proA
  implicit none
  integer a,b,c,d,i,j,k
  character *3 s

  read(*,*) s
  do i=1,3
     if(s(i:i)=="a")then
        do j=1,3
           if ( s(j:j)=="b" ) then
              do k =1,3
                 if ( s(k:k)=="c" ) then
                    write (*,*) "Yes"
                    stop                    
                 end if
              end do
           end if
        end do
     end if
  end do

  write(*,*) "No"
  
end program proA


Measured memory_bytes: 768
#include<iostream>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b;
    if(a>0&&a<101&&b>0&&b<101)
    {
        b=b*2;
        c=a-b;
        if(c<0)
        {
            c=0;
        }
        cout<<c<<endl;
    }
    return 0;
}


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

int main(){
    string n ;
    cin >> n ;
    if (n.at(0) == '7'||n.at(1) == '7'||n.at(2) == '7')
    {
        cout << "Yes" ;
    }else
    {
        cout << "No" ;
    }
    cout << endl ;
    
}

Measured memory_bytes: 3628
s = list(input())
k = int(input())
ans = []
now = s[0]
cou = 0
if len(s) == 1:
    print(k//2)
    exit()

for i in range(len(s)):
    if now == s[i]:
        cou += 1
    elif now != s[i]:
        ans.append(cou)
        cou = 1
        now = s[i]
if cou > 0:
    ans.append(cou)
if ans[0] == len(s):
    print((ans[0]*k)//2)
    exit()
    
p = 0
for i in ans:
    p += (i//2)*k

if s[0] == s[-1]:
    p -= (ans[0]//2 + ans[-1]//2)*(k-1)
    p += ((ans[0]+ans[-1])//2)*(k-1)

print(p)

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

using namespace std; 

int main(){ 
  int n,k;
  cin>>n>>k;
  int a[n];
  for(int i=0;i<n;++i){
    cin>>a[i];
  }
  sort(a,a+n,greater<int>());
  int ans=0;
  for(int i=0;i<k;i++){
    ans+=a[i];
  }
  cout<<ans;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <utility>

using namespace std;

#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define dump(x) cerr << #x << "=" << x << endl

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<string> vs;
typedef vector<bool> bv;

int main(void) {

    string s;
    cin >> s;

    int cnt=count(all(s), 'o');
    int y=700+100*cnt;

    cout << y << endl;
}

Measured memory_bytes: 256
//g++でビルド

#include "bits/stdc++.h"

using namespace std;

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> spots;
    for(int i = 0; i < M; i++){
        int a;
        cin >> a;
        spots.push_back(a);
    }
    sort(spots.begin(), spots.end());
    vector<int> distances;
    for(int i = 1; i < M; i++){
        int dis;
        dis = spots[i] - spots[i - 1];
        distances.push_back(dis);
    }
    sort(distances.begin(), distances.end());

    int result = 0;
    if(M > N){
        for(int i = 0; i < distances.size() - N + 1; i++){
            result += distances[i];
        }
    }
    

    cout << result << endl;
    return 0;
}

Measured memory_bytes: 1400
from enum import Enum, auto
class Color(Enum):
    WHITE = auto()
    GRAY = auto()
    BLACK = auto()

n = int(input())
M = []
for i in range(n):
    arr = [int(x) for x in input().split(' ') if x != '']
    M.append(arr)
colors = []
d = []
p = [0 for i in range(n)]

INFTY = 2001
def prim():
    global d
    colors = [Color.WHITE for i in range(n)]
    d = [INFTY for i in range(n)]

    d[0] = 0 # iに入る辺の重み **最小全域木は (頂点の数)-1 = (辺の数)
    p[0] = -1 # 0を根にする

    while True:
        mincost = INFTY
        u = 0
        for i in range(n):
            if colors[i] != Color.BLACK and d[i] < mincost:
                mincost = d[i]
                u = i
        if mincost == INFTY: break

        colors[u] = Color.BLACK
        for v in range(n):
            if colors[v] != Color.BLACK and M[u][v] != -1:
                if M[u][v] < d[v]:
                    d[v] = M[u][v]
                    p[v] = u
                    colors[v] = Color.GRAY

prim()
print(sum(d))



Measured memory_bytes: 6576
#include<iostream>
#include<algorithm>
using namespace std;
int N_MAX=2000;
int t[4][2]={{1,1},{1,-1},{-1,1},{-1,-1}};
int main()
{
  int n,x,y,i,j,k,res;
  bool f[N_MAX][N_MAX];
  cin >> n >> x >> y;
  x--; y--;
  for(i=0;i<n;i++)
    fill(f[i],f[i]+n,0);
  for(i=0;i<n;i++)
    f[i][i]=1;
  for(i=1;i<n;i++){
    res=0;
    for(j=0;j+i<n;j++)
      if(f[j][j+i]==0){
        res++;
        f[j][j+i]=1;
        f[j+i][j]=1;
      }
    for(j=0;j<i;j++)
      for(k=0;k<4;k++)
        if(x+t[k][0]*j>=0&&x+t[k][0]*j<n
           &&y+t[k][1]*(i-1-j)>=0&&y+t[k][1]*(i-1-j)<n
           &&f[x+t[k][0]*j][y+t[k][1]*(i-1-j)]==0){
          res++;
          f[x+t[k][0]*j][y+t[k][1]*(i-1-j)]=1;
          f[y+t[k][1]*(i-1-j)][x+t[k][0]*j]=1;
        }
    cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 4096
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 1e18
#define MOD 100000007
#define SIZE 10005
#define PI 	3.14159265358979323846

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int R;
    cin >> R;
    if(R<1200){
        cout << "ABC" << endl;
    }else if(R<2800){
        cout << "ARC" << endl;
    }else{
        cout << "AGC" << endl;
    }
    return 0;
}

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

using namespace std;

int num[100005][4];
int dp[100005][4];

int main() {
    int n;
    cin >> n;
    for(int i=0; i<n; i++){
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        num[i][0] = a;
        num[i][1] = b;
        num[i][2] = c;
    }

    for(int i=0; i<3; i++){
        dp[0][i] = num[0][i];
    }

    for(int i=0; i<n; i++){
        for(int a=0; a<3; a++){
            for(int j=0; j<3; j++){
                if(j==a){
                    continue;
                }
                dp[i+1][j] = max(dp[i][a]+num[i+1][j], dp[i+1][j]);
            }
        }
    }

    cout << (max(max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]));

    /*for(int i=0; i<n+1; i++){
        for(int j=0; j<3; j++){
            cout << dp[i][j] << " ";
        }cout << endl;
    }*/


    return 0;
}

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

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

    int n;
    cin >> n;
    pair<pair<string, int>, int> p[n];
    for (int i = 0; i < n; ++i){
        string city;
        int score;
        cin >> city >> score;

        p[i] = make_pair(make_pair(city, -score), i);
    }
    sort(p, p+n);

    for (int i = 0; i < n; ++i) cout << p[i].second + 1 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
    //freopen("input.txt", "r", stdin);

    string s;
    cin >> s;

    bool used[26];
    for (int i = 0; i < 26; ++i)
        used[i] = false;
    int n = (int)s.size();
    if (n < 26)
    {
        for (char c : s)
            used[c - 'a'] = true;
        for (int i = 0; i < 26; ++i)
        {
            if (!used[i])
            {
                cout << s << char('a' + i);
                return 0;
            }
        }
    }
    else
    {
        for (int i = n - 1; i >= 0; --i)
        {
            used[s[i] - 'a'] = true;
            for (char c = s[i] + 1; c <= 'z'; ++c)
            {
                if (used[c - 'a'])
                {
                    for (int k = 0; k < i; ++k)
                        cout << s[k];
                    cout << c;
                    return 0;
                }
            }
        }
        cout << -1;
    }

}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int K = Integer.parseInt(scanner.nextLine());
        long total = 0;
        for (int i = 1; i <= K; i++) {
            for (int j = 1; j <= K; j++) {
                for (int k = 1; k <= K; k++) {
                    total += gcd(i, j, k);
                }
            }
        }
        System.out.println(total);
    }

    public static int gcd(int a, int b) {
        if (a >= b) {
            if (b == 0) {
                return a;
            }
            return gcd(b, a % b);
        } else {
            return gcd(b, a);
        }
    }

    public static int gcd(int a, int b, int c) {
        return gcd(a, gcd(b, c));
    }
}


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

int main() {
	int n, d;
    scanf("%d %d", &n, &d);
	int result = 0;
	for (int i = 0; i < n; i++) {
		long long x, y;
		cin >> x >> y;
		if (x * x + y * y <= (long long)d * d)
			result++;
	}
	cout << result;
}


Measured memory_bytes: 3732
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(void) {
    string s; cin >> s;
    int cnt = 0;
    rep(i, s.size()) {
        if(s[i] == '1') cnt++;
    }
    cout << cnt;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<set>
#include<map>
#define ll long long
using namespace std;

int main() {
	ll a, b, x;
	cin >> x >> a >> b;
	cout << ((abs(a - x) < abs(b - x)) ? 'A' : 'B') << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = sc.nextInt();
        if(x >= a){
            System.out.println(10);
        }else{
            System.out.println(0);
        }
    }
}


Measured memory_bytes: 22868