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

using namespace std;
typedef long long LL;
typedef pair<int,int> pii;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second

#ifdef OJ
#define debug(x)  do{cerr<<#x<<": "<<x<<"\n";}while(0)
#define debugv(x) do{cerr<<#x<<": ";for(auto&e: (x))cerr<<e<<" ";cerr<<"\n";}while(0)
#else
#define debug(x)
#define debugv(x)
#endif

#define all(x) (x).begin(), (x).end()
#define rsort(x) sort((x).rbegin(), (x).rend())
#define sz(x) ((int)x.size())
#define fori(i, n) for (int i = 0; i < (int)(n); ++i)
#define ford(i, n, e) for (int i = (int)(n); i >= (int)(e); --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
#define RETURN(x) do{cout << (x) << '\n'; return 0;}while(0)


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

  int n; cin >> n;
  vector<int> a(n);
  int x = 0;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    x ^= a[i];
  }
  
  for(int i = 0; i < n; i++) {
    cout << (a[i]^x) << ' ';
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3940
import java.util.Iterator;
import java.util.PrimitiveIterator;
import java.util.Scanner;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main{
	static Scanner s=new Scanner(System.in);
	
	void solve(){
		int n=gInt(),k=gInt();
		System.out.println((n+k-3)/(k-1));
	}

	public static void main(String[] A){
		new Main().solve();
	}

	static int gInt(){
		return Integer.parseInt(s.next());
	}
	static long gLong(){
		return Long.parseLong(s.next());
	}
	static double gDouble(){
		return Double.parseDouble(s.next());
	}

	SupplyingIterator<Integer> ints(int n){
		return new SupplyingIterator<>(n,Main::gInt);
	}
	SupplyingIterator<Long> longs(int n){
		return new SupplyingIterator<>(n,Main::gLong);
	}
	SupplyingIterator<Double> doubles(int n){
		return new SupplyingIterator<>(n,Main::gDouble);
	}
	SupplyingIterator<String> strs(int n){
		return new SupplyingIterator<>(n,s::next);
	}

	Range rep(int i){
		return Range.rep(i);
	}
	Range rep(int f,int t,int d){
		return Range.rep(f,t,d);
	}
	Range rep(int f,int t){
		return rep(f,t,1);
	}
	Range rrep(int f,int t){
		return rep(t,f,-1);
	}

	IntStream REP(int v){
		return IntStream.range(0,v);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(Main::gInt).limit(n);
	}
	Stream<String> STRS(int n){
		return Stream.generate(s::next).limit(n);
	}

}
class SupplyingIterator<T> implements Iterable<T>,Iterator<T>{
	int			t;
	Supplier<T>	supplier;

	SupplyingIterator(int t,Supplier<T> supplier){
		this.t=t;
		this.supplier=supplier;
	}

	@Override
	public Iterator<T> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return t>0;
	}

	@Override
	public T next(){
		--t;
		return supplier.get();
	}

}
class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
	int to,cur,d;

	Range(int from,int to,int d){
		this.cur=from-d;
		this.to=to;
		this.d=d;
	}

	Range(int n){
		this(0,n-1,1);
	}

	@Override
	public Iterator<Integer> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
	}

	@Override
	public int nextInt(){
		return cur+=d;
	}

	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}

}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, m;
    cin >> n >> m;
    vi a(n);
    rep(i, n) cin >> a[i];
    vi b(m), c(m);
    rep(i, m) cin >> b[i] >> c[i];
    map<int, ll> mp;
    rep(i, n) mp[-a[i]]++;
    rep(i, m) mp[-c[i]] += b[i];
    ll ans = 0;
    for (auto p : mp) {
        if (p.se <= n) {
            n -= p.se;
            ans += p.fi * p.se;
        } else {
            ans += (ll)p.fi * n;
            break;
        }
    }
    ans = -ans;
    cout << ans << endl;
}

Measured memory_bytes: 13952
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000010
#define EPS 1e-9
#define fst first
#define scd second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin>>n>>s;
  rep(i,s.size() ){
    s[i]-='A';
    s[i]+=n;
    s[i]%=26;
    s[i]+='A';
  }
  cout<<s<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int MAX = 5000;
string s, t;
int dp[MAX + 1][MAX + 1];

int main(void) {
  while (cin >> s >> t) {
    for (int i = 0; i < s.size(); i++) {
      for (int j = 0; j < t.size(); j++) {
        dp[i][j] = 0;
      }
    }
    int ans = 0; 
    for (int i = 0; i < s.size(); i++) {
      for (int j = 0; j < t.size(); j++) {
        if (s[i] == t[j]) {
          dp[i + 1][j + 1] = dp[i][j] + 1;
          ans = max(dp[i + 1][j + 1], ans);
        } else
          dp[i + 1][j + 1] = 0;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}


Measured memory_bytes: 81384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

void swap(int i, int j){
    int temp = i;
    i = j;
    j = temp;
}

int main(){
    int X, Y, Z;
    cin >> X >> Y >> Z;
    int x = Z, y = X, z = Y;
    cout << x << " " << y << " " << z << endl;
}

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

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const int MOD = 1000000007;

const int CASES = 3;

void solve(){
    string S; ll K; cin >> S >> K;
    ll n = S.size();
    if(S[0] == S[n-1] && K > 1){
        ll l = 0, r = 0;
        for(int i = 0; i < n; ++i){
            if(S[i] == S[0]){
                ++l;
            }
            else{
                break;
            }
        }
        for(int i = n-1; i >= 0; --i){
            if(S[i] == S[n-1]){
                ++r;
            }
            else{
                break;
            }
        }
        if(l + r < n){
            ll ans1 = 0, ans2 = 0;
            S += S;
            for(int i = l; i < n - 1 - r; ++i){
                if(S[i] == S[i+1]){
                    S[i+1] = 'A';
                    ++ans1;
                }
            }
            for(int i = n - r; i < n + l; ++i){
                if(S[i] == S[i+1]){
                    S[i+1] = 'A';
                    ++ans2;
                }
            }
            cout << ans1 * K + ans2 * (K-1) + (l/2) + (r/2)<< endl;
        }
        else{
            ll ans = 0;
            S += S;
            for(int i = 0; i < 2 * n-1; ++i){
                if(S[i] == S[i+1]){
                    S[i+1] = 'A';
                    ++ans;
                }
            }
            ll tmp = 0;
            if(K % 2 == 1){
                tmp = (n/2);
            }
            cout << ans * (K/2) + tmp << endl;
        }
    }
    else{
        ll ans = 0;
        for(int i = 0; i < n-1; ++i){
            if(S[i] == S[i+1]){
                S[i+1] = 'A';
                ++ans;
            }
        }
        ll tmp = 0;
        if(S[0] == S[n-1]){
            tmp = K-1;
        }
        cout << ans * K + tmp<< endl;
    }
}

int main() {
    #ifdef MYLOCAL
    vector<string> filenames {"input1.txt", "input2.txt", "input3.txt", "input4.txt"};
    cout << "------------\n";
    for(int i = 0; i < CASES; ++i){
        ifstream in(filenames[i]);
        cin.rdbuf(in.rdbuf());
        solve();
        cout << "------------\n";
    }
    #else

    solve();

    #endif
    return 0;
}



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

int main(){
    int N, K;
    cin >> N >> K;

    int maxK = ((N-1)*(N-2)) / 2;
    if(K <= maxK){
        int M = (N-1) + maxK - K;
        cout << M << "\n";
        for(int i=2;i<=N;i++){
            cout << 1 << " " << i << "\n";
        }
        int m = N - 1;
        for(int i=2;i<=N;i++){
            for(int j=i+1;j<=N;j++){
                if(m < M){
                    cout << i << " " << j << "\n";
                    m++;
                }
            }
        }
    }
    else{
        cout << -1 << "\n";
    }

    return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d", &n)
	a := make([]int, n)
	for i := range a {
		fmt.Scanf("%d",&a[i])
	}

	max := a[0]
	min := a[0]

	for i := range a{
		if min > a[i] {
			min = a[i]
		} else if max < a[i] {
			max = a[i]
		}
	}

	fmt.Println(max-min)
}

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

int main()
{
    ios_base::sync_with_stdio(0);

    int a,b,c;
    cin >> a >> b >> c;
    if(a>b) swap(a,b);
    if(b>c) swap(b,c);
    if(a==5 && b==5 && c==7) puts("YES");
    else puts("NO");

    return 0;
}

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

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

  int a, b;
  cin >> a >> b;

  if ((a + b) % 3 == 0 || a % 3 == 0 || b % 3 == 0) cout << "Possible\n";
  else cout << "Impossible\n";

  return (0);
}


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

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

    int x, i = 1;
    while(cin >> x){
        if(x == 0) break;
        cout << "Case " << i << ": " << x << endl;
        i++;
    }

    return 0;
}


Measured memory_bytes: 3128
N, L = map(int,input().split())
result = 0
Min = L
Max = L + N - 1
flg = 0
for i in range(1,N+1):
  x = L + i - 1
  if x == 0:
    flg = 1
  result = result + x

if flg == 1:
  print(result)
else:
  if Min < 0:
    print(result-Max)
  else:
    print(result-Min)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
char s[55];
int cnt[26], cnt2[26];
int main(){
    for(int i=0;i<26;i++) cnt2[i] = 1e9;
    int n;
    scanf("%d", &n);
    for(int i=1;i<=n;i++){
        scanf("%s", s+1);
        memset(cnt, 0, sizeof(cnt));
        int l = strlen(s+1);
        for(int j=1;j<=l;j++) cnt[s[j]-'a']++;
        for(int j=0;j<26;j++) cnt2[j] = min(cnt2[j], cnt[j]);
    }
    for(int i=0;i<26;i++){
        for(int j=0;j<cnt2[i];j++) printf("%c", i+'a');
    }
    printf("\n");
}

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

constexpr int64_t mod = 1'000'000'007;

int main(){
    int n, k;
    cin >> n >> k;
    int64_t sqn;
    for(sqn=1;sqn*sqn<=n;++sqn);
    --sqn;

    vector<int64_t> rg(2*sqn);
    for(int i=1;i<=sqn;++i){
        rg[i-1] = i;
        rg[2*sqn-i] = n/i;
    }

    static int64_t dp[100000][100];    
    dp[0][0] = 1;
    for(int i=1;i<2*sqn;++i){
        dp[i][0] = (rg[i]-rg[i-1]) % mod;
        dp[i][0] = (dp[i][0] + dp[i-1][0]) % mod;
    }
    for(int kk=1;kk<k;++kk){
        dp[0][kk] = dp[2*sqn-1][kk-1] % mod;
        for(int i=1;i<2*sqn;++i){
            int ok=0, ng=2*sqn;
            while(ng-ok>1){
                int64_t mid = (ok+ng)/2;
                if(rg[i]*rg[mid] <= n) ok = mid;
                else ng = mid;
            }
            dp[i][kk] = dp[ok][kk-1] * (rg[i]-rg[i-1]) % mod;
            dp[i][kk] = (dp[i][kk] + dp[i-1][kk]) % mod;
        }
    }

    cout << dp[2*sqn-1][k-1] << endl;
    
    return 0;
}

Measured memory_bytes: 51968
#include<iostream>
using namespace std;
int sumOfEachDigit(int n){
  int sum_1 = 0;
  while (n > 0){
    sum_1 += n % 10;
    n /= 10;
  }
  return sum_1;
}

int main(){
  int N, A, B, sum_2 = 0;
  cin >> N >> A >> B;
  for(int i = 1; i <= N; i++){
    if(sumOfEachDigit(i) >= A && sumOfEachDigit(i) <= B) sum_2 += i;
  }
  cout << sum_2 << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str[] = br.readLine().split(" ");
		double p;
		double a = Double.parseDouble(str[0]);
		double b = Double.parseDouble(str[1]);
		double c = Double.parseDouble(str[2]);
		p =Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2));
		System.out.println(a*b*(Math.sin(Math.toRadians(c)))/2);
		System.out.println(a+b+(Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2)-(2*a*b*Math.cos(Math.toRadians(c))))));
		System.out.println(b*(Math.sin(Math.toRadians(c))));
	}
}

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#define ll long long
#define ld long double
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)

#define xx first
#define yy second
#define mp make_pair
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define vll vector<ll>
#define pdd pair<double,double>
#define ALL(v) (v).begin(), (v).end()

const ll MOD=1e9+7; ;
const ll inf=1e18;

#define MODSET(d) if ((d) >= MOD) d %= MOD;
#define MODNEGSET(d) if ((d) < 0) d = ((d % MOD) + MOD) % MOD;
#define put(x) cout<<#x<<" = "<<x<<endl;

ll power(ll a,ll n){
    ll ans=1;
    while(n){
        if(n&1)
            ans=(ans*a);
        n>>=1;
        a=(a*a);
    }
    return ans;
}


ll powerMod(ll a,ll n){
    ll ans=1;
    while(n){
        if(n&1)
            ans=(ans*a)%MOD;
        n/=2;
        a=(a*a)%MOD;
    }
    return ans;
}

ll powerMod1(ll a,ll n,ll mod){
    ll ans=1;
    while(n){
        if(n&1)
            ans=(ans*a)%mod;
        n>>=1;
        a=(a*a)%mod;
    }
    return ans;
}

ll lcm(ll a,ll b){
    return a*(b/__gcd(a,b));
}

ll sumdigit(ll n){
    ll sum=0;
    while(n){
        sum+=n%10;
        n=n/10;
    }
    return sum;
}

ll countSetBit(ll a){
    return __builtin_popcount(a);
}
ll countBit(ll a){
    ll sum=0;
    while(a){
        sum++;
        a>>=1;
    }
    return sum;
}

ll length(ll a){
    ll ans=0;
    while(a){
        ans++;
        a=a/10;
    }
    return ans;
}

bool isVowel(char c){
	if(c=='a' or c=='e' or c=='i' or c=='o' or c=='u')
		return true;
	return false;
}



int main()
{
    fast;
    ll t;
    //~ cin>>t;
    t=1;
    while(t--){
			ll n;
			cin>>n;
			ll ans=0;
			ll c=1;
			while(n){
				ans+=c;
				c = c*2;
				n/=2;
			}
			cout<<ans;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
 
int main() {
  char X, Y; cin >> X >> Y;
  string result;
  if ( X > Y ) result = ">";
  else if ( X < Y ) result = "<";
  else result = "=";
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
bingo = []
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
tmp = input()
bingo.append(tmp.split(' '))
for i in range(len(bingo)):
    bingo[i] = [int(bingo[i][0]), int(bingo[i][1]), int(bingo[i][2])]

n = input()
data = []
arr = range(int(n))
arr = list(arr)
for count in arr:
    tmp = input()
    data.append(int(tmp))

ans = []
for num in data:
    for i in range(len(bingo)):
        for j in [0, 1, 2]:
            if bingo[i][j] is num:
                ans.append([i, j])

# 1 2 3
# 4 5 6
# 7 8 9

# 6 15 12 15 15 24 18
# more 3

# 11 12 13
# 21 22 23
# 31 32 33

if [0, 0] in ans and [0, 1] in ans and [0, 2] in ans:
    print('Yes')
    exit(0)

if [1, 0] in ans and [1, 1] in ans and [1, 2] in ans:
    print('Yes')
    exit(0)

if [2, 0] in ans and [2, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 0] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

if [0, 1] in ans and [1, 1] in ans and [2, 1] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 2] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 0] in ans and [1, 1] in ans and [2, 2] in ans:
    print('Yes')
    exit(0)

if [0, 2] in ans and [1, 1] in ans and [2, 0] in ans:
    print('Yes')
    exit(0)

print('No')


Measured memory_bytes: 3192
/**
 *   author: bholuakku
**/

#include <bits/stdc++.h>
#define For(i,a,b) for(i=(a); i<(b); i++)
#define rep(i,n) for(i=0; i<(n); i++)
#define Nfor(i,a,b) for(i=(a)-1; i>=(b); i--)
#define dep(i,n) for(i=(n-1);i>=0; i--)
#define mp make_pair
#define pb push_back
#define Auto(a) for(auto &val : a)
#define X first
#define Y second
#define MOD 1000000007
#define MOD1 998244353
#define iterate(A, i) for(auto i = A.begin(); i!=A.end(); i++)
#define mset(A,val,n) memset(A, val, n*sizeof(int))
#define Endl cout<<"\n"
#define Test cout<<"Hello\n"

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<bool> vb;
typedef vector<vector<bool> > vvb;
typedef pair<int, int> pii;
typedef vector<vector<pair<int, int> > > vvp;

int 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 modInverse(ll n) {ll p = MOD;return power(n, p-2, p);}
int min(int a, int b, int c) { return min(a, min(b, c)); }
ll max(ll a, ll b, ll c) { return max(a, max(b, c)); }
inline void swap(int &a, int &b) { int t = a; a = b; b = t;}
bool cmp(int a, int b){return a>b;}

int main(){
    int n, w, i, j;
    cin>>n>>w;
    int wt[n+10], val[n+10];
    rep(i, n) cin>>wt[i]>>val[i];
    ll dp[n+10][w+10];
    dp[0][0] = 0;
    For(i,1,w+1){
        dp[0][i] = 0;
        if(i>=wt[0]) dp[0][i] = val[0];
    }
    For(i,1,n){
        rep(j,w+1){
            dp[i][j] = dp[i-1][j];
            if(j-wt[i]>=0) dp[i][j] = max(dp[i][j], val[i] + dp[i-1][j-wt[i]]);
        }
    }
    // rep(i, n){
    //     rep(j, w+1) cout<<dp[i][j]<<" ";Endl;
    // }
    cout<<dp[n-1][w];
    return 0;
}


Measured memory_bytes: 79744
#include <bits/stdc++.h>
// #include <cmath>
// #include <numeric>
// #include <regex> //正規表現
using namespace std;
#define rep(i,a,b) for(int i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+b,(a).begin()+c // コンテナ a の 要素 b から c へのイテレータ
#define MOD 1000000007ll
#define INF 1000000000
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;
// グリッドグラフの移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};


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

int64_t N; cin >> N;

if (N == 1) {
    cout << 0 << endl;
    return 0;
}

cout << N*(N-1)/2 << endl;
}

// 境界，出力文字列 チェック



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
/*---------------------DEBUGGING--------------------------------------------*/
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
/*-------------------------------------------------------------------------------------*/
#define mp make_pair
#define pb push_back
#define ll long long
#define pii pair<int,int>
#define pcc pair<char,char>
#define F first
#define S second
#define int long long
#define pi 3.141592653589793238462643383279502
#define M  1000000007
#define rep(i,a,n) for(int i=a;i<n;i++)
#define N 300005
#define vi vector<int>
#define all(v) v.begin(),v.end()

signed main()
{
   ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
   int k,x;
   cin>>k>>x;
   set<int> s;
   for(int i=x;i>(x-k);i--)
   {
       s.insert(i);
   }
   debug(s);
   for(int i=x;i<(x+k);i++)
   {
       s.insert(i);
   }
   for(auto y:s)
    cout<<y<<" ";
}


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

using namespace std;

#define rep(i,a,b) for(int i = a; i<int(b);++i)
#define all(v) v.begin(),v.end()
#define sz(v) v.size()
#define trav(a,c) for(auto a: c)

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pii;

int main(){
	cin.sync_with_stdio(false);
	ll a,b,c;
	cin>>a>>b>>c;
    cout<<min(a+b+1,c)+b<<endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<stack>
#include<algorithm>

#define maxn 100005
#define INF 1000000000

using namespace std;

inline int getint()
{
	int num=0,flag=1;char c;
	while((c=getchar())<'0'||c>'9')if(c=='-')flag=-1;
	while(c>='0'&&c<='9')num=num*10+c-48,c=getchar();
	return num*flag;
}

int n;
int fir[maxn],nxt[2*maxn],to[2*maxn],cnt;
int ans[maxn],l[maxn],r[maxn];

inline void newnode(int u,int v)
{to[++cnt]=v,nxt[cnt]=fir[u],fir[u]=cnt;}

inline bool check(int u,int fa,int st)
{
	if(ans[u]>-INF&&ans[u]%2!=st)return 1;
	for(int i=fir[u];i;i=nxt[i])
		if(to[i]!=fa)
			if(check(to[i],u,st^1))return 1;
	return 0;
}

inline bool dfs(int u,int fa)
{
	if(ans[u]>-INF)l[u]=r[u]=ans[u];
	for(int i=fir[u];i;i=nxt[i])
		if(to[i]!=fa)
		{
			if(dfs(to[i],u))return 1;
			l[u]=max(l[to[i]]-1,l[u]);
			r[u]=min(r[to[i]]+1,r[u]);
			if(l[u]>r[u])return 1;
		}
	return 0;
}

inline void color(int u,int fa)
{
	if(ans[u]<=-INF)ans[u]=r[u]=l[u];
	for(int i=fir[u];i;i=nxt[i])
		if(to[i]!=fa)
		{
			l[to[i]]=max(l[u]-1,l[to[i]]);
			r[to[i]]=min(r[u]+1,r[to[i]]);
			color(to[i],u);
		}
}

int main()
{
	memset(ans,-0x3f,sizeof ans);
	memset(l,-0x3f,sizeof l);
	memset(r,0x3f,sizeof r);
	n=getint();
	for(int i=1;i<n;i++)
	{
		int u=getint(),v=getint();
		newnode(u,v),newnode(v,u);
	}
	int t=getint(),x;
	while(t--)
	{
		x=getint();
		ans[x]=getint();
	}
	if(check(x,x,ans[x]%2)){puts("No");return 0;}
	if(dfs(1,1)){puts("No");return 0;}
	color(1,1);
	puts("Yes");
	for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
}

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

int main(){
    int n,t,a,nom=0;cin>>n>>t>>a;double ans=3000;//3000は適当な数
    for(int i=0;i<n;i++){
        int h;cin>>h;double T=max((t-0.006*h)-a,a-(t-0.006*h));
        if(ans>T){
            ans=T;
            nom=i+1;
        }
    }
    cout<<nom<<endl;
}

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

#define ll long long
#define sp ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define cps CLOCKS_PER_SEC
#define mod (ll)1000000007
#define f first
#define s second
#define debug1(x) cout<<x<<"\n"
#define debug2(x,y) cout<<x<<" "<<y<<"\n"
#define debug3(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define nl cout<<"\n";
#define pq priority_queue
#define inf 0x3f3f3f3f
#define test cout<<"abcd\n";
#define pi pair<int,int>
#define pii pair<int,pi>
#define pb push_back
#define mxn 200005

vector<int> g[mxn];
ll dp[mxn][2];

void dfs(int x=1,int p=0){
ll p1=1LL,p2=1LL;
for(auto &it:g[x]){
    if(it!=p){
        dfs(it,x);
        p1=(1LL*p1*(dp[it][0]+dp[it][1]))%mod;
        p2=(1LL*p2*dp[it][0])%mod;
    }
}
dp[x][0]=p1;
dp[x][1]=p2;
}

int main(){
sp;
int n,x,y;
cin>>n;
if(n==1){
    cout<<2;
    return 0;
}
for(int i=1; i<n; ++i){
    cin>>x>>y;
    g[x].pb(y);
    g[y].pb(x);
}
dfs();
cout<<(dp[1][0]+dp[1][1])%mod;
return 0;}


Measured memory_bytes: 17664
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>

#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
using namespace std;

int main(void) {
	string s;
	cin >> s;
	s.insert(s.begin() + 4, ' ');
	cout << s << endl;
	return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int x;
	cin >> x;
	
	int num500s = x / 500;
	x %= 500;
	int num5s = x / 5;
	int ret = num500s * 1000 + num5s * 5; 
	
	cout << ret << 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(){
    int n, x;
    cin >> n >> x;

    int D = 0;
    int ans = 1;
    for(int i = 0; i < n; i++){
        int l; cin >> l;
        D = D + l;
        if(D>x) break;
        ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std ;
double x[100] , y[100] , c[100] , r[100];
const double esp = 1e-9 ;
typedef pair<double , double> Pair ;
int n , k ;
double get(Pair a , Pair b)
{
	return sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)) ;
}
vector<Pair> calc(double x1 , double y1 , double r1 , double x2 , double y2 , double r2)
{
	 // x1 -= x2 , y1 -= y2 ;
	 // double t1 = (x1 * x1 + y1 * y1 + r2 * r2 - r1 * r1) / (2 * x1) ;
	 // double t2 = y1 / x1 ;
	 // double a = t2 * t2 , b = -2 * t1 * t2 , c = t1 * t1 - t2 * t2 ;
	 // double d = b * b - 4 * a * a ;
   // if(d < 0) return {} ;
	 // double c1 = (-b + sqrt(d)) / 2 / a ;
	 // double c2 = (-b - sqrt(d)) / 2 / a ;
	 // return {{t1 - t2 * c1 , c1} , {t1 - t2 * c2 , c2}} ;
	 x1-=x2,y1-=y2;
	 double S=x1*x1+y1*y1,a=(S+r2*r2-r1*r1)/2,D=S*r2*r2-a*a;
	 if(D<0) return {};
	 double A1=a*x1,B1=y1*sqrt(D);
	 double A2=a*y1,B2=x1*sqrt(D);
	 return {{(A1+B1)/S+x2,(A2-B2)/S+y2},{(A1-B1)/S+x2,(A2+B2)/S+y2}};
}
bool check(double t)
{
	vector<Pair> res ;
	for(int i = 1 ; i <= n ;i ++)  r[i] = t / c[i] ;
	for(int i = 1; i <= n ;i ++)
	{
		res.push_back({x[i] , y[i]}) ;
		for(int j = i + 1; j <= n ;j ++)
		{
		vector<Pair> p = calc(x[i] , y[i] , r[i] , x[j] , y[j] , r[j]) ;
		for(auto t : p)
		 res.push_back(t) ;
		}
	}

	for(auto tt : res)
	 {
		 int cnt = 0 ;
		 for(int i = 1 ;i <= n ;i ++)
		  if( get(tt , {x[i] , y[i]})  <= r[i] + esp ) cnt ++ ;
		if(cnt >= k) return true ;
	 }
	 return false ;

}
int main()
{
  scanf("%d%d" , &n , &k) ;
	for(int i = 1; i <= n ;i ++)
	 scanf("%lf%lf%lf" , &x[i] , &y[i] , &c[i]) ;
	double l = 0 , r = 1e9 ;
 for(int i = 0 ; i < 100 ;i ++ )
	 {
		 double mid = (l + r) / 2 ;
		 if(check(mid)) r = mid ;
		 else l = mid ;
	 }
	 printf("%.12lf\n" , r) ;
	return 0 ;
}


Measured memory_bytes: 384
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(auto i=0;i<n;++i)
#define REPR(i,n) for(auto i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(auto i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}

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

using namespace std;

typedef pair<int,int> pii;

llong dp[100010];

int main(){

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

  REP(i,n+1){
    dp[i] = INF;    
  }
  dp[0] = 0;

  vector<int> v;
  v.pb(1);
  int tmp = 6;
  while(tmp <= n){
    v.pb(tmp);
    tmp *= 6;
  }
  tmp = 9;
  while(tmp <= n){
    v.pb(tmp);
    tmp *= 9;
  }

  int len = v.size();

  FOR(i,1,n+1){
    REP(j,len){
      if(i - v[j] >= 0){
        dp[i] = min(dp[i], dp[i - v[j]] + 1);
      }
    }
  }


  printf("%lld\n", dp[n]);
  return 0;
}



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

#define ll long long
#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define repr(i,n,m) for(int i=m; i<n; i++)
#define MAX 100
#define MOD 1000000007
#define pb push_back
#define debug(x) cout << x << endl;
#define END cout << endl;
#define sorti(x) sort(x.begin(), x.end())

const int N = 100010;
vector<pair<int,int> > v[N];
int d[N];
bool used[N];

void dfs(int x, int y) {
  used[x] = true;
  d[x] = y;
  for (auto to : v[x]) {
    if (!used[to.first]) {
      dfs(to.first, y + to.second);
    } else {
      if (d[to.first] != y + to.second) {
        cout << "No" << endl;
        exit(0);
      }
    }
  }
}

int main() {
  int n,m; cin >> n >> m;
  rep(i,m) {
    int l,r,d;
    cin >> l >> r >> d;
    v[l].pb(make_pair(r,d));
    v[r].pb(make_pair(l,-d));
  }
  repr(i,n+1,1) {
    if (!used[i]) {
      dfs(i,0);
    }
  }

  cout << "Yes" << endl;
}

Measured memory_bytes: 12416
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

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

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int n = sc.nextInt();
        int x = sc.nextInt();

        System.out.println(n-x+1);
    }
}

Measured memory_bytes: 21844
#include <stdio.h>
#include <stdlib.h>

int main(){
    long long a,b,i;

    scanf("%lld %lld",&a,&b);

    for(i = 0 ; i <= 1000000000; i++){
        if(abs(a-i) == abs(b-i)){
            printf("%lld\n",i);
            return 0;
        }
    }

    printf("IMPOSSIBLE\n");
    return 0;
}

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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18
typedef long long ll;


int main() {
    int N; cin >> N;
    string S; cin >> S;
    S += S;
    vector<string> T{"SS", "SW", "WS", "WW"};
    FOR(i,1,N){
        REP(n,4){
            if(T[n][i]=='S' && S[i]=='o') T[n] += T[n][i-1];
            else if(T[n][i]=='S' && S[i]=='x') T[n] += (T[n][i-1]=='S'?'W':'S');
            else if(T[n][i]=='W' && S[i]=='o') T[n] += (T[n][i-1]=='S'?'W':'S');
            else if(T[n][i]=='W' && S[i]=='x') T[n] += T[n][i-1];
        }
    }

    REP(n,4){
        bool ok = false;
        if(T[n][0] == T[n][N]){
            if(S[0]=='o'){
                if(T[n][0]=='S' && T[n][N-1]==T[n][1]){
                    ok = true;

                }else if(T[n][0]=='W' && T[n][N-1]!=T[n][1]){
                    ok = true;
                }
            }else{
                if(T[n][0]=='S' && T[n][N-1]!=T[n][1]){
                    ok = true;

                }else if(T[n][0]=='W' && T[n][N-1]==T[n][1]){
                    ok = true;
                }
            }
        }
        if(ok){
            REP(i,N) cout << T[n][i];
            cout << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 4260
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
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; }

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;

constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

class AAtCoderContestScheduling {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;

      int d; cin >> d;
      vector<int> c(26);
      rep(i, 26) {
        cin >> c[i];
      }
      vector<vector<ll>> s(d, vector<ll>(26));
      rep(i, d) rep(j, 26) {
          cin >> s[i][j];
        }
      ll ret = 0;
      set<int> last[26];
      rep(i, 26) {
        last[i].insert(0);
        last[i].insert(d+1);
      }
      vector<ll> last2(26);
      vector<int> contests(d);
      rep(i, d) {
        int t = (i%26);
        contests[i] = t;
        ret += s[i][t];
        last[t].insert(i+1);
        last2[t] = i+1;
        rep(j, 26) {
          ret -= c[j]*(i+1-last2[j]);
        }
      }

      auto start = clock();

      while(clock() - start < 1.8 * CLOCKS_PER_SEC) {
        int day = rng()%d;
        int q = rng()%26;

        int before = contests[day];
        contests[day] = q;

        ll diff = 0;
        diff += s[day][q];
        diff -= s[day][before];

        day++;
        last[before].erase(day);
        auto it = last[before].upper_bound(day);
        int right = (*it);
        it--;
        int left = (*it);
        diff -= c[before]*(day-left)*(right-day);

        it = last[q].upper_bound(day);
        right = (*it);
        it--;
        left = (*it);
        diff += c[q]*(day-left)*(right-day);

        if (diff >= 0) {
          last[q].insert(day);
          ret += diff;
        } else {
          last[before].insert(day);
        }
      }

      rep(i, d) {
        cout << contests[i]+1 << '\n';
      }
      debug(ret);
    }
};

signed main() {
  AAtCoderContestScheduling solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

Measured memory_bytes: 4016
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    string str[N];
    for(int i=0;i<N;++i){
            cin >> str[i];
    }
    int count=0, flag=0;
    for(int A=0;A<N;A++){
            for(int i=0;i<N;i++){
                for(int j=i;j<N;j++){
                    if(str[(i+A)%N][j] != str[(j+A)%N][i]){
                        flag = 1;
                        break;
                    }
                }
                if(flag == 1) {
                    break;
                }
            }
            if(flag == 1) flag = 0;
            else count++;
    }
    cout << count * N <<"\n";
}


Measured memory_bytes: 384
k = int(input())
g = [[] for _ in range(k)]
for i in range(1,k):
    g[i].append([i*10%k,0])
    if i%10 != 9:
        g[i].append([(i+1)%k,1])
v = [100000]*k
v[1] = 1

def draw(d):
    for i in range(k):
        if v[i] > d:
            continue
        for v_next in g[i]:
            if v[i] == d and v_next[1] == 0 and v[v_next[0]] > d:
                v_n = v_next[0]
                while v[v_n] > d:
                    v[v_n] = d
                    v_n = v_n*10%k
            elif v[i] == d-1 and v_next[1] == 1 and v[v_next[0]] > d:
                v_n = v_next[0]
                while v[v_n] > d:
                    v[v_n] = d
                    v_n = v_n*10%k
            
for i in range(1,46):
    draw(i)
    if v[0] == i:
        print(v[0])
        exit()


Measured memory_bytes: 39568
S = input()
T = input()

len_s = len(S)
len_t = len(T)

max_count = 0
for x in range(len_s - len_t + 1):
    count = 0 #初期化
    for y in range(len_t):
#        print(S[y+x], T[y])
        if S[y+x] == T[y]:
            count += 1
        else:
            pass
#        print(count)

    if max_count < count:
        max_count = count
#    print(x, max_count)
    
print(len_t - max_count)
        

Measured memory_bytes: 9016
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    string S;

    cin >> S;

    string three = S.substr(2, 1);
    string four = S.substr(3, 1);

    string five = S.substr(4, 1);
    string six = S.substr(5, 1);

    string Answer = "No";

    if (three == four && five == six)
    {
        Answer = "Yes";
    }

    cout << Answer << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <set>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

#define INF 100000000
#define MOD 100000007

#define writeln(n) cout<<n<<endl

using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
//vector<tuple<long long, long long, long long>>vec;

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;
}

llong pownew(llong m, llong n) {
    if (n == 0) { return 1; }
    if (n % 2 == 0) { return pow(m*m, n/2); }
    return pow(m, n-1) * m;
}

bool isprime(int p) {
    if (p == 1) return false;
    for (int i = 2; i < p; i++) {
        if (p%i == 0) return false;
    }
    return true;
}

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

const int inf=100000000;

long long modpow(long long a, long long n, long long mod) //a^n
{
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

llong gcd(llong a, llong b) {
    return b != 0 ? gcd(b, a % b) : a;
}
//setprecision(10);


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

    int n; cin>>n;
    llong k; cin>>k;
    int q; cin>>q;
    vector<int> a(q,0);
    REP(i,q) cin>>a[i];
    vector<llong> cnt(n,0);
    REP(i,n)
    {
        cnt[i]=k-q;
    }
    REP(i,q)
    {
        cnt[a[i]-1]++;
    }
    string ans="Yes";
    REP(i,n)
    {
        if(cnt[i]>0) cout<<ans<<endl;
        else cout<<"No"<<endl;
    }



    return  0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;

typedef long long ll;

#define REP(var,n) for(int var=0;var<(n);var++)
#define REPP(var,n) for(int var=1;var<(n);var++)
#define ALL(c) (c).begin(),(c).end()

int main(){
    int n;
    cin >> n;
    int size = n/2;

    int a[size], b[size];

    int amax = -1;
    int bmax = -1;

    REP(i, n){
        if(i%2==0){
            cin >> a[i/2];
            if(a[i/2] > amax){
                amax = a[i/2];
            }
        }
        else{
            cin >> b[i/2];
            if(b[i/2] > bmax){
                bmax = b[i/2];
            }
        }
    }

    int acount[amax+1];
    int bcount[bmax+1];
    REP(i,amax+1){
       acount[i] = 0; 
    }
    REP(i, bmax+1){
       bcount[i] = 0; 
    }

    int cou_a_max = 0;
    int cou_b_max = 0;
    int max_a_index = 0;
    int max_b_index = 0;

    REP(i, size){
        acount[a[i]] += 1;
        bcount[b[i]] += 1;

        if(acount[a[i]] > cou_a_max){
            cou_a_max = acount[a[i]];
            max_a_index = a[i];
        }
        if(bcount[b[i]] > cou_b_max){
            cou_b_max = bcount[b[i]];
            max_b_index = b[i];
        }
    }

    if(max_a_index == max_b_index){
        acount[max_a_index] = -1;
        bcount[max_b_index] = -1;
        int cou_a_max2 = 0;
        int cou_b_max2 = 0;
        int max_a_index2 = 0;
        int max_b_index2 = 0;
        REP(i, amax+1){
            if(acount[i] > cou_a_max2){
                cou_a_max2 = acount[i];
                max_a_index2 = i;
            }
        }
        REP(i, bmax+1){
            if(bcount[i] > cou_b_max2){
                cou_b_max2 = bcount[i];
                max_b_index2 = i;
            }
        }

        if(cou_a_max2 > cou_b_max2){
            cou_a_max = cou_a_max2;
        }
        else{
            cou_b_max = cou_b_max2;
        }
    }

    cout << (size-cou_a_max) + (size-cou_b_max) << endl;
    return 0;
}


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

using namespace std;

#define inf 1<<30
#define llong long long
#define usd unsigned
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define fn fill_n
typedef pair<int, int> P;
typedef struct data{
	int now;
	int cost;
}data;
int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};

int n;
int memo[100001];

int dp(int n){
	// cout << n << endl;
	if(n == 0) return 0;
	if(memo[n] != inf) return memo[n];

	int ret = inf;
	for(int i = 1; i <= 6; i++){
		if(n - (int)pow(6,i) < 0) break;
		ret = min(ret, 1 + dp(n - (int)pow(6,i)));
	}
	for(int i = 1; i <= 5; i++){
		if(n - (int)pow(9,i) < 0) break;
		ret = min(ret, 1 + dp(n - (int)pow(9,i)));
	}
	ret = min(ret, n);

	return memo[n] = ret;
}

int main(){
	cin >> n;
	fn(memo, 100001, inf);
	cout << dp(n) << endl;

	return 0;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2) % mod;
}
/*--------Library Zone!--------*/

int n, m;
int par[114514];
int hon[114514];
vector<int>G[114514];
signed main() {
	cin >> n >> m;
	rep(i, n + m - 1) {
		int a, b; cin >> a >> b; a--; b--;
		G[a].push_back(b);
		hon[b]++;
	}
	queue<int>que;
	rep(i, n) {
		if (!hon[i])que.push(i);
	}
	while (!que.empty()) {
		int f = que.front(); que.pop();
		rep(i, G[f].size()) {
			int to = G[f][i];
			hon[to]--;
			if (!hon[to]) {
				par[to] = f + 1;
				que.push(to);
			}
		}
	}
	rep(i, n)cout << par[i] << endl;
}

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


namespace Test1 {

    


    class ClassMain {

       
        public static void Main(String[] args) {
            string line;
            while ((line = Console.ReadLine()) != null) {
                string search = line;
                int n = int.Parse(Console.ReadLine());
                int cnt = 0;
                for (int i = 0; i < n; i++) {
                    line = Console.ReadLine();
                    string tail = line.Substring(0, search.Length - 1);
                    line += tail;
                    for (int j = 0; j <= line.Length - search.Length; j++) {
                        if (line.Substring(j).StartsWith(search)) { cnt++; break; }
                    }
                }
                Console.WriteLine(cnt);
                break;
            }
        }

        
    }



    
}

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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())

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

#define INF INT_MAX/3

#define MAX_N 200002
#define M 1000000007

int h,w,a,b;

//// extended gcd
ll extgcd(ll a,ll b,ll& x,ll& y){
	ll d=a;
	if(b!=0){
		d=extgcd(b,a%b,y,x);
		y-=(a/b)*x;
	}else{
		x=1;y=0;
	}
	return d;
}

//// mod inverse
ll mod_inverse(ll a,ll m){
	ll x,y;
	extgcd(a,m,x,y);
	return (m+x%m)%m;
}

//// mod factorial
ll fact[MAX_N];

void mod_fact(int n,int p){ // O(n)
	fact[0]=1;
	for(int i=1;i<=n;i++)fact[i]=(fact[i-1]*i)%p;
}

//// mod combination
ll mod_comb(int n,int k,int p){
	if(n<0||k<0||n<k)return 0;
	return ((fact[n]*mod_inverse(fact[k],p))%p)*mod_inverse(fact[n-k],p)%p;
}

ll route(int x,int y){
	return mod_comb(x+y,x,M);
}

int main(){
	cin.sync_with_stdio(false);
	cin>>h>>w>>a>>b;
	mod_fact(200001,M);
	int x=b,y=h-a-1; ll res=0;
	while(x<w&&y>=0){
		res=(res+route(x,y)*route(w-1-x,h-1-y)%M)%M;
		x++; y--;
	}
	cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main() {

	string s;
	cin >> s;
	int count = 0;
	for (int i = 0; i < 4; i++) {
		if (s[i] == '+')
			count++;
		else
			count--;
	}

	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e4+10;
char s[maxn],res[maxn];
char c;
int n,k,len[maxn],mx;
bool check(int p)
{
    for(int i=1;i<=n;i++)
    if(s[i+p-1]>res[i])return false;
    else if(s[i+p-1]<res[i])return true;
    return false;
}
int main()
{
    c='z'+1;
    scanf("%d%d",&n,&k);
    scanf("%s",s+1);
    for(int i=1;i<=n;i++)c=min(c,s[i]),s[n*2-i+1]=s[i];
    for(int i=1;i<=n;i++)res[i]='z'+1;
    if(k>=15)
    {
        for(int i=1;i<=n;i++)printf("%c",c);
        printf("\n");
        return 0;
    }
    if(k==1)
    {
        for(int i=1;i<=n+1;i++)
        if(check(i))
        {
            for(int j=1;j<=n;j++)res[j]=s[i+j-1];
        }           
        printf("%s",res+1);
        return 0;
    }
    for(int i=1;i<=2*n;i++)len[i]=s[i]==c?len[i-1]+1:0,mx=max(mx,len[i]);
    k--;
    if((mx<<k)>=n)
    {
        for(int i=1;i<=n;i++)printf("%c",c);
        printf("\n");
        return 0;
    }
    int now=mx<<k;
    for(int i=1;i<=n+mx;i++)
    if(len[i]==mx&&check(i+1))
    for(int j=1;j<=n;j++)res[j]=s[i+j];
    for(int i=1;i<=now;i++)printf("%c",c);
    for(int i=now+1;i<=n;i++)printf("%c",res[i-now]);
    printf("\n");
}


Measured memory_bytes: 256