akhauriyash/Code-Regression huggingface dataset:
using System;

using System.Linq;

namespace atcoder_nomura
{
    public class Postdocs
    {
        public static void Main(string[] args) 
        {
            string input = Console.ReadLine();

            string inputpd = input.Replace("?", "D");

            Console.WriteLine(inputpd);
            //Console.WriteLine(PD(inputpd));


        }

        public static int PD(string s) {
            int pd = CountOf(s, "D","PD");
            return pd;
        }
        public static int CountChar(string s, char c)
        {
            return s.Length - s.Replace(c.ToString(), "").Length;
        }

        public static int CountOf(string target, params string[] strArray)
        {
            int count = 0;

            foreach (string str in strArray)
            {
                int index = target.IndexOf(str, 0);
                while (index != -1)
                {
                    count++;
                    index = target.IndexOf(str, index + str.Length);
                }
            }

            return count;
        }
    }
}


Measured memory_bytes: 29108
#include <iostream>
#include <climits>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); ++i)
#define rep(i,n) REP(i,0,n)
#define DEB 0

/*
  êxsÁ½Æ±ëÍ¢©È¢H
  ³µ¢[v@@X^[gÆIªê
  (x,y)©çX^[gµÄA³µ¢[vÉÈçÈ©Á½
  @ÙÈé}X©ç(x,y)É«½êÍA²×éKv è
  (x,y)©çX^[gµÄA³µ¢[vÉÈÁ½
  @²×éKvÍÈ¢AâÎÉÙÈé
 */

int n;
pair<int,int> jump[110][110];
bool used[110][110];
int memo[110][110];

int dfs(int x, int y, int sx, int sy){
  if( memo[y][x]==1 ) return 2;
  if( used[y][x] ){
    if( x==sx && y==sy ) return 1;
    return 2;
  }
  used[y][x] = true;
  return dfs(jump[y][x].first, jump[y][x].second, sx, sy);
}
int main(){
  while(cin>>n,n){
    rep(i,n){
      rep(j,n){
	int x,y; cin>>x>>y;
	jump[i][j].first = x;
	jump[i][j].second = y;
      }
    }
#if DEB
    rep(i,n){
      rep(j,n){
	printf("%d,%d ",jump[i][j].first, jump[i][j].second);
      }
      puts("");
    }
    puts("");
#endif	

    int ret = 0;
    memset(memo,0,sizeof(memo));

    rep(i,n)rep(j,n)if( !memo[i][j] ){
      memset(used,false,sizeof(used));
      if( dfs(j,i,j,i)==1 ){
	memo[i][j] = 1;
	ret++;
      }
    }
    cout << ret << endl;
  }
  return 0;
}

Measured memory_bytes: 1016
x1,y1,x2,y2 = map(int,input().split())
ax = x2 - x1
ay = y2 - y1

x3 = x2 - ay
y3 = y2 + ax

x4 = x1 - ay
y4 = y1 + ax

print(x3,y3,x4,y4)

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

int main() {
	// your code goes here
	int n;
	cin>>n;
	int arr[n];
	for(int i=0;i<n;i++)
	cin>>arr[i];
	int first=INT_MIN,second=INT_MIN;
	for(int i=0;i<n;i++){
		if(arr[i]>first){
			second=first;
			first=arr[i];
		}
		else if(arr[i]<=first&&arr[i]>=second){
			second=arr[i];
		}
	}
	for(int i=0;i<n;i++){
		if(arr[i]==first)
		cout<<second<<" ";
		else
		cout<<first<<" ";
	}
	return 0;
}

Measured memory_bytes: 2432
<?php
fscanf(STDIN,"%s",$s);
$result = "No";
for($i = 1; $i < 10; $i++)
{
  for($j = 1; $j < 10; $j++)
  {
    if($i*$j == $s)
    {
      $result = "Yes";
      break 2;
    }
  }
}

echo($result);

Measured memory_bytes: 3828
#include "bits/stdc++.h"
using namespace std;
typedef long long lint;
#define MAXN 200010
#define rep(i,n) for(int i=0;i<(n);++i)

vector<int> ma[MAXN];

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

	int h,w,n;cin>>h>>w>>n;
	int x,y;
	rep(i,n){
		cin>>x>>y;--x;--y;
		if(x==1&&y==0){
			cout<<1<<endl;getchar();getchar();return 0;
		}
		ma[x].push_back(y);
	}x=0,y=0;
	rep(j,h){
		++y;
		bool R_movable=1;
		for(int &i:ma[y]){
			if(i<=x){
				cout<<y<<endl;
				getchar();
				getchar();return 0;
			}if(i==x+1){
				R_movable=0;
			}
		}if(R_movable){
			++x;
		}
	}cout<<h<<endl;
	getchar();
	getchar();
	return 0;
}

Measured memory_bytes: 11264
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define int long long int
#define FILEIO  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); 
#define maxn 1000000
 

using namespace std;

int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a);}

signed main() {
//FILEIO;
ios::sync_with_stdio(false);
cin.tie(0);
cout.precision(10);
cout << fixed;
string s , t;
cin>>s>>t;
int len = s.length();
int ans  = 0;
for (int i = 0; i < len; ++i)
{
    /* code */
    if(s[i] != t[i])
        ans++;
}
cout<<ans;










    return 0;
}


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

int main()
{
   int a,b,c;
   cin>>a>>b>>c;
   
   if(a!=b && b!=c && a!=c || a==b && b==c )
   {
       cout<<"No";
   }
   
   else
   {
       cout<<"Yes";
   }
   

	return 0;
}

Measured memory_bytes: 256
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let s: Vec<char> = sc.chars();
    let mut k: i64 = sc.cin();
    let mut i = 0;
    loop {
        if k == 1 {
            put!(s[i]);
            return;
        } else if s[i] == '1' && k > 1 {
            i += 1;
            k -= 1;
        }
        else if s[i] != '1' && k >= 1 {
            put!(s[i]);
            return;
        }
        else if i == s.len() - 1 {
            put!(s[i]);
            return;
        }
    }
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> { self.cin::<String>().chars().collect() }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> { (0..n).map(|_| self.cin()).collect() }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define sqr(x) ((x) * (x))
#define bit(n) (1LL<<(n))
#define pcnt(x) __builtin_popcountll(x)
#define PB push_back
#define MP make_pair
#define endl "\n"
using Edge = pair<int,int>;
using Graph = vector<vector<Edge>>;
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;}
// ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int dp[11100];

int main() {
  int n,w; cin >> n >> w;
  FOR(i,0,n-1){
    int val,wei; cin >> val >> wei;
    FOR(j,0,10000-wei){
      chmax(dp[j+wei],dp[j] + val);
    }
  }
  cout << dp[w] << endl;
}



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

#define pii pair<int, int>

using namespace std;

int main(void){
    int n, m;
    cin >> n >> m;
    vector<pii> v(m);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        v[i] = make_pair(a,b);
    }
    sort(v.begin(), v.end());
    
    vector<pii> vp(n);
    for (int i = 0; i < n; i++) vp[i].first = i, vp[i].second = i;
    
    for (int i = 0; i < m; i++) {
        int x = v[i].second;
        vp[x].first = vp[x-1].first;
        vp[x-1].second = vp[x].second;
    }
    for (int i = 0; i < n; i++) {
        cout << vp[i].second - vp[i].first + 1;
        if (i < n-1) cout << " ";
    }
    cout << endl;
}

Measured memory_bytes: 5184
/**
 *    author: apurba_debnath
**/
#include <bits/stdc++.h>


#define ll long long
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;


using namespace std;

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

    string s, t;
    int flag = 0;
    cin >> s >> t;
    for (int i = 0; i < s.length(); ++i) {
        if (s[i] != t[i]) {
            flag = 1;
            break;
        }
    }
    if (flag)
        cout << "No";
    else
        cout << "Yes";

    return 0;
}


Measured memory_bytes: 3608
#include<iostream>
#include<string.h>
#include<cstdio>
using namespace std;
int main()
{
    int n,m,time,flag;
    char s[11];
    cin>>s;
    time=0;
    flag=0;
    n=strlen(s);
    for(int i=0;i<n&&n>3&&n<11;i++)
    {
        int t=(int)s[i];
        /*cout<<"t"<<t;*/
        if((s[i]!='A'&&s[i]!='C'&&t<97)||time>1)
        {
            flag=1;
            break;
        }

        if(s[i]=='C')
        {

            if(i!=n-1&&i>1)
            {
              time++;
              m=i;
            }
            else
              {break;}
        }

    }
    if(s[0]=='A'&&time==1&&flag==0)
    {
        cout<<"AC"<<endl;
    }
    else{cout<<"WA"<<endl;}
    return 0;
}


Measured memory_bytes: 256
S = input()
ans = float('inf')
for s in S:
    T = (S + 'a')[:-1]
    # print(id(S) == id(T))
    cnt = 0
    while T.count(s) < len(T):
        D = []
        for i in range(len(T)-1):
            D.append(s if T[i] == s or T[i+1] == s else T[i])
        T = ''.join(D)
        # print(T)
        cnt += 1
    ans = min(ans, cnt)
print(ans)


Measured memory_bytes: 41516
#include<iostream>
#include<vector>
#include<string>
#include<bitset>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
#include<set>
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int main() {
	int k;
	cin >> k;

	int keta = 0;
	int number = 0;
	while (keta < k) {
		keta++;
		number = number * 10 + 7;
		if (number % k == 0) {
			cout << keta << endl;
			return 0;
		}
		number = number % k;
	}
	cout << -1 << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#ifdef BUG
    #include "debug.hpp"
#else
    #define DEBUG(var)
#endif

using namespace std;
template< class T1, class T2 > inline istream &
operator>>( istream & fin, pair< T1, T2 > & pr )
{ fin >> pr.first >> pr.second; return fin; }
template< class T0, class T1, class T2 > inline istream &
operator>>( istream & fin, tuple< T0, T1, T2 > & t )
{ fin >> get<0>(t) >> get<1>(t) >> get<2>(t); return fin; }
template< class T > inline istream &
operator>>( istream & fin, vector< T > & a ) {
for(auto & u: a) fin >> u; return fin; }
template<class T, size_t n> inline istream &
operator>>( istream & fin, array<T, n> & a ) {
for(auto & u: a) fin >> u; return fin; }
template<class FwdIter> inline auto
dump(FwdIter first, FwdIter last, const char * dlm = " ") -> void {
typedef typename iterator_traits<FwdIter>::value_type value_type;
copy(first, last, ostream_iterator<value_type>(cout, dlm)); }
template<typename T> vector<T> & operator--(vector<T> & a)
{ for(auto & i: a) --i; return a; }
/* @@@ ----------------------------------- */

size_t d004()
{
    size_t n, k;
    cin >> n >> k;
    vector<size_t> a(n);
    cin >> a;
    --a;

    vector<set<size_t>> adj(n);
    for(size_t i = 0; i < n; ++ i)
        adj[a[i]].insert(i);

    const size_t inf = numeric_limits<size_t>::max();
    vector<size_t> dist(n, inf);
    {
        queue<size_t> q;
        dist[0] = 0;
        for(q.push(0); !q.empty(); q.pop())
        {
            const auto u = q.front();
            for(const auto i: adj[u])
                if(dist[u] + 1 < dist[i])
                {
                    dist[i] = dist[u] + 1;
                    q.push(i);
                }
        }
    }

    typedef pair<size_t, size_t> value_t;
    priority_queue<value_t, vector<value_t>, less<value_t>> heap;
    for(size_t i = 0; i < n; ++i)
        if(k < dist[i])
            heap.emplace(dist[i], i);

    size_t out = 0;

    while(!heap.empty())
    {
        const auto pr = heap.top();
        heap.pop();

        if(dist[pr.second] != pr.first || dist[pr.second] < k + 1)
            continue;

        // install a shortcut at furthest node possible
        size_t u = pr.second;
        for(size_t i = 0; i + 1 < k; ++i)
            u = a[u];

        ++ out;
        a[u] = 0;
        adj[a[u]].erase(u);
        adj[0].insert(u);

        dist[u] = 1;
        queue<size_t> q;

        for(q.push(u); !q.empty(); q.pop())
        {
            const auto v = q.front();
            if(k < dist[v])
                heap.emplace(dist[v], v);

            for(const auto i: adj[v])
                if(dist[v] + 1 < dist[i])
                {
                    dist[i] = dist[v] + 1;
                    q.push(i);
                }
        }

    }

    return out + (a[0] ? 1 : 0);
}

int main(const int argc, char * argv [])
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cout << d004();

    return EXIT_SUCCESS;
}


Measured memory_bytes: 17476
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
const int MOD=1e9+7;
const int INF=2e9;


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


    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    vector<int> dp(n,INF);
    rep(i,n) {
        int j=lower_bound(dp.begin(),dp.end(),a[i])-dp.begin();
        dp[j]=a[i];
    }
    int ans=0;
    rep(i,n) {
        if (dp[i]!=INF) ans=i;
    }
    cout << ans+1 << endl;
    

    return 0;   
}



Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main(){
int a = 0, b = 0;
int in;
for(int i = 0; i < 8; i++){
cin >> in;
if(i < 4) a += in;
else b += in;
}
cout << max(a, b) << endl;
return 0;
}


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<string>> vvs;
typedef vector<vector<char>> vvc;
typedef vector<vector<bool>> vvb;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define vrep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
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; }

const int mod = 1000000007;
const int inf = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

ll fac[4004], inv[4004], finv[4004];

void SetTable(){
    fac[0] = fac[1] = 1;
    inv[1] = 1;
    finv[0] = finv[1] = 1;
    for(int i = 2 ; i <= 4002; i++){
        fac[i] = (fac[i-1]*i)%mod;
        inv[i] = mod - (inv[mod%i])*(mod/i)%mod;
        finv[i] = (finv[i-1]*inv[i])%mod;
    }
}

ll com(ll n, ll k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return (((fac[n] * finv[k])%mod)*finv[n-k])%mod; 
}

int main(){
    SetTable();
    int n, k;
    cin >> n >> k;
    srepn(i,1,k) cout << com(n-k+1, i) * com(k-1,i-1) % mod << endl;
}

Measured memory_bytes: 384
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
namespace lc {
template <int MOD>
class ModulusInteger {
public:
	typedef ModulusInteger<MOD> self_type;
private:
	int m_value;
	static self_type unsafe_construct(int x){
		self_type y;
		y.m_value = x;
		return y;
	}
public:
	ModulusInteger()
		: m_value(0)
	{ }
	ModulusInteger(int x)
		: m_value(x % MOD)
	{
		if(m_value < 0){ m_value += MOD; }
	}
	int operator*() const { return m_value; }
	self_type &operator=(const self_type &x){
		m_value = x.m_value;
		return *this;
	}
	self_type operator+(const self_type &x) const {
		const int y = m_value + x.m_value;
		return unsafe_construct(y >= MOD ? y - MOD : y);
	}
	self_type operator-(const self_type &x) const {
		const int y = m_value - x.m_value;
		return unsafe_construct(y < 0 ? y + MOD : y);
	}
	self_type operator*(const self_type &x) const {
		return unsafe_construct(
			static_cast<long long>(m_value) * x.m_value % MOD);
	}
	self_type &operator+=(const self_type &x){ return (*this = *this + x); }
	self_type &operator-=(const self_type &x){ return (*this = *this - x); }
	self_type &operator*=(const self_type &x){ return (*this = *this * x); }
};
template <int MOD>
std::ostream& operator<<(std::ostream &os, const ModulusInteger<MOD> &x){
	os << *x;
    return os;
}
}
using namespace std;
typedef lc::ModulusInteger<1000000007> mint;
static mint dp[5001][5001];
int main(){
	ios_base::sync_with_stdio(false);
	int n, m, k, q;
	cin >> n >> m >> k >> q;
	dp[0][0] = 1;
	for(int i = 0; i < m; ++i){
		for(int j = 0; j < k; ++j){
			const mint t = dp[i][j];
			dp[i + 1][j]     += t;
			dp[i + 1][j + k] -= t;
		}
		for(int j = k; j < k + k; ++j){
			const mint t = dp[i][j];
			dp[i + 1][j]     += t;
			dp[i + 1][k + k] -= t;
			dp[i + 1][0]     += t;
			dp[i + 1][j - k] -= t;
		}
		for(int j = 0; j < k + k; ++j){
			dp[i + 1][j + 1] += dp[i + 1][j];
		}
	}
	for(int i = 0; i < q; ++i){
		int a, b, c;
		cin >> a >> b >> c;
		if(b == 0){
			cout << (a == c ? 1 : 0) << endl;
		}else{
			a %= (2 * k);
			c %= (2 * k);
			auto answer = dp[b][(c - a + 2 * k) % (2 * k)];
			if(b > 1){
				mint x = n / (k * 2), z = 1;
				--b;
				while(b > 0){
					if(b & 1){ z *= x; }
					x *= x;
					b >>= 1;
				}
				answer *= z;
			}
			cout << answer << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 98892
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long int ll;

const ll MOD = 1000000007;

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

  int N, D;
  cin >> N >> D;

  int r = N;
  int p = 0;
  while (r > 0) {
    r -= D * 2 + 1;
    p++;
  }

  cout << p << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int a, b, c, d, e, h, i, j, k, l;
    double f, g;
    scanf("%d\n%d\n%d\n%d\n%d", &a, &b, &c, &d, &e);
    f = b * 1.0 / d;
    g = c * 1.0 / e;
    i = b / d;
    j = c / e;
    k = i;
    l = j;
    if(f > i){k = i + 1;
    };
    if(g > j){l = j + 1;
    };
    if( f > g ){h = a - k;
        printf("%d\n", h);
    };
    if( f < g ){h = a - l;
        printf("%d\n", h);
    };
    if( f == g ){h = a - l;
        printf("%d\n", h);
    };
    return 0;
}

Measured memory_bytes: 596
#include <stdio.h>

int main(void) {

  int n;
  int i;
  int a[1000];

  scanf("%d", &n);

  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  for(i = n - 1; i > 0; i--)
    printf("%d ", a[i]);
  printf("%d\n", a[0]);

  return 0;
}



Measured memory_bytes: 2056
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      
      	float length = sc.nextFloat();
      	int time = sc.nextInt();
      	float sokudo = sc.nextFloat();
      
      	if(length / sokudo <= time) {
        	System.out.println("Yes");
        } else {
        	System.out.println("No");        	
        }
    
    }
}

Measured memory_bytes: 37228
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(signed i=0;i<n;++i)
#define repi(n) rep(i,n)
#define repvin(n) vint a(n);r(i,n)cin>>a[i];
#define str string
#define vint vector<signed>
#define pint pair<signed,signed>
#define pb(a) push_back(a)
#define all(v) v.begin(),v.end()
#define yn(b) cout<<((b)?"Yes":"No")<<endl
#define YN(b) cout<<((b)?"YES":"NO")<<endl
#define call(a) for(auto t:a)cout<<t<<" ";cout<<endl
#define ENDL printf("\n");
#define debg(a) cout<<#a<<":"<<a<<endl;
#define SORT(a) sort(all(a));
#define INF 1LL<<60

signed main(){
  int n;
  cin>>n;
  vector<long long> a(n);
  repi(n)cin>>a[i];
  SORT(a);
  long long res=0,tmp=0;
  for(int i=n-1;i>0;--i){
    if(a[i]==a[i-1]){
      if(a[i]==tmp){
        cout<<(a[i]*a[i])<<endl;
        return 0;
      }
      else if(tmp!=0){
        cout<<(tmp*a[i])<<endl;
        return 0;
      }
      else tmp=a[i];
      i--;
    }
  }
  cout<<0<<endl;
  
  return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>
int main(){
  int n,j=0,i,a=1,s=0;
  scanf("%d",&n);
  for(i=n;i/10;i/=10){
    j=1-j;
    if(j)s+=a*9;//printf("%d\n",s);
    a*=10;
  }
  //printf("%d %d %d\n",a,j,s);
  if(j==0)s+=1+n-a;
  printf("%d\n",s);
  return 0;
}


Measured memory_bytes: 128
import java.util.*;

import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main {
    int INF = 1 << 28;
    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashSet<T> tt = new HashSet<T>();
        for (int i = 0; i < n; i++) tt.add(new T(sc.nextInt(), sc.nextInt()));
        int m = sc.nextInt();
        for (int i = 0; i < m; i++) tt.add(new T(sc.nextInt(), sc.nextInt()));
        
        ArrayList<T> ts = new ArrayList<T>(tt);
        sort(ts);
        
        for (int i = 0; i < ts.size(); i++) {
            System.out.print(ts.get(i) + (i == ts.size() - 1 ? "\n" : " "));
        }
    }
    
    class T implements Comparable<T>{
        int h, m;
        T(int h, int m) {
            this.h = h;
            this.m = m;
        }
        @Override
        public int compareTo(T o) {
            // TODO ティツ?ェテ・ツ仰陛ァツ板淌ヲツ按静」ツ?陛」ツつ古」ツ?淌」ツδ。テ」ツつステ」ツδε」ツδ嘉」ツδサテ」ツつケテ」ツつソテ」ツδ?
            if (h != o.h)
                return h - o.h;
            return m - o.m;
        }
        
        @Override
        public String toString() {
            return h + ":" + (m/10 == 0 ? "0" : "") + m;
        }
        
        public int hashCode() {
            return h * 100 + m;
        }
        
        public boolean equals(Object o) {
            if (o instanceof T) {
                T t = (T)o;
                return h == t.h && m == t.m;
            }
            return false;
        }
    }
    
    void debug(Object...os) {
        System.out.println(deepToString(os));
    }
    
    public static void main(String[] args) {
        new Main().run();
    }
}

Measured memory_bytes: 20668
import sys
from collections import Counter

N = int(sys.stdin.readline())

A = []
for _ in range(N):
    a = int(sys.stdin.readline())
    A.append(a)

counter = Counter(A)
ans = 0
for key, count in counter.items():
    if count % 2 == 1:
        ans += 1

print(ans)

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

namespace ABC138
{
    class Program
    {
        static void Main()
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split(' ').Select(decimal.Parse).ToArray();
            Decimal ans = 0;
            for (int i = 0; i < n; i++)
                ans += 1 / a[i];
            Console.WriteLine(1 / ans);
        }
    }
}


Measured memory_bytes: 13396
#include<bits/stdc++.h>
#define rep(i,N) for(ll (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;
const int mod = 1000000007;

int main() {
  
  int n;
  cin >> n;
  priority_queue<ll> plus;
  vector<ll> minus;
  vector<ll> a(n), b(n);
  rep(i, n) {
    cin >> a[i];
  }
  rep(i, n) cin >> b[i];
  rep(i, n) {
    ll cur = a[i] - b[i];
    if(cur > 0) plus.push(cur);
    else if(cur < 0) minus.push_back(-cur);
  }
  ll ans = minus.size();
  ll cur = 0;

  rep(i, minus.size()) {

    while(cur < minus[i]) {
      if(plus.empty()){
        puts("-1");
        return 0;
      }
      ll t = plus.top(); plus.pop();
      ++ans;
      cur += t;
    }
    cur -= minus[i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 2812
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstring>

using namespace std;

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

int main(){
	int n; cin >> n;
	cout << "ABC" << n << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.12f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e18;
const ll MAX_N = 1010101;

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

// mod.m での a の逆元 a^ { -1 } を計算する
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x /gcd(x, y) * y );
}

//union-find木について
ll par[101010];
ll rank2[101010];

void init(ll n) {
	rep(i, n) {
		par[i] = i;
		rank2[i] = 0;
	}
}

ll find(ll x) {
	if (par[x] == x) {
		return x;
	}
	else {
		return par[x] = find(par[x]);
	}
}

void unite(ll x, ll y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (rank2[x] < rank2[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if (rank2[x] == rank2[y]) {
			rank2[x]++;
		}
	}
}


ll dx[8] = { 1,-1,0,0,1,1,-1,-1 };
ll dy[8] = { 0,0,1,-1,1,-1,1,-1 };
char c[2010][2010];
ll a[20][20];

//long longしか使わない
//素数は1より大きい
//lower_boundは指定したkey以上の要素の一番左のイテレータをかえす
//upper_boundは指定したkeyより大きい要素の一番左のイテレータをかえす
int main() {
	ll n, m;
	cin >> n >> m;
	vector<ll>k(m);
	rep(i, m) {
		cin >> k[i];
		rep(j, k[i]) {
			cin >> a[i][j];
			a[i][j]--;
		}
	}
	vector<ll>p(m);
	rep(i, m) {
		cin >> p[i];
	}
	ll ans = 0;
	for (ll bits = 0;bits < (1 << n);++bits) {
		vector<ll>res;
		rep(i, n) {
			if (bits & (1 << i))res.push_back(i);
		}
		bool flag = true;
		rep(i, m) {
			ll res2 = 0;
			rep(j, res.size()) {
				rep(j2, k[i]) {
					if (res[j] == a[i][j2])res2++;
				}
			}
			if (res2 % 2 != p[i])flag = false;
		}
		if (flag)ans++;
	}
	cout << ans << endl;
	return 0;
}


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

int main(){

int a[4];
int b[4] = {0, 0, 0, 0};

for(int i=0; i<4; i++){
  cin >> a[i];
}

for(int i=0; i<4; i++){
  if(a[i] == 1) b[0]++;
  if(a[i] == 4) b[1]++;
  if(a[i] == 9) b[2]++;
  if(a[i] == 7) b[3]++;
}

for(int i=0; i<4; i++){
  if(b[i] != 1){
    cout << "NO" << endl;
    return 0;
  }
}

cout << "YES" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define sim template < class c
#define ris return *this
#define dor > debug & operator <<
#define eni(x) sim > typename \
	enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
	ris << "(" << d.first << ", ", d.second << ")";
}
sim dor(rge<c> d) {
	*this << "[";
	for (auto it = d.b; it != d.e; it++)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

const int INF = 1e9;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	vector<int> dp(n, INF);
	dp[0] = 0;
	for (int i = 1; i < n; i++) {
		for (int j = 1; j <= min(i, k); j++) {
			dp[i] = min(dp[i], abs(a[i] - a[i - j]) + dp[i - j]);
		}
	}
	cout << dp[n - 1];
	
	return 0;
}


Measured memory_bytes: 1024
from collections import defaultdict, deque
def inpl(): return list(map(int, input().split()))

H, W = inpl()
searched = [[10**9]*(W+2) for _ in range(H+2)]

for h in range(H+2):
    searched[h][0] = 0
    searched[h][-1] = 0
for w in range(W+2):
    searched[0][w] = 0
    searched[-1][w] = 0

Q = deque()
for h in range(H):
    for w, c in enumerate(input()):
        if c == "#":
            searched[h+1][w+1] = 0
            Q.append((h+1, w+1, 0))

while Q:
    h, w, c = Q.popleft()
    if searched[h][w] < c:
        continue
    for dh, dw in [(0, 1), (1, 0), (-1, 0), (0, -1)]:
        nh, nw = h+dh, w+dw
        if searched[nh][nw] > c+1:
            searched[nh][nw] = c+1
            Q.append((nh, nw, c+1))

print(max(map(max, searched)))

Measured memory_bytes: 147676
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int MN = 200200;
int dp[MN];
vvi g;
bitset<MN> bs,sv,vs,sc;
vi ord,st;
bool found;
int ds(int u) {
	if(dp[u] != -1) return dp[u];
	vi ok;ok.push_back(MN+2);
	for(int i=0;i<g[u].size();i++) {
		int v = g[u][i];
		if(sc[u] && sc[v]) {continue;}
		ok.push_back(ds(v));
	}
	sort(ok.begin(),ok.end());
	int res = 0;
	while(ok[res] == res) {res++;}
	return dp[u] = res;
}
void cyc(int u) {
	st.push_back(u);
	sv.set(u);
	vs.set(u);
	for(int i=0;i<g[u].size();i++) {
		if(found) return;
		int v = g[u][i];
		if(sv[v]) {
			found = true;
			while(1) {
				ord.push_back(st.back());
				sc.set(st.back());
				if(st.back() == v) break;
				st.pop_back();
			}
			return;
		} else {
			if(!vs[v]) {
			cyc(v);
			}
		}
	}
	if(found) return;
	sv.reset(u);
	st.pop_back();
}
int n;
void calc() {
	found = false;
	for(int i=0;i<n;i++) {
		if(!vs[i]) {
			cyc(i);
		}
	}
}
int main() {
	memset(dp,-1,sizeof(dp));
	scanf("%d",&n);
	g.assign(n,vi());
	for(int i=0;i<n;i++) {
		int a;
		scanf("%d",&a);
		a--;
		g[a].push_back(i);
	}
	calc();
	int rep = ord[0];
	bool sm = true;
	for(int i=0;i<ord.size();i++) {
		if(ds(rep) != ds(ord[i])) {
			sm = false;break;
		}
	}
	bool poss = (!sm) || (ord.size()%2 == 0);
	printf("%sPOSSIBLE\n",poss?"":"IM");
}

Measured memory_bytes: 20980
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<cstdint>
using namespace std;

int main()
{
  uint64_t a, b;

  cin >> a >> b;

  if (a - b & 1) {
    cout << "IMPOSSIBLE" << endl;
  } else {
    cout << (a + b) / 2;
  }

  return 0;
}

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



int main(){

  while(1){
  int n;
  cin>>n;
  if(n==-1)break;

  int ans[10]={};
  int i=0;
  while(n)ans[i++]+=n%4,n/=4;
  
  if(i==0)cout <<0;
  for(i=i-1;i>=0;i--)cout << ans[i];
  cout <<endl;
  }

  return 0;
}

Measured memory_bytes: 1160
n, z, w = [int(x) for x in raw_input().split()]
c = [int(x) for x in raw_input().split()]
if abs(c[n - 1] - w) > abs(c[n - 1] - c[n - 2]):
    print abs(c[n - 1] - w)
else:
    print abs(c[n - 1] - c[n - 2])

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

#define MAX 100005

using namespace std;

struct process{
    int time;
    string name;
};

class my_queue{
private:
    int head, tail;
    process queue[MAX];


public:
    my_queue()
    {
        head = 0;
        tail = 0;
    }

    bool isEmpty()
    {
        return head == tail;
    }

    bool isFull()
    {
        return head == (tail + 1) % MAX;
    }

    void enqueue(process n)
    {
        if(isFull())
        {
            cout << "Queue is full." << endl;
            return;
        }
        queue[tail++] = n;

        if(tail == MAX) tail = 0;

        return;
    }

    process dequeue()
    {
        if(isEmpty())
        {
            cout << "Queue is empty." << endl;
            exit(-1);
        }
        
        process ret = queue[head];

        if(head+1 == MAX) head = 0;
        else head++;

        return ret;
    }
};

int main(void)
{
    my_queue queue;
    process proc;
    int n, q;
    int time = 0;

    cin >> n >> q;
    for(int i = 0; i < n; i++)
    {
        cin >> proc.name >> proc.time;
        queue.enqueue(proc);
    }

    while(!queue.isEmpty())
    {
        proc = queue.dequeue();
        if(proc.time <= q)
        {
            time += proc.time;
            cout << proc.name << " " << time << endl;
        }
        else
        {
            proc.time = proc.time - q;
            queue.enqueue(proc);
            time += q;
        }
    }

    return 0;
}

Measured memory_bytes: 5112
#include <bits/stdc++.h>
#define ll long long
#define fastio cin.sync_with_stdio(false); cin.tie(NULL)
using namespace std;

int main(){
  fastio;
  int a,b,h;
  cin>>a>>b>>h;
  cout<<h/2*(a+b)<<'\n';
  return 0;
}


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

int main() {
  int A, B;
  cin >> A >> B;
  int score[] = {0, 14, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
  if (A == B) {
    cout << "Draw" << endl;
  } else if (score[B] < score[A]) {
    cout << "Alice" << endl;
  } else {
    cout << "Bob" << endl;
  }
}

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

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-12;
static const double PI = acos(-1.0);
static const ll MOD = 1000000007;

#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a) (a).begin(), (a).end()
#define DEBUG(x) cout << #x << ": " << x << endl

ll calc_score(ll D, const vector<ll> &c, const vector<vector<ll>> &s, const vector<ll> &t) {
  vector<ll> last(26, -1);
  ll score = 0;
  REP(d, D) {
    ll i = t[d];
    score += s[d][i];
    last[i] = d;
    REP(j, 26) {
      score -= c[j] * (d - last[j]);
    }
  }
  return score;
}

ll area(ll D, ll d, const vector<ll> &t, ll target) {
  ll l = -1;
  for (int i = d - 1; i >= 0; i--) {
    if (t[i] == target) {
      l = i;
      break;
    }
  }
  ll r = D;
  FOR(i, d + 1, D) {
    if (t[i] == target) {
      r = i;
      break;
    }
  }
  ll x = r - d;
  ll y = d - l;
  return x * y;
}

ll calc_diff(ll D, ll pre, ll next, const vector<ll> &c, const vector<vector<ll>> &s, ll d, const vector<ll> &t) {
  ll diff = s[d][next] - s[d][pre];
  diff += c[next] * area(D, d, t, next);
  diff -= c[pre] * area(D, d, t, pre);
  return diff;
}

void solve(ll D, vector<ll> c, vector<vector<ll>> s, vector<ll> t) {
  ll score = calc_score(D, c, s, t);
  ll M;
  scanf("%lld", &M);
  REP(i, M) {
    ll d;
    scanf("%lld", &d);
    d--;
    ll q;
    scanf("%lld", &q);
    q--;
    ll pre = t[d];
    ll next = q;
    t[d] = next;

    score += calc_diff(D, pre, next, c, s, d, t);
    cout << score << "\n";
  }
}

int main() {
  ll D;
  scanf("%lld", &D);
  vector<ll> c(26);
  for (int i = 0; i < 26; i++) {
    scanf("%lld", &c[i]);
  }
  vector<vector<ll>> s(D, vector<ll>(26));
  for (int i = 0; i < D; i++) {
    for (int j = 0; j < 26; j++) {
      scanf("%lld", &s[i][j]);
    }
  }
  vector<ll> t(D);
  for (int i = 0; i < D; i++) {
    scanf("%lld", &t[i]);
    t[i]--;
  }
  solve(D, move(c), move(s), move(t));
  return 0;
}


Measured memory_bytes: 3792
import sys

A, B, M = map(int, input().split())

a = list(map(int, sys.stdin.readline().rsplit()))
b = list(map(int, sys.stdin.readline().rsplit()))

res = min(a) + min(b)

for i in range(M):
    x, y, c = map(int, input().split())
    res = min(res, a[x - 1] + b[y - 1] - c)

print(res)


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

using namespace std;

int main(){
	int i,j,m,n,t,s,k,maxn = 1;
	scanf("%d",&n);
	for(i=1;i*i<=n;i++){
		for(j=2;j<=n;j++){
			if(pow(i,j)>maxn&&pow(i,j)<=n)maxn = pow(i,j);
			if(pow(i,j)>n)break;
		}
	}
	printf("%d",maxn);
	return 0;
}

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

using namespace std;
using ll = long long;

#pragma region Macros
#define FOR(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define rep(i, n) FOR(i, 0, n)

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

template <class T> string join(const T &v, const string delim = ",")
{
    if (v.empty())
        return "";

    ostringstream res;
    res << v[0];
    for (int i = 1; i < v.size(); i++)
    {
        res << delim << v[i];
    }
    return res.str();
}

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << ":" << #x << " = " << (x) << endl;
#else
#define dbg
#endif

#pragma endregion Macros

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

    vector<ll> L(N);
    rep(i,N) cin >> L[i];

    ll ans = 0;
    for (int i = 0; i < N; i++) {
        for (int j = i + 1;j<N;j++){
            for (int k = j + 1; k < N;k++){
                if (L[i] == L[j] || L[j] == L[k] || L[i] == L[k]) continue;

                if (L[i] + L[j] > L[k] && L[j] + L[k] > L[i] && L[k] + L[i] > L[j]) {
//                    cerr << L[i] << "," << L[j] << "," << L[k] << endl;
                    ans++;
                }
            }
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 3648
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<cmath>
#include<algorithm>
#include<bitset>
#define lson node<<1,st,mid
#define rson node<<1|1,mid+1,ed
#define mem(a,x) memset(a,x,sizeof(a))
#define me(a) memset(a,0,sizeof(a))
#define IOS ios::sync_with_stdio(false)
#define lowbit(x) x&(-x)
#define up(i,x,y) for(long long i=x;i<y;i++)
#define down(i,x,y) for(long long i=x;i>=y;i--)
#define in freopen("in.txt","r",stdin)
#define out freopen("out.txt","w",stdout)   
typedef long long ll;
const ll mod = 1e9+7;
const ll INF = 0x3f3f3f3f;
const ll maxn = 1e6 + 5;
const ll N=1e3+5;
const double pi = acos(-1.0);
const double eps=1e-9;
using namespace std;

int main(){
    // in;
    // out;
    ll x;
    cin>>x;
    ll cs=100;
    for(ll i=1;i<=40000;i++){
        ll y=(ll) cs/100;
        cs+=y;
        if(cs>=x){
            cout<<i<<endl;
            break;
        }
    }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
 
using namespace std;
 
const int MOD=1e9+7;
const double PI=3.14159265359;


 
int main(){
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin>>n;
    vector<long long> v(n);
    for(auto&i:v)cin>>i;
    
    vector<long long> cs(n), xs(n);
    
    cs[0]=v[0], xs[0]=v[0];
    for(int i=1; i<n; i++){
        cs[i]=cs[i-1]+v[i];
        xs[i]=xs[i-1]^v[i];
    }
    
   
    
    long long ans=0;
    for(int i=0; i<n; i++){
        int l=i, r=n-1;
        while(l<r){
            int mid=(l+r)/2;
            long long val1=cs[mid+1]-(i?cs[i-1]:0);
            long long val2=xs[mid+1]^(i?xs[i-1]:0);
            if(val1>val2){
                r=mid;
            }
            else{
                l=mid+1;
            }
            /*
            if(l==r){
                cout<<val1<<" "<<val2<<endl;
            }
            */
            //cout<<i<<" "<<l<<" "<<r<<endl;
            
        }
        //cout<<i<<" "<<l<<endl;
        
        ans+=(l-i+1);
        
    }
    
    //cout<<(5^6^4)<<endl;
    
    cout<<ans;
    return 0;
    
}

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

using ll = long long;
#define int long long

#define LOG(variable) cout << #variable":\t" << (variable) << endl
#define LOGCON(i, container) for(int (i) = 0; (i) < (container).size(); ++(i)) cout << (i) << ":\t" << (container)[(i)] << endl
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, n, r) for(int i = (n); i >= (r); --i) // from n to r
#define REPOBJ(itr, obj) for(auto itr = (obj).begin(); itr != (obj).end() ; ++itr)
#define REPROBJ(itr, obj) for(auto itr = (obj).rbegin(), e = (obj).rend(); itr != e; ++itr)
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))
struct mint {
  ll x; // typedef long long ll;
  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 { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
int in() {int x; cin>>x; return x;}
string stin() {string s; cin>>s; return s;}
/***** MAIN *****/
signed main() {
  int n = in();
  int ans = 0;
  REPS(i,1,n+1) {
    if(i%3 && i%5) {
      ans += i;
    }
  }
  cout << ans;
  cout << "\n";
  return 0;
}
/***** MAIN *****/


Measured memory_bytes: 3600
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdio>
#include <stack>
#include <climits>

using namespace std;

int main() {

	int a, b = 0;
	cin >> a >> b;

	cout << a * b - (a + b - 1) << endl;

	return 0;

}

Measured memory_bytes: 256
use proconio::input;

#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars, Usize1};
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::ops::*;

#[derive(Clone, Debug, Default)]
struct Struct;

fn dfs(a: &mut Vec<usize>, i: usize, n:usize, m: usize, bq: &Vec<Vec<(usize, usize, i32, usize)>>, score:usize) -> usize {
    let mut val_to_score = vec![0; m + 1];
    for v in &bq[i] {
        let good_val = a[v.0] + v.2 as usize;
        if good_val <= m {
            val_to_score[good_val] += v.3;
        }
    }
    let mut max_score = 0;
    for val in a[i-1]..=m {
        if val == a[i-1] || val_to_score[val] != 0 {
            a[i] = val;
            if i == n-1 {
                max_score = max(max_score, score + val_to_score[val]);
            } else {
                max_score = max(max_score,dfs(a, i+1, n, m, bq, score + val_to_score[val]));
            }
        }
    }
    max_score
}

//#[proconio::fastout]
fn main() {
    input! {
        n: usize,
        m: usize,
        q: usize,
        v: [(Usize1,Usize1,i32,usize);q],
    }

    let mut bq = vec![Vec::new(); n];
    for i in 0..q {
        let b = v[i].1;
        bq[b].push(v[i]);
    }

    let mut a = vec![1; n];
    let ans = dfs(&mut a, 1, n, m, &bq, 0);

    println!("{}", ans);
}


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



int main() {
int n,x,t;
cin >> n >> x >> t;
int ans;
if(n%x == 0){
    ans = (n/x) * t;
}
else{
    ans = (n/x + 1) * t;
}

cout << ans << endl;

}

Measured memory_bytes: 3588
#include <iostream>
#include <random>
#include <chrono>
#include <algorithm>
#include <cstring>

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
using namespace std;
typedef long long ll;
const ll MOD = (ll)1e9 + 7;
const int N = 1e5+5, inf = 1e9+5;
ll add(ll x, ll y) { x += y; if (x >= MOD) return x - MOD; return x; }
ll sub(ll x, ll y) { x -= y; if (x < 0) return x + MOD; return x; }
ll mult(ll x, ll y) { return (x * y) % MOD; }
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

ll h[N], dp[N];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n; cin >> n;
    memset(dp, inf, sizeof(dp));
    rep (i, 0, n) cin >> h[i];

    dp[0] = 0;
    for (int i = 0; i < n; ++i) {
        dp[i+1] = min(dp[i+1], dp[i] + abs(h[i+1]-h[i]));
        dp[i+2] = min(dp[i+2], dp[i] + abs(h[i+2]-h[i]));
    }

    cout << dp[n-1] << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>

int main(void){

  int a, b;

  scanf("%d %d",&a ,&b);

    if (a < b){
      printf("a < b\n");
    }

      else if (a > b){
      printf("a > b\n");
      }

      else {
	printf("a == b\n");
      }

  return 0;
}

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

int main(){
  int n ;
  cin >> n;
  int w[100];
  int ans = 0;
  for(int i = 0; i < n; i++){
    cin >> w[i];
    ans += w[i];
  }
  int sum = 0;
  int wans = 1000000;
  for(int i = 0; i < n; i++){
    if(abs(sum-ans) < wans)wans = abs(sum - ans);
    sum += w[i];
    ans -= w[i];
  }
  cout << wans << endl;
}


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

string str[110];
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, l;
    cin >> n >> l;

    for(int i = 0; i < n; ++i){
        cin >> str[i];
    }

    sort(str, str + n);

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

    return 0;
}

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

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

int main()
{
	int n, k;
	cin >> n >> k;
	int a[n];
	for(int i=0;i<n;i++)
		cin >> a[i];
	sort(a, a+n);
	int ans = 1000000000;
	for(int i=0;i+k-1 <n;i++)
	{
		ans = min(ans, a[i+k-1]-a[i]);
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 640