akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
public class Main
{
    public static void main(String [] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(); int [] a = new int [n]; HashMap<Long, Long> map = new HashMap<>();
        for (int i = 0; i < n; i++) a[i] = sc.nextInt();
        map.put((long) a[0], (long) 1); long ans = 0;
        for (long i = 1; i < n; i++) {
            ans += map.getOrDefault(i - a[(int)i], (long)0);
            map.put(i + a[(int) i], map.getOrDefault(i + a[(int) i], (long)0) + 1);
        }
        System.out.println(ans);
    }


}

Measured memory_bytes: 66960
// #include <bits/stdc++.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <map>
#include <math.h>
#include <algorithm> // std::sort, std::min, std::next_permutation, std::lower_bound
#include <iomanip> // std::setprecision
#include <cmath> // std::ceil
#include <numeric> // std::gcd, std::lcm
#include <limits> // std::numeric_limits<long int>::max()
#include <unordered_map>
#include <map>
#include <cmath> // std::atan2
#include <deque>
#include <queue>

using namespace std;
typedef long long ll;
#define INF 1999999999
#define MODA 1000000007 
#define rep(i,n) for (long long i = 0; i < (n); ++i)

int main() {
  ll N;
  cin >> N;
  vector<ll> a(N);
  rep(i,N) cin >> a[i];

  ll count = 0;
  for (ll i = 0; i < N; i+=2){
    if (a[i]%2 == 1) count++;
  }
  cout << count << endl; 
  return 0;
}



Measured memory_bytes: 3588
n,x,y = map(int,input().split())
ans = [0]*n
for i in range(1,n+1):
    for j in range(i+1,n+1):
        ans[min(abs(i-j) , abs(i-x)+1+abs(j-y)) ]+=1
        
for i in range(1,n):
    print(ans[i])

Measured memory_bytes: 3444
N = int(input())
travels = [[0, 0, 0]]
travels += [list(map(int, input().split())) for _ in range(N)]
flag = True
for i in range(N):
    cnt = 0
    cnt += abs(travels[i+1][1] - travels[i][1])
    cnt += abs(travels[i+1][2] - travels[i][2])
    time = travels[i+1][0] - travels[i][0]
    if time < cnt or (time-cnt) % 2 == 1:
        flag = False
        break
print('Yes' if flag else 'No')


Measured memory_bytes: 28148
#include<iostream>
#include<cmath>
#include<stdio.h>
using namespace std;

int main(){
  double x=0;
  double y=0;
  double angle=0;
  double r,th;
  while(1){
    scanf("%lf,%lf",&r,&th);
    if(r==0&&th==0)break;
    x+=r*sin(2*M_PI*angle/360);
    y+=r*cos(2*M_PI*angle/360);
    angle+=th;
  }
  printf("%d\n%d\n",(int)x,(int)y);
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
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 a;
  ld b;
  cin >> a >> b;
  ll c = b*100+0.1;
  ll ans = a*c;
  ans /= 100;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3732
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int res=0;
	long long a,b,c,d;
	cin>>a>>b>>c>>d;
	if(c*2==a&&d*2==b) res=1;
	cout<<fixed<<setprecision(15)<<a*b/2.0<<" "<<res<<endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
http://abc065.contest.atcoder.jp/tasks/arc076_a

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    N, M = map(int, input().split())

    res = 0
    if N == M:
        combi_N = 1
        for i in range(1, N+1):
            combi_N *= i
            combi_N %= 1000000007
        combi_M = 1
        for i in range(1, M+1):
            combi_M *= i
            combi_M %= 1000000007
        res = combi_N * combi_M * 2
        res %= 1000000007
    elif (N + 1) == M or (M + 1) == N:
        combi_N = 1
        for i in range(1, N+1):
            combi_N *= i
            combi_N %= 1000000007
        combi_M = 1
        for i in range(1, M+1):
            combi_M *= i
            combi_M %= 1000000007
        res = combi_N * combi_M
        res %= 1000000007

    print(res)


if __name__ == '__main__':
    main(sys.argv[1:])

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main()
{   
   long long  int x;
   cin>>x;
   {
       if(1800<=x&&x<=1999)
       {
           printf("1\n");
       }
       else if(1600<=x&&x<=1799)
       {
           printf("2\n");
       }
       else if(1400<=x&&x<=1599)
       {
           printf("3\n");
       }
       else if(1200<=x&&x<=1399)
       {
           printf("4\n");
       }else if(1000<=x&&x<=1199)
       {
           printf("5\n");
       }
       else if(800<=x&&x<=999)
       {
           printf("6\n");
       }
       else if(600<=x&&x<=799)
       {
           printf("7\n");
       }
       else if(400<=x&&x<=599)
       {
           printf("8\n");
       }
       
   }
    
	
	
}

Measured memory_bytes: 3624
A = [list(map(int, input().split())) for i in range(3)]
n = int(input())

b = []

for i in range(n):
  b.append(int(input()))


for i in range(len(b)):
  for a_i in range(len(A[0])):
    for a_j in range(len(A[1])):
      if A[a_i][a_j] == b[i]:
        A[a_i][a_j] = 0

ok = 0

# print(all([i == 0 for i in A[0]]))

for j in range(3):
  if all([i == 0 for i in A[j]]):
    ok += 1

for i in range(3):
  if (A[0][i] == 0 and A[1][i] == 0 and A[2][i] == 0):
    ok += 1

for i in range(3):
  if A[i][i] != 0:
    break
  if i == 2:
    ok += 1

if A[0][2] == 0 and A[1][1] == 0 and A[2][0] == 0:
  ok += 1

if ok > 0:
  print("Yes")
else:
  print("No")




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

int main(){
    int N,L,m;
    int ans = 0;
    cin >> N >> L;
    m = 1000;
    int mi = 0;
    for(int i = 0;i<N;i++){
        if (abs(L+i) < m){
            m = abs(L+i);
            mi = i;
        }
    }
    for(int i = 0;i<N;i++){
        ans += L+i;
    }
    ans -= (L+mi);
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define V(n) vector<int>(n)
#define mu vector<vector<int> >
using namespace std;
int n,m,a,b,c,t;
mu kei(mu &A,mu &B){
  mu C(n,V(n));
  r(i,n)r(j,n)r(k,n){
    C[i][j]+=A[i][k]*B[k][j];
    C[i][j]=C[i][j]%m;
  }
  return C;
}
mu M(mu &s,int x){
  mu p(n,V(n));
  r(i,n)p[i][i]=1;
  while(x>0){
    if(x&1)p=kei(p,s);
    s=kei(s,s);
    x>>=1;
  }
  return p;
}
int main(){
  while(cin>>n>>m>>a>>b>>c>>t,n){
    int s1[n],ans[n]={};
    mu s2(n,V(n));
    r(i,n)cin>>s1[i];
    r(i,n)r(j,n){
      if(j==i-1)s2[i][j]=a;
      if(j==i)s2[i][j]=b;
      if(j==i+1)s2[i][j]=c;
    }
    mu p=M(s2,t);
    r(i,n){
      int sum=0;
      r(j,n)sum+=p[i][j]*s1[j];
      ans[i]=sum;
    }
    r(i,n){
      if(i)cout<<' ';
      cout<<ans[i]%m;
    }
    cout<<endl;
  }
}

Measured memory_bytes: 3160
//Utkarsh.25dec
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val)  no. of elements strictly less than val
// s.find_by_order(i)  itertor to ith element (0 indexed)
typedef vector<vector<ll>> matrix;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=2000023;
bool vis[N];
vector <int> adj[N];
void solve()
{
    ll n;
    cin>>n;
    vl v;
    v.pb(0);
    rep(i,n)
    {
        ll c;
        cin>>c;
        v.pb(c);
    }
    ll pre[n+1]={0};
    adj[0].pb(0);
    ll zeros[n+10]={0};
    zeros[0]=1;
    for(int i=1;i<=n;i++)
    {
        pre[i]=(pre[i-1]^v[i]);
        adj[pre[i]].pb(i);
        zeros[i]=zeros[i-1];
        if(pre[i]==0)
            zeros[i]++;
    }
    if(pre[n]!=0)
    {
        ll x=pre[n];
        ll dp[n+1][2];
        memset(dp,0,sizeof(dp));
        dp[0][0]=1;
        dp[0][1]=0;
        for(int i=1;i<=n;i++)
        {
            if(pre[i]!=0)
                dp[i][0]=dp[i-1][0];
            else
                dp[i][0]=dp[i-1][0]+dp[i-1][1];
            if(pre[i]!=x)
                dp[i][1]=dp[i-1][1];
            else
                dp[i][1]=dp[i-1][0]+dp[i-1][1];
            dp[i][0]%=mod;
            dp[i][1]%=mod;
        }
        cout<<dp[n][0]<<'\n';
    }
    else
    {
        ll allzeros=adj[0].size();
        ll ans=0;
        ans+=power(2,allzeros-2);
        vl x;
        rep(i,n+1)
        {
            x.pb(pre[i]);
        }
        sort(all(x));
        x.resize(unique(all(x))-x.begin());
        for(auto res:x)
        {
            if(res==0)
                continue;
            ll a=1,b=0;
            for(int i=0;i<adj[res].size()-1;i++)
            {
                b+=a;
                b%=mod;
                ll cont=zeros[adj[res][i+1]]-zeros[adj[res][i]];
                a+=(b*cont);
                a%=mod;
            }
            b+=a;
            b%=mod;
            ans+=b;
            ans%=mod;
        }
        cout<<ans<<'\n';
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T=1;
    //cin>>T;
    int t=0;
    while(t++<T)
    {
        //cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 77496
#include <iostream>

int main()
{
	char	str;
  	std::cin >> str;
  
  	if(str == 'A')
    {
    	printf("T");
    }
  	else if(str == 'T')
    {
  		printf("A");
    }
  	else if(str == 'C')
    {
        	printf("G");
    }
  	else
    {
    	    	printf("C");
    }
  
  	return 0;
}


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

using namespace std;
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll;
long long N=1e+5;

void solve()
{
    int a,b,c;
    cin>>a>>b>>c;
    int cnt=0;
    for(int i=a; i<=b; i++)
    {
        if(i%c==0)
        {
            cnt++;
        }
    }
    cout<<cnt<<endl;
}

int main()
{
    IO;

    solve();
    return 0;
}


Measured memory_bytes: 3632
import std.stdio;
import std.string;
import std.array;
import std.range;
import std.random;
import std.algorithm;
import std.conv;

void main(){
    auto input = readln().chomp().to!int;
    (solve(input) ? "Yes" : "No").writeln();
}

bool solve(int input){
    auto sum = 0;
    foreach(c; input.to!string){
        sum += c.to!string.to!int;
    }
    return input % sum == 0;
}

Measured memory_bytes: 256
/*
  Contest 085
  B - Kagami Mochi
  Rakesh Kumar --> 17/09/2020
 */

#include <bits/stdc++.h>

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

    int n = 0;
    std::cin >> n;
    std::set<int> chaawal_ka_stupa;
    while (n--) {
        int e = 0;
        std::cin >> e;
        chaawal_ka_stupa.insert(e);
    }
    std::cout << chaawal_ka_stupa.size() << std::endl;

    return 0;
}


Measured memory_bytes: 3664
#include<iostream>

using namespace std;

long long a,b,k;
//long long check=48518828981938099;


int main(){
    cin>>k>>a>>b;
    if(a>=b-2) cout<<1+k<<endl;
    else{
        if(k<=a-1){
            cout<<1+k<<endl;
        }
        else{
            long long ans=(k-a+1)/2*(b-a)+a;
            if((k-a+1)%2!=0) ans++;
            //cout<<ans-check<<endl;
            cout<<ans<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

const MOD = 1000000007

func main() {
	sc := NewScanner()
	X, Y := sc.nextInt(), sc.nextInt()
	if (2*X-Y)%3 != 0 {
		fmt.Println(0)
		return
	}
	m := (2*X - Y) / 3
	if (Y-m)%2 != 0 {
		fmt.Println(0)
		return
	}
	n := (Y - m) / 2
	if m < 0 || n < 0 {
		fmt.Println(0)
		return
	}
	fmt.Println(combination(m+n, n, MOD))
}

func combination(big, small, m int) int {
	a := 1
	for i := big; i > 0; i-- {
		a *= i
		a %= m
	}
	b := 1
	for i := small; i > 0; i-- {
		b *= i
		b %= m
	}
	diff := big - small
	c := 1
	for i := diff; i > 0; i-- {
		c *= i
		c %= m
	}
	tmp := (a * modinv(b, m)) % m
	return tmp * modinv(c, m) % m
}

func modinv(a, m int) int {
	b := m
	u := 1
	v := 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= m
	if u < 0 {
		u += m
	}
	return u
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<set>
using namespace std;
const int64_t mod = 1e9 + 7;
int64_t comb[1021][1021]={};
int64_t dp[1010][1010]={};//dp[i][j]でj人利用して、i人のグループまで作った時の通り数。
int64_t mod_pow(int64_t n,int64_t x){//nをx乗
    if(x%2==0){
        if(x==0){
            return 1;
        }else{
            int64_t z=mod_pow(n,x/2);
            return (z*z)%mod;
        }
    }else{
        if(x==1){
            return n;
        }else{
            int64_t z=mod_pow(n,(x-1)/2);
            return (z*((z*n)%mod))%mod;
        }
    }
}

int main(){
    int MAX_N = 1010;
    for (int i = 1; i <=MAX_N; i++) {
        for (int j = 1; j <= MAX_N; j++) {
            if (j == 1)                 // 行の左端は 1
                comb[i][j] = 1;
            else if (j == i) {          // 行の右端も 1
                comb[i][j] = 1;
                break;        // 右端まで計算したので内側のループから抜ける
            }
            else{              // 行の途中は一つ上の二つの要素の合計
                comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j])%mod;
            }
        }
    }/*
    for(int i=1;i<=10;i++){
        for(int j=1;j<=i;j++){
            cout<<comb[i][j]<<' ';
        }cout<<endl;
    }*/
    int64_t facto[1001]; facto[0]=1; facto[1]=1;
    for(int i=2;i<=1000;i++){
        facto[i]=facto[i-1]*i % mod;
    }
    int N,A,B,C,D;
    cin>>N>>A>>B>>C>>D;
    dp[B+1][0]=1;
    for(int i = B ; i >=A ;i--){//i人チーム
        for(int k=N ;k >= 0;k--){
            if(dp[i+1][k] != 0){
                //i人のチームを作らない場合
                dp[i][k] = (dp[i][k] + dp[i+1][k])%mod;
                //i人のチームを作る場合
                int64_t hoge = 1;
                int64_t rem = N - k;
                for(int j=C ; j<=D ; j++){
                    if(k + i*j > N){
                        break;
                    }
                    if(j==C){
                        for(int l=1;l<=C;l++){
                            hoge = (hoge * comb[rem+1][i+1]) % mod;
                            rem-=i;
                        }
                        dp[i][k+i*j] = (dp[i][k+i*j] + ((dp[i+1][k]*hoge%mod)*mod_pow(facto[j],mod-2)%mod))%mod;
                    }else{
                        hoge = (hoge * comb[rem+1][i+1]) % mod;
                        rem -= i;
                        dp[i][k+i*j] = (dp[i][k+i*j] + ((dp[i+1][k]*hoge%mod)*mod_pow(facto[j],mod-2)%mod))%mod;
                    }
                }
            }
        }
    }
    /*
    for(int i=A;i<=B;i++){
        for(int j=0;j<5;j++){
            cout<<dp[i][j]<<' ';
        }cout<<endl;
    }*/
    cout<<dp[A][N]<<endl;
    return 0;
}


Measured memory_bytes: 14208
#include <iostream>
#define create_tmp_num(a, b) a * 10 + b

using namespace std;
int main(void){
    cin.tie(0);
    iostream::sync_with_stdio(false);

    int input[3];
    cin >> input[0] >> input[1] >> input[2];

    int max=0;
    int index;
    for(int i=0; i <= 2; i++){
        if(max < create_tmp_num(input[i], input[(i+1)  % 3])){
         max = create_tmp_num(input[i], input[(i+1)  % 3]);
         index = (i + 2) % 3;
        }
        if(max < create_tmp_num(input[i], input[(i+2)  % 3])){
         max = create_tmp_num(input[i], input[(i+2)  % 3]);
         index = (i + 1) % 3;
        }
    }
    cout << max + input[index] << '\n';
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <tr1/unordered_map>
using namespace std;
#define ll long long
#define re register
#define pb push_back
#define fi first
#define se second
const int N=1e6+10;
const int M=1e6;
const int mod7=1e9+7;
const int mod=998244353;
void read(int &a)
{
    a=0;int d=1;char ch;
    while(ch=getchar(),ch>'9'||ch<'0')
        if(ch=='-')
            d=-1;
    a=ch^48;
    while(ch=getchar(),ch>='0'&&ch<='9')
        a=(a<<3)+(a<<1)+(ch^48);
    a*=d;
}
void read(ll &a)
{
    a=0;int d=1;char ch;
    while(ch=getchar(),ch>'9'||ch<'0')
        if(ch=='-')
            d=-1;
    a=ch^48;
    while(ch=getchar(),ch>='0'&&ch<='9')
        a=(a<<3)+(a<<1)+(ch^48);
    a*=d;
}
int main()
{
    double a;
    cin>>a;
    printf("%.2f",3.1415926*a*2);
    return 0;
}

Measured memory_bytes: 3788
S = input()
N = len(S)
left_R = [0] * N
right_L = [N-1] * N

for i, s in enumerate(S[1:], 1):
  left_R[i] = i if s == 'R' else left_R[i-1]

for i, s in enumerate(S[N-2::-1], 1):
  i = N-1-i
  right_L[i] = i if s == 'L' else right_L[i+1]

answer = [0] * N
for i, (s, R, L) in enumerate(zip(S, left_R, right_L)):
  if s == 'L':
    j = left_R[i]
    if (i+j) & 1:
      j += 1
  else:
    j = right_L[i]
    if (i+j) & 1:
      j -= 1
  answer[j] += 1
print(' '.join(map(str, answer)))
  


Measured memory_bytes: 21760
N, T = list(map(int, input().split()))
A = list(map(int, input().split()))

mi = A[0]
ma = 0
cnt = 0
for i in range(1, N):
  if mi > A[i]:
    mi = A[i]
  else:
    if A[i] - mi == ma:
      cnt += 1
    elif A[i] - mi > ma:
      cnt = 1
      ma = A[i] - mi
print(cnt)

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

  
int main(){
 int x1,y1,x2,y2;
  cin >> x1 >> y1 >>x2 >> y2;
int x3,y3,x4,y4;
  x3=x2-(y2-y1);
  y3=y2+(x2-x1);
  x4=x1-(y2-y1);
  y4=y1+(x2-x1);
  cout << x3 <<" " <<y3 << " " <<x4 << " " << y4 <<endl;
        

}
 

Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 N;
  std::cin >> N;
  for (i64 X = 0; X <= N; ++X) {
    if (X * 108 / 100 == N) {
      std::cout << X << std::endl;
      return 0;
    }
  }
  std::cout << ":(" << std::endl;
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

int main(){
  ios::sync_with_stdio(false);
  int a, b;
  cin >> a >> b;
  if((a+b) % 2 == 0)
    cout << abs((a+b)/2) << endl;
  else
    cout << "IMPOSSIBLE" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector<ll> vi;
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
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(){
  ll a, b;
  cin >> a >> b;
  if(a==1&&b==1){
    print("Draw");
  }
  else if(a==1&&b!=1){
    print("Alice");
  }
  else if(a!=1&&b==1){
    print("Bob");
  }
  else{
    if(a==b){
      print("Draw");
    }
    else if(a>b){
      print("Alice");
    }
    else{
      print("Bob");
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std ;
#define N 100000+5
#define int long long int
int n,a[N][3] , dp[N][4];
int f(int i,int choice)
{
     if( i < 0 ) return 0 ;
     int ans = -1000000000 ;
     if( dp[i][choice] != -1 ) return dp[i][ choice ] ;
     for( int j = 1 ;j <= 3 ; j++ )
     {
         if( choice != j )
         {
             ans = max( ans , a[i][j-1] + f( i-1 , j )  ) ;
         }
     }
     return dp[i][choice] = ans ;
}

signed main()
{
    cin >> n ;
    for( int i=0;i<n;i++ ) {cin >> a[i][0] >> a[i][1] >> a[i][2] ;
     for( int j=0 ; j<4;j++ ) dp[i][j] = -1 ;
    }
    cout << f(n-1,0) ;
    return 0 ;
}


Measured memory_bytes: 13568
#include <iostream>
#include <bitset>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <queue>
using namespace std;
using ll = long long int;
#define REP(i,n) for(int i=0;i<n;i++)

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int H, W;
    cin >> H >> W;
    vector<vector<int>> memo(1010, vector<int>(1010));
    queue<pair<int, int>> points;
    for(int row = 0; row < H; row++)
    {
        for(int col = 0; col < W; col++)
        {
            char c;
            cin >> c;
            memo[row][col] = -1;
            if (c == '#')
            {
                points.emplace(pair<int, int>(row, col));
                memo[row][col] = 0;
            }
        }
    }

    long max=-1;
    while(!points.empty())
    {
        pair<int, int> searching = points.front();
        points.pop();
        int row = searching.first;
        int col = searching.second;
        //cout << "Searching: (" << row << ", " << col << ") | ";
        int now = memo[row][col];
        //cout << "now: " << now << endl;
        if (max < now)
            max = now;
        if (row > 0)
        {
            if (memo[row-1][col] == -1)
            {
                points.emplace(pair<int, int>(row-1, col));
                memo[row-1][col] = now+1;
            }
        }
        if (row < H)
        {
            if (memo[row+1][col] == -1)
            {
                points.emplace(pair<int, int>(row+1, col));
                memo[row+1][col] = now+1;
            }
        }
        if (col > 0)
        {
            if (memo[row][col-1] == -1)
            {
                points.emplace(pair<int, int>(row, col-1));
                memo[row][col-1] = now+1;
            }
        }
        if (col < W)
        {
            if (memo[row][col+1] == -1)
            {
                points.emplace(pair<int, int>(row, col+1));
                memo[row][col+1] = now+1;
            }
        }
    }
    
    cout << max << endl;
}

Measured memory_bytes: 12432
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
const long long mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
const int ddx[4] = {1,1,-1, -1};
const int ddy[4] = {1,-1,-1,1};
//////////////////////////////////

int main(){
  int n; cin >> n;
  vector<int> a(n);
  int x;
  for(int i=1; i<n; i++) {
    cin >> x;
    a[x-1]++;
  }
  for(int i=0; i<n; i++) {
    cout << a[i] << endl;
  }

}

// EOF


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

#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); i--)
#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a))

#define SZ(a) (int) a.size()
#define ALL(a) a.begin(),a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const LL INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const int MAX = 2 * 1000 * 100 + 47;

#define x1 asd
#define y1 dgfg
#define x2 were
#define y2 vcx

struct Fenvic
{
    int T[MAX];
    int n;
    void init(int n1)
    {
        n = n1;
    }
    
    void add(int i, int val)
    {
        for(; i < n; i = i | (i  + 1))
        {
            T[i] = max(T[i], val);
        }
    }
    
    int get(int i)
    {
        int res = 0;
        for(; i >= 0; i = (i & (i + 1)) - 1)
        {
            res = max(res, T[i]);
        }
        
        return res;
    }
} F;

PII A[MAX];
vector<PII> B;
vector<int> T;
int x1, y1, x2, y2, n;

bool inside(int x, int y)
{
    return x >= x1 && y >= y1 && x <= x2 && y <= y2;
}

bool cmp(PII a, PII b)
{
    if (a.second == b.second)
    {
        return a.first < b.first;
    }
    
    return a.second < b.second;
}

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios::sync_with_stdio(false); cin.tie(0);
	cin >> x1 >> y1 >> x2 >> y2 >> n;
	FOR(i,0,n)
	{
	    cin >> A[i].first >> A[i].second;
	}
	
	if (x1 > x2)
	{
	    swap(x1, x2);
	    swap(y1, y2);
	}
	
	if (y1 > y2)
	{
	    y2 = y1 + y1 - y2;
	    FOR(i,0,n)
	    {
	        A[i].second = y1 + y1 - A[i].second;
	    }
	}
	
	FOR(i,0,n)
	{
	    if (!inside(A[i].first, A[i].second)) continue;
	    B.PB(A[i]);
	}
	
	FOR(i,0,SZ(B))
	{
	    T.PB(B[i].first);
	}
	
	sort(ALL(T));
	T.resize(unique(ALL(T)) - T.begin());
	FOR(i,0, SZ(B))
	{
	    B[i].first = lower_bound(ALL(T), B[i].first) - T.begin();    
	}
	
	sort(ALL(B), cmp);
	F.init(SZ(B));
	
	int cnt = 0;
	FOR(i,0, SZ(B))
	{
	    int tmp = F.get(B[i].first);
	    F.add(B[i].first, tmp + 1);
	    cnt = max(cnt, tmp + 1);
	}
	
	//cout << "!" << cnt << endl;
	
	double ans = x2 - x1 + y2 - y1;
	ans *= 100;
	
	if (cnt == min(x2 - x1, y2 - y1) + 1)
	{
	    ans += (-20 + 5 * PI) * (cnt - 1);
	    ans += -20 + 10 * PI;
	}else
	{
	    ans += (-20 + 5 * PI) * cnt;
	}
	
	cout << fixed << setprecision(15) << ans << endl;
}

Measured memory_bytes: 6000
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
for (int i=0; i<N; i++){
  string S;
  cin >> S;
  
  if (S == "Y"){
    cout << "Four" << endl;
    break;
  }
  if (i == N-1){
        cout << "Three" << endl;
  }
  
}
}

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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/
int main() {
  ll n,k,r,s,p;
  string t;
  cin >> n >> k >> r >> s >> p;
  cin >> t;

  vector<string> vs(k,"");
  REP(i,n){
    ll j = i%k;
    vs[j] = vs[j] + t[i];
  }

  ll ans = 0;
  REP(i,k){
    ll tl = vs[i].length();
    vl dpr(tl+1,0);
    vl dps(tl+1,0);
    vl dpp(tl+1,0);
    REP(j,tl){
      dpr[j+1] = max(dps[j],dpp[j]);
      dps[j+1] = max(dpp[j],dpr[j]);
      dpp[j+1] = max(dpr[j],dps[j]);
      if(vs[i][j]=='r') dpp[j+1] += p;
      if(vs[i][j]=='s') dpr[j+1] += r;
      if(vs[i][j]=='p') dps[j+1] += s;
    }
    ans += max(dpr[tl],max(dps[tl],dpp[tl]));
  }
  
  //cout << fixed << setprecision(10);
  cout << ans << endl;
  return 0;
}


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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define ture ture
#define flase false
#define falg flag

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;//llの最大9*10^18
const int INF = pow(2, 30) - 1;

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

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

    ll N;
    string S,T;
    cin >> S>>T;

    ll ans = INF;

    REP(i,S.size()-T.size()+1){
        ll tmp = T.size();
        REP(j,T.size()){
            if(S.at(i+j)==T.at(j)){
                tmp--;
            }
        }
        ans = min(ans, tmp);
    }

    cout << ans << endl;
}


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

int main(int argc, char const *argv[])
{
	int n;
	string s;
	cin>>n>>s;
	int ans=0;
	for (int i = 1; i < n; ++i)
	{
		int nans=0;
		set<char> tmp1,tmp2;
		for (int j = 0; j < i; ++j)
		{
			tmp1.insert(s[j]);
		}
		for (int j = i; j < n; ++j)
		{
			tmp2.insert(s[j]);
		}
		for (int i = 0; i <= 'z'-'a'; ++i)
		{
			if (tmp1.count('a'+i)>0&&tmp2.count('a'+i)>0)
			{
				++nans;
			}
		}
		ans=max(ans,nans);
	}
	cout<<ans<<endl;
	return 0;
}


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

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

    for(int h=0;h<n;h++){
        for(int w=0;w<m;w++){
            cin>>a[h][w];
        }
    }
    for(int i=0;i<m;i++){
        cin>>b[i];   
    }

    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            c[i]+= (a[i][j]*b[j]);
        }
    }

    for(int i=0;i<n;i++){
        cout<<c[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long A,B,C,K;
  cin >> A >> B >> C >> K;
  long total = 0;

  for(int i=0;i<A;i++){
      total ++;
      K--;
      if(K <= 0)break;
  }
  if(K >= 1){
      for(int i=0;i<B;i++){
          K--;
          if(K <= 0) break;
      }
  }
  if(K >= 1){
      for(int i=0;i<C;i++){
          total --;
          K--;
          if(K <= 0) break;
      }
  }

  cout << total;
}


Measured memory_bytes: 3628
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = new Date();
  Main();
  var end = new Date() - start;
  
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var N = nextInt();
	var list = nextIntArray();
	var max = 0;
	for(var i = 0; i < N - 1; i++){
		for(var j = i + 1; j < N; j++){
			max = Math.max(max, Math.abs(list[i] - list[j]));
		}
	}
	myout(max);
}


Measured memory_bytes: 30360
N = int(input())

from math import sqrt
from collections import defaultdict
ans = defaultdict(int)
k = int(sqrt(N)) + 5
for x in range(1, k):
    for y in range(1, k):
        for z in range(1, k):
            ans[x**2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1


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

Measured memory_bytes: 73132
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(int i=0;i<(int)n;i++)
#define PI acos(-1)
#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);
ll mod=1e9+7;

ll rep_pow(ll a, ll b){//繰り返し2乗法
    if(b==0) return 1;
    else if(b%2==0){
        ll memo = rep_pow(a, b/2);
        return memo*memo%mod;
    }else{
        return rep_pow(a, b-1)*a%mod;
    }
}

ll nCr(ll n, ll r){//mod逆元使ったnCr
    ll ret=1;
    rep(i,r){
        ret *= n-i;//分子
        ret %= mod;
        ret *=rep_pow(r-i, mod-2);//mod逆元によりr!で割ると同値
        ret %= mod;
    }
    return ret;
}
ll gcd(ll a, ll b){ if(b==0) return a; return gcd(b, a%b);}

int counter(int x){
    if(x==0) return 0;
    return counter(x>>1)+(x&1);
}


int main(){
    fast_io

    int h,w;
    cin>>h>>w;
    string s[h][w];
    rep(i,h) rep(j,w) cin>>s[i][j];

    rep(i,h){
        rep(j,w){
            if(s[i][j]=="snuke"){
                cout<<(char)(j+'A')<<i+1<<endl;
                return 0;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 256
/* ＵＴＦ－８ */
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

#define USE_COLORED 1

#ifdef USE_COLORED
static const char stdout_pre[]  = "\033[1m"; // bold black
static const char stderr_pre[]  = "\033[31;1m"; // bold red
static const char stdxxx_post[] = "\033[m";

// 当然ながら GCC(g++)/libstdc++ 依存
#include <ext/stdio_filebuf.h>
using stdio_filebuf = __gnu_cxx::stdio_filebuf<char>;
class colored_stdio_filebuf : public stdio_filebuf {
private:
	const char* const pre_;
	const char* const post_;

public:
	colored_stdio_filebuf(FILE* fp, const char* pre, const char* post) : stdio_filebuf(fp, std::ios_base::out), pre_(pre), post_(post)
	{
	}

protected:
	std::streamsize xsputn(const char* s, std::streamsize count) override
	{
		stdio_filebuf::xsputn(pre_, strlen(pre_));
		auto ret = stdio_filebuf::xsputn(s, count);
		stdio_filebuf::xsputn(post_, strlen(post_));
		return ret;
	}
};
#endif

int main()
{
#ifdef USE_COLORED
	if (getenv("DEBUG")) {
		std::cout.rdbuf(new colored_stdio_filebuf(stdout, stdout_pre, stdxxx_post));
		std::cerr.rdbuf(new colored_stdio_filebuf(stderr, stderr_pre, stdxxx_post));
	} else
#endif
	{
		int fd = open("/dev/null", O_WRONLY);
		dup2(fd, 2);
		close(fd);
	}
	
	int x, a, b;
	std::cin >> x >> a >> b;
	if (std::abs(x-a) <= std::abs(x-b))
		std::cout << "A\n";
	else
		std::cout << "B\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll gcd(int a,int b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(int a,int b){return a*b/gcd(a,b);}
const int INF=1e9;
const ll INFS=1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);

int main() {
  double n,k;
  cin>>n>>k;
  double sum=0,ans=0,cnt=0;
  vector<double> p(n);
  rep(i,n) cin>>p[i];
  vector<double> tot(n);
  rep(i,n){
    sum+=p[i];
    tot[i]=sum;
  }
  rep(i,n-k+1){
    cnt=(tot[i+k-1]-tot[i]+p[i]+k)/2;
    ans=max(cnt,ans);
  }
  printf("%.10f\n",ans);
}

Measured memory_bytes: 6468
<?php
// 都市と道路の数を取得する
$inputs     = explode(' ', trim(fgets(STDIN)));
$city_count = (int)$inputs[0];
$path_count = (int)$inputs[1];

// 各都市から伸びる経路を取得する
$paths = [];
do {
    $inputs  = explode(' ', trim(fgets(STDIN)));
    $paths[] = (int)$inputs[0];
    $paths[] = (int)$inputs[1];
} while (count($paths) < $path_count * 2);

sort($paths);

$answers = array_pad([], $city_count, 0);
foreach ($paths as $path) {
    $answers[$path - 1]++;
}

foreach ($answers as $answer) {
    echo "$answer\n";
}


Measured memory_bytes: 15952
#include<cstdio>
#include<algorithm>
#include<vector>
#include<functional>
int par[100000],n;
typedef std::pair<int,int> pii;
typedef std::pair<int,pii> pipii;
int root(int x){
    if(par[x]==x)return x;
    else return par[x]=root(par[x]);
}
bool unite(int x,int y){
    if(root(x)!=root(y)){
        par[root(x)]=root(y);
        return true;
    }else return false;
}
int main(){
    scanf("%d",&n);
    std::vector<pii> px,py;
    for(int i=0;i<n;i++){
        par[i]=i;
        int x,y;
        scanf("%d%d",&x,&y);
        px.push_back({x,i});
        py.push_back({y,i});
    }
    std::sort(px.begin(),px.end());
    std::sort(py.begin(),py.end());
    std::vector<pipii> g;
    for(int i=1;i<n;i++){
        g.push_back({px[i].first-px[i-1].first,{px[i].second,px[i-1].second}});
        g.push_back({py[i].first-py[i-1].first,{py[i].second,py[i-1].second}});
    }
    std::sort(g.begin(),g.end(),std::greater<pipii>());
    int num=1;
    long long ans=0;
    while(num<n){
        pipii a=g.back();
        g.pop_back();
        if(unite(a.second.first,a.second.second)){
            ans+=(long long)a.first;
            num++;
        }
    }
    printf("%lld",ans);
    return 0;
}

Measured memory_bytes: 7528
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    S=str(input())
    print('yes' if len(S)==len(set(S)) else 'no')

resolve()

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

using namespace std;

typedef long long ll;
typedef pair<ll,ll> ii;

vector<ll> a;
set<ii> front, back;
vector<ll> maxSum, minSum;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  ll n;
  cin >> n;
  a.resize(3 * n);
  for (ll i = 0; i < 3 * n; i++) cin >> a[i];

  maxSum.resize(3 * n, -100000000000000000LL);
  minSum.assign(3 * n, 100000000000000000LL);

  ll curSum = 0;
  for (int i = 0; i < 3 * n; i++) {
    curSum += a[i];
    front.insert(ii(a[i], i));
    if ((int)front.size() > n) {
      curSum -= front.begin()->first;
      front.erase(front.begin());
    }
    if ((int)front.size() == n) {
      maxSum[i] = curSum;
    }
  }

  curSum = 0;
  for (int i = 3 * n - 1; i >= 0; i--) {
    curSum += a[i];
    back.insert(ii(-a[i], i));
    if ((int)back.size() > n) {
      curSum += back.begin()->first;
      back.erase(back.begin());
    }
    if ((int)back.size() == n) {
      minSum[i] = curSum;
    }
  }

  ll result = -100000000000000000LL;
  for (int i = n - 1; i < 2 * n; i++) {
    result = max(result, maxSum[i] - minSum[i + 1]);
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 19840
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b?gcd(b,a%b):a;} //最小公倍数
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

signed main() {
  RAPID;
  // デフォルト変数定義
  int n,m,a,b,c,d,x,y,z;
  string s,t;
  //

  // ここから
  Vi v(3);
  VIN(v)
  SORT(v);
  Yes(v[0]+v[1]==v[2]);
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<map>
#include<ctime>

using namespace std;

template <typename T>

inline T read()
{
	T x=0,f=1;char c=getchar();
	while(!isdigit(c))
	{if(c=='-') f=-f;c=getchar();}
	while(isdigit(c))
	{x=(x<<3)+(x<<1)+(c-48);c=getchar();}
	return x*f;
}

#define lint long long int
#define ulint unsigned lint

const int inf=1e9+1e7;

int main(void)
{

	// freopen("testdata.in","r",stdin);
	// freopen("testdata.out","w",stdout);

	int n=read<int>();

	bool flag=false;

	if(n%10==7) flag=true;
	n/=10;
	if(n%10==7) flag=true;
	n/=10;
	if(n%10==7) flag=true;

	if(flag) puts("Yes");
	else puts("No");

	return 0;

}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define debug(x) cout<<x<<endl;
#define int ll
const ll INF = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 5;
 
int32_t main()
{
	#ifndef ONLINE_JUDGE
		freopen("a.in","r",stdin);
	#endif
	ios::sync_with_stdio(false);
 
 	int n;
 	cin>>n;
 	vector<vector<int> > v(n, vector<int>(3));
 	for(int i=0;i<n;i++)
 		cin>>v[i][0]>>v[i][1]>>v[i][2];

 	vector<vector<int> > dp(n, vector<int>(3, 0));
 	dp[0][0] = v[0][0];
 	dp[0][1] = v[0][1];
 	dp[0][2] = v[0][2];

 	for(int i=1;i<n;i++)
 	{
 		for(int j=0;j<3;j++)
 		{
 			int x = 0;
 			for(int k=0;k<3;k++)
 			{
 				if(j==k)
 					continue;
 				x = max(x, dp[i-1][k]);
 			}
 			dp[i][j] = max(dp[i][j], x + v[i][j]);
 		}
 	}

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

	return 0;
}

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

const int MAXH = 5e5;
const int MAXW = 5e5;
const int MAXN = 5e5;
int H, W;
int N;
vector<int> obstacle[MAXW];

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> H >> W >> N;
	for (int i = 0; i < N; i++) {
		int x, y; cin >> x >> y;
		obstacle[y].push_back(x);
	}
	for (int j = 1; j <= W; j++) {
		sort(obstacle[j].begin(), obstacle[j].end());
		obstacle[j].push_back(H+1);
	}
	int firstBad = H+1;
	int firstReach = 0;
	for (int j = 1; j <= W; j++) {
		firstReach++;
		int ind = 0;
		while (ind < int(obstacle[j].size()) && obstacle[j][size_t(ind)] <= firstReach) {
			firstReach = max(firstReach, obstacle[j][size_t(ind)]+1);
			ind++;
		}
		if (ind == int(obstacle[j].size())) {
			break;
		}
		firstBad = min(firstBad, obstacle[j][size_t(ind)]);
	}
	
	cout << firstBad-1 << '\n';

	return 0;
}


Measured memory_bytes: 18432
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int a[200005];
LL sum[200005];
int main(){
	int n;
	scanf("%d", &n);
	for(int i=1;i<=n;i++){
		scanf("%d", &a[i]);
		sum[i] = sum[i-1]+a[i];
	}

	LL ans = 1e18;
	for(int i=2;i<=n-2;i++){
		int lo = 0, hi = i, res1 = 0, res2 = 0;
		while(lo <= hi){
			int mid = (lo+hi)/2;
			if(sum[mid]-sum[0] <= sum[i]-sum[mid]) res1 = mid, lo = mid+1;
			else hi = mid-1;
		}
		if(sum[res1]-sum[0] > 0 && sum[i]-sum[res1] > 0){
			LL mx1 = max(sum[res1]-sum[0], sum[i]-sum[res1]);
			LL mn1 = min(sum[res1]-sum[0], sum[i]-sum[res1]);

			lo = i, hi = n;
			while(lo <= hi){
				int mid = (lo+hi)/2;
				if(sum[mid]-sum[i] <= sum[n]-sum[mid]) res2 = mid, lo = mid+1;
				else hi = mid-1;
			}
			if(sum[res2]-sum[i] > 0 && sum[n]-sum[res2] > 0){
				LL mx2 = max(sum[res2]-sum[i], sum[n]-sum[res2]);
				LL mn2 = min(sum[res2]-sum[i], sum[n]-sum[res2]);
				LL mx = max(mx1, mx2);
				LL mn = min(mn1, mn2);

				ans = min(ans, mx-mn);
			}

			lo = i, hi = n, res2 = 0;
			while(lo <= hi){
				int mid = (lo+hi)/2;
				if(sum[mid]-sum[i] >= sum[n]-sum[mid]) res2 = mid, hi = mid-1;
				else lo = mid+1;
			}
			if(sum[res2]-sum[i] > 0 && sum[n]-sum[res2] > 0){
				LL mx2 = max(sum[res2]-sum[i], sum[n]-sum[res2]);
				LL mn2 = min(sum[res2]-sum[i], sum[n]-sum[res2]);
				LL mx = max(mx1, mx2);
				LL mn = min(mn1, mn2);

				ans = min(ans, mx-mn);
			}
		}
		lo = 0, hi = i, res1 = 0, res2 = 0;
		while(lo <= hi){
			int mid = (lo+hi)/2;
			if(sum[mid]-sum[0] >= sum[i]-sum[mid]) res1 = mid, hi = mid-1;
			else lo = mid+1;
		}
		if(sum[res1]-sum[0] > 0 && sum[i]-sum[res1] > 0){
			LL mx1 = max(sum[res1]-sum[0], sum[i]-sum[res1]);
			LL mn1 = min(sum[res1]-sum[0], sum[i]-sum[res1]);

			lo = i, hi = n;
			while(lo <= hi){
				int mid = (lo+hi)/2;
				if(sum[mid]-sum[i] <= sum[n]-sum[mid]) res2 = mid, lo = mid+1;
				else hi = mid-1;
			}
			if(sum[res2]-sum[i] > 0 && sum[n]-sum[res2] > 0){
				LL mx2 = max(sum[res2]-sum[i], sum[n]-sum[res2]);
				LL mn2 = min(sum[res2]-sum[i], sum[n]-sum[res2]);
				LL mx = max(mx1, mx2);
				LL mn = min(mn1, mn2);

				ans = min(ans, mx-mn);
			}

			lo = i, hi = n, res2 = 0;
			while(lo <= hi){
				int mid = (lo+hi)/2;
				if(sum[mid]-sum[i] >= sum[n]-sum[mid]) res2 = mid, hi = mid-1;
				else lo = mid+1;
			}
			if(sum[res2]-sum[i] > 0 && sum[n]-sum[res2] > 0){
				LL mx2 = max(sum[res2]-sum[i], sum[n]-sum[res2]);
				LL mn2 = min(sum[res2]-sum[i], sum[n]-sum[res2]);
				LL mx = max(mx1, mx2);
				LL mn = min(mn1, mn2);

				ans = min(ans, mx-mn);
			}
		}
	}
	printf("%lld\n", ans);
}

Measured memory_bytes: 2688
n = input()
num = len(n) - 1
if n[num] ==str(2) or n[num] ==str(4) or n[num] == str(5) or n[num] == str(7) or n[num] == str(9):
    print("hon")
elif n[num] ==str(0) or n[num] ==str(1) or n[num] ==str(6) or n[num] ==str(8):
    print("pon")
else:
    print("bon")

Measured memory_bytes: 9072