akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
// import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{

	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
	    int[] a = new int[n];
	    int[] b = new int[n];
	    int[] c = new int[n];
	    int[][] dp = new int[n][3];
	    int last = 0;
	   // int i =0;
	   // List<node> order = new ArrayList<node>();
		for(int i=0;i<n;i++)
		{
		    a[i] = sc.nextInt();
		    b[i] = sc.nextInt();
		    c[i] = sc.nextInt();
		    if(i==0)
		        {dp[i][0] = a[i];
		        dp[i][1] = b[i];
		        dp[i][2] = c[i];}
		    else{
		        dp[i][0] = a[i]+Math.max(dp[i-1][1],dp[i-1][2]);
		        dp[i][1] = b[i]+Math.max(dp[i-1][0],dp[i-1][2]);
		        dp[i][2] = c[i]+Math.max(dp[i-1][1],dp[i-1][0]);
		        
		    }
		}
		System.out.print(Math.max(Math.max(dp[n-1][0],dp[n-1][1]),dp[n-1][2]));
	}
}


Measured memory_bytes: 99060
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b;
  cin>>a>>b;
  if(a>0 && b>0)
    cout<<"Positive"<<endl;
  else
    if(a<0 && b<0)
    {
      if(b==a)
        cout<<"Positive"<<endl;
      else
      if((b-a)%2==0)
        cout<<"Negative"<<endl;
      else
        cout<<"Positive"<<endl;
    }
  else
    cout<<"Zero"<<endl;
  
  
  return 0;
}

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

int main(){
    int sum[30] = {};
    char ch;
    while(cin >> ch){
        if(ch >= 'a' && ch <= 'z'){
            sum[ch-'a']++;
        }else if(ch >= 'A' && ch <= 'Z'){
            sum[ch-'A']++;
        }
    }
    
    for(int i = 0; i < 26; i++) cout << (char)(i+'a') << " : " << sum[i] << endl;
    return 0;
}


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

#define x first
#define y second
#define ndl '\n'
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)x.size()
#define bit __builtin_popcount
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

using namespace std;
using namespace __gnu_pbds;

template<typename T> using indexed_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<int, ull> piu;
typedef vector<vector<int>> matrix;

const ll INF = 1e18 + 123;
const ld EPS = 1e-9;
const int inf = 1e9 + 123;
const int MOD = 1e9 + 7;
const int N = 5e5 + 13;
const int M = 1e6 + 123;
const double pi = acos(-1.0);
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};

int main(){
    #ifdef KAZAKH
        freopen("input.txt", "r", stdin);
    #endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s, t, u;
    int a, b;
    cin >> s >> t >> a >> b >> u;
    if (s == u) a--;
    else b--;
    cout << a << " " << b;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cctype>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int comp(const void* a, const void* b){
	return *(int*)a - *(int*)b;
}

int main() {
	int y, m, d;
	scanf("%d/%d/%d", &y, &m, &d);
	if(y <= 2019){
		if(m <= 4){
			cout << "Heisei" << endl;
		}else{
			cout << "TBD" << endl;
		}
	}else{
		cout << "TBD" << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
vector<pair<int,int> >v[15];
int n,m,ans,b[65536],dp[65536][15];
int main(){
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int x,y,len;cin>>x>>y>>len;x--;y--;
		v[x].push_back(make_pair(y,len));v[y].push_back(make_pair(x,len));
		ans+=len; 
	}
	for(int i=0;i<(1<<n);i++)
	{
		for(int j=0;j<n;j++)
			if(!(i&(1<<j))&&!b[i+(1<<j)])
			{
				b[i+(1<<j)]=b[i];
				for(int k=0;k<v[j].size();k++)
					if(i&(1<<v[j][k].first))
						b[i+(1<<j)]+=v[j][k].second;
			}
	}
	memset(dp,-1,sizeof(dp));
	dp[1][0]=0;
	for(int i=0;i<(1<<n);i++)
		for(int j=0;j<n;j++)
			if(dp[i][j]!=-1&&(i&1<<j)){
				for(int k=0;k<v[j].size();k++)
					if(!(i&(1<<v[j][k].first)))
						dp[i|(1<<v[j][k].first)][v[j][k].first]=max(dp[i|(1<<v[j][k].first)][v[j][k].first],dp[i][j]+v[j][k].second);
				for(int k=((1<<n)-1-i)|(1<<j);k;k=(k-1)&(((1<<n)-1-i)|(1<<j)))
					if(k&(1<<j))
						dp[i|k][j]=max(dp[i|k][j],dp[i][j]+b[k]);
			}
	cout<<ans-dp[(1<<n)-1][n-1];
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#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 rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

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

     int H,W,h,w;
     cin >> H >>W >> h >> w;
     cout << (H-h)*(W-w) << endl;


    return 0;
}


Measured memory_bytes: 256
//#include <algorithm>
//#include <cstdio>
//#include <functional>
#include <iostream>
//#include <cfloat>
//#include <climits>
//#include <cstdlib>
//#include <cstring>
//#include <cmath>
//#include <map>
//#include <queue>
//#include <set>
//#include <sstream>
//#include <stack>
//#include <string>
//#include <time.h>
//#include <vector>
//#include <random>
//#include <unordered_set>
//#include <complex>
#define WAIT system ("pause")
#define rt0 return 0
using namespace std;
bool p(string s)
{
    for(int i=0;i<s.size()/2;i++)
    {
        if(s[i]!=s[s.size()-i-1]) 
        {
            return false;
            break;
        }
    }
    return true;
}
int main()
{
    int a,b,i,cnt=0,n[5],s;
    cin>>a>>b;
    for(i=a;i<=b;i++) 
    {
        s=i;
        n[4]=s%10;
        s/=10;
        n[3]=s%10;
        s/=10;
        n[2]=s%10;
        s/=10;
        n[1]=s%10;
        s/=10;
        n[0]=s%10;
        s/=10;
        if((n[0]==n[4])and(n[1]==n[3])) cnt++;
    }
    cout<<cnt;
    WAIT;
    rt0;
}


Measured memory_bytes: 504
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const ll INF = 2e15;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin>>n;
  vl x(n+1,0);
  vl y(n+1,0);
  vl z(n+1,0);
  ll ans=1;
  for(ll i=1;i<=n;i++){
    ll a;
    cin>>a;
    ll tmp=0;
    if(a==x[i-1])tmp++;
    if(a==y[i-1])tmp++;
    if(a==z[i-1])tmp++;
    ans*=tmp;
    ans%=MOD;
    if(a==x[i-1]){
      x[i]=x[i-1]+1;
      y[i]=y[i-1];
      z[i]=z[i-1];
    }
    else if(a==y[i-1]){
      x[i]=x[i-1];
      y[i]=y[i-1]+1;
      z[i]=z[i-1];
    }
    else if(a==z[i-1]){
      x[i]=x[i-1];
      y[i]=y[i-1];
      z[i]=z[i-1]+1;
    }
    //cout<<x[i]<<" "<<y[i]<<" "<<z[i]<<endl;
  }
  print(ans);
}


Measured memory_bytes: 5640
while True:
    n = int(input())
    if n == 0:
        break

    nums = [int(input()) for _ in range(n)]
    max_num = max(nums)
    min_num = min(nums)
    nums.remove(max_num)
    nums.remove(min_num)
    print(sum(nums) // len(nums))



Measured memory_bytes: 5600
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define f first
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define s second
#define rep(i, a, b) for(int i = int(a); i <= int(b); ++i)
using namespace std;


int main(){
    faster
    int T = 1;
    while(T--){
        int n,l;
        cin>>n>>l;
        
        string arr[n];
        
        rep(i,0,n-1){
            cin>>arr[i];
        }
        
        sort(arr,arr+n);
        
        rep(i,0,n-1){
            cout<<arr[i];
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main(void){
	int n;
	while(cin >> n){
		for (int i=0; i<10; i++){
			if (n%2==1){
				cout << (int)pow(2.0,i);
				n = (n-1)/2;
				
			if (n==0){
				cout << endl;
				break;
			}else{
				cout << " ";
			}
			}else{
				n = n/2;
			}
		}
	}



	return 0;
}

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

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }


int main() {
    ll n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    ll broken_num = 0;

    rep(i, n) {
        if(a[i] == i + 1 - broken_num) {
            continue;
        } else {
            broken_num++;
        }
    }

    if(broken_num == n) cout << -1 << endl;
    else cout << broken_num << endl;

    return 0;
}



Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;

int main(){
    ll a,b,c,d;
    scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
    ll mx=max(max(a*c,a*d),max(b*c,b*d));
    printf("%lld",mx);
}


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

int main()
{
    int h, w;
    cin >> h >> w;
    vector<vector<int>> grid(h, vector<int>(w, 0));
    char c;
    for (int i = 0; i < h; i++) 
        for (int j = 0; j < w; j++)
        {
            cin >> c; 
            if (c == '.') grid[i][j] = 0;
            if (c == '#') grid[i][j] = -1;
        }
    for (int i = 0; i < h; i++)
    for (int j = 0; j < w; j++)
    {
        if (grid[i][j] == 0)
        {
            for (int k = i - 1; k <= i + 1; k++)
            for (int l = j - 1; l <= j + 1; l++)
            {
                if (k < 0 || l < 0 || k >= h || l >= w) continue;
                if (grid[k][l] == -1) grid[i][j]++;
            }
        }
    }
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (grid[i][j] >= 0) cout << grid[i][j];
            else cout << "#";
        }
        cout << endl;
    }
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func abs(a int) int {
	if a < 0 {
		return -1 * a
	} else {
		return a
	}
}

func main() {
	sc.Split(bufio.ScanWords)

	n := nextInt()
	sum, nc, minAbs := 0, 0, 1000000000
	for i := 0; i < n; i++ {
		a := nextInt()
		if a < 0 {
			nc++
		}
		aa := abs(a)
		if minAbs > aa {
			minAbs = aa
		}
		sum += aa
	}

	if nc % 2 == 1 {
		sum -= 2 * minAbs
	}

	fmt.Println(sum)
}


Measured memory_bytes: 2304
#include<iostream>
#include<cstdio>
#define FOR(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
const int N=300300;
int n,L,R,a[N],s[2][N];
bool chk(int lim){
	int mi=0,ret=0;
	FOR(i,1,n)if(i&1){
		if(lim<=s[1][i]-s[0][i]-mi)
			mi=min(mi,s[1][i+1]-s[0][i+1]),ret=i==n;
	}return ret;
}
int main(){
	scanf("%d",&n);
	FOR(i,1,n) scanf("%d",&a[i]),s[i&1][i]=a[i];
	FOR(i,1,n) s[0][i]+=s[0][i-1],s[1][i]+=s[1][i-1];
	if(!(n&1)) return cout<<max(s[0][n],s[1][n])<<' '<<min(s[0][n],s[1][n])<<'\n',0;
	L=0,R=s[1][n];
	while(L<R){
		int md=(L+R+1)>>1;
		chk(md)?L=md:R=md-1;
	}
	cout<<s[0][n]+L<<' '<<s[1][n]-L<<'\n';
}

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

int main(){
  int height[10];
  for(int i = 0; i < 10; i++)
    cin >> height[i];
  sort(height, height + 10);
  cout << height[9] << endl;
  cout << height[8] << endl;
  cout << height[7] << endl;
}

Measured memory_bytes: 1176
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl

#define all(x) x.begin(),x.end()
typedef pair<int,int> P;
typedef pair<int,P> PP;
int kesu[100000];
int n,m;
int ans;
int zen[100000];
int x[100006];
vector<int> hai[100000];
int main()
{
	cin>>n>>m;
	rep(i,n)
	{
		cin>>x[i];
		hai[(x[i]%m)].push_back(x[i]);
	}
	rep(i,m)
	{
		sort(hai[i].begin(),hai[i].end());
	}
	int kk;
	rep(i,m)
	{
		kk=hai[i].size();
		zen[i]=kk;
		rep(j,kk-1)
		{
			if(hai[i][j]==hai[i][j+1])
			{
				kesu[i]++;
				j++;
			}
		}
	}
	ans+=(zen[0]/2);
	if(m%2==0)
	{
		ans+=(zen[m/2]/2);
	}
	rep2(i,1,(m+1)/2)
	{
		if(zen[i]<zen[m-i])
		{
			ans+=zen[i];
			zen[m-i]-=zen[i];
			ans+=min(zen[m-i]/2,kesu[m-i]);
		}
		else
		{
			ans+=zen[m-i];
			zen[i]-=zen[m-i];
			ans+=min(zen[i]/2,kesu[i]);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 6528
#include<iostream>
#include <algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<queue>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;

const int mod = 1000000007;
struct mint {
  ll x;

  mint(ll x=0):x((x%mod+mod)%mod){}

  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

int main() {
  int N;
  cin >> N;
  vector<ll> C(N);
  rep(i,N) cin >> C[i];

  sort(C.begin(), C.end(), greater<>());  
  mint sum = 0;
  mint base = 1;
  rep(i,N-1) base *= 2;
  rep(i,N) {    
    mint d = base + mint(i)*base/2;
    mint c = C[i];
    sum += c * d;
  }
  mint n = 1;
  rep(i,N) n *= 2;
  mint ans = sum*n;  
  cout << ans.x << endl;
  return 0;
}


Measured memory_bytes: 1792
def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10 ** 7)

    a = int(readline())
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9096
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<ll,ll,ll> T;
const long long INF = 1LL<<60;
const int MOD = 1000000000+7;
#define rev(s) (string((s).rbegin(), (s).rend()))
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
// cout << fixed << setprecision(10) << ans << endl;
// *min_element(c + l, c + r) *max_element(c + l, c + r)
// int dx[8]={1,1,0,-1,-1,-1,0,1};
// int dy[8]={0,1,1,1,0,-1,-1,-1};
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
// struct Edge {
//   int to, id;
//   Edge(int to, int id): to(to), id(id) {}
// };

int main() {
  int H,W;cin>>H>>W;
  vector<string> maze(H);
  rep(i,H) cin>>maze[i];
  int mx = 0;
  rep(i,H) {
    rep(j,W) {
      if(maze[i][j]=='#') continue;
      vector<vector<int>> dist(H,vector<int>(W,0));
      vector<vector<bool>> done(H,vector<bool>(W,false));
      queue<P> qu;
      qu.push(P(i,j));
      done[i][j] = true;
      while(!qu.empty()) {
	int y = qu.front().first, x = qu.front().second;
	qu.pop();
	rep(k,4) {
	  int ny = y + dy[k], nx = x + dx[k];
	  if(ny < 0 || ny >= H || nx < 0 || nx >= W) continue;
	  if(maze[ny][nx] == '.' && !done[ny][nx]) {
	    done[ny][nx] = true;
	    dist[ny][nx] = dist[y][x] + 1;
	    qu.push(P(ny,nx));
	  }
	}
      }
      int cnt = 0;
      rep(a,H) {
	rep(b,W) {
	  cnt = max(cnt,dist[a][b]);
	}
      }
      mx = max(mx,cnt);
    }
  }
  cout<<mx<<endl;
}

Measured memory_bytes: 3640
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <unordered_map>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <cstring>
#include <cmath>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for(int i = (int)(n-1); i > -1; i--)


ull MOD = 1000000007;

int main(){
    ll a,b,k;
    cin >> a >> b >> k;
    if( k > a){
        cout << 0 << " " <<  max(0ll, b-(k-a)) << endl;
    } else{
        cout << a-k << " " << b << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define se second
#define fi first
#define ll long long int
#define INF INT_MAX
#define mod
#define chutiyaap ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
int main()
{
    chutiyaap;
    double r;cin>>r;
    double res=(2.0)*r*(3.14);
    cout<<fixed<<setprecision(10)<<res;
}

Measured memory_bytes: 3800
# 0-indexed
class SegTree:
    def __init__(self, vals, seg_f, ide_ele):
        n = len(vals)
        self.seg_f = seg_f
        self.ide_ele = ide_ele
        self.leaf_n = 1 << (n-1).bit_length()
        self.tree = [ide_ele]*(2*self.leaf_n-1)
        for i in range(n):  # init leaf
            self.tree[i+self.leaf_n-1] = vals[i]
        for i in range(self.leaf_n-2, -1, -1):  # bottom-up
            self.tree[i] = self.seg_f(self.tree[2*i+1], self.tree[2*i+2])

    def update(self, i, x):
        i += (self.leaf_n-1)
        self.tree[i] = x
        while i > 0:
            i = (i-1)//2
            self.tree[i] = self.seg_f(self.tree[2*i+1], self.tree[2*i+2])

    # [l,r)
    def query(self, l, r):
        v_l = self.ide_ele
        v_r = self.ide_ele
        l += (self.leaf_n-1)
        r += (self.leaf_n-1)
        while l < r:
            if l&1 == 0:
                v_l = self.seg_f(v_l, self.tree[l])
            if r&1 == 0:
                v_r = self.seg_f(v_r, self.tree[r-1])
                r -= 1
            l >>= 1
            r >>= 1
        return self.seg_f(v_l ,v_r)



n,x = map(int, input().split())
al = list(map(int, input().split()))

st = SegTree(al, min, 10**18)
ans = 10**18
for i in range(0,n): # move cnt
    curr_i_ans = i*x
    for j in range(n): # ind
        l = j-i
        if l >= 0:
            amin = st.query(l,j+1)
        else:
            amin1 = st.query(0,j+1)
            amin2 = st.query(l+n,n)
            amin = min(amin1,amin2)
        curr_i_ans += amin
    ans = min(ans, curr_i_ans) 
print(ans)

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

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

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

int main(void){
  int n;
  cin >> n;
  int n1 = n/100;
  int n2 = n%10;
  if(n1 == n2){
    cout << "Yes" << '\n';
  }
  else{
    cout << "No" << '\n';
  }
}


Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var nums = cin.ReadLongArray(4);
            var A = nums[0];
            var B = nums[1];
            var C = nums[2];
            var D = nums[3];
            var muls = countMuls(A, B, C) + countMuls(A, B, D) - countMuls(A, B, C * D / gcd(C, D));
            Console.WriteLine(B - A + 1 - muls);
        }

        static long countMuls(long a, long b, long k)
        {
            return b / k - (a - 1) / k;
        }

        static long gcd(long a, long b)
        {
            return b == 0 ? a : gcd(b, a % b);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}


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

int main() {
    string s;
    cin >> s;
    if(s == "SAT") cout << "1" << endl;
    if(s == "FRI") cout << "2" << endl;
    if(s == "THU") cout << "3" << endl;
    if(s == "WED") cout << "4" << endl;
    if(s == "TUE") cout << "5" << endl;
    if(s == "MON") cout << "6" << endl;
    if(s == "SUN") cout << "7" << endl;

}

Measured memory_bytes: 256
N = int(input())
ss = {}
ht = []
ans = 0

for i in range(N):
    s = ''.join(sorted(input()))
    if not s in ss.keys():
        ss[s] = 1
    else:
        ss[s] += 1
        
for i in ss.keys():
    if ss[i] > 1:
        ans += int((ss[i]*(ss[i]-1))/2)

print(ans)

Measured memory_bytes: 17852
a,b,k=map(int, input().split())
turn=0
while(k>0):
    if turn==0:
        if a%2==1:
            a-=1
        b+=a/2
        a//=2
        turn=1
    else:
        if b%2==1:
            b-=1
        a+=b/2
        b//=2
        turn=0
    k-=1

print("{} {}".format(int(a),int(b)))

Measured memory_bytes: 3064
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

N,M = [int(i) for i in input().split()]

if N >= 2 and M >= 2:
    ans = cmb(N,2) + cmb(M,2)
elif N <= 1 and M >=2:
    ans = cmb(M,2)
elif M <= 1 and N >=2:
    ans = cmb(N,2)
else:
    ans = 0


print(int(ans))

Measured memory_bytes: 3064
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define pb push_back
#define F first
#define S second
#define ins insert
#define mp make_pair
#define bit __builtin_popcount
#define md (l + ((r - l) / 2))
#define all(x) x.begin(),x.end()
//#define all(x , n) x+1,x+n+1
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define sz(x) (int)x.size()
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;


using ll = long long;

//#define int ll

const int N = 5000+54, mod = 1e9 + 7, mod1 = 998244353;
const int MAX = 1e5 + 11 , T = 2000;
const int INF1 = 2e9 + 11;
const ll INF2 = 2e18 + 11;
const long double INF3 = 1e8 + 11;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const int LOG = 20;
const double EPS = 1e-4;
const double PI = acos(-1.0);

template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }


typedef pair <int, int> pii;        // #include <ext/pb_ds/assoc_container.hpp>
typedef pair <ll, ll> pll;         // #include <ext/pb_ds/tree_policy.hpp>
typedef vector <int> vi;          // #include <ext/rope>
                // #include <ext/rope>
                                 // #include <ext/rope>
bool prime(int n) {             // template<typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
    for(int i=2;i<=sqrt(n);i++){
        if(n%i==0){return 0;}
    }return 1;}
bool query = 0;
ll bp(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
///////////////////////////////////////////////////////////


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

/*
*/

main() {
    ios;
    int tt = 1;
    if(query)
        cin >> tt;
    while(tt --) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3592
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;


int main(){
    int n,c;
    scanf("%d %d",&n,&c);
    int chan[c+1][100001];
    int i,j,k;
    for(i=0;i<=c;i++)for(j=0;j<=100000;j++)chan[i][j]=0;
    for(k=1;k<=n;k++){
        int sh,th,ch;
        scanf("%d %d %d",&sh,&th,&ch);
        for(i=sh;i<=th;i++)chan[ch][i]=1;
    }
    
    int ans=0;
    for(i=1;i<=100001;i++){
        int k=0;
        for(j=1;j<=c;j++){
            if(chan[j][i]==1)k++;
        }
        if(k>ans)ans=k;
    }
    printf("%d",ans);
    
    return 0;
    
}

Measured memory_bytes: 12288
import math
A =[]
for i in range(5):
    A.append(int(input()))

m = 11
index = 0
for i,a in enumerate(A):
   if a%10!=0 and m > a%10:
       index = i
       m = a % 10

temp = A[index]
del A[index]

A = list(map(lambda x:math.ceil(x/10)*10,A))

print(sum(A)+temp)


Measured memory_bytes: 3060
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner scan = new Scanner(System.in);

		int r = scan.nextInt();
		int g = scan.nextInt();
		int b = scan.nextInt();

		int sum = r * 100 + g * 10 + b;

		if (sum % 4 == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	//***********************以下共通関数************************************************
	/**
	 * 文字列を反転して返す
	 * @param pStr 文字列
	 * @return 反転した文字列
	 */
	public static String myReverse(String pStr) {
		if (pStr.length() < 1) {
			return "";
		}

		StringBuffer sb = new StringBuffer(pStr);
		return sb.reverse().toString();
	}

	/**
	 * 余りを求める。
	 * @param a
	 * @param b
	 * @return 余り。余りがマイナスの時はプラスで返す。
	 */
	public static long myMod(long a, long b) {
		long ret = 0;

		ret = a % b;

		if (ret < 0) {
			ret += b;
		}

		return ret;
	}

	/**
	 * 乗数を求める ※mod対応
	 * @param kisu 基数
	 * @param josu 乗数
	 * @param primeNumMod_0 法 mod値 使わない場合は「0」
	 * @return
	 */
	public static long myPowWithMod(long kisu, long josu, long primeNumMod_0) {

		long ans = 1;

		//乗数が0の場合→1
		if (josu == 0)
			return 1;

		if (primeNumMod_0 == 0) {
			//modを使わないとき

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= kisu;
					josu = josu / 2;
				} else {
					//累乗が奇数の時
					ans *= kisu;
					josu--;
				}
			}

			return ans;

		} else {
			//modを使うとき

			//初めに桁を落とす
			kisu = myMod(kisu, primeNumMod_0);

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= myMod(kisu, primeNumMod_0);
					josu = josu / 2;

				} else {
					//累乗が奇数の時
					ans *= myMod(kisu, primeNumMod_0);
					josu--;

				}
			}

			return myMod(ans, primeNumMod_0);

		}

	}

}


Measured memory_bytes: 27008
#include<iostream>
#include<string>
using namespace std;
int main(){
  string a, b;
  cin >> a >> b;
  int c = stoi(a+b);
  for (int i=1;i<1000;i++){
    if (i*i == c){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ri register int
const int maxn=3e3+5,mod=1e9+7;
long long f[maxn][maxn][2];
long long n,m;
inline int maxx(int x,int y) {return x>y?x:y;}
inline int minn(int x,int y) {return x<y?x:y;}
int main(){
	scanf("%lld%lld",&n,&m);
	
	for(ri i=1;i<=n;i++) f[0][i][0]=1;
	f[0][0][1]=1;
	
	for(ri i=0;i<m;i++)
	  for(ri j=0;j<=n;j++){
	  		f[i][j][0]%=mod;
	  		f[i][j][1]%=mod;
	    	if(j>=1){
	    		if(j==1) f[i+1][j-1][1]+=f[i][j][0];
	    		else f[i+1][j-1][0]+=f[i][j][0];
	    		f[i+1][j-1][1]+=f[i][j][1];
	    		if(j==1) f[i+1][j][1]+=f[i][j][0];
	    		else f[i+1][j][0]+=f[i][j][0];
	    		f[i+1][j][1]+=f[i][j][1];
			}
			if(j<n){
				f[i+1][j+1][0]+=f[i][j][0];
				f[i+1][j+1][1]+=f[i][j][1];
				f[i+1][j][0]+=f[i][j][0];
				f[i+1][j][1]+=f[i][j][1];
			}
		}
		
	long long ans=0;
	for(ri i=0;i<=n;i++) ans+=f[m][i][1],ans%=mod;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 144460
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <stack>
#include <cstring>
#include <iomanip>
#include <ctime>
#include <cassert>
using namespace std;
#define REP(i,a,b) for(int (i)=(a);(i)<=(b);++i)
#define PER(i,a,b) for(int (i)=(a); (i)>=(b);--i)
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)((x).size()))
#define ALL(t) t.begin(),t.end()
#define clr(x) memset(x,0,sizeof(x))
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long double ld;
#define DBG(vari) cout<<"["<<__LINE__<<"] "<<#vari<<" = "<<(vari)<<endl;
template<class T> ostream &operator<<(ostream &os, vector<T> V){ os<<"[";for(auto vv:V)os<<vv<<",";return os<<"]"; } 
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) { return os<<"("<<P.fi<<","<<P.se<<")"; }
#define flash ios_base::sync_with_stdio(0);
#define read freopen("1.in","r",stdin);
#define write freopen("1.out","w",stdout);
inline bool EQ(ld a,ld b) {return fabs(a-b)<=(1e-7);}
const ll mod=(1e9+7);
const ld pi=(acos(-1));
//CUT BEGINS

int main() {
	flash; bool flag=0;
	int n; cin>>n;
	ll ans=0,w[n+5][n+5],imp[n+5][n+5]; clr(w),clr(imp);
	REP(i,1,n) REP(j,1,n) cin>>w[i][j];
	REP(k,1,n) REP(i,1,n) REP(j,1,n) if(w[i][j]>w[i][k]+w[k][j]) flag=1;
	if(flag) {
		cout<<-1; return 0;
	}
	REP(k,1,n) REP(i,1,n) REP(j,1,n) if(k!=i&&k!=j&&w[i][j]==w[i][k]+w[k][j]) imp[i][j]=1;
	REP(i,1,n) REP(j,1,n) if(!imp[i][j]) ans+=w[i][j];
	cout<<ans/2;
	return 0;
}

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

#ifdef DEBUG
#include "../.inc/debug.hpp"
#else
#define debug(...) 42
#define rdfile(...) 42
#endif

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    // rdfile("_input.txt");

    int n;
    cin >> n;

    vector<int> lis(n, -1);
    int a;
    for (int i=0; i<n ; ++i) {
        cin >> a;
        int k = lower_bound(lis.begin(), lis.end(), a) - lis.begin();
        lis[k-1] = a;
    }

    int col = 0;
    for (int i=n-1; i>=0; --i) {
        if (lis[i] != -1) {
            col ++;
            continue;
        }
        break;
    }
    cout << col << endl;

    return 0;
}

Measured memory_bytes: 640
//
// Created by kapildd on 12/23/17.
//

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

int main() {
    long long x, y;
    cin>>x>>y;
    int c=0;
    while(x>=0 && x<=y) {
        x *= 2;
        c++;
    }
    cout << c << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String str = reader.readLine();
			Dice dice = new Dice(str);
			str = reader.readLine();
			int q = Integer.parseInt(str);

			for (int i = 0; i < q; i++) {
				str = reader.readLine();
				String[] face = str.split(" ");

				int j = 0;
				int k = 0;
				for (j = 0; j < 6; j++) {
					if (face[0].equals(dice.getFace(j))) {
						break;
					}
				}
				switch (j) {
				case 0:
					break;
				case 1:
					dice.moveN();
					break;
				case 2:
					dice.moveW();
					break;
				case 3:
					dice.moveE();
					break;
				case 4:
					dice.moveS();
					break;
				case 5:
					dice.moveN();
					dice.moveN();
					break;
				}
				for (k = 1; k < 5; k++) {
					if (face[1].equals(dice.getFace(k))) {
						break;
					}
				}
				int right = 0;
				switch (k) {
				case 1:
					right = 2;
					break;
				case 2:
					right = 4;
					break;
				case 3:
					right = 1;
					break;
				case 4:
					right = 3;
					break;
				}
				System.out.println(dice.getFace(right));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

class Dice {
	private String face[];
	private String tmp;
	
	Dice (String str) {
		this.face = new String[6];
		this.face = str.split(" ");
	}

	public String getFace(int n) {
		return this.face[n];
	}
	
	public void moveN() {
		tmp = this.face[0];
		this.face[0] = this.face[1];
		this.face[1] = this.face[5];
		this.face[5] = this.face[4];
		this.face[4] = tmp;
	}
	
	public void moveE() {
		tmp = this.face[0];
		this.face[0] = this.face[3];
		this.face[3] = this.face[5];
		this.face[5] = this.face[2];
		this.face[2] = tmp;
	}
	
	public void moveW() {
		tmp = this.face[0];
		this.face[0] = this.face[2];
		this.face[2] = this.face[5];
		this.face[5] = this.face[3];
		this.face[3] = tmp;
	}
	
	public void moveS() {
		tmp = this.face[0];
		this.face[0] = this.face[4];
		this.face[4] = this.face[5];
		this.face[5] = this.face[1];
		this.face[1] = tmp;
	}
}

Measured memory_bytes: 24328
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    d = collections.defaultdict(list)
    n = int(input().rstrip('\n'))
    for i in range(n):
        s = collections.Counter(str(input().rstrip('\n')))
        for k, v in s.items():
            d[k] += [v]
    ans = []
    for k, v in d.items():
        if len(v) == n:
            ans.append(k * min(v))
    ans.sort()
    print("".join(ans))


if __name__ == '__main__':
    slove()


Measured memory_bytes: 39152
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string input;
	cin >> input;
	if (input == "Sunny") {
		cout << "Cloudy";
	}
	else if (input == "Cloudy") {
		cout << "Rainy";
	}
	else {
		cout << "Sunny";
	}
}

Measured memory_bytes: 256
from sys import stdin


def main():
    N, A, B = [int(x) for x in stdin.readline().rstrip().split()]
    total = 0
    for i in range(1, N + 1):
        sum_ = sum([int(x) for x in str(i)])
        if A <= sum_ <= B:
            total += i
    print(total)


if __name__ == "__main__":
    main()


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

using namespace std;

int main(){
    int n, res;
    cin >> n;
    res=n;
    int a[n];
    for(int i=0; i<n; i++)
        cin >> a[i];
    sort(a, a+n);
    for(int i=0; i<n-1; i++){
        if(a[i]==a[i+1]) res--;
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;

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

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

	long long int sum = 0;
	for(int i = 0; i < N; i++) sum += A[i];

	// 重複なしの自動ソート
	set<long long int> c;

	// 約数を求める
	for(int i = 1; i*i <= sum; i++)
	{
		if(sum % i == 0)
		{
			c.insert(i);
			c.insert(sum / i);
		}
	}

	long long int ans = 1;
	
	// 整数列を操作して、最大公約数をxにできるかどうか
	for(long long int x : c)
	{
		long long int need; //操作回数
		vector<long long int> r(N);
		// 各要素を何回操作したらxの倍数になるか
		for(int i = 0; i < N; i++) r[i] = A[i] % x;
		// -1する側と+1する側を分けるためにソート
		sort(r.begin(), r.end());
		// プラスする側
		long long int b = 0;
		for(int i = 0; i < N; i++) b += x - r[i];
		// プラス側とマイナスする側の区切りを一つずつ確かめる
		long long int a = 0;
		need = 1e18;
		for(int i = 0; i < N; i++)
		{
			a += r[i];
			b -= x-r[i];
			need = min(need, max(a, b));
		}
		if(need <= K) ans = max(ans, x);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner stdIn= new Scanner(System.in);
        long x = stdIn.nextLong();
        long a=100;
        int y=0;
        for(;a<x;y++){
            a+=a/100;
        }
        System.out.println(y);
    }
}


Measured memory_bytes: 35860
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <stack>
#include <set>
#include <bitset>
#include <functional>
#include <cassert>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVSORT(v) sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int gcd(int a,int b){return b?gcd(b,a%b):a;}

ll modpow(ll n,ll k){
  if(k == 1){
    return n;
  }else if(k == 0){
    return 1;
  }else if(k%2==0){
    ll memo = modpow(n,k/2)%MOD;
    return memo*memo%MOD;
  }else{
    return n * modpow(n,k-1)%MOD;
  }
}

int main(){

  int ans = 1;
  REP(i,5){
    int t;
    cin>>t;
    if(t==0){
      ans = i+1;
    }
  }
  cout<<ans<<endl;

 

  return 0;
}

Measured memory_bytes: 3164
#include <iostream>
using namespace std;
int main(){
    int N, A[110];
    double cnt = 0;
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    for(int i = 0; i < N; i++){
        cnt = cnt + 1 / (double)A[i];
    }
    cout << (1 / cnt) << endl;

    return 0;
}

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

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define debug(i) cout << i << endl;
#define debugarr(a) for(auto i : a) cout << i << " ";

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int,int>
#define pll pair<ll, ll>
#define vpi vector<pi>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);

    ll a, b;

    cin >> a >> b;

    ll menor = min(a, b);
    ll maior = max(a, b);

    ll ans = -1;

    ll l = menor;
    ll r = maior;

    while(l <= r) {
        ll mid = (l+r)>>1;
        if(abs(a - mid) == abs(b - mid)) {
            cout << mid << endl;
            return 0;
        }else if(abs(mid - menor) > abs(mid - maior)) {
            l = mid + 1;
        }else {
            r = mid - 1;
        }
    }

    cout << "IMPOSSIBLE" << endl;
}


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

int N,K;
vector<vector<int> > G(2020);
const int INF=INT_MAX/2;

vector<int> bfs(int v){
  vector<int> res(N,INF);
  res[v]=0;
  queue<int> q;
  q.push(v);
  while(!q.empty()){
    int u=q.front(); q.pop();
    for(auto s:G[u]) if(res[s]+1>res[u]){
      res[s]=res[u]+1;
      q.push(s);
    }
  }
  return res;
}

int main(){
  cin>>N>>K;
  rep(i,N-1){
    int a,b; cin>>a>>b; a--,b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  vector<int> cnt(N,0);
  // R[i]:頂点iを削除することにより，cntが減る頂点
  vector<vector<int> > R(N);
  rep(i,N){
    vector<int> d=bfs(i);
    rep(j,N) if(d[j]>K){
      cnt[i]++;
      R[i].push_back(j);
    }
  }
  int ans=0;
  while(1){
    auto it=max_element(cnt.begin(),cnt.end());
    if(*it==0){
      break;
    }
    int v=it-cnt.begin();
    cnt[v]=0;
    for(auto u:R[v]){
      cnt[u]--;
    }
    R[v].clear();
    ans++;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 16512
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 998244353;
const ll LINF = 1e18;
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <typename T>
struct SegmentTree {
    int n;
    vector<T> node;
    T calc(T a, T b) {
        return a + b;
        // return min(a, b);
        // return max(a, b);
    }
    T e = 0;
    SegmentTree(vector<T> v) {
        int sz = v.size();
        n = 1;
        while (n < sz) {
            n *= 2;
        }
        node.resize(2 * n - 1, e);
        for (int i = 0; i < sz; i++) {
            node[i + n - 1] = v[i];
        }
        for (int i = n - 2; i >= 0; i--) {
            node[i] = calc(node[2 * i + 1], node[2 * i + 2]);
        }
    }
    SegmentTree(T sz) {
        n = 1;
        while (n < sz) {
            n *= 2;
        }
        node.resize(2 * n - 1, e);
    }
    void update(int x, T val) {
        x = n + x - 1;
        node[x] = val;
        while (x > 0) {
            x = (x - 1) / 2;
            node[x] = calc(node[2 * x + 1], node[2 * x + 2]);
        }
    }
    void add(int x, T val) {
        x = n + x - 1;
        node[x] += val;
        while (x > 0) {
            x = (x - 1) / 2;
            node[x] = calc(node[2 * x + 1], node[2 * x + 2]);
        }
    }
    T query(int a, int b, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = n;
        if (r <= a || b <= l) return e;
        if (a <= l && r <= b) return node[k];
        T vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
        T vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
        return calc(vl, vr);
    }
    T at(int x) {
        return node[n + x - 1];
    }
};
int main() {
    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    SegmentTree<ll> segt(a);
    vector<ll> v;
    for (int l = 0; l < n; l++) {
        for (int r = l; r < n; r++) {
            v.push_back(segt.query(l, r + 1));
        }
    }

    vector<ll> w;
    rrep(i, 60) {
        int cnt = 0;
        for (ll x : v) cnt += x >> i & 1;
        if (cnt < k) continue;
        for (ll x : v) {
            if (x >> i & 1) w.push_back(x);
        }
        v.clear();
        for (ll x : w) v.push_back(x);
        w.clear();
    }
    ll ans = v[0];
    rep(i, k) ans &= v[i];
    cout << ans << endl;
}


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

#define MAX_N 100000000

// int N = 3;
// int s[] = {8, 12, 40};

int N;
int s[MAX_N];

int main() {
    cin >> N;
    rep(i, N) {
        cin >> s[i];
    }

    int result = 0;
    int flag = true;
    while (flag) {
        rep(i, N) {
            if (s[i] % 2 == 0) {
                s[i] = s[i] / 2;
            } else {
                flag = false;
                break;
            }
        }

        if (flag) {
            result++;
        }
    }

    cout << result << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long N;
  long long min,max,sum;
  //vector<vector<int>> A(n, vector<int>(m, 0));
  double a,b,C;

  cin >> a >> b >> C;
  double radC = C * acos(-1) / 180.0;
  
  double S = sin(radC) * a * b / 2;
  cout << std::fixed << std::setprecision(6) << S << endl;
  
  double L;
  if(C != 90) L = sqrt(pow(a, 2.0) + pow(b, 2.0) - (2 * a * b * cos(radC)));
  else L = sqrt(pow(a, 2.0) + pow(b, 2.0));
  cout << std::fixed << std::setprecision(6) << a + b + L << endl;
  
  double h = b * sin(radC);
  cout << std::fixed << std::setprecision(6) << h << endl;
}


Measured memory_bytes: 3584
#include<iostream>
#include<vector>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define arep(i, c) for (auto i = (c).begin(); i != (c).end(); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    vector<int> H(N);
    rep(i, 0, N) cin >> H[i];
    int ans = 0;
    rep(i, 0, N) {
        if (H[i] >= K) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640