akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init)                                          \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T> using VEC = std::vector<T>;
template <class T> using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail> void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec)
    os << v << ",";
  os << "}";
  return os;
}
template <typename T> ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
  int A,P;
  cin>>A>>P;
  P+=A*3;
  cout<<P/2<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n,a,b,x[10000000],ans;
int main()
{
	cin>>n>>a>>b;
	for(int i=1;i<=n;i++)
	{
		cin>>x[i];
	}
	for(int i=2;i<=n;i++)
	{
		ans+=min(a*(x[i]-x[i-1]),b);
	}
	cout<<ans;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <list>
#include <stack>
#include <queue>
#include <utility>

using namespace std;


#define ll long long
#define MOD 1000000007
#define rep(i, n) for(int i = 0;i < n;i++)

int main()
{
    int n;
    cin >> n;
    ll* h;
    h = new ll[n];
    rep(i,n)
    {
        cin>>h[i];
    }
    int* j;
    j = new int[n];

    

    for (int i = 0; i < n-1; i++)
    {
        if (h[i]>=h[i+1])
        {
            j[i] = 1;
        }else{
            j[i] = 0;
        }
        
    }

    int counter = 0;
    int ans = 0;
    

    for (int i = 0; i < n-1; i++)
    {
        if (j[i] == 1)
        {
            counter++;
        }else
        {
            if (ans<counter)
            {
                ans = counter;
                counter = 0;
            }else
            {
                counter = 0;
            }
        }
       //cout << counter << endl;
    }

    if (ans<counter)
    {
        cout << counter << endl;
    }else
    {
        cout << ans << endl;
    }
    
    
}

Measured memory_bytes: 1408
package main

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

var scanner *bufio.Scanner

func printIt() {
	var building [4][3][10]int
	n := nextInt()
	for i := 0; i < n; i++ {
		a := nextInt() - 1
		b := nextInt() - 1
		c := nextInt() - 1
		d := nextInt()
		building[a][b][c] += d
	}

	for i := 0; i < 4; i++ {
		for f := 0; f < 3; f++ {
			for r := 0; r < 10; r++ {
				fmt.Print(" ")
				fmt.Print(building[i][f][r])
			}
			fmt.Println()
		}
		if i != 3 {
			fmt.Println("####################")
		}
	}
}

func nextInt() int {
	scanner.Scan()
	num, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(1)
	}
	return num
}

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	printIt()
}



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

void swap(int *,int,int);
int partition(int **,int,int);
void quicksort(int **,int,int);

int main(){
  int i,n;
  int f=0,**c;
  
  scanf("%d",&n);
  
  c = malloc(sizeof(int *)*3);
  
  for(i=0;i<3;i++)c[i] = malloc(sizeof(int)*n);

  for(i=0;i<n;i++){
    getchar();
    c[0][i] = getchar();
    getchar();
    scanf("%d",&c[1][i]);
    c[2][i]=i;
  }
    
  quicksort(c,0,n-1);

  for(i=1;i<n;i++){
    if(c[1][i-1]==c[1][i]){
      if(c[2][i-1] > c[2][i])f=1;
    }
  }
  if(f == 1)printf("Not stable\n");
  else printf("Stable\n");
  for(i=0;i<n;i++){
    
    printf("%c %d\n",c[0][i],c[1][i]);
  }

  free(c[0]);
  free(c[1]);
  free(c[2]);
  free(c);
  return 0;
}

void  quicksort(int **c,int p,int r){
  int q,i;
  if(p < r){
    q = partition( c, p, r);
    quicksort( c, p, q-1);
    quicksort( c, q+1, r);
  }
}
int partition(int **c,int p,int r){
  int i,j,t;

  t=c[1][r];
  i=p-1;
  for(j=p;j<=r-1;j++){
    if(t>=c[1][j]){
      i++;
      swap(c[0],i,j);
      swap(c[1],i,j);
      swap(c[2],i,j);      
    }
  }
  swap(c[0],i+1,r);
  swap(c[1],i+1,r);
  swap(c[2],i+1,r);    
  return i+1;
}

void swap(int *c,int i,int j){
  int t;
  t = c[i];
  c[i] = c[j];
  c[j] = t;
}



Measured memory_bytes: 2520
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(int i=1,i##_len=(n); i<=i##_len; ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define srep(i,s,t) for(int i=(s);i<(t);++i)
#define rng(obj) (obj).begin(), (obj).end()
#define maxs(x,y) (x=max((x),(y)))
#define mins(x,y) (x=min((x),(y)))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x=max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T>>
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vp = vector<P>;
template <class T> inline istream& operator>>(istream&i,v(T)&v)
{ rep(j,sz(v))i>>v[j];return i;}
template <class T> string join(const v(T)&v)
{ stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template <class T> inline ostream& operator<<(ostream&o,const v(T)&v)
{ if(sz(v))o<<join(v); return o;}
template <class T1,class T2> inline istream& operator>>(istream&i ,pair<T1,T2>&v)
{ return i>>v.fi>>v.se;}
template <class T1,class T2> inline ostream& operator<<(ostream&o ,pair<T1,T2>&v)
{ return o<<v.fi<<","<<v.se;}
template <class T> inline ll suma(const v(T)& a) 
{ ll res(0); for(auto&& x:a) res += x; return res;}
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const double eps = 1e-10;
#define dame {puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;
#define fileio ifstream fio; if(argc>=2){fio.open(argv[1]); std::cin.rdbuf(fio.rdbuf());}
#define fastio ios_base::sync_with_stdio(false);
#define MOD 1000000007
//----------------------------------------------------------------
template <class T>
map< T, int > prime_factor(T n) {
    map< T, int > ret;
    for(T i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if(n != 1) ret[n] = 1;
    return ret;
}

void Main(){
  int n;
  cin>>n;
  vi s(n);
  cin>>s;
  int ans = 0;
  vi a;
  rep(i,n){
    if(s[i]%10==0) ans+=s[i];
    else a.pb(s[i]);
  }
  if(a.size()==0){
    cout<<0<<endl;
  }else{
    sort(rng(a));
    int sum = accumulate(rng(a),0); 
    if(sum%10==0){
      cout<<sum-a[0]+ans<<endl;
    }else{
      cout<<sum+ans<<endl;
    }
  }
  
  

} int main(int argc,char* argv[]){ 
    fastio; fileio; Main();}

Measured memory_bytes: 256
w = list(map(str,input()))

w_ord = []

for i in range(len(w)):
    w_ord.append(ord(w[i]))

w_ord.sort()

j = 1

if len(w) % 2 == 1:
    print("No")
else:
    for i in range((len(w)+1)//2):
        if not w_ord[2*i] == w_ord[2*i + 1]:
            print("No")
            break
        else:
            if i == (len(w)+1)//2 -1:
                print("Yes")


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define vvll vector<vll>
#define all(v) v.begin(),v.end()
#define itr(r,v) for(auto r=v.begin();r!=v.end();r++)
#define FOR(i,n) for(ll i=0;i<n;i++)
#define ffor(i,a,b) for(ll i=a;i<=b;i++)
#define rfor(i,a,b) for(ll i=a;i>=b;i--)
#define space cout<<"\n\n";
#define endl "\n"
#define pqmx priority_queue<ll>
#define pqmn priority_queue<ll,vll,greater<ll>>
#define fps(x,y) fixed<<setprecision(y)<<x
#define merg(a,b,c) set_union(a.begin(),a.end(),b.begin(),b.end(),inserter(c,c.begin()))
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define ctime auto start = high_resolution_clock::now()
#define etime auto stop = high_resolution_clock::now()
#define ptime auto z1z = duration_cast<microseconds>(stop-start); cout<<"Time elapsed : "<<z1z.count()<<" microseconds\n"
#define dbg1(x)             cout <<#x<<": "<<x<<'\n';
#define dbg2(x, y)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<'\n';
#define dbg3(x, y, z)       cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<'\n';
#define dbg4(a, b, c, d)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<'\n';
#define dbg5(a, b, c, d, e) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<'\n';

using namespace std;
using namespace std::chrono;

const ll MOD = 1e9 + 7;
const ll N = 1e6 + 6;
const ll maxN = 1e7 + 7;
const ll MAX_SIZE = 2e5 + 5;

ll powerM(ll x, ll y, ll M = MOD) // default argument
{ll v = 1; x = x % M; while (y > 0) {if (y & 1)v = (v * x) % M; y = y >> 1; x = (x * x) % M;} return v;}

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

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input2.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
	FIO
	ll x; cin>>x;
	if(x>=30) cout<<"Yes";
	else cout<<"No";
	return 0;
}


Measured memory_bytes: 3516
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MAX_N = 2e5 + 5;

int N, K, A[MAX_N];
LL sum[MAX_N] = {0};
int F[MAX_N] = {0};  // F(i) = prefix_sum(i)-i
map<int, int> rec;  // map[F[i]] = number of F[i] within interval [j-K+1, j] in current situation
LL ans[MAX_N] = {0}, cnt = 0;

int main() {
    scanf("%d %d", &N, &K);
    for (int i = 1; i <= N; i++) {
        scanf("%d", &A[i]);
//        if (A[i] == 1) cnt++;
        sum[i] = (sum[i-1]+A[i])%K;
        F[i] = (sum[i]-i)%K;
        while (F[i] < 0) F[i] += K;
//        printf("#%lld %d\n", sum[i], F[i]);
    }
    int j = 0;
    rec[0] = 1;
    while (j < N) {
        j++;
        if (j-K >= 0) rec[F[j-K]]--;
        ans[j] = (rec.count(F[j]) ? rec[F[j]] : 0);
        if (!rec.count(F[j])) rec[F[j]] = 1;
        else rec[F[j]]++;
//        printf("%d  %d %d  %lld\n", j, F[j], rec[F[j]], ans[j]);
    }
    for (int i = 1; i <= N; i++) cnt += ans[i];
    printf("%lld\n", cnt);
    return 0;
}


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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pll> pip;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-9;

int main() {
	string s; cin >> s;
	
	int n = s.size();
	
	int ans = 0;
	for (int i = 2; i < n; i += 2) {
		string str = s.substr(0, (n - i) / 2);
		string str2 = s.substr((n - i) / 2, (n - i) / 2);
		
		if (str == str2) chmax(ans, n - i);
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!

// OT.find_by_order(k-1)
// 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(998244353)
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long

//////////////////////
const int N = 2005;


int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(0); 
    cout.tie(0);

    int H, W, h, w;
    cin >> H >> W >> h >> w;

    cout << H*W - h*W - w*H + h*w << '\n';
}

Measured memory_bytes: 256
D, N = map(int,input().split())
if D == 2:
  if N < 100:
    print(N*10000)
  else:
    print(1010000)
elif D == 1:
  if N < 100:
    print(N*100)
  else:
    print(10100)
else:
  if N < 100:
    print(N)
  else:
    print(101)

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a);i>(b);--i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1000000000;
const LL MOD = 1000000007;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

int main() {
  string S;
  cin >> S;
  if(S == "Sunny") {
    cout << "Cloudy" << endl;
  }
  else if(S == "Cloudy") {
    cout << "Rainy" << endl;
  }
  else {
    cout << "Sunny" << endl;
  }
  return 0;
}

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

int f(int a, char c, int b) {
  if (c == '+') return a + b;
  if (c == '-') return a - b;
  if (c == '*') return a * b;
}

bool ans(string s, vector<int> a) {
  if (f(f(f(a[0], s[0], a[1]), s[1], a[2]), s[2], a[3]) == 10) {
    printf("(((%d %c %d) %c %d) %c %d)\n", a[0], s[0], a[1], s[1], a[2], s[2], a[3]);
    return true;
  }
  if (f(f(a[0], s[0], f(a[1], s[1], a[2])), s[2], a[3]) == 10) {
    printf("((%d %c (%d %c %d)) %c %d)\n", a[0], s[0], a[1], s[1], a[2], s[2], a[3]);
    return true;
  }
  if (f(f(a[0], s[0], a[1]), s[1], f(a[2], s[2], a[3])) == 10) {
    printf("((%d %c %d) %c (%d %c %d))\n", a[0], s[0], a[1], s[1], a[2], s[2], a[3]);
    return true;
  }
  if (f(a[0], s[0], f(f(a[1], s[1], a[2]), s[2], a[3])) == 10) {
    printf("(%d %c ((%d %c %d) %c %d))\n", a[0], s[0], a[1], s[1], a[2], s[2], a[3]);
    return true;
  }
  if (f(a[0], s[0], f(a[1], s[1], f(a[2], s[2], a[3]))) == 10) {
    printf("(%d %c (%d %c (%d %c %d)))\n", a[0], s[0], a[1], s[1], a[2], s[2], a[3]);
    return true;
  }

  return false;
}

bool symbol(vector<int> &a, string s = "") {
  if (s.size() == 3) {
    return ans(s, a);
  }
  vector<string> sym({"+", "-", "*"});
  for (int i = 0; i < 3; ++i) {
    if (symbol(a, s + sym[i])) return true;
  }

  return false;
}

void solver(vector<int> a) {
  int cnt = 0;
  do {
    if (symbol(a)) return;
    cnt++;
    next_permutation(a.begin(), a.end());
  } while ( cnt < 100 );
  puts("0");
}

int main() {
  vector<int> a(4);
  while (cin >> a[0] >> a[1] >> a[2] >> a[3], a[0] + a[1] + a[2] + a[3]) {
    solver(a);
  }
}

Measured memory_bytes: 3264
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    
    sort(a.begin(), a.end());
    auto iter0 = lower_bound(a.begin(), a.end(), (a.back() + 1) / 2);
    if (iter0 == a.begin()) {
        cout << a.back() << " " << a[0] << endl;
    } else {
        auto iter1 = iter0 - 1;
        int d0 = *iter0 * 2 - a.back();
        int d1 = a.back() - *iter1 * 2;
        if (d0 < d1) {
            cout << a.back() << " " << *iter0 << endl;
        } else {
            cout << a.back() << " " << *iter1 << endl;
        }
    }
    return 0;
}


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

int main(){
    string s, t;
    cin >> s >> t;
    long long count = 0;
    for(long long i = 0; i < s.size(); i++){
        if(s[i] != t[i]){
            count++;
        }
    }

    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3912
// Problem : A - Five Variables
// Contest : AtCoder - AtCoder Beginner Contest 170
// URL : https://atcoder.jp/contests/abc170/tasks/abc170_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#define eb emplace_back
#define pb push_back
#define size(s) (int)s.size()
#define int long long
#define vi vector<int>
#define vs vector<string>
#define vv vector<vector<int>>
#define pii pair<int,int>
#define m_p(x,y) make_pair(x,y)
#define vp vector<pair<int,int>>
#define setbits(x) __builtin_popcountll(x)
#define f first
#define se second
#define inc(v,n,x) v.assign(n,x)
#define incd(v,n) v.resize(n)
#define iniz(n) memset(n,0,sizeof(n))
#define inin(n) memset(n,-1,sizeof(n))
#define inimi(n) memset(n,0xc0,sizeof(n))
#define inima(n) memset(n,0x3f,sizeof(n))
#define all(v) (v).begin(),(v).end()

using namespace std;

template<typename T1,typename T2>istream &operator>>(istream &is, vector<pair<T1,T2>> &v) { for (pair<T1,T2> &t : v) is >> t.f>>t.se; return is; }
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }

double pi=acos(-1.0);
const int md=1e9+7;
const int INF=1e15;
int dx1[]={0,0,-1,1};
int dy1[]={1,-1,0,0};

template<class T>
T abst(T a)
{return a<0?-a:a;}

template<class T>
T max2(T a,T b){return a>b?a:b;}
template<class T>
T min2(T a,T b){return a<b?a:b;}

void solve()
{
	for(int i=1;i<=5;i++)
	{
		int x;cin>>x;
		if(!x)
		{
			cout<<i;
			return;
		}
	}
}

int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int t=1;
//cin>>t;
for(int i=1;i<=t;i++)
{
    solve();
}
return 0;
}


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

#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define all(v) v.begin(),v.end()

int main()
{
	FIO
	int a, b, c;
	cin >> a >> b >> c;
	if(a + b + c >= 22) {
		cout << "bust\n";
	} else {
		cout << "win\n";
	}
	return 0;
}

Measured memory_bytes: 256
<?php


[$N, $M] = fscanf(STDIN, "%d%d");
$map = [];
while($M--){
    [$l, $r, $d] = fscanf(STDIN, "%d%d%d");
    $map[$l][$r] = $d;
    $map[$r][$l] = $d * -1;
}
$list = [];
$a = 0;
foreach($map as $key=>$value){
    if($a ===0){
        $list[$key] = 0;
        $a = 1;
        bfs($key);
    }
    if(!isset($list[$key])){
        bfs($key);
    }
}
echo "Yes";
function bfs($from){
    global $list, $map;
    foreach($map[$from] as $key => $value){
        if(isset($list[$key])){
            if( $list[$key] -  $list[$from] !== $value){
                echo "No";
                exit;
            }
        }else{
            $list[$key] = $list[$from] + $value;
            bfs($key);
        }
    }
}


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

using namespace std;

vector<int> a[333];
int main() {
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		a[i].resize(m);
		for (int j = 0; j < m; j++)
			scanf("%d", &a[i][j]);
	}
	int p = 998244353;
	int r = [](vector<int> *m, int R, int C) {
		int i = 0;
		for (int j = 0; j < C; j++) {
			int k;
			for (k = i; k < R; k++)
				if (m[k][j]) goto p;
			continue;
		p:
			swap(m[k], m[i]);
			for (k = 0; k < R; k++)
				if (k != i && m[k][j])
					for (int l = j; l < C; l++)
						m[k][l] ^= m[i][l];
			i++;
		}
		return i;
	}(a, n, m);
	int x = 0;
	for (int i = 0; i < 2; i++) {
		int y = 1;
		for (int j = 0; j < n + m - 1 - i * r; j++)
			(y += y) %= p;
		(x += i ? p - y : y) %= p;
	}
	cout << x << endl;
	return 0;
}


Measured memory_bytes: 640
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
//#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define reps(i, j, k) for(auto i = j; i < k; ++i)
#define rep(i, j) reps(i, 0, j)
#define decs(i, j, k) for(auto i = j; i >= k; --i)
#define dec(i, j) decs(i, j, 0)
#define iter(i, j) for(auto i = j.begin(); i != j.end(); ++i)
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int, int>
#define vpi vector<pi>
#define vb vector<bool>
#define F first
#define S second
#define mp make_pair
#define um unordered_map
#define all(x) (x).begin(), (x).end()  
#define fast_io ios::sync_with_stdio(0); cin.tie(0);
#define file_io freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define IMAX std::numeric_limits<int>::max()
#define IMIN std::numeric_limits<int>::min()
using namespace std;

int main()
{ 
    ll n; cin >> n;
    ll d, a; cin >> d >> a;
    vector<pair<ll, ll> > p(n);
    rep(i, n) cin >> p[i].F >> p[i].S;
    sort(all(p));
    ll k = 2 * d + 1;
    ll b, j;
    vll add(n, 0);
    ll acc = 0, bombs = 0, curr_bombs = 0;
    rep(i, n)
    {
        acc += add[i];
        if(p[i].S > acc)
        {
            p[i].S -= acc;
            curr_bombs = ceil(p[i].S / ld(a));
            bombs += curr_bombs;
            acc += curr_bombs * a;

            j = n;
            for(b = n; b > 0; b /= 2)
            	while(j - b > i && p[j - b].F >= p[i].F + k)
            		j -= b;
            if(j < n)
           		add[j] += -curr_bombs * a;	
        }
    }
    cout << bombs;
    return 0;
}

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

int main() {
  int64_t N,K;
  cin>>N>>K;
  vector<vector<int>> p(N,vector<int>(61));
  for(int i=0;i<N;i++){
    int a;
    cin>>a;
    a--;
    p.at(i).at(0)=a;
  }
  for(int j=1;j<61;j++){
    for(int i=0;i<N;i++){
      p.at(i).at(j)=p.at(p.at(i).at(j-1)).at(j-1);
    }
  }
  int64_t a=1,Z=0,b=0;
  while(K!=0){
    if(K%(a*2)!=0){
      K-=a;
      Z=p.at(Z).at(b);
    }
    a*=2;
    b++;
  }
  cout<<Z+1<<endl;
}

Measured memory_bytes: 57904
#include<iostream>
#include<math.h>
#include<string>
#include<map>
#include<vector>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<bitset>
#include<stack>
#include<algorithm>
#include<climits>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long int
#define vll vector<ll>
#define mii map<ll, ll>
#define debug(x) cerr << #x << " is " << x << "\n";
#define debug1(x, y) cerr << #x << " is " << x << "\n" << #y << " is " << y << "\n";
#define w(x) ll x; cin >> x; while(x--)
#define endl "\n"
#define f first 
#define s second 
#define fo(n) for(ll i = 0LL; i < n; ++i) 
#define setbits(n) __builtin_popcount(n)
#define all(x) x.begin(), x.end()
#define sortAll(x) sort(x.begin(), x.end())
#define pb push_back
#define mk make_pair
#define PERMUTE next_permutation
#define RESET(a, b) memset(a, b, sizeof(a))
#define MOD 1000000007
using namespace std;
 
int main(){
    fast
    string a, b;
    cin >> a >> b;
    fo(a.size()) {
        if(a[i] != b[i]) {
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
    return 0;
}

Measured memory_bytes: 3640
#include <iostream>
int A, B, C, D;
using namespace std;

int main(){
    cin >> A >> B >> C >> D;
    if(A + B > C + D){
        cout << "Left" << endl;
    }else if(A + B == C + D){
        cout << "Balanced" << endl;
    }else{
        cout << "Right" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<int,P> PP;

vector<PP> v;
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

int main()
{
	double w,h,x,y;
	cin >> w >> h >> x >> y;
	cout << w*h/2 << ((w/2 == x && h/2 == y)?" 1":" 0") << endl;
	return 0;
}


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

int main(){
    char s;
    cin >> s;
    char ans;
    if(s == 'A') ans = 'T';
    else if(s == 'T') ans = 'A';
    else if(s == 'C') ans = 'G';
    else if(s == 'G') ans = 'C';
    cout << ans << endl;
    return 0;
}

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

using namespace std;
using ll = long long;

//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const int INF = 1e9;

int main(void){

	string S; cin >> S;
	deque<char> deq;
	REP(i,S.length()){
		deq.push_back(S[i]);
	}
	int Q; cin >> Q;

	int cnt = 0;
	REP(i,Q){
		int T; cin >> T;

		if(T == 1){
			cnt++;
		}else{
			int F;
			char C;
			cin >> F >> C;
			F += cnt % 2;
			F %= 2;
			if(F == 1) deq.push_front(C);
			else deq.push_back(C);
		}
	}

	int N = deq.size();
	REP(i,N){
		if(cnt%2 == 1) cout << deq.at(N-i-1);
		else cout << deq.at(i);
	}
	cout << endl;

	return 0;

}


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

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif

#define REP(i,n) for(ll (i) = (0); (i) < (n); ++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) v.begin(),v.end()
#define INF 1100000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

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


int main()
{
  int N;
  cin >> N;
  string ans = "";

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

  while(N) {
    if(abs(N) % 2) { ans = '1' + ans; N--; }
    else ans = '0' + ans;
    N /= -2;
  }
  cout << ans << endl;

	return 0;
}


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

#define pb push_back
#define fi first
#define se second
typedef long long ll;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n;
	cin >> n;
	bool ok = true;
	for (int i = 0; i < n; ++i) {
		int a;
		cin >> a;
		if (a % 2 == 0 && a % 3 && a % 5)
			ok = false;
	}
	cout << (ok ? "APPROVED\n" : "DENIED\n");
}


Measured memory_bytes: 256
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/


int main() {

ll A,B,N;
cin>>A>>B>>N;
cout<<A*min(N,B-1)/B<<endl;




return 0;
}

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

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

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#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,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;
int sfx = 'a' - 1;

int N;
VS vs;
int dp[64][64][32][32];
LL solve(int b, int e, int p, int lb){
  int& ret = dp[b][e][p][lb];
  if(~ret) return ret;
  if(b >= e) return ret = 1;
  
  if(lb == 27) return ret = 0;
  if(p == 20) return ret = (e-b == 1);

  ret = 0;
  LL res = solve(b,e,p,lb+1);
  for(int i=b;i<e;++i){
	if(vs[i][p] != '?'){
	  int c = vs[i][p] - sfx;
	  if(c != lb) break;
	}
	else if(lb == 0) break;
	(res += solve(b, i+1, p+1, 0) * solve(i+1, e, p, lb+1) % MOD) %= MOD;
  }
  return ret = res;
}

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

  cin >> N;
  vs.resize(N);
  REP(i,N){
	cin >> vs[i];
	vs[i] += string(20-SZ(vs[i]), sfx);
  }

  fill((int*)dp, (int*)dp+64*64*32*32, -1);
  cout << solve(0, N, 0, 0) << endl;

  return 0;
}

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

int main() {
  int n;
  cin>>n;
  vector<double> a(n);
  for(int i=0;i<n;i++){
    cin>>a.at(i);
  }
  sort(a.begin(),a.end());
  double count=0;
  
  for(int i=1;i<n;i++){
    if(i==1){
      count+=(a.at(0)+a.at(1))/pow(2,n-1 );
    }
    if(i>1){
      count+=a.at(i)/pow(2,n-i);
    }
  }
  cout<<count;
}

Measured memory_bytes: 512
/*
   Push yourself, because no one else is going to do it for you.
*/
#include <bits/stdc++.h>
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define set_zero(a) memset(a,0,sizeof(a));
#define ll long long int
#define PI 2 * acos(0.0)
#define MAX 1000000000000000000
#define in(a) scanf("%d",&a);
#define out(a) printf("%d",a);
#define INF 1000000 
#define M 1000000007
#define pi 3.14159265 
using namespace std; 
int main(){ 
   fast_io
   ll n;
   cin>>n;
   ll a[n];
   for(ll i = 0;i<n;i++) cin>>a[i];
   sort(a,a+n);
   long double ans = (long double) a[0];
   for(ll i = 1;i<n;i++){
      long double y = (long double)(a[i]);
      ans = (ans+y)/2.0;
   }
   cout<<fixed<<setprecision(15)<<ans<<endl;
   return 0;
} 

Measured memory_bytes: 3808
#include <iostream>
#include <stack>
#include <string>
#include <sstream>

inline int toInt(std::string s) {
    int v;
    std::istringstream sin(s);
    sin >> v;
    return v;
}
 
int main () {
  std::string s;
  std::stack<int> st;
  while (std::cin >> s) {
        if (s[0]>='0' and s[0]<='9') {
            st.push(toInt(s));
        }
        else {
            int a = st.top();
            st.pop();
            int b = st.top();
            st.pop();
            switch(s[0]) {
            case '+':
                st.push(a + b);
                break;
            case '-':
                st.push(b - a);
                break;
            case '*':
                st.push(a * b);
                break;
            }
        }
    }
  std::cout<<st.top()<<'\n';
    return 0;
}


Measured memory_bytes: 3152
#include <bits/stdc++.h>
using namespace std;
int main(){
  int id,x,i=1,out=1,ma=1;
  cin>>x;
  while(i*i<=x){
    out=i*i;
    id=out;
    ma=max(out,ma);
    while(id*i<=x&&i!=1){
      id*=i;
      ma=max(id,ma);
    }
    i++;
  }
  cout<<ma<<endl;
  return 0 ;
}


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

int index(const string &s) {
  int sum = 0;
  rep(i, s.size()) {
    if (s[i] == 'D')
      sum++;
    if (s[i] == 'P' && i < s.size() - 1 && s[i + 1] == 'D')
      sum++;
  }
  return sum;
}

int max_pd = INT_MIN;
string ans = "aho";
void dfs(string &s, int p) {
  if (p == s.size()) {
    int id = index(s);
    if (id > max_pd) {
      ans = string(s);
      max_pd = id;
    }
    return;
  }
  if (s[p] == '?') {
    s[p] = 'P';
    dfs(s, p + 1);
    s[p] = 'D';
    dfs(s, p + 1);
    s[p] = '?';
  } else {
    while (++p < s.size() && s[p] != '?')
      ;
    if (p == s.size()) {
      int id = index(s);
      if (id > max_pd) {
        ans = string(s);
        max_pd = id;
      }
      return;
    }
    dfs(s, p);
  }
}

int main() {
  string s;
  cin >> s;
  for(char &c:s){
    if (c == '?') c = 'D';
  }
  //Bdfs(s, 0);
  cout << s << endl;
  return 0;
}


Measured memory_bytes: 3756
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
long long int memo[100003][2];
int main(){
    for(int i=0;i<100003;i++)memo[i][0]=-1;

    long long int N,X,M;
    cin>>N>>X>>M;
    long long int ans=X;
    memo[ans][0]=1;memo[ans][1]=ans;
    int flg=0;
    for(long long int i=2;i<=N;i++){
        X=(X*X)%M;
        ans+=X;
        //printf("[%lld]:[%lld][%lld]\n",i,X,ans);
        if(memo[X][0]==-1||flg){
            memo[X][0]=i;memo[X][1]=ans;
        }
        else{
            long long int nokorite=N-i;
            long long int syuki=i-memo[X][0];
            long long int kasan=ans-memo[X][1];
            long long int syu=nokorite/syuki;
            i+=syuki*syu;
            ans+=kasan*syu;
            flg=1;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 4692
s=input()
t=input()
lent = len(t)

ans = lent
cnt = 0

for i in range(len(s)-len(t)+1):
    s1 = s[i:i+lent+1]
    cnt1 = 0
    for j in range(lent):
        if s1[j] == t[j]:
            cnt1 += 1
    ans = min(ans,lent - cnt1)

print(ans)


Measured memory_bytes: 9116
t,_,s=open(0).read().partition('\n')
h,w=map(int,t.split())
d=[h%2&w%2,w%2*h//2+h%2*w//2,0,h//2*(w//2)]
for i in map(s.count,set(s)-{'\n'}):
  for j in(3,1,0):
    while d[j]and i>j:
      i-=j+1
      d[j]-=1
print('YNeos'[any(d)::2])

Measured memory_bytes: 3064
#include<stdio.h>
#include<math.h>

int main()
{
	int a, b;
	int i;
	while (1)
	{
		if (scanf("%d %d", &a, &b) == EOF)
			break;

		i = 0;
		while (pow(10,i)<=a+b)
		{
			i++;
		}
		printf("%d\n", i);
	}
	return 0;
}

Measured memory_bytes: 644
S = input()
N = ["dream", "dreamer", "erase", "eraser"]
bool = True

while bool:
  if len(S) == 0:
    break
 
  bool = False
  for n in N:
    
    if S.endswith(n):
      L = S.rsplit(n,1)
      S = L[0]
      bool = True
      break
  

if bool:
  print("YES")
else:
  print("NO")
 

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define Mod(n) n % 1000000007
const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};

int main()
{
    string s;
    bool is = true;
    set<char> t;
    cin >> s;
    for(int i = 0;i < s.size();i++)
    {
        auto l = t.insert(s[i]);
        if(!l.second)
            is  =false;
    }
    cout << (is ? "yes\n" : "no\n");
}

Measured memory_bytes: 256
x = int(input())
if 400 <= x <= 599:
    print(8)
elif 600 <= x <= 799:
    print(7)
elif 800 <= x <= 999:
    print(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
else:
    print(1)

Measured memory_bytes: 61820
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int N;
    cin >> N;
    vector<int> A(N),B(N);
    rep(i,N) cin >> A[i];
    rep(i,N) cin >> B[i];
    ll sumA = 0;
    ll sumB = 0;
    ll cntA=0,cntB=0;

    rep(i,N){
        if(A[i]-B[i]>0){
            // Bに1を足す必要がある回数
            cntB += A[i] - B[i];
        }else{
            // Aに2を足す必要がある回数
            cntA += (B[i] - A[i])/2.0;
        }
    }
    if(cntA>=cntB){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 384
import sys
import re
input = sys.stdin.readline

Sd = input().strip()
T = input().strip()

def same(s, t):
    s = re.sub('\?', '.', s)
    return re.match(s, t)

flag = False
for i in range(len(T), len(Sd) + 1):
    if same(Sd[len(Sd) - i:len(Sd) - i + len(T)], T):
        Sd = Sd[:len(Sd) - i] + T + Sd[len(Sd) - i + len(T):]
        flag = True
        break

if flag:
    Sd = re.sub('\?', 'a', Sd)
else:
    Sd = 'UNRESTORABLE'

print(Sd)

Measured memory_bytes: 3316
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#define ll long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const int INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const int MOD = 1000000007;
const int MAX = 510000;
const double pi = acos(-1);
const double eps = 1e-9;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    double a, b, x;
    cin >> a >> b >> x;
    double y = 2 * x / a / b;
    
    if(y>a){
        cout << 90-(atan((double)(a/(2*b-2*(x/a/a))))*180/pi) <<endl;

    }
    else{
        cout << 90 - (atan((double)(2 * x / (a*b*b) ))*180/pi) << endl;
    }
    return 0;
}

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

#define ll long long
#define pb push_back
#define st first
#define sc second
#define mp make_pair

using namespace std;

const int e = 1e6 + 69;


int main()
{
    for(int i=1; i<=5; i++){
        int x;
        cin >> x;
        if(x == 0){
            cout << i;
        }
    }

}



Measured memory_bytes: 3616
//agc028_a.cpp
//Sun Nov 25 18:39:08 2018

#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

long long gcd (long long a, long long b){ //最大公約数
	if (b == 0){
		return a;
	}
	return gcd(b, a%b);
}

long long lcm (long long a, long long b){ //最小公倍数
	long long temp = gcd(a,b);
	return (a/temp)*b;
}

int main(){
	ll n,m;
	cin >> n >> m;
	string s,t;
	cin >> s >> t;

	ll num = lcm(n,m);

	ll check = lcm(num/n,num/m);

	for (ll i=0;i<num;i=i+check){
		if (s[i/(num/n)]!=t[i/(num/m)]){
			cout << -1 << endl;
			return 0;
		}
	}

	cout << num << endl;
}

Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1LL << 60;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)


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

	int N;
	cin >> N;
	puts(N*N*N);

	return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES // for C++  
#include <cmath> 
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <array>
#include <iterator>
#include <utility>
#include <set>
#include <random>
#include <map>
#include <stack>
#include <queue>
#include <list>
#include <functional>
 
 
using namespace std;
 
int main() {
    string w;
    map<char, int> map;
    bool flag = true;
    cin >> w;
    for (size_t i = 0; i < w.length(); i++)
    {
        auto itr = map.find(w[i]);
        if (itr != map.end())
        {
            itr->second++;
        }
        else
        {
            map.insert(make_pair(w[i], 1));
        }
    }
 
    for (auto itr = map.begin(); itr != map.end(); itr++)
    {
        if (itr->second % 2 != 0)
        {
            flag = false;
        }
        
    }
    if (flag)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}  

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
 
int N,Q,A,m,i,j,f[2005]={1};
 
int main()
{
    scanf("%d",&N);
    for(i=0;i<N;i++)
    {
        scanf("%d",&A);
        for(j=2000;j>=0;j--)
            if(j+A<2001&&f[j])
                f[j+A]=1;
    }
    scanf("%d",&Q);
    for(i=0;i<Q;i++)
    {
        scanf("%d",&m);
        puts(f[m]?"yes":"no");
    }
    return 0;
}

Measured memory_bytes: 588
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int W= sc.nextInt();
        int[] w = new int[n];
        int[] v = new int[n];
        for(int i = 0;i < n;i++){
            v[i] = sc.nextInt();
            w[i] = sc.nextInt();
        }
        int[][] dp = new int[n+1][W+1];
        for(int i = 0;i <= W;i++){
            dp[0][i] = 0;
        }
        for(int i = 1;i <= n;i++){
            for(int j = 1;j <= W;j++){
                if(j - w[i-1] >= 0){
                    dp[i][j] = Math.max(dp[i-1][j-w[i-1]] + v[i-1],dp[i-1][j]);
                }
                else{
                    dp[i][j] = dp[i-1][j];
                }
            }
        }
        System.out.println(dp[n][W]);
    }
}



Measured memory_bytes: 31112