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

int main(void)
{
	long int X;

	cin >> X;

	long double deposit = 100;
	int year = 0;
	while (true) {
		deposit = deposit + floor(deposit * 0.01);
		year++;
		if (deposit >= X) break;
	}

	cout << year << endl;
	return 0;
}


Measured memory_bytes: 3636
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

void solve() {
  int r;
  scan(r);
  double ans = 2 * r * M_PI;
  print(ans);

}

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


Measured memory_bytes: 3260
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef pair<double,double> point;
const ll MAX = 2000005;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a;
    cin >> a;
    PRINT(a+a*a+a*a*a);
}


Measured memory_bytes: 3636
def main():
	import sys
	import numpy as np
	input = sys.stdin.readline
	N = int(input())
	A = [int(input()) for _ in range(N)]
	A = np.array(A)
	maxNum = np.max(A)
	maxIndex = np.where(A == A.max())[0]
	if len(maxIndex) > 1:
		for _ in range(N):
			print(maxNum)
	elif maxIndex[0] == 0:
		print(np.max(A[1:]))
		for i in range(1, N):
			print(maxNum)
	elif maxIndex[0] == N-1:
		for i in range(N-1):
			print(maxNum)
		print(np.max(A[:N-1]))
	else:
		for i in range(maxIndex[0]):
			print(maxNum)
		prev = max(np.max(A[:maxIndex[0]]), np.max(A[maxIndex[0]+1:]))
		print(prev)
		for i in range(maxIndex[0]+1, N):
			print(maxNum)



if __name__ == '__main__':
    main()

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

using namespace std;

const int N = 100005;

int n, k, a[N], dp[N];

int fun(int i) {
  if (i == n - 1) return 0;
  int &ret = dp[i];
  if (ret != -1) return ret;
  ret = 1e9;
  for (int x = 1; x + i < n && x <= k; x++) {
    ret = min(ret, abs(a[i] - a[i + x]) + fun(i + x));
  }
  return ret;
}

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

  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  memset(dp, -1, sizeof dp);
  printf("%d\n", fun(0));
  return 0;
}


Measured memory_bytes: 5760
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
using namespace std;
using ll = long long;

int main() {
    int N;
    cin >> N;
    
    double A[N];
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    double bunsi = 1;
    double bunbo = 0;
    
    for(int i=0;i<N;i++){
        bunsi *= A[i];
    }
    
    for(int i=0;i<N;i++){
        bunbo += bunsi/A[i];
    }
    double ans = 0;
    ans = bunsi/bunbo;
    
    cout << ans << endl;
    
}



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

int main() {
  int A,B,m;
  cin >>A >>B;
  m=A+B;
  if(m<A-B){
    m=A-B;
  }
  if(m<A*B){
    m=A*B;
  }
  cout << m;
}


Measured memory_bytes: 764
n = int(input())
line1 = list(map(int, input().split()))
line2 = list(map(int, input().split()))
a = 0
b = 0
for i in range(n):
    a += line1[i]
    b += line2[i]
    line1[i] = a
    line2[i] = b
line2.insert(0, 0)
c_max = 0
for i in range(n):
    c = line1[i] + line2[n] - line2[i]
    if c > c_max:
        c_max = c
print(c_max)


Measured memory_bytes: 3064
S = input()
rights = []
lefts = []
prev = "R"
for i, c in enumerate(S[1:], 1):
    if prev == "R" and prev != c:
        rights.append(i - 1)
        lefts.append(i)
    prev = c
count = 0
prev = ""
ans = [0] * len(S)
for i, c in enumerate(S):
    if c == "R":
        count += prev == "L"
        ans[lefts[count] - ((lefts[count] - i) & 1)] += 1
    else:
        ans[rights[count] + ((i - rights[count]) & 1)] += 1
    prev = c
print(*ans)

Measured memory_bytes: 10268
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        System.out.println(b/a < c ? b/a : c);
    }
}


Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
typedef vector<string> vstring;
#define _GLIBCXX_DEBUG
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
const int INF = 1 << 30;
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
#define stp(x)  setprecision(x)
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll a,b,c,k;
  cin>>a>>b>>c>>k;
  ll ans=0;
  if(a<k){
    ans+=a;
  }
  else{
    ans+=k;
  }
  k-=a;
  k-=b;
  if(k>0){
    ans-=k;
  }
  cout<<ans<<'\n';
  return(0);
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
   if (a > b) {
      a = b;
      return true;
   }
   return false;
}
template <class T>
inline bool chmax(T& a, T b) {
   if (a < b) {
      a = b;
      return true;
   }
   return false;
}
void hr() {
   cerr << "--------------" << endl;
}
const ll INF = ll(1e18);
const int MOD = 1000000007;
// const int MOD = 998244353;

int n;
ll dp[500][500], sum[500];
bool fg[500][500];
int a[500];
ll dfs(int l, int r) {
   if (l == r || l + 1 == r) return 0;
   if (fg[l][r]) return dp[l][r];

   ll af = INF;
   rep(i, l + 1, r) af = min(af, dfs(l, i) + dfs(i, r));
   fg[l][r] = true;
   return dp[l][r] = af + sum[r] - sum[l];
}
int main() {
   cin.tie(0);
   ios_base::sync_with_stdio(0);

   cin >> n;
   rep(i, 0, n) cin >> a[i];
   rep(i, 0, n) sum[i + 1] = sum[i] + a[i];
   ll ans = dfs(0, n);
   cout << ans << endl;
   return 0;
}

Measured memory_bytes: 2048
/* goes here */
#include<bits/stdc++.h> // 1 // 2
using namespace std; // 2　　//3
// using int = long long ; //3 // 4
#define yes(n) cout << ((n) ? "yes" : "no" ) << endl // 4 // 1
long long alphabet[26]; // 1 // 2
int main(){ // 2 (// 3)
    string s; //3 // 4
    cin >> s; // 4 // 1
    for(char i : s){ // 1 // 2
        alphabet[i-'a']++; // 2 (// 3)
    }  //3 // 4
    for(long long i : alphabet){ // 4 // 1
        if(i > 1)return 0 & puts("no"); // 1 // 2
    } // 2 (// 3)
    yes(1000000007);  //3 // 4
    return 0 & 1333; // 4 // 1 
} // 1 end // 2 end

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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

int main(void){
  ll x,y; cin >> x >> y;

  ll mul = 2;
  ll c = x;
  ll ans = 0;
  while(1){
    ans++;
    c *= mul;
    if(c>y) break;
  }

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


Measured memory_bytes: 3552
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
//typedef tuple<pii,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n,m;
	cin>>n>>m;
	cout<<pow(2,m)*(1900*m+100*(n-m))<<endl;
}




Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

const int MAX = 100000;
const int INFTY = (1 << 30);
int n, d[MAX];
vector<pair<int, int> > G[MAX];

// sから各頂点への距離テーブルを作る
void bfs(int s){
  bool visited[MAX];
  for(int i=0;i<n;i++){
    visited[i] = false;
    d[i] = INFTY;
  }
  queue<int> q;
  visited[s] = true;
  q.push(s);
  d[s] = 0;

  while(!q.empty()){
    int u = q.front(); q.pop();
    for(int i=0;i<G[u].size();i++){
      int next = G[u][i].first;
      int w = G[u][i].second;
      if(!visited[next]){
        q.push(next);
        d[next] = d[u] + w;
        visited[next] = true;
      }
    }
  }
}

int solve(){
  bfs(0);
  int maxcost = 0, tgt;
  for(int i=0;i<n;i++){
    if(d[i] > maxcost){
      maxcost = d[i];
      tgt = i;
    }
  }

  bfs(tgt);
  maxcost = 0;
  for(int i=0;i<n;i++){
    if(d[i] != INFTY && d[i] > maxcost){
      maxcost = d[i];
    }
  }

  return maxcost;
}

int main(){
  cin >> n;
  for(int i=0;i<n-1;i++){
    int s, t, w;
    cin >> s >> t >> w;
    G[s].push_back(make_pair(t, w));
    G[t].push_back(make_pair(s, w));
  }

  // if(n == 0) cout << 0 << endl;
  cout << solve() << endl;
  return 0;
}



Measured memory_bytes: 9888
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) {if(a<b) {a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) {if(a>b) {a=b;return 1;} return 0;}
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = 1LL<<60;

int main() {
    cin.tie(0);
    int N;
    cin >> N;
    vector<int> a(N),b(N),c(N);
    rep(i,N) {
        cin >> a[i] >> b[i] >> c[i];
    }

    vector<ll> dpa(N),dpb(N),dpc(N);
    dpa[0]=a[0];
    dpb[0]=b[0];
    dpc[0]=c[0];
    for(int i=1;i<N;i++) {
        dpa[i]=max(dpb[i-1],dpc[i-1])+a[i];
        dpb[i]=max(dpa[i-1],dpc[i-1])+b[i];
        dpc[i]=max(dpa[i-1],dpb[i-1])+c[i];
    }
    ll ans=max({dpa[N-1],dpb[N-1],dpc[N-1]});
    cout << ans << endl;
    return 0;
}

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

int main (){
  string input;for(int i=0;i<3;i++){cin>>input[i];}
  bool five =false, seven = false;
  int fcnt = 0;
  for(int i=0; i<3; i++){
    if(input[i] == '7'){
      seven =true;
      }
    else if(input[i] == '5') {
      fcnt += 1;
      }
  
    if(fcnt==2){
      five =true;
      }
    }
  if(five==true&&seven==true)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  
  return 0;
  }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define DEBUG
#define PI 3.141592653589793238462643383279

#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define REPR(i, n) for(ll i = n; i >= 1; i--)
#define FOR(i, m, n) for(ll i = m; i <= n; i++)
const ld INF = 1e9+123;
#define VEC(type,A,N) vector<type> A(N+10)
#define VECi(type,A,N,i) vector<type> A(N+10,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N+10,vector<type>(M+10))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N+10,vector<type>(M+10,i))
#define ALL(v) v.begin()+1, v.end()-9
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
vector<ll> yakusuu(ll N){
    vector<ll> ret;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ret.push_back(i);
            if (i * i != N) ret.push_back(N / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}
int main(){
    ll N,M;
    cin>>N>>M;
    
    VEC(int,p,M);
    VEC(int,s,M);
    VECi(int,w,N,-1);
    
    int wa=0,ac=0;
    REP(i,M){
        string s;int p;
        cin>>p>>s;
        if(s=="AC"){
            if(w[p]!=-2){
                ac++;
                if(w[p]!=-1)wa+=w[p];
                w[p]=-2;
                
            }
        }else if(s=="WA"){
            if(w[p]!=-2){
                if(w[p]==-1)w[p]=0;
                w[p]++;
            }
        }
    }
    cout<<ac<<" "<<wa;
    //cout<<fixed<<setprecision(15)<<m;
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 1408
x, n = map(int,input().split())
if n==0:
  print(x)
else:
  p = list(map(int,input().split()))

  min = 1000
  ans = 0
  for i in range(102):
    if abs(x-i)<min and (i in p)==False:
      min = abs(x-i)
      ans = i

  print(ans)

Measured memory_bytes: 9192
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for ( int i = 0 ; i < n ; i++ ) {
    cin >> vec.at(i);
  }
  
  vector<int64_t> data(n,0);
  for ( int i = 0 ; i < n ; i++ ) {
    data.at( vec.at(i)-1 ) +=1;
  }
  
  int64_t  sum =0;
  
  for ( int i = 0 ; i < n ; i++ ) {
    sum += data.at(i)*(data.at(i)-1)/2;
  }
  
  for ( int i = 0 ; i < n ; i++ ) {
    cout << sum +1 - data.at( vec.at(i)-1 ) << endl;
  }
  

  
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define rep(i, n) for(int i=0; i<n; ++i)
#define REP(i, n) for(int i=1; i<=n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using P = pair<int, int>;
const int inf = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9+7;
const ll MAX = 1e9+7;

int main(){
    int n, k; cin >> n >> k;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    rep(i, n-k){
        if(a[i] < a[i+k]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

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

int main()
{
    int W,H;
    cin >> H >> W;

    int a = 0;

    while(H)
    {
        for(int i=0; i<H; i++)
        {
            for(int j=0; j<W; j++)
            {
                if((i+j) % 2 == 0) cout << '#';
                else cout << '.';
            }
        cout << endl;
        }
    cout << endl;
    cin >> H >> W;
    }
    
    return 0;
}


Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T> void assign(V<T>& v, int n, const T& a = T()) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


constexpr lint mod = 1e9 + 7;
inline lint emod(lint a, lint p = mod) { return (a % p + p) % p; }

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  lint n, k; cin >> n >> k;
  VV<> mem; assign(mem, n + 1, k + 1, -1);
  fill(begin(mem[0]), end(mem[0]), 1);
  for (int i = 1; i < n + 1; ++i) mem[i][0] = 0;
  auto rec = [&](auto rec, lint n, lint k) -> lint {
    if (n < 0 or k < 0) return 0;
    if (mem[n][k] != -1) return mem[n][k];
    return mem[n][k] = (rec(rec, n, k - 1) + rec(rec, n - k, k)) % mod;
  };
  cout << emod(rec(rec, n, k)) << '\n';
}


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

int main() {
 
string s;int n;
cin >> n >> s;
int x=0;
for(int i=0;i<s.size();i++){
  
if (s[i]=='A'){
  if (s[i+1]=='B'){
    if (s[i+2]=='C'){
      x+=1;
      continue; 
    }
  }
}

}cout <<x;
return 0;}

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

using namespace std;

using ll = long long;
using ld = long double;

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

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

	int n;
	cin >> n;

	cout << n / 3 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define db double
#define ls rt << 1
#define rs rt << 1 | 1
#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define rep(i, x, y) for(int i = x; i <= y; i ++)
#define rrep(i, x, y) for(int i = x; i >= y; i --)
#define eps 1e-9
#define all(x) (x).begin(), (x).end()
#define cmax(u,v) (u)<(v)?(u)=(v):0;
using namespace std;
inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}

inline ll read1()
{
	ll x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
const int mod = 1e9 + 7;
int n, m;
int f[3010][3010][2];
int main()
{
	n = read();
	m = read();
	f[0][0][1] = 1;
	rep(i, 1, n) f[0][i][0] = 1;
	rep(i, 0, m - 1)
		rep(j, 0, n)
			rep(k, 0, 1)
			{
				if(j) (f[i + 1][j - 1][k | (j == 1)] += f[i][j][k]) %= mod;
				if(j) (f[i + 1][j][k | (j == 1)] += f[i][j][k]) %= mod;
				if(j != n) (f[i + 1][j][k] += f[i][j][k]) %= mod;
				if(j != n) (f[i + 1][j + 1][k] += f[i][j][k]) %= mod;
			}
    int ans = 0;
	rep(i, 0, n) (ans += f[m][i][1]) %= mod;
	cout << ans;
	return 0;
}


Measured memory_bytes: 70784
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    scanf("%d", &n);
    vector<int> a(n);
    for(int i = 0; i < n; i++){
    	scanf("%d", &a[i]);
    }
    int ans = 0;
    bool changed = false;
    for(int i = 1; i < n; i++){
    	if(!changed && a[i] == a[i - 1]){
    		ans++;
    		changed = true;
    	} else changed = false;
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
int main(){
    int cnt=0;
    string S,T;
    cin >> S >> T;
    
    for (int i=0; i<3; i++){
        if (S[i]==T[i]) cnt++;
    }
    cout << cnt;
    return 0;
}

Measured memory_bytes: 256
S = input().strip()
if S=="keyence":
    print("YES")
else:
    flag = 0
    for i in range(len(S)):
        for j in range(i,len(S)):
            x = S[:i]+S[j+1:]
            if x=="keyence":
                flag = 1
                break
        if flag==1:break
    if flag==1:
        print("YES")
    else:
        print("NO")

Measured memory_bytes: 64196
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric> // accumulate(v.begin(), v.end(), 0)                                                         

using namespace std;
#define ll long long

int main(){
  string S;
  cin >> S;
  S[3] = '8';
  cout << S << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
#define inf 1e9


int main(){
    	int m,n;
	cin>>m>>n;
	priority_queue<int> q;
	for(int i=0;i<m;i++){
		int tmp;
		cin>>tmp;
		q.push(tmp);
	}
	vector<vector<int> > dp(n+1,vector<int> (m+1,inf) );
	dp[0][0] = 0;
	for(int i=1;i<=n;i++){
		int c,e;
		cin>>c>>e;
		for(int j=0;j<=m;j++){
			if(c<=j){
				dp[i][j] = min(dp[i][j],dp[i-1][j-c] + e );
			}else{
				dp[i][j] = min(dp[i][j] , e) ;
			}
			dp[i][j] = min(dp[i-1][j] , dp[i][j] )  ;
		}
	}
	int res = 0;
	int sum = 0;
	for(int i=1;i <= m;i++){
		sum += q.top();
		q.pop();
		res  = max( res , sum - dp[n][i] ) ;
	//	cout<<i<<' '<<dp[n][i]<<endl;
	}
	cout<<res<<endl;

	return 0;
}



Measured memory_bytes: 22696
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    String N = scanner.nextLine();
		    
		    if( N.indexOf("9") == -1 ) 
		    {
		    	System.out.println("No");
		    }
		    else 
		    {
		    	System.out.println("Yes");
		    }
		    
		    scanner.close(); }
		  }

Measured memory_bytes: 21844
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string S;
    cin >> S;
    int ans = 0;
    for(int i = 0; i < S.size(); i++){
        for(int j = i + 1; j <= S.size(); j++){
            bool can_be_ans = true;
            for(int k = i; k < j; k++){
                if(S[k] != 'A' && S[k] != 'T' && S[k] != 'C' && S[k] != 'G'){
                    can_be_ans = false;
                    break;
                }
            }
            if(can_be_ans){
                ans = max(ans, j - i);
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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

//????????¢?´¢??¨?????§????????????????????????????????§??????????????????????????????????°??????????

using namespace std;

typedef struct s {
    int Key;
    s *Parent;
    s *Left;
    s *Right;
} Node;

Node *root,*NIL;

void insert(int Key){
    Node *x = root;//?§????????????¢?????¬???
    Node *y = NIL;//??¢?????¬???????????????????????¨????????????NIL??§?????????
    Node *z;//??¬???
    
    z = (Node *)malloc(sizeof(Node));
    z -> Key = Key;
    z -> Left = NIL;
    z -> Right = NIL;
    
    //x???NIL????????????
    while (x != NIL) {
        y = x;
        if (z -> Key < x -> Key) {
            x = x -> Left;
        }else{
            x = x -> Right;
        }
    }
    
    z -> Parent = y;
    //root??????NIL??????????????£?????´???
    //
    if (y == NIL) {
        root = z;
    }else{
        if (z -> Key < y -> Key) {
            y -> Left = z;
        }else{
            y -> Right = z;
        }
    }
}

void inoder(Node *n){
    if (n == NIL) return;
    inoder(n -> Left);
    cout << " " << n -> Key;
    inoder(n -> Right);
}

void preoder(Node *n){
    if (n == NIL) return;
    cout << " " << n -> Key;
    preoder(n -> Left);
    preoder(n -> Right);
}

int main(){
    root = NIL;
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        string com;
        cin >> com;
        if (com == "insert") {
            int num;
            scanf("%d",&num);
            insert(num);
        }else{
            inoder(root);
            cout << endl;
            preoder(root);
            cout << endl;
        }
    }
    return 0;
}

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

using namespace std;

int k;
string s;

void solve() {
  cin >> k;
  cin >> s;
  if (s.length() <= k) {
    cout << s << '\n';
  } else {
    string ans = "";
    for (int i = 0; i < k; i++) {
      ans += s[i];
    }
    ans += "...";
    cout << ans << '\n';
  }
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  solve();
  return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
long double const pi = std::acos(-1.0L);
typedef pair<int,int> P;
const int INF = 1001001001;

int main() {
  int n, k; cin >> n >> k;
  vector<int> p(n);
  rep(i,n) cin >> p[i];
  sort(p.begin(),p.end());
  int ans = 0;
  rep(i,k){
    ans += p[i];
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lb;
#define REP(i,j,n) for (int i=j;i<(n);i++)
#define RREP(i,n) for (int i = n; 0<i;i--)
#define print(out) cout<< out  << "\n";
#define mod 1000000007
const int INF = 1e9;

int main(){
  ll H,W,h,w;cin>>H>>W;
  ll ans=0;
  if(H==1||W==1){
    print(1)
    return 0;
  }
  if(W%2==1){
    w=W/2+1;
    ans+=w*H;
    ans-=H/2;
  }
  else{ 
    w=W/2;
    ans=H*w;
  }
  print(ans)
}


Measured memory_bytes: 256
from sys import stdin


class DisjointSet():
    def __init__(self):
        self.parent = None
        self.ancestor = self


def ancestor(elems, x):
    s = elems[x].ancestor
    while s.parent is not None:
        s = s.parent
    elems[x].ancestor = s
    return s


def unite(elems, x, y):
    ax = ancestor(elems, x)
    ay = ancestor(elems, y)
    if ax is not ay:
        parent = DisjointSet()
        ax.parent = ay.parent = parent


def same(elems, x, y):
    return ancestor(elems, x) is ancestor(elems, y)


def main():
    n, q = [int(x) for x in input().split()]
    elems = [DisjointSet() for _ in range(n)]

    for _ in range(q):
        com, x, y = [int(x) for x in input().split()]
        if com == 0:
            unite(elems, x, y)
        else:
            print(1 if same(elems, x, y) else 0)


if __name__ == '__main__':
    main()



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

using namespace std;

int main() {
    int n, l;
    cin >> n >> l;
    vector<string> s(n);
    for(size_t i = 0; i < n; ++i) cin >> s[i];
    sort(s.begin(), s.end());
    string res = "";
    for(size_t i = 0; i < n; ++i) res += s[i];
    cout << res << endl;
    return EXIT_SUCCESS;
}

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

int main() {
    int X;
    cin >> X;
    int ans = 1;
    for (int i = 2; i <= pow(X, 0.5); i++) {
        int cnt = i;
        while (cnt <= X){
            if (cnt*i <= X) {
                cnt *= i;
            }
            else{
                break;
            }
        }
        ans = max(ans,cnt);
        if (ans == X) {
            break;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 4012
#include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <functional>
#include <iomanip>
#include <bitset>
#include <numeric>
#include <queue>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
const long long mod = 1000000007;
typedef long long ll;




int main() {

	ll n;
	cin >> n;
	vector<ll> p(n);
	rep(i, n) cin >> p.at(i);
	vector<ll> m(n);
	int cnt = 1;
	ll num = 100010001001;
	m.at(0) = p.at(0);
	for(int i = 1; i < n; i++) {
		m.at(i) = min(m.at(i - 1), p.at(i));
	}

	for (int i = 1; i < n; i++) {
		if (m.at(i - 1) > p.at(i)) {
			cnt++;
		}
	}

	cout << cnt << endl;

	return 0;
}

Measured memory_bytes: 3456
import java.util.*;

class Main{

    public static void main(String[] args){

	Scanner in = new Scanner(System.in);
	int[] dice = {6,2,1,5,3,4};
	int sum,n,h;
	String s;

	while(true){

	n = in.nextInt();
	if(n==0)break;
	sum=1;
	dice[0]=6;
	dice[1]=2;
	dice[2]=1;
	dice[3]=5;
	dice[4]=3;
	dice[5]=4;


	for(int i=0;i<n;i++){
	    s = in.next();
	    if(s.equals("North")){
		h=dice[0];
		dice[0]=dice[3];
		dice[3]=dice[2];
		dice[2]=dice[1];
		dice[1]=h;
		sum+=dice[2];
	    }else if(s.equals("East")){
		h=dice[2];
		dice[2]=dice[5];
		dice[5]=dice[0];
		dice[0]=dice[4];
		dice[4]=h;
		sum+=dice[2];
	    }else if(s.equals("West")){
		h=dice[2];
		dice[2]=dice[4];
		dice[4]=dice[0];
		dice[0]=dice[5];
		dice[5]=h;
		sum+=dice[2];
	    }else if(s.equals("South")){
		h=dice[2];
		dice[2]=dice[3];
		dice[3]=dice[0];
		dice[0]=dice[1];
		dice[1]=h;
		sum+=dice[2];
	    }else if(s.equals("Right")){
		h=dice[1];
		dice[1]=dice[4];
		dice[4]=dice[3];
		dice[3]=dice[5];
		dice[5]=h;
		sum+=dice[2];
	    }else if(s.equals("Left")){
		h=dice[1];
		dice[1]=dice[5];
		dice[5]=dice[3];
		dice[3]=dice[4];
		dice[4]=h;
		sum+=dice[2];
	    }
	    //   for(int j=0;j<6;j++)
		//	    System.out.println("dice[" + j + "] = " + dice[j]);
	}


	System.out.println(sum);
	sum=1;



	}




    }




}

Measured memory_bytes: 0
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>/
// #include <ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define mod 1000000007LL
#define IN freopen("nocross.in","r",stdin)
#define OUT freopen("nocross.out","w",stdout)
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG printf("Hi\n")
#define INF 2000000000000000000LL
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define ln 17
#define off 2
#define SZ(z) ((int)z.size())

#define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL)


// using namespace __gnu_pbds;
using namespace std ;

// typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define maxn 300005

i64 ans[maxn] ;
i64 pos[maxn] , type[maxn] ;
i64 nextPos[maxn] ;

int main()
{
    i64 n , L , T ;

    scanf("%lld %lld %lld",&n,&L,&T) ;

    i64 cl = 0 , anticl = 0 ;

    for(int i=1 ; i<=n ; i++)
    {
        scanf("%lld %lld",&pos[i],&type[i]) ;
        if(type[i]==1) cl++ ;
        else anticl++ ;

        if( type[i] == 1 ) nextPos[i] = (pos[i]+T)%L ;
        else nextPos[i] = ((pos[i]-T)%L + L)%L ;
    }

    sort( nextPos+1 , nextPos+n+1 ) ;

    if( type[1] == 1 )
    {
        i64 collision = 0 ;
        collision = 2LL*(T/L)*anticl ;

        i64 p = (T+pos[1])%L ;

        for(int i=2 ; i<=n ; i++)
        {
            if(type[i]==1) continue ;

            if( ( pos[i]-pos[1] ) <= 2*(T%L) )
            {
                collision++ ;
                if( pos[1]+L-pos[i] <= (2*(T%L) - 2*( pos[i]-pos[1] )) ) collision++ ;
            }
        }

        collision %= n ;
        int idx = collision+1 ;

        int start = 1 ;

        for(int i=1 ; i<=n ; i++)
        {
            if( nextPos[i] == p  ) start = i ;
        }
        for(int i=start , j=1 ; j<=n ;  j++ )
        {
            ans[idx] = nextPos[i] ;

            idx++ ; if(idx>n) idx -= n ;
            i++ ; if(i>n) i -= n ;
        }
   //     return 0 ;
    }
    else{
        i64 collision = 0 ;
        collision = 2LL*(T/L)*cl ;

        i64 p = ( (pos[1]-T)%L + L )%L ;

        for(int i=n ; i>1 ; i--)
        {
            if(type[i]==2) continue ;

            if( (pos[1] + L-pos[i] ) <= 2*(T%L) )
            {
                collision++ ;
                if( (pos[i]-pos[1]) <= (2*(T%L) - 2*(pos[1] + L-pos[i] )) ) collision++ ;
            }
        }
        collision %= n ;

        int idx = 1 ;

        if(collision > 0) idx = n-collision+1 ;

        int start ;

        for(int i=n ; i>=1 ; i--)
        {
            if( nextPos[i] == p ) start = i ;
        }

        for(int j=1 , i= start ; j<=n ; j++)
        {
            ans[idx] = nextPos[i] ;
            i++ ; idx++ ;
            if(i > n) i -= n ;
            if(idx > n) idx -= n ;
        }
    }

    for(int i=1 ; i<=n ; i++)
    {
        printf("%lld\n",ans[i]) ;
     //   if(i==n) printf("\n") ;
     //   else printf(" ") ;
    }

    return 0 ;
}


Measured memory_bytes: 8064
#!/usr/bin/python3
# -*- coding: utf-8 -*-


MOD = 1000000007


N,M = map(int, input().split())
dp = [1 for _ in range(N+1)]
for _ in range(M):
  dp[int(input())] = 0

for i in range(2,N+1):
  if dp[i] > 0:
    dp[i] = (dp[i-1]+dp[i-2]) % MOD
print(dp[-1])

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef unsigned long long ull;
typedef long double ld; 
typedef tuple<int,int,int> State;

ll mod = 1e9 + 7;



#define citc(tc) int tc; cin>>tc; while(tc--){solve();}
#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()
#define deb(x) cout<<#x<<" "<<x<<endl;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cinai(a, n) vi a(n); rep(i, n) { cin>>a[i]; }
#define cinal(a, n) vl a(n); rep(i, n) { cin>>a[i]; }
#define coutai(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define coutal(a, n) rep(i, n) { cout<<a[i]<<" "; } ent;
#define ent cout<<endl;

void solve()
{
	int arr[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};	
	cini(n);
	cout<<arr[n-1]<<endl;
}
int main()
{
	fastio();
	// citc(tc);
	solve();
}

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

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; ++i) cin >> a[i];
  int q;
  cin >> q;
  while(q--) {
    int k;
    cin >> k;
    cout << count(a.begin(), a.end(), k) << endl;
  }
  return 0;
}



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

int main() {
  int n,Bob=0,Alice=0;
  cin>>n;
  vector<int> p(n);
  rep(i,n){
    cin>>p[i];
  }
  sort(p.begin(),p.end(),greater<int>());
  rep(i,n){
    if(i%2==0){
      Alice+=p[i];
    }else{
      Bob+=p[i];
    }
  }
  cout<<Alice-Bob<<endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<bits/stdc++.h>
typedef long long int ll;
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR_IN(i, a, b) for(int i = (a); i < (b); i++)
#define BETWEEN(x, a, b) ((x) >= (a) && (x) <= (b))
#define BIT(b, i) (((b) >> (i)) & 1)
#define LOG_F 1
#define LOG(...) if(LOG_F) fprintf(stderr, __VA_ARGS__)

using namespace std;

ll pow(int x, int n){
  return n == 0 ? 1 : x * pow(x, n - 1);
}


/*

 */
int a[3];

int main(){
  REP(i,3){
    cin>>a[i];
  }
  if(a[2]>=a[0] && a[2]<=a[1])
    cout<<"Yes\n";
  else
    cout<<"No\n";

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define LLI long long int
#define fst first
#define sec second
#define ULTRA 2134567890
using namespace std;

LLI w[107] = {};
LLI v[107] = {};
LLI dp[100007] = {};

int main() {
	
	int i,j;
	int N,W;
	
	cin >> N >> W;
	
	for( i=1; i<=N; i++) {
		cin >> w[i] >> v[i];
	}
	for( i=1; i<=100000; i++)
		dp[i] = ULTRA;
	dp[0] = 0;
	for( i=1; i<=N; i++) {
		for( j=100000; j>=v[i]; j--)
			dp[j] = min( dp[j], dp[ j-v[i] ] + w[i]);
	}
	for( i=100000; i>=0; i--) {
		if( dp[i] <= W)
			break;
	}
	cout << i << "\n";
	
	return 0;
} 

Measured memory_bytes: 4332
import java.util.*;
public class Main
{
    public static void main(String[] args)
    {
        //Compute c1 = new Compute();//calc
        int count = 0;
        boolean sw = false;
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        double dMax = Double.MIN_VALUE;
        double dMin = Double.MAX_VALUE;
        //StringBuilder answer=new StringBuilder();
        //input
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<Integer,Integer> map =new HashMap<>();
        for (int i=0;i<n;++i)
        {
            int a=sc.nextInt();
            map.put(a,i+1);
        }

        for (int i=1;i<n+1;++i) System.out.println(map.get(i));
        sc.close();
    }
}

Measured memory_bytes: 71912
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

int main() {
	int n, m, a, b;
	cin >> n >> m;

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

	bool ok = true;
	for (auto e : cnt) {
		if (e % 2 == 1) {
			ok = false;
			break;
		}
	}

	cout << (ok ? "YES" : "NO") << endl;
	return 0;
}


Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main() {
	int n;
	while (cin >>  n&&n != -1) {
		int sum = 0;
		sum += 1150;
		n -= 10;
		if (n>0) {
			if (n <= 10)
				sum += (n * 125);
			else
				sum += 1250;
			n -= 10;
		}
		if (n>0) {
			if (n <= 10)
				sum += (n * 140);
			else
				sum += 1400;
			n -= 10;
		}
		if (n > 0) {
			sum += (n * 160);
		}
		cout << 4280 - sum << endl;
	}
}

Measured memory_bytes: 3028
#include <stdio.h>

int main(void) {
	long max;
	long where;
	long ue;
	long sita;
	long uebak;
	long sitabak;
	long kazu;
	int kaeruiro;
	int currentiro;
	int retu[10000];
	long i;
	long result;
	char kieta;
	while(1) {
		scanf("%d",&max);
		if(max==0)break;
		for(i=0;i<max;i++) {
			scanf("%d",&retu[i]);
		}
		result=max;
		for(where=0;where<max;where++) {
			for(kaeruiro=1;kaeruiro<4;kaeruiro++) {
				currentiro=kaeruiro;
				ue=where-1;
				sita=where+1;
				kazu=1;
				kieta=0;
				do {
					uebak=ue;
					sitabak=sita;
					for(ue=ue;ue>=0;ue--) {
						if(retu[ue]!=currentiro)break;
						kazu++;
					}
					for(sita=sita;sita<max;sita++) {
						if(retu[sita]!=currentiro)break;
						kazu++;
					}
					if(kazu<4) {
						ue=uebak;
						sita=sitabak;
						break;
					}
					kieta=1;
					if(retu[ue]!=retu[sita])break;
					if(ue==-1 && sita==max)break;
					kazu=0;
					currentiro=retu[ue];
				} while(1);
				if(kieta==0)ue++;
				if(ue+1+max-sita<result)result=ue+1+max-sita;
			}
		}
		printf("%d\n",result);
	}
	return 0;
}

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

ll nextLong() { ll x; scanf("%lld", &x); return x;}

int main2() {
  int ans = 0;
  REP(i, 5) {
    int x = nextLong();
    if (x == 0) ans = i + 1;
  }
  cout << ans << endl;
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> v(N);
  for (int i = 0; i < N; i++) cin >> v[i];

  int ans = 0;
  while (true) {
    bool flag = true;
    for (int i : v) if (i % 2 != 0) flag = false;
    if (flag) {
      for (int& i : v) i /= 2;
      ans++;
    } else {
      break;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();
        
        String c = a+b;
        
        long x = Integer.parseInt(c);
        
        long ans=0;
        for(int i=1;;i++){
            ans=i*i;
            
            if(ans==x){
                System.out.println("Yes");
                return;
            }else if(ans>x){
                System.out.println("No");
                return;
            }
        }
    }
}


Measured memory_bytes: 39516
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N,K,X,Y;
    cin >> N >> K >> X >> Y;
    if(N-K>0){
        cout << ((K * X) + ((N - K) * Y)) << endl;
    }
    else{
        cout << N * X << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }
int sub(int a, int b) { return (a -= b) < 0 ? a + mod : a; }
int ctz(int x) { return __builtin_ctz(x); }
int clz(int x) { return __builtin_clz(x); }

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

  int n;
  cin >> n;
  int res = 0;
  for(int i = 0; i < n; i++){
  	int x;
    cin >> x;
    res = __gcd(x, res);
  }
  cout << res;
}

Measured memory_bytes: 256
import decimal

def volume(h, w, v):
    return h * w * v

L = decimal.Decimal(input())

i = decimal.Decimal(L/3)
j = decimal.Decimal(L/3)
k = decimal.Decimal(L/3)
max_volume = volume(i, j, k)
while k <= decimal.Decimal(L/3) + 1:
    if i + j + k > L:
        k += decimal.Decimal(0.01)
        continue
    v = volume(i, j, k)
    max_volume = max(max_volume, v)
    k += decimal.Decimal(0.01)

print(max_volume)

Measured memory_bytes: 5076
#include <cstdio>
#include <algorithm>
const int MAXN = 1e5;
struct Node
{
	int pos, value;
	bool operator < (const Node &s) const
	{
		return value < s.value;
	}
}D[MAXN];
int main()
{
	int N, i, ans = 0;
	scanf("%d", &N);
	for(i=0; i<N; ++i)
	{
		scanf("%d", &D[i].value);
		D[i].pos = i;
	}
	std::sort(D, D+N);
	for(i=0; i<N; ++i)
		if((i ^ D[i].pos) & 1)
			++ans;
	printf("%d\n", ans/2);
}

Measured memory_bytes: 896
/**********************************************************************
   File hoge.cpp
   Author  harunaya
   Date   2020-04-30(Thu)
   note   
**********************************************************************/

#include <bits/stdc++.h>
using namespace std;

int main() {
   long long int a, b, n;
   cin >> a >> b >> n;
   long long int number = floor(a*(b-1)/b);
   long long int number2 = floor(a*n/b);
   long long int ans = min(number, number2);
   cout << ans << endl;

}

Measured memory_bytes: 3636