akhauriyash/Code-Regression huggingface dataset:
#pragma GCC target("avx2")
#pragma GCC optimize("O3")

# include <x86intrin.h>
# include <bits/stdc++.h>

# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
 
template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 61;
const int pri = 997;
const int Magic = 2101;

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

ll dp[64][2][2][2], L, R;
 
ll solve(int now, bool l, bool r, bool bf) {
	if (now == -1) return 1;
	ll &ans = dp[now][l][r][bf];
	if (ans >= 0) return ans;
	ans = 0;
	bool P = (L >> now) & 1;
	bool Q = (R >> now) & 1;
	for (int i = 0; i <= 1; i++) {
		for (int j = 0; j <= 1; j++) {
			if (l && i == 0 && P) continue;
			if (r && j == 1 && !Q) continue;
			if (i > j) continue;
			if (!bf && (i != j)) continue;
			ans += solve(now - 1, l && (i == P), r && (j == Q), bf || i);
			ans %= mod;
		}
	}
	ans %= mod;
	return ans;
}

int main () {
   SpeedForce;
	cin >> L >> R;
	memset(dp, -1, sizeof dp);
	cout << (mod + solve(62, 1, 1, 0)) % mod;
   return Accepted;
}

// B...a

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

int n, x, max1, max2, a;

int main() {
	cin >> n;
	for (int i=0; i<n; i++) {
		cin >> x;
		if (x>max1) {
			max2=max1;
			max1=x;
			a=i;
		}
		else {
			if (x>max2) {
				max2=x;
			}
		}
	}
	for (int j=0; j<n; j++) {
		if (j==a) {
			cout << max2 << endl;
		}
		else {
			cout << max1 << endl;
		}
	}
}

Measured memory_bytes: 1664
/*input

*/


// assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;

// order_of_key (k) : Number of items strictly smaller than k .
// find_by_order(k) : K-th element in a set (counting from zero).
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ll          long long int
#define pb          push_back
#define pii         pair<ll ,ll >
#define vpii        vector< pii >
#define vi          vector<ll >
#define vs			vector< string >
#define vvi         vector< vector< ll > >
#define inf			(ll)1e18
#define all(it,a)   for(auto it=(a).begin();it!=(a).end();it++) 
#define F           first
#define S           second
#define sz(x)       (ll )x.size()
#define rep(i,a,b)	for(ll  i=a;i<b;i++)
#define repr(i,a,b) for(ll  i=a;i>b;i--)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define mp          make_pair
#define whatis(x)   cout << #x << " is " << x << "\n";
#define graph(n)    adj(n,vector< ll > () )
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define debug(x)     cout << #x << " " << x << endl;
#define debug_p(x)   cout << #x << " " << x.F << " " << x.S << endl;
#define debug_v(x)   {cout << #x << " "; for (auto ioi : x) cout << ioi << " "; cout << endl;}
#define debug_vp(x)  {cout << #x << " "; for (auto ioi : x) cout << '[' << ioi.F << " " << ioi.S << ']'; cout << endl;}
#define debug_v_v(x) {cout << #x << "/*\n"; for (auto ioi : x) { for (auto ioi2 : ioi) cout << ioi2 << " "; cout << '\n';} cout << "*/" << #x << endl;}

int solve()
{
	ll n,m;cin>>n>>m;
	ll k;cin>>k;
	vi a(n),b(m);
	rep(i,0,n) cin>>a[i];
	rep(i,0,m) cin>>b[i];

	vi pfa(n,0);
	vi pfb(m,0);

	rep(i,0,n) pfa[i] = (i-1>=0?pfa[i-1]:0)+a[i];
	rep(i,0,m) pfb[i] = (i-1>=0?pfb[i-1]:0)+b[i];

	ll ans=0;
	rep(i,0,n)
	{
		ll left = k-pfa[i];
		if(left>=0)
		{
			ll idx = upper_bound(pfb.begin(), pfb.end(),left) - pfb.begin()-1;
			ans=max(ans,i+1+idx+1);
		}
	}

	rep(i,0,m)
	{
		ll left = k-pfb[i];
		if(left>=0)
		{
			ll idx = upper_bound(pfa.begin(), pfa.end(),left) - pfa.begin()-1;
			ans=max(ans,i+1+idx+1);
		}
	}

	cout<<ans<<"\n";

	return 0;
}

int main()
{
	auto start = chrono::high_resolution_clock::now();

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

	ll test_cases=1;
	//cin>>test_cases;
	while(test_cases--)
		solve();

	auto stop = chrono::high_resolution_clock::now();
	auto duration = chrono::duration_cast<chrono::milliseconds>(stop-start);
	//cout<<"\nduration: "<<(double)duration.count()<<" milliseconds";
}

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

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

using namespace std;

int d(vector<string> s, int y, int x){
  if(s[y][x]=='#')return 0;
  map<pair<int, int>, bool>visited;
  map<pair<int, int>, int>distance;
  rep(i, s.size())rep(j, s[0].size())distance[make_pair(i, j)]=100000;

  queue<pair<pair<int, int>,int>> q;
  auto fc = make_pair(y,x);
  distance[fc]=0;
  q.push(make_pair(fc,0));
  while(!q.empty()){
    auto cd = q.front();
    auto c = cd.first;
    auto d = cd.second;
    q.pop();
    int y=c.first;
    int x=c.second;
    if(visited[c])continue;
    visited[c]=true;
    if(s[y][x]=='.'){

      if(y+1<s.size() && s[y+1][x]=='.'){
        auto n = make_pair(y+1,x);
        q.push(make_pair(n, d+1));
        distance[n] = min(distance[n], d+1);
      }

      if(y-1>=0 && s[y-1][x]=='.'){
        auto n = make_pair(y-1,x);
        q.push(make_pair(n, d+1));
        distance[n] = min(distance[n], d+1);
//        cout<<'|'<<y<<','<<x-1<<' '<<d+1<<endl;
      }

      if(x+1<s[0].size() && s[y][x+1]=='.'){
        auto n = make_pair(y, x+1);
        q.push(make_pair(n, d+1));
        distance[n] = min(distance[n], d+1);
      }

      if(x-1>=0 && s[y][x-1]=='.'){
        auto n = make_pair(y, x-1);
        q.push(make_pair(n, d+1));
        distance[n] = min(distance[n], d+1);
//        cout<<'|'<<y<<','<<x-1<<' '<<d+1<<endl;
      }

    }
  }

  int result=0;
  for(auto p: distance){
    if(p.second!=100000)result = max(result, p.second);
  }
//  rep(i, s.size())rep(j, s[0].size())result = max(result, distance[make_pair(i, j)]);
//  rep(i, s.size())rep(j, s[0].size())cout<<distance[make_pair(i, j)]<<' '<<i<<' '<<j<<endl;cout<<endl;

  return result;  
}

int main(){
  int h,w;cin>>h>>w;
  vector<string> s(h);
  rep(i, h)cin>>s[i];
  int result=0;

  rep(i,h)rep(j,w){
//    int t=d(s, i, j);
//    result = max(result, t);
//    cout<<t<<' '<<i<<' '<<j<<" res"<<endl;
    result = max(result, d(s, i, j));
  }
  
//  cout<<endl<<d(s, 2, 0)<<endl;

  cout<<result;

  return 0;
}

Measured memory_bytes: 256
def main():
    S = int(input())
    
    C = 100
    
    cc = 1
    isfinish = False
    while not isfinish:
        C += int(C * 0.01)
        if C >= S:
            print(cc)
            isfinish = True
            break
        else:
            cc += 1
            
    
        
    
main()

Measured memory_bytes: 63352
#include<stdio.h>
#include<math.h>
#include<algorithm>

int change[100010] = {};
int main() {
	int N = 0;
	scanf("%d",&N);
	for (int i = 0; i < N;i++) {
		int a, b;
		scanf("%d %d",&a,&b);
		change[a]++;
		change[b+1]--;
	}
	int ans=0;
	int p=0;
	for (int i = 2; i <= N + 1; i++) {
		p += change[i];
		if (i-1 <= p) {
			ans = std::max(ans, i-1);
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 3104
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    string S;
    cin >> S;

    bool check1 = false, check2 = false, check3 = true;
    ll Ccount = 0;
    if(S[0] == 'A'){
        check1 = true;
    }
    if(S[1] < 'a'){
        check3 = false;
    }
    for(ll i = 2; i < S.size() - 1; i++){
        if(S[i] == 'C' && Ccount == 0){
            check2 = true;
            Ccount++;
        }else if(S[i] < 'a'){
            check3 = false;
        }
    }
    if(S[S.size() - 1] < 'a'){
        check3 = false;
    }

    if(check1 && check2 && check3){
        cout << "AC" << endl;
    }else{
        cout << "WA" << endl;
    }

    return 0;
}

Measured memory_bytes: 3568
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <cstdlib>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <sstream>

using namespace std;

class c_main
{
private:
    
public:
    c_main();
    void f_input();
    int f_digit(int sum);
};

int c_main::f_digit(int sum){
    int digit=0;
    while(sum!=0){
        sum /= 10;
        digit++;
    }
    return digit;
}

c_main::c_main()
{
    int a,b;
    int cnt;
    
    cnt = 0;
    
    for (;cin >> a >> b;){
        cout << f_digit(a+b) << endl;
    }
}

void c_main::f_input()
{
    
}

int main(){
    c_main main01;
    main01.f_input();
    
    return 0;
}

Measured memory_bytes: 3080
import java.util.Scanner;

public class Main {
	//half and half


	public static void main(String[] args){
		int A,B;
		Scanner sc = new Scanner(System.in);
		A=sc.nextInt();
		B=sc.nextInt();
		if(A>=13)System.out.println(B);
		else if(A>=6)System.out.println(B/2);
		else System.out.println(0);


	}
}

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

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<string> &o) {
    string a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

int main() {
    string s;
    cin >> s;
    int n = s.size();

    if (*min_element(s.begin(), s.end()) == *max_element(s.begin(), s.end())) {
        cout << n << endl;
        ret();
    }


    int ans = INT_MAX;
    rep(i, n - 1) {
        if (s[i] == s[i + 1]) continue;
        int k = max(i + 1, n - i - 1);
        cmin(ans, k);
    }
    cout << ans << endl;

}



Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
void Ask(int pos) {
	static char buf[100];
	printf("%d\n", pos);
	fflush(stdout);
	scanf("%s", buf);
	if (buf[0] == 'V') exit(0);
	else if (buf[0] == 'M') a[pos] = 1;
	else a[pos] = 2;
}
void Q(int l, int r) {
	int mid = (l + r) >> 1;
	Ask(mid);
	if (((mid - l) % 2 != 0 && a[l] == a[mid]) || ((mid - l) % 2 == 0 && a[l] != a[mid])) {
		Q(l, mid);
	} else {
		Q(mid, r);
	}
}
int main() {
	scanf("%d", &n);
	Ask(0);
	Ask(n - 1);
	Q(0, n - 1);
	return 0;
}

Measured memory_bytes: 852
#!/usr/bin/env python3
N = int(input().strip())
XL = [[int(str) for str in input().strip().split()] for _ in range(N)]


def solve():
    AB = [(x - l, x + l) for x, l in XL]
    AB.sort(key=lambda x: x[1])
    removed = -float('Inf')
    ans = 0
    for a, b in AB:
        if a < removed:
            continue
        removed = b
        ans += 1

    print(ans)


solve()


Measured memory_bytes: 36392
#include <bits/stdc++.h>
using namespace std;
int main() {
int A, B; cin >> A >> B;
int ans;
if (A > B) {
ans = A + (A-1);
}
else if (B > A) {
ans = B + (B-1);
}
else {
ans = A + B;
}
cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define SUM(n) ((n)+1)*(n)/2　//1〜nまでの総和を求める式
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) setprecision(x+1) //小数点桁数を指定する
#define abs(x,y) (max(x,y)-min(x,y))
#define all(v) v.begin(),v.end()
#define UPDight(a,b) (a+b-1)/b //小数点切り上げ 
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD=int(1e9)+7; 
using namespace std;
using pii = pair<int,int>;
typedef vector<int> vit;
  
int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n;
  cin >> n;
  int a[3 * n + 5];
  rep(i, 3 * n){
    cin >> a[i];
  }
  sort(a, a + (3 * n), greater<int>());
  lol ans = 0;
  rep(i, n){
    ans += a[2 * i + 1];
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1<<21;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    if(n%2){
        cout << "No" << endl;
        return 0;
    }
    for(int i=0; i<n/2; i++){
        if(s[i] != s[i+n/2]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
	int a, b, c, k, i, total=0;

	scanf("%d %d %d %d", &a, &b, &c, &k);
	b+=a;
	c+=b;

	for(i=0; i<k; i++){
		if(i<a){
			total+=1;
		}else if(i<b){
			total+=0;
		}else{
			total-=1;
		}
	}
	printf("%d", total);
	return 0;
}
	

Measured memory_bytes: 2152
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <climits>
#include <cassert>
using namespace std;

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

typedef vector<int> vi;
typedef vector<string> VS;
typedef pair<int, int> pii;
typedef long long ll;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

const double EPS = 1e-9;
const double PI  = acos(-1.0);
const int dx[] = {-1,1,0,0};
const int dy[] = {0,0,1,-1};

#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const ll MOD = 1000000007;

int N, M;
ll ret;
ll f[100010];

int main() {
	f[0] = 1;
	for (int i = 1; i <= 100000; ++i) {
		f[i] = f[i-1] * i % MOD;
	}
	cin >> N >> M;
	if (N > M) swap(N, M);

	if (M > N + 1) {
		puts("0");
	} else {
		ret = f[N] * f[M] % MOD;
		if (N == M) ret = ret * 2 % MOD;
		cout << ret << endl;
	}
    return 0;
}

Measured memory_bytes: 1532
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = Integer.parseInt(sc.nextLine());
		boolean isMatch = false;
		for (int i = 1; i < 10; i++) {
			for (int j = 1; j < 10; j++) {
				if (line == i*j) {
					isMatch = true;
				}
			}
		}
		sc.close();
		if (isMatch) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}


Measured memory_bytes: 23252
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>

#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (int i = beg; end <= i; i--)

using namespace std;

void calc(int64_t& rem, int64_t& count)
{
	while (rem >= 10) {
		int64_t v = rem / 10;
		count += v;
		rem -= v * 9;
	}
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int64_t m; cin >> m;
	int64_t ans = -1;
	int64_t rem = 0;

	FOR_LT(i, 0, m) {
		int64_t d, c; cin >> d >> c;
		rem += d * c;

		int64_t count = c;
		calc(rem, count);
		ans += count;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<deque>
#include<utility>
#include<map>
#include<set>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<functional>
#include<sstream>
#include<cstring>
#include<bitset>
#include<stack>
using namespace std;

string s;
int cc,ff;
int c[105],f[105];

int main()
{
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='C')c[++cc]=i; else if(s[i]=='F')f[++ff]=i;
	}
	
	if(cc==0 || ff==0)
	{
		cout<<"No"<<endl;
		return 0;
	}
	
	for(int i=1;i<=cc;i++)
	{
		for(int j=1;j<=ff;j++)
		{
			if(c[i]<f[j])
			{
				cout<<"Yes"<<endl;
				return 0;
			}
		}
	}
	
	cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
static const int dx[4] = { 0, 1, 0, -1 };
static const int dy[4] = { 1, 0, -1, 0 };
static const char dir[4] = { 'u', 'r', 'd', 'l' };
static const ll INF = 1 << 21;
static const ll MOD = 1e9 + 7;

bool IsPrime(int num)
{
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false; // 偶数はあらかじめ除く

    for (int i = 2; i * i <= num; ++i) {
        if (num % i == 0) {
            return false;
        }
    }

    // 素数である
    return true;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    vector<ll> primes;
    for (int i = 2; i <= 55555; i++) {
        if (IsPrime(i)) {
            primes.push_back(i);
        }
    }
    vector<ll> ans;
    for (auto p : primes) {
        if (p % 5 == 1) {
            ans.push_back(p);
        }
    }
    rep(i, N)
    {
        cout << ans[i] << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cstring>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
using namespace std;

#define LL long long
int ans;
string str;

int main() {
    #ifdef LOCAL
    freopen("test.txt", "r", stdin);
    #endif // LOCAL

    while(cin >> str) {
        ans = 700;
        int len = str.length();
        for(int i = 0; i < len; ++i) {
            if(str[i] == 'o') {
                ans += 100;
            }
        }
        printf("%d\n", ans);
    }

    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		char c[]=sc.next().toCharArray();
		int n=c.length;
		String ans="";
		for(int i=0;i<n;i++){
			
			char a=c[i];
			
			for(int j=i+1;j<n;j++){
				if(c[j]==a){
					if(j==n-1){
						i=n-1;
					}
					c[j]='\0';
					continue;
				}else{
					
					i=j-1;
					break;
				}
			}
						
			
		}
		long sum=0;
		for(int i=0;i<n;i++){
			if(c[i]!='\0'){
				sum++;
			}
		}
		//System.out.println(Arrays.toString(c));
		System.out.println(sum-1);
		
		
	}

}


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

using namespace std;

typedef long long ll;

struct para
{
    ll il, x, nr;
};

bool por(para a, para b)
{
    if (a.x > b.x)
        return true;
    if (a.x < b.x)
        return false;
    if (a.nr < b.nr)
        return true;
    return false;
}

int main()
{
    ios_base::sync_with_stdio(0);
    int n, m;
    cin >> n >> m;
    vector<ll> a(n);
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    sort(a.begin(), a.end());
    vector<para> op(m);
    for (int i = 0; i < m; ++i)
    {
        cin >> op[i].il >> op[i].x;
        op[i].nr = i;
    }
    sort(op.begin(), op.end(), por);
    int nr = 0;
    for (int i = 0; i < m; ++i)
    {
        for (int j = 0; j < op[i].il; ++j)
        {
            if (a[nr] < op[i].x)
                a[nr] = op[i].x;
            ++nr;
            if (nr == n)
                break;
        }
        if (nr == n)
            break;
    }
    ll odp = 0;
    for (int i = 0; i < n; ++i)
        odp += a[i];
    cout << odp;
    return 0;
}


Measured memory_bytes: 3328
#pragma warning disable

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Numerics;
using System.Collections;
using System.Timers;

static class MainClass
{
    public static void Main(string[] args)
    {
        var n = Console.ReadLine().ToInt32();
        var an = Console.ReadLine().SplittedStringToInt32List();
        var num = 1;
        foreach (var item in an)
        {
            num = Lcm(item, num);
        }
        Console.WriteLine(num);

        Console.ReadLine();
    }

    public static int Gcd(int a, int b)
    {
        if (b == 0)
            return a;
        return Gcd(b, a % b);
    }
    public static BigInteger Gcd(BigInteger a, BigInteger b)
    {
        if (b == 0)
            return a;
        return Gcd(b, a % b);
    }

    public static BigInteger Lcm(BigInteger a, BigInteger b)
    {
        return (a * b) / Gcd(a, b);
    }

    public static int Lcm(int a, int b)
    {
        return (a * b) / Gcd(a, b);
    }
    #region ライブラリ
    public static long ToInt64(this string str) => long.Parse(str);
    public static int ToInt32(this string str) => int.Parse(str);
    public static BigInteger ToBigInteger(this string str) => BigInteger.Parse(str);
    public static List<string> SplittedStringToList(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
    public static List<int> SplittedStringToInt32List(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToList();
    public static List<BigInteger> SplittedStringToBigInteger(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => BigInteger.Parse(x)).ToList();

    public const int INF = int.MaxValue / 2;
    #endregion
}



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

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

  vector<int> a(n);
  for (auto&& e : a) {
    cin >> e;
    e--;
  }

  valarray<int64_t> c(n);
  for (const auto& e : a)
    c[e]++;

  int64_t s = (c * (c - 1L) / 2).sum();

  for (const auto& e : a)
    cout << s - (c[e] - 1) << endl;
}


Measured memory_bytes: 4992
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
from functools import lru_cache
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7 

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    A, V = read_values()
    B, W = read_values()
    T = int(input())
    if V <= W:
        print("NO")
        return 
    
    print("YES" if abs(A - B) <= T * (V - W) else "NO")


if __name__ == "__main__":
    main()



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

using namespace std;

#define REP(i,n)	for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,s,n)	for(int i=(s), i##_len=(n); i<i##_len; ++i)

#define ALL(obj)	(obj).begin(),(obj).end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define VEC vector

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int 			ll;

typedef pair<int,int>			P;
typedef vector<int>				Vint;
typedef vector<Vint>			VV;

template<typename T>string join(const v(T)&v)
{stringstream s;REP(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define MAX 		100010


const ll LINF = (ll)9e18+7;		//
const int INF = 100100100;			//2,147,483,647 (Max int)
const ll MOD = 1e9+7;
// テンプレ終了
//====================================================================//

// int DP[MAX];

v(Vint) E;
Vint cnt,pre;
queue<int> q;

void bfs(){
	if(q.empty()) return; 
	int n=q.front();q.pop();
	// cout << n << endl;
	for(int i : E[n]){
		// cout << "\t" << i << endl;
		if(cnt[i] <= cnt[n]+1)continue;
		cnt[i] = cnt[n]+1;
		pre[i] = n;
		q.push(i);
	}
	bfs();
}

int main(){
	int N,M;
	cin >> N >> M;
	E.resize(N);
	REP(i,M){
		int a,b;cin>>a>>b;
		E[--a].push_back(--b);
		E[b].push_back(a);
	}

	cnt.resize(N,INF);
	pre.resize(N,0);

	// cout << cnt << pre << endl;
	
	q.push(0);
	cnt[0]=0;
	bfs();

	bool f = true;
	REPS(i,1,N)if(cnt[i]==INF){f=false;break;}
	if(f){cout << "Yes" << endl;REPS(i,1,N)cout << pre[i]+1 << endl;}
	else cout << "No" << endl;
	
	return 0;
}
 



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

#define rp(i,t) for(int i=0;i<(t);i++)
#define rep(i,s,t) for(int i=(s);i<=(t);i++)
#define rsp(i,s,t) for(int i=(s);i<(t);i++)
#define rrp(i,t,s) for(int i=(t);i>=(s);i--)
#define rcp(i,s,b,d) for(int i=(s);b;d)
#define mst(a,x) memset(a,x,sizeof(a))
#define INF 0x3f3f3f3f
#define N

#define Dp puts("")
#define Dw printf
#define Ds printf("#")

typedef long long ll;
bool b;
char ch;
int n,x;
deque<int> Q;

inline void read(int &x){x=0;do{ch=getchar();}while(ch<'0'||'9'<ch);do{x=x*10+ch-'0';ch=getchar();}while('0'<=ch&&ch<='9');}

int main(void)
{
	read(n);
	rep(i,1,n)
	{
		read(x);
		if(b)Q.push_front(x);
		else Q.push_back(x);
		b=!b;
	}
	if(b)
	{
		while(!Q.empty())
		{
			printf("%d ",Q.back());
			Q.pop_back();
		}
	}
	else
	{
		while(!Q.empty())
		{
			printf("%d ",Q.front());
			Q.pop_front();
		}
	}
	return 0;
}


Measured memory_bytes: 2944
a, b, k = gets.split.map(&:to_i)
c = a + k - 1
if (a + k) >= b
    a.upto(b) do |i|
        puts i
    end
else
    a.upto(c) do |i|
        puts i
    end
    (b-k+1).upto(b) do |i|
        next if c >= i
        puts i
    end
end

Measured memory_bytes: 1788
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) ((int)(x).size())
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N,K; cin>>N>>K;
    vint x(N);
    REP(i,N) cin>>x[i];

    int ans=1e9;
    for(int i=0;i+K<=N;i++)
    {
        int j=i+K-1;
        int cost1=abs(x[i])+abs(x[i]-x[j]);
        int cost2=abs(x[j])+abs(x[j]-x[i]);
        ans=min(ans,min(cost1,cost2));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1024
/*  -*- coding: utf-8 -*-
 *
 * a.cc: A - Poor
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);

  if ((a == b && b != c) || (b == c && c != a) || (c == a && a != b))
    puts("Yes");
  else
    puts("No");
  return 0;
}


Measured memory_bytes: 256
A,B,C = map(int, input().split())
ctr = 0
if A == B == C and A%2 == 0 and B%2 == 0 and C%2 == 0:
  print(-1)
else:
  while A%2 == 0 and B%2 == 0 and C%2 == 0:
    A,B,C = int((B+C)/2), int((A+C)/2), int((A+B)/2)
    ctr += 1
  print(ctr)

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

using namespace std;

int main() {

	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);

	string S[100];
	int n, l;
	cin >> n >> l;
	for (int i = 0; i < n; ++i) cin >> S[i];
	sort(S, S + n);
	for (int i = 0; i < n; ++i) cout << S[i];
	cout << '\n';
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int linersearch(int *,int key);
int n;
int q;
int T[100000];

int main(){
  int i,j;
  int c=0;
  int S[100000];
  int Q[100000];
  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i=0; i<q; i++){
    scanf("%d",&Q[i]);
  }
  for(i=0; i<n; i++){
    T[i] = -1;
  }
  
  for(i=0; i<q; i++){
    c += linerSearch(S,Q[i]);
  }
  printf("%d\n",c);
  return 0;
}

int linerSearch(int *A,int key){
  int i,j,m;
  int l = 0;
 int  r = n;
 while( l< r ){
    m = (l + r)/ 2;
    if(A[m]==key){
      return 1;
    }else if(key < A[m]){
      r = m;
    }else{
      l = m + 1;
    }
  }
  return 0;
  
}




Measured memory_bytes: 2712
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

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

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

int main(){
    long long int N, A, B, C, D;
    cin >> N >> A >> B >> C >> D;
    cout << min((N / A + (N % A != 0)) * B, (N / C + (N % C != 0)) * D) << endl;
    return 0;
}


Measured memory_bytes: 3116
# -*- coding:utf-8 -*-

import math

def insertion_sort(num_list, length, interval):
    cnt = 0
    for i in range(interval, length):
        v = num_list[i]
        j = i - interval
        while j >= 0 and num_list[j] > v:
            num_list[j+interval] = num_list[j]
            j = j - interval
            cnt = cnt + 1
        num_list[j+interval] = v
    return cnt

def shell_sort(num_list, length):
    cnt = 0
    h = 4
    intervals = [1,]
    while length > h:
        intervals.append(h)
        h = 3 * h + 1
    for i in reversed(range(len(intervals))):
        cnt = cnt + insertion_sort(num_list, length, intervals[i])
    print(len(intervals))
    show_list(intervals)
    print(cnt)

def show_list(list):
    i = len(list) - 1;
    while i > 0:
        print(list[i], end=" ")
        i = i - 1
    print(list[i])

input_num = int(input())
input_list = list()
for i in range(input_num):
    input_list.append(int(input()))
shell_sort(input_list, input_num)
for num in input_list:
    print(num)

Measured memory_bytes: 47544
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int max_n=305;
int n,a[max_n][max_n];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++)scanf("%d",&a[i][j]);
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            bool f=false;
            for(int k=1;k<=n;k++){
                if(k==i||k==j)continue;
                if(a[i][k]+a[k][j]<a[i][j])return printf("-1\n"),0;
                else if(a[i][k]+a[k][j]==a[i][j])f=true;
            }
            if(f==false)ans+=a[i][j];
        }
    }
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 640
#include<iostream>

using namespace std;

int main(){
	int n;
	cin >> n;
	long int l = 0,r = 0;
	for(int i = 0;i < n;i++){
		long int p;
		char c;
		int n;
		cin >> p >> c >> n;
		if(c == '('){
			l += n;
		}else{
			r += n;
		}
		if(l == r){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}
	return 0;
}


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

int main(){
  int N;
  string S;
  cin >> N;
  cin >> S;
  long long r = 0, b = 0, g = 0;
  for (int i = 0; i < N; i++){
    if ( S[i] == 'R') r++;
    else if ( S[i] == 'B') b++;
    else g++;
  }
  long long all = r*b*g;
  long long sub = 0;
  for (int i = 0; i < N; i++){
    for (int j = i+1; j < N ; j++){
      int k = 2*j - i;
      if (S[i] != S[j] && S[i] != S[k] && S[j] != S[k] && k < N) sub++;
    }
  }
  cout << all - sub << endl;
  return 0;
}

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

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define repll(i,n) for(ll i=0;i<(ll)(n);i++)
#define repll2(i,n) for(ll i=1;i<=(ll)(n);i++)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define INF (int)1e9
#define LINF (ll)4e18
#define MOD (int)(1e9)+7
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define PI 3.1415926535898
#define NP(v) next_permutation(v.begin(),v.end())

//------------------------------------------------------

int dist[2][100010]; //0ならblack 1ならwhite
bool used[2][100010] = {};
vector<int> edge[100010];
int n;

void bfs(int color) {
    queue<int> que;
    if (color == 0) {
        used[0][1] = true;
        dist[0][1] = 0;
        que.push(1);
    } else {
        used[1][n] = true;
        dist[1][n] = 0;
        que.push(n);
    }

    while (!que.empty()) {
        for (auto e : edge[que.front()]) {
            if (!used[color][e]) {
                used[color][e] = true;
                dist[color][e] = dist[color][que.front()] + 1;
                que.push(e);
            }
        }
        que.pop();
    }

}

int main() {
    cin >> n;

    rep(i, n) {
        int a, b;
        cin >> a >> b;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }

    bfs(0);
    bfs(1);

    int white = 0;
    int black = 0;

    rep2(i, n) {
        if (dist[0][i] <= dist[1][i]) black++;
        else white++;
    }

    if (black > white) cout << "Fennec" << endl;
    else cout << "Snuke" << endl;

    return 0;
}



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

int main(){
  long long int a,b;
  cin >> a >> b;
  long long int ans = 0;
  for(int i = 0; 62 > i; i++){
    long long int mod = 1LL << (1 + i);
    ans += mod/2*(((b/mod - a/mod) * (mod/2) - max(0LL, a%mod - mod/2) + max(0LL,b%mod - mod/2 + 1))%2);
  }
  cout <<ans<<endl;
 return 0; 
}

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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var abc = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Array.Sort(abc);
            Console.WriteLine(abc[0] + abc[1]);
        }
    }
}


Measured memory_bytes: 13396
import java.util.Scanner;
class Main{
  public static void main(String... args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
    if(a+b+c >= 22){
      System.out.println("bust");
    }else{
      System.out.println("win");      
    }
  }
}

Measured memory_bytes: 21716
#include<iostream>
#include<algorithm>
using namespace std;
main(){
	int n,h,w;
	cin>>n>>h>>w;
	int ai[1050],bi[1050];
	int c=0,d;
 for(int i=0;i<n;i++){
     	cin>>ai[i];
     	cin>>bi[i];
	 }
	for(int i=0;i<n;i++){
		if(ai[i]>h||ai[i]==h)if(bi[i]>w||bi[i]==w)c++;
	}
	cout<<c;
} 

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <iomanip>
#include <cmath>


using namespace std;
using ull = unsigned long long;

constexpr double Pi = 3.141592653;

int main()
{
    double a, b, cAngle;
    cin >> a >> b >> cAngle;

    cAngle = cAngle * 2 * Pi / 360.0;

    double S = a * b * sin(cAngle) / 2;
    double L = a + b + sqrt(a*a + b*b - 2 * a * b * cos(cAngle));
    double h = b*sin(cAngle);

    cout << fixed;
    cout << setprecision(8) << S << " " << L << " " << h << endl;


    return 0;
}

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

int main() {
  int N, M, sum=0; cin >> N >> M;
  for (int i=0; i<M; i++) {
    int A; cin >> A;
    sum += A;
  }
  if (N>=sum) cout << N-sum << endl;
  else cout << "-1" << endl;
}
  

Measured memory_bytes: 3640
import java.util.*;
public class Main {
   static Scanner sc = new Scanner(System.in);

   public static void main(String[] args) {
      int N = sc.nextInt();
      int M = sc.nextInt();
      int X = sc.nextInt();
      int Y = sc.nextInt();
      int Z;
      String msg = "War";
      int[] xAr = new int[N];
      int[] yAr = new int[M];


      for (int i = 0; i < N; i++) {
         xAr[i] = sc.nextInt();
      }
      Arrays.sort(xAr);
      for (int i = 0; i < M; i++) {
         yAr[i] = sc.nextInt();
      }
      Arrays.sort(yAr);

      for (Z = X + 1; Z <= Y; Z++) {
         if (Z > xAr[N - 1] && Z <= yAr[0]) {
            msg = "No War";
            break;
         }
      }

      System.out.println(msg);
   }
}

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

#define MOD 1000000007
#define MODSET(d) if ((d) >= MOD) d %= MOD;

using namespace std;

int arr[205];

int main()
{
    #ifdef VSP4
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

	int n, i, j, ans = 0;
	
	cin >> n;
	
	for (i = 0; i < 2*n; i++)
	{
		cin >> arr[i];
	}
	
	sort(arr, arr + 2*n);
	
	for (i = 2*n-2; i >=0; i-=2)
	{
		ans += arr[i];
	}
	
	cout << ans;
		
    return 0;
}


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

char maps[22][22];
int count;
int me[2];
int w,h;

void init(){
  for(int i = 0; i < 22; i++){
    for(int j = 0; j < 22; j++){
      maps[i][j] = '#';
    }
  }
}

void where(int w,int h){
  for(int i = 0; i < h; i++){
    for(int j = 0; j < w; j++){
      if(maps[i][j] == '@'){
	me[0] = i;
	me[1] = j;
	maps[i][j] = '.';
	return;
      }
    }
  }
}

void search(int y, int x){
  maps[y][x] = '#';
  count++;
  if(maps[y - 1][x] == '.' && y > 0){
    search(y - 1, x);
  }
  if(maps[y + 1][x] == '.' && y < h){
    search(y + 1, x);
  }
  if(maps[y][x - 1] == '.' && x > 0){
    search(y, x - 1);
  }
  if(maps[y][x + 1] == '.' && x < w){
    search(y, x + 1);
  }
  return;
}
  
int main(){
  while(true){
    // input 
    cin >> w >> h;
    if(!w && !h){
      break;
    }
    init();
    for(int i = 0; i < h; i++){
      cin >> maps[i];
    }
    count = 0;
    where(w, h);
    search(me[0], me[1]);

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

Measured memory_bytes: 0
#include <stdio.h>

int main(void){
  long long int n, a, b, h[100000], i, max=0, right, left, mid, re;
  scanf("%lld%lld%lld", &n, &a, &b);
  for(i=0; i<n; ++i){
    scanf("%lld", &h[i]);
    if(h[i] > max) max = h[i];
  }
  right = max / b + 1;
  left = max / a;
  while(right - left > 1){
    mid = (right + left)/2;
    re = 0;
    for(i=0; i<n; ++i){
      if(h[i] > mid*b){
	re += (h[i]-mid*b)%(a-b) ? (h[i]-mid*b)/(a-b)+1:(h[i]-mid*b)/(a-b);
      }  
    }
    if(re>mid) left=mid;
    else right=mid;
  }
  printf("%lld\n", right);
  return 0;
}

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;

signed main(){
    int a,b,c;
    cin >> a >> b >> c;
    if(a == b && b == c) cout << 1 << '\n';
    else if(a == b || c == b || a == c) cout << 2 << '\n';
    else cout << 3 << '\n';

    return 0;
}


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

using namespace std;

int main(void)
{
    int N;
    cin >> N;
    vector<int> V(N);
    vector<int> C(N);

    for(int i = 0; i < N; i++){
        cin >> V[i];
    }
    for(int i = 0; i < N; i++){
        cin >> C[i];
    }
    int cost = 0;
    for(int i = 0; i < N; i++){
        if(C[i] < V[i]){
            cost += V[i] - C[i];
        }
    }

    cout << cost << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <functional>
#include <queue>
#include <map>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
const int INF = 100000000;

int main(){
    int a, b, x, y;
    scanf("%d%d%d%d", &a, &b, &x, &y);
    printf("%1f %d\n", double(a)*double(b)/2, x + x == a && y + y == b);
}

Measured memory_bytes: 384
#include <iostream>
using namespace std;
int int_pow(int,int);
int main(){
	int n,k;
	cin >> n >>k;
	for(int i = 1;1;i++){
		if(n < int_pow(k,i)){
			cout << i;
			return 0;
		}
	}
	return 0;
}

int int_pow(int x,int y){
	int ans = 1;
	for(int i = 0;i <= y -1;i ++){
		ans *= x;
	}
	return ans;
}


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) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//        String[] str = br.readLine().split(" ");
        int n = Integer.parseInt(br.readLine());
        int a = 128;
        for (; a > n; a /= 2);
        System.out.println(a);

    }
}


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

long long gcd(long long a,long long b){
  if(max(a,b)%min(a,b)==0){
  return min(a,b);
  }
  else{
  return gcd(min(a,b),max(a,b)%min(a,b));
  }
}

int main(){
  int n;
  cin>>n;
  vector<long long>x(n);
  for(int i=0;i<n;i++){
  cin>>x[i];
  }
  int j=2;
  long long ans=gcd(x[0],x[1]);
  while(j<n){
  ans=gcd(ans,x[j]);
  j++;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 1024
package main

import (
	"bufio"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"strconv"
	"strings"
)

func (p *problem) solve() {
	N := p.NextInt()
	if N < 1000 {
		p.Printf("ABC")
	} else {
		p.Printf("ABD")
	}
}

var (
	debug  bool
	output string
)

func main() {
	flag.BoolVar(&debug, "debug", false, "Print debug logs")
	flag.BoolVar(&debug, "d", false, "Print debug logs")
	flag.StringVar(&output, "output", "stdout", "Specify output target (Default: stdout)")
	flag.StringVar(&output, "o", "stdout", "Specify output target (Default: stdout)")
	flag.Parse()

	if debug {
		out := os.Stdout
		if output != "stdout" {
			logfile, err := os.OpenFile(output, os.O_CREATE|os.O_WRONLY, 0666)
			if err != nil {
				panic(err)
			}
			defer logfile.Close()
			out = logfile
		}
		log.SetOutput(out)
	} else {
		log.SetOutput(ioutil.Discard)
	}

	p := problem{
		in:  bufio.NewReader(os.Stdin),
		out: bufio.NewWriter(os.Stdout),
	}
	p.solve()

	if err := p.out.Flush(); err != nil {
		panic(err)
	}
}

type problem struct {
	in  *bufio.Reader
	out *bufio.Writer
}

func (p *problem) PrintInt(d int) {
	p.Printf("%d\n", d)
}

func (p *problem) Printf(format string, a ...interface{}) {
	if _, err := fmt.Fprintf(p.out, format, a...); err != nil {
		panic(err)
	}
}

func (p *problem) Printfln(format string, a ...interface{}) {
	if _, err := fmt.Fprintf(p.out, fmt.Sprintf("%v\n", format), a...); err != nil {
		panic(err)
	}
}

func (p *problem) NextInt() int {
	return stoi(p.Next())
}

func (p *problem) NextInts() []int {
	line := p.NextSSLine()
	ds := make([]int, len(line))
	for i, s := range line {
		ds[i] = stoi(s)
	}
	return ds
}

func (p *problem) NextSSLine() []string {
	return strings.Split(p.Next(), " ")
}

// Next reads line and return string.
func (p *problem) Next() string {
	var b []byte
	for {
		l, pre, err := p.in.ReadLine()
		if err != nil {
			panic(err)
		}
		b = append(b, l...)
		if !pre {
			break
		}
	}
	return string(b)
}

func stoi(s string) int {
	i, err := strconv.Atoi(s)
	if err != nil {
		fmt.Println(i)
		fmt.Println(err)
	}
	return i
}


Measured memory_bytes: 640
#include<iostream>
#include<vector>
using namespace std;
vector<int> memo;
int fib(int n){
    if(n==1||n==0){
        return 1;
    }
    if(memo[n]==-1){
        memo[n] = fib(n - 1) + fib(n - 2);
    }
    return memo[n];
}


int main(){
    int n ;
    cin >> n;
    memo = vector<int>(n + 1, -1);
    cout << fib(n)<<endl;
}



Measured memory_bytes: 3144
import java.io.*
import java.util.*


fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val N = sc.next().toInt()
    when(N){
        1 -> { println("Hello World") }
        2 -> { println(sc.next().toInt() + sc.next().toInt()) }
        else -> {println("Error")}
    }
}



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

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define fr(i,k,n) for (int i = k; i < n; ++i)
#define fri(i,k,n) for (int i = k; i >= n; --i)
#define INF (int)1e9
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define all(arr) arr.begin(),arr.end()

void boost(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

void solve(){
	string s,t;
	cin>>s>>t;
	string t1;
	int len=t.size(),len2=s.size();
	int mn=INF;
	fr(i,0,len2-len+1){
		t1=s.substr(i,len);
		int cnt=0;
		fr(j,0,len){
			if(t1[j]!=t[j])
				cnt++;
		}
		mn=min(mn,cnt);
	}
	cout<<mn<<endl;
	return;
}

int main()
{
	boost();
	
	int tc=1;
	//cin>>tc;
	while(tc--)
		solve();
	return 0;
}

Measured memory_bytes: 3648
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do(): 
    n=INT()
    n=n%1000
    if n==0:
        n=1000
    print(1000-n)
if __name__ == '__main__':
    do()

Measured memory_bytes: 9188