akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
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; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

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

int code (string s) {
    if (s == "Male") return 1;
    else if (s == "Female") return 2;
    else return 0;
}
int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    string s;
    vector<int> state(n);
    // 1: male 2: female
    printf("0\n"); fflush(stdout);
    cin >> s; state[0] = code(s); if (!state[0]) return 0;
    printf("%d\n", n/2); fflush(stdout);
    cin >> s; state[n/2] = code(s); if (!state[n/2]) return 0;
    int l, r;
    if ((n/2) % 2 == 0 ^ state[n/2] == state[0]) {
        l = 0; r = n/2;
    } else {
        l = n/2; r = n;
    }
    while (r - l > 1) {
        int m = (r + l) / 2;
        printf("%d\n", m); fflush(stdout);
        cin >> s; state[m] = code(s); if (!state[m]) return 0;
        if ((m - l) % 2 == 0 ^ state[m] == state[l]) r = m;
        else l = m;
    }
    return 0;
}

Measured memory_bytes: 1356
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string j;
    cin>>j;
    for(int i=0;j[i]!='\0';i++)
    {
        int p = ((j[i]-'A') + n)%26;
        j[i] = char(p+'A');
    }
    cout<<j;
}


Measured memory_bytes: 256
#include<stdio.h>

long attack(long H)
{
  long cnt=0;
  if(H==1)
  {
    cnt = 1;
  }
  else if(H>1)
  {
    cnt = attack(H/2) * 2 + 1;
  }
  return cnt;
}

int main(void)
{
  long H;
  long cnt=0;
  
  scanf("%ld",&H);
  
  cnt = attack(H); 
  
  printf("%ld\n",cnt);
  
  return 0;
}

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

int main(void) {
    int n;
    int x[1000] = {};
    int y[1000] = {};
    double a;
    
    cin >> n;
    
    for(int i = 0; i < n; ++i) {
        cin >> x[i];
    }
    for(int i = 0; i < n; ++i) {
        cin >> y[i];
    }
    
    for(int i = 1; i <= 3; ++i) {
        a = 0;
        for(int j = 0; j < n; ++j) {
            a += pow(abs(x[j] - y[j]), i);
        }
        a = pow(a, (double)1 / i);
        printf("%lf\n", a);
    }
    a = 0;
    for(int i = 0; i < n; ++i) {
        if(a < abs(x[i] - y[i])) {
            a =  abs(x[i] - y[i]);
        }
    }
    printf("%lf\n", a);
    
    return 0;
    
}




Measured memory_bytes: 3348
#include<bits/stdc++.h>
#define Imposter ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long int
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>//s.order_of_key(val) *s.find_by_order(ind)
using namespace std;
#define f(n) for(ll i=0;i<n;i++)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define endl "\n"
#define vll vector<ll>
#define vlll vector<vll>
#define all(x) x.begin(),x.end()
ll power(ll x, ll y, ll p) { 
    ll res = 1;    x = x % p;  
    while(y > 0) {
        if(y & 1) res = (res*x) % p; 
        y = y>>1;    x = (x*x) % p; 
    } return res; 
}
int main()
{
    Imposter
    
    int t=1;
    //cin>>t;
    while(t--)
    {
        
        ll n;
        cin>>n;
        ll d[n][2];
        f(n)
        {
            cin>>d[i][0]>>d[i][1];
        }
        int f=0;
        f(n)
        {
            if(d[i][0]==d[i][1])
            {
                if(i+2<n)
                {
                    if(d[i+1][0]==d[i+1][1] and d[i+2][0]==d[i+2][1])
                    f=1;
                    
                }
            }
        }
        if(f)
        cout<<"Yes"<<endl;
        else
        cout<<"No"<<endl;
        
    }
    return 0;
}


Measured memory_bytes: 3616
N, K = map(int, input().split())
An = list(map(int, input().split()))
Bn = []
Bn.append(0)
for i in range(N):
    Bn.append(An[i]+Bn[i])
for i in range(K+1, N+1):
    if (Bn[i]-Bn[i-K] > Bn[i-1]-Bn[i-K-1]):
        print("Yes")
    else:
        print("No")



Measured memory_bytes: 31416
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;

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

        long x;
        if(N<B){
            x = N;
        }
        else{
            x = B - 1;
        }
        long ans = A * x / B - A * (x / B);

        System.out.println(ans);
    }
}

Measured memory_bytes: 35744
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;

int main() {
	int N, K;
	cin >> N >> K;
	vector<int> h(N);
	for (size_t i = 0; i < N; i++)
	{
		cin >> h.at(i);
	}
	vector<int>dp(N, mod);
	dp.at(0) = 0;
	for (int i = 1; i < N; i++)
	{
		for (int j = 1; j <= min(i,K); j++)
		{
			dp.at(i) = min(dp.at(i - j) + abs(h.at(i - j) - h.at(i)),dp.at(i));
		}
	}
		cout << dp.at(N-1);

}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
#define INF 0x7fffffff
using namespace std;
int main()
{
    int n,l;
    int i,tmp;
    long long sum=0,min=INF,mini;
    scanf("%d %d",&n,&l);
    for(i=1;i<=n;i++)
    {
        tmp=l+i-1;
        sum+=tmp;
        if(abs(tmp)<=min)
        {
            min=abs(tmp);
            mini=tmp;
        }
    }
    printf("%lld\n",sum-mini);
    return 0;
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int a, b, c;
    cin >> a >> b >> c;
    swap(a, b);
    swap(a, c);
    printf("%d %d %d\n", a, b, c);
    return 0;
}

Measured memory_bytes: 3652
def getN():
    return int(input())

def getMN():
    a = input().split()
    b = [int(i) for i in a]
    return b[0],b[1]

def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b

k,a,b = getlist()
if a >= b-2:
    print(k+1)
else:
    diff = b - a
    shortage = a - 1
    #a枚にできない
    if k <= shortage:
        print(k+1)
    else:
        remainturn = k-a+1
        changenum = remainturn //2
        ans = diff * changenum + a
        if remainturn % 2 == 1:
            #悪あがき
            ans += 1
        print(ans)


Measured memory_bytes: 3064
#include <stdio.h>

int main(void)
{
	int n, k;
	int i;

	scanf("%d%d", &n, &k);

	/*  */
	for (i = 0; n > 0; i++)
	{
		n /= k;
	}

	printf("%d\n", i);

	return 0;
}

Measured memory_bytes: 128
n, x, y = map(int, input().split())
g = [[] for i in range(n+1)]
for i in range(n-1):
    g[i+1].append(i+2)
    g[i+2].append(i+1)
g[x].append(y)
g[y].append(x)
ans = [0]*(n+1)

from collections import deque
for i in range(1, n+1):
    dist = [10**5] * (n+1)
    q = deque([i])
    dist[i] = 0
    while q:
        now = q.popleft()
        for next in g[now]:
            if dist[next] == 10**5:
                dist[next] = dist[now] + 1
                q.append(next)
    for j in range(i+1, n+1):
        ans[dist[j]] += 1

for i in range(1, n):
    print(ans[i])


Measured memory_bytes: 47452
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_vec::<usize>();
    let (h, w) = (line[0], line[1]);

    let mut v: Vec<Vec<char>> = vec![];
    for i in 0..h{
        v.push(read_as_string().chars().collect::<Vec<char>>());
    }

    for i in (0..h).rev(){
        if v[i].iter().all(|x| *x == '.'){
            v.remove(i);
        }
    }

    for i in (0..w).rev(){
        let mut is_empty = true;
        for j in 0..v.len(){
            if v[j][i] == '#'{
                is_empty = false;
            }
        }
        if is_empty{
            for j in 0..v.len(){
                v[j].remove(i);
            }
        }
    }

    for i in 0..v.len(){
        for j in 0..v[i].len(){
            print!("{}", v[i][j]);
        }
        println!("");
    }
}


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

#define int long long
#define INT int
#define MOD 1000000007

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T>
void print(T x)
{
    std::cout << x << '\n';
}
typedef long long ll;
const long long INF = 1LL << 60;

signed main()
{

    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n)
    {
        cin >> a[i];
    }
    sort(all(a));

    int amax = a[n - 1];
    bool dp[amax + 1];
    rep(i, amax + 1)
    {
        dp[i] = true;
    }

    int target = -1;
    int ans = 0;
    rep(i, n)
    {
        if (target == a[i])
        {
            continue;
        }
        target = a[i];
        if (dp[a[i]])
        {
            if (i + 1 < n && a[i] != a[i + 1])
                ans++;
            else if (i + 1 == n)
            {
                ans++;
            }

            for (int j = 1; a[i] * j <= a[n - 1]; j++)
            {
                dp[a[i] * j] = false;
            }
        }
        else
        {
            continue;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 5760
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,k = LI()
    r = 0
    for i in range(k,n+2):
        t = (0+(i-1)) * i // 2
        u = ((n-i+1)+n) * i // 2
        r += u - t + 1
        r %= mod

    return r


print(main())





Measured memory_bytes: 10972
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
//typedef tuple<ll, ll, ll> T;

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


int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,K;
    cin>>N>>K;
    vector<int> v(N);
    REP(i,N) cin>>v[i];
    int R=min(N,K);
    ll ans=0;
    for(int a=0;a<=R;a++){
        for(int b=0;a+b<=R;b++){
            vector<int> sum;
            REP(i,a){
                //cout<<i<<" ";
                sum.push_back(v[i]);
            }
            REP(i,b){
                //cout<<N-i-1<<" ";
                sum.push_back(v[N-1-i]);
            }
            VSORT(sum);
            if(K-a-b>0){
                REP(i,min(K-a-b,(int)sum.size())) if(sum[i]<0)sum[i]=0;
            }
            ll tmp=0;
            REP(i,sum.size()){
                //cout<<sum[i]<<" ";
                tmp+=sum[i];
            }
            //cout<<endl;
            ans=max(ans,tmp);
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <iomanip>
#include <queue>
using namespace std;
const int MAX_N = 200005;
const int MAX_Q = 200005;

int p[MAX_N],Q[MAX_Q],ans[MAX_N];
queue<int> V[MAX_N];

void init()
{
	for (int i = 0; i < MAX_N; ++i)
	{
		p[i] = -1;
	}
	p[1] = 1;
	return;
}

void tree(int n)
{
	//cout << "a";
	while(!V[n].empty())
	{
		int temp = V[n].front();
		V[n].pop();
		if (p[n] != temp)
		{
			p[temp] = n;
			tree(temp);
		}
	}
	return;
}

int main()
{
	int n,q;
	cin >> n >> q;
	p[1] = 1;
	int a,b;
	for (int i = 0; i < n-1; ++i)
	{
		cin >> a >> b;
		V[a].push(b);
		V[b].push(a);
	}

	//cout << "b";

	//木を構成
	init();
	tree(1);

	/*
	for (int i = 1; i <= n; ++i)
	{
		cout << i << "'s parent is " << p[i] << endl;
	}
	*/


	int t1,t2;

	for (int i = 1; i <= n ; ++i)
	{
		Q[i] = 0;
	}

	for (int i = 0; i < q; ++i)
	{
		cin >> t1 >> t2;
		Q[t1] += t2;
	}

	for (int i = 1; i <= n; ++i)
	{
		ans[i] = -1;
	}

	ans[1] = Q[1];

	for (int i = 2; i <= n; ++i)
	{
		int temp = i;
		ans[temp] = Q[temp]; 
		while(ans[p[temp]] == -1)
		{
			ans[i] += Q[p[temp]];
			temp = p[temp];
		}

		ans[i] += ans[p[temp]];
	}

	for (int i = 1; i <= n; ++i)
	{	
		if (i != 1) cout << " ";

		cout << ans[i]; 
	}

	cout << endl;
	return 0;
}

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

#define FOR0(i,n) for (int i = 0; i < n; i++)
#define FOR(i,j, n) for (int i = j; i < n; i++)
// bool isEven(ll n) {return (n%2!=0)?false:true;};
#define INF 1000000000 // 1 billion, safer than 2B for Floyd Warshall’s

#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
// #define int ll

using namespace std;

//atcoder ABC 141

//c


int main()
{
	int n, k, q;

	cin>>n>>k>>q;

	int a[n];

	FOR0(i, n) a[i] = k-q;

	int temp;

	for (int i = 0; i < q; ++i)
	{
		cin>>temp;
		temp--;

		a[temp]++;
	}
	for (int i = 0; i < n; ++i)
	{
		if(a[i]>0)
			cout<<"Yes"<<endl;
		else 
			cout<<"No"<<endl;
	}
}

Measured memory_bytes: 1024
import warnings
import numpy as np
warnings.simplefilter(action='ignore', category=FutureWarning)

h, w = map(int,input().split())
table = np.empty((h,w))

for i in range(h):
	temp = [0 if x=="." else 1 for x in list(input())]
	for j in range(w):
		table[i][j] = temp[j]

new1 = table
# print(table)

c = 0

for i in range(h):
	if not 1 in table[i]:
		new1 = np.delete(new1, i-c, 0)
		c += 1

c = 0

for j in range(w):
	if not 1 in table[:,j]:
		new1 = np.delete(new1, j-c, 1)
		c += 1

table = new1
# print(table)

for i in range(len(table)):
	z = ""
	for j in range(len(table[0])):	
		if table[i][j] == 0:
			z = z + "."
		else:
			z = z + "#"
	print(z)

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

int main(){
    int n, k, x, y, sum=0;

    cin >> n >> k >> x >> y;

    for(int i=0;i<n;i++){
        if(i<k){
            sum+=x;
        }else{
            sum+=y;
        }
    }

    cout << sum << endl;

}

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

class CumulativeSum2D{
private:
    vector<vector<ll>> CumSum;
public:
    // コンストラクタ
    CumulativeSum2D(int H, int W): CumSum(H+1, vector<ll>(W+1, 0)){}
    // 配列に値を加える
    // 引数y, x：加えたい座標. CumSum[y][x]なので注意
    void add(int y, int x, ll value){
        ++x; ++y;
        if(y >= CumSum.size() || x >= CumSum[0].size()) return;
        CumSum[y][x] += value;
    }
    // 二次元累積和を構築する
    // 引数、戻り値なし
    void build(){
        int h = CumSum.size()-1, w = CumSum[0].size()-1;
        for(int i = 0; i < h; ++i){
            for(int j = 0; j < w; ++j){
                CumSum[i+1][j+1] += CumSum[i][j+1]+CumSum[i+1][j]-CumSum[i][j];
            }
        }
    }
    // (sx,sy)から(gx,gy)までの長方形の区間にある数の総和を求める（半開区間）
    ll query(int sx, int sy, int gx, int gy){
        return CumSum[gy][gx]-CumSum[sy][gx]-CumSum[gy][sx]+CumSum[sy][sx];
    }
};

int main(){
    int n, m, q; cin >> n >> m >> q;
    CumulativeSum2D cumsum(n+1, n+1);
    int l,r;
    rep(i,m){
        cin >> l >> r;
        l--; r--;
        cumsum.add(l,r,1);
    }
    cumsum.build();
    rep(i,q){
        cin >> l >> r;
        l--;
        cout << cumsum.query(l,l,r,r) << "\n";
    }
}

Measured memory_bytes: 2944
from collections import defaultdict
from bisect import *
 
S = input().rstrip()
T = input().rstrip()
 
LS = len(S)
index = defaultdict(list)
 
for i, s in enumerate(S):
  index[s].append(i)

x = -1
loop = 0
for t in T:
  arr = index[t]  
  if len(arr) == 0:
    print(-1)
    exit()  
  i = bisect(arr, x)  
  if i == len(arr):
    loop += 1
    x = arr[0]
  else:
    x = arr[i]

print(loop*LS+x+1)

Measured memory_bytes: 7904
#include <iostream>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <numeric>
#include <cctype>
#include <climits> // INT_MAX ...
#include <cstring> // 

using namespace std;
using ll = long long;

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

    ll h, n;
    cin >> h >> n;
    vector<int> A(n);
    for (auto &x : A) cin >> x;

    ll sum = accumulate(A.begin(), A.end(), 0);
    if (h <= sum) cout << "Yes" << endl;
    else cout << "No" << endl; 
    

	return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;


public class Main 
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		for(int i=0; i<n; i++)
		{
			double[] x = new double[3];
			double[] y = new double[3];
			for(int j=0; j<3; j++)
			{
				x[j] = scanner.nextDouble();
				y[j] = scanner.nextDouble();
			}
			
			double a1 = 2*(x[1] - x[0]);
			double b1 = 2*(y[1] - y[0]);
			double c1 = (x[0]*x[0] - x[1]*x[1]) + (y[0]*y[0] - y[1]*y[1]);
			
			double a2 = 2*(x[2] - x[0]);
			double b2 = 2*(y[2] - y[0]);
			double c2 = (x[0]*x[0] - x[2]*x[2]) + (y[0]*y[0] - y[2]*y[2]);
			
			double px = (b1*c2 - b2*c1)/(a1*b2 - a2*b1);
			double py = (c1*a2 - c2*a1)/(a1*b2 - a2*b1);
			
			double r = Math.sqrt((px-x[0])*(px-x[0]) + (py-y[0])*(py-y[0]));
			
			System.out.printf("%1$.3f %2$.3f %3$.3f\n", px, py, r);
		}
	}
}

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

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
// inline void CIN() {}
// template <class Head, class... Tail>
// inline void CIN(Head &&head, Tail &&... tail) {
//     cin >> head;
//     CIN(move(tail)...);
// }
// CIN(__VA_ARGS__)
// CIN(__VA_ARGS__)
// CIN(__VA_ARGS__)
// #define Yes(a) cout << (a ? "Yes" : "No") << "\n"
// #define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef priority_queue<int> PQ;
// typedef priority_queue<int, V, greater<int>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int n;
set<string> st;

int main() {
    cin >> n;
    REP(i, n) {
        string s;
        cin >> s;
        if(s == "insert") {
            st.insert(IN<string>());
        } else {
            if(st.find(IN<string>()) != st.end()) {
                cout << "yes"
                     << "\n";
            } else {
                cout << "no"
                     << "\n";
            }
        }
    }
    return 0;
}



Measured memory_bytes: 32076
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=200010;
const ll mod=1e9+7;

 
int main(){
  ll n,k;
  cin >> n >> k;
  vector<ll> a(n);
  vector<ll> r(mx,0);
  rep(i,n){ cin >> a[i]; a[i]--; }
  rep(i,n){ r[i+1] = (r[i]+a[i]) % k; }

  ll ans = 0;
  map<int,int> mp;
  queue<int> q;
  rep(i,n+1){
    ans += mp[r[i]];

    mp[r[i]]++;
    q.push(r[i]);
    if(q.size()==k){
      mp[q.front()]--;
      q.pop();
    }
  }

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


Measured memory_bytes: 13568
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> V;
#define rep(cnt,e) for(ll cnt=0;cnt<e;cnt++ )
typedef pair<ll,ll> P;
const ll mod = 1e9+7;
const ll INF = INT64_MAX;

typedef tuple<ll,ll,ll> T;


ll i,j,k;


int main(){
    ll N;
    cin>>N;
    vector<string> S(N);
    rep(i,N)cin>>S.at(i);
    set<string> ans;
    rep(i,N)ans.insert(S.at(i));
    cout<<ans.size()<<endl;
}


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

int main(){
  int p[3], ju[2];
  int pmin = 10000, jumin=10000;

  for( int i=0;i<3;i++ ){
    cin >> p[i];
    if( p[i]<pmin ) pmin=p[i];
  }
  for( int i=0;i<2;i++ ){
    cin >> ju[i];
    if( ju[i]<jumin ) jumin=ju[i];
  }
  cout << pmin+jumin-50 << endl;


  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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; }

void solve() {
    char c;
    cin >> c;
    cout << char(c + 1) << endl;
}

signed main() {
    solve();
    
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main {
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                Map hs = new HashMap();
                PrintWriter ou = new PrintWriter(System.out);
                int a = Integer.parseInt(sc.next());
                long b = Long.parseLong(sc.next());
                long n = Long.parseLong(sc.next());
                sc.close();
                ou.print((int)(Math.floor(a * Math.min(b - 1 , n) * 1.0 / b) - a * Math.floor(Math.min(b - 1 , n) * 1.0 / b)) + "\n");
                ou.flush();
        }
}

Measured memory_bytes: 38556
if __name__ == '__main__':
    s = input()
    keyence = "keyence"
    for i in range(7):
        if s[:i] == keyence[:i] and s[-7+i:] == keyence[-7+i:]:
            print("YES")
            quit(0)

    if s[:7] == keyence:
        print("YES")
    else:
        print("NO")



Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <utility>
#include <climits>
#include <iomanip>
using namespace std;
#define MAXSIZE 100005
#define MAXL 100
#define MOD_CONST 1000000007
typedef long long int lli;

int main(){
    int n, l;
    cin >> n >> l;
    int sum = 0;
    int sub_min = 201;
    for(int i = 1; i <= n; ++i){
        sum += l + i - 1;
        sub_min = (abs(sub_min) > abs(l + i - 1))? l + i - 1 : sub_min;
    }
    int ans = sum - sub_min;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1016
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long ll;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int a,b,c;
  cin>>a>>b>>c;
  if(a==c)cout<<0;
  else cout<<1;
  return 0;
}


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

int main() {
  string N;
  cin >> N;
  int cnt = 1;
  for(int i=1; i<4; i++){
    if (N[i-1] == N[i]){
      cnt += 1;
    } else {
      cnt = 1;
    }
    if (cnt > 2){
      cout << "Yes" << endl;
      break;
    }
  }
  if (cnt < 3) {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define coR() cout << 'R'
#define coL() cout << 'L'
#define coU() cout << 'U'
#define coD() cout << 'D'
using namespace std;
int main(){
  int sx,sy,tx,ty;
  cin >> sx >> sy >> tx >> ty;
  int distx = tx - sx;
  int disty = ty - sy;
  
  rep(i,distx){ coR(); }
  rep(i,disty){ coU(); }
  rep(i,distx){ coL(); }
  rep(i,disty+1){ coD(); }
  rep(i,distx+1){ coR(); }
  rep(i,disty+1){ coU(); }
  coL();
  coU();
  rep(i,distx+1){ coL(); }
  rep(i,disty+1){ coD(); }
  coR();
  cout << endl;
}


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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

	int n;string s[3]; cin >> n >> s[0] >> s[1] >> s[2];

	int ans = 0;

	for (int i = 0;i < n;i++){
		map<char,int> cnt;
		for (int j = 0;j < 3;j++){
			cnt[s[j][i]]++;
		}
		bool flag = false;
		bool flag2 = false;
		for (auto&& j:cnt){
			if(j.second == 2) flag = true;
			if(j.second == 3) flag2 = true;
		}
		if(flag) ans++;
		else if(!flag2) ans += 2;
	}

	cout << ans << endl;

	return 0;

}


Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int length = reader.nextInt(), count = 0;
		int[] arr = new int[length];
		for (int i = 0; i < length; i++) {
			arr[i] = reader.nextInt();
		}
		for (int i = 0; i < length - 2; i++) {
			for (int j = i + 1; j < length - 1; j++) {
				if (arr[i] == arr[j]) {
					continue;
				}
				for (int k = j + 1; k < length; k++) {
					if (arr[i] == arr[k] || arr[j] == arr[k]) {
						continue;
					}
					if (arr[i] + arr[j] <= arr[k] || arr[i] + arr[k] <= arr[j] || arr[j] + arr[k] <= arr[i]) {
						continue;
					}
					else {
						//System.out.println("ijk: " + i + " " + j + " " + k);
						count++;
					}
				}
			}
		}
		System.out.println(count);
		
		reader.close();
	}
	
}


Measured memory_bytes: 36680
import collections
N = int(input())
A = sorted(list(map(int,input().split())))
cA = collections.Counter(A)

li = [1]*(max(A)+1)
for j in range(N):
    for i in range(A[j]*2,A[-1]+1,A[j]):
        li[i] = 0

for key,val in cA.items():
    if val >1:
        li[key]=0
        
sA = sum([li[i] for i in A])
print(sA)

Measured memory_bytes: 135208
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[] p=new int[6];
		p[0]=sc.nextInt();
		p[1]=sc.nextInt();
		p[2]=sc.nextInt();
		p[3]=sc.nextInt();
		p[4]=sc.nextInt();
		p[5]=sc.nextInt();
		sc.close();
		for(int i=0;i<p.length-1;i++){
			for(int j=i+1;j<p.length-1;j++){
				if(Math.abs(p[i]-p[j])>p[5]){
					System.out.println(":(");
					System.exit(0);
				}
			}
		}
		System.out.println("Yay!");
	}
}

Measured memory_bytes: 21972
INF = 10000000000

def merge(A, left, mid, right):
    count = 0
    L = A[left:mid] + [INF]
    R = A[mid:right] + [INF]
    
    i, j = 0, 0
    for k in range(left, right):
        count = count + 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
    return count

def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        countL = mergeSort(A, left, mid)
        countR = mergeSort(A, mid, right)
        return merge(A, left, mid, right) + countL + countR
    return 0
        

n = int(input())
A = [int(i) for i in input().split()]
count = mergeSort(A, 0, n)
for i in range(n):
    if i:
        print(" ", end = "")
    print(A[i], end = "")
print()
print(count)



Measured memory_bytes: 63704
#include<bits/stdc++.h>
    using namespace std;
     
    long long N;
     
    int rec(long long n,bool x3,bool x5,bool x7){
    	if(n > N) return 0;
    	long long res = 0;
    	if(n <= N && n != 0 && x3 && x5 && x7) res++;
     
    	res += rec(n*10+3,true,x5,x7);
    	res += rec(n*10+5,x3,true,x7);
    	res += rec(n*10+7,x3,x5,true);
    	return res;
    }
     
    int main(){
    	cin >> N;
    	cout<<rec(0,false,false,false)<<endl;
    	return 0;
    }

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

#ifdef LOCAL
	#define D(a) cerr << #a << " = " << a << endl
#else
	#define D(a)
	#define cerr false && cerr
#endif
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define dforsn(i,s,n) for(int i=int(n-1);i>=int(s);i--)
#define forsn(i,s,n) for(int i=int(s);i<int(n);i++)
#define dforn(i,n) dforsn(i,0,n)
#define forn(i,n) forsn(i,0,n)
#define all(a) a.begin(),a.end()
#define si(a) int((a).size())
#define pb emplace_back
#define mp make_pair
#define snd second
#define fst first
#define endl '\n'
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

int main() {
	fastio;
	
    int n; cin >> n;
    vi a(n),b(n,INT_MAX);
    forn(i,n) cin >> a[i];
    b[n-1] = 0;
    dforn(i,n){
        if(i-1 >= 0) b[i-1] = min(b[i-1],abs(a[i-1]-a[i])+b[i]); 
        if(i-2 >= 0) b[i-2] = min(b[i-2],abs(a[i-2]-a[i])+b[i]); 
    }
	cout << b[0] << endl; 
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <stdio.h>
#define MAX 100000
#define NIL -1
#define LEN 26
using namespace std;

struct Node
{
    int parent,left,right;
};
Node T[LEN];
//D[]用来记录每个节点度数，S[]用来记录每个节点的兄弟,DEP[]记录深度
int D[LEN],S[LEN],DEP[LEN],HE[LEN];

void setDepth(int u,int p)
{
    DEP[u] = p;
    if(T[u].right!=NIL)
    {
        setDepth(T[u].right,p+1);
    }
    if(T[u].left!=NIL)
    {
        setDepth(T[u].left,p+1);
    }
}
int setHeight(int u){
    int h1 = 0,h2 = 0;
    if(T[u].right!=NIL){
        h1 = setHeight(T[u].right)+1;
    }
    if(T[u].left != NIL){
        h2 = setHeight(T[u].left)+1;
    }
    return HE[u] = max(h1,h2);
}
void print(int u){
    int i;
    printf("node %d:",u);
    printf(" parent = %d",T[u].parent);
    printf(", sibling = %d",S[u]);
    printf(", degree = %d",D[u]);
    printf(", depth = %d",DEP[u]);
    printf(", height = %d",HE[u]);
    if(T[u].parent==NIL){
        printf(", root");
    }
    else if(T[u].left == T[u].right){
        printf(", leaf");
    }
    else printf(", internal node");
    printf("\n");
}
int main()
{
    int n,i,l,r,No;
    cin >> n;
    for(i = 0; i < n; i++)T[i].left = T[i].parent = T[i].right = NIL;
    for(i = 0; i < n; i++)
    {
        scanf("%d %d %d",&No,&l,&r);
        T[No].left = l;
        T[No].right = r;
        T[l].parent = T[r].parent = No;
        S[r] = l;
        S[l] = r;
        if(l!=NIL&&r!=NIL){
            D[No] = 2;
        }
        else if(l!=NIL||r!=NIL){
            D[No] = 1;
        }
        else {
            D[No] = 0;
        }
    }
    for(i = 0;i < n;i++){
        if(T[i].parent==NIL)
            r = i;
    }
    setDepth(r,0);
    setHeight(r);
    S[r] = -1;
    for(i = 0;i < n;i++){
        print(i);
    }

    return 0;
}



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

#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef vector<int> vec;
typedef vector<P> pvec;
typedef vector<vector<int>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<int> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<int,vector<int>,greater<int>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;

const vector<int> DX = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> DY = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const ll INF = (1LL << 60); // 1152921504606846976
const double PI = (3.141592653589794);
const double EPS = (0.0000000001); // 10^(-10)

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1) / b);}
template<class T> inline T round(T a, T b) {return T(a / b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
template <class T> inline void out(T &a) { bool flag=true; for(auto&x:a){if(flag) {flag=false;} else{ cout << ' '; } cout<<x; } cout << endl; }



//----------------------------------------------------------------
int nmax=200000; // 2*(10^5)
vvec G(nmax);





void solve4ts()
{
  
  
  string s;
  cin>>s;
  if(s=="ARC"){
    cout<<"ABC"<<endl;
  }
  else{
    cout<<"ARC"<<endl;
  }
  
  
}
//-----------------------------------------------------------------

signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15);
    int repeat = 1;
    // cin >> repeat;
    while(repeat--) solve4ts();
}

Measured memory_bytes: 7776
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int  [] a = new int[M];
        int [] b = new int [M];
        int [] count = new int[N];
        
        for(int i =0; i<M; i++){
            a[i]=sc.nextInt();
            b[i]=sc.nextInt();
        }
        
        for(int i =0; i<N; i++){
            count[i] = 0;
        }
        
        for(int i=0; i<M; i++){
            count[a[i]-1] += 1;
            count[b[i]-1] += 1;
        }
        
        for(int i=0; i<N; i++){
            System.out.println(count[i]);
        }
        
    }
}


Measured memory_bytes: 21844
#include <stdio.h>

int main(void)
{
	int x, y, z;
	int n, r, i;
	
	while (scanf("%d %d %d", &x, &y, &z), x != 0 || y != 0 || z != 0){
		scanf("%d", &n);
		for (i = 0; i < n; i++){
			scanf("%d", &r);
			
			if ((4 * r * r) > (x * x) + (y * y) || (4 * r * r) > (x * x) + (z * z) || (4 * r * r) > (y * y) + (z * z)){
				printf("OK\n");
			}
			else {
				printf("NA\n");
			}
		}
	}
	
	return (0);
}

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

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

int main() {
  int x;
  cin >> x;
  cout << (x < 1200 ? "ABC" : "ARC") << endl;
}



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

int n;
void dfs(string str, char d){
  if(str.length()==n){
    cout << str << '\n';
  }else{
    for(char c='a'; c<=d;c++){
      if(c==d)dfs(str+c, (char)(d+1));
      else dfs(str+c, d);
    }
  }
}
int main(){
  cin >> n;

  dfs("",'a');
}

Measured memory_bytes: 1536
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef vector<pair<int, int> > VPII;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<int, int> P;
typedef pair<int, pair<P, P> > PP;

#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
//for gcc (未test)
// #define FOREACH_IT(it,c) for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
// for Debug.
#define DUMP_VVI(b) FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}
// 入力をpush_back(d)やarray[d]に使う時に1行で書ける
// int INPUT_INT() {int d;cin>>d;return d;}
template<class T>T IN() { T d; cin >> d; return d; }
// 最大公約数（Greatest Common Divisor）
LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; }
// 最小公倍数（Least Common Multiple）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; }
// Y年はうるう年か否か
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); }

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };

// vector注意
// vec[i][j]の形に入力を入れるとき、vecは初期化してある必要がある.

// ------------------- include, typedef, define END. -------------------

int main() {
	FAST_IO;
	// for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;
	bool dbgF = true;

	//コードはここから書く.

	char a, b;
	cin >> a >> b;
	
	if (a == 'H')
		cout << b << endl;
	else
		if (b == 'H')
			cout << 'D' << endl;
		else
			cout << 'H' << endl;

	return 0;
}

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

int main(){
  int A, B;
  cin >> A >> B;
  int ans = 0;
  for(int i=A; i<=B; i++){
    string S;
    S =std::to_string(i);
    if(S.at(0)==S.at(4) && S.at(1)==S.at(3)) ans++;
  }
  cout << ans << endl;
}

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

int main(){
  int N, T, A, H, temp, ans;
  cin >> N >> T >> A;

  temp = 999999;
  for(int i = 1; i <= N; i++){
    cin >> H;
    if(abs((T*1000-H*6)-A*1000) <= temp){
      temp = abs((T*1000-H*6)-A*1000);
      ans = i;
    }
  }
  cout<<ans<<endl;

}


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

using namespace std;

int main() {
  string S;
  cin >> S;
  int n = S.size(), l{}, r{};
  vector<int> C(n);
  for (int i = 0; i != n; ++i) {
    if (S[n-i-1] == 'L') ++l;
    else {
      C[n-i] += l - l / 2;
      C[n-i-1] += l / 2;
      l = 0;
    }
    if (S[i] == 'R') ++r;
    else {
      C[i - 1] += r - r / 2;
      C[i] += r / 2;
      r = 0;
    } 
  }

  for (int i = 0; i != n; ++i) cout << (i?" " : "") << C[i];
  cout << endl;
}


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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

string M[1005];
//! [h][w]=まで行くまでの組み合わせすう
ll dp[1005][1005];

int main()
{
    int H, W;
    cin >> H >> W;
    REP(i, H)
    {
        cin >> M[i];
    }

    REP(i, 1000)
    {
        dp[0][i] = 0;
        dp[i][0] = 0;
    }
    dp[1][1] = 1;
    REP(h, H)
    {
        REP(w, W)
        {
            if (h == 0 && w == 0)
                continue;
            if (M[h][w] == '#')
            {
                dp[h + 1][w + 1] = 0;
                continue;
            }
            dp[h + 1][w + 1] = dp[h + 1][w] + dp[h][w + 1];
            dp[h + 1][w + 1] %= MOD;
        }
    }
    cout << dp[H][W] << endl;
    return 0;
}

Measured memory_bytes: 9216
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
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; }


int main() {
    int n; cin >> n;
    vector<int> B(n); rep(i, n) cin >> B[i];

    bool fg = true;
    vector<int> R;
    while(!B.empty()){
        int ins = -1;
        rep(i, B.size()){
            if(B[i] == i+1) ins = i+1;
        }
        if(ins == -1){
            fg = false; break;
        }
        R.push_back(ins);
        B.erase(B.begin()+ins-1);
    }
    if(fg){
        for(int i=n-1; i>=0; i--){
            cout << R[i] << ln;
        }
    }else cout << -1 << ln;
}


Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<float.h>

using namespace std;
#define ll long long


int main(void){
    ll N,A,B,C,D;
    string S;
   
    cin>>N>>A>>B>>C>>D>>S;
    
    if(max(C,D)>N) {
        cout<<"No"<<endl;
        return 0;
    }
    
    for(ll i=A;i<max(C,D)-2;i++){
        if(S.at(i)=='#'){
            if(S.at(i+1)=='#'){
                cout<<"No"<<endl;
                return 0;
            }
            else i++;
        }
    }
    
    if(C<D) {
        cout<<"Yes"<<endl;
        return 0;
    }
    
    for(ll i=B-2;i<D-1;i++){
        if(S.at(i)=='.'){
            if(S.at(i+1)=='.'){
                if(S.at(i+2)=='.'){
                    cout<<"Yes"<<endl;
                    return 0;
                }
                i++;
            }
            i++;
        }
    }
    cout<<"No"<<endl;
    return 0;
}


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

#define vi vector<int>
#define all(v) v.begin(),v.end()
#define ll long long int
#define  IOS    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const ll MOD=1e9+7;
const int maxn = 3*2500+5;
vector<int> sum(maxn,0);
void solve(){
   int k,s;
   cin >> k >> s;
   for(int i=0;i<=k;i++){
     for(int j=0;j<=k;j++){
        sum[i+j]++;
        sum[i+j+k+1]--;
     }
   }
   for(int i =0;i<maxn;i++){
     sum[i+1]+=sum[i];
   }
   cout << sum[s];
}


int main(){
  IOS
     solve();
}
// integer overflow
// remember to clear visited array
// take input as vector<string> while using grid


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

int main () {
	ios::sync_with_stdio(0);
	cin.tie(0);
	set<int> st;
	int T;
	cin >> T;
	while (T--) {
		int x;
		cin >> x;
		if (st.find(x) != st.end()) st.erase(st.find(x));
		else st.insert(x);
	}
	cout<<st.size()<<endl;
}


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

int calculateMoves(int a,int h,int move) {
    if(h <= 0)
    return move;
    return calculateMoves(a, h - a, move + 1);
}

int main(){
    int a,h;
    cin >> h >> a;
    int move = 0;
    cout << calculateMoves(a,h,move);
}


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

using namespace std;

typedef long long ll;

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

int main()
{
    int N;
    ll x1, x2;
    cin >> N >> x1;
    vector<ll> dist(N);
    for (int i = 0; i < N; i++) {
        cin >> x2;
        dist[i] = abs(x2 - x1);
        x1 = x2;
    }

    ll ans = dist[0];
    for (int i = 1; i < N; i++) {
        ans = gcd(ans, dist[i]);
    }

    cout << ans << endl;
}

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

int get(int y,int x) {
	int hasil=0;
	for(int i=1;i<=y;i++) {
		for(int j=i;j<=y;j++) {
			for(int r=j;r<=y;r++) {
				if((i!=r && r!=j && j!=i) && ((i+j+r)==x)) {
					hasil++;
				}
			}
		}
	}
	return hasil;
}

int main() {
	int a,b;
	while(true) {
		cin>>a>>b;
		if(a==0 && b==0) break;
		cout<<get(a,b)<<endl;
	}
}


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

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

/* solve */

int main(){
    ll n;
    string s[110];
    cin >> n;
    cin >> s[0];
    ll cur=s[0][s[0].size()-1];
    set<string> st;
    st.insert(s[0]);
    rep(i,n-1){
        cin >> s[i];
        st.insert(s[i]);
        if(cur != s[i][0]){
            cout << "No";return 0;
        }
        cur = s[i][s[i].size()-1];
    }
    if(st.size()==n){
        cout << "Yes";
    }else
        cout << "No";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define Sort(a) sort(a.begin(), a.end())
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;} return false;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;} return false;}

int main(){
    int x[6];
    int ans = 0;
    rep(i, 5){
        cin >> x[i];
        if(x[i] == 0) ans = i+1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3588