akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;//list用
using System.Text;//StringBuilder用
using System.Collections;
using System.Linq;
class Program
{
    static List<int> s = new List<int>();
    static decimal result;
static StringBuilder sb = new StringBuilder();
static int N,M,K;
    static void Main()
    {
Read3();
      N=s[3];
      s.RemoveAt(3);
      s.Sort((a,b)=>b-a);
      
      int tmp=0;
      for(int i=0;i*s[0]<=N;i++){
      tmp=i*s[0];
      for(int j=0;j*s[1]+tmp<=N;j++){
      tmp+=j*s[1];
        if((N-tmp)%s[2]==0){result++;}
        tmp-=j*s[1];
      }
      }
                    Console.WriteLine(result.ToString());

    }


    static void Read1()//1項
    {
        string tmp = Console.ReadLine();
        N = int.Parse(tmp);
    }
 
    static void Read2()//複数項（項目数Ｎ）
    {
        string[] tmp = Console.ReadLine().Split(' ');
        for (int i = 0; i < N; i++) { s.Add(int.Parse(tmp[i])); }
    }
    static void Read3()//1行複数項
   {
       string[] tmp = Console.ReadLine().Split(' ');
       for (int i = 0; i < tmp.Length; i++) { s.Add(int.Parse(tmp[i])); }
    }
    static void Read4()//NK１行
    {
        string[] tmp = Console.ReadLine().Split(' ');
       N = int.Parse(tmp[0]);
       K = int.Parse(tmp[1]);
    }
    static void Read5()//N行K項
    {

 
    }


}

Measured memory_bytes: 11220
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>

using namespace std;


/*--- Macro ---*/
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep1(i, n) for(int i=1; i<(int)n; i++)
#define mp make_pair
#define pb push_back


/*---  Type ---*/
typedef long long ll;


/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;

// 4-direction
int dy4[] = {0,  1, -1,  0};
int dx4[] = {1,  0,  0, -1};

// 8-direction
int dy8[] = {0,  1,  1,  1,  0, -1, -1, -1};
int dx8[] = {1,  1,  0, -1, -1, -1,  0,  1};

// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

int main() {
  int n;
  cin >> n;
  vector<int> c(1e5+1);
  fill(c.begin(), c.end(), 0);

  rep(i, n) {
    int a;
    cin >> a;
    c[a]++;
  }

  int cnt = 0; // 取り除きたいカード枚数
  rep(i, 1e5+1) {
    if(c[i] > 1) cnt += (c[i] - 1);
  }

  cout << n - 2*((cnt+1)/2) << endl;

  return 0;
}

Measured memory_bytes: 640
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

/* Macros reg. ends here */

const ll INF = 1LL << 50;
static const long long mod = 1000000007;

int main() {
  cout << fixed << setprecision(15);

  ll n, m, k;
  cin >> n >> m >> k;

  vll csuma(n+1), csumb(m+1);
  rep(i,n) {
    ll a;
    cin >> a;
    csuma[i+1] = csuma[i] + a;
  }
  rep(i,m) {
    ll b;
    cin >> b;
    csumb[i+1] = csumb[i] + b;
  }
  
  ll ans = 0;
  rep(i, n+1){
    ll tmp = i;
    if(csuma[i] > k) continue;
    ll j = Upper_bound(csumb, k - csuma[i]);
    if(j > 0) tmp += j - 1;
    chmax(ans, tmp);
  }

  cout << ans << endl;

  return 0;
}



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

int main(){
	int n; cin>>n;
	string s; cin>>s;
  	if(n%2==1) cout<<"No"<<endl;
  	else{
    	vector<char> v1,v2;
      	for(int i=0,j=n/2;i<n/2;i++,j++){
        	v1.push_back(s[i]);
          	v2.push_back(s[j]);
        }

      	if(v1==v2) cout<<"Yes"<<endl;
      	else cout<<"No"<<endl;
    }
 
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=(a);i<(b);i++)
#define fore(i,a,b) for(int i=(a);i<=(b);i++)
#define pb push_back
#define F first
#define S second
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
void amin(ll &a, ll b){ a=min(a,b); }
void amax(ll &a, ll b){ a=max(a,b); }
void SD(int t=0){ cout<<"PASSED "<<t<<endl; }
const ll INF = ll(1e18);
const int MOD = 998244353;

bool DEBUG=0;
const int MAXN = 200005;

int n;
ll a[MAXN];
ll sum=0;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	cin>>n;
	forn(i,0,n){
		cin>>a[i];
		sum^=a[i];
	}
	
	forn(i,0,n) cout<<(sum^a[i])<<' ';
	
	
	return 0;
}


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

int main() {
	int n;
	cin >> n;
	vector<int> h(n);
	for(int i=0;i<n;i++)
	{
		cin >> h.at(i);
	}
	string ans="Yes";
	for(int i=0;i<n;i++)
	{
		if(i==0)
		{
			h.at(i)-=1;
		}
		else
		{
			if(h.at(i)<h.at(i-1))
			{
				ans="No";
				break;
			}
			else if(h.at(i)>h.at(i-1))
			{
				h.at(i)-=1;
			}
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3784
#include <stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
long long cmpfunc (const void * a, const void * b) {
   return ( *(long long*)a - *(long long*)b );
}



int main(void){
   
long long int test,i,j,n,count,flag=0,o1=0,o2=0,b1,x,m,l,max,sum2,min,f,c,r,o,sum1,sum=0,y,b,count1=0,a2,b2;
char a[100];
scanf("%s",a);
if((strcmp(a,"Sunny"))==0){
    printf("Cloudy");
}else{
    if((strcmp(a,"Cloudy"))==0){
     printf("Rainy");
}else{
     printf("Sunny");
}
}
return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<climits>
#include<cstring>
#include<queue>
#include<map>
#include<functional>
using namespace std;

const int dev = 1e9+7;
typedef long long ll;

int main(){
    ll X;
    cin >> X;
    int i = 0;
    while(1){
        if(X <= i*(i+1)/2){
            break;
        }
        i++;
    }
    cout << i << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

using Real = long double;
using Point = complex<Real>;
const Real Pi = acos(-1), EPS = 1e-9;
inline bool eq(Real a, Real b) { return fabs(a - b) < EPS; }

//scalar
Point operator*(const Point &p, const Real &c)
{
    return Point(c * real(p), c * imag(p));
}

//add
Point operator+(const Point &p, const Point &q)
{
    return Point(real(p) + real(q), imag(p) + imag(q));
}

Point operator-(const Point &p, const Point &q)
{
    return Point(real(p) - real(q), imag(p) - imag(q));
}

//equal
bool operator==(const Point &p, const Point &q)
{
    return (real(p) == real(q)) && (imag(p) == imag(q));
}

Real radian_to_degree(Real r)
{
    return (r * 180.0 / Pi);
}

Real degree_to_radian(Real d)
{
    return (d * Pi / 180.0);
}

// norm
Real norm(const Point &p)
{
    return real(p) * real(p) + imag(p) * imag(p);
}

Real abs(const Point &p)
{
    return sqrt(norm(p));
}

//argumant [0, 2 * Pi)
Real arg(const Point &p)
{
    Real a = atan2(imag(p), real(p));
    if (a < 0)
        a = fabs(a) + Pi;
    return a;
}

Real dot(const Point &p, const Point &q)
{
    return (real(p) * real(q) + imag(p) * imag(q));
}

//input
istream &operator>>(istream &is, Point &p)
{
    Real a, b;
    is >> a >> b;
    p = Point(a, b);
    return is;
}

//output
ostream &operator<<(ostream &os, Point &p)
{
    os << fixed << setprecision(10) << p.real() << " " << p.imag();
}

Real get_angle(Point a, Point b)
{
    return acos(dot(a, b) / (abs(a) * abs(b)));
}

int N;

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

    vector<int> index(N);
    for (int i = 0; i < N; i++)
    {
        index[i] = i;
    }

    long double ans = 1e6;

    do
    {
        Point now_vect(0.5, 0.); //今向いている方向
        long double res = 0.;
        for (int i = 0; i < N; i++)
        {
            Point next_vect = (i == 0 ? X[index[i]] : X[index[i]] - X[index[i - 1]]);
            res += get_angle(now_vect, next_vect);
            now_vect = next_vect;
        }
        Point next_vect = -X[index[N - 1]];
        res += get_angle(now_vect, next_vect);
        ans = min(ans, res);
    } while (next_permutation(index.begin(), index.end()));

    cout << fixed << setprecision(10);
    cout << radian_to_degree(ans) << endl;
}


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

int main(){
    int n, k;
    cin >> n >> k;
    int a[n];
    if(k > 50){
        k = 50;
    }
    int b[k][n] = {};
    for(int i=0;i<n;i++){
        cin >> a[i];
    }

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

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


}

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

signed main() {
	int s;
	cin >> s;
	vector<int> a(1000020);
	a[1] = s;

	for (int i = 2; ; i++) {
		if (a[i - 1] % 2 == 0) {
			a[i] = a[i - 1] / 2;
		}
		else {
			a[i] = 3 * a[i - 1] + 1;
		}


		for (int j = 1; j < i - 1; j++) {
			if (a[i] == a[j]) {
				cout << i << endl;
				return 0;
			}
		}
	}
}


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

// Loops
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define _rrep(i, n) rrepi(i, n, 0)
#define rrepi(i, a, b) for (int i = int(a) - 1; i >= int(b); --i)

#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(xi, x) for (auto &&xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)

// typedef
template <class T> using vec = vector<T>;
using ll = long long;
using vi = vec<ll>;
using vvi = vec<vi>;
using vvvi = vec<vvi>;
using pii = pair<ll, ll>;

// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define mp make_pair

// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase(unique(all(v)), v.end())
#define perm(c)                                                                \
  sort(all(c));                                                                \
  for (bool c##p = 1; c##p; c##p = next_permutation(all(c)))

template <class T> pair<T, size_t> max(vector<T> &x) {
  auto it = max_element(all(x));
  return mp(*it, it - x.begin());
}
template <class T> pair<T, size_t> min(vector<T> &x) {
  auto it = min_element(all(x));
  return mp(*it, it - x.begin());
}

template <class T> inline bool chmax(T &maxval, const T &newval) {
  if (maxval < newval) {
    maxval = newval;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &minval, const T &newval) {
  if (minval > newval) {
    minval = newval;
    return 1;
  }
  return 0;
}

// Utilities
// Grid world utilities
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
#define inside(H, W, y, x) 0 <= (x) && (x) < (W) && 0 <= (y) && (y) < (H)

// Debug
#ifdef LOCAL
#include "dump.hpp"
#define debug(x) cerr << #x << ": " << x << '\n'
#else
#define dump(...)
#define debug(x)
#endif

// Yes or No
void yesno(bool ok, string yes = "Yes", string no = "No") {
  cout << (ok ? yes : no) << endl;
}

// Paste snippets here!!

//

void solve(long long N, std::vector<long long> A) {
  // 考え方
  // WLOG, i<j. So condition is rewritten as i+A[i]==j-A[j]
  // Following this, an inverted index I is built.
  // for each person i, we search the index by a key i+A[i].
  // for each person j in the I[i+A[i]], if i<j, we add him to the result.
  unordered_map<ll, vec<ll>> I;
  rep(j,N){
    I[j-A[j]].push_back(j);
  }
  ll ret = 0;
  rep(i,N){
    if(I.find(i+A[i])!=I.end()){
      auto &II = I[i+A[i]];
      auto it = upper_bound(all(II), i);
      ret += II.size() - (it - II.begin());
    }
  }
  cout << ret << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false); // Magic for faster cin
  cout.precision(12);
  long long N;
  std::cin >> N;
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    std::cin >> A[i];
  }
  solve(N, std::move(A));
  return 0;
}


Measured memory_bytes: 21104
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 1000

int lcs (char X[], char Y[]) {
	int i, j;
	int c[N + 1][N + 1];
	int m = strlen(X);
	int n = strlen(Y);
	int maxl = 0;


	for ( i = 1; i <= m; i++) c[i][0] = 0;
	for ( j = 1; j <= n; j++) c[0][j] = 0;

	for ( i = 1; i <= m; i++) {
		for ( j = 1; j <= n; j++) {
			if ( X[i-1] == Y[j-1] ) {
				c[i][j] = c[i - 1][j - 1] + 1;
			} else {
				c[i][j] = c[i - 1][j] > c[i][j - 1] ? c[i - 1][j] : c[i][j - 1] ;
			}
			maxl = maxl > c[i][j] ? maxl : c[i][j];
		}
	}

	return maxl;
}

int main () {
	char s1[N], s2[N];
	int n, i, result[N];

	scanf("%d",&n);
	for ( i = 0; i < n; i++ ) {
		scanf(" %s %s", s1, s2);
		result[i] = lcs(s1,s2);
		printf("%d\n",lcs(s1,s2));
	}

	return 0;
}


Measured memory_bytes: 5632
import itertools

A = []
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))
A = list(itertools.chain.from_iterable(A))
N = int(input())
for n in range(N):
    b = int(input())
    A = [0 if a == b else a for a in A]

if A[0] == A[1] == A[2] == 0:
    print("Yes")
elif A[3] == A[4] == A[5] == 0:
    print("Yes")
elif A[6] == A[7] == A[8] == 0:
    print("Yes")
elif A[0] == A[3] == A[6] == 0:
    print("Yes")
elif A[1] == A[4] == A[7] == 0:
    print("Yes")
elif A[2] == A[5] == A[8] == 0:
    print("Yes")
elif A[0] == A[4] == A[8] == 0:
    print("Yes")
elif A[2] == A[4] == A[6] == 0:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long llong;
const int inf = 1 << 20;
const int mod = 1e9 + 7;

int main() {
   string s;
   cin >> s;
   string ACGT = "ACGT";
   int ans = 0;
   rep(i, s.size()) {
      for (int j = i; j < s.size(); j++) {
         bool isACGT = false;
         rep(k, 4) {
            if (s[j] == ACGT[k])
               isACGT = true;
         }
         if (!isACGT) {
            break;
         } else {
            ans = max(ans, j - i + 1);
         }
      }
   }
   cout << ans << endl;
   return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long H;
        H = sc.nextLong();
        long A;
        A = sc.nextLong();

        final Solver solver = new Solver();
        solver.solve(H, A);
    }
}

class Solver {
    public void solve(long H, long A) {
        long left = H;
        long ans = 0;
        while (left > 0) {
            ans++;
            left -= A;
        }

        System.out.println(ans);
    }
}



Measured memory_bytes: 21844
parseInt(x)=parse(Int, x)
parseMap(x::Array{SubString{String},1})=map(parseInt, x)

function main()
	n = readline() |> parseInt
	a = Tuple{Int,Int}[(0,0) for i in 1:n]
	for i in 1:n
		x,y = readline() |> split |> parseMap
		a[i] = (x,y)
	end
	a = sort(a,by=x->(x[1]+x[2]))
	b = sort(a,by=x->(x[1]-x[2]))
	println(max(abs(a[1][1]-a[n][1])+abs(a[1][2]-a[n][2]), abs(b[1][1]-b[n][1])+abs(b[1][2]-b[n][2])))
end

main()

Measured memory_bytes: 225764
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

struct Graph {
    struct Vertex { int n, c; };
    struct Edge { int i, n, c; };
    Graph(int n, int m) : v(n, { -1, 0 }), e(m), n(n), m(0) {}
    void add_edge(int i, int j, int c) {
        e[m] = { j, v[i].n, c };
        v[i].n = m;
        m++;
    }
    void bfs01(int s, int t) {
        deque<int> q;
        q.push_back(s);
        for (int i = 0; i < n; i++) v[i].c = 1 << 30;
        v[s].c = 0;
        while (!q.empty()) {
            int i = q.front(); q.pop_front();
            if (i == t) break;
            for (int j = v[i].n; j >= 0; j = e[j].n) {
                Edge& o = e[j];
                int c = v[i].c + o.c;
                if (c < v[o.i].c) {
                    v[o.i].c = c;
                    if (o.c == 0) {
                        q.push_front(o.i);
                    } else {
                        q.push_back(o.i);
                    }
                }
            }
        }
    }
    vector<Vertex> v;
    vector<Edge> e;
    int n, m;
};

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

    int h, w;
    cin >> h >> w;

    int ch, cw;
    cin >> ch >> cw;
    ch--; cw--;
    int ck = ch * w + cw;

    int dh, dw;
    cin >> dh >> dw;
    dh--; dw--;
    int dk = dh * w + dw;

    vector<char> s(h * w);
    string t;
    for (int i = 0; i < h; i++) {
        cin >> t;
        for (int j = 0; j < w; j++) {
            int k = i * w + j;
            s[k] = t[j] == '#';
        }
    }

    Graph g(h * w, h * w * 30);

    for (int i = 1; i < h; i++) {
        for (int j = 0; j < w; j++) {
            int k = i * w + j;
            if (s[k] || s[k - w]) continue;
            g.add_edge(k, k - w, 0);
            g.add_edge(k - w, k, 0);
        }
    }
    for (int i = 0; i < h; i++) {
        for (int j = 1; j < w; j++) {
            int k = i * w + j;
            if (s[k] || s[k - 1]) continue;
            g.add_edge(k, k - 1, 0);
            g.add_edge(k - 1, k, 0);
        }
    }
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            int k = i * w + j;
            if (s[k]) continue;
            for (int x = -2; x <= 2; x++) {
                if (i + x < 0 || i + x >= h) continue;
                for (int y = -2; y <= 2; y++) {
                    if (j + y < 0 || j + y >= w) continue;
                    int l = k + (x * w + y);
                    if (s[l]) continue;
                    g.add_edge(k, l, 1);
                }
            }
        }
    }

    g.bfs01(ck, dk);

    cout << (g.v[dk].c == 1 << 30 ? -1 : g.v[dk].c) << endl;

    return 0;
}

Measured memory_bytes: 363548
#include <iostream>

int main(int argc, char const* argv[])
{
	int H, W;
	while(true) {
		std::cin >> H >> W;
		if (H == 0 && W == 0) {
			break;
		}
		else {
			for (int h = 0; h < H; h++) {
				for (int w = 0; w < W; w++) {
					std::cout << "#";
				}
				std::cout << std::endl;
			}
			std::cout << std::endl;
		}
	}
	return 0;
}



Measured memory_bytes: 3128
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;


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

	long long a;
	long double b;
	cin >> a >> b;

	cout << fixed << setprecision(0) << floor(a * b) << '\n';

	return 0;
}


Measured memory_bytes: 3812
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int main(){
	fast;
	string n;
	cin>>n;
	if(n[0]=='9'||n[1]=='9')
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
}


Measured memory_bytes: 3604
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define psortfirst(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.first<b.first;});
#define All(x) (x).begin(),(x).end()
using namespace std;
using pii  = pair<int,int>;
long long gcd(long long a, long long b){return (b == 0 ? a : gcd(b, a%b));}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
int BinarySearch(int key,int n,int S[]){
  int l=0,r=n;
  while(r-l>1){
    int mid=(l+r)/2;
    if(S[mid]>key)r=mid;
    else l=mid;
  }
  return S[l]==(key?1:0);
}
typedef long long ll;
#define MOD 1000000007
#define EPS 10e-8

int main() {
    ll N,A[95];cin >> N;
    A[0]=2;A[1]=1;
    rep(i,N-1){
        A[i+2]=A[i]+A[i+1];
    }
    cout << A[N] <<endl;
}

Measured memory_bytes: 256
n = gets.to_i

a = []
n.times do
  a << gets.to_i
end

current = 1
result = 0
n.times do
  result += 1
  num = a[current-1]
  if num == 2
    puts result.to_s
    exit
  end
  current = num
end
puts '-1'


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

typedef long long ll;
const int MAX_N = 100030;    // Change as necessary
const ll  MODD = 1000000009; //

int A[MAX_N];

set<pair<int,int> > S,C;

ll ans[11] = {0};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  
  ll W,H;
  cin >> H >> W;
  
  int N; cin >> N;
  
  for(int i=0;i<N;i++){
    int a,b; cin >> a >> b;
    a--; b--;
    S.emplace(a,b);
  }
  
  for(const auto& x : S){
    for(int i=-2;i<=0;i++)
      for(int j=-2;j<=0;j++){
        int I=x.first+i, J = x.second+j;
        if(!(0 <= I && I < H && 0 <= J && J < W)) continue;
        if(!(0 <= I+2 && I+2 < H && 0 <= J+2 && J+2 < W)) continue;
        if(C.count(make_pair(I,J))) continue;
        C.emplace(I,J);
        int ctr = 0;
        for(int ii=0;ii<3;ii++)
          for(int jj=0;jj<3;jj++)
            if(S.count(make_pair(I+ii,J+jj)))
              ctr++;
        ans[ctr]++;
      }
  }
  
  ll tot = max(0ll,(W-2)*(H-2));
  ans[0] = tot - accumulate(ans+1,ans+10,0ll);
  
  for(int i=0;i<10;i++)
    cout << ans[i] << endl;
  
  return 0;
}


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

using ll = int64_t;
#define int ll

#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(), x.end()
auto &errStream = cerr;
#ifdef LOCAL
#define cerr (cerr << "-- line " << __LINE__ << " -- ")
#else
class CerrDummy {
} cerrDummy;
template <class T> CerrDummy &operator<<(CerrDummy &cd, const T &) {
  return cd;
}
using charTDummy = char;
using traitsDummy = char_traits<charTDummy>;
CerrDummy &operator<<(CerrDummy &cd,
                      basic_ostream<charTDummy, traitsDummy> &(
                          basic_ostream<charTDummy, traitsDummy> &)) {
  return cd;
}
#define cerr cerrDummy
#endif
#define REACH cerr << "reached" << endl
#define DMP(x) cerr << #x << ":" << x << endl
#define ZERO(x) memset(x, 0, sizeof(x))
#define ONE(x) memset(x, -1, sizeof(x))

using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  REP(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

ll read() {
  ll i;
  scanf("%" SCNd64, &i);
  return i;
}

void printSpace() { printf(" "); }

void printEoln() { printf("¥n"); }

void print(ll x, int suc = 1) {
  printf("%" PRId64, x);
  if (suc == 1)
    printEoln();
  if (suc == 2)
    printSpace();
}

string readString() {
  static char buf[3341000];
  scanf("%s", buf);
  return string(buf);
}

char *readCharArray() {
  static char buf[3341000];
  static int bufUsed = 0;
  char *ret = buf + bufUsed;
  scanf("%s", ret);
  bufUsed += strlen(ret) + 1;
  return ret;
}

template <class T, class U> void chmax(T &a, U b) {
  if (a < b)
    a = b;
}

template <class T, class U> void chmin(T &a, U b) {
  if (b < a)
    a = b;
}

template <class T> T Sq(const T &t) { return t * t; }

#define CAPITAL
void Yes(bool ex = true) {
#ifdef CAPITAL
  cout << "YES" << endl;
#else
  cout << "Yes" << endl;
#endif
  if (ex)
    exit(0);
}
void No(bool ex = true) {
#ifdef CAPITAL
  cout << "NO" << endl;
#else
  cout << "No" << endl;
#endif
  if (ex)
    exit(0);
}

const ll infLL = LLONG_MAX / 3;

#ifdef int
const int inf = infLL;
#else
const int inf = INT_MAX / 2 - 100;
#endif

signed main() {
  int s = read();
  vi a;
  a.PB(s);

  REP(i, 1000000) {
    if (a[i] % 2 == 0)
      a.PB(a[i] / 2);
    else
      a.PB((a[i] * 3) + 1);
    FOR(j, 0, a.size() - 2) {
      if (a[j] == a[i + 1]) {
        print(i + 2, 0);
        return 0;
      }
    }
  }
}


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

#include <iostream>
using namespace std;
int main() {
  int64_t n;
  cin >> n;
  vector<string> s(n);
  for (auto &si : s) {
    cin >> si;
  }
  sort(s.begin(), s.end());
  uint64_t n_types = 1;
  for (uint64_t i = 1; i < n; ++i) {
    if (s[i] != s[i - 1]) {
      n_types++;
    }
  }
  cout << n_types << endl;
  return 0;
}


Measured memory_bytes: 9560
while True:
    data = input().split()
    if data[1] == "?":
        break
    a = int(data[0])
    b = int(data[2])
    if data[1] == "+":
        c = a + b
    elif data[1] == "-":
        c = a - b
    elif data[1] == "*":
        c = a * b
    else:
        c = a // b
    print(c)


Measured memory_bytes: 5596
#include <bits/stdc++.h>
#define rep(i, z, n) for(int i = z; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
//const int INF = 1<<29;
//const int MODINF = 1000000007;
using namespace std;

int main(){
    int64_t N;
    cin >> N;
    int64_t x = 1;
    while(true){
        if(pow(x + 1, 2) > N){
            break;
        }
        else{
            x++;
        }
    }
    int ans = pow(x, 2);
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int N,Q;
const int INF=INT_MAX;
struct LazySegmentTree{
  private:
  int n;
  vector<int> node,lazy;
  vector<bool> lazyFlag;
  
  public:
  LazySegmentTree(vector<int> v){
    int sz=(int)v.size();
    n=1;  while(n<sz)n*=2;
    node.resize(2*n-1);
    lazy.resize(2*n-1,INF);
    lazyFlag.resize(2*n-1,false);
    for(int i=0;i<sz;i++)node[i+n-1]=v[i];
    for(int i=n-2;i>=0;i--){node[i]=min(node[2*i+1],node[2*i+2]);}
  }
  void lazyEvaluate(int k,int l,int r){
    if(lazyFlag[k]){
      node[k]=lazy[k];
      if(r-l>1){
        lazy[2*k+1]=lazy[2*k+2]=lazy[k];
        lazyFlag[2*k+1]=lazyFlag[2*k+2]=true;
      }
      lazyFlag[k]=false;
    }
  }
  void update(int a,int b,int x,int k=0,int l=0,int r=-1){
    if(r<0)r=n;
    lazyEvaluate(k,l,r);
    if(b<=l || r<=a)return;
    if(a<=l && r<=b){
      lazy[k]=x;
      lazyFlag[k]=true;
      lazyEvaluate(k,l,r);
    }
    else{
      update(a,b,x,2*k+1,l,(l+r)/2);
      update(a,b,x,2*k+2,(l+r)/2,r);
      node[k]=min(node[2*k+1],node[2*k+2]);
    }
  }
  int find(int a,int b,int k=0,int l=0,int r=-1){
    if(r<0)r=n;
    lazyEvaluate(k,l,r);
    if(b<=l || r<=a)return INF;
    if(a<=l && r<=b)return node[k];
    int vl=find(a,b,2*k+1,l,(l+r)/2);
    int vr=find(a,b,2*k+2,(l+r)/2,r);
    return min(vl,vr);
  }
};

int main(){
  cin >> N >> Q;
  LazySegmentTree seg(vector<int>(N,INF));
  for(int i=0;i<Q;i++){
    int q,s,t; cin >> q >> s >> t;
    if(q==0){
      int x; cin >> x;
      seg.update(s,t+1,x);
    }
    else{
      cout << seg.find(s,t+1) << endl;
    }
  }
}


Measured memory_bytes: 5216
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define maxn 200010

int n, cnt=0;
long long k;
string s;

int main()
{
    cin >> n >> s;
    int cnt=0;
    for(int i = 0; i < n; i++) cnt+=(s[i]=='W');
    for(int i=n-cnt; i<n; i++)if(s[i]=='W')cnt--;
    cout << cnt;
}


Measured memory_bytes: 3768
n = int(input())
h = list(map(int,input().split()))
dp = [0,abs(h[1]-h[0])]
for i in range(2,n):
    dp.append(min(dp[i-2]+abs(h[i]-h[i-2]),dp[i-1]+abs(h[i]-h[i-1])))
    
print(dp[n-1])

Measured memory_bytes: 13980
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    S = Scanner.string()
    if S == 'ABC':
        print("ARC")
    else:
        print("ABC")


def main():
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()


Measured memory_bytes: 10648
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
    long long a,b;
    cin >> a >> b;
    long long ans;
    int count=0;
    long long i;
    for(i=0;i<1000000001;i++){
        if(abs(a-i)==abs(b-i)) {
            count=1;
            break;
        }
    }
    if(count==0) cout << "IMPOSSIBLE" << endl;
    else cout << i << endl;
 }


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


int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n+1);
    for (int i = 1; i <= n; i++) cin >> a[i];

    for (int i = k+1; i <= n; i++) {
        if (a[i] > a[i-k]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 3960
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt(), m = sc.nextInt();
        int[] X = new int[m];
        for (int i = 0; i < m; i++) {
            X[i] = sc.nextInt();
        }
        int[] dX = new int[m - 1];
        Arrays.sort(X);
        for (int i = 0; i < m - 1; i++) {
            dX[i] = X[i + 1] - X[i];
        }

        Arrays.sort(dX);
        long sub = 0;
        for (int i = 0; i < Math.min(n - 1, m - 1); i++) {
            sub += dX[m - 2 - i];
        }
        long sum = 0;
        for (int i = 0; i < m - 1; i++) {
            sum += dX[i];
        }

        System.out.println(sum - sub);
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


Measured memory_bytes: 49268
#include <iostream>
#include <algorithm>

int main()
{
  int n;
  int r=0;
  std::cin>>n;
  int a=1;
  while(a<=n){
    r+=std::min(a*10, n+1)-a;
    a*=100;
  }
  std::cout<<r;
  return 0;
}


Measured memory_bytes: 256
index={}
while True:
    try:
        word,page=input().split(" ")
        page=int(page)
        tmp=index.get(word,[])
        tmp.append(page)
        index[word]=tmp

    except EOFError:
        break


index=sorted(index.items())
for object in index:
    print(object[0])
    print(" ".join([str(i) for i in sorted(object[1])]))



Measured memory_bytes: 5604
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<algorithm>
#include<utility>
using namespace std;

int N, M;
vector<long long> x, y, z;

long long calc(vector<pair<long long, int>>& v)
{
	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());

	int index;
	long long xx, yy, zz;
	xx = yy = zz = 0;
	for(int i=0; i<M; i++){
		index = v[i].second;
		xx += x[index];
		yy += y[index];
		zz += z[index];
	}

	return abs(xx) + abs(yy) + abs(zz);
}

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

	x = vector<long long>(N);
	y = vector<long long>(N);
	z = vector<long long>(N);
	for(int i=0; i<N; i++)
		cin >> x[i] >> y[i] >> z[i];

	long long ret = 0;
	vector<pair<long long, int>> table(N);
	vector<long long> sign(2, 1);
	sign[1] = -1;
	for(int i=0; i<2; i++){
		for(int j=0; j<2; j++){
			for(int k=0; k<2; k++){
				for(int n=0; n<N; n++){
					table[n] = make_pair(sign[i]*x[n] + sign[j]*y[n] + sign[k]*z[n], n);
				}
				ret = max(ret, calc(table));
			}
		}
	}

	cout << ret << endl;

	return 0;
}


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

namespace ProblemA
{
    class Program
    {
        static void Main(string[] args)
        {
            string S = CIN.String();
            char one = S[0];
            char two = ' ';
            int oneC = 1;
            int twoC = 0;

            for (int i = 1; i < 4; i++)
            {
                if (S[i] == one)
                {
                    oneC++;
                    continue;
                }

                if (two == ' ')
                {
                    two = S[i];
                }
                
                if (S[i] == two)
                {
                    twoC++;
                }
            }

            if (oneC == 2 && twoC == 2)
            {
                Console.WriteLine("Yes");
                return;
            }
            Console.WriteLine("No");
        }
    }

    internal static class CIN
    {
        public static string String()
        {
            return Console.ReadLine();
        }

        public static int Int()
        {
            return int.Parse(Console.ReadLine());
        }

        public static int[] IntArray()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        public static long Long()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] LongArray()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] DoubleArray()
        {
            return Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
        }
    }
}

Measured memory_bytes: 13140
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include<set>
#include<tuple>
using namespace std;
#define INF 11000000000
#define MAX 5100
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
typedef pair<pair<int,int>,int> p;
typedef pair< pair<int,int>, int> p; 
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
const double PI = acos(-1);

int main(){
    int x,y;
    string s;
    cin>>s>>x>>y;
    x+=8000; y+=8000;
    s.push_back('T');
    int now=0,count=0;
    vector<int> X,Y;
    for(int i=0;i<(int)s.size();i++){
        if(s[i]=='F') count++;
        else{
            if(now==0) x-=count;
            else if(count==0){
                now++;
                continue;
            }else if(now%2==0) X.push_back(count);
            else Y.push_back(count);
            count=0;
            now++;
        }
    }
    int nx=(int)X.size(),ny=(int)Y.size();
    bool dp[4100][16100];
    for(int i=0;i<4100;i++){
        for(int j=0;j<16100;j++) dp[i][j]=false;
    }
    dp[0][8000]=true;
    for(int i=0;i<nx;i++){
        for(int j=0;j<16100;j++){
            if(dp[i][j]==false) continue;
            dp[i+1][j+X[i]]=true;
            dp[i+1][j-X[i]]=true;
        }
    }
    if(!dp[nx][x]){
        cout<<"No"<<endl;
        return 0;
    } 

    for(int i=0;i<4100;i++){
        for(int j=0;j<16100;j++) dp[i][j]=false;
    }
    dp[0][8000]=true;
    for(int i=0;i<ny;i++){
        for(int j=0;j<16100;j++){
            if(dp[i][j]==false) continue;
            dp[i+1][j+Y[i]]=true;
            dp[i+1][j-Y[i]]=true;
        }
    }
    if(dp[ny][y]) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}



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

template<typename T, typename U>
using pv=vector<pair<T,U>>;
template<typename T>
using matrix=vector<vector<T>>;
template<typename T>
using pque=priority_queue<T>;
template<typename T>
using lpque=priority_queue<T,vector<T>,greater<T>>;

using ll=long long;
using intpair=pair<int,int>;
using llpair=pair<ll,ll>;
using ilpair=pair<int,ll>;
using lipair=pair<ll,int>;
using intvec=vector<int>;
using llvec=vector<ll>;
using intq=queue<int>;
using llq=queue<ll>;
using intmat=vector<intvec>;
using llmat=vector<llvec>;

#define PI 3.141592653589793
#define INTINF ((1<<30)-1)
#define LLINF 1LL<<60
#define MPRIME 1000000007
#define MPRIME9 998244353
#define MMPRIME (1ll<<61)-1

#define len length()
#define pushb push_back
#define fi first
#define se second

#define setpr fixed<<setprecision(15)
#define all(name) name.begin(),name.end()
#define rall(name) name.rbegin(),name.rend()
#define gsort(vbeg,vend) sort(vbeg,vend,greater<>())

template<class T>
inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}

template<class T>
inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

template<class T>
inline void init(T& v) {
	for(auto &a: v) cin>>a;
}
template<class T, class U>
inline void init(vector<pair<T,U>>& v) {
	for(auto &a: v) cin>>a.first>>a.second;
}
template<class T, class N>
inline void init(T& v, N n) {
	v.resize(n);
	for(auto &a: v) cin>>a;
}
template<class T, class U, class N>
inline void init(vector<pair<T,U>>& v, N n) {
	v.resize(n);
	for(auto &a: v) cin>>a.first>>a.second;
}

inline void out() {
	cout<<endl;
}
template<class T, class... U>
inline void out(T a, U... alist) {
	cout<<a<<" ";
	out(forward<U>(alist)...);
}

template<class N>
void resiz(N n) {
	//empty
}
template<class N, class T, class... U>
void resiz(N n, T&& hd, U&&... tl) {
	hd.resize(n);
	resiz(n,forward<U>(tl)...);
}

ll binpow(ll a, ll ex, ll p) {
	ll result=1;
	while(ex>0) {
		if(ex&1) result=result*a%p;
		ex>>=1;
		a=a*a%p;
	}
	return result;
}


int N;
int ac,wa,tle,re;

void input() {
	cin>>N;
}

void solve() {
	for(int i=0; i<N; i++) {
		string S; cin>>S;
		if(S=="AC") ac++;
		if(S=="WA") wa++;
		if(S=="TLE") tle++;
		if(S=="RE") re++;
	}

	cout<<"AC x "<<ac<<endl;
	cout<<"WA x "<<wa<<endl;
	cout<<"TLE x "<<tle<<endl;
	cout<<"RE x "<<re<<endl;
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout<<fixed<<setprecision(15);
	int t=1;
	while(t) {
		input();
		solve();
		t--;
	}
}


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


typedef long long ll;
typedef double db;
int main(){
	char c[3];
	scanf("%c %c %c",&c[0],&c[1],&c[2]);
	sort(c,c+3);
	printf("%d",(c[2]-'0')*10+c[1]-'0'+c[0]-'0');












	return 0;
}

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

int main() {
  int h,w,a,b;
  cin >> h >> w >> a >> b;
  vector<vector<int>>data(h,vector<int>(w,0));
  for(int i = 0;i < h;i++){
    for(int j = 0;j < w;j++){
      if(i<b^j<a) data[i][j] = 1;
      cout << data[i][j];
    }
    cout << "" << endl;
  }
}


Measured memory_bytes: 5120
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define mod 998244353

using namespace std;
typedef pair<llint, llint> P;

llint n, x, m;
map<llint, llint> mp;
llint a[200005];

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> x >> m;
	
	mp[x] = 1, a[1] = x;
	llint pos, per;
	for(int i = 2; ; i++){
		x *= x, x %= m;
		a[i] = x;
		if(mp.count(x)){
			pos = mp[x];
			per = i - mp[x];
			break;
		}
		mp[x] = i;
	}
	
	//cout << pos << " " << per << endl;
	
	llint ans = 0;
	for(int i = 1; i <= min(pos-1, n); i++) ans += a[i];
	
	
	n -= (pos-1);
	if(n <= 0){
		cout << ans << endl;
		return 0;
	}
	
	llint sum = 0;
	for(int i = 0; i < per; i++) sum += a[pos+i];
	
	ans += n/per*sum;
	n %= per;
	for(int i = 0; i < n; i++) ans += a[pos+i];
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 7052
import copy

H,W,K = map(int, input().split())
c = [list(map(str, list(input()))) for i in range(H)]


#bit全探索
S = 0
for i in range(2 ** (H+W)):
    field = copy.deepcopy(c)
    bag = []
    for j in range(H+W):  # このループが一番のポイント
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
            if j < W:
                for y in range(H):
                    field[y][j] = "."
            else:
                for x in range(W):
                    field[j-W][x] = "."
    #print(field)
    #print()
    Sum = 0
    for x in range(W):
        for y in range(H):
            if field[y][x] == "#":
                Sum += 1

    if Sum == K:
        S += 1

print(S)

Measured memory_bytes: 71728
#include<stdio.h>
int main(void){
    int sx,sy,tx,ty;
    scanf("%d %d %d %d",&sx,&sy,&tx,&ty);
    for(int i=sy;i<ty;i++){
        printf("U");
    }
    for(int i=sx;i<tx;i++){
        printf("R");
    }
    for(int i=ty;i>sy;i--){
        printf("D");
    }
    for(int i=tx;i>sx;i--){
        printf("L");
    }
    printf("L");
    for(int i=sy;i<ty+1;i++){
        printf("U");
    }
    for(int i=sx;i<tx+1;i++){
        printf("R");
    }
    printf("DR");
    for(int i=ty;i>sy-1;i--){
        printf("D");
    }
    for(int i=tx;i>sx-1;i--){
        printf("L");
    }
    printf("U\n");
    return(0);

}

Measured memory_bytes: 128
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
b = -1
for i in A:
    ans += B[i-1]
    if b == i - 1:
        ans += C[b-1]
    b = i

print(ans)


Measured memory_bytes: 3060
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef complex<double> xy_t;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-11;

int main() {
    while (1) {
        int N;
        cin >> N;
        if (N == 0) {
            break;
        }
        string s[N];
        int dots[N];
        for (int i = 0; i < N; i++) {
            cin >> s[i];
            int len = s[i].size();
            int num = 0;
            for (int j = 0; j < len; j++) {
                if (s[i][j] != '.') {
                    break;
                }
                num++;
            }
            dots[i] = num;
        }
        for (int i = 0; i < N; i++) {
            if (dots[i] == 0) {
                continue;
            } else {
                for (int j = 0; j < dots[i] - 1; j++) {
                    if (s[i][j] != '|') {
                        s[i][j] = ' ';
                    }
                }
                s[i][dots[i] - 1] = '+';
                int num = i;
                for (int j = i + 1; j < N; j++) {
                    if (dots[j] < dots[i]) {
                        break;
                    } else if (dots[j] == dots[i]) {
                        num = j;
                        break;
                    }
                }
                if (num > i) {
                    for (int j = i + 1; j < num; j++) {
                        s[j][dots[i] - 1] = '|';
                    }
                }
            }
        }
        for (int i = 0; i < N; i++) {
            cout << s[i] << endl;
        }
    }
}



Measured memory_bytes: 3836
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader r =
            new BufferedReader(new InputStreamReader(System.in), 1);
        String is = r.readLine();
        String[] sp = is.split(" ");
      //ArrayList???????????????
        ArrayList<Integer> al = new ArrayList<Integer>();

        //Integer????????°??????????????????
        al.add(Integer.parseInt(sp[0]));
        al.add(Integer.parseInt(sp[1]));
        al.add(Integer.parseInt(sp[2]));

        //????????§???????????????
        Collections.sort(al);
        System.out.println(al.get(0) + " " + al.get(1) + " " + al.get(2));
    }
}

Measured memory_bytes: 24448
#include <bits/stdc++.h>
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << '\n'
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef double db;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a; }
//head
 
void solve(){
    int n;
    cin >> n;
    vector<int> a(n);
    int m = 0, pred_m = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] > m){
            pred_m = m;
            m = a[i];
        }
        else if (a[i] > pred_m) pred_m = a[i];
    }

    int c = 0;
    for (int i = 0; i < n; i++) if (a[i] == m) c++;

    for (int i = 0; i < n; i++){
        if (a[i] == m){
            if (c > 1) cout << m;
            else cout << pred_m;
        }
        else cout << m;
        cout << '\n';
    }
}

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

    //int t; cin >> t; while (t--)
        solve();
}

Measured memory_bytes: 3916