akhauriyash/Code-Regression huggingface dataset:
//
//  main.cpp
//  Atcoder1
//
//  Created by Hamske on 2020/09/17.
//  Copyright © 2020 Author. All rights reserved.
//

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <string>

using namespace std;

//#define pb push_back
//#define mp make_pair
//
//#define F first
//#define S second

typedef long long ll;

#define rept(_i,iv,n,type) for(type _i=(type)(iv);_i<(type)(n);++_i)
//#define repi(_i,iv,n) rept(_i,iv,n,int)
//#define repl(_i,iv,n) rept(_i,iv,n,ll)

#define rept0(_i,n,type) rept(_i,0,n,type)
#define repi0(_i,n) rept(_i,0,n,int)
#define repl0(_i,n) rept(_i,0,n,ll)

//#define repst(_i,iv,n,type) for(type _i=iv;_i<=(type)(n);++_i)
//#define repsi1(_i,n) repst(_i,1,n,int)

#define REPT(_i,iv,_l,n,type) for(type _i=(type)(iv),_l=(type)(n);_i<_l;++_i)
//#define REPI(_i,iv,_l,n) REPT(_i,iv,_l,n,int)
//#define REPL(_i,iv,_l,n) REPT(_i,iv,_l,n,ll)
//
#define REPT0(_i,_l,n,type) REPT(_i,0,_l,n,type)
#define REPI0(_i,_l,n) REPT(_i,0,_l,n,int)
#define REPL0(_i,_l,n) REPT(_i,0,_l,n,ll)


//#define rrept(_i,x,e,type) for(type _i=((type)(x)-1);_i>=e;--_i)
//
//#define rrept0(_i,x,type) rrept(_i,x,0,type)
//
//#define RREPT(_i,x,_e,e,type) for(type _i=((type)(x)-1),_e=(type)(e);_i>=_e;--_i)
//
//#define RREPT0(_i,x,_e,type) RREPT(_i,x,_e,0,type)
//
//#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

//#define all(x) (x).begin(),(x).end()
#define REPV(v,_itr,_end) for(auto _itr=(v).begin(),_end=(v).end();_itr!=_end;++_itr)
#define REPVC(v,_itr,_end) for(auto _itr=(v).cbegin(),_end=(v).cend();_itr!=_end;++_itr)

#define td typedef
//#define tds(stl,type,name) typedef stl<type > name;
#define tdv(type,name) typedef vector<type > name;


typedef vector<bool> vb;
typedef vector<vb > vvb;
typedef vector<int> vi;
typedef vector<vi > vvi;
typedef vector<ll> vll;
//typedef vector<vll > vvll;
tdv(string, vs)

int main(int argc, const char * argv[]) {
    int N;
    cin>>N;
    vi A(N);
    vvi x(N),y(N);
    repi0(i, N){
        cin>>A[i];
        x[i].resize(A[i]);
        y[i].resize(A[i]);
        repi0(j, A[i]){
            int x1;
            cin>>x1>>y[i][j];
            --x1;
            x[i][j]=x1;
        }
    }
    
    int max=0;
    REPI0(s, l,1<<N){
        bool errFlg=false;
        int cnt=0;
        repi0(i, N){
            if(((s>>i)&1)==0){//不親切
                continue;
            }
            cnt+=1;
            repi0(j, A[i]){
                if(((s>>x[i][j])&1)!=y[i][j]){
                    errFlg=true;
                    break;
                }
            }
            if(errFlg){
                break;
            }
        }
        if(!errFlg){
            if(max<cnt){
                max=cnt;
            }
        }
    }
    cout<<max<<endl;
    
    return 0;
}


Measured memory_bytes: 3132
while str = gets do
    num1, num2 = str.chomp.split(" ").map(&:to_i)
    break if num1 == 0 && num2 == 0
    sum_array = []
    num2.times do |n|
        sum_array << [0, n + 1]
    end
    
    num1.times do |n|
        array = gets.chomp.split(" ").map(&:to_i)
        array.each_with_index do |m, i|
            sum_array[i][0] += m
        end
    end
    puts sum_array.sort!{|ar1, ar2| ar2[0] <=> ar1[0]}.map(&:last).join(" ")
end

Measured memory_bytes: 9172
import std.stdio;
import std.ascii;
import std.conv;
import std.string;
import std.algorithm;
import std.range;
import std.functional;
import std.math;
import core.bitop;
import std.numeric;

alias lread = () => readln.chomp.to!long;
alias aryread = () => readln.split.to!(long[]);

void main()
{
    auto nx = aryread();
    long N = nx[0];
    long x = nx[1];
    auto a = aryread();
    a.sort();
    foreach (i; 0 .. N)
    {
        if (x < a[i])
        {
            writeln(i);
            return;
        }
        else
        {
            x -= a[i];
        }
    }
    if (x == 0)
    {
        writeln(N);
    }
    else
    {
        writeln(N - 1);
    }
}


Measured memory_bytes: 256
n=int(input())
a= [int(input()) for i in range(n)]

import collections


a = collections.Counter(a)

a=list(a.most_common())
# [('a', 4), ('c', 2), ('b', 1)]
count=0
for i in range(len(a)):
    if a[i][1]%2==1:
        count+=1
print(count)

Measured memory_bytes: 65364
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

int main(void) {
    string S;
    cin >> S;
    if(S[2] == S[3] && S[4] == S[5]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main() {
	int k;
	cin >> k;
	int a, b;
	cin >> a >> b;
	int i;
	for (i = a; i <= b; i++) {
		if (i % k == 0) {
			cout << "OK\n";
			return 0;
		}
	}
	cout << "NG\n";
	return 0;
}

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

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    if(A+B>=C){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */



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

	LL N, M; cin >> N >> M;
	VI likes(M, 1);
	FOR(_, 0, N) {
		int K; cin >> K;
		VI in(M,0);
		FOR(i, 0, K) {
			int a; cin >> a;
			in[a - 1] = 1;
		}
		FOR(i, 0, M) {
			if (in[i])continue;
			likes[i] = 0;
		}
		DD(De(likes));
	}


	LL ans = accumulate(ALL(likes), 0);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
using namespace std;
#define REP(i, limit) for(int i=0; i< limit; ++i)
#define LINT long long
char maze[50][50];
int dist[50][50];
int H, W;
int white=0;
struct coor{
  int h;
  int w;
  int d;
};
//キュー
queue<coor> q;
coor target;
void bfs(){
  int w = (q.front()).w;
  int h = (q.front()).h;
  int d = (q.front()).d;
  q.pop();
  if( w<0 || W<=w || h<0 || H<=h
          || maze[h][w] == '#'|| dist[h][w]!=-1) return;
  dist[h][w]=d;
  q.push({h+1, w, d+1});
  q.push({h-1, w, d+1});
  q.push({h, w+1, d+1});
  q.push({h, w-1, d+1});
  return;
}

int main(){
  cin>>H>>W;
  REP(i, 50) REP(j, 50) {
    dist[i][j]=-1;
    maze[i][j]='#';
  }
  REP(i, H) REP(j, W){
    cin>>maze[i][j];
    if(maze[i][j]=='.') ++white;
  }
  q.push({0, 0, 0});
  while(!q.empty()) bfs();
  if(dist[H-1][W-1]==-1) printf("-1\n");
  else printf("%d\n", white-dist[H-1][W-1]-1);

  return 0;
}


Measured memory_bytes: 256
A, B, C, X, Y = map(int, input().split())

AandB = X * A + Y * B
allAB = max(X, Y) * 2 * C  # すべてAB

comb = min(X, Y) * 2 * C  # 余らないAB
minXY = min(X, Y)
X -= minXY
Y -= minXY
comb += X * A
comb += Y * B

print(min(AandB, allAB, comb))

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

#define ll long long
#define pb push_back
#define mk make_pair
#define fr first
#define sc second
#define vi vector < int >
#define pi pair < int, int >

const int M = 107;
const int N = 1e5 + 7;
const int mod = 1e9 + 7;

pi a[N];
int n;

main(){
    cin >> n;
    for (int i = 1; i <= n; i++){
        scanf("%d", &a[i].fr);
        a[i].sc = i;
    }
    sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; i++){
        printf("%d ", a[i].sc);
    }
}


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

int main() {
  vector<vector<int>> A(3, vector<int>(3));
  for(int i = 0; i < 3; i++) {
    for(int j = 0; j < 3; j++) {
      cin >> A.at(i).at(j);
    }
  }
  int N;
  cin >> N;
  bool k = false;
  vector<int> b(N);
  for(int i = 0; i < N; i++) {
    cin >> b.at(i);
  }
  for(int i = 0; i < N; i++) {
    for(int j = 0; j < 3; j++) {
      for(int k = 0; k < 3; k++) {
        if(b.at(i) == A.at(j).at(k)) {
          A.at(j).at(k) = 0;
        }
      }
    }
  }
  if(A.at(0).at(0) + A.at(0).at(1) + A.at(0).at(2) == 0) {
    k = true;
  }
  if(A.at(1).at(0) + A.at(1).at(1) + A.at(1).at(2) == 0) {
    k = true;
  }
  if(A.at(2).at(0) + A.at(2).at(1) + A.at(2).at(2) == 0) {
    k = true;
  }
  if(A.at(0).at(0) + A.at(1).at(0) + A.at(2).at(0) == 0) {
    k = true;
  }
  if(A.at(0).at(1) + A.at(1).at(1) + A.at(2).at(1) == 0) {
    k = true;
  }
  if(A.at(0).at(2) + A.at(1).at(2) + A.at(2).at(2) == 0) {
    k = true;
  }
  if(A.at(0).at(0) + A.at(1).at(1) + A.at(2).at(2) == 0) {
    k = true;
  }
  if(A.at(0).at(2) + A.at(1).at(1) + A.at(2).at(0) == 0) {
    k = true;
  }
  if(k == true) {
    cout<<"Yes"<<endl;
  }
  else {
    cout<<"No"<<endl;
  }
}


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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define fst first
#define snd second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define EPS (1e-9)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

const string YES = "";
const string NO  = "";

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

// B

void solve() {

}

int main() {
  string s,t;
  cin >> s >> t;
  int mini = INT_MAX;
  rep(i,(int)s.size()) {
    if( i + (int)t.size()-1 >= (int)s.size() ) continue;
    int cost = 0;
    rep(j,(int)t.size()) {
      assert( i + j < (int)s.size() );
      if( s[i+j] != t[j] ) {
	++cost;
      }
    }
    mini = min(mini,cost);
  }
  cout << mini << endl;
  return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T, class S> std::ostream& operator <<(std::ostream& os, std::pair<T, S> p)
{
  return os << "(" << p.first << " " << p.second << ")";
}

template<class T> std::ostream& operator <<(std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  //os << v[0]; for (ll i = 1; i < (ll)v.size(); i++){ os << " " << v[i]; }
  return os;
}

template<class T, class S> std::ostream& operator <<(std::ostream& os, std::map< T, S > m)
{
  ll i = 0; for (auto p : m){ os << " [" << i << "]" << p.first << "->" << p.second; i++;}
  return os;
}

template<class T> std::ostream& operator <<(std::ostream& os, std::vector< std::vector<T> > vv)
{
  for (auto& vec : vv){ os << vec << std::endl; }
  os << "--------" << std::endl;
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H&& head){ std::cout << head << std::endl; }
template<typename H, typename... T> void print(H&& head, T&&... tail){
  std::cout << head << " ", print(std::forward<T>(tail)...);
}

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

  ll X;
  std::cin >> X;

  std::vector<ll> vx;
  for (ll a = -1000; a <= 1000; a++) {
    ll a5 = std::pow(a, 5);
    std::vector<ll> vb;
    for (ll i = -1000; i <= 1000; i++) vb.push_back(a+i);
    for (auto b : vb) {
      ll b5 = std::pow(b, 5);
      if (a5 - b5 == X) {
        print(a, b);
        std::exit(0);
      }
    }
  }

  return 0;
}


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

#define int long long int
#define double long double
#define endl "\n"
#define sz(x) (int)x.size()

using namespace std;

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  int n;
  cin>>n;

  int a[4];
  memset(a, 0, sizeof a);

  for(int i=0; i<n; i++) {
      string s;
      cin>>s;

      if(s=="AC") {
          a[0]++;
      } else if(s=="WA") {
          a[1]++;
      } else if(s=="TLE") {
          a[2]++;
      } else {
          a[3]++;
      }
  }

  cout<<"AC x "<<a[0]<<endl;
  cout<<"WA x "<<a[1]<<endl;
  cout<<"TLE x "<<a[2]<<endl;
  cout<<"RE x "<<a[3]<<endl;
}

Measured memory_bytes: 3656
// Time:
// Algorithms: 

#include <bits/stdc++.h>

#pragma GCC optimize("O3")

using namespace std;

#define MAXN 1000005

#define FOR(i, n) for (int i = 0; i < n; i++)
#define FORR(j, i, n) for (int i = j; i < n; i++)
#define FORD(i, n) for (int i = n - 1; i >= 0; i--)
#define FOBIR(i, n) for (int i = 1; i <= n; i++)
#define FOBIRD(i, n) for (int i = n; i >= 1; i--)
#define pb push_back
#define mp make_pair
#define endl '\n'
#define DUEHOANG                  \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL);                \
    cout.tie(NULL)

#define fileio(in, out)      \
    freopen(in, "r", stdin); \
    freopen(out, "w", stdout);

#define ll long long
#define INF (1e9*1)+5

typedef set<int> si;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<int, pii> iii;
typedef vector<pii> vii;
typedef vector<iii> viii;
typedef priority_queue<int> pqi;
typedef stack<int> sti;
typedef queue<int> qi;
typedef deque<int> di;
typedef map<int, int> mii;
#define f first
#define s second

#define LEFT(x) 2 * x
#define RIGHT(x) 2 * x + 1

#define bitinc(x) x&-x

const int MAX(int &a, int b)
{
    return a = max(a, b); 
}
const int MIN(int &a, int b)
{
    return a = min(a, b); 
}

int n, k;
int R,P,S;
string T;
bool bigboi[100005];
int main()
{
    int t = 1;
    // cin >> t; // uncomment if it's multitest
    while(t--)
    {
        cin >> n >> k;
        cin >> R >> S >> P;
        cin >> T;
        ll score = 0;
        FOR(i, k)
        {
            if(T[i] == 's') score += R;
            else if(T[i] == 'r') score += P;
            else score += S;
        }
        FORR(k, i, n)
        {
            if(T[i-k] != T[i] || bigboi[i-k])
            {
                if(T[i] == 's') score += R;
                else if(T[i] == 'r') score += P;
                else score += S;
            } else bigboi[i] = 1;
            // else we can just set it so that we don't lose the one k after
            // this is always possible
        }
        cout << score << endl;
    }
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    string S;
    cin >> S;
    int len = S.size();
    rep(i,len){
        cout << "x";
    }
    cout << endl;
}



Measured memory_bytes: 3588
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
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(a > b){ a = b; return 1; } return 0; }
int main()
{
  int n,k;cin >> n >> k;
  vector<int> cnt(n, 0);
  rep(i,k) {
    int d; cin >> d;
    rep(j,d) {
      int a; cin >> a; a--;
      cnt[a]++;
    }
  }

  int res = 0;
  rep(i,n) if(cnt[i] == 0) res++;
  cout << res << "\n";
  return 0;
}


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

int main()
{
    int A, B;
    cin >> A >> B;
    if (A == 1)
    {
        A = 14;
    }
    if (B == 1)
    {
        B = 14;
    }
    if (A == B)
    {
        cout << "Draw";
    }
    else if (A > B)
    {
        cout << "Alice";
    }
    else
    {
        cout << "Bob";
    }
}

Measured memory_bytes: 256
from collections import Counter

N = int(input())
S = str(input())

dic = Counter(S)
ans = dic["R"] * dic["G"] * dic["B"]

for cntr in range(N):
    i = 1
    while True:
        left = cntr - i
        right = cntr + i
        if not (0 <= left and right < N): break
        if S[left] != S[cntr] and S[cntr] != S[right] and S[right] != S[left]: ans -= 1
        i += 1

print(ans)

Measured memory_bytes: 74120
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

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 = sc.next();
		
		// 計算
		String result = "";
		int ia = 0;
		int ib = 0;
		int ic = 0;
		char next = 'a';
		while(true){
		    if(next == 'a'){
		        if(ia == a.length()){
		            result = "A";
		            break;
		        }else{
		            next = a.charAt(ia);
		            ia++;
		        }
		    }else if(next == 'b'){
		        if(ib == b.length()){
		            result = "B";
		            break;
		        }else{
		            next = b.charAt(ib);
		            ib++;
		        }
		    }else{
		        if(ic == c.length()){
		            result = "C";
		            break;
		        }else{
		            next = c.charAt(ic);
		            ic++;
		        }
		    }
		}
		
		// 出力
		System.out.println(result);
	}
	
	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}


Measured memory_bytes: 21204
#include <algorithm>
#include <iostream>
#include <random>
#include <string>
#include <vector>

int main()
{
    std::string s;
    std::cin >> s;
    std::cout << s[0] << s.size() - 2 << s[s.size() - 1] << std::endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;

typedef pair<int,int> P;

int main(void){
    int n,k;
    long long s=0,t,u[100002],w;
    vector<int> v[100002];
    priority_queue<P, vector<P>, greater<P>> q;
    P p[100002];
    map<int,int> m;
    cin>>n>>k;
    for(int i=0;i<n;i++){
        int t,d;
        cin>>t>>d;
        p[i].first=d;
        p[i].second=t;
    }
    sort(p,p+n,greater<P>());
    for(int i=0;i<k;i++){
        s+=p[i].first;
        m[p[i].second]++;
        u[p[i].second]+=p[i].first;
        q.push(p[i]);
    }
    //cout<<m[3]<<endl;
    w=m.size();
    t=s+w*w;
    for(int i=k;i<n;i++){
        if(m[p[i].second]==0){
            bool wh=true;
            while(!q.empty()&&wh){
                P z=q.top();
                q.pop();
                if(m[z.second]>1){
                    s-=z.first;
                    s+=p[i].first;
                    m[p[i].second]++;
                    w++;
                    t=max(t,s+w*w);
                    wh=false;
                }
            }
            if(wh)break;
        }
        //cout<<p[i].first<<p[i].second<<endl;
        //cout<<"---"<<m[p[i].second]<<endl;
        //cout<<"i"<<i<<" "<<s<<endl;
    }
    cout<<t<<endl;
    
}


Measured memory_bytes: 7028
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

int main()
{
    int n;
    std::cin >> n;

    int num_odd = 0, num_even = 0;
    for (int i = 0; i < n; i++) {
        int temp;
        std::cin >> temp;

        if (temp % 2) {
            num_odd++;
        } else {
            num_even++;
        }
    }

    std::cout << pow(3, n) - pow(2, num_even) << std::endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef trie<string, null_type, trie_string_access_traits<>, pat_trie_tag, trie_prefix_search_node_update> pref_trie;
typedef unsigned long long BITMASK; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<double, double> pdd; typedef pair<long long, long long> pll;
#define has_bit(bit_mask, x) ((bit_mask) & (1ULL << (x)))
#define turn_on_bit(bit_mask, x) (bit_mask |= (1ULL << (x)))
#define turn_off_bit(bit_mask, x) (bit_mask &= (~(1ULL << (x))))
#define smallest_on_bit(bit_mask) (__builtin_ctzint((bit_mask) & (-(bit_mask))))
#define CLOCK_START clock_t chrono_clk_beg = clock()
#define CLOCK_END clock_t chrono_clk_end = clock(); cerr << (double(chrono_clk_end - chrono_clk_beg) / CLOCKS_PER_SEC) << " sec"
#define bug(args ...) cerr << __LINE__ << ">> ", err(new istringstream(string(#args)), args), cerr << '\n'
#define decToBin(name, num) string name = bitset<8>(num).to_string();
#define binToDec(name, binary) unsigned long name = bitset<8>(binary).to_ulong();
#define radToDeg(name, radians) double name = radians * 180 / M_PI;
#define all(x) x.begin(), x.end()
#define removeDuplicates(vec) sort(vec.begin(), vec.end()); vec.erase(unique(vec.begin(), vec.end()), vec.end())
#define printMat(mat) for (auto &x : mat) { for (auto &y : x) { if (y < INF) cout << setw(7) << y; else cout << setw(7) << "-"; } cout << '\n'; }
#define fillMat(mat, n, m, x) for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) mat[i][j] = x;
#define printArr(arr) for (auto &x : arr) cout << x << " "; cout << '\n';
#define arrReplace(arr, from, to) for (auto &x : arr) if (x == from) x = to;
#define INF (1LL<<30)
#define INF32 (1LL<<62)
#define F first
#define S second
#define M_PI 3.14159265358979323846
inline int ceil(int a, int b) { return (a+b-1)/b; }
void err(istringstream *iss) {} template<typename T, typename ... Args> void err(istringstream *iss, const T &_val, const Args & ... args) { string _name; *iss >> _name; if (_name.back()==',') _name.pop_back(); cerr << _name << " = " << _val << "; ", err(iss, args ...); }
int str_replace(string& str, const string& from, const string& to, int limit = -1) { if(from.empty()) return 0; size_t start_pos = 0; int cnt = 0; while((start_pos = str.find(from, start_pos)) != std::string::npos) { str.replace(start_pos, from.length(), to); start_pos += to.length(); cnt++; if (cnt == limit) break; } return cnt; }
#define MOD 1000000007
#define int ll

signed main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n; cin >> n;
	int ans = ((n/500)*1000) + ((n%500)/5)*5;
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 256
// Gaurav Aggarwal

/*
useful stl
array<ll,size> ar;         //size(),front(),back(),fill(),empty()
deque<ll> d                //push_back(),push_front(),pop_front(),pop_back()
vector<ll> v(size,val);    //push_back(),*max_element(v.begin(),v.end()),accumulate(v.begin(),v.end(),0)
stack<ll> g;               //push(),pop(),top(),size(),empty()         LIFO
queue<ll> q;               //push(),size(),front(),back(),empty()      FIFO
priority_queue<ll> pq
*/

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

typedef long long ll;
typedef pair<ll,ll> ipair;
typedef pair<long,long> lpair;
#define scan(x) do{while((x=getchar_unlocked())<'0'); for(x-='0'; '0'<=(_=getchar_unlocked()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
#define For(i, a, b) for(__typeof (a) i=a; i<=b; i++)
#define mod 1000000007
#define PI 3.141592653589793238462643383279502884 
#define debug1(a) cout<<a<<"\n";
#define debug2(a,b) cout<<a<<" "<<b<<"\n";
#define debug3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n";
#define debug_arr(a,n) {for(__typeof (n) i=0; i<n; ++i) {cout<<a[i]<<" ";}}
#define inp_arr(a,n) for(__typeof (n) i=0; i<n; ++i) {cin>>a[i];}
#define beg_arr(a,n) for(__typeof (n) i=0; i<n; ++i) {a[i] = 0;}

ll power(ll x, ll y) 
{ 
    ll res = 1;   
    while (y > 0) { 
        if (y & 1) 
            res = (res*x)%mod; 
        y = y>>1;
        x = (x*x)%mod; 
    } 
    return res%mod; 
}

ll lis( ll arr[], ll n )  
{  
    ll lis[n]; 
   
    lis[0] = 1;    
  
    for (int i = 1; i < n; i++ )  
    { 
        lis[i] = 1; 
        for (int j = 0; j < i; j++ )   
            if ( arr[i] > arr[j] && lis[i] < lis[j] + 1)  
                lis[i] = lis[j] + 1;  
    } 
  
    return *max_element(lis, lis+n); 
}  

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


    int n;
    cin>>n;
    int a[n];
    inp_arr(a,n);

    int sum = 0;
    for(int i=0;i<n;++i) {
        sum += a[i];
    }

    for(int i=0;i<n;++i) {
        if(a[i] >= sum - a[i]) {
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
bool G[55][55];
int main() {
	int n,m;
	cin >> n >> m;
	int a[m],b[m];
	for(int i=0;i<m;i++){
		cin >> a[i] >> b[i];
		G[a[i]-1][b[i]-1]=true;
		G[b[i]-1][a[i]-1]=true;
	}
	int count=0;
	for(int i=0;i<m;i++){
		G[a[i]-1][b[i]-1]=false;
		G[b[i]-1][a[i]-1]=false;
		vector<int> dist(n,-1);
		queue<int> que;
		dist[0]=0;
		que.push(0);
		while(!que.empty()){
			int v=que.front();
			que.pop();
			for(int j=0;j<n;j++){
				if(G[v][j]){
					if(dist[j]!=-1) continue;
					else{
						que.push(j);
						dist[j]=dist[v]+1;
					}
				}
			}
		}
		bool flag=true;
		for(int i=0;i<n;i++){
			if(dist[i]==-1) flag=false;
		}
		if(!flag) count++;
		G[a[i]-1][b[i]-1]=true;
		G[b[i]-1][a[i]-1]=true;
	}
	cout << count << endl;
}


Measured memory_bytes: 256
/*
ID: wangjun30
TASK:
LANG: C++
*/
#include<iostream>
using namespace std;
long long num[51],nump[51];
long long dfs(int i,long long x){
	if(x==0)
		return 0;
	if(i==1){
		if(x<5)
			return x-1;
		else
			return x-2;
	}
	long long nege=1,val=0;
	if(x>num[i]/2)
		nege++,val++;
	if(x==num[i])
		nege++;
	if(x>=num[i]/2)
		nege+=num[i-1],val+=nump[i-1];
	x-=nege;
	val+=dfs(i-1,x);
	return val;
}
int main(){
	num[0]=1;
	nump[0]=1;
	for(int i=1;i<=50;i++)
		num[i]=num[i-1]*2+3,nump[i]=nump[i-1]*2+1;
	long long n,x;
	cin>>n>>x;
	cout<<dfs(n,x);
	return 0;
}

Measured memory_bytes: 256
N = gets.to_i
As = gets.split.map(&:to_i)

mx = ->(a, b){a > b ? a : b}
ab = ->(a, b){(a - b).abs}
as = As.map.with_index.sort_by(&:first).reverse
dp = Array.new(N + 1){Array.new(N + 1, 0)}
(0 ... N).each do |l|
  (0 ... N - l).each do |r|
    a, p = as[l + r]
    dp[l + 1][r] = mx[dp[l + 1][r], dp[l][r] + a*ab[p, l]]
    dp[l][r + 1] = mx[dp[l][r + 1], dp[l][r] + a*ab[p, N - r - 1]]
  end
end
puts (0 ... N).map{dp[_1][N - _1]}.max

Measured memory_bytes: 45804
#define NDEBUG

#include <unordered_map>
#include <functional>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <utility>
#include <string>
#include <vector>
#include <queue>
#include <tuple>
#include <set>
#include <map>

// [0, max)
#define FOR0(var, max) for (sl (var) = 0; (var) < (max); ++(var))
// [min, max)
#define FORi(var, min, max) for (sl (var) = (min); (var) < (max); ++(var))
// [min, max)
#define FORi_INV(var, min, max) for (sl (var) = (max) - 1; (var) + 1 > (min); --(var))
#define FORITER(var, iter) for (auto (iter) = (var).begin(); (iter) != (var).end(); (iter)++)
#define FORITER_INV(var, iter) for (auto (iter) = (var).rbegin(); (iter) != (var).rend(); (iter)++)

// a < b < c
#define LTLT(a, b, c) (((a) < (b)) && ((b) < (c)))
// a <= b < c
#define LELT(a, b, c) (((a) <= (b)) && ((b) < (c)))
// a < b <= c
#define LTLE(a, b, c) (((a) < (b)) && ((b) <= (c)))
// a <= b <= c
#define LELE(a, b, c) (((a) <= (b)) && ((b) <= (c)))

#ifndef NDEBUG
#  define MASSERT(cond) m_assert(cond, __LINE__, #cond);
#else
#  define MASSERT(...)
#endif

using namespace std;

using uc = unsigned char;
using ui = unsigned int;
using ul = unsigned long long int;

using sc = signed char;
using si = signed int;
using sl = signed long long int;

using ld = long double;

void m_assert(const bool& cond, const sl& line, const char *condstr) {
  if (!cond) {
    cerr << "Assertion Failed: " << condstr << " at line " << line << endl;
    exit(1);
  }
}

static si N;
static string S;

void solve(void) {
  if (N % 2 == 1) {
    cout << "No" << endl;
    return;
  }
  FOR0(i, N / 2) {
    if (S[i] != S[i + N / 2]) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
}

int main(void) {
  cin >> N;
  cin >> S;
  solve();
  return 0;
}

Measured memory_bytes: 256
try:

    # パラメータの取得
    k = int(input()) # int型1個

    # 偶数の数?奇数の数
    e = int(k / 2)
    o = e if k % 2 == 0 else e + 1

    # print(e, o)
    print(e * o)

except EOFError:
    pass


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

typedef long long ll;

int main() {

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    unsigned long long int x = 0;
    cin >> x;
    unsigned long long int amt = 100;
    unsigned long long int count = 0;
    while(amt < x) {
        amt = amt + floor(amt/100);
        count++;
    }
    cout << count << endl;
    


    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
//typedef vector<vector<ll>> Graph;

const ll mod = 1e9 + 7;
//const ll mod = 998244353;

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define spa << " " <<
#define fi first
#define se second

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 (a>b) { a=b; return 1; } return 0; }

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<endl;}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<endl;};

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

    ll N;
    cin >> N;

    vector<ll> cnt(20000, 0);

    for(int x=1;x<=100;x++){
        for(int y=1;y<=100;y++){
            for(int z=1;z<=100;z++){
                ll val = x*x + y*y + z*z + x*y + y*z + z*x;
                if(val<20000) cnt[val]++;
            }
        }
    }

    for(int i=1;i<=N;i++) cout << cnt[i] << endl;

    return 0;
}

Measured memory_bytes: 3612
c=input()
test='Yes'
for i in range (len(c)) :
    if( i % 2) ==0 :
        if not (c[i] in 'URD') :
            test = 'No'
            break
    else :
        if not (c[i] in 'ULD') :
            test = 'No'
            break
print( test)
       

        
            
    



Measured memory_bytes: 2940
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
using ll = long long;
int main(){
    int a,b;
    cin >> a >> b;
    if(a>=13)   cout << b;
    else if(a>5) cout << b/2;
    else    cout << 0;
}

Measured memory_bytes: 256
//dlang template---{{{
import std.stdio;
import std.conv;
import std.string;
import std.array;
import std.algorithm;
import std.typecons;
import std.math;
import std.range;

// MIT-License https://github.com/kurokoji/nephele
class Scanner
{
  import std.stdio : File, stdin;
  import std.conv : to;
  import std.array : split;
  import std.string;
  import std.traits : isSomeString;

  private File file;
  private char[][] str;
  private size_t idx;

  this(File file = stdin)
  {
    this.file = file;
    this.idx = 0;
  }

  this(StrType)(StrType s, File file = stdin) if (isSomeString!(StrType))
  {
    this.file = file;
    this.idx = 0;
    fromString(s);
  }

  private char[] next()
  {
    if (idx < str.length)
    {
      return str[idx++];
    }

    char[] s;
    while (s.length == 0)
    {
      s = file.readln.strip.to!(char[]);
    }

    str = s.split;
    idx = 0;

    return str[idx++];
  }

  T next(T)()
  {
    return next.to!(T);
  }

  T[] nextArray(T)(size_t len)
  {
    T[] ret = new T[len];

    foreach (ref c; ret)
    {
      c = next!(T);
    }

    return ret;
  }

  void scan()()
  {
  }

  void scan(T, S...)(ref T x, ref S args)
  {
    x = next!(T);
    scan(args);
  }

  void fromString(StrType)(StrType s) if (isSomeString!(StrType))
  {
    str ~= s.to!(char[]).strip.split;
  }
}

//Digit count---{{{
int DigitNum(int num) {
  int digit = 0;

  while (num != 0) {
    num /= 10;
    digit++;
  }

  return digit;
}
//}}}
//}}}

void main() {
  Scanner sc = new Scanner;

  int N, M;
  sc.scan(N, M);
  int[] X = new int[M];
  foreach (i; 0 .. M)
    sc.scan(X[i]);

  sort(X);

  int[] diff = new int[M - 1];

  foreach (i; 0 .. M - 1)
    diff[i] = abs(X[i] - X[i + 1]);

  reverse(sort(diff));

  int sum = 0;
  foreach (i; N - 1 .. diff.length)
    sum += diff[i];

  writeln(sum);
}


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

struct edge {
    int to, cap, rev;
};

using edges = std::vector<edge>;
using graph = std::vector<edges>;

void add_edge(graph& g, int from, int to, int cap) {
    g[from].push_back(edge{to, cap, static_cast<int>(g[to].size())});
    g[to].push_back(edge{from, 0, static_cast<int>(g[from].size()-1)});
}

int dfs(graph& g, std::vector<bool>& used, int v, int t, int f) {
    if(v == t) {
        return f;
    }
    used[v] = true;
    for(int i=0; i<g[v].size(); ++i) {
        edge& e = g[v][i];
        if(!used[e.to] && e.cap > 0) {
            int d = dfs(g, used, e.to, t, std::min(f, e.cap));
            if(d > 0) {
                e.cap -= d;
                g[e.to][e.rev].cap += d;
                return d;
            }
        }
    }
    return 0;
}

int max_flow(graph& g, int s, int t) {
    int flow = 0;
    int INF = 1e9;
    std::vector<bool> used(g.size(), false);
    while(true) {
        std::fill(used.begin(), used.end(), false);
        int f = dfs(g, used, s, t, INF);
        if(f == 0) {
            return flow;
        }
        flow += f;
    }

}

int calc_max(int n, vector<int> const& u, vector<int> const& v) {
    const int m = u.size();
    graph g(n + m + 2);
    const int source = n + m;
    const int dest = n + m + 1;
    for(int i=0; i<m; ++i) {
        add_edge(g, u[i], n + i, 1);
        add_edge(g, v[i], n + i, 1);
        add_edge(g, n + i, dest, 1);
    }
    for(int i=0; i<n; ++i) {
        add_edge(g, source, i, 0);
    }
    int flow = 0;
    int res = 1;
    for(; ; ++res) {
        for(auto& e : g[source]) {
            e.cap += 1;
        }
        flow += max_flow(g, source, dest);
        if(flow == m) {
            break;
        }
    }
    return res;
}

int calc_min(int n, vector<int> const& u, vector<int> const& v) {
    const int m = u.size();
    graph g(n + m + 2);
    const int source = n + m;
    const int dest = n + m + 1;
    for(int i=0; i<m; ++i) {
        add_edge(g, u[i], n + i, 1);
        add_edge(g, v[i], n + i, 1);
        add_edge(g, n + i, dest, 1);
    }
    for(int i=0; i<n; ++i) {
        add_edge(g, source, i, 0);
    }
    int res = 0;
    int flow = 0;
    for(int i = 1; i <= 100; ++i) {
        for(auto& e : g[source]) {
            e.cap += 1;
        }
        flow += max_flow(g, source, dest);
        if(flow == n * i) {
            res = i;
        }
    }
    return res;
}

int main() {
    int n, m;
    while(cin >> n >> m, n) {
        vector<int> u(m), v(m);
        for(int i=0; i<m; ++i) {
            cin >> u[i] >> v[i];
            u[i]--;
            v[i]--;
        }
        int ma = calc_max(n, u, v);
        int mi = calc_min(n, u, v);
        cout << mi << ' ' << ma << endl;
    }
}


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

using namespace std;

int main(void){
    int H,W,K,cnt=0;
    cin >> H >> W >> K;
    
    vector<vector<char> > c(H,vector<char>(W));

    for(int i=0;i < H;i++){
        for(int j=0;j < W;j++) cin >> c.at(i).at(j);
    }

    int h_all = 1 << H;
    int w_all = 1 << W;

    for(int h_mask=0;h_mask < h_all;h_mask++){
        for(int w_mask=0;w_mask < w_all;w_mask++){
            int bcnt = 0;
            for(int i=0;i < H;i++){
                for(int j=0;j < W;j++){
                    if((h_mask >> i)&1 && (w_mask >> j)&1 && c.at(i).at(j)=='#'){
                        bcnt++;
                    }
                }
            }
            if(bcnt == K) cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3624
n,t[999],a;
int main(i){for(;n*=scanf("%d",&n);puts("")){
    for(i=999;t[i]=i--;);
    for(;n--;t[a]=*t)scanf(" %c %c",&a,t);
    for(scanf("%d",&n);n--;putchar(t[a]))scanf(" %c",&a);
  }
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef vector<int> vi;
const int inf = 1e9+7;
const int INF = 1e18+7;
//26

class Dijkstra{
public:
	vector<vector<P> > G;
	vector<int> d;
	
	void init(int n){
		d.resize(n);
		G.resize(n);
	}
	void add_edge(int s, int t, int cost){
		G[s].push_back(P(t, cost));
	}
	
	void dijkstra(int s){
		priority_queue<P, vector<P>, greater<P> > q;
		fill(d.begin(), d.end(), INF);
		d[s] = 0;
		q.push(P(0, s));
		
		while(!q.empty()){
			P p = q.top();q.pop();
			int v = p.second;
			if(d[p.second] < p.first)continue;
			
			for(int i = 0;i < G[v].size();i++){
				int to = G[v][i].first;
				int cost = G[v][i].second;
				
				if(d[to] > d[v]+cost){
					d[to] = d[v]+cost;
					q.push(P(d[to], to));
				}
			}
		}
	}
};

Dijkstra dij[2];
struct edge{int u, v, a, b;};
edge q[200000];
int dis[2][200000], dp[200000];
signed main(){
	int n, m, s, t;
	scanf("%lld%lld%lld%lld", &n, &m, &s, &t);
	rep(i,m){
		int x[4] = {};
		rep(j,4)scanf("%lld", &x[j]);
		q[i] = (edge){x[0], x[1], x[2], x[3]};
	}
	
	dij[0].init(n+1);
	rep(i,m){
		dij[0].add_edge(q[i].u, q[i].v, q[i].a);
		dij[0].add_edge(q[i].v, q[i].u, q[i].a);
	}
	dij[0].dijkstra(s);
	rrep(i,n){
		dis[0][i] = dij[0].d[i];
	}
	
	dij[1].init(n+1);
	rep(i,m){
		dij[1].add_edge(q[i].u, q[i].v, q[i].b);
		dij[1].add_edge(q[i].v, q[i].u, q[i].b);
	}
	dij[1].dijkstra(t);
	rrep(i,n){
		dis[1][i] = dij[1].d[i];
	}
	
	int dd = INF;
	drep(i,n,0){
		dd = min(dd, dis[0][i]+dis[1][i]);
		dp[i] = dd;
	}
	
	int ans = 1e15;
	rrep(i,n)printf("%lld\n", ans-dp[i]);
	return 0;
}






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

#define pb push_back
#define mp make_pair

ll x;

void solve()
{
	double cur=100;
	int ans=0;
	while(true){
		ans++;
		cur=(ll)(cur*1.01);
		if(cur >= x){
			cout << ans << '\n';
			return;
		}
	}
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> x;
	solve();
	return 0;
}

Measured memory_bytes: 3652
/*****/

#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

//#define int long long

using namespace std;
using ll = long long;
using ld = long double;
using vecll = vector<ll>;

#define nextline() (std::cerr << "\n")
#define debug(x) (#x " : " + (x))
#define debug_cout(x) (std::cerr << #x << " : " <<  (x) << "\n")
#define debug_tabcout(n, x) (std::cerr << strMulti("\t",n) << #x << " : " <<  (x) << "\n")
#define debug_headcout(h, x) (std::cerr << h << " : " <<  (x) << "\n")
#define debug_tabheadcout(n, h, x) (std::cerr << strMulti("\t",n) << h << " : " <<  (x) << "\n")

#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 rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b);
constexpr int INF = 2000000100;
constexpr ll DIV = 1000000007;	// 10e9+7
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> T divup(T a, T b) { if (a % b == 0) { return a / b; } return a / b + 1; }
#define diup(a, b) (a % b == 0 ? a / b : a / b + 1)
#define exist_in(list, value) (list.end() != std::find(all(list),value))
std::string strMulti(std::string t, int n) { std::string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }
//template<class T> T math_P(T m, T n) { T ret = 1; for (T i = m; i > m - n; i--) { ret *= i; } return ret; }
//template<class T> T math_C(T m, T n) { T ret = mathP(m, n); for (T i = 2; i <= n; i++) { ret /= i; } return ret; }
//template<class T> bool compare_by_b(pair<T, T> a, pair<T, T> b) { if (a.second != b.second) { return a.second < b.second; } return a.first < b.first; }
//template<class T> T math_gcd(T a, T b) { a = abs(a); b = abs(b); if (a < b) { std::swap(a, b); } T tmp; while (b != 0) { tmp = b; b = a % b; a = tmp; } return a; }
//template<class T> T math_lcm(T a, T b) { a = abs(a); b = abs(b); if (a > b) { std::swap(a, b); } if (a == 1) { return b; } T i = a; while (i % b != 0) { i += a; } return i; }
//template<class T1, class T2> bool exist_in(const T1& list, const T2& v) { return (list.end() != std::find(list.begin(), list.end(), v)); }
//template<class T> bool exist_in(const T& c, const typename T::value_type& v) {	return (c.end() != std::find(c.begin(), c.end(), v));}

/*****/

void Main()
{
	int r, g;
	cin >> r >> g;
	cout << 2 * g - r;
}

/*****/

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

	std::cout << std::fixed << std::setprecision(10);


	/*
	while (true)
	{
		Main();
		cout << endl;
	}
	//*/


	Main();

	return 0;
}


Measured memory_bytes: 256
n=gets.to_i
a=gets.split.map(&:to_i)
a = a*2
r=a[1...n].inject(a[0]){|s,i|s=-s+i}
rr=[r]
(n-1).times {|t|rr<<a[t]*2-rr[-1]}
puts rr.join(' ')


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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

// n回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii;  // 2次元配列
typedef vector<ll> vll;
typedef vector<double> vd;
typedef pair<int, int> PII;

template<typename T>
using vec = vector<T>;
template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

const ld Pi = std::acos(-1.0L);
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;

/*最長増加or減少部分列----------*/
/*第一引数 : 対象となるvector
  第二引数 : true:狭義 false:広義  デフォルト:false
  第三引数 : true:増加 false:減少  デフォルト:true
*/
template<class T>
std::vector<T> lis(const std::vector<T> &a, bool strict=0, bool UporNot=1) {
    std::vector<T> lis;
    if(UporNot) {
        for(auto &p : a) {
            typename std::vector<T>::iterator iter;
            if(strict) iter = std::lower_bound(lis.begin(), lis.end(), p);
            else iter = std::upper_bound(lis.begin(), lis.end(), p);
            if(lis.end()==iter) lis.emplace_back(p);
            else *iter = p;
        }
    }else {
        vector<T> rev = a;
        reverse(rev.begin(), rev.end());
        for(auto &p : rev) {
            typename std::vector<T>::iterator iter;
            if(strict) iter = std::lower_bound(lis.begin(), lis.end(), p);
            else iter = std::upper_bound(lis.begin(), lis.end(), p);
            if(lis.end()==iter) lis.emplace_back(p);
            else *iter = p;
        }
    }
    return lis;
}

/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    int _StartTime_ = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    // cout << fixed << setprecision(15);

    int n; cin >> n;
    vi a(n); rep(i,n) cin >> a[i];

    vi ans = lis(a, 1);

    cout << ans.size() << '\n';

    // printf("ExecutionTime: %d /ms\n",1000*(int)((clock()-_StartTime_)/CLOCKS_PER_SEC));
}


Measured memory_bytes: 3800
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=2e5+9;
const int mod=998244353;

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,k;
    string s;
    cin>>k;
    cin>>s;
    n=s.size();
    if(n<=k)return cout<<s,0;
    for(int i=0;i<k;i++){
    	cout<<s[i];
    }
    cout<<"...";


    

}



Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define LL long long
#define M 1000000007
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

int main()
{
	fastio;
	int n, ans=0;
	cin>>n;
	int a[n];
	for(int i=0; i<n; i++)
		cin>>a[i];
	for(int i=0;i<n; i++){
		for(int j=i+1; j<n; j++){
			ans+=a[i]*a[j];
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

int main() {
    int a,b,c,k;
    cin >> a >> b >> c >> k;
    int ans = min(a,k);
    k -= min(a,k);
    k -= min(b,k);
    ans -= k;
    cout << ans << endl;
}

Measured memory_bytes: 3188