akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

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

int main()
{
        //input->compute->output//
        int A, B, C;
        cin >> A >> B >> C;
        if (A == 5 && A == B && C == 7)
        {
                cout << "YES" << endl;
        }
        else if (A == 5 && A == C && B == 7)
        {
                cout << "YES" << endl;
        }
        else if (B == 5 && B == C && A == 7)
        {
                cout << "YES" << endl;
        }
        else
        {
                cout << "NO" << endl;
        }

        return 0;
}


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

using namespace std;

inline int get_steps(int a, int b) {
	return abs(a - b) / 2;
}

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

	vector<int> vec(3);

	cin >> vec[0] >> vec[1] >> vec[2];

	sort(vec.begin(), vec.end());

	bool o1_p = vec[0] % 2;
	bool o2_p = vec[1] % 2;
	bool max_p = vec[2] % 2;

	int ans = get_steps(vec[0], vec[2]) + get_steps(vec[1], vec[2]);

	if ((o1_p == max_p && o2_p != max_p) || (o1_p != max_p && o2_p == max_p)) ans += 2;
	else if (o1_p != max_p && o2_p != max_p) ++ans;

	cout << ans;

	//system("pause");
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdint.h>
#include<stdbool.h>
#include<math.h>
#include<time.h>
#define ll long long
#define min(a,b) ((a)>(b)?(b):(a))
#define max(a,b) ((a)>(b)?(a):(b))
#define miin(a,b,c) min((a), min((b), (c)))
#define maax(a,b,c) max((a), max((b), (c)))
int n, a[222222] = {}, nyan = 1;
int cmp(const int *a, const int *b){
    return *a - *b;
}
int main(){
    scanf("%d", &n);
    for(int i = 0; i < n; i++){
        scanf("%d", &a[i]);
    }
    qsort(a, n, 4, cmp);
    for(int i = 1; i < n; i++){
        nyan *= (a[i-1] != a[i]);
    }
    puts(nyan?"YES":"NO");
    return 0;
}

Measured memory_bytes: 1788
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define int long long
int dp[3001][3001];


int maxscore(int i,int j,int a[]){
    if(i>j){return 0;}
    if(j==i){return a[i];}
    if(j-i == 1){return max(a[i],a[j]);}
    if(dp[i][j] != -1){return dp[i][j];}

    int op1 = a[i] + min(maxscore(i+2,j,a),maxscore(i+1,j-1,a));
    int op2 = a[j] + min(maxscore(i+1,j-1,a),maxscore(i,j-2,a));

    return dp[i][j] = max(op1,op2);
    
}
 
 int32_t main(){
     int n;
     cin>>n;
     int a[n+1];
     a[0] = 0;
     int total = 0;
     for(int i=1;i<=n;i++){
         cin>>a[i];
         total += a[i];
     }
     memset(dp,-1,sizeof dp);
     int x = maxscore(1,n,a);
     cout<<2*x-total;
 }

Measured memory_bytes: 74092
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define fir first 
#define sec second
#define int long long
#define endl "\n"
using namespace std;
const int nax=1e5+5;
vector<int>adj[nax];
const int mod=1e9+7;
const int inf=1e18+7;

signed main(){
	int n,m;
	cin>>n>>m;
	int sum=0;
	for(int i=0;i<m; i++){
		int a;
		cin>>a;
		sum+=a;
	}
	int ans= n-sum>=0?n-sum:-1;
	cout<<ans<<endl;
	return 0;
}



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

int main() {
    int n,ans = 0;
    long double d; 
    cin >> n >> d;
    for (int i = 0; i < n; i++){
        long int p,q;
        long double sum;
        cin >> p >> q;
        sum = sqrt(p * p + q * q);
        if(d >= sum) ans ++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3844
#include <bits/stdc++.h>
using namespace std;
int main() 
{
    int i,j,k,l,m,n,a,b,c,x,y,z,five,seven;
    string strs[10000];
  	while(cin>>n>>l)
    {
        for(i=0;i<n;i++)
            cin>>strs[i];
        sort(strs,strs+n);
        for(i=0;i<n;i++)
            cout<<strs[i];
        cout<<endl;
      	
    }
   
    return 0;
}

Measured memory_bytes: 384
#include <iostream>

using namespace std;

int main(void) {
	int in;
	cin >> in;
	int a = in / 1000, b = in / 100 % 10, c = in / 10 % 10, d = in % 10;

	int tb, tc, td;
	int i;

	for(i = 0 ; i < (1<<3); i ++) {
		tb = ((i >> 2) % 2 ? 1 : -1) * b;
		tc = ((i >> 1) % 2 ? 1 : -1) * c;
		td = ((i >> 0) % 2 ? 1 : -1) * d;

		if (a + tb + tc + td == 7){
			cout<<a;
			cout<<(tb > 0 ? "+" : "-")<<b;
			cout<<(tc > 0 ? "+" : "-")<<c;
			cout<<(td > 0 ? "+" : "-")<<d;
			cout<<"=7"<<endl;
			break;
		}
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
// 217
// 44


/*const int MOD = (int) 1e9 + 7;

inline void mod(int &x) {
    if(x >= MOD)
        x -= MOD;
}

inline void add(int &x, int y) {
    x += y;
    mod(x);
}

inline void mul(int &x, int y) {
    x = (1LL * x * y) % MOD;
}*/

using namespace std;



int main() {
    //ifstream cin("B.in");
    //ofstream cout("B.out");
    int n, k;
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    string str;
    cin >> n >> k >> str;
    int cnt = 0;
    for(int i = 0; i + 1 < n; i++) {
        if(str[i] == str[i + 1]) {
            cnt++;
        }
    }
    cout << min(cnt + 2 * k, n - 1);

    return 0;
}


Measured memory_bytes: 512
import heapq

x, y, z, k = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)

que = [(-(a[0]+b[0]+c[0]), 0, 0, 0)]
is_pushed = {(0, 0, 0): 1}
for _ in range(k):
    v, p, q, r = heapq.heappop(que)
    print(-v)
    if p+1 < x and not is_pushed.get((p+1, q, r)):
        heapq.heappush(que, (-(a[p+1]+b[q]+c[r]), p+1, q, r))
        is_pushed[(p+1, q, r)] = 1
    if q+1 < y and not is_pushed.get((p, q+1, r)):
        heapq.heappush(que, (-(a[p]+b[q+1]+c[r]), p, q+1, r))
        is_pushed[(p, q+1, r)] = 1
    if r+1 < z and not is_pushed.get((p, q, r+1)):
        heapq.heappush(que, (-(a[p]+b[q]+c[r+1]), p, q, r+1))
        is_pushed[(p, q, r+1)] = 1


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

typedef long long int ll;

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

    ll n,d;
    cin>>n>>d;

    ll ans = 0;
    ll len = 0;

    for(ll i=1;i<=n;i++){
        len++;
        if(len<=2*d+1){

        }
        else{
            //cout<<i<<endl;
            ans++;
            len = 1;
        }
    }
    if(len>0){
        ans++;
    }

    cout<<ans<<endl;

}


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

using namespace std;

int n, m; 
int occ[200005];
int arr[200005];
int intv[200005];
int zeros;

void update(int pos, int v){
	if(pos < 0) return;
	if(intv[pos] == 0) zeros--;
	intv[pos] += v;
	if(intv[pos] == 0) zeros++;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin >> n >> m;
	zeros = n;
	
	for(int i = 0;i < n;i++){
		int a; cin >> a;
		arr[i+1] = a;
		occ[a]++;
		update(a - occ[a], 1);
	}

	for(int i = 0;i < m;i++){
		int x, a; cin >> x >> a;
		int preA = arr[x];
		
		update(preA - occ[preA], -1);
		occ[preA]--;
		
		arr[x] = a;
		
		occ[a]++;
		update(a - occ[a], 1);
		
		cout << zeros << "\n";
	}
}


Measured memory_bytes: 3840
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  long long  n, a, b, ans;
  cin >> n >> a >> b;
  
  ans = (n / (a+b)) * a;
  
  n %= (a+b);
  ans += min(a, n);
  cout << ans << "\n";
  return 0;
}




Measured memory_bytes: 256
fun main(args : Array<String>) {
  val list = readLine()!!.split(" ").map(String::toInt)
  
  val a = list[0]
  val b = list[1]
  
  if(a >= 13){
   println(b.toString()) 
  } else if(a >= 6){
    println((b/2).toString()) 
  } else {
    println("0")
  }
}

Measured memory_bytes: 37908
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    string s,t;
    cin >> s >> t;
    string er="UNRESTORABLE";
    ll si=s.size();
    ll ti=t.size();
    if(si<ti){
        print(er);
        return;
    }
    bool ans=false;
    for(ll i=si-ti; i>=0; i--){
        bool ok=true;
        repi(j,i,i+ti){
            if(s[j]=='?') continue;
            if(s[j]!=t[j-i]){
                ok=false;
                break;
            }
        }
        if(ok) {
            ans=true;
            repi(j,i,i+ti) s[j]=t[j-i];
            break;
        }
    }
    if(ans){
        for(auto ch:s){
            if(ch=='?') cout << 'a';
            else cout << ch;
        }
        cout << endl;
    }else{
        print(er);
    }
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define pback push_back
#define mpair make_pair
#define MODN 1000000007

using namespace std;


int main(){


    int n,m;
    cin >> n >> m;

    vector<pair<int,int>> works;
    vector<int> schedule;

    //添字でmまで扱いたいため
    rep(i,m + 1){
        schedule.pback(0);
    }

    rep(i,n){
        int a,b;
        cin >> a >> b;

        works.pback(mpair(a,b));
    }

    sort(works.begin(),works.end());

    priority_queue<int> pq;

    int workcount = 0;

    for(int i = 1; i <= m; i++){

        while(works[workcount].first == i){
            pq.push(works[workcount].second);
            workcount++;
        }

        if(!pq.empty()){    
            schedule[i] = pq.top();
            pq.pop();
        }
    }

    int ans = 0;

    rep(i,m){
        ans = ans + schedule[i + 1];
    }

    cout << ans << endl;

}

Measured memory_bytes: 2292
n, k = map(int, input().split())

trees = []
for _ in range(n):
  trees.append(int(input()))
  
  
trees.sort()
ans = 10**9+1
for i in range(n-k+1):
  if ans > trees[i+k-1] - trees[i]:
    ans = trees[i+k-1] - trees[i]
    
print(ans)

Measured memory_bytes: 7488
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int w = scan.nextInt();
        int a = scan.nextInt();
        int b = scan.nextInt();
        int out = 0;
        if(a <= b){
            if(b > a + w){
                out = b - a - w;
            }
        }else if(a > b + w){
            out = a - b - w;
        }
        System.out.println(out);
    }
}

Measured memory_bytes: 21844
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

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

int main(){
	int a,b,n;
	while(scanf("%d%d%d",&a,&b,&n)!=EOF){
		
		
		int sum = 0;
		rep(i,n){
			int ca = a;
			int cb = b;
			
			rep(j,i+1){
				ca = ca%cb;
				ca*=10;
			}
			
			double c = (double)ca/cb;
			
			int t = int(c);
			sum+=t;
			//printf("!%d ",t);
		}
		
		printf("%d\n",sum);
	}
}

Measured memory_bytes: 1172
N = int(input())
L = list(map(int,input().split()))
import bisect
 
L.sort()
ans = 0
 
for i in range(N-2):
  for j in range(i+1,N-1):
    ans += bisect.bisect_left(L,L[i]+L[j])-(j+1)
    
print(ans)

Measured memory_bytes: 3188
n,m = map(int,input().split())
min_ = 0
max_ = 100001
for i in range(m):
  li = list(map(int,input().split()))
  
  if min(li) >= min_ :
    min_ = min(li)
  if max(li) <= max_:
    max_ = max(li)
if min_ > max_:
    print(0)
else:
    print(max_ - min_ + 1)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <queue>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
typedef long long ll;
typedef pair <int,ll> pii;


int main(void)
{
  string a,b;
  cin >> a >> b;
  string sq=a+b;
  int sq2=stoi(sq);
  int i=1;
  while(i*i<=sq2)
    {
      if(i*i==sq2)
	{
	  cout << "Yes" << endl;
	  return 0;
	}
      i++;
    }

  cout << "No" << endl;
  return 0;


}


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

bool fg ;
int dfs(const Graph &G,vector<bool> seen, int v) {
    seen[v] = true; // v を訪問済にする
    fg =true;
    for (int a=0;a<seen.size();a++){
      if(!seen[a]) fg=false;
    }
    if(fg) return 1;
  
    int total=0;

    // v から行ける各頂点 i について
    for (int i=0; i<seen.size();i++){
        if(!G[v][i])continue;
        if(seen[i])continue;
        seen[i]=true;
        total += dfs(G, seen, i); // 再帰的に探索
        seen[i]=false;
    }
    return total;
}

int main(){
  
  //入力・準備
  int N; int M;
  cin >> N >> M;
  Graph G(N, vector<int>(N));;
  for(int i=0;i<M;i++){
    int a, b;
    cin >> a >> b;
    a--; b--;
    G[a][b]=1;
    G[b][a]=1;
  }
  
  //実装
  vector<bool> seen;
  seen.assign(N,false);
  cout << dfs(G,seen,0) << endl;
  
}

Measured memory_bytes: 256
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#define pb push_back 
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
typedef long long ll;
const int INF = 100000000, mod = 1000000007;
const double pi = 3.14159265;
const ll LLINF = 1LL << 50;
using namespace std;


int main() {
    ll q, h, s, d, n;
    cin >> q >> h >> s >> d >> n;
    ll one, two;
    one = min(min(q * 4, h * 2), s);
    two = min(one * 2, d);
    if (n % 2 == 0) {
        cout << two*(n / 2) << endl;
    }
    else {
        cout<< two*(n / 2)+one << endl;
    }
    return 0;
}


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

#define F first 
#define S second
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef priority_queue<int> HEAP;
typedef priority_queue<int, vector<int>, greater<int> > RHEAP;

const int N = 100010, M = 1010, mod = 1e9 + 7;

int n, m;
int a[N];
int fact[N], infact[N];

int qp(int a, int b)
{
	int res = 1;
	while (b)
	{
		if (b & 1) res = (LL)res * a % mod;
		a = (LL)a * a % mod;
		b >>= 1;
	}
	return res;
}

int C(int a, int b)
{
	return (LL)fact[a] * infact[b] % mod * infact[a - b] % mod;
}

int main()
{
	scanf("%d%d", &n, &m);
	fact[0] = infact[0] = 1;
	for (int i = 1; i <= n; i ++ )
	{
		fact[i] = (LL)fact[i - 1] * i % mod;
		infact[i] = (LL)infact[i - 1] * qp(i, mod - 2) % mod;
	}
	for (int i = 1; i <= n; i ++ ) scanf("%d", &a[i]);
	
	int res = 0;
	sort(a + 1, a + n + 1);
	for (int i = m; i <= n; i ++ ) res = (res + (LL)a[i] * C(i - 1, m - 1) % mod) % mod;
	reverse(a + 1, a + 1 + n);
	for (int i = m; i <= n; i ++ ) res = (res - (LL)a[i] * C(i - 1, m - 1) % mod) % mod;
	
	res = (res % mod + mod) % mod;
	printf("%d\n", res);
    return 0;
}

Measured memory_bytes: 4880
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint();
	int A[200001];
	rep(i, N) A[i] = getint();

	ll kotae = 0;
	int k = 0;
	int tmpp = 0;
	int tmpx = 0;
	rep(i, N) {
		while (tmpp == tmpx && k <= N) {
			tmpp += A[k];
			tmpx ^= A[k];
			k++;
		}
		tmpp -= A[i];
		tmpx ^= A[i];

		kotae += k - i - 1;
	}
	co(kotae);

	Would you please return 0;
}

Measured memory_bytes: 1152
/*
    author: blue_matrix
*/
#include <bits/stdc++.h>
using namespace std;

#define n_l '\n'
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; cout << to_string(__VA_ARGS__) << endl
template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(const string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(const bool b) { return (b ? "true" : "false"); } string to_string(const char c){ return string({c}); } template<size_t N> string to_string(const bitset<N> &b, int x1=0, int x2=1e9){ string t = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } return '"' + t + '"'; } template <typename A, typename... C> string to_string(const A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(const pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(const A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += n_l; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += n_l; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; if(l_v_l_v_l == 0) res += n_l; return res; } void dbgm(){;} template<typename Heads, typename... Tails> void dbgm(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgm(T...); } 
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgm(__VA_ARGS__); cout << endl
#define ll long long
void dfs(vector<string> &v,vector<vector<bool>> &vis,ll i,ll j,ll n,ll m)
{
    vis[i][j]=true;
    if(i>n || i<1 || j>m || j<1)
        return ;
    
    // cout<<" ("<<i<<" "<<j<<") ";
    for(ll k=-1;k<=1;k++)
    {
        for(ll p=-1;p<=1;p++)
        {
            if(p==0 || k==0)
            {
                if(vis[i+k][j+p]==false and v[i+k][j+p]=='.' )
                    dfs(v,vis,i+k,j+p,n,m);
            }
        }
    }
    return ;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll a,b,h,m;
    double PI= 3.141592653589793238;
    cin>>a>>b>>h>>m;
    double ans=0;
    double x=(double)m/5.0;
    double deg= abs((double)30.0*(h-x)+0.5*(m));
    // cout<<deg<<endl;
    ans=sqrt((double)a*a+(double)b*b-(double)2*a*b*cos(deg*PI/180.0));

    
    cout<<fixed<<setprecision(16)<<ans<<endl;
    return 0;
}

Measured memory_bytes: 4212
n = int(input())
squeres = list(map(int, input().split()))
flag = True
before_down = 0
for i in range(n - 1):
    if squeres[i] > squeres[i + 1] and squeres[i] - 1 <= squeres[i + 1] and before_down == 0:
        before_down = 1

    elif not squeres[i] <= squeres[i + 1]:
        flag = False
    
    else:
        if squeres[i] < squeres[i + 1]:
            before_down = 0
if flag:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 20772
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, N)
	for i := range A {
		fmt.Scan(&A[i])
	}
	tempM := make(map[int]int)
	for _, a := range A {
		tempM[a]++
	}
	m := make(map[int]int)
	for a, v := range tempM {
		if v > 1 {
			m[a] = v
		}
	}
	count := 0
	for _, v := range m {
		if v <= 1 {
			continue
		}
		count += v * (v - 1) / 2
	}
	for _, a := range A {
		v := m[a]
		if v <= 1 {
			fmt.Println(count)
			continue
		}
		reduced := count - v*(v-1)/2
		if v == 2 {
			fmt.Println(reduced)
			continue
		}
		v--
		reduced += v * (v - 1) / 2
		fmt.Println(reduced)
	}
}


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

#define maxn 2500
#define INF 0x3f3f3f3f
#define mod 1000000007
typedef long long ll;
using namespace std;


int dis[27][27], ans;

void slove()
{
	ll n, sum = 0;
	cin >> n;
	for (int i = 1; i <= n; i++)
		if (i % 3 && i % 5) sum += i;
	cout << sum;
}


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

	slove();

	return 0;
}

Measured memory_bytes: 3608
//bismillahir rahmanir rahim            //Author:Fayed Anik
 
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
//using namespace __gnu_pbds;
 
//#define         ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define         ll                          long  long
#define         lf                          double
#define         pb(x)                       push_back(x)
#define         ull                         unsigned long long
#define         sfl(a)                      scanf("%lld",&a)
#define         sf(a)                       scanf("%d",&a)
#define         pf(a)                       printf("%d\n",a)
#define         pfl(a)                      printf("%lld\n",a)
#define         FOR(x,n)                    for(ll x=1;x<=n;++x)
#define         pii                         pair< ll , ll >
#define         mp(a,b)                     make_pair(a,b)
#define         UNIQUE(v)                   v.resize(distance(v.begin(),unique(v.begin(),v.end())))
#define         mod                         1000000007
#define         INF                         2e18
#define         EPS                         1e-15
#define         f1                          first
#define         f2                          second
#define         all(v)                      v.begin(),v.end()
#define         PI                          acos(-1)
#define         printminusone               printf("-1\n")
#define         bug                         printf("bug")
#define         FILEIN                      freopen("in.txt","r",stdin)
#define         FILEOUT                     freopen("out.txt","w",stdout)
 
//ll SET(ll mask,ll pos){ return mask = (mask | (1ll<<pos)); }
//ll RESET(ll mask,ll pos){ return mask = mask & ~(1ll<<pos); }
//bool CHECK(ll mask,ll pos) { return (bool) (mask & (1ll<<pos)); }
//priority_queue <ll, vector<ll>, greater<ll> > pq;
//int dx[]={0,0,1,-1,1,1,-1,-1};
//int dy[]={1,-1,0,0,1,-1,1,-1};


#define lim 2005

ll dp[lim],a[lim],n,s,ans;


ll F(ll now){
    if(now<0) return 0;
    if(now==0) return 1;
    ll &ret = dp[now];
    if ( ~ret ) return ret;
    ret = 0;
    for(ll i=1;i<=n;i++){
        ret = (ret+F(now-a[i]))%mod;
    }
    return ret;
}
int main(){
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    sfl(s);
    n = s-2;
    for(ll i=1,j=3;i<=n;i++,j++){
        a[i] = j;
    }
    memset(dp,-1,sizeof dp);
    ans = F(s);
    pfl(ans);
    return 0;
}

Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int64_t,int64_t> pll;
typedef vector<int64_t> vl;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
const long double PI = acos(-1);
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define sz(s) (s).size()
#define ALL(a) begin(a),end(a)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

int r(){int x;cin>>x;return x;}

void solve() 
{
    int h,w;cin>>h>>w;
    int g[h][w];
    REP(i,h)REP(j,w){
        int x;cin>>x;
        g[i][j]=x;
    }
    REP(i,h)REP(j,w){
        int x;cin>>x;
        g[i][j]=abs(g[i][j]-x);
    }
    bitset<40000>dp[h][w];//20000=0
    const int M=20000;
    dp[0][0][M+g[0][0]]=1;
    dp[0][0][M-g[0][0]]=1;
    REP(i,h)REP(j,w){
        if(i){
            dp[i][j] |= dp[i-1][j]<<g[i][j];
            dp[i][j] |= dp[i-1][j]>>g[i][j];
        }
        if(j){
            dp[i][j] |= dp[i][j-1]<<g[i][j];
            dp[i][j] |= dp[i][j-1]>>g[i][j];
        }
    }
    int ans=50000;
    REP(i,40000){
        if(dp[h-1][w-1][i])ans=min(ans,(int)abs(i-M));
    }
    cout<<ans<<endl;
}

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


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

bool check_even( string& s )
{
	if( s.length() % 2 != 0 ) {
		return false;
	}
	int l = s.length() / 2;
	string left = s.substr(0, l);
	string right= s.substr(l, l);
	if(left == right){
		return true;
	} else {
		return false;
	}
}

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

	int cnt = 1;
	s.pop_back();
	while( !check_even( s ) ){
		s.pop_back();
		++cnt;
	}
	cout << s.length() << endl;

	return 0;
}


Measured memory_bytes: 256
/*#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")*/
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;

#define amen ;
#define vec vector
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define Str(x) to_string(x)
#define len(s) (int)s.size()
#define int long long
typedef long long ll;
typedef double d;
typedef long double lld;
typedef string str;
typedef unsigned long long ull;
typedef unsigned int ui;

 main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, k;
    cin >> n >> k;
    vector <int> v(n);
    for (auto &it : v)
        cin >> it;
    int cnt = 40;
    int ans = 0, flex = 0;
    for (int i = cnt - 1; i >= 0; i--)
    {
        int g = ((ll)1 << i), sum = 0;
        for (auto it : v)
        {
            if ((g & it))
                sum++;
        }
        if (sum < n - sum)
        {
            if (flex + g > k)
            {
                ans += sum * g;
            }
            else
            {
                flex += g;
                ans += (n - sum) * g;
            }
        }
        else
        {
            ans += sum * g;
        }
    }
    cout << ans << endl;



    return 0;
}

Measured memory_bytes: 1024
#include <iostream>

using namespace std;
using ll = long long;
using ld = long double;

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

void solve(ll X, ll A, ll B) {
  cout << (X-A)%B << endl;
}

int main() {
  ll X;
  cin >> X;
  ll A;
  cin >> A;
  ll B;
  cin >> B;
  solve(X, A, B);
  return 0;
}


Measured memory_bytes: 256
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";var r=n(1);n(2)(r.readFileSync("/dev/stdin","utf8"))},function(t,e){t.exports=require("fs")},function(t,e,n){"use strict";var r=n(3),i=n(5);t.exports=function(t){var e=new r(t);i(e)}},function(t,e,n){"use strict";var r=n(4);t.exports=class{constructor(t){var e=t.trim().split(/\s+/g);this.inp=new r(e)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(t,e,n){"use strict";t.exports=class{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=t.length,this.items=t,this.ind=0}enq(t){this.size+=1,this.items.push(t)}deq(){var t=this.items[this.ind];return this.size-=1,this.ind+=1,t}clear(){this.items=[],this.size=0,this.ind=0}}},function(t,e,n){"use strict";t.exports=function(t){var e=t.in(),n=t.in(),r=0;e>=n?(r+=e,r+=--e>=n?e:n):(r+=n,r+=e>=--n?e:n),console.log(r)}}]);

Measured memory_bytes: 21956
#include "iostream"
using namespace std;

int main()
{
	int x, y, a, b, c,z,d;
	int i = 1;
	cin >> x;
	cin >> a;
	cin >> b;
	y = x - a;
	for (i; i*b <= y; i++) //for文がまだ使えてない、しっかり条件を明確にする
	{
		d = i * b;
	};
	z = y - d;
	cout << z;
    return 0;
}


Measured memory_bytes: 256
object Main extends App {

  val mod = 1000000007

  def mul(a: Int, b: Int): Int = {
    ((a % mod) * (b % mod)) % mod
  }

  def add(a: Int, b: Int): Int = {
    (a + b) % mod
  }


  val Array(n, m) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
  var a = Array.fill(n + 3)(0)

  (1 to m).foreach { _ =>
    val aa = scala.io.StdIn.readLine.toInt
    a(aa) = -99
  }
  a(0) = 1
  //println(a.deep)

  (0 to n).foreach { i =>
    val cnt = a(i)
    if (cnt != -99) {
      if (a(i + 1) != -99) {
        a(i + 1) = add(a(i + 1), cnt)
      }
      if (a(i + 2) != -99) {
        a(i + 2) = add(a(i + 2), cnt)
      }
    }
  }

 // println(a.deep)
  println(a(n))
}

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

#define pb push_back
#define ll unsigned long long
#define ff first
#define ss second
#define pii pair<int,int> 
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);

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

int main(){
    fastio
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    int ans =0;
    ll x,y;
    a -=1;
    x = b/c-a/c;
    y = b/d-a/d;
    ll z = (c*d)/gcd(c,d);
    ll r = b/z - a/z;
    cout<<(b-a-(x+y-r))<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;
  
  	cin >> s;
  
  	int tmp;
  	int i;
  
  	tmp = 0;
  	for(i=0; i<s.size(); i++){
      tmp += (s[i] - 48);
    }
  
  	if(tmp % 9 == 0)
      cout << "Yes";
  	else
      cout << "No";
  
  	return 0;
}


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

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

  vector<int> p(n), q(n), v(n);
  vector<vector<int>> w;
  rep(i, n) cin >> p[i];
  rep(i, n) cin >> q[i];
  rep(i, n) v[i] = i + 1;

  int i = 0;
  do {
    w.push_back(v);
  } while (next_permutation(v.begin(), v.end()));

  int ip = 0, iq = 0;
  rep(i, w.size()) {
    bool is_p = true;
    rep(j, n) {
      if (w[i][j] != p[j])
        is_p = false;
    }
    if (is_p)
      ip = i;
    bool is_q = true;
    rep(j, n) {
      if (w[i][j] != q[j])
        is_q = false;
    }
    if (is_q)
      iq = i;
  }

  cout << abs(ip - iq) << endl;
}

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

using namespace std;

int main()
{
    int a;
    int b;

    cin >> a;
    cin >> b;

    if ((a * b) % 2 == 0)
    {

        cout << "Even" << endl;
    }
    else
    {
        cout << "Odd" << endl;
    }

    return 0;
}

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

int main(){
  int n, m;
  cin >> n;
  map<string, int> mp;
  for(int i = 0; i < n; i++){
    string s;
    cin >> s;
    mp[s]++;
  }
  
  cin >> m;
  for(int i = 0; i < m; i++){
    string s;
    cin >> s;
    mp[s]--;
  }
  int ans = -10000007;
  for(pair<string, int> x : mp){
    ans = max(ans, x.second);
  }
  cout << max(ans, 0) <<endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long int a,b,c,k;
    scanf("%lld %lld %lld %lld",&a,&b,&c,&k);
    if(k<=a){
        printf("%lld",k);
    }else if(k<=a+b){
        printf("%lld",a);
    }else{
        printf("%lld",a-(k-(a+b)));
    }
    return 0;
}

Measured memory_bytes: 3836
#define DBG 1

#include<bits/stdc++.h>
 
#define fi first
#define se second
 
#define mp make_pair
#define pb push_back
 
#define all(x) (x).begin(), (x).end()
 
#define F return

#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)

#define debug(x) if(DBG) cerr << #x << " is " << x << '\n';

typedef long long ll;

using namespace std;                             

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

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pair<int,int>> vpii;

const int MAXN = 2e5 + 500;
const int INF = 1e9 + 23;
    
const int MOD = 1e9 + 7;

int n, d[MAXN];

//Real Code Started from Here;


void solve() {
    //code here;
int x,y,z;
cin>>x>>y>>z;
cout<<z<<" "<<x<<" "<<y;		
	
}	


//Main Function;

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

//if test cases is not given;
	
	solve();

//if no of test cases is given;
    
/*
	
	int tt;cin>>tt;
	while (tt--) {
		solve();
	}
	
*/

    // you should actually read the stuff at the bottom
return 0;
}
/*
logic






*/


Measured memory_bytes: 256
from sys import stdin

a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())
c = int(stdin.readline().rstrip())
x = int(stdin.readline().rstrip())

count = 0

for i in range(a+1):
  if i * 500 > x: continue
  for j in range(b+1):
    if i * 500 + j * 100 > x: continue
    for k in range(c+1):
      if i * 500 + j * 100 + k * 50 == x: count += 1
        
print(count)

Measured memory_bytes: 3188
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
    int n;
    double s;
    double sum, ave;
    double var;
    vector<double> ss;
    double sd;

    cin>>n;
    do {
        ss.clear();
        sum = 0;
        ave = 0;
        var = 0;
        for (int i=0; i<n; ++i) {
            cin>>s;
            ss.push_back(s);
            sum += s;
        }
        ave = sum / n;
        for (int i=0; i<n; ++i) {
            var += pow((ss[i] - ave), 2.0);
        }
        sd = sqrt(var/n);
        cout<<setprecision(8)<<sd<<endl;

        cin>>n;
    } while (n != 0);

    return 0;
}



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

int main() {
	int N, K;
	cin >> N >> K;
	int buf;
	for (int i = 0; i < N; i++) cin >> buf;
	int ans = 1, sum=K;
	while (sum < N) {
		ans++;
		sum += K - 1;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

number=int(input())
consequence=factorize(number)
c=list(set(consequence))

ans=0

for i in range(len(c)):
    Count=consequence.count(c[i])
    d=f=1
    while Count >= d:
        f +=1
        d +=f
        ans +=1

print(ans)

Measured memory_bytes: 9216
N,M=map(int,input().split())
q=[[] for i in range(N+1)]
for i in range(M):
    l,r,x=map(int,input().split())
    q[r].append((l,x))
mod=10**9+7

dp=[[0 for i in range(N+1)] for i in range(N+1)]

i=N
for j in range(N+1):
    for k in range(N+1):
        check=7
        for l,x in q[i]:
            if i==l:
                check=(x==1)*check
            elif i-1>=l>j:
                check=(x==1)*(check%2)+(x==2)*(check&6)
            elif j>=l>k:
                check=(x==2)*(check&3)+(x==3)*(check&4)
            else:
                check*=(x==3)
        dp[j][k]=bin(check).count("1")

ndp=[[0 for j in range(N+1)] for k in range(N+1)]
for i in range(N-1,0,-1):
    for j in range(i):
        for k in range(j+1):
            check=7
            for l,x in q[i]:
                if i==l:
                    check=(x==1)*check
                elif i-1>=l>j:
                    check=(x==1)*(check%2)+(x==2)*(check&6)
                elif j>=l>k:
                    check=(x==2)*(check&3)+(x==3)*(check&4)
                else:
                    check*=(x==3)
            ndp[j][k]=(dp[j][k]*((check//1)%2)+dp[i-1][k]*((check//2)%2)+dp[i-1][j]*((check//4)%2))%mod

    dp=ndp

print(dp[0][0])

Measured memory_bytes: 68828
// -*- coding:utf-8; tab-width:4 -*-
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>

// 解答
namespace solution {
    using namespace std;
   
    typedef istringstream ISS;
    typedef ostringstream OSS;
    typedef vector<string> VS;
    typedef long long LL;
    typedef int INT;
    typedef vector<INT> VI;
    typedef vector<VI> VVI;
    typedef pair<INT, INT> II;

    LL a, b;

    template <class T> T gcd( T a, T b ) {
        T i, j;
        for ( i = 0; ! ( a & 1 ); ++ i )
            a >>= 1;
        for ( j = 0; ! ( b & 1 ); ++ j )
            b >>= 1;
        while ( b != a ) {
            b -= a;
            if ( b < 0 ) {
                a += b;
                b = -b;
            }
            while ( ! ( b & 1 ) )
                b >>= 1;
        }
        return a << min( i, j );
    }

    template <class T> T lcm( T a, T b ) {
        T larger = a > b ? a : b;
        T smaller = a > b ? b : a;
        T res = larger;
        while ( res % smaller != 0 )
            res += larger;
        return res;
    }

    struct Solution {
        void init() {
        }
   
        bool input() {
            return cin >> a >> b;
        }

        void solve() {
            cout << gcd(a,b) << " " << lcm(a,b) << endl;
        }
      
        int run() {
            while ( init(), input() ) {
                solve();
            }
            return 0;
        }
    };
}

int main() {
    return solution::Solution().run();
}

Measured memory_bytes: 1156
#include<iostream>
#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 <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int sub(int a,vector<char>b,int c,int d){
  if(c%2019==0&&c!=0)return 1;
  return sub(a+1,b,c+b[d]*a,d+1);
}
int main(){ 
  int a;cin>>a;
  cout<<a*800-(a/15)*200;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

X,Y=map(int,input().split())

for i in range(X+1):
    if i*2+(X-i)*4==Y:
        print('Yes')
        exit()
print('No')

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>0;(i)--)
#define rrep(i,n,m) for(int (i)=(n);(i)<(m);(i)++)
#define rrepr(i,n,m) for(int (i)=(n);(i)>(m);(i)--)
#define SORT(s) sort((s).begin(),(s).end())
#define SORTR(s,t) sort((s).begin(),(s).end(),greater<t>())

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;

const int INF = 1000000000;
const ll LINF = 1000000000000000000ll;
const double PI = acos(-1.0);
const double EPS = 1e-10;

const ll MOD = 1000000007ll;
const int MAX=510000;

int a; string s;
void input(){
    cin>>a>>s;
    return;
}

void solve(){
    if(a>=3200) cout<<s<<endl;
    else cout<<"red\n";
    return;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

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

int main(){
    int n;
    int a[110];
    cin >> n;
    for (int i = 0; i<n; i++) cin >> a[i];

    sort(a, a+n, greater<int>());
    int Alice = 0;
    int Bob = 0;
    for(int i=0; i<n; i++){
        if(i%2 == 0){
            Alice += a[i];
        }
        else{
            Bob += a[i];
        }
    }
    cout << Alice-Bob << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const long double EPS = 1e-9;
const ll mod = 1e9 + 7;
const ll INF = 1e9;

#define rep(i, n) for(ll i = 0; i < n ; i++ )
#define For(i, a, b) for(ll i = (a); i < (b) ; i++ )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

const ll MAX_N = 3000010;

int main(void){
    ll A, B;

    cin >> A >> B;

    if ((A + B) % 2 == 1){
        cout << "IMPOSSIBLE" << endl;
    }else{
        cout << (A + B) / 2 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1e9
#define LINF 1e18
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
#define int long long
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
struct edge{int to,cost;};
typedef pair<int,int> P;

bool isupper(char c){if('A'<=c&&c<='Z')return 1;return 0;}
bool islower(char c){if('a'<=c&&c<='z')return 1;return 0;}
bool isPrime(int x){if(x==1)return 0;if(x==2)return 1;if(x%2==0)return 0;for(int i=3;i*i<=x;i++)if(x%i==0)return 0;return 1;}
bool iskaibun(string s){for(int i=0;i<s.size()/2;i++)if(s[i]!=s[s.size()-i-1])return 0;return 1;}
bool isnumber(char c){return ('0'<=c&&c<='9');}
bool isalpha(char c){return (isupper(c)&&islower(c));}
void printvi(vector<int> v){rep(i,0,v.size()){if(i)cout<<" ";cout<<v[i];}cout<<endl;}
void printvil(vector<int> v){rep(i,0,v.size()){cout<<v[i]<<endl;}}
void printvvi(vector<vector<int>> v){
    rep(i,0,v.size()){
        rep(j,0,v[i].size())cout<<v[i][j];
        cout<<endl;
    }
}
void printvstr(vector<string> v){
    rep(i,0,v.size()){
        cout<<v[i]<<endl;
    }
}

signed main (){
    int n;cin>>n;
    vector<int> ans;
    for(int i=2;i<=55555;i++){
        if(isPrime(i) && i%5==1){
            ans.emplace_back(i);
        }
        if(ans.size()==n)break;
    }
    printvi(ans);
}
/*

*/


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

char query[50004];
char buffer[50004];

int gets2(char* row,int len) {
	char* lf;
	if(!fgets(row,len,stdin))return 0;
	lf=strchr(row,'\n');
	if(lf)*lf=0;
	return 1;
}

int main(void) {
	char* nowquery=NULL;
	int currentindent;
	int isobject;
	int found;
	int previsstring;
	char* thestring;
	gets2(query,sizeof(query));
	currentindent=0;
	previsstring=0;
	found=1;
	while(found && (nowquery=strtok(nowquery?NULL:query,"."))) {
		found=0;
		currentindent=-1;
		if(previsstring)break;
		while(gets2(buffer,sizeof(buffer))) {
			char* kugiri;
			char* start;
			int nowindent;
			for(start=buffer;*start==' ';start++);
			kugiri=strchr(start,':');
			if(kugiri==NULL)return 1;/* sintax error */
			nowindent=(int)(start-buffer);
			if(currentindent<0)currentindent=nowindent;
			if(nowindent!=currentindent)continue;
			*kugiri=0;
			if(strcmp(start,nowquery)==0) {
				found=1;
				previsstring=(*(kugiri+1)==' ');
				if(previsstring)thestring=kugiri+2;
				break;
			}
		}
	}
	if(found) {
		if(previsstring) {
			printf("string \"%s\"\n",thestring);
		} else {
			puts("object");
		}
	} else {
		puts("no such property");
	}
	return 0;
}

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

int main(){
  int N;
  int A[200];
  cin >> N;
  for(int i=0 ; i<N ; ++i) cin >> A[i];
  int res = 0;

  while(true){

    bool exist_odd =false;

    for(int i=0;i<N;++i){
      if(A[i]%2 != 0) exist_odd = true;
    }

    if(exist_odd) break;

    for(int i=0;i<N;++i) A[i] /= 2;

    ++res;
  }

  cout << res <<endl;
}


Measured memory_bytes: 256