akhauriyash/Code-Regression huggingface dataset:
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> using vv=vector<vector<T>>;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
const ll MOD=1e9+7;

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  int n,m;
  cin>>n>>m;
  vector<pii> ps(m);
  vector<int> cnt(n,1),ex(n);
  ex[0]=1;
  rep(i,m){
    int x,y;
    cin>>x>>y; --x; --y;
    ps[i]=pii(x,y);
  }
  for(pii p:ps){
    ex[p.Y]|=ex[p.X];
    if(cnt[p.X]==1) ex[p.X]=0;
    --cnt[p.X];
    ++cnt[p.Y];
  }
  cout<<accumulate(all(ex),0)<<endl;
  return 0;
}


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

typedef long long ll;

ll N, V[3];
vector<ll> K;
vector<ll> R;

bool solve() {
  for (ll i = 0; i < N; ++i) {
    ll k = K[i];
    ll a = (k + 1) % 3, b = (k + 2) % 3;
    if (V[a] == 0 && V[b] == 0) return false;
    if (V[a] == 1 && V[b] == 1 && i + 1 < N && K[i + 1] != k) {
      ll c = K[i + 1];
      ll d = c == a ? b : a;
      ++V[d];
      --V[c];
      R.push_back(d);
    } else if (V[a] < V[b]) {
      ++V[a];
      --V[b];
      R.push_back(a);
    } else {
      ++V[b];
      --V[a];
      R.push_back(b);
    }
  }
  return true;
}
int main() {
  cin >> N >> V[0] >> V[1] >> V[2];
  K.resize(N);
  for (ll i = 0; i < N; ++i) {
    string s;
    cin >> s;
    K[i] = s == "AB" ? 2 : s == "AC" ? 1 : 0;
  }
  if (!solve()) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
    for (ll r : R) {
      cout << (r == 0 ? "A" : r == 1 ? "B" : "C") << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 5068
A , B , C , K = map ( int  ,input().strip().split(" ") ) 
l = [ 1 , 0 , -1 ] ;
t = 0 

for ( c,r ) in zip ( l , ( A, B , C ) ) :

	if r >= K :
		t += K * c ;
		break ;
	else :
		K -= r ;
		t += r * c ;
print ( t ) ;





Measured memory_bytes: 9120
N=int(input())
G=[dict() for i in range(N)]
for i in range(N-1):
    u,v,w=map(int,input().split())
    G[u-1][v-1]=w
    G[v-1][u-1]=w
color=[-1 for i in range(N)]
dist=[-1 for i in range(N)]
dist[0]=0
q=[0]
while(len(q)>0):
    r=q.pop()
    for p in G[r]:
        if dist[p]!=-1:
            continue
        dist[p]=dist[r]+G[r][p]
        q.append(p)
for i in range(N):
    color[i]=dist[i]%2
for ans in color:
    print(ans)


Measured memory_bytes: 49776
S = input()

flag = 1
for i in range(0,(len(S) - 1)//2 ):
	if S[i] != S[len(S) -1 -i]:
		flag = 0
	#print(i)
#print(flag)

#flag2= 1
for i in range(0,((len(S)- 1)//2-1 )//2):
	if S[i] !=  S[(len(S) -1 )//2 -1 -i]:
		flag=0
	#print(i)
#print(flag)

#flag3= 1
for i in range((len(S) - 1)//4):
	if S[(len(S) + 3)//2-1+i] !=  S[len(S) -1-i]:
		flag=0
	#print(i,(len(S) + 3)//2-1+i,len(S) -1-i)
#print(flag,flag2,flag3)

if flag == 1:
	print("Yes")
else:
	print("No")

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

using namespace std;

typedef long long ll;

typedef vector<ll> vector_t;

struct knapsack:array<vector_t,2>
{
    ll max_value;
    
    knapsack(int n, int W) 
    { 
        vector<int> weight(n), value(n); 
        
        for(int i = 0; i < n; ++i)
            cin >> weight[i] >> value[i];
      
        int W1 = W+1; back().resize(W1,0);
            
        for (int i = 0; i < n; ++i) 
        {
	    	front() = back();

	        for (int v = value[i], w = weight[i], w1 = 0; w < W1; ++w, w1++) 
	            if((max_value = back().at(w1)+v) > front().at(w))
	               front().at(w) = max_value;
	               
	        front().swap(back());
        }
     
        max_value = back().at(W); 
    }
};

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

    int n, W; cin >> n >> W; cout << knapsack(n,W).max_value; 
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using std::cout;
using std::endl;
using std::cin;

int main(){
	std::string s; cin >> s;
	
	int c = 0;
	for(int i = 0; i < s.size(); i++) c += (s[i] == 'o');
	cout << 700 + 100 * c << endl;
	return 0;
}


Measured memory_bytes: 256
// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include<unordered_map>
#include <stack>
#include <random>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); ++i)
#define mapa make_pair
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

template<typename T>
void vdeb(std::vector<T> &da) {
    for (int i = 0;i < da.size();++i) {
        if (i == da.size() - 1) std::cout << da[i];
        else std::cout << da[i] << ' ';
    }
    std::cout << std::endl;
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
    for (int i = 0;i < da.size();++i) vdeb(da[i]);
    std::cout << std::endl;
}

using namespace std;

const ll MOD = 1000000007;

ll modpow(ll a, ll b){
    ll r = 1;
    while (b) {
        if(b&1) r = r * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return r;
}

ll da[101000];

int main(){
    ll n,k; cin >> n >> k;
    rip(i,k+1,1) da[i] = modpow(k/i, n);
    vector<bool> isPrime(k+1, true);
    rip(i,k+1, 2){
        if(isPrime[i]){
            for(int now = 1;now < k/i+1; ++now){
                isPrime[now*i] = false;
                da[now] -= da[now*i];
            }
        }
    }
    ll ans = 0;
    rip(i,k+1,1){
        ans += (da[i] * i)%MOD;
    }
    cout << (ans%MOD+MOD)%MOD << endl;
}

Measured memory_bytes: 4364
#include<algorithm>
#include <iostream>
#include<vector>
 #include<queue>
 #include<string>
#include <iomanip>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;

void dfs(int v, int p, long long cost, vvi &a, vector<long long> &c, vector<long long> &up){
   c[v] = cost+up[v];
   for(auto u: a[v]){
       if(u==p) continue;
       dfs(u, v, c[v], a, c, up);
   } 
   return;
}

int main(){
    int n,m;
    cin>>n>>m;
    vvi a(n+1);
    for(int i=0;i<n-1;i++){
        int x, y;
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    vector<long long> up(n+1, 0);
    for(int i=0;i<m;i++){
        long long x, y;
        cin>>x>>y;
        up[x] +=y;
    }

    vector<long long> c(n+1, 0);

    dfs(1, -1, 0, a, c, up); 
    for(int i=1;i<n+1;i++){
        cout<<c[i]<<" ";
    }

}

Measured memory_bytes: 32128
from sys  import stdin,stdout

import bisect

import math

def st():
    return list(stdin.readline().strip())

def inp():
    return int(stdin.readline())

def li():
    return list(map(int,stdin.readline().split()))

def mp():
    return map(int,stdin.readline().split())

def pr(n):
    stdout.write(str(n)+"\n")

def soe(limit):
    l=[1]*(limit+1)
    prime=[]
    for i in range(2,limit+1):
        if l[i]:
            for j in range(i*i,limit+1,i):
                l[j]=0

    for i in range(2,limit+1):
        if l[i]:
            prime.append(i)
    return prime

def segsoe(low,high):
    limit=int(high**0.5)+1
    prime=soe(limit)
    n=high-low+1
    l=[0]*(n+1)
    for i in range(len(prime)):
        lowlimit=(low//prime[i])*prime[i]
        if lowlimit<low:
            lowlimit+=prime[i]
        if lowlimit==prime[i]:
            lowlimit+=prime[i]
        for j in range(lowlimit,high+1,prime[i]):
            l[j-low]=1
    for i in range(low,high+1):
        if not l[i-low]:
            if i!=1:
                print(i)
                
def gcd(a,b):
    while b:
        a,b=b,a%b
    return a

def power(a,n):
    r=1
    while n:
        if n&1:
            r=(r*a)
        a*=a
        n=n>>1
    return r

    
def solve():
    n,k=mp()
    pr(k*(k-1)**(n-1))
for _ in range(1):
    solve()
    


Measured memory_bytes: 9208
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int[] output = new int[num];
		int x = 0;
		for(int i = 0; i < num; i++){
			output[i] = i + 1;
			if((output[i] % 3 == 0)){
				System.out.printf(" %d" ,output[i]);
			}else{
				x = output[i];
				do{
					if(x % 10 == 3){
						System.out.printf(" %d" ,output[i]);
						break;
					}
					x = x / 10;
				}while(x != 0);
			}
		}
		System.out.printf("\n");
	}

}


Measured memory_bytes: 40656
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<endl;
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;
const ll inf=1e15;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    ll n=len(s);
    map<char,ll> cnt;
    rep(i,n) cnt[s[i]]++;
    ll ans=n*(n-1)/2+1;
    for(auto itr:cnt){
      if(itr.se>=2) ans-=itr.se*(itr.se-1)/2;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 720
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
char str[2][60];

int main(){
	int a;scanf("%d",&a);
	scanf("%s%s",str[0],str[1]);
	long long ret=1;
	int pre=-1;
	for(int i=0;i<a;i++){
		if(str[0][i]==str[1][i]){
			if(pre==-1)ret=ret*3%mod;
			if(pre==0)ret=ret*2%mod;
			pre=0;
		}else{
			if(pre==-1)ret=ret*6%mod;
			if(pre==0)ret=ret*2%mod;
			if(pre==1)ret=ret*3%mod;
			pre=1;i++;
		}
	}
	printf("%lld\n",ret);
}

Measured memory_bytes: 128
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

int a[100000];

int main() {
    int n, m, c = 0, i, j;
    long long ans = 0, sum = 0, best = 0;
    vector <pair<int, int> > v;
    
    scanf("%d %d", &n, &m);
    
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
        
        a[i]--;
    }
    
    for (i = 0; i + 1 < n; i++) {
        int x = a[i], y = a[i + 1];
        
        if (x > y) y += m;
        
        ans += y - x;
        
        v.push_back(make_pair(x + 1, -1));
        v.push_back(make_pair(y, y - x - 1));
        
        x += m;
        y += m;
        
        v.push_back(make_pair(x + 1, -1));
        v.push_back(make_pair(y, y - x - 1));
    }
    
    sort(v.begin(), v.end());
    
    for (i = 0, j = 0; i < m * 2; i++, sum += c) {
        best = max(best, sum);
        
        while (j < v.size()) {
            if (v[j].first > i) break;
            
            if (v[j].second < 0) {
                c++;
            } else {
                c--;
                sum -= v[j].second;
            }
            
            j++;
        }
    }
    
    printf("%lld\n", ans - best);
    
    return 0;
}


Measured memory_bytes: 6640
import sys
input = sys.stdin.readline
N,T = [int(i) for i in input().split()]
t = [int(i) for i in input().split()]
sum = 0
for i in range(N-1) :
    if t[i+1] - t[i] <= T :
        sum += t[i+1] - t[i]
    else :
        sum += T
sum += T
print(sum)

Measured memory_bytes: 25744
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <cstdlib>
#define INF 100000000
#define _INF -100000000
#define INFLL (long long)1e14
#define _INFLL (long long)-1e14
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef pair<ll, ll> P;

int main() {
	string s; cin >> s;
	stack<char> stk;
	stk.push(s[0]);
	int cnt = 0;
	int ans = -1;
	Loop1(i, s.length() - 1) {
		if (cnt == (int)1e5) {
			ans = stk.size() + s.length() - i;
			break;
		}
		if (stk.size() > 0 && stk.top() == 'S'&&s[i] == 'T') {
			stk.pop();
			cnt++;
		}
		else {
			stk.push(s[i]);
		}
	}
	if (ans == -1) ans = stk.size();
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 768
using System;

class Program
{
    static void Main(string[] args)
    {
        var abc = Console.ReadLine().Split();
        var a = int.Parse(abc[0]);
        var b = int.Parse(abc[1]);
        var c = int.Parse(abc[2]);

        if ((a == 7 && b == 5 && c == 5) ||
            (a == 5 && b == 7 && c == 5) ||
            (a == 5 && b == 5 && c == 7))
        {
            Console.WriteLine("YES");
        }
        else
        {
            Console.WriteLine("NO");
        }
    }
}


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

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

int main(){
    int n;cin>>n;
    int res=1;
    while(n--){
        int a;cin>>a;
        res/=gcd(res,a);
        res*=a;
    }
    cout<<res<<endl;
}


Measured memory_bytes: 3104
#include<iostream>
#define int long long
using namespace std;
signed main (){
  int n, k;
  cin >> n >> k;
  if(k == 0){
    cout << n * n << endl;
    return 0;
  }
  int ans = 0;
  for(int b = k + 1; b <= n; b++){
    long long hoge = n / b;
    ans += (b - k) * hoge;
    if(n - (b * hoge + k - 1) > 0) ans += n - (b * hoge + k - 1);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const int INF=1e9;
 
struct edge{
    int to, cap, rev;
};
 
int N;
vector<int> g[502];
bool used[502];
int c[502][502];
bool nuo[502][502];
void init(){
	for(int i=0; i<N; i++){
		for(int j=0; j<N; j++){
			c[i][j]=0;
			nuo[i][j]=0;
		}
		used[i]=0;
		g[i].clear();
	}
}
void add_edge(int from, int to, int cap){
    g[from].push_back(to);
    g[to].push_back(from);
    c[from][to]+=cap;
}
int dfs(int v, int t, int f){
    if(v==t) return f;
    used[v]=1;
    for(int i=0; i<g[v].size(); i++){
        int y=g[v][i];
        if(!used[y] && c[v][y]>0){
            int d=dfs(y, t, min(f, c[v][y]));
            if(d>0){
                c[v][y]-=d;
				nuo[v][y]=1;
                c[y][v]+=d;
				nuo[y][v]=0;
                return d;
            }
        }
    }
    return 0;
}
 
int max_flow(int s, int t){
    int flow=0;
    while(1){
        fill(used, used+N, 0);
        int f=dfs(s, t, INF);
        if(f==0) return flow;
        flow+=f;
    }
}
int main()
{
	int n, m; cin>>n>>m;
	int a[101][101];
	P p[101][101];
	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++){
			cin>>a[i][j];
			p[i][j]=P((a[i][j]-1)/m, a[i][j]);
		}
	}
	for(int i=0; i<m; i++){
		int s=2*n, t=2*n+1;
		N=2*n+2;
		init();
		for(int j=0; j<n; j++){
			add_edge(s, j, 1);
			add_edge(j+n, t, 1);
		}
		for(int j=0; j<n; j++){
			for(int k=i; k<m; k++){
				add_edge(p[j][k].first, j+n, 1);
			}
		}
		max_flow(s, t);
		for(int j=0; j<n; j++){
			for(int l=0; l<n; l++){
				if(nuo[j][l+n]){
					for(int k=i; k<m; k++){
						if(p[l][k].first==j){
							swap(p[l][i], p[l][k]);
							break;
						}
					}
					break;
				}
			}
		}
	}
	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++){
			cout<<p[i][j].second<<" ";
		}
		cout<<endl;
	}
	for(int i=0; i<m; i++){
		P q[101];
		for(int j=0; j<n; j++){
			q[j]=p[j][i];
		}
		sort(q, q+n);
		for(int j=0; j<n; j++){
			p[j][i]=q[j];
		}
	}
	for(int i=0; i<n; i++){
		for(int j=0; j<m; j++){
			cout<<p[i][j].second<<" ";
		}
		cout<<endl;
	}
	return 0;
}

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

typedef long long ll;
const int maxn=1e6+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define int ll

#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int n,k;
int ppow(int x,int y)
{
    if (y==0) return 1;
    int ret=ppow(x,y/2);
    ret=ret*ret%mod;
    if (y&1) ret=ret*x%mod;
    return ret;
}

int p[maxn],invp[maxn];

int C(int x,int y)
{
    return p[x]*invp[y]%mod*invp[x-y]%mod;
}

int32_t main()
{
    IOS
    p[0]=1,invp[0]=1;
    for (int i=1;i<=400000;i++) p[i]=p[i-1]*i%mod,invp[i]=ppow(p[i],mod-2);
    cin>>n>>k;
    if (k>=n-1) cout<<C(2*n-1,n)<<endl;
    else
    {
        int sum=0;
        for (int i=n;i>=n-k;i--) sum=(sum+C(n,i)*C(n-1,i-1))%mod;
        cout<<sum<<endl;
    }
}



Measured memory_bytes: 10496
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <numeric>
#include <limits>
#include <type_traits>
#include <locale>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

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


const long long int mod = 1000000007;
const long long int INF = 1e18;
const long double PI=3.14159265358979323; 


string S[3];


int main()
{
    cout << fixed << setprecision(18);
    cin>>S[0]>>S[1]>>S[2];
    cout<<S[0][0]<<S[1][1]<<S[2][2]<<endl;
}    


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

int main(){
    string s, t;
    bool flag = false;
    cin >>s;
    cin >>t;

    if(t.size() == 1){
	bool flag2= false;
	for(int i=0; i<s.size(); i++){
	    if(s[i] == t[0])
		flag2 = true;
	}
	if(flag2){
	    for(int i=0; i<s.size(); i++){
		if(s[i] == '?')
		    s[i] = 'a';
	    }
	}
	else{
	    for(int i=s.size()-1; i>=0; i--){
		if(s[i] == '?'){
		    s[i] = t[0];
		    break;

		}

	    }
	    for(int i=0; i<s.size(); i++){
		if(s[i] == '?')
		    s[i] = 'a';
	    }
	}
	cout << s << endl;
	return 0;
    }

    reverse(s.begin(), s.end());
    reverse(t.begin(), t.end());
    
    for(int i=0; i<s.size(); i++){
	if(s[i] == t[0] || s[i] == '?'){
	    for(int j=1; j<t.size(); j++){
		if(i+j >=s.size())
		    break;
		if(s[i+j] == '?' || s[i+j] == t[j])
		    ;
		else
		    break;
		if(j == t.size()-1){
		    flag = true;
		    for(int k=0; k<t.size(); k++){
			s[i+k] = t[k];
		    }
		}
	    }
	}
	if(flag)
	    break;
    }

    for(int i=0; i<s.size(); i++){
	if(s[i] == '?')
	    s[i] = 'a';
    }
    reverse(s.begin(), s.end());
    if(flag)
	cout << s << endl;
    else
	cout << "UNRESTORABLE" << endl;


}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define in insert
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define sz(v) (int)(v.size())
#define all(x) x.begin(), x.end()
#define prec fixed << setprecision(12)
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define test int t; cin >> t; while(t--)

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef set<int> si;
typedef map<int, int> mii;
typedef vector<pii> vpi;

void solve() {
	int n;
	cin >> n;
	vi v(n);
	rep(i, 0, n - 1) cin >> v[i];
	int dp[n];
	dp[0] = 1;
	rep(i, 1, n - 1) {
		if (v[i] <= v[i - 1])
			dp[i] = dp[i - 1] + 1;
		else
			dp[i] = 1;
	}
	cout << *max_element(dp, dp + n) - 1;
}

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

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

#define TEST 0

	if (TEST) {
		test;
		solve();
	} else {
		solve();
	}

	return 0;
}

Measured memory_bytes: 4756
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int n = x;
		int mod = 0;
		for (; ;) {
			mod = mod + n%10;
			n = n/10;
			if (n==0) {
				break;
			}
		}
		if (x%mod==0) {
			System.out.println("Yes");			
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 21844
using System;
 
namespace Aizu
{
    class OnlineJudge
    {
        public static void Main()
        {
            for(int i; (i = int.Parse(Console.ReadLine())) != 0;) {
                var ice = new int[10];
                while(i-- > 0) {
                    ++ice[int.Parse(Console.ReadLine())];
                }
                foreach(var item in ice) {
                    Console.WriteLine(item == 0 ? "-" : new String('*', item));
                }
            }
        }
    }
}

Measured memory_bytes: 5416
package main
 
import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)
 
func run() {

	var A int64;
    A = nextInt();
    var B int64;
    B = nextInt();
	solve(A, B);

}

func solve(A int64, B int64){
	if((A+B) %2 == 1 ){
		Println("IMPOSSIBLE")
	}else{
		Println((A+B) /2)
	}
}


// --- template ---
// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
// Caution: You will get unexpected result if a single token is larger than this size.
const BufferSize = 64 * 1024 * 1024
 
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, a...)
}
 
func Printf(format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, format, a...)
}
 
func Println(a ...interface{}) (n int, err error) {
	return fmt.Fprintln(out, a...)
}
 
func next() string {
	sc.Scan()
	return sc.Text()
}
 
func nextInt() int64 {
	a, err := strconv.ParseInt(next(),10, 64)
	if err != nil {
		log.Fatal(err)
	}
	return a
}

func nextFloat() float64 {
	a, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		log.Fatal(err)
	}
	return a
}


type IntHeap []int
func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] > h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

func (h *IntHeap) Push(x interface{}) {
	// Push and Pop use pointer receivers because they modify the slice's length,
	// not just its contents.
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

/////数字と文字
// 基本クラス
type NS struct {
    Num int
    Str string
}

//////　数字と数字
// 基本クラス
type NN struct {
    Num1 int
    Num2 int
}

 
func main() {
	sc.Buffer(make([]byte, 0, BufferSize), BufferSize)
	sc.Split(bufio.ScanWords)
	run()
	out.Flush()
}



Measured memory_bytes: 2816
#include<bits/stdc++.h>
using namespace std;
int a[201],sum,n,l,lo,minabs=1000000000;
int main()
{
	cin>>n>>l;
	for(int i=1;i<=n;i++)
	{
		a[i]=l+i-1;
		sum+=a[i];
		if(minabs>abs(a[i]))
		{
			minabs=abs(a[i]);lo=i;
		}
		
	}
	cout<<sum-a[lo]<<endl;
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	vs := make([]int, n)
	for i := range vs {
		fmt.Scan(&vs[i])
	}

	even := map[int]int{}
	odd := map[int]int{}
	for i, v := range vs {
		if i%2 == 0 {
			even[v]++
		} else {
			odd[v]++
		}
	}

	ek1, ev1 := mapMax(even)
	ok1, ov1 := mapMax(odd)
	if ek1 != ok1 {
		fmt.Println(n - ev1 - ov1)
		return
	}

	delete(odd, ok1)
	delete(even, ek1)
	_, ov2 := mapMax(odd)
	_, ev2 := mapMax(even)
	fmt.Println(min(n-ev1-ov2, n-ov1-ev2))
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func mapMax(m map[int]int) (mk int, mv int) {
	for k, v := range m {
		if v > mv {
			mv = v
			mk = k
		}
	}
	return
}


Measured memory_bytes: 9276
#include<stdio.h>

int main(){
	char S[3],T[3];
	int a=0;
	scanf("%s",S);
	scanf("%s",T);
	for(int i=0;i<3;i++){
		if(S[i]==T[i])a++;
	}
	printf("%d\n",a);
	return 0;
}

Measured memory_bytes: 128
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<iterator>
#include<cmath>
#include<string>
#include<algorithm>
#include<sstream>
#include<queue>
#include<list>
#include<deque>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iomanip>
#include<unordered_map>
#include<stack>
#include<chrono>
#define FastIO      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define pb          push_back
#define siz         100009
#define mp          make_pair
#define ll          long long int
#define val         1000000007
#define fileout     freopen("output.txt","w",stdout)
#define filein      freopen("input.txt","r",stdin)
#define pi          acos(-1.0)
#define all(x)      x.begin(),x.end()
#define ull		    unsigned long long int
#define PI          acos(-1.0)
#define f(i,n)		for(ll i=0;i<n;i++)
#define m(a)		memset(a,0,sizeof(a))
#define sc(a)	    scanf("%lld",&a)
#define pr(a)	    printf("%lld ",a)
using namespace std;
//using namespace std::chrono;

int main()
{
	FastIO;
       
	ll  a, c, r, j, k, l, m, n, t;
	cin >> n;
	while (n)
	{
		if (n % 10 == 7)
		{
			cout << "Yes" << endl;
			return 0;
		}
		n = n / 10;
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3656
// inputに入力データ全体が入る
function Main(input) {
  var input = input.split(' ')
  var a = Number(input[0])
  var b = Number(input[1])
  if (a > 9 || b > 9){
    console.log(-1)
  	return;
  }
  var result = a * b;
  console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define F first
#define S second
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define sz size()
#define all(A)    A.begin(), A.end()
#define mem(a, b) memset(a, b, sizeof(a))   // all elements of A are b=0 or b=-1 else don't work
#define f0(i,b)   for(ll i=0;i<(b);i++)
#define f1(i,b)   for(ll i=1;i<=(b);i++)
#define f2(i,a,b) for(ll i=(a);i<=(b);i++)
#define f3(i,b,a) for(ll i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(ll i=(a);i!=(b);i+=(c))
#define mod 1000000007

#define whilee(i,t)  while(i!=t)
#define  sl(a)  scanf("%lld",&a)
#define  pl(a)  printf("%lld\n",a)

#define scan(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;

//for(auto it =A.begin(); it!=A.end(); it++)
//sort(A.begin(),A.end());
//binary_search(A.begin(),A.end(),x);
//reverse(A.begin(), A.end());
//cout << *max_element(A.begin(), A.end());
//cout << *min_element(A.begin(), A.end());
//count(A.begin(), A.end(), X); //counts the occurrences of X
//distance(A.begin(),A.end());  //distance between first to last element
//accumulate(A.begin(), A.end(), 0); //add
//next_permutation(A.begin(), A.end());
//prev_permutation(A.begin(), A.end());
//swap(S[0], T[0]);

//scanf("%lld",&x);
//printf("%lld\n",x);
//while (scanf("%lld %lld", &a, &b) == 2)
//printf("Case %lld: %lld\n", t++, a);

//vector <ll> A;
//deque <ll> A;
//queue <ll> A;
//stack <ll> A;
//list <int> A;
//set <ll> A;
//map <ll,ll> A;
//pair <ll,ll> A ;
//vector <pair <ll,ll>> A ;
//bitset<32> bset1;
//char ch;
//string S, T, U;
ll i, j, k, a, b, c, d, e, f, g, h, l, m, n, o, p, q, r, s, t=1, u, v, w, x, y, z, maxx=INT_MIN, minn=INT_MAX, ans=0, sum=0, cnt=0;

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

    //scan(n);
    cin>>n;
    ll A[n], B[n];

    f0(i,n)
    {
        cin>>A[i];
        B[i]=A[i];
    }
    sort(B,B+n);
    f0(i,n)
    {
        if(A[i]!=B[i])
        {
            cnt++;
        }
    }
    if(cnt<=2)
    {
        cout<<"YES"<<endl;
    }
    else
    {
          cout<<"NO"<<endl;
    }

    return 0;
}


Measured memory_bytes: 256
#入力取得
n = int(input())
p = list(map(int, input().split()))

ans = 0

for i in range(1, n-1):
    tmp_list = [p[i-1], p[i], p[i+1]]
    tmp_list.sort()


    if tmp_list[1] == p[i]:
        ans += 1

print(ans)

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

import static java.lang.System.in;

public class Main {
    static long[] bit0, bit1;
    static int n,m;
    // a[1]+...+a[i] = sum(bit1,i)*i+sum(bit0,i);
    public static void main(String[] args)throws IOException{
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); m = sc.nextInt();
        bit0 = new long[n+5];
        bit1 = new long[n+5];
        for(int q=0;q<m;q++){
            int a = sc.nextInt(),b = sc.nextInt();
            if(b<a){
                int c=a;
                a=b;
                b=c;
            }
            addInterval(a,b-1,1);
        }
        boolean flag = true;
        for(int i=1;i<n;i++){
            long cur = overallSum(i)-overallSum(i-1);
            flag &= (cur%2==0);
        }
        String ans = flag?"YES":"NO";
        System.out.println(ans);
    }
    static long overallSum(int i){
        return ((long)i)*sum(bit1,i)+sum(bit0,i);
    }
    static void addInterval(int l, int r, long val){
        add(bit0,l,-val*(l-1));
        add(bit1,l,val);
        add(bit0,r+1,val*r);
        add(bit1,r+1,-val);
    }
    static void add(long[] bit, int idx, long val){
        while(idx<=n){
            bit[idx]+=val;
            idx += idx&(-idx);
        }
    }
    static long sum(long[] bit, int idx){
        long ans = 0;
        while(idx>0){
            ans += bit[idx];
            idx -= idx&(-idx);
        }
        return ans;
    }
}


Measured memory_bytes: 67576
N,M=map(int,input().split(' '))
B = [1]*N
R = [1]+[0]*(N-1)
for i in range(M):
    x,y=map(lambda x:int(x)-1,input().split(' '))
    B[x]-=1
    B[y]+=1
    if R[x] and B[x]:
        R[y]=1
    elif R[x] and not B[x]:
        R[x]=0
        R[y]=1
print(sum(R))

Measured memory_bytes: 5364
/**
 *    author:  math2do
 *    created: 13.04.2020 22:41:50
**/

#include <bits/stdc++.h>

using namespace std;

const int mod = (int) (1e9 + 7);

inline int mul(int a, int b) {
  long long res = (long long) a * b;
  a = (int) (res % mod);
  return a;
}

inline int power(int a, int b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    b >>= 1;
    a = mul(a, a);
  }
  return res;
}

inline void add(int &a, int b) {
  a += b;
  if (a >= mod) {
    a -= mod;
  }
}

inline void sub(int &a, int b) {
  a -= b;
  if (a < 0) {
    a += mod;
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector <int> dp(k + 1, 0);
  auto get = [&](int i) {
    int cnt = k / i;
    return power(cnt, n);
  }; 
  int ans = k;
  dp[k] = 1;
  for (int i = k - 1; i >= 1; i--) {
    dp[i] = get(i);
    for (int j = i + i; j <= k; j += i) {
      sub(dp[i], dp[j]);
    }     
    add(ans, mul(dp[i], i));
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3696
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define SIZE 200005

using namespace std;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
long long int MOD = 1000000007;
int n,m,Y,Z;
char c[10];
int p[10];
string b;
 
int f[30];
 
const int INF=123456789;
 
int dp[1025][11];
int nx[1025][11];
 
int main()
{
	cin.tie(0);ios::sync_with_stdio(false);
	int N;
	cin >>N;
	vi x(N);
	vector<pii> pos;
	rep(i,N){
				cin >>x[i];
			pos.pb(mp(x[i]-1,i+1));
	}
	int ans[250001]={0};
	sort(pos.begin(),pos.end());
	rep(i,N)ans[x[i]-1]=i+1;
	int now=0;
	bool flag=true;
	for(int i=0;i<N;i++){
		int num=pos[i].second;
		for(int j=0;j<num-1;j++){
			if(ans[now]!=0){
				j--;
			}else{
				ans[now]=num;
			}
			now++;
		}
		if(now>pos[i].first)flag=false;
	}
	int now2=N*N-1;
	for(int i=N-1;i>=0;i--){
		int num=pos[i].second;
		for(int j=0;j<N-num;j++){
			if(ans[now2]!=0){
				j--;
			}else{
				ans[now2]=num;
			}
			now2--;
		}
		if(now2<pos[i].first)flag=false;
	}
	
	/*for(int i=0;i<N*N;i++){
			cout<<ans[i];
			if(i!=(N*N-1))cout<<" ";
		}
		cout<<endl;*/
	
	if(flag){
		cout<<"Yes"<<endl;
		/*for(int i=1;i<=N;i++){
			for(int j=0;j<N-i;j++){
				if(ans[now]!=0){
					j--;
				}else{
					ans[now]=i;
				}
				now++;
			}
		}*/
		for(int i=0;i<N*N;i++){
			cout<<ans[i];
			if(i!=(N*N-1))cout<<" ";
		}
		cout<<endl;
	}else{
		cout<<"No"<<endl;
	}
	
}

Measured memory_bytes: 2176
#include <iostream>
//#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
//#include <utility>
#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;
//#define all(v) v.begin(),v.end()
//ll mod = 1000000007 ;
//long double pie = acos(-1) ;
//ll INF = 1000000000000 ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void fix_cout(){cout << fixed << setprecision(20) ;}

int main(){
	ll a,v,b,w,t ;
	cin >> a >> v >> b >> w >> t ;
	YorN((v-w)*t>=abs(a-b)) ;
}


Measured memory_bytes: 3548
#[allow(dead_code)]
fn scan<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn scan_split<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|t| t.parse().ok().unwrap()).collect()
}

#[allow(dead_code)]
fn scan_split_with<T: std::str::FromStr>(ch: char) -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split(ch)
        .map(|t| t.parse().ok().unwrap()).collect()
}

#[allow(dead_code)]
fn scan_lines<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| scan::<T>()).collect()
}

#[allow(unused_macros)]
macro_rules! scan_as_tuple {
    ( $t:ty ) => {
        (scan::<$t>(),)
    };
    ( $( $t:ty ),* ) => {
        {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).ok();
            let v = s.trim().split_whitespace();
            let mut it = v;
            let ret = ( $(it.next().unwrap().parse::<$t>().ok().unwrap()),* );
            assert!(it.next() == None, "not all tokens consumed");
            ret
        }
    };
}

fn main() {
    let s = scan::<String>();
    println!("{}", s.replace(",", " "));
}

Measured memory_bytes: 4352
#include <iostream>

using namespace std;

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

    for(int m=0; m<=M; ++m) {
        for(int n=0; n<=N; ++n) {
            if(m*N+n*M-2*m*n==K) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }

    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std; 
#define mod 1000000007
#define N 100005
#define int long long
#define ull unsigned long long
#define loop1(i, j, k, step) for (int i=j; i<k; i+=step)
#define loop(i, j, k) for (int i=j; i<k; i++) 
#define rloop1(i, j, k, step) for (int i=j; i>=k; i-=step)
#define rloop(i, j, k) for(int i=j; i>=k; i--)
#define rep(i, k) for(int i = (0); i < (k); i++ )
#define rrep(i, k) for(int i = k-1; i >= 0; i-- )

#define forall(it, l) for(auto it=l.begin(); it != l.end(); it++)
#define mp make_pair
#define pb push_back
#define pop pop_back
#define F first
#define S second
#define sz(x) (int)(x).size()
#define endl "\n"
#define Max (int)INT_MAX
#define Min (int)INT_MIN
#define MEM(a, b) memset(a, (b), sizeof(a))
#define fast_io ios_base::sync_with_stdio(0), cin.tie(NULL)
typedef vector<int> vi;
typedef pair<int,int> pi;

void solve()
{
	int n,i,j,x,k,k1;
	cin>>x;
	loop(i,-205,205){
		k=pow(i,5);
		loop(j,-205,205){
			k1=pow(j,5);
			if(k-k1==x){
				cout<<i<<" "<<j;
				return;
			}
			if(k1-k==x){
				cout<<j<<" "<<i;
				return;
			}
		}
	}
}
signed  main() 
{
	auto start=clock();
	fast_io;
    int t=1;
    //cin>>t;
    while(t--)
    	solve();
    auto stop =clock();
    cerr<<"time taken:"<<double(stop-start)/double(CLOCKS_PER_SEC)<<" s"<<endl;
	return 0; 
}

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

int main(){
  long long n,k,i,j,ans=0,a;
  cin >> n >> k;
  vector<int> abit(41);
  for(i=0; i<n; i++){
    cin >> a; j=0;
    while(a>0){
      abit[j]+=a%2;
      a/=2;
      j++;
    }
  }
  long long cur=0,cbit=1;
  j=41;
  for(i=0; i<41; i++){
    cbit*=2;
  }
  while(j>=0){
    if(n-abit[j]>(n/2) && cur+cbit<=k){
      cur+=cbit; ans+=cbit*(n-abit[j]);
    }else{
      ans+=cbit*abit[j];
    }
    j--; cbit/=2;
  }
  cout << ans;
}

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

int main(){
    int_fast64_t N, T, A, X, P, C, D;
    cin >> N >> T >> A;
    X = (T - A) * 500;
    P = -12435892351420;
    C = -1;
    for(int i = 0; i < N; ++i){
        cin >> D;
        if(abs(X - 3 * D) <= abs(X - 3 * P))C = i, P = D;
    }
    cout << C + 1 << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define re register int
#define F(x,y,z) for(re x=y;x<=z;x++)
#define FOR(x,y,z) for(re x=y;x>=z;x--)
typedef long long ll;
#define I inline void
#define IN inline int
#define C(x,y) memset(x,y,sizeof(x))
#define STS system("pause")
template<class D>I read(D &res){
	res=0;register D g=1;register char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-')g=-1;
		ch=getchar();
	}
	while(isdigit(ch)){
		res=(res<<3)+(res<<1)+(ch^48);
		ch=getchar();
	}
	res*=g;
}
const int Mod=1e9+7;
char c[303000];
int n,m,f[2][3][3],ans;
I Plus(int &x,int y){
	x+=y;
	if(x>=Mod)x-=Mod;
}
int main(){
	cin>>c+1;
	n=strlen(c+1);m=0;
	f[0][0][0]=1;
	F(i,1,n){
		m^=1;
		F(j,0,2)F(k,0,2)f[m][j][k]=0;
		if(c[i]!='1'){
			Plus(f[m][0][1],f[m^1][0][0]);
			Plus(f[m][0][2],f[m^1][0][1]);
			Plus(f[m][0][1],f[m^1][0][2]);
			Plus(f[m][1][1],f[m^1][1][0]);
			Plus(f[m][1][2],f[m^1][1][1]);
			Plus(f[m][1][1],f[m^1][1][2]);
			Plus(f[m][2][1],f[m^1][2][0]);
			Plus(f[m][2][2],f[m^1][2][1]);
			Plus(f[m][2][1],f[m^1][2][2]);
		}
		if(c[i]!='0'){
			Plus(f[m][1][0],f[m^1][0][0]);
			Plus(f[m][0][0],f[m^1][0][1]);
			Plus(f[m][0][1],f[m^1][0][2]);
			Plus(f[m][2][0],f[m^1][1][0]);
			Plus(f[m][1][0],f[m^1][1][1]);
			Plus(f[m][1][1],f[m^1][1][2]);
			Plus(f[m][2][0],f[m^1][2][0]);
			Plus(f[m][2][0],f[m^1][2][1]);
			Plus(f[m][2][1],f[m^1][2][2]);
		}
	}	
	ans=0;
	Plus(ans,f[m][0][0]);
	Plus(ans,f[m][1][0]);
	Plus(ans,f[m][1][1]);
	Plus(ans,f[m][2][0]);
	Plus(ans,f[m][2][1]);
	Plus(ans,f[m][2][2]);
	cout<<ans;
	return 0;
}



Measured memory_bytes: 512
n = int(input())
h = list(map(int, input().split()))

steps = []
temp = 0

for i in range(n):
    if i != n - 1:
        if h[i] >= h[i + 1]:
            temp += 1
        else:
            steps.append(temp)
            temp = 0
    else:
        steps.append(temp)

print(max(steps))

Measured memory_bytes: 14224
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 	int n, m, sum = 0;
  	cin >> n >> m;
  	int a[n + 1];
  	for(int i = 1; i <= n; i++) {
     	cin >> a[i];
      	sum += a[i];
    }
  	sort(a + 1, a + 1 + n);
  	int x = sum / (4 * m);
  	int f = 0;
  	if(x * m * 4 == sum)
      	f = 1;
  	bool f1 = true;
  	//cout << "lol" << endl;
  	for(int i = n; i > (n - m); i--) {
      	if(a[i] > x)
          	continue;
      	if(a[i] == x && f == 1)
          	continue;
      	f1 = false;
    }
  	cout << ((f1 == false) ? ("No") : ("Yes")) << endl;
  	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int m = 0;
  int sum = 0;
  for(int i = 0; i < n; i++){
    int l;
    cin >> l;
    m = max(l, m);
    sum += l;
  }
  if(m*2 < sum)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

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

using namespace std;
#define BUF (1000)
#define ll long long 

ll a,b;
ll ans = 0;
int main(void){
	cin >> a >> b;
	ll diff = b-a+1;

	if(a%2==1){
		ans^=a;
		diff--;
	}

	if(b%2==0){
		ans^=b;
		diff--;
	}

	ans ^= (diff/2)%2;

	cout << ans << endl;
	return 0;
}


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

int main(){
    string s;
    int sum = 0;
    cin >> s;
    int size = s.size();
    for(int i=0; i<size/2; i++){
        if(s[i] != s[size-1-i]) sum++;
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
 #define rep(i, n) for (int i = 0; i < (int)(n); i++)
 #define big 1000000007

int64_t GCD(int64_t a,int64_t b){
    return b == 0 ? a : GCD(b, a % b);
   
}
int main(){
    int64_t a,b;
    cin >> a >>b;
    int64_t gcd = GCD(a,b);
    //cout <<gcd<<endl;
    //gcdを素因数分解すればいい
    int j=0;
    //sort(yaku.begin(), yaku.end()); 
    //reverse(yaku.begin(), yaku.end()); 
    int64_t ans = 1;

    bool gusu = false;
    bool kisu;
    for (int64_t i = 2; i * i <= gcd; i++) {
		if (gcd % i == 0) {
			ans++;
			while (gcd % i == 0)gcd /= i;
		}
	}
	cout << (gcd != 1 ? ans + 1 : ans) << endl;
 
	return 0;

}

Measured memory_bytes: 256
//Bokan ga bokka--nn!!
//Daily Lunch Special Tanoshii !!
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef long long ll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
#define f first
#define s second
#define rep(i,x) for(int i=0;i<x;i++)
struct bug
{
	int make,lim;
	bug(){}
	bug(int make,int lim):make(make),lim(lim){}
	bool operator<(const bug& an)const
	{
		if(lim!=an.lim) return lim>an.lim;
		return make<an.make;
	}
}b[300005];
int main()
{
	srand((unsigned int)time(NULL));
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d %d",&b[i].make,&b[i].lim);
	}
	sort(b,b+n);
	int lb=0;
	int ub=n+1;
	//[lb,ub)
	while(ub-lb>1)
	{
		int mid=(lb+ub)/2;
		priority_queue<int>que;
		int ret=0; ll sum=0LL;
		for(int i=0;i<n;i++)
		{
			ll bord=b[i].lim;
			que.push(b[i].make);
			sum+=1LL*b[i].make;
			while(sum>bord*mid)
			{
				sum-=que.top();
				que.pop();
			}
			if(que.size()>=mid)
			{
				goto ok;
			}
		}
		ub=mid;
		continue;
		ok:;
		lb=mid;
	}
	printf("%d\n",lb);
}

Measured memory_bytes: 6520