akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>  // ver2.2.3
#define int long long
#define endl "\n"
#define ALL(v) (v).begin(),(v).end()
#define Vi vector<int>
#define VVi vector<Vi>
#define Vs vector<string>
#define Pii pair<int,int>
#define VPii vector<Pii>
#define Tiii tuple<int,int,int>
#define PQi priority_queue<int>
#define PQir priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define itos to_string
#define stoi stoll
#define FI first
#define SE second
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define sortr(v) sort(v,greater<>())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repeq(i,a,b) for(int i=a;i<=b;i++)
#define repreq(i,a,b) for(int i=a;i>=b;i--)
#define leng(n) (int)(log10(n)+1)
#define dem(a,b) ((a+b-1)/(b))
#define Vin(a) rep(iI,0,a.size())cin>>a[iI]
#define Vout(a) rep(lZ,0,a.size()-1)cout<<a[lZ]<<' ';cout<<a.back()<<endl
#define VVout(a) rep(lY,0,a.size()){Vout(a[lY]);}
#define VPout(a) rep(lX,0,a.size())cout<<a[lX].FI<<' '<<a[lX].SE<<endl
#define Verr(a) rep(iZ,0,a.size()-1)cerr<<a[iZ]<<' ';cerr<<a.back()<<endl
#define VVerr(a) rep(iY,0,a.size()){Verr(a[iY]);}
#define VPerr(a) rep(iX,0,a.size())cerr<<a[iX].FI<<' '<<a[iX].SE<<endl
#define INF 3000000000000000000  //  3.0*10^18(MAXの1/3くらい)
#define MAX LLONG_MAX
#define MOD 1000000007  //  10^9 + 7
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm
void uniQ(string &v){v.erase(unique(ALL(v)),v.end());}  //  圧縮
int mypow(int x, int n, int m){  //  累乗x^n(mod m)  O(log(n))
if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}



signed main() {
  cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(12);
  int n;
  string s;
  cin >> n >> s;
  uniQ(s);
  cout<<s.size()<<endl;
  return 0;
}

Measured memory_bytes: 512
#define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
#include <string.h>
typedef long long ll;
const int INF = 1e9+7;

void reverse(char *s, int n) {
	int i;
	char c;
	for (i = 0; i < n/2; i++) {
		c = s[i];
		s[i] = s[n - i - 1];
		s[n - i - 1] = c;
	}
}

void rotate(char *s, int n) {
	int len = strlen(s);
	reverse(s, n);
	reverse(s+n, len-n);
	reverse(s, len);
}

int main(int argc, char **argv)
{
	int i, m, h;
	char deck[256];
	
	for (;;) {
		scanf("%s", deck);
		if (strcmp(deck, "-") == 0) break;
		scanf("%d", &m);
		i = strlen(deck);
		for (i = 0; i < m; i++) {
			scanf("%d", &h);
			rotate(deck, h);
		}
		printf("%s\n", deck);
	}
	return 0;
}

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

int main(){
  string S;
  cin>>S;
  for(int i=0;i<S.length();i++){
    for(int j=i+1;j<S.length();j++){
      if(S.at(i)==S.at(j)){
        cout<<"no"<<endl;
        return 0;
      }
    }
  }
  cout<<"yes"<<endl;
  return 0;
}

      

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};


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

  ll n,a,b,c,d;
  cin >> n >> a >> b >> c >> d;

  string s;
  cin >> s;
  a--;
  b--;
  c--;
  d--;


  string ans = "Yes";
  bool dot_flag = false;
  char p = s[0];

  REP1(i, n){
    if(i >= a && i <= d && s[i] == '#' && p == s[i]){
      ans = "No";
      break;
    }
    else if(i >= b && i <= d && i != n-1){
      if(s[i] == '.' && s[i+1] == p && s[i] == p)
        dot_flag = true;
    }

    p = s[i];
  }

if(!dot_flag && c > d)
  ans = "No";

  cout << ans << endl;


}


Measured memory_bytes: 764
N = int(input())
Ans = []
n = N
for i in range(1, 10000000):
    if n >= i:
        n -= i
        Ans.append(i)
    else:
        break
for i in range(1, n+1):
    Ans[-i] += 1
print("\n".join(map(str, Ans)))


Measured memory_bytes: 3444
/***********************
*  Author: xuziyuan    * 
***********************/

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++)
#define LL long long
#define pii pair <int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))

using namespace std;

const LL MOD=1e9+7;

int n,k;
int a[100010];

int main()
{
	cin>>n>>k;
	rep(i,n) cin>>a[i];
	sort(a,a+n);
	int ans=1e9;
	for(int i=0;i<n&&i+k-1<n;i++)
	{
		ans=min(ans,a[i+k-1]-a[i]);
	}
	cout<<ans<<endl;
	rt0;
}

Measured memory_bytes: 640
#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 rrep(i,n) for(int i = n - 1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define mrep(i,from,n) for(int i = from; i < n; i++)
#define mreps(i,from,n) for(int i = from; i <= n; i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(ALL(x), val), x.end())
typedef long long ll;
typedef pair<ll, ll> P;
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; }
ll MOD = 1000000007;
int INF = 1001001001;

void solve()
{	
	int n, m, l; cin >> n >> m >> l;
	vector<vector<ll>> a(n,vector<ll>(m));
	vector<vector<ll>> b(m,vector<ll>(l));
	vector<vector<ll>> c(n,vector<ll>(l ,0));
	rep(i, n)rep(j, m)cin >> a[i][j];
	rep(i, m)rep(j, l)cin >> b[i][j];
	rep(i, n)rep(j, l)rep(k, m)c[i][j] += a[i][k] * b[k][j];
	
	rep(i, n)rep(j, l)
	{
		cout << c[i][j];
		if(j != l-1)cout << " ";
		else cout << endl;
	}
	return;
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}



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

using namespace std;

#define ll long long
#define MOD 1000000007

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

	ll sum = 0;
	for (int i = 0; i < N; i++) {
		sum += A[i];
		sum %= MOD;
	}

	ll ans = 0;
	for (int i = 0; i < N; i++) {
		sum -= A[i];
		if (sum < 0) {
			sum += MOD;
		}
		ans += A[i] * sum;
		ans %= MOD;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 4768
import collections
import math


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    if n > 1:
        _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n = int(input())
sieve = eratosthenes(math.ceil(math.sqrt(n)))
counter = collections.Counter()
for k in range(1, n + 1):
    for i in range(1, k):
        if i**2 > k:
            break
        if sieve[i]:
            while k % i == 0:
                counter[i] += 1
                k //= i
        if k == 1:
            break
    if k > 1:
        counter[k] += 1

MOD = 10**9 + 7
res = 1
for v in counter.values():
    res *= v + 1
print(res % MOD)

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

using lnt = long long;
using Real = long double;

#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(lnt i=0;i<(n);++i)
#define RANGE(i, a, b) for(lnt i=(a);i<(b);++i)
#define RREP(i, n) for(lnt i=(n)-1;i>= 0;--i)

#define ln '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define dcout cout<<fixed<<setprecision(20)
#define summon_tourist cin.tie(0);ios::sync_with_stdio(false)

constexpr int dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
constexpr Real eps = 1e-9; const Real pi = acosl(-1);
constexpr lnt BIG = INT_MAX/10, BBIG = LLONG_MAX/10;

template<class T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<class T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<class T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<class T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

using pint = pair<int, int>; using plnt = pair<lnt, lnt>;
using vint = vector<int>; using vlnt = vector<lnt>;
constexpr lnt MOD = 1e9+7;

lnt powmod(lnt a, lnt p, lnt m){
	lnt res = 1, tmp = a;
	while(p != 0){
		if(p % 2) res = (res*tmp) % m;
		tmp = (tmp*tmp) % m;
		p >>= 1;
	}
	return res;
}

int main(){
	summon_tourist;

	lnt N; cin >> N;
	lnt ans = powmod(10, N, MOD);
	lnt a = powmod(9, N, MOD);
	lnt b = powmod(8, N, MOD);
	ans += MOD;
	ans -= a;
	ans %= MOD;
	ans += MOD;
	ans -= a;
	ans %= MOD;
	ans += MOD;
	ans += b;
	ans %= MOD;
	cout << ans << ln;
}

Measured memory_bytes: 3648
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
	int N;
	cin >> N;
	auto result = 0ll;
	auto prev = 0;
	for (auto i = 0; i < N; ++i)
	{
		ll A;
		cin >> A;
		result += (A + prev) / 2;
		if (A > 0)
		{
			prev = (A - prev) % 2;
		}
		else
		{
			prev = 0;
		}
	}

	cout << result << endl;

	return 0;
}

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

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int L = sc.nextInt();
    String S[] = new String[N];
    
    for(int i=0; i<N; i++){
      S[i]=sc.next();
    }
    Arrays.sort(S);
    String s = "";
    for(int i=0; i<N; i++){
      s += S[i];
    }
    System.out.println(s);
  }
}
      

Measured memory_bytes: 40388
from fractions import gcd

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

def f(l):
    yield 0
    a = 0
    for i in l:
        a = gcd(a, i)
        yield a

L = list(f(A))
R = list(reversed(list(f(reversed(A)))))

print(max([gcd(a, b) for a, b in zip(L, R[1:])]))


Measured memory_bytes: 16148
#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;
const int INF = 1000000000;
const ll LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;

int main(void)
{
    float R;
    cin >> R;

    float ans = 2 * R * PI;
    cout << ans << endl;
    return (0);
}

Measured memory_bytes: 3788
#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>
signed main(){
  int N; cin>>N;
  vector<vector<pii>> A(N);
  rep(i,0,N-1){
    int X,Y,Z; cin>>X>>Y>>Z;
    A[X-1].push_back(make_pair(Y-1,Z));
    A[Y-1].push_back(make_pair(X-1,Z));
  }
  queue<int> Q;
  vector<bool> ans(N),F(N,1);
  ans[0]=1;
  F[0]=0;
  Q.push(0);
  while(1){
    int K=Q.front();
    Q.pop();
    rep(i,0,A[K].size()){
      if(F[A[K][i].first]){
        F[A[K][i].first]=0;
        Q.push(A[K][i].first);
        if(A[K][i].second%2==0){
          ans[A[K][i].first]=ans[K];
        }
        else{
          ans[A[K][i].first]=!ans[K];
        }
      }
    }
    if(Q.size()==0)
      break;
  }
  rep(i,0,N)
    cout<<ans[i]<<endl;
  }



Measured memory_bytes: 7936
import java.io.*;

class Main{
 public static void main(String[] args)throws IOException{
  int x,y;
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  
  
  
  while(true){
    String str = br.readLine(); 
    String[] strAry = str.split(" ");
    x = Integer.parseInt(strAry[0]);  
    y = Integer.parseInt(strAry[1]);   
    if(x==0&&y==0) break;   
    if(x<=y){
      System.out.println(x +" "+ y);
     
    }else{    
      System.out.println(y +" "+ x);
     }
  }
 }
}

Measured memory_bytes: 27176
#include<stdio.h>

int main(){
  int sum;
  char s[3];
  
  scanf("%s", s);
  
  if(s[1] == '1')
    sum = sum + 1;
  if(s[2] == '1')
    sum = sum + 1;
  if(s[0] == '1')
    sum = sum + 1;
  
  printf("%d", sum);
  
  return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int is_syouzyunn(const int* data, int size) {
	int i;
	for (i = 1; i < size; i++) {
		if (data[i - 1] > data[i]) return 0;
	}
	return 1;
}

int main(void) {
	int N;
	int p[64];
	int i, j;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &p[i]) != 1) return 1;
	}
	if (is_syouzyunn(p, N)) {
		puts("YES");
		return 0;
	}
	for (i = 0; i < N; i++) {
		for (j = i + 1; j < N; j++) {
			int t;
			t = p[i]; p[i] = p[j]; p[j] = t;
			if (is_syouzyunn(p, N)) {
				puts("YES");
				return 0;
			}
			t = p[i]; p[i] = p[j]; p[j] = t;
		}
	}
	puts("NO");
	return 0;
}


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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<char,int>;

const int MOD = 1e9 + 7;
const int INF = 1001001001;

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

    int a, b;
    char c;
    cin >> a >> c >> b;

    if(c == '+'){
        cout << a + b << endl;
    }else{
        cout << a - b << endl;
    }


    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

typedef  long long ll;
#define mop 1000000007
using namespace std;

ll power(ll a, ll b){
    ll tmp = 1;
    for(ll i=0;i<b;i++){
        tmp *= a;
    }
    return tmp;
}


int main() {
    
    ll n,k,s;
    cin >> n >> k >> s;
    if(s != power(10,9)){
        for(ll i=1;i<=k;i++){
            cout << s << " ";
        }
        for(ll i = k+1;i<=n;i++){
            cout << power(10,9) << " ";
        }
        cout << endl;
    }else{
        for(ll i=1;i<=k;i++){
            cout << s << " ";
        }
        for(ll i=k+1;i<=n;i++){
            cout << 1 << " ";
        }
        cout << endl;
    }
}

Measured memory_bytes: 1280
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cstdio>
#include<cmath>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<tuple>
#include<utility>
#include<vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define REP(i, n)  for(int i=0; i<(int)(n); i++)
#define REPS(i, n)  for(int i=1; i<=(int)(n); i++)
#define PER(i, n) for(int i=(int)(n)-1; i>= 0; i--)
#define PERS(i, n)  for(int i=(int)(n)-1; i>0; i--)
#define FOR(i, c) for(__typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define RFOR(i, c)  for(__typeof((c).rbegin()) i=(c).rbegin(); i!=(c).end(); i++)
#define ALL(container)  (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) (container).size()
#define FILL0(n)  setfill('0') << right << setw(n)
#define mp(a, b)  make_pair(a, b)
#define toLower(c)  c+0x20
#define toUpper(c)  c-0x20
#define pb  push_back
#define eb  emplace_back

const int INF = 1<<28;
const int MOD = 1000000007;

int main(){
  int n;  cin >> n;
  int a = 0, un = 0;
  bool ok = true;
  REP(i, n){
    string call;  cin >> call;
    if(call == "A") {
      a++;
    }
    if(call == "Un")  {
      if(a>0) {
        un++;
        a--;
      }else{
        ok = false;
      }
    }
  }
  if(a==0 && un>0 && ok)  cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}



Measured memory_bytes: 3144
N = int(input())
A = list(map(int, input().split()))
MOD = 10**9+7

b = [0]*60
for a in A:
    digit = 0
    while a > 0:
        if a % 2 == 1:
            b[digit] += 1
        a = a >> 1
        digit += 1

ans = 0
for i in range(60):
    ans += 2**i * b[i] * (N-b[i])
    ans %= MOD
print(ans)


Measured memory_bytes: 122936
import copy
n,m = map(int,input().split())
ht = [x for x in input().split()]
hl = {x + 1 : int(ht[x]) for x in range(len(ht))}
mx = {h:0 for h in hl}
for i in range(m):
    l,r = map(int,input().split())
    mx[l] = max(mx[l],hl[r])
    mx[r] = max(mx[r],hl[l])
cnt = 0
for h in hl:
    if mx[h] < hl[h]:
        cnt += 1
print(cnt)

Measured memory_bytes: 38052
package main

import (
	"bufio"
	"container/list"
	"fmt"
	"os"
	"strconv"
)

func main() {
	var n, x, y int
	fmt.Scan(&n, &x, &y)

	ans := make([]int, n+1)
	for i := 1; i <= n; i++ {
		seen := make([]int, n+1)
		seen[i] = 1
		ls := list.New()
		ls.PushBack(i)
		for ls.Len() > 0 {
			v := ls.Remove(ls.Front()).(int)
			if nv := v - 1; nv >= 1 && nv <= n && seen[nv] == 0 {
				seen[nv] = seen[v] + 1
				ans[seen[nv]-1]++
				ls.PushBack(nv)
			}
			if nv := v + 1; nv >= 1 && nv <= n && seen[nv] == 0 {
				seen[nv] = seen[v] + 1
				ans[seen[nv]-1]++
				ls.PushBack(nv)
			}
			if v == x && seen[y] == 0 {
				seen[y] = seen[x] + 1
				ans[seen[y]-1]++
				ls.PushBack(y)
			}
			if v == y && seen[x] == 0 {
				seen[x] = seen[y] + 1
				ans[seen[x]-1]++
				ls.PushBack(x)
			}
		}
	}

	var wr = bufio.NewWriter(os.Stdout)
	for i := 1; i < n; i++ {
		wr.WriteString(strconv.Itoa(ans[i]/2) + "\n")
	}
	wr.Flush()
}


Measured memory_bytes: 5504
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <array>
#include <cmath>
#include <iterator>
#include <utility>
#include <set>
#include <random>
#include <map>
#include <stack>
#include <queue>
#include <list>

using namespace std;

int main() {
    int n;
    cin >> n;
    cout << n * 800 - n / 15 * 200 << endl;
    return 0;
}

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

vector <long long> v[1234567];
int main(){
    long long  n,m=-1;
    cin>>n;
    for(int i = 1; i <= n; i++){
        int x;
        cin>>x;
       if(x!=0 ) v[x-1].push_back(x);
        v[x].push_back(x);
        v[x+1].push_back(x);
    }

    for(int i = 0; i <= 100000; i++){
        long long c= v[i].size();
        m=max(c,m);
    }
    cout<<m;
}


Measured memory_bytes: 34048
x = int(input())

a = x // 11

ans = 10 ** 15
for n in range(max(0, a - 100), a + 100):
    if 6 * n + 5 * n >= x:
        ans = min(ans, n + n)
    if 6 * n + 5 * (n - 1) >= x:
        ans = min(ans, n + n - 1)

print(ans)




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

int H,W;
char fid[1010][1010] = {0};
char B[1010][1010],R[1010][1010];

int main()
{
    scanf("%d%d",&H,&W);
    for(int i = 0; i < H; i++)for(int j = 0; j < W; j++)R[i][j] = B[i][j] = '.';

    for(int i = 0; i < H; i++)
    {
        for(int j = 0; j < W; j++)
        {
            scanf(" %c",&fid[i][j]);
            if(fid[i][j] == '#')
                R[i][j] = B[i][j] = '#';
        }
    }

    for(int i = 0; i < H; i++)
    {
        for(int j = 0; j < W; j++)
        {
            if(j == 0)R[i][j] = '#';
            else if(j == W - 1)B[i][j] = '#';
            else
            {
                if(i % 2 == 0)R[i][j] = '#';
                else B[i][j] = '#';
            }
        }
    }

    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++)printf("%c",B[i][j]);printf("\n");}printf("\n");
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++)printf("%c",R[i][j]);printf("\n");}

    return 0;
}


Measured memory_bytes: 2304
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC166
{
    class Program
    {
        static void Main(string[] args)
        {
            b();
        }

        public static void b()
        {
            int[] nk = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int n = nk[0], k = nk[1];
            var list = new List<int>();
            for(int i = 0; i < k; i++)
            {
                int d = int.Parse(Console.ReadLine());
                int[] ai = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                foreach(var x in ai)
                {
                    list.Add(x);
                }
            }
            var ans = list.Distinct();
            Console.WriteLine(n - ans.Count());
        }
    }
}


Measured memory_bytes: 28624
#include <bits/stdc++.h>
#define ll long long

using namespace std;

ll a[100010],b[100010];
int n,ans;
map<ll,int>mp;


ll pw(ll x)
{
	return x*x;
}

int main()
{
	scanf("%d",&n);
	for(int i=1; i<=n; i++)
	{
		ll x;
		scanf("%lld",&x);
		for(ll j=2; j*j*j<=x; j++)
			while(x%(j*j*j)==0)
				x/=j*j*j;
		mp[x]++;
		a[i]=x;
		ll y=1;
		for(ll j=2; j*j*j<=x; j++)
			if(x%j==0)
			{
				y*=(x%(j*j)==0)?j:j*j;
				while(x%j==0)x/=j;
			}
		if(pw((ll)sqrt(x))==x)y*=(ll)sqrt(x);
		else y*=x*x;
		b[i]=y;
	}
	if(mp[1])
	{
		ans++;
		mp[1]=0;
	}
	for(int i=1; i<=n; i++)
	{
		ans+=max(mp[a[i]],mp[b[i]]);
		mp[a[i]]=mp[b[i]]=0;
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 14336
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Collections;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Gluttony solver = new Gluttony();
        solver.solve(1, in, out);
        out.close();
    }

    static class Gluttony {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long k = in.nextLong();

            Integer[] foods = new Integer[n];
            Integer[] team = new Integer[n];

            for (int i = 0; i < n; i++) {
                team[i] = Integer.parseInt(in.next());
            }

            for (int i = 0; i < n; i++) {
                foods[i] = Integer.parseInt(in.next());
            }

            Arrays.sort(foods);
            Arrays.sort(team, Collections.reverseOrder());

            if (score(team, foods, 0) <= k) {
                out.println(0);
                return;
            }

            long left = 0;
            long right = Long.MAX_VALUE;
            while (right - left > 1) {
                long middle = (left + right) / 2;
                long s = score(team, foods, middle);
                if (s <= k) {
                    right = middle;
                } else {
                    left = middle;
                }
            }

            out.println(right);

        }

        public static long score(Integer[] team, Integer[] foods, long target) {

            long score = 0;
            for (int i = 0; i < team.length; i++) {
                long count = target / foods[i];
                score += Math.max(team[i] - count, 0);
            }
            return score;
        }

    }
}



Measured memory_bytes: 68704
n=int(input())
d={}
for i in range(n):
	s=input()
	if s in d:
		d[s]+=1
	else:
		d[s]=1
m=int(input())
for i in range(m):
	t=input()
	if t in d:
		d[t]-=1
	else:
		d[t]=-1
print(max(max(d.values()),0))

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
Apparently, the tree supports the same operations as the set 
(at least I haven't any problems with them before), but also there are two new features — 
find_by_order() — The first returns an iterator to the k-th largest element (counting from zero)
order_of_key() — the number of items in a set that are strictly smaller than our item. 
https://codeforces.com/blog/entry/11080
using namespace __gnu_pbds; */
using namespace std;
#define test() int t;cin>>t;for(int test=1;test<=t;test++)
#define int long long
#define MOD 1000000007
#define pb push_back 
#define ins insert
#define fast(); ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ld long double
#define endl '\n'
int m(int a) {
    return ((a%MOD)+MOD)%MOD;
}
int p(int a, int b) {
    int res = 1;
    while(b > 0){
        if(b&1) res = m(m(res)*m(a));
        a = m(m(a)*m(a));
        b >>= 1;
    }
    return res;
}
signed main(){
    fast();
    int r, c, k;
    cin >> r >> c >> k;
    vector<vector<char>> a(r, vector<char>(c));
    for(int i=0; i<r; i++){
        for(int j=0; j<c; j++){
            cin >> a[i][j];
        }
    }
    int ans = 0;
    for(int i=0; i<p(2, r); i++){
        for(int j=0; j<p(2, c); j++){
            int curr = 0;
            // cerr << "doing this for: " << i << " " << j << endl;
            vector<bool> fr(r, 1), fc(c, 1);
            for(int row=0; row<r; row++){
                if(p(2, row)&i){
                    // cerr << "row fucked is: " << row << endl;
                    fr[row] = 0;
                }
            }
            for(int col=0; col<c; col++){
                if(p(2, col)&j){
                    // cerr << "col fucked is: " << col << endl;
                    fc[col] = 0;
                }
            }
            for(int x=0; x<r; x++){
                for(int y=0; y<c; y++){
                    if(fr[x] && fc[y] && a[x][y] == '#'){
                        curr++;
                    }
                }
            }
            if(curr == k){
                // cerr << "results for: " << i << " " << j << endl;
                ans++;
            }
        }
    }
    cout << ans << endl;
    cerr << "\nTime elapsed : " << 1000 * clock() / CLOCKS_PER_SEC << " ms\n";
}

Measured memory_bytes: 3660
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys

sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




def main(): #startline--------------------------------------------
    n = int(input())
    a = list(map(int,input().split()))
    tmp = 0
    ans = 0
    r = 0
    for l in range(n):
        while r < n and tmp ^ a[r] == tmp + a[r]:
            tmp += a[r]
            r += 1
        ans += r-l
        if l == r:
            r += 1
        else:
            tmp -= a[l]
    print(ans)
if __name__ == "__main__":
    main() #endline===============================================
    

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

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

int main() {
  int h, w, k;
  int sx, sy, gx, gy;
  cin >> h >> w >> k;
  cin >> sx >> sy >> gx >> gy;
  sx--, sy--, gx--, gy--;
  vector<string> maze(h);
  rep(i, h) cin >> maze[i];
  vector<vector<int>> dist(h, vector<int>(w, -1));

  queue<P> q;
  q.push(P(sx, sy));
  dist[sx][sy] = 0;
  while (!q.empty()) {
    P p = q.front();
    q.pop();
    int cx = p.first;
    int cy = p.second;
    if (cx == gx && cy == gy) break;
    rep(i, 4) {
      for (int j = 1; j <= k; j++) {
        int nx = cx + dx[i] * j;
        int ny = cy + dy[i] * j;
        if (0 > nx || nx >= h || 0 > ny || ny >= w) break;
        if (maze[nx][ny] == '@') break;
        if (dist[nx][ny] != -1 && dist[nx][ny] <= dist[cx][cy]) break;
        if (dist[nx][ny] != -1) continue;
        dist[nx][ny] = dist[cx][cy] + 1;
        q.push(P(nx, ny));
      }
    }
  }
  cout << dist[gx][gy] << endl;
  return 0;
}


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

using namespace std;
 
#define IOS		    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ld 		    long double
#define ll 		    long long int
#define ull 	   	    unsigned long long int
#define pb		    push_back
#define mp		    make_pair
#define F		    first
#define S		    second
#define lb		    lower_bound
#define ub		    upper_bound
#define deb(x)      	    cout<<"#x "<<x<<"\n";
#define trace(x,y)  	    cout<<"#x "<<x<<" #y "<<y<<"\n";
#define cn          	    cout<<"\n";


bool SBF(const pair <int,int>&a, const pair<int,int>& b){return a.F<b.F;}
bool SBS(const pair<int,int>& a, const pair<int,int>& b){return a.S<b.S;}


const long double PI = 3.1415926535;
const int         mod= 1e9+ 7; 

ll n, m;
vector <int> g[100001];




int par[100001];
bool vis[100001];
bool exist =true;

void bfs(){
     memset(par,0,sizeof(par));
     memset(vis,0,sizeof(vis));
     vis[1]=true;
     queue <int> q;
     q.push(1);
     par[1]=-1;
     while(q.size() != 0){
	     int u = q.front();
	     q.pop();
	     for(int i=0;i<g[u].size();i++){
		     int v=g[u][i];
		     if(vis[v] == false){
			     par[v] = u;
			     vis[v] = true;
			     q.push(v);
		     }
	     }
     }
     for(int i=1;i<=n;i++){
	     if(vis[i] == false)exist=false;
     }

return ;
}
void solve(){
     cin >> n>> m;
     for(int i=0;i<m;i++){
	     int u, v;
	     cin >> u >> v; 
             g[u].pb(v);
	     g[v].pb(u);
     }
     bfs();
     if(exist){
	     cout<<"Yes\n";
	     for(int i=2;i<=n;i++)cout<<par[i]<<"\n";
     }
     else {
	     cout<<"No\n";
     }


     return ;
}




int main(){
	solve();
return 0;


}
























Measured memory_bytes: 10608
while True:
    H, W = map(int, input().split())
    if H == 0:
        break
    for i in range(H):
        S = ""
        for j in range(W):
            if (i+j) % 2 == 0:
                S += "#"
            else:
                S += "."
        print(S)
    print()



Measured memory_bytes: 5608
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
VI vis;
VVI egs;
bool dfs(in u, in typ){
  if(vis[u]){
    if(vis[u]==typ)
      return 1;
    return 0;
  }
  vis[u]=typ;
  bool notbip=0;
  forv(i,egs[u]){
    if(!dfs(egs[u][i],3-typ))
      notbip=1;
  }
  return !notbip;
}
in nbip=0;
in nus=0;
in nsing=0;
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  in n,m;
  cin>>n>>m;
  egs.resize(n);
  vis.resize(n);
  in ta,tb;
  forn(zz,m){
    cin>>ta>>tb;
    --ta;
    --tb;
    egs[ta].PB(tb);
    egs[tb].PB(ta);
  }
  forn(i,n){
    if(vis[i])
      continue;
    if(sz(egs[i])==0){
      vis[i]=3;
      ++nsing;
      continue;
    }
    if(dfs(i,1))
      ++nbip;
    else
      ++nus;
  }
  in sm=0;
  sm+=2*nsing*n-nsing*nsing;
  sm+=nus*nus+2*nus*nbip;
  sm+=2*nbip*nbip;
  cout<<sm<<endl;
  return 0;
}


Measured memory_bytes: 12416
#include <bits/stdc++.h>
using namespace std;
typedef long long       ll;
typedef pair<int,int>   ii;
typedef vector<int>     vi;
typedef set<int>        si;

template<typename T> T sgn (T x)      {return x<0? -1:x!=0; }
template<typename T> T gcd (T a, T b) {return a ? gcd (b % a, a) : b; }
//pi=acos(-1)
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
#define clr(x,v) memset(x,v,sizeof x)
#define forn(i,a,b) for(int i=a;i<b;i++)
#define popcount __builtin_popcount
#define eb emplace_back
#define emp emplace
#define ss second
#define ff first
#define MOD ((int)1e9+7)
#define N ((int)2e5+123)
#define K (int(1e6))
void reads(string& x){ char kk[N]; scanf("%s",kk); x = kk;}

int ans, q;
ll n;
int v[N];
vector<ll> pr;
ll lp[K+1];
void crivo(){
    for(ll i=2;i<=K;i++){
        if(lp[i]==0){
            lp[i]=i;
            pr.eb(i);
        }
        for(ll j=0;j<sz(pr)&&pr[j]<=lp[i]&&i*pr[j]<=K;j++){
            lp[i*pr[j]] = pr[j];
        }
    }
}
void solve(){
    scanf("%lld", &n);
    if(n==1){
        printf("0\n");
        return;
    }
    crivo();
    for(ll x:pr){
        q=0;
        while(n%x==0){
            n/=x;
            q++;
        }
        //if(q) printf(" %d %d\n", x, q);
        ans += (sqrt(1+8*q)-1)/2;
        if(n==1)break;
    }
    if(n^1)ans++;
    printf("%d\n", ans);
}

int main(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;//scanf("%d",&t);
    while(t--)solve();
}

Measured memory_bytes: 12088
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


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

	if (n < 1200)
	{
		println("ABC");
	}
	else
	{
		println("ARC");
	}
}

Measured memory_bytes: 256
import java.io.*;
import java.util.Arrays;
public class Main{
    public static void main(String args[])throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        
        int A[] = {1819, 2003, 876, 2840, 1723, 1673, 3776, 2848, 1592, 922};
        int len = A.length;
        for(int i =0; i<len ; i++)
            A[i] = Integer.parseInt(br.readLine());
        
        Arrays.sort(A);
        
        System.out.println(A[len-1]);
        System.out.println(A[len-2]);
        System.out.println(A[len-3]);
        
        
    }
}

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

int main() {
    int A, B;
    cin >> A >> B;
    int count = 0;
    int plag_count = 1;
    while(plag_count < B)
    {
        count++;
        plag_count += A - 1;
    }

    cout << count << endl;
    return 0;  

}

Measured memory_bytes: 256
#include "iostream"

using namespace std;

struct Card { char suit,value; } ;

void bubsort(struct Card A[],int N) {
  for(int i = 0;i<N;i++){
    for(int j = N -1; j >= i + 1 ;j--){
      if(A[j].value < A[j -1].value){
        Card t = A[j]; A[j] = A[j-1]; A[j-1] =t;
      }
    }
  }
}

void selesort(struct Card A[],int N){
  for(int i = 0 ; i < N ; i++){
    int minj = i;
    for(int j = i ; j < N ; j++){
      if(A[j].value < A[minj].value) minj = j;
    }
      Card t = A[i]; A[i] = A[minj]; A[minj] = t;
  }
}

void print(struct Card A[],int N){
  for(int i = 0; i < N ; i++){
      if(i > 0) cout << " ";
      cout << A[i].suit << A[i].value;
  }
  cout << endl;
}

bool judge(struct Card C1[],struct Card C2[], int N){
  for(int i = 0 ; i < N ; i++){
    if(C1[i].suit != C2[i].suit) return false;
  }
  return true;
}

int main(){
  Card C1[100],C2[100];
  int N;
  char ch;

  cin >> N;
  for(int i = 0 ; i < N ;i++){
    cin >> C1[i].suit >> C1[i].value;
  }
    for(int i = 0 ; i < N ;i++) C2[i] = C1[i];
    bubsort(C1,N);
    selesort(C2,N);
    print(C1,N);
    cout << "Stable" << endl;
    print(C2,N);
    if(judge(C1,C2,N)){
    cout << "Stable" << endl;
  }else{
    cout << "Not stable" << endl;
  }
  return 0;
}



Measured memory_bytes: 3100
#include <map>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
struct point {
	int x, y;
};
bool operator<(const point& p1, const point& p2) {
	return p1.x * p2.y < p1.y * p2.x;
}
bool operator>(const point& p1, const point& p2) {
	return p1.x * p2.y > p1.y * p2.x;
}
bool operator==(const point& p1, const point& p2) {
	return p1.x == p2.x && p1.y == p2.y;
}
int gcd(int x, int y) {
	if (y == 0) return x;
	return gcd(y, x % y);
}
int main() {
	int H, W;
	cin >> H >> W;
	vector<string> S(H + 2, string(W + 2, '.'));
	for (int i = 0; i < H; ++i) {
		cin >> S[i + 1]; S[i + 1] = '.' + S[i + 1] + '.';
	}
	reverse(S.begin(), S.end());
	vector<point> l, r;
	for (int i = 1; i <= H; ++i) {
		int pre = 0;
		for (int j = 1; j <= W + 1; ++j) {
			if (S[i][j] != S[i][j - 1] || S[i + 1][j] != S[i + 1][j - 1]) {
				if (S[i][j - 1] != S[i + 1][j - 1]) {
					l.push_back(point{ i, j - 1 });
					r.push_back(point{ i, pre - 1 });
				}
				pre = j;
			}
		}
	}
	for (int i = 1; i <= W; ++i) {
		int pre = 0;
		for (int j = 1; j <= H + 1; ++j) {
			if (S[j][i] != S[j - 1][i] || S[j][i + 1] != S[j - 1][i + 1]) {
				if (S[j - 1][i] != S[j - 1][i + 1]) {
					l.push_back(point{ j - 1, i });
					r.push_back(point{ pre - 1, i });
				}
				pre = j;
			}
		}
	}
	int N = l.size();
	for (int i = 0; i < N; ++i) {
		if (l[i] > r[i]) {
			swap(l[i], r[i]);
		}
		int gl = gcd(l[i].x, l[i].y); if (gl != 0) l[i].x /= gl, l[i].y /= gl;
		int gr = gcd(r[i].x, r[i].y); if (gr != 0) r[i].x /= gr, r[i].y /= gr;
	}
	map<point, int> gin, gout;
	vector<point> sp;
	for (int i = 0; i < N; ++i) {
		++gin[l[i]];
		++gout[r[i]];
		sp.push_back(l[i]);
		sp.push_back(r[i]);
	}
	sort(sp.begin(), sp.end());
	sp.erase(unique(sp.begin(), sp.end()), sp.end());
	int cnt = 0, mx = 0;
	for (point p : sp) {
		cnt += gin[p];
		cnt -= gout[p];
		mx = max(mx, cnt);
	}
	cout << (mx + 1) / 2 + 1 << endl;
	return 0;
}


Measured memory_bytes: 21912
use std::io;

fn read_line() -> Vec<i32> {
    let mut line = String::new();
    let mut inputs = Vec::<i32>::new();
    io::stdin().read_line(&mut line).unwrap();
    // let inputs = line.trim().chars().map(|x| x.parse::<i32>().unwrap());
    let inputs = line.trim().chars().map(|x| x.to_digit(10).unwrap() as i32);
    inputs.collect::<Vec<i32>>()
}

fn operation(op: &char, l_operand: &i32, r_operand: i32) -> i32 {
    if *op == '+' {
        return l_operand + r_operand;
    } else if *op == '-' {
        return l_operand - r_operand;
    } else {
        panic!("");
    }
}

fn solve(a: i32, b: i32, c: i32, d: i32) {
    let op_list = vec!['+', '-'];
    for op1 in op_list.iter() {
        let mut res = operation(op1, &a, b);
        for op2 in op_list.iter() {
            let res2 = operation(op2, &res, c);
            for op3 in op_list.iter() {
                let res3 = operation(op3, &res2, d);
                if res3 == 7 {
                    println!("{}{}{}{}{}{}{}=7", a, op1, b, op2, c, op3, d);
                    return;
                }
            }
        }
    }
}

fn main() {
    let inputs = read_line();
    solve(inputs[0], inputs[1], inputs[2], inputs[3]);
}


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

// B - String Palindrome
bool reverCheck(string S) {
    string reverseS = S;
    reverse(reverseS.begin(), reverseS.end());

    return S == reverseS;
}

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

    if (!reverCheck(S)) {
        cout << "No";
        return 0;
    }

    int len = (S.size() - 1) / 2;
    if (!reverCheck(S.substr(0, len))) {
        cout << "No";
        return 0;
    }

    int point = (S.size() + 3) / 2;
    if (!reverCheck(S.substr(point - 1, S.size() - point + 1))) {
        cout << "No";
        return 0;
    }

    cout << "Yes";
}


Measured memory_bytes: 256
using namespace std;
#include<bits/stdc++.h>
#define int long long
#define pb push_back 
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define repa(i,a,b) for (int i=a; i<=b; i++)
#define repd(i,b,a) for (int i=b; i>=a; i--)
#define endl "\n"
//debugging
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl;

const int N = 1e+6+5;
int big = 1e+18+3;
int mod = 1e+9+7;

signed main()
{
    IOS;
       
    int n,k;
    cin>>n>>k;
    int vis[n+1];
    repa(i,1,n)
        vis[i]=1;
    repa(i,1,k)
    {
        int d; cin>>d;
        repa(j,1,d)
        {
            int buf;
            cin>>buf;
            vis[buf]=0;
        }
    }   
    int ans = 0;
    repa(i,1,n)
        ans+=vis[i];
    cout<<ans<<endl;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
constexpr int Nbit= 200'000;
constexpr int sNbit= 21;

int nextX(const bitset<sNbit> &bsX, int popX){
  bitset<sNbit> X= bsX;

  int mod= 0;
  int base_mod= 1;
  while(X.any()){
    if(X.test(0)){
      mod= (mod+ base_mod) % popX;
    }

    base_mod= (2* base_mod) % popX;
    X >>= 1;
  }

  return mod;
}

int init(const bitset<Nbit> &bsX, vector<int> *base_mod, int div){
  if(div==0){ return 0; }
  else{
    const size_t N= (int)base_mod->size();

    bitset<Nbit> X= bsX;
    int mod= 0;
    base_mod->at(0)= 1 % div;
    for(size_t i=0; i<N; i++){
      if(X.test(i)){
        mod= (mod+ base_mod->at(i)) % div;
      }

      if(i+1 < N){
        base_mod->at(i+1)= (2* base_mod->at(i)) % div;
      }
    }

    return mod;
  }
}

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

  const bitset<Nbit> bsX(X);
  const int popX= (int)bsX.count();

  vector<int> offset_plus1(N);
  vector<int> offset_minus1(N);

  const int mod_popXplus1 = init(bsX, &offset_plus1 , popX+ 1);
  const int mod_popXminus1= init(bsX, &offset_minus1, popX- 1);
  
  for(int i=1; i<=N; i++){
    int bit_i= (bsX.test(N-i)) ? 0
                               : 1;
    int popXi= (bit_i==1) ? popX+ 1
                          : popX- 1;

    bitset<sNbit> bsXi;
    int ans_i= 0;
    while(popXi > 0){
      ans_i++;
      if(ans_i==1){
        int next= (bit_i==1) ? (mod_popXplus1+ offset_plus1.at(N-i)) % popXi
                             : (((mod_popXminus1- offset_minus1.at(N-i)) % popXi)+ popXi) % popXi;
        bsXi= bitset<sNbit>(next);
        popXi= (int)bsXi.count();
      }
      else{
        int next= nextX(bsXi, popXi);

        bsXi= bitset<sNbit>(next);
        popXi= (int)bsXi.count();
      }
    }

    cout << ans_i << endl;
  }
}

Measured memory_bytes: 5188
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=998244353;
//const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
    ll k;
    cin>>k;
    ll d=0,cnt=1;
    for(int i=0;i<50000000;i++){
        d=d*10+7;
        d%=k;
        if(d==0){
            cout<<i+1<<"\n";
            return 0;
        }
    }
    cout<<-1<<"\n";
}


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


signed main()
{

ll m;ll a;
cin>>m;
a=ceil(m/1.08);
if(floor(a*1.08)==m){
    cout<<a;
}
else{
    cout<<":(";

}

    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		// 配列の縦横入力
		String str = scan.nextLine();
		String[] spl = str.split(" ");
		// 入力した文字列を数値に変換
		int n = Integer.parseInt(spl[0]);
		int m = Integer.parseInt(spl[1]);
		// カウンタ変数
		int i=0;
		int j=0;

		String[] input = new String[m];
		int[][] a = new int[n][m];
		int[] b = new int[m];
		int[] c = new int[n];


		// a行列を入力
		for(i=0; i<n; i++){
			str = scan.nextLine();
			input = str.split(" ");
			for(j=0; j<m; j++){
				a[i][j] = Integer.parseInt(input[j]);
			}
		}
		// b行を入力
		for(i=0; i<m; i++){
			str = scan.nextLine();
			b[i] = Integer.parseInt(str);
		}


		// 行列計算（ループか？）
		for(i=0; i<n; i++){
			for(j=0; j<m; j++){
				c[i] = c[i] + (a[i][j] * b[j]);
			}
			System.out.println(c[i]);
		}

	}
}


Measured memory_bytes: 29848
#include <bits/stdc++.h>
typedef long long int ll;
#define rep(i,n) for (int i = 0; i< (n); i++)
#define Rep(i,n,m) for (int i = (n); i< (m); i++)
#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a.end())
using namespace std;

int main() {
    int a,b,c;
    cin>>a>>b>>c;

    
    cout<<c<<" "<<a<<" "<<b<<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);
		int[] n = new int[3];
		for (int i = 0; i < n.length; i++) {
			n[i] = Integer.parseInt(sc.next());
		}

		int flg = 1;
		while (flg == 1) {
			flg = 0;
			for (int i = 0; i < n.length - 1; i++) {
				if(n[i] > n[i +1]) {
					int tmp = n[i];
					n[i] = n[i + 1];
					n[i + 1] = tmp;
					flg = 1;
				}
			}
		}

		for (int i = 0; i < n.length; i++) {
			System.out.print(n[i]);
			if (i < n.length - 1) {
				System.out.print(" ");
			}
		}
		System.out.println();
		sc.close();
	}
}

Measured memory_bytes: 26184