akhauriyash/Code-Regression huggingface dataset:
{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE StrictData #-}
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import Data.Array.Unboxed
import Data.Array.ST
import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Data.List
import Data.Char
import qualified Data.Set as Set

main :: IO ()
main = do
    n <- readLn
    xxx <- replicateM n BS.getLine
    print $ Set.size $ Set.fromList xxx

Measured memory_bytes: 65248
#!/usr/bin/env python3
A = [list(map(int,input().split())) for i in range(3)]
N = int(input())
for k in range(N):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if b == A[i][j]:
                A[i][j] = True
for i in range(3):
    if A[i][0] == A[i][1] == A[i][2] == True:
        print("Yes")
        exit()
    elif A[0][i] == A[1][i] == A[2][i] == True:
        print("Yes")
        exit()
if A[0][0] == A[1][1] == A[2][2] == True:
    print("Yes")
    exit()
if A[0][2] == A[1][1] == A[2][0] == True:
    print("Yes")
    exit()
print("No")

Measured memory_bytes: 3064
loop do
  n, m = gets.split.map(&:to_i)
  break if n.zero? && m.zero?

  question = {}
  m.times { |i| question[i + 1] = 0 }

  n.times do
    gets.split.map(&:to_i).each_with_index { |v, i| question[i + 1] += 1 if v == 1 }
  end

  i = 0
  puts Hash[question.sort_by { |k, v| [-v, i += 1] }].keys.join("\s")
end



Measured memory_bytes: 7080
#include <stdio.h>

#define MAX 200000
#define INF 1e9
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a < b ? b : a)

int main(){
  int N,a[MAX],mini[MAX],i,ans;

  scanf("%d" ,&N);
  for(i = 0 ; i < N ; i++){
    scanf("%d" ,a + i);
  }


  mini[0] = a[0];
  ans = -INF;
  for(i = 1 ; i < N ; i++){
    ans = max(ans,a[i]-mini[i-1]);
    mini[i] = min(a[i],mini[i-1]);
  }
  printf("%d\n" ,ans);

  return 0;
}

Measured memory_bytes: 2160
// {{{
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <complex>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define FOR(i, a, b) for(ll i = static_cast<ll>(a); i < static_cast<ll>(b); i++)
#define FORR(i, a, b) for(ll i = static_cast<ll>(a); i >= static_cast<ll>(b); i--)
#define REP(i, n) for(ll i = 0ll; i < static_cast<ll>(n); i++)
#define REPR(i, n) for(ll i = static_cast<ll>(n); i >= 0ll; i--)
#define ALL(x) (x).begin(), (x).end()

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

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

constexpr int INF = 100000000;
constexpr ll LINF = 10000000000000000ll;
constexpr int MOD = static_cast<int>(1e9 + 7);
constexpr double EPS = 1e-9;
// }}}

int N;
ll a[200000];
ll s[200000];

void init()
{
}

void solve()
{
    ll ans = LINF;
    s[0] = a[0];
    FOR(i, 1, N) s[i] = a[i] + s[i-1];
    REP(i, N-1){
        ll x = s[i];
        ll y = s[N-1] - x;
        ans = min(ans, abs(x-y));
    }
    cout << ans << endl;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    REP(i, N) cin >> a[i];
    solve();
    return 0;
}

// vim:set foldmethod=marker:


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

int main(){

    int a,s,d,f;
    cin >> a >> s >> d >> f;

    cout << max(a*s,d*f) << endl;

    return 0;
}

Measured memory_bytes: 256
/*
	Copyright: razouq (c)
	Author: Anass BENDARSI
	Date: 29/07/2017 13:02:59
	flamers will **** you
*/
#include<bits/stdc++.h>
//#include<flamers.h>
#define ll long long
#define ull unsigned long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define POB pop_back
#define dist(a, b) sqrt(a*a + b*b)
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef vector<pair<int, int>> vipi;
bool compare(pi p1, pi p2){
	 if(1) return true;
	 return false;
}

int fct(int n) {
	int c = 0;
	while(n % 2 == 0){
		n /= 2;
		c++;
	}
	return c;
}

int main(){
//	freopen("input.in", "r", stdin);
//	freopen("output.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie();
	int n;
	cin>>n;
	int r = 1, m = 0; 
	for(int i = 1; i <= n; i++){
		if(fct(i) > m) {
			r  = i;
			m = fct(i);
		}
	}
	cout<<r<<endl;
	return 0;
}


Measured memory_bytes: 256
//https://atcoder.jp/contests/cf16-final/tasks/codefestival_2016_final_c
//C - Interpretation
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}

struct uf_tree {
    std::vector<int> parent;
    int __size;
    uf_tree(int size_) : parent(size_, -1), __size(size_) {}
    void unite(int x, int y) {
        if ((x = find(x)) != (y = find(y))) {
            if (parent[y] < parent[x]) std::swap(x, y);
            parent[x] += parent[y];
            parent[y] = x;
            __size--;
        }
    }
    bool is_same(int x, int y) { return find(x) == find(y); }
    int find(int x) { return parent[x] < 0 ? x : parent[x] = find(parent[x]); }
    int size(int x) { return -parent[find(x)]; }
    int size() { return __size; }
};

int main() {
#if LOCAL&01
    std::ifstream in("./test/sample-1.in"); //input.txt
    std::cin.rdbuf(in.rdbuf());
#else
    cin.tie(0);
    ios::sync_with_stdio(false);
#endif
    ll N,M; cin>>N>>M;    
    unordered_map<ll,vector<ll>> lang_n_map;
    FOR(i,1,N+1){
        ll k; cin>>k;
        REP(j,k){
            ll L; cin>>L;
            lang_n_map[L].push_back(i);
        }
    }

    uf_tree uft(N+1);
    for(const auto& lnm :lang_n_map){
        auto fn = lnm.second.front();
        FOR(i,1,lnm.second.size()){
            uft.unite(fn, lnm.second.at(i));
        }
    }
    bool ans=(uft.size(1) == N);
    cout<<(ans?"YES":"NO")<<endl;
    return 0;
}

Measured memory_bytes: 6668
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;



int main(){ 
  int N;
  cin >> N;
  vector<string> S(N);
  rep(i,N) cin >> S[i];
  
  map<string, int> f;
  rep(i,N) f[S[i]]++;
  
  int M = 0;
  for (auto p : f) {
    M = max(M, p.second);
  }

  for (auto p : f) {
    if (p.second == M) {
      cout << p.first << endl;
    }
  }
}


Measured memory_bytes: 26752
import math
n,k = map(int, input().split())
mod = 10**9+7
ans = 0
array = [i for i in range(n+1)]
first_sum = sum(array[:k])
latter_sum = sum(array[-k:])
for i in range(k,n+1):
    ans += (latter_sum - first_sum) + 1
    first_sum += array[i]
    latter_sum += array[-(i+1)]
    ans %= mod
ans += 1
print(ans % mod)

Measured memory_bytes: 18412
import java.util.*;
import java.lang.*;
class Main {
  static int stacksize = 200;
  static int stackpointer = 0;
  static int [] stack = new int[stacksize];
//push
  static void push(int num){
    stack[stackpointer++] = num;
  }
  //pop
  static int pop(){
    return stack[--stackpointer];
  }
  //main
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String [] s = sc.nextLine().split("\\s+");
    for(int i = 0; i<s.length; i++){

      if(s[i].equals("+")){
        push(pop()+pop());
      }else if(s[i].equals("-")){
        push(-(pop()-pop()));
      }else if(s[i].equals("*")){
        push(pop()*pop());
      }else{
        push(Integer.valueOf(s[i]));
      }
    }
    System.out.println(pop());
  }
}


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

int main() {
	int N;
	cin >> N;
	int ans = 0;
	for (int i = 0; i < N; i++) {
		int a;
		cin >> a;
		while (a % 2 == 0) {
			a /= 2;
			ans++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define long long long
#define ull unsigned long long
#define up(i,a,b) for (int i=a; i<=b; i++)
#define down(i,a,b) for (int i=a; i>=b; i--)
#define endl '\n'
#define pb push_back
#define X first
#define Y second
#define II pair<int, int>
#define III pair<int, pair<int, int> >
#define V vector
#define debug(X) cerr<< #X << " = " <<X << endl
#define debug2(X,Y) cerr<< #X << " = " <<X << ","<<#Y<<" = "<<Y<<endl
#define show(X,a,b) {cerr << #X << " = "; up(__,a,b) cerr << X[__] << ' '; cerr << endl;}
#define gc getchar
#define pc putchar

using namespace std;

inline void read(int &x)
{
    register int c = gc();
    x = 0;
    int neg = 0;
    for (;((c<48 || c>57) && c != '-') ;c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}
inline void writeln(int x){

         char buffor[21];
         register int i=0;
         int neg=0; if (x<0) {neg=1; x= -x;}
         do{
               buffor[i++]=(x%10)+'0';
               x/=10;
            } while(x);
           i--;
           if (neg) pc('-');
           while(i>=0) pc(buffor[i--]);
           pc('\n');
       }
const int N= 2010;
int n,m,q,a[N][N];
int dpsq[N][N],dphor[N][N],dpver[N][N];

//horizontal= ngang
void input()
{
    cin>>m>>n>>q;
    up(i,1,m)
     up(j,1,n)
     {
     	char aa; cin>>aa; if (aa== '1') a[i][j]= 1;
     	dpsq[i][j]= dpsq[i-1][j]+ dpsq[i][j-1]- dpsq[i-1][j-1]+ a[i][j];
     	dphor[i][j]= dphor[i-1][j]+ dphor[i][j-1]- dphor[i-1][j-1];
     	if (a[i][j]==1 and a[i][j-1]==1) dphor[i][j]++;
     	dpver[i][j]= dpver[i-1][j]+ dpver[i][j-1]- dpver[i-1][j-1];
     	if (a[i][j]==1 and a[i-1][j]==1) dpver[i][j]++;
     }
}

void solve()
{
    up(i,1,q)
    {
        int x1,x2,y1,y2;
        cin>>x1>>y1>>x2>>y2;
        cout<< dpsq[x2][y2]- dpsq[x1-1][y2]- dpsq[x2][y1-1]+ dpsq[x1-1][y1-1]
        - ( dphor[x2][y2]- dphor[x2][y1]- dphor[x1-1][y2]+ dphor[x1-1][y1]+ dpver[x2][y2]- dpver[x2][y1-1]- dpver[x1][y2]+ dpver[x1][y1-1] )<<endl;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);// don't use when interactive
    #define TASK "tmp"
  //  freopen(TASK".inp","r",stdin);
  //  freopen(TASK".out","w",stdout);

    input();
    solve();

    return 0;
}


Measured memory_bytes: 64896
#include<iostream>
#include<map>
using namespace std;
int p,q;
main()
{
	while(cin>>p>>q)
	{
		map<int,int>M;
		int id=0;
		string ans="";
		while(M.find(p)==M.end()&&p!=0)
		{
			M[p]=id++;
			p*=10;
			ans+=p/q+'0';
			p%=q;
		}
		cout<<ans<<endl;
		if(p!=0)
		{
			int L=M[p],R=id;
			string ret(ans.size(),' ');
			for(int i=L;i<=R;i++)ret[i]='^';
			cout<<ret<<endl;
		}
	}
}



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

bool is_prime(const int x) {
    if (x == 2 || x == 3) return true;
    if (x % 2 == 0 || x % 3 == 0) return false;
    if (x % 6 != 1 && x % 6 != 5) return false; // 3??\???????´???°???6????????°???????????????????????¨
    for (int i = 5; i * i <= x; i += 6) {
        if (x % i == 0 || x % (i + 2) == 0) return false;
    }
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, a, cnt = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a;
        if (is_prime(a)) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3128
from collections import *
import sys
S=sys.stdin.readlines()
N=int(S[0])
G=[[] for i in range(N)]
a,b,c=0,0,0
for i in range(N-1):
  a,b,c=map(int,S[i+1].split())
  a,b=a-1,b-1
  G[a].append((b,c))
  G[b].append((a,c))
Q,K=map(int,S[N].split())
D,Z=deque(),set()
def qao(x):
  global D,Z
  if x in Z:
    return False
  Z.add(x)
  D.append(x)
  return True

dist=[0]*N
def bfs():
  global dist,D,G
  v=0
  for i in range(len(D)):
    v=D.popleft()
    for j in range(len(G[v])):
      if qao(G[v][j][0]):
        dist[G[v][j][0]]=G[v][j][1]+dist[v]
  return len(D)

qao(K-1)
while bfs():
  pass
for i in range(Q):
  a,b=map(int,S[N+1+i].split())
  print(dist[a-1]+dist[b-1])

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

int main()
{
  int s, t, n;

  s = t = 0;
  for (int i = 0; i < 4; i++){
    cin >> n;
    s += n;
  }
  for (int i = 0; i < 4; i++){
    cin >> n;
    t += n;
  }
  if (s <= t){
    cout << t << endl;
    return 0;
  }
  cout << s << endl;

  return 0;
}

Measured memory_bytes: 1160
// JOI13-quest3.cpp : Defines the entry point for the console application.
//

#include <stdio.h>

int absolute(int *n) {

	if (*n >= 0) {
		return *n;
	}
	else {
		*n *= -1;
		return *n;
	}
}

int big(int n, int m) {
	int max;

	absolute(&n);
	absolute(&m);

	if (n >= m) {
		max = n;
	}
	else {
		max = m;
	}

	return max;
}

int main(void)
{
	int width, height, number;

	scanf("%d %d %d", &width, &height, &number);

	int x1, y1, x2, y2, minus_x, minus_y, sum = 0;
	scanf("%d %d", &x1, &y1);

	for (int i = 0; i < number - 1; i++) {
		scanf("%d %d", &x2, &y2);
		minus_x = x1 - x2;
		minus_y = y1 - y2;

		if ((minus_x > 0 && minus_y > 0) || (minus_x < 0 && minus_y < 0)) {
			sum += big(minus_x, minus_y);
		}
		else if (minus_x == 0) {
			absolute(&minus_y);
			sum += minus_y;
		}
		else if (minus_y == 0) {
			absolute(&minus_x);
			sum += minus_x;
		}
		else {
			absolute(&minus_x);
			absolute(&minus_y);
			sum += (minus_x + minus_y);
		}

		x1 = x2;
		y1 = y2;
	}

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

	return 0;
}

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

int main() {
 int N,K;
 cin >> N>>K;
  int n = N;
  
 vector<int> D(K);
  for(int i = 0;i<K;i++){
    cin >> D[i];
  }
 vector<int> T(10,1);
  for(int i = 0;i<K;i++){
    T[D[i]] = 0;
  }

  vector<int> t;
  for(int i = 0;i<T.size();i++){
    if(T[i] ==1){
      t.push_back(i);
    }
  }

  
  int c = 0;
  while(1){
    N = N/10;
    c++;
    if(N == 0) break;
  }

  
  vector<int> ans;
 if(c == 4){
   
   for(int i = 0;i<t.size();i++){
     for(int j = 0;j<t.size();j++){
       for(int k = 0;k<t.size();k++){
         for(int l = 0;l<t.size();l++){
           int x = 1000*t[i] + 100*t[j] + 10*t[k] + t[l];//まず4桁で計算
           if(x>=n) ans.push_back(x);
          }
         }
        }
      } 
     if(ans.size() == 0){//4桁でN以上の数を作れんかったら5桁でトライ
       
       for(int i = 0;i<t.size();i++){
        for(int j = 0;j<t.size();j++){
         for(int k = 0;k<t.size();k++){
          for(int l = 0;l<t.size();l++){
           for(int m = 0;m<t.size();m++){
             int y = 10000*t[i] + 1000*t[j] + 100*t[k] + 10*t[l] + t[m];
           if(y>=n) ans.push_back(y);
          }
         }
        }
       }
      }
     }
   sort(ans.begin(),ans.end());
   cout << ans[0] << endl;
 }
  if(c == 3){
    for(int i = 0;i<t.size();i++){
     for(int j = 0;j<t.size();j++){
       for(int k = 0;k<t.size();k++){
           int x = 100*t[i] + 10*t[j] + t[k];//まず3桁で計算
           if(x>=n) ans.push_back(x);
          }
         }
        }
     if(ans.size() == 0){//3桁でN以上の数を作れんかったら4桁でトライ
       
       for(int i = 0;i<t.size();i++){
        for(int j = 0;j<t.size();j++){
         for(int k = 0;k<t.size();k++){
          for(int l = 0;l<t.size();l++){
             int y = 1000*t[i] + 100*t[j] + 10*t[k] + t[l];
           if(y>=n) ans.push_back(y);
          }
         }
        }
       }
     }
   sort(ans.begin(),ans.end());
   cout << ans[0] << endl;
 }
  
  if(c == 2){
    for(int i = 0;i<t.size();i++){
     for(int j = 0;j<t.size();j++){
           int x = 10*t[i] + t[j];//まず2桁で計算
           if(x>=n) ans.push_back(x);
         }
        }
     if(ans.size() == 0){//2桁でN以上の数を作れんかったら3桁でトライ
       
       for(int i = 0;i<t.size();i++){
        for(int j = 0;j<t.size();j++){
         for(int k = 0;k<t.size();k++){
             int y = 100*t[i] + 10*t[j] + t[k];
           if(y>=n) ans.push_back(y);
         }
        }
       }
     }
   sort(ans.begin(),ans.end());
   cout << ans[0] << endl;
 }
  if(c == 1){
    for(int i = 0;i<t.size();i++){
           int x = t[i];//まず1桁で計算
           if(x>=n) ans.push_back(x);
        }
     if(ans.size() == 0){//1桁でN以上の数を作れんかったら2桁でトライ
       
       for(int i = 0;i<t.size();i++){
        for(int j = 0;j<t.size();j++){
             int y = 10*t[i] + t[j];
           if(y>=n) ans.push_back(y);
        }
       }
     }
   sort(ans.begin(),ans.end());
   cout << ans[0] << endl;
 }
}

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

int main(){
  ll a,b,x;
  cin >> a >> b >> x;
  if(a!=0){
    cout << b/x-(a-1)/x << endl;
  }
  else{
    cout << b/x+1 << endl;
  }
}

Measured memory_bytes: 3580
from heapq import heappush, heappop

N, M = map(int, input().split())
A = list(map(int, input().split()))
pq = []
for a in A:
	heappush(pq, -1*a)

for i in range(M):
	front = heappop(pq)
	front = -1 * front
	front = front // 2
	heappush(pq,-1 * front)

sumi = 0
while True:
	try:
		sumi += (-1 * heappop(pq))
	except Exception as e:
		break;
print(sumi)
	


Measured memory_bytes: 14180
#include <bits/stdc++.h>
#define fi first
#define sc second
#define forn(i,p,k) for(int (i)=(p);(i)<=(k);++(i))
using namespace std;
typedef long long ll;
const int MM=30;
const int P=1e9+7;
vector< vector<int> > M(MM,vector<int>(MM));

int main()
{
    ios_base::sync_with_stdio(0);
    int n;
    cin>>n;
    forn(i,1,n) forn(j,1,n) cin>>M[i][j];
    ll wyn=0;
    for(int m=1;m<(1<<n);m++)
    {
        bool zn=0;
        ll tmp=1;
        for(int ii=0;ii<n;ii++) zn^=((m&(1<<ii))>0?1:0);
        forn(i,1,n)
        {
            int tmp2=0;
            for(int ii=0;ii<n;ii++) if(m&(1<<ii))   tmp2+=M[i][ii+1];
            tmp=tmp*tmp2%P;
        }
        wyn=(zn?(wyn-tmp+P)%P:(wyn+tmp)%P);
    }
    cout<<((n&1)?(P-wyn)%P:wyn);
}


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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int k, a, b;
    cin >> k >> a >> b;
    bool ans = false;
    for (int i=a; i<=b; ++i) {
        if (i%k==0) ans = true;
    }
    cout << (ans?"OK":"NG") << endl;
    return 0;
}


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

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


int main(){

  ll d,t,s;
  cin >> d >> t >> s;

  if(d <= t*s){
    cout << "Yes" << endl;
  }else
  {
    cout << "No" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3596
import java.util.Scanner;

public class Main{

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

        // input
        final int NUM = scan.nextInt();
        final int M = scan.nextInt();
        int[][] codes = new int[NUM][M];
        int[] rate = new int[M];
        int bonus = scan.nextInt();
        for(int i = 0; i < M; i++){
            rate[i] = scan.nextInt();
        }
        for(int i = 0; i < NUM; i++){
            for(int j = 0; j < M; j++){
                codes[i][j] = scan.nextInt();
            }
        }

        // search
        int count = 0 ;
        for(int i = 0; i < NUM; i++){
            int sum = 0;
            for(int j = 0; j < M; j++){
                sum += codes[i][j] * rate[j];
            }
            sum+= bonus;
            if(sum > 0){
                count++;
            }
        }

        // answer
        System.out.println(count);

    }
}

Measured memory_bytes: 22228
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int r = sc.nextInt();
        int max_X = x + r;
        int min_X = x - r;
        int max_Y = y + r;
        int min_Y = y - r;
        if((max_X <= w)&&(0 <= min_X)&&(max_Y <= h)&&(0 <= min_Y)){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 26360
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int p = 998244353;
inline int qpow(int value, int n) {
  int result = 1;
  for (; n; n >>= 1, value = (ll)value * value % p) {
    if (n & 1) {
      result = (ll)result * value % p;
    }
  }
  return result;
}
void fwt(vector<int> &arr) {
  for (int gap = 1; gap < arr.size(); gap <<= 1) {
    for (int start = 0; start < arr.size(); start += gap * 2) {
      for (int i = start; i < start + gap; i++) {
        int x = arr[i], y = arr[i + gap];
        arr[i] = (x + y) % p;
        arr[i + gap] = (x - y + p) % p;
      }
    }
  }
}
int main() {
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int n, sum = 0;
  cin >> n;
  vector<int> prob(1 << n);
  for (int i = 0; i < 1 << n; i++) {
    cin >> prob[i];
    sum = (sum + prob[i]) % p;
  }
  for (int i = 0; i < 1 << n; i++) {
    prob[i] = (ll)prob[i] * qpow(sum, p - 2) % p;
  }
  prob[0] = (prob[0] - 1 + p) % p;
  fwt(prob);
  vector<int> arr(1 << n, p - 1);
  arr[0] = (1 << n) - 1;
  fwt(arr);
  for (int i = 0; i < 1 << n; i++) {
    arr[i] = (ll)arr[i] * qpow(prob[i], p - 2) % p;
  }
  fwt(arr);
  for (int i = 0; i < 1 << n; i++) {
    arr[i] = (ll)arr[i] * qpow(1 << n, p - 2) % p;
  }
  for (int i = 0; i < 1 << n; i++) {
    cout << (arr[i] - arr[0] + p) % p << "\n";
  }
  return 0;
}


Measured memory_bytes: 4864
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int main() {
    string S, T;
    cin >> S >> T;
 
    //答えansを仮置きする。
    //これが十分に大きくないと不正解となるので、
    //この値なら絶対に正しい答えが出る、という値を仮置きすること
    int ans = T.size();
 
    //Sの何文字目から調べるかを全探索する
    for (int start = 0; start <= S.size() - T.size(); start++)
    {
        int diff = 0;
        for (int i = 0; i < T.size(); i++)
        {
            if (T[i] != S[start + i]) {
                diff++;
            }
        }
        ans = min(ans, diff);
    }
 
    cout << ans << endl;
}

Measured memory_bytes: 3136
#include <stdio.h>
#define N 60
#define M 1000000007
typedef long long LL;

LL read()
{
	char c;
	while((c = getchar()) < 48 || c > 57);
	LL x = c - 48;
	while((c = getchar()) > 47 && c < 58) x = x * 10 + c - 48;
	return x;
}

int main() 
{
	LL p2[N + 1], m2, x, sum = 0, y;
	int i, j, c1[N] = {0}, n;
		
	scanf("%d", &n);
	for(p2[j = 0] = 1, i = 1; i <= N; j = i++){
		p2[i] = p2[j] << 1;
	}
	for(register int i = 1; i <= n; i++){
		x = read();
		for(register int j = 0; j < N; j++){
			if(x & p2[j]) c1[j]++;
		}
	}
	for(i = 0, m2 = 1, y = (LL)n; i < N; i++){
		x = (LL)c1[i];
		sum += x * (y - x) % M * m2 % M;
		m2 <<= 1;
		if(m2 >= M) m2 -= M;
	}
	printf("%lld\n", sum %= M);
	
	return 0;
}

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

using namespace std;

int main()
{
  int n;
    cin >> n;
    int x, y;
    cin >> x >> y;
    vector<int>len;
    len.resize(n);
    for(int i = 1; i <= n; i++){
        for(int j = i+1; j <= n; j++){
          int d = min({j-i, abs(y-j)+1+abs(x-i), abs(y-i)+1+abs(x-j)});
            len[d]++;
        }
    }
    for(int i = 1; i < n; i++){
        cout << len[i] << endl;
    }
    return 0;
}


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

int main() {
	vector<int>A(5);
	for (int n = 0;n<5;++n) {
		cin >> A[n];
	}
	int K;
	cin >> K;
	sort(A.begin(), A.end());
	
	if (A[4]-A[0] > K) {
		cout << ":("<<endl;
	}
	else{
		cout << "Yay!"<<endl;
	}
	return 0;
}

Measured memory_bytes: 3628
#include<stdio.h>

#define N 100000

int Partition(int* A,int p,int r){
  int x,i,j,tmp;
  x=A[r];
  i=p-1;
  for(j=p;j<=r-1;j++){
    if(A[j]<=x){
      i++;
      tmp=A[i];
      A[i]=A[j];
      A[j]=tmp;
    }
  }
  tmp=A[i+1];
  A[i+1]=A[r];
  A[r]=tmp;
  return i+1;
}


main(){
  int i,n,m;
  int A[N];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  m=Partition(A,0,n-1);
  for(i=0;i<m;i++){
    printf("%d ",A[i]);
  }
  printf("[%d] ",A[m]);
  for(i=m+1;i<n-1;i++){
    printf("%d ",A[i]);
  }
  printf("%d",A[n-1]);
  printf("\n");
  return 0;
}

Measured memory_bytes: 992
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <map>
#include <string>
#include <math.h>
#include <vector>
#include <cstdlib>
#include <queue>

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n';

typedef long long ll;

using namespace std;

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

    int A, B;

    bool MMYY = false, YYMM = false;

    A = N / 100;
    B = N % 100;

    if (0 < A && A < 13)
    {
        MMYY = true;
        if (0 < B && B < 13)
        {
            YYMM = true;
        }
    }
    else
    {
        if (0 < B && B < 13)
        {
            YYMM = true;
        }
    }

    if (MMYY && YYMM)
    {
        cout << "AMBIGUOUS" << endl;
    }
    else if (MMYY && !YYMM)
    {
        cout << "MMYY" << endl;
    }
    else if (!MMYY && YYMM)
    {
        cout << "YYMM" << endl;
    }
    else
    {
        cout << "NA" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
n, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=False)
count = 0
for i in range(n):
    if x>=a[i]:
        count += 1
        x -= a[i]
    else:
        break
if (x!=0)and(count==n):
    count -= 1
print(count)

Measured memory_bytes: 9072
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	ll len=s.length();
	
	vector< pair<ll, pair<ll,ll > > > vecl,vecr;
	
	ll l=0,r=0;
	if(s[0]=='R') r++;
	else l++;
	ll i=1;
	for(i=1;i<n;i++){
		if(s[i]!=s[i-1]){
			//cout<<"i"<<i<<endl;
			if(r>0){
				vecr.push_back({r,{i-1,i-1-r+1}});
				r=0;
			}
			else if(l>0){
				vecl.push_back({l,{i-1,i-1-l+1}});
				l=0;
			}
			if(s[i]=='R') r++;
			else l++;
		}
		else{
			if(s[i]=='R') r++;
			else l++;
		}
	}
	if(r>0){
		vecr.push_back({r,{i-1,i-1-r+1}});
		r=0;
	}
	else if(l>0){
		vecl.push_back({l,{i-1,i-1-l+1}});
		l=0;
	}
	
	vector< pair<ll, pair<ll,ll > > > vecll,vecrr;
	vecll=vecl;vecrr=vecr;
	sort(vecr.rbegin(),vecr.rend());
	sort(vecl.rbegin(),vecl.rend());
	
//	cout<<endl;
//	for(ll i=0;i<vecr.size();i++){
//		cout<<vecr[i].first<<" "<<vecr[i].second.first<<" "<<vecr[i].second.second<<endl;
//	}
//	cout<<endl;
//	for(ll i=0;i<vecl.size();i++){
//		cout<<vecl[i].first<<" "<<vecl[i].second.first<<" "<<vecl[i].second.second<<endl;
//	}

	string u1=s;
	for(ll i=0;i<vecr.size()&&i<k;i++){
		for(ll j=vecr[i].second.second;j<=vecr[i].second.first;j++){
			if(u1[j]=='L') u1[j]='R';
			else u1[j]='L';
		}
	}
	
	//cout<<u1<<endl;
	
	
	ll ans1=0;
	for(ll i=1;i<n-1;i++){
		if(u1[i]=='R'&&u1[i+1]=='R'){
			ans1++;
		}
		else if(u1[i]=='L'&&u1[i-1]=='L'){
			ans1++;
		}
	}
	
	if(u1[0]=='R'&&u1[1]=='R') ans1++;
	if(u1[n-1]=='L'&&u1[n-2]=='L') ans1++;
	
	
	string u2=s;
	for(ll i=0;i<vecl.size()&&i<k;i++){
		for(ll j=vecl[i].second.second;j<=vecl[i].second.first;j++){
			if(u2[j]=='L') u2[j]='R';
			else u2[j]='L';
		}
	}
	
	
	ll ans2=0;
	for(ll i=1;i<n-1;i++){
		if(u2[i]=='R'&&u2[i+1]=='R'){
			ans2++;
		}
		else if(u2[i]=='L'&&u2[i-1]=='L'){
			ans2++;
		}
	}
	
	if(u2[0]=='R'&&u2[1]=='R') ans2++;
	if(u2[n-1]=='L'&&u2[n-2]=='L') ans2++;
//	cout<<u1<<" "<<u2<<endl;
//	cout<<ans1<<" "<<ans2<<endl;


	string u11=s;
	for(ll i=0;i<vecrr.size()&&i<k;i++){
		for(ll j=vecrr[i].second.second;j<=vecrr[i].second.first;j++){
			if(u11[j]=='L') u11[j]='R';
			else u11[j]='L';
		}
	}
	
	//cout<<u1<<endl;
	
	
	/////////////////////
	
	ll ans3=0;
	for(ll i=1;i<n-1;i++){
		if(u11[i]=='R'&&u11[i+1]=='R'){
			ans3++;
		}
		else if(u11[i]=='L'&&u11[i-1]=='L'){
			ans3++;
		}
	}
	
	if(u11[0]=='R'&&u11[1]=='R') ans3++;
	if(u11[n-1]=='L'&&u11[n-2]=='L') ans3++;
	
	
	string u22=s;
	for(ll i=0;i<vecll.size()&&i<k;i++){
		for(ll j=vecll[i].second.second;j<=vecll[i].second.first;j++){
			if(u22[j]=='L') u22[j]='R';
			else u22[j]='L';
		}
	}
	
	
	ll ans22=0;
	for(ll i=1;i<n-1;i++){
		if(u22[i]=='R'&&u22[i+1]=='R'){
			ans22++;
		}
		else if(u22[i]=='L'&&u22[i-1]=='L'){
			ans22++;
		}
	}
	
	if(u22[0]=='R'&&u22[1]=='R') ans22++;
	if(u22[n-1]=='L'&&u22[n-2]=='L') ans22++;
	
	
	////////////



	cout<<max(ans1,max(ans2,max(ans3,ans22)))<<endl;
	
	
	
}

Measured memory_bytes: 5496
using System;
using System.Linq;

namespace abc095_b
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int ret = x[0];
            int[] a = new int[x[0]];
            for (int i = 0; i < x[0]; i++) a[i] = int.Parse(Console.ReadLine());
            x[1] -= a.Sum();
            Console.WriteLine(ret + x[1] / a.Min());
        }
    }
}

Measured memory_bytes: 11348
#include"bits/stdc++.h"

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
//#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SORT_DESC(c) sort((c).rbegin(),(c).rend())
#define REV(c) reverse((c).begin(), (c).end())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

void Main()
{
    string s;cin>>s;
    if(s == "zyxwvutsrqponmlkjihgfedcba"){
        cout<<-1<<endl;
        return;
    }
    int n = SIZE(s);
    if(n==26){
        vector<bool> f(26,false);
        PER(i,n){
            REP(j,26){
                if(f[j] && s[i]<('a'+j)){
                    s=s.substr(0,i);
                    s+='a'+j;
                    cout<<s<<endl;
                    return;
                }
            }
            f[s[i]-'a'] = true;
        }

    }
    else{
        vector<bool> f(26,false);
        REP(i,n){
            f[s[i]-'a'] = true;
        }
        REP(i,26){
            if(!f[i]){
                s += (i+'a');
                break;
            }
        }
        cout<<s<<endl;
    }
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
//typedef complex<D> P;
#define F first
#define S second
const ll MOD=1000000007;
//const ll MOD=998244353;

template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,const pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,const vector<T> &A){int i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}



int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin>>N;
  vector<string> A(N);
  vector<ll> B(N);
  string X;
  ll sum=0;
  for(int i=0;i<N;i++){
    cin>>A[i]>>B[i];
    sum+=B[i];
  }
  cin>>X;
  for(int i=0;i<N;i++){
    sum-=B[i];
    if(A[i]==X){break;}
  }
  cout<<sum<<endl;
  


  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<list>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>
//#include<cmath>
using namespace std;

int A[2010], s[21];

bool solve(int i, int m, int n)
{
	if (m == 0)
		return true;
	if (i >= n)
		return false;
	bool res = solve(i + 1, m, n) || solve(i + 1, m - A[i], n);
	return res;
}

int main(void)
{
	int n, q, m;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> A[i];
	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> m;
		if (solve(0, m, n))
			cout << "yes" << endl;
		else
			cout << "no" << endl;
	}
	return 0;
}


Measured memory_bytes: 3116
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
const ll NN = 2e5 + 5;
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll a, b, c;
    cin >> a >> b >> c;
    if(a + b + c >= 22)
        cout << "bust\n";
    else
        cout << "win\n";
}

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

inline int read()
{
	int sum=0,ff=1; char ch=getchar();
	while(!isdigit(ch))
	{
		if(ch=='-') ff=-1;
		ch=getchar();
	}
	while(isdigit(ch))
		sum=sum*10+(ch^48),ch=getchar();
	return sum*ff;
}

const int N=2e5+5;

int n,m,cnt,ans[N],head[N];
struct nood
{
	int nex,to;
};
nood e[N<<1];

vector<int> col[2],mo[4];

inline void jia(int u,int v)
{
	e[++cnt].nex=head[u];
	head[u]=cnt;
	e[cnt].to=v;
}

inline void dfs(int u,int fa,int co)
{
	col[co].push_back(u);
	for ( int i=head[u];i;i=e[i].nex ) 
		if(e[i].to!=fa) dfs(e[i].to,u,co^1);
}

inline void getans(int co,int mod) 
{
	while(!col[co].empty()&&!mo[mod].empty())
	{
		ans[col[co].back()]=mo[mod].back();
		col[co].pop_back();
		mo[mod].pop_back();
	}
}

int main()
{
	n=read();
	for ( int i=1;i<=n;i++ ) mo[i%3].push_back(i);
	for ( int i=1;i<n;i++ )
	{
		int u,v;
		u=read(),v=read();
		jia(u,v);
		jia(v,u);
	}
	dfs(1,0,0);
	getans(col[0].size()<col[1].size(),1);
	getans(col[0].size()<col[1].size(),2);
	getans(1,0);
	getans(0,0);
	for ( int i=1;i<=n;i++ ) printf("%d ",ans[i]);
	return 0;
}

Measured memory_bytes: 10904
#include <bits/stdc++.h>
#define ll signed long long int
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MAXX 1000005
using namespace std;

ll a[MAXX]= {0}, b[MAXX]={0}, c[MAXX], k = 0;

signed main()
{
	FAST;
	ll  n, m;
	cin >> n;
	for(ll i = 0; i < n-1; i++){
		cin >> a[i];
		b[a[i]] ++;
	}
	for(ll i = 1; i <=n; i++){
		cout << b[i] << endl;
	}
	
}

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

int main(){
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    int ans1 = 100*a, ans2 = 0;
    for(int i = 1; i < f / 100; i++){
        int flag = 0;
        for(int l = 0; l*a <= i; l++){
            for(int m = 0; l*a+m*b <= i; m++){
                if(l*a+m*b == i){
                    flag = 1;
                }else{
                    continue;
                }
            }
        }
        if(flag == 0){
            continue;
        }
        int water = 100*i, sugar = 0;
        int maxs = min(e*i, f - i*100);
        for(int l = 0; l * c <= maxs; l++){
            for(int m = 0; l*c + m*d <= maxs; m++){
                sugar = l*c+m*d;
                if(ans2*(sugar+water) < sugar * ans1){
                    ans1 = water + sugar;
                    ans2 = sugar;
                }
            }
        }
    }
    cout << ans1 << " " <<  ans2 << endl;
}

Measured memory_bytes: 256
// template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define REP_AB(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define REP_IN(i, n, x) for (ll i = 0; i < n; i++)in>>x;
#define REP_OUT(i, n, x) for (ll i = 0; i < n; i++)out<<x<<endl;
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
#define REVERSE(v) reverse(ALL(v))
// true / false
#define BIN_SEARCH(v, a) binary_search(ALL(v), a)
// index
#define BIN_LEFT(v, a) (lower_bound(ALL(v), a) - v.begin())
#define BIN_RIGHT(v, a) (upper_bound(ALL(v), a) - v.begin())
#define BIN_INSERT(v, a) (v.insert(v.begin() + BIN_LEFT(v, a), a))
#define DEL(v, i) v.erase(v.begin() + i)
#define INSERT(v, i, a) v.insert(v.begin() + i, a)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a / gcd(a, b)) * b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
#define endl '\n'
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
// template end
 
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    ll N;
    in >> N;
    vector<ll> A(N);
    vector<ll> X(N);
    REP(i, N){
        in >> A[i];
        X[A[i]-1] = i+1;
    }
    REP(i, N){
        out << X[i] << " ";
    }
    out << endl;



}

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

const int Nmax=200010;

int main() {
	int N,flag=0;
	char s[100];
	cin >> N;
	for(int i=0;i < N;i++){
		cin >> s[i];
		if(s[i] == 'Y') flag = 1;
	}
	if(flag == 1) cout << "Four" << endl;
	else cout << "Three" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<eps)
const int SIZE = 1<<17;
int N,R,L;
struct segtree
{
	P seg[SIZE*2];
	void init()
	{
		for(int i=0;i<N;i++)
		{
			seg[i+SIZE-1].fi=0;
			seg[i+SIZE-1].sec=-i;
		}
	}
	void build()
	{
		for(int i=SIZE-2;i>=0;i--)seg[i]=max(seg[i*2+1],seg[i*2+2]);
	}
	void update(int k,int x)
	{
		k+=SIZE-1;
		seg[k].fi+=x;
		while(k>0)
		{
			k=(k-1)/2;
			seg[k]=max(seg[k*2+1],seg[k*2+2]);
		}
	}
	P query(int a,int b,int k,int l,int r)
	{
		if(r<=a||b<=l)return P(-INF,INF);
		else if(a<=l&&r<=b)return seg[k];
		else return max(query(a,b,k*2+1,l,(l+r)/2),query(a,b,k*2+2,(l+r)/2,r));
	}
	P query()
	{
		return query(0,N,0,0,SIZE);
	}
};
segtree seg;
void print(){cout << -((seg.query()).sec) << endl;}
int total[100100];
int d[1000100],t[1000100],x[1000100];
vector<int> vx;
int main()
{
	scanf("%d %d %d",&N,&R,&L);
	for(int i=0;i<R;i++)
	{
		scanf("%d %d %d",&d[i],&t[i],&x[i]);
		d[i]--;
	}
	t[R]=L;
	seg.init();
	seg.build();
	//print();
	total[-((seg.query()).sec)]+=t[0];
	for(int i=0;i<R;i++)
	{
		seg.update(d[i],x[i]);
		//print();
		total[-((seg.query()).sec)]+=t[i+1]-t[i];
	}
	int ansv=-1,ans;
	for(int i=0;i<N;i++)if(ansv<total[i])
	{
		ansv=total[i];
		ans=i;
	}
	printf("%d\n",ans+1);
	return 0;
}

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


int main() {
  string s;
  cin >> s;
  bool ok = true;
  for (int i = 0;i < s.size();i++) {
    if (i%2==0) {
      if (s.at(i) != 'h') ok = false;
    }
    else {
      if (s.at(i) != 'i') ok = false;
    }
  }
  if (s.size() % 2 == 1) ok = false;
  if (ok) cout << "Yes" << endl;
  else cout << "No" << endl;
}



Measured memory_bytes: 256
a, b, c, d = map(int, input().split(" "))

i = 0
while True:
    if i%2 == 0:
        c -= b
        if c <= 0:
            print("Yes")
            break
    else:
        a -= d
        if a <= 0:
            print("No")
            break

    i+=1

Measured memory_bytes: 9140
#include <stdio.h>

int main()
{
    int i;
    int k, n;
    int first, pre, crnt, dist;
    int max = 0, max_i;

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

    scanf("%d", &first);

    pre = first;

    for (i = 1; i < n; i++) {
        scanf("%d", &crnt);
        dist = crnt - pre;
        if (dist > max) {
            max = dist;
        }
        pre = crnt;
    }

    dist = k - pre + first;
    if (dist > max)  {
        max = dist;
    }

    printf("%d\n", k - max);

    return 0;
}

Measured memory_bytes: 1688
#include<bits/stdc++.h>
using namespace std;
#define fastio() ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define inf 1e9
#define pi 3.1415926536
#define mod 1000000007
#define fr(i,a,b,in) for(int i=a;i<b;i+=in)
#define frn(i,a,b,dc) for(int i=a;i>=b;i-=dc)
#define test(t) int t; cin>>t; while(t--)
int main()
{
	fastio();
	string st;
	cin>>st;
	int ans=0;
	fr(i,0,st.size(),1){
		ans+=(st[i]-'0');
	}
	if(ans%9==0) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 3776
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
int inf=1e8;
int cs[100000],ct[100000];
vector<int> G[100000];
int ds[100000],dt[100000];
int N;
void bfs(int s,int* d){
	queue<int> que;
	que.push(s);
	rep(i,N) d[i]=inf;
	d[s]=0;
	while(!que.empty()){
		int v=que.front();
		que.pop();
		for(int u:G[v]){
			if(d[u]==inf){
				que.push(u);
				d[u]=d[v]+1;
			}
		}
	}
}
int main(){
	int M,s,t;
	cin>>N>>M>>s>>t;
	s--,t--;
	rep(i,M){
		int x,y;
		cin>>x>>y;
		x--,y--;
		G[x].pb(y),G[y].pb(x);
	}
	bfs(s,ds);
	bfs(t,dt);
	int D=ds[t];
	rep(i,N) if(ds[i]!=inf) cs[ds[i]]++;
	rep(i,N) if(dt[i]!=inf) ct[dt[i]]++;
	long long ans=0;
	rep(i,D-1) ans+=(long long)cs[i]*ct[D-2-i];
	cout<<ans<<endl;
}

Measured memory_bytes: 8368
#include <bits/stdc++.h>
using namespace std;
int main() {
    int x = 1;
    int t = 0;
    int a, b;
    cin >> a >> b;
    while(x < b){
        t++;
        x = x + a - 1;
    }
    cout << t << endl;
    
   return 0;
}


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

int main(){
  string s;cin >> s;ll k;cin >> k;int len = s.length();
  int o = 0,p = 0,q = 0;string s2 = s;
  for(int i=1;i<len;++i){
    if(s[i-1] == s[i]){o += 1;s[i] = '0';}
  }
  if(s[len-1] == s2[0]){p += 1;s2[0] = '0';}
  for(int i=1;i<len;++i){
    if(s2[i-1] == s2[i]){p += 1;s2[i] = '0';}
  }
  if(s2[len-1] == s[0])q = p;
  else q = o;
  ll ans = 0;
  if((k-1)%2 == 0)ans = o + (((k-1)/2))*p + (((k-1)/2))*q;
  else ans = o + ((k-1)-((k-1)/2+1))*q + ((k-1)/2+1)*q;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
H = list(map(int, input().split()))

t = [0]*N
for i in range(M):
   a, b = map(int, input().split())
   t[a-1] = max(t[a-1], H[b-1])
   t[b-1] = max(t[b-1], H[a-1])

res = 0
for i in range(N):
    if H[i] > t[i]:
        res += 1

print(res) 

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

struct UnionFind{
    vector<int> par;
    vector<int> sizes;

    UnionFind(int size) : par(size), sizes(size,1){
        for(int i=0;i<size;i++) par[i] = i;
    }

    bool unite(int x,int y){
        x = find(x);
        y = find(y);

        if(x == y) return false;
        if(sizes[x] < sizes[y]) swap(x,y);

        par[y] = x;
        sizes[x] += sizes[y];
        sizes[y] = 0;
    }

    int find(int x){
        if(par[x] == x) return x; 
        return par[x] = find(par[x]);
    }

    bool isSame(int x,int y){
        return find(x) == find(y);
    }

    int getSize(int x){
        return sizes[find(x)];
    }
};

int main(){
    int N,Q;
    cin >> N >> Q;
    UnionFind forest(N);

    for(int i=0;i<Q;i++){
        int com, x, y;
        cin >> com >> x >> y;
        if(com == 0) forest.unite(x,y);
        else cout << forest.isSame(x,y) << endl;
    }
}


Measured memory_bytes: 3168
import sys
N = int(input())
txy2 = [list(map(int,input().split())) for _ in range(N)]
txy = [[0,0,0]]
for i in range(N):
    txy.append(txy2[i])
for i in range(N):
    if abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2]) > txy[i+1][0]-txy[i][0]:
        print("No")
        sys.exit()
    elif ((txy[i+1][0]-txy[i][0]) - (abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2])))%2 != 0:
        print("No")
        sys.exit()
print("Yes")

Measured memory_bytes: 28252
n, w = [int(i) for i in input().split()]
vw = [[int(i) for i in input().split()] for _ in range(n)]

# dp[i][j]: i番目までの商品から重さjまでの範囲で選んだ場合の価値の最大値
dp = [[0]*(w+1) for _ in range(n+1)]
for i in range(n):
    v_i, w_i = vw[i]
    for j in range(w+1):
        # 選ぶ場合
        if j - w_i >= 0:
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-w_i] + v_i)
        # 選ばない場合
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])

print(dp[-1][-1])



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

ll solve() {
    ll N, Y;
    cin >> N >> Y;
    for ( ll i = 0; i <= N; i++ ) {
        for ( ll j = 0; j <= N; j++ ) {
            if ( 10000 * i + 5000 * j > Y ) continue;
            ll n1000 =  (Y - (10000 * i + 5000 * j)) / 1000;
            if ( i + j + n1000 == N ) {
                cout << i << " " << j << " " << n1000 << "\n";
                return 0;
            }
        }
    }
    cout << "-1 -1 -1" << "\n";
    return 0;
}

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

Measured memory_bytes: 256