akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

void yes() { cout << "Yes" << endl; exit(0); }
void no() { cout << "No" << endl; exit(0); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> void amax(T &x, T y) { x = max(x, y); }
template <typename T> void amin(T &x, T y) { x = min(x, y); }
template <typename T> T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

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

void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vi32 a(n);
  rep(i, n) a[i] = s[i] - '1';
  auto g = [](int a, int b) {
    while (a || b) {
      if ((a & 1) == 0 && (b & 1) == 1) return false;
      a >>= 1, b >>= 1;
    }
    return true;
  };
  auto f = [&](vi32 a) {
    int n = sz(a);
    int acc = 0;
    rep(i, n) {
      if (g(n - 1, i)) {
        acc += a[i] & 1;
        acc %= 2;
      }
    }
    return acc;
  };
  if (f(a)) {
    cout << 1 << endl;
    return;
  }
  bool one = false;
  rep(i, n) one |= a[i] == 1;
  if (one) {
    cout << 0 << endl;
    return;
  }
  rep(i, n) a[i] >>= 1;
  cout << f(a) * 2 << endl;
}


Measured memory_bytes: 9176
#include <iostream>
#include <stdio.h>
using namespace std;
int main(void){
    int a,b,c,d,e,f,n;
    int T,F;
    char A;
    cin >> a >> b >>c >> d >> e >> f >> n;
    
    for(;n>0;n=n-1){
    
    
    
    cin >> T >> F;
    if(T==a&&F==b){
        cout << c << endl;
    }else if(T==a&&F==c){
        cout << e << endl;
    }else if(T==a&&F==d){
        cout << b << endl;
    }else if(T==a&&F==e){
        cout << d << endl;
    }else if(T==b&&F==f){
        cout << c << endl;
    }else if(T==b&&F==c){
        cout << a << endl;
    }else if(T==b&&F==a){
        cout << d << endl;
    }else if(T==b&&F==d){
        cout << f << endl;
    }else if(T==c&&F==b){
        cout << f << endl;
    }else if(T==c&&F==f){
        cout << e << endl;
    }else if(T==c&&F==e){
        cout << a << endl;
    }else if(T==c&&F==a){
        cout << b << endl;
    }else if(T==d&&F==b){
        cout << a << endl;
    }else if(T==d&&F==a){
        cout << e << endl;
    }else if(T==d&&F==e){
        cout << f << endl;
    }else if(T==d&&F==f){
        cout << b << endl;
    }else if(T==e&&F==a){
        cout << c << endl;
    }else if(T==e&&F==c){
        cout << f << endl;
    }else if(T==e&&F==f){
        cout << d << endl;
    }else if(T==e&&F==d){
        cout << a << endl;
    }else if(T==f&&F==b){
        cout << d << endl;
    }else if(T==f&&F==d){
        cout << e << endl;
    }else if(T==f&&F==e){
        cout << c << endl;
    }else if(T==f&&F==c){
        cout << b << endl;
    }
    
    }
    
    
}


Measured memory_bytes: 3116
#include <iostream>
using namespace std;
typedef long long ll;

ll rec(ll n, ll m){
    if(n % m == 0) return m * (2 * (n / m) - 1);
    return rec(m, n % m) + m * (2 * (n / m));
}

int main()
{
    ll n, x;
    cin >> n >> x;
    cout << n + rec(max(x, n - x), min(x, n - x)) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define mp make_pair
#define endl '\n'
typedef long long ll;
 
const int INF=1e9+5;
const ll lim=(ll)3e16;
const int N=1e5+5;
const int maxP=7;
const int mod=1e9+7;
const ll oo=1e18+5;
 
int n,m;

int main(){
	ios::sync_with_stdio(false); cin.tie(NULL);
	cin>>n>>m;
	vector<int> ans(n,-1);
	bool check=1;
	for(int i=0;i<m;++i){
		int pos,num;
		cin>>pos>>num;
		if(ans[pos-1]!=-1&&ans[pos-1]!=num){
			check=0;
		}
		else{
			ans[pos-1]=num;
		}
	}
	if(!check||(ans[0]==0&&n>1)){
		return cout<<-1,0;
	}
	for(int i=0;i<n;++i){
		if(ans[i]!=-1) cout<<ans[i];
		else if(i==0&&n>1) cout<<1;
		else cout<<0;
	}
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
using namespace std;
typedef long long ll;

//定義場所//
int i, j, k, l, m, n;
int W, N, K;
////////////

int main()
{
	string S;
	cin >> S;
	string A = S.substr(0, 2);
	string B = S.substr(2, 2);
	int p, q;
	if (A.at(0) != '0' && A.at(1) != '0' && A.at(1) != '1' && A.at(1) != '2') {
		p = 0;
	}
	else if (A.at(0) == '0' && A.at(1) == '0') {
		p = 0;
	}
	else {
		p = 1;
	}
	if (B.at(0) != '0' && B.at(1) != '0' && B.at(1) != '1' && B.at(1) != '2') {
		q = 0;
	}
	else if (B.at(0) == '0' && B.at(1) == '0') {
		q = 0;
	}
	else {
		q = 1;
	}
	if (p == 0 && q == 0) {
		cout << "NA";
	}
	else if (p == 1 && q == 1) {
		cout << "AMBIGUOUS";
	}
	else if (p == 1 && q == 0) {
		cout << "MMYY";
	}
	else {
		cout << "YYMM";
	}

}

Measured memory_bytes: 256
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {
	private static final int MOD = 1000000007;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		int sum = 0;
		if (A < 6) {
			sum += 0;
		} else if (A <= 12) {
			sum += B / 2;
		} else {
			sum += B;
		}

		System.out.println(sum);
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public char nextChar() throws IOException {
			return (char) skip();
		}

		public int nextInt() throws IOException {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}

Measured memory_bytes: 20564
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int inf = INT_MAX;
const ll INF = LLONG_MAX;
const ll MOD = 1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b, const ll mod=MOD) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b, const ll mod=MOD) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b, const ll mod=MOD) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b, const ll mod=MOD) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    string in; cin >> in;
    vector<string> T = {"Sunny", "Cloudy", "Rainy"};
    string res = T[0];
    rep(i, 2){
        if(in == T[i]){
            res = T[i + 1];
        }
    }

    cout << res << endl;

    return 0;
}


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

using namespace std;

#define INF 1e9
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

ll N,K, ans = 1;

void solve(){
    rep(i,N){
        if(ans < K)
            ans *= 2;
        else
            ans += K;
    }
    cout << ans << endl;
}

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

    solve();
}


Measured memory_bytes: 256
class abc_164:
    
    def __init__(self):
        pass
    
    def A(self):
        sw=list(map(int,input().split()))
        print("unsafe") if sw[1]>=sw[0] else print("safe")
    
    def B(self):
        abcd=list(map(int,input().split()))
        while(abcd[0]!=0 and abcd[2]!=0):
            abcd[2]=abcd[2]-abcd[1]
            abcd[0]=abcd[0]-abcd[3]
            
            if abcd[2]<=0:
                print("Yes")
                break
            elif abcd[0]<=0:
                print("No")
                break
            else:
                pass
            
    def C(self):
        N=int(input())
        S = [input() for i in range(N)]
        print(len(list(set(S))))
    
    def D(self):
        pass
    
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_164()
    obj.C()

Measured memory_bytes: 110716
#pragma region header
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cctype>
#include <assert.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#include <cstring>
#include <array>
// ===============================================================
//using系
#pragma region header
using namespace std;
using lint = long long;
using ld = long double;
using ulint = unsigned long long;
const int dx[] = { 1,0,-1,0 };
const int dy[] = { 0,1,0,-1 };
constexpr lint mod = 1000000007;
constexpr long double pi = 3.141592653589793238462643383279;
#pragma endregion
// ========================================================================
//define
#define INF (lint)10000000000000000;
#define mod (int)1000000007
#pragma region header
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
#pragma endregion
#pragma endregion

lint gcd(lint a, lint b) {
	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}
lint lcm(lint a, lint b) {
	return a * b / gcd(a, b);
}

int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(0);
	lint a, b; cin >> a >> b;
	vector<lint> d;
	lint cnt = 1;
	lint x = gcd(a, b);
	for (lint i = 2; i * i <= x; i++) {
		if (x % i == 0) {
			cnt++;
			while (x % i == 0) x /= i;
		}
	}
	if (x != 1) cnt++;
	cout << cnt << endl;

	return 0;
}

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

int main(){
	long int n,m,p,i,array[100],a,price;
	long double pd,priced,tmpp;
	while(cin >> n >> m >> p && (n != 0 || m != 0 || p != 0)){
		memset(array,0,sizeof(array));
		price = 0;
		tmpp = (double)p;
		pd = (double)(1.0 - (tmpp / 100.0) + 1e-8);
		for(i = 0;i < n;i++){
			cin >> a;
			array[i] = a;
			price += a * 100;
		}
		priced = (double)(price * pd);
		if(array[m-1] != 0){
			cout << (int)(priced / array[m-1]) << endl;
		}
		else {
			cout << 0 << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 0
MOD = 10**9 + 7
list_size = 1001

f_list = [1] * list_size
f_r_list = [1] * list_size

for i in range(list_size - 1):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % MOD)

f_r_list[-1] = pow(f_list[-1], MOD - 2, MOD)

for i in range(2, list_size + 1):
	f_r_list[-i] = int((f_r_list[-i + 1] * (list_size + 2 - i)) % MOD)

def comb(n, r):
	if n < r:
		return 0
	elif n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % MOD) * f_r_list[r - 1]) % MOD

def comb_suc(n, r, k):
	if n == r*k:
		return (f_list[n-1] * pow(f_r_list[r-1], k, MOD) * f_r_list[k-1]) % MOD
	else:
		return (f_list[n-1] * f_r_list[n-(r*k)-1] * pow(f_r_list[r-1], k, MOD) * f_r_list[k-1]) % MOD

import sys
def input():
	return sys.stdin.readline()[:-1]

#print(comb(3, 3), comb_suc(3, 3, 1))
n, a, b, c, d = map(int, input().split())
dp = [[0 for _ in range(n+1)] for _ in range(b+1)]
dp[a-1][0] = 1
for i in range(a, b+1):
	for j in range(n+1):
		dp[i][j] += dp[i-1][j]
		if j-c*i >= 0:
			for k in range(c, min(d+1, j//i+1)):
				#print(i, j, k)
				dp[i][j] += dp[i-1][j-k*i] * comb_suc(n-(j-k*i), i, k)
		dp[i][j] %= MOD
#for i in range(b+1):
#	print(dp[i])
print(dp[b][n])

Measured memory_bytes: 131804
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define yoi cout<<"yo"<<endl;
#define debug(x) cerr << #x << " is " << x << endl;
#define all(x) x.begin(),x.end()
const lli inf=1e18;
const int mod=1e9+7;
int main(){
IOS;
lli n,i,j,sum=0;
cin>>n;
lli a[n];
for(i=0;i<n;i++)
    cin>>a[i];
for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
        sum+=a[i]*a[j];
    }
}
cout<<sum<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
signed main(){
  string S; cin>>S;
  rep(i,0,S.size()) cout<<'x';
  cout<<endl;
  }



Measured memory_bytes: 256
#include <stdio.h>

int main() {
    int a[3], d;
    scanf("%d %d %d", &a[0], &a[1], &a[2]);
    d = a[1] + a[2];
    for(int i = 0; i < 3; i++) {
        if(a[(i+1)%3] < a[(i+2)%3]){
            if(a[i]<d)
                d = a[i] + a[(i+1)%3];
        } 
    }
    printf("%d", d);

    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define PI 3.14159265359

#define int long long
int N;
int h[100005];
int dp[100005];

int solve(int now){
	if(now == N-1) return 0;
	if(now >= N) return INT_MAX;
	if(dp[now] != INT_MAX) return dp[now];
	int a = abs(h[now]-h[now+1]) + solve(now+1);
	int b = abs(h[now]-h[now+2]) + solve(now+2);
	return dp[now] = min((LL)INT_MAX,min(a,b));
}

#undef int

int main(){
	cin >> N;
	for(int i=0; i<N; i++){
		cin >> h[i];
		dp[i] = INT_MAX;
	}
	h[N] = 0;
	cout << solve(0) << endl;

	return 0;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  ll a,b,c,d;
  cin >> a >> b >> c >> d;
  ll A=(a-1)/d+1,B=(c-1)/b+1;
  if(A>=B){
    cout << "Yes" << endl;
  }
  else
    cout << "No" << endl;
}

Measured memory_bytes: 3616
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define N 101010
LL n , a[ N ];
int main(){
  scanf( "%lld" , &n );
  for( LL i = 0 ; i < n ; i ++ )
    scanf( "%lld" , &a[ i ] );
  sort( a , a + n );
  LL bst = a[ 0 ];
  for( LL i = 1 ; i + 1 < n ; i ++ )
    if( min( a[ i ] , a[ n - 1 ] - a[ i ] ) >
        min( bst    , a[ n - 1 ] - bst ) )
      bst = a[ i ];
  cout << a[ n - 1 ] << " " << bst << endl;
}


Measured memory_bytes: 1024
from collections import Counter
n,k,l = map(int,input().split())
e1 = [[] for _ in range(n)]
e2 = [[] for _ in range(n)]

for _ in range(k):
    p,q = map(int,input().split())
    e1[p-1].append(q-1)
    e1[q - 1].append(p - 1)

for _ in range(l):
    p,q = map(int,input().split())
    e2[p-1].append(q-1)
    e2[q - 1].append(p - 1)

g1 = [-1]*n
for i in range(n):
    if g1[i] != -1:
        continue
    g1[i] = i
    s = [i]
    while s:
        v = s.pop()
        for d in e1[v]:
            if g1[d] != -1:
                continue
            g1[d] = i
            s.append(d)
g2 = [-1]*n
for i in range(n):
    if g2[i] != -1:
        continue
    g2[i] = i
    s = [i]
    while s:
        v = s.pop()
        for d in e2[v]:
            if g2[d] != -1:
                continue
            g2[d] = i
            s.append(d)
g = []
for i in range(n):
    g.append((g1[i], g2[i]))
c = Counter(g)
f = [c[g[i]] for i in range(n)]
print(' '.join(map(str, f)))

Measured memory_bytes: 100008
import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	long a = scan.nextLong() - 1;
      	long b = scan.nextLong();
      	long c = scan.nextLong();
      	long d = scan.nextLong();
      	long g = gcd(c,d);
      	long l = c * d / g;
      	long countb, counta;
      	countb = b - b/c - b/d + b/l;
      	counta = a - a/c - a/d + a/l;
        
      	System.out.print(countb - counta);
    }
  	public static long gcd(long m , long n){
      if(n == 0){
      	return m;
      }
      else{
        	return gcd(n, m%n);
      }
    }
 
}

Measured memory_bytes: 23764
import java.util.Scanner;
import java.util.stream.*;
class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        long[] A = new long[N];
        long[] B = new long[N];
        for(int i=0;i<N;++i){
            A[i] = scan.nextLong();
            B[i] = scan.nextLong();
        }
        long ans = 0;
        for(int i=N-1;i>=0;--i){
            ans += (B[i] - (A[i]+ans)%B[i])%B[i];
        }
        System.out.println(ans);

    }
}

Measured memory_bytes: 90060
H, W = list(map(int, input().split()))
S = []
for _ in range(H):
  S.append([0 if s == '.' else s for s in input()])
  
posi = [(-1,-1), (-1,0), (-1,1), (0, -1), (0, 1), (1, -1), (1,0), (1,1)]
for h in range(H):
  for w in range(W):
    koushin = [1]*8
    if S[h][w] == '#':
      if h == 0:
        koushin[0],koushin[1],koushin[2] = 0,0,0
      if h == H-1:
        koushin[5],koushin[6],koushin[7] = 0,0,0
      if w == 0:
        koushin[0],koushin[3],koushin[5] = 0,0,0
      if w == W-1:
        koushin[2],koushin[4],koushin[7] = 0,0,0
      for i in range(8):
        if koushin[i]:
          if S[h+posi[i][0]][w+posi[i][1]] != '#':
            S[h+posi[i][0]][w+posi[i][1]] += 1

for Si in S:
  print(''.join(map(str, Si)))

Measured memory_bytes: 3064
def g;gets.split.map &:to_i;end
def f a,b,c,e,m;[a,b]==e||[[a,b+1],[a,b-1],[a+1,b],[a-1,b]].any?{|i,j|m[j][i]==c&&(m[j][i]=7;f i,j,c,e,m)}end
while(w,h=g)[0]>0
s,t=g
e=g
m=[v=[6]*w*2]+(1..h).map{[6]+[0]*w+v}<<v
g[0].times{c,d,x,y=g;o=d<1?4:2;m[y,6-o].map{|i|i[x,o]=[c]*o}}
puts f(s,t,m[t][s],e,m)?:OK:"NG"end

Measured memory_bytes: 8064
import math
n,d = map(int,input().split())
xy = [list(map(int,input().split())) for _ in range(n)]

cnt = 0
for i in range(n):
    x,y = xy[i][0],xy[i][1]
    if math.sqrt(x**2+y**2) <= d:
        cnt += 1

print(cnt)


Measured memory_bytes: 45460
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define endl "\n"
#define MOD 1000000007
#define inf -100000000
#define ordered_set tree<pair<ll int,ll int>, null_type,less<ll int>, rb_tree_tag,tree_order_statistics_node_update> 
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
using namespace std;
using namespace __gnu_pbds; 
int main()
{
    fast;
   // #ifndef ONLINE_JUDGE
   // freopen("input.txt", "r", stdin);
   // freopen("output.txt", "w", stdout);
   // #endif
    string s;
    cin>>s;
    if(s=="ABC")
    	cout<<"ARC";
    else
    	cout<<"ABC";
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

const int INF = 1001001001;

 
int main(){
    int n, w;
    cin >> n >> w;
    vec<vec<ll>> dp(n+1, vec<ll>(2*w));
    
    rep(i, n) {
        int wi, vi; 
        cin >> wi >> vi;
        rep(j, w+1) {
            //dp[i+1][j+wi] = max(dp[i][j+wi], dp[i][j] + vi);
            //cout << "dp" << i+1 << "," << j+wi << "= max of " << dp[i][j+wi] << "," << dp[i][j] + vi << endl;
            if (j-wi<0) dp[i+1][j] = dp[i][j];
            else dp[i+1][j] = max(dp[i][j-wi]+vi, dp[i][j]); 
        }
    }

    // int ans = 0;
    // rep(j, w+1) ans = max(ans, dp[n][j]), cout << dp[n-1][j] << endl;
    // cout << ans << endl;
    cout << dp[n][w] << endl;
}

Measured memory_bytes: 159744
var output;
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){return null;}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//不明値:何もしない 1:数値へ変換 2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字に分割  7:1文字に分割し、数値配列へ
//8:半角SPで結合　9:改行で結合　0:文字なしで結合
function myconv(i,no){switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}
function Main() {
  var H = myconv(next(),1);
  var W = myconv(next(),1);
  var N = myconv(next(),1);
  output = Math.min(Math.ceil(N/H),Math.ceil(N/W));
  myout(output);
}

Measured memory_bytes: 11468
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int c = sc.nextInt();

    int res = 0;

    int[] b = new int[m];

    for (int i = 0; i < m; ++i)
      b[i] = sc.nextInt();

    for (int i = 0; i < n; ++i) {
      int sum = c;
      for (int j = 0; j < m; ++j)
        sum += b[j] * sc.nextInt();
      res = (sum > 0) ? res + 1 : res;
    }

    System.out.println(res);
  }
}


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

const int INF = 2e9;

int main(){
    string n;
    cin >> n;
    ll h = 0;
    rep(i,n.size()){
        int a = n[i];
        a -= 48;
        h += a;
    }
    if(h%9 == 0)cout << "Yes" << endl;
    else cout << "No" << endl; 
}

Measured memory_bytes: 3744
#include "cstdio"
#include "algorithm"
using namespace std;
int main()
{
	int a[101];
	int n;
	scanf("%d",&n);
	int i,j;
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	int tot=0;
	for(i=1;i<n;i++)
		tot+=a[i];
	printf("%d\n",tot+a[n]/2);
	return 0;
}

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

typedef long long ll;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(a) a.begin(), a.end()

const int maxn = 200010;
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;
ll n, m, a[maxn];
map<int, int> M, N;
set<int> S;
string s;

void solve()
{
    cin >> n;
    for(int i = 0; i < n; i++) cin >> a[i];
    int cnt=0, cnt2=0;
    for(int i = 0; i < n; i++)
    {
        if(a[i]%4==0)cnt++;
        else if(a[i]%2==0)cnt2++;
    }

    if(n>2*cnt+cnt2+1) cout << "No\n";
    else if(cnt2!=0 and 2*cnt+cnt2==n-1) cout << "No\n";
    else cout << "Yes\n";
}
//1212135 34343434343
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int t=1; //cin >> t;
    while(t--) solve();
}


Measured memory_bytes: 4412
import collections                                                              
                                                                                
N = int(input())                                                                
S = []                                                                          
for i in range(N):                                                              
    S.append(input().strip())                                                   
counter = collections.Counter(S)                                                
common_word_num = counter.most_common()[0][1]                                   
                                                                                
ans = [i[0] for i in counter.items() if i[1] == common_word_num]                
ans.sort()                                                                      
for w in ans:                                                                   
    print(w)                                                                   

Measured memory_bytes: 45040
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(100000)

def insert(k, node):
    if k < node:
        if tree[node]["left"] == None:
            tree[node]["left"] = k
            tree[k] = {"parent": node, "left": None, "right": None}
            return
        else:
            insert(k, tree[node]["left"])
    else:
        if tree[node]["right"] == None:
            tree[node]["right"] = k
            tree[k] = {"parent": node, "left": None, "right": None}
            return
        else:
            insert(k, tree[node]["right"])


def pre_order(n):
    result = []
    if n == None:
        return []
    result.append(str(n))
    result.extend(pre_order(tree[n]["left"]))
    result.extend(pre_order(tree[n]["right"]))
    
    return result


def in_order(n):
    result = []
    
    if n == None:
        return []

    result.extend(in_order(tree[n]["left"]))
    result.append(str(n))
    result.extend(in_order(tree[n]["right"]))
    
    return result


M = int(input())
root = "nan"
while root == "nan":
    inp = [n for n in input().split()]
    if inp[0] == "print":
        print()
        print()
    else:
        root = int(inp[1])

tree = {root:{"parent": None, "left": None, "right": None}}

for i, _ in enumerate(range(M-1)):
    inp = [n for n in input().split()]
    if inp[0] == "print":
        in_text = ""
        pre_text = ""
        print(" " + " ".join(in_order(root)))
        print(" " + " ".join(pre_order(root)))
    else:
        insert(int(inp[1]), root)
        #if i%1000 == 0:
        #    print("done {}/{}".format(i, M))

Measured memory_bytes: 234344
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;

#define rep(i,N) for(ll i=0;i<(ll)N;++i)

ll GCD(ll x, ll y) {
    if (y == 0) return x;
    else return GCD(y, x % y);
}

#include <iostream>

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

    vector<ll> d(K);

    deque<ll> e;

    rep(i, K) {
        cin >> d[i];
        rep(j, d[i]) {
            ll a;
            cin >> a;
            e.push_front(a);
        }
    }

    sort(e.begin(), e.end());
    e.erase(unique(e.begin(), e.end()), e.end());

    ll s = e.size();

    cout << N - s << endl;

}

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

public class Test
{
	public static void Main()
	{
		// your code goes here
		
		int n = int.Parse(Console.ReadLine());
		var a = Console.ReadLine().Split().Select(x => double.Parse(x)).ToArray();
		double gyakusum = 0;
		double itizi = 0;
		double answer = 0;
		
		for(int b=0; b!=n; b++){
			itizi = 1 / a[b];
			gyakusum = gyakusum + itizi;
		}
		
		answer = 1 / gyakusum;
		Console.WriteLine(answer);
		
		
	}
}

Measured memory_bytes: 11348
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MOD 1000000007
using namespace std;

int dp[4001],n,a,b,c,i;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n,m;
    cin >> n >> m;
    if(n==m) cout << "Yes";
    else cout << "No";
    cout << "\n";
    return 0;
}



Measured memory_bytes: 256
// import chie template :) {{{
import std.stdio,
       std.algorithm,
       std.array,
       std.string,
       std.math,
       std.conv,
       std.range,
       std.container,
       std.bigint,
       std.ascii;
// }}}
// tbh.scanner {{{
class Scanner {
  import std.stdio;
  import std.conv : to;
  import std.array : split;
  import std.string : chomp;

  private File file;
  private dchar[][] str;
  private uint idx;

  this(File file = stdin) {
    this.file = file;
    this.idx = 0;
  }

  private dchar[] next() {
    if (idx < str.length) {
      return str[idx++];
    }

    dchar[] s;
    while (s.length == 0) {
      s = file.readln.chomp.to!(dchar[]);
    }

    str = s.split;
    idx = 0;

    return str[idx++];
  }

  T next(T)() {
    return next.to!(T);
  }

  T[] nextArray(T)(uint len) {
    T[] ret = new T[len];

    foreach (ref c; ret) {
      c = next!(T);
    }

    return ret;
  }
}
// }}}

void main() {
  auto cin = new Scanner;
  int x = cin.next!int;
  int a = cin.next!int,
      b = cin.next!int;

  x -= a;
  writeln(x % b);
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
using namespace std;
#define INT(x) int x; scanf("%d",&x)
#define INPUT(x) scanf("%d",&x)
#define REP1(x,n) for(int x = 0; x < n; x++)
#define REP2(x,s,e) for(int x = s; x <= e; x++)
#define BR printf("\n")
#define INF 2000000000
#define NIL -1

struct Point{
    int x,y,id;
};

bool lessX(const Point &p1, const Point &p2) { return p1.x < p2.x;}
bool lessY(const Point &p1, const Point &p2) { return p1.y < p2.y;}

Point A[500000];

struct Node{
    int id,l,r,x,y;
};

Node T[500000];
int np = 0;

int make2Dtree(int l,int r,int d){
    if (r-l <= 0) return NIL;
    int mid = (l+r)/2;
    int t = np++;
    
    if (d == 0) sort(A+l,A+r,lessX);
    else sort(A+l,A+r,lessY);
    
    T[t].id = A[mid].id;
    T[t].x = A[mid].x;
    T[t].y = A[mid].y;
    T[t].l = make2Dtree(l,mid,(d+1)%2);
    T[t].r = make2Dtree(mid+1,r,(d+1)%2);
    
    return t;
}

vector<int> ans;

void findTree(int i,int xs,int xt,int ys,int yt,int d){
    if (d == 0) {
        if(xs <= T[i].x && T[i].l != NIL) findTree(T[i].l,xs,xt,ys,yt,1);
        if (xs <= T[i].x && T[i].x <= xt && ys <= T[i].y && T[i].y <= yt) ans.push_back(T[i].id);
        if(T[i].x <= xt && T[i].r != NIL) findTree(T[i].r,xs,xt,ys,yt,1);
    }else{
        if(ys <= T[i].y && T[i].l != NIL) findTree(T[i].l,xs,xt,ys,yt,0);
        if (xs <= T[i].x && T[i].x <= xt && ys <= T[i].y && T[i].y <= yt) ans.push_back(T[i].id);
        if(T[i].y <= yt && T[i].r != NIL) findTree(T[i].r,xs,xt,ys,yt,0);
    }
}

int main(){
    INT(n);
    REP1(i,n){
        scanf("%d %d",&A[i].x,&A[i].y);
        A[i].id = i;
    }
    make2Dtree(0,n,0);
    INT(q);
    REP1(i,q){
        int xs,xt,ys,yt;
        scanf("%d %d %d %d",&xs,&xt,&ys,&yt);
        findTree(0,xs,xt,ys,yt,0);
        sort(ans.begin(),ans.end());
        REP1(j,ans.size()) printf("%d\n",ans[j]);
        BR;
        ans.clear();
    }
    return 0;
}

Measured memory_bytes: 16660
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printv(x) for(int i = 0; i < x.size(); i++){ cout << (x[i]) << " "; } cout << endl; 
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define INF (1e9)
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    double A,B,C,D,E,F;
    cin >> A >> B >> C >> D >> E >> F;
    double density_max = 0;
    double water_max = 0;
    double sugar_max = 0;
    rep(i,0,101){
        rep(j,0,101){
            rep(k,0,101){
                rep(l,0,101){
                    double water = 100 * A * i + 100 * B * j;
                    double sugar = C * k + D * l;
                    if(water + sugar <= F && water + sugar != 0 && water != 0){
                        double density = 100 * sugar /(water + sugar);
                        double d_E = 100 * E / (100 + E);
                        if(density <= d_E){
                            if(density >= density_max){
                                density_max = density;
                                water_max = water;
                                sugar_max = sugar;
                            }

                        }
                    }
                }
            }

        }
    }
    cout << water_max + sugar_max << " " << sugar_max << endl;

}


Measured memory_bytes: 256
#include<stdio.h>
main(){
  int K,sum=0,x,i;
  while(scanf("%d",&K)){
    if(K==0)break;
    sum=0;
      for(i=0;i<K*(K-1)/2;i++){
	scanf("%d",&x);
	sum+=x;
      }
      printf("%d\n",sum/(K-1) );  
    }
}
    

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int main() {
    int W, H, x, y, r;
    cin >> W >> H >> x >> y >> r;

    if (x - r >= 0 && x + r <= W && y - r >= 0 && y + r <= H)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3096
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>
//<editor-fold desc="definitions">
#include <bits/stdc++.h>
#define se cout << "test ok" << endl;
#define sp << " " <<
#define enl "\n"
using namespace std;
using ll=long long;
using ld=long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using viii = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using vlll = vector<vector<vector<ll>>>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
ll mod = ll(1e9)+7;
ll inf = ll(1e18);
void bl(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void bl2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b){a=b; return true;} return false; }
template<typename T> inline bool chmin(T &a, T b){ if(a>b){a=b; return true;} return false; }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

#include <iostream>
#include <vector>
#include <map>
using namespace std;

namespace dbg {
    using ll = long long;

    class Debug {
    public:
        Debug(){}
        template<typename T>
        void vd(vector<T> vec);
        template<typename T>
        void vd2(vector<vector<T>> vec);
        template<typename T>
        void ad(T *arr, ll n);
        template<typename T, size_t N>
        void ad2(T (&arr)[N], ll n);
        template<typename T>
        void md(T mp);
    };

    template<typename T>
    void Debug::vd(vector<T> vec) {
        for (auto vv : vec) cout << vv << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::vd2(vector<vector<T>> vec) {
        for (auto vv : vec) {
            for (auto vvv : vv) cout << vvv << " ";
            cout << endl;
        }
    }

    template<typename T>
    void Debug::ad(T *arr, ll n) {
        for (int i = 0; i <= n; i++) cout << arr[i] << " ";
        cout << endl;
    }

    template<typename T, size_t N>
    void Debug::ad2(T (&arr)[N], ll n) {
        for (int i = 0; i <= N; i++) for (int j = 0; j <= n; j++) cout << arr[i][j] << " ";
        cout << endl;
    }

    template<typename T>
    void Debug::md(T mp) {
        cout << "key : value" << endl;
        for (auto const &m : mp) cout << m.first << " : " << m.second << endl;
        cout << endl;
    }

}

#endif //INCLUDE_DEBUG_HPP

dbg::Debug debug;
//</editor-fold>

class AWeLoveGolf {
public:
	void solve(std::istream& in, std::ostream& out) {
	    int a, b, k;
	    in >> k;
	    in >> a >> b;

	    bool flg = false;
	    for(int i=a; i<=b; i++){
	        if(i%k == 0) flg = true;
	    }

	    if(flg) out << "OK" << enl;
	    else out << "NG" << enl;
	}
};


int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
	AWeLoveGolf solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3672
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <climits>
using namespace std;

#define MOD1097 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mpair make_pair
#define pm(first, second) pb(mpair(first, second))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()
#define reall(X) (X).rbegin(), (X).rend()
#define divcel(a, b) (((a) + ((b) - 1)) / (b))

int main(){

	ll N, M;
	cin >> N >> M;
	cout << N*(N-1)/2 + M*(M-1)/2 << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String[] ss = sc.next().split("");
		int sum = 0;
		for(int i=0; i<ss.length; i++) {
			if(ss[i].equals("+")) {
				sum += 1;
			}else if(ss[i].equals("-")) {
				sum -= 1;
			}
		}
		System.out.println(sum);
	}
}


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

int main() {
  int a = 0, b = 0;
  cin >> a >> b;
  
  int ans = (a * b)%2;
  if (ans == 0) {
    cout << "Even" << endl;
  } else {
    cout << "Odd" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <set>
#include <utility>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
#include <cstdio>
#include <map>

using namespace std;

using ll = long long;
using P = pair<ll,ll>;

#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define rrep(i,x) for(ll i = ((ll)(x) - 1); i >= 0; i--)

#define all(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))

//ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};

const ll mod = 1e9 + 7;
const ll IMF = 1LL<<29;
const double PI = 3.14159265358979323846;






int main(){
        
        int n,m;
        cin >> n >> m;
        vector<int> broken(n+1);
        rep(i,m){
                int a;
                cin >> a;
                broken[a] = 1;
        }

        vector<int> dp(n+2);
        dp[n] = 1;

        for(int i = n-1; i >= 0; i--){
                if(broken[i]){
                        dp[i] = 0;
                        continue;
                }
                dp[i] = (dp[i+1] + dp[i+2]) % mod;
        }

        int ans = dp[0] % mod;
        cout << ans << endl;

        return 0;

}



Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 5;
int n , k;
int arr[N];
int g , m;
int main(){
	scanf("%d %d" , &n , &k);
	for(int i = 1 ; i <= n ; ++i){
		scanf("%d" , arr + i);
	}
	g = arr[1];
	m = arr[1];
	for(int i = 2 ; i <= n ; ++i){
		g = __gcd(g , arr[i]);
		m = max(m , arr[i]);
	}
	if(k <= m && k % g == 0){
		printf("POSSIBLE\n");
	}
	else{
		printf("IMPOSSIBLE\n");
	}
}

Measured memory_bytes: 640
n,k = map(int,input().split()) 
a = list(map(int,input().split()))
max_a = [sum(a[0:k])]
exp = max_a[0]
for i in range(n-k):
    max_a.append(max_a[i]-a[i]+a[k+i])
    if max_a[i+1] > exp:
      exp = max_a[i+1]
print((k+exp)/2)

Measured memory_bytes: 24548
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#define PB	push_back
#define FOR(n)			for(int i = 0; i < n; ++i)
#define COUT(n)			cout << n << " " << flush
#define ALL(obj)		obj.begin(), obj.end()
using namespace std;

int main() {
	bool f = true;
	char s[5];
	cin >> s;

	FOR(3) {
		if (s[i] == s[i + 1]) {
			f = false;	break;
		}
	}

	if (f)
		cout << "Good" << endl;
	else
		cout << "Bad" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
    int n,m;
    scanf("%d%d", &n,&m);

    int one_to[n-2];
    int to_n[n-2];
    for(int i=0; i<n-2; i++){
        one_to[i] = 0;
        to_n[i] = 0;
    }

    for(int i=0; i<m; i++){
        int a,b;
        scanf("%d%d", &a, &b);

        if(a==1 && b!=n){
            one_to[b-2] = 1;
        }
        else if(a!= 1 && b==n){
            to_n[a-2] = 1;
        }
    }

    int res = 0;
    for(int i=0; i<n-2; i++){
        if(one_to[i]==1 && to_n[i]==1){
            res = 1;
        }
    }

    if(res){
        printf("POSSIBLE\n");
    }else{
        printf("IMPOSSIBLE\n");
    }

    return 0;
}

Measured memory_bytes: 1664
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void) {
	int n, x, t, ans;

	scanf("%d %d %d", &n, &x, &t);

	if (n % x == 0) {
		ans = (n / x) * t;
	}
	else {
		ans = (n / x + 1) * t;
	}

	printf("%d", ans);
}

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

int n,bil,arr[200001];

int main(){
	cin>>n;
	for(int i = 1;i <= n - 1;i++){
		cin>>bil;
		arr[bil]++;
	}
	for(int i = 1;i <= n;i ++){
		cout<<arr[i]<<endl;
	}
}


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


int main(void) {
	int N, A;
	int ans = 1;
	int updown = 0; // up = 1, down = -1

	cin >> N >> A;
	int preA = A;
	for (int i= 1; i < N; i++) {
		cin >> A;
		if (updown == 0) {
			if (preA < A) updown = 1;
			if (preA > A) updown = -1;
		}
		if ((updown == -1) && (preA < A)) {
			ans++;
			updown = 0;
		}
		if ((updown == 1) && (preA > A)) {
			ans++;
			updown = 0;
		}
		preA = A;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <string>
#include <algorithm>
#include <cmath>
#include <ctype.h>
using namespace std;
#define dump(a) cout << (a) << '\n';
typedef long long Int;
Int mod = 1e9+7;
Int MOD = 998244353;

int main() {
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    string t[] = {
        "KIHBR",
        "KIHBRA",
        "KIHBAR",
        "KIHBARA",
        "KIHABR",
        "KIHABRA",
        "KIHABAR",
        "KIHABARA",
        "AKIHBR",
        "AKIHBRA",
        "AKIHBAR",
        "AKIHBARA",
        "AKIHABR",
        "AIHABRA",
        "AKIHABAR",
        "AKIHABARA"
    };
    for (Int i = 0; i < 16; i++) {
        if (s == t[i]) {
            dump("YES");
            return 0;
        }
    }
    dump("NO");
    return 0;  
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include<bits/stdc++.h>
#include <utility>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1<<29)

using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int X,A,B;
  cin >> X >> A >> B;
  X-=A;
  cout << X%B << endl;
  return 0;
}

Measured memory_bytes: 256