akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
using namespace std;
typedef long long unsigned int ll;
 
int main() {
 
  int a,b,c;
  cin >> a;
  cin >> b;
  
  
  if(a*b%2==0){
    cout << "No" <<endl;
  }else{
	cout << "Yes" <<endl;
  }
  
   return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef  long long ll;
ll gcd(ll x,ll y){
   if(y==0) return x;
   else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
   return x/gcd(x,y)*y;
}
using namespace std;

int main(){ 
   int a,b;
   cin>>a>>b;
   (a<10 &b<10)? cout<<a*b:cout<<-1;
   return 0;
}

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

vector<LL> st;
int ans = -1;

void dfs(LL N, int k, int use){
    if(k >= st.size()) return;
    LL now = st[k];
    if(N == 1){
        ans = max(ans, use);
        return;
    }
    if(now > N) return;
    if(N % now == 0){
        dfs(N/now, k, use+1);
    }
    dfs(N, k+1, use);
}

int main(){
    LL N;
    cin>>N;
    if(N == 1){
        cout << -1 << endl;
        return 0;
    }
    set<LL> M;
    for(int i=1;i<=18;i++)
    {
        for(int j=0;j<(1<<i);j++)
        {
            LL now=0;
            for(int k=0;k<i;k++) now = now*10 + (j>>k&1 ? 8:2);
            if(__builtin_popcountll(j) == i) continue;
            M.insert(now);
        }
    }
    for(auto &&i : M)if(N % i == 0) st.push_back(i);
    dfs(N, 0, 0);
    cout << ans << endl;
}



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

typedef long long ll;
ll k, mn1 = 1e9, mn2 = 1;

ll f(ll p) {
	ll s;
	for (s = 0; p; s += p % 10, p /= 10);
	return s;
}

int main()
{
	ll i, j;
	cin >> k;
	for (i = 1, j = 1; k; i += j) {
		if (i * f(i + j) <= (i + j) * f(i)) printf("%lld\n", i), k--;
		else i -= j, j *= 10;
	}
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
    
int main(){
    string S;
    cin >>S;
    if(S=="AAA"||S=="BBB"){
        cout << "No";
    }
    else{
        cout << "Yes";
    }
}



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

#ifdef TESTING
  #include "dump.hpp"
#else
  #define DUMP(...)
  #define DEBUG(...)
#endif

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
#define SZ(a) int((a).size())
#define _REP(_1,_2,_3,_4,name,...) name
#define _REP4(i,b,e,s) for(decltype(e) _b=(b),_e=(e),i=_b+(0<(s)?0:(s));(0<(s)?i<_e:_e<=i);i+=(s))
#define _REP3(i,b,e) for(decltype(e) _b=(b),_e=(e),i=(_b<_e?_b:_b-1);(_b<_e?i<_e:_e<=i);(_b<_e?i++:i--))
#define _REP2(i,n) for(decltype(n) i=0,_n=(n);i<_n;i++)
#define _REP1(n) for(decltype(n) _i=0,_n=(n);_i<_n;_i++)
#define REP(...) _REP(__VA_ARGS__,_REP4,_REP3,_REP2,_REP1)(__VA_ARGS__)
#define FOR(it,c) for(auto&& it=begin(c);it!=end(c);it++)
#define ROF(it,c) for(auto&& it=rbegin(c);it!=rend(c);it++)
#define EB emplace_back
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define INT(n) int n;assert(0<scanf("%d",&n))
#define VI(v,n) vector<int> v(n);REP(i,n){assert(0<scanf("%d",&v[i]));}

int main(){
  INT(n); VI(as, n);
  vector<int> v;
  REP(i, n){
    v.PB(as[i] - (i + 1));
  } sort(v.begin(), v.end());
  int m;
  if (n % 2 == 1){
    m = 2 * v[n / 2];
  } else {
    m = v[n / 2 - 1] + v[n / 2];
  }
  ll ans = 0;
  for(int e: v){
    ans += abs(2ll * e - m);
  } ans /= 2;
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 2168
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <assert.h>
#include <numeric>
#include <iomanip>
#define rep(i, a, b) for (int(i) = (a); i < (b); i++)
using namespace std;

using ll = long long;

typedef pair<int, int> P;

const int INF = 100000000;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll MOD = 1000000007;

ll pow_mod(ll x, ll y, ll mod)
{
	ll ans=1;
	for(;y>0;y>>=1){
		if(y&1)(ans*=x)%=mod;
		(x*=x)%=mod;
	}
	return ans;
}

ll n, k;

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	//問題文中の添え字が0-indexか1-indexか確認!
	cin >> n >> k;
	ll ans = n - k + 1;
	cout << ans<< "\n";
	rep(i,2,k+1){
		if(i>n-k+1)
		{
			ans = 0;
		}else{
			ans = (ans * (n - k + 2 - i)) % MOD;
			ans = (ans * (k + 1 - i)) % MOD;
			ans = (ans * (pow_mod(i * (i - 1), MOD - 2, MOD))) % MOD;
		}
		cout << ans << "\n";
	}
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
		
		public static void main(String[] args) throws IOException {
//			java.util.Scanner scan = new java.util.Scanner(System.in);
//		int x = scan.nextInt();
			
			BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
			String str = br.readLine();
			int x = Integer.parseInt(str);
			
		if(1<=x && x<=100){;
		System.out.println(x*x*x);// TODO ?????????????????????????????????????????????
		}
		}	
			
		
	
	}
	

Measured memory_bytes: 24316
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        char[] s = input.readLine().toCharArray();
        char[] t = input.readLine().toCharArray();
        Arrays.sort(s);
        Arrays.sort(t);
        for (int i = 0, j = t.length - 1; i < s.length && j > -1; i++, j--) {
            if (s[i] < t[j]) {
                System.out.println("Yes");
                return;
            } else if (s[i] > t[j]) {
                System.out.println("No");
                return;
            }
        }
        if (s.length < t.length) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}



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

int main() {
  int N;
  cin >> N;
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
  }
  sort(S.begin(), S.end());
  int count = 0;
  for (int i = 0; i < N; i++) {
    count++;
    if (i == N-1) {
      break;
    }
    if (S.at(i) == S.at(i+1)) {
      count--;
    }
  }
  cout << count << endl;
}

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

int main() {

  int N, K, a;
  cin >> N >> K;
  a = 1;
  for (int i = 0; i < N; i++) {
    if (a < K) {
      a *= 2;
    } else {
      a += K;
    }
  }
  cout << a << endl;

}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define bit(n, k) ((n >> k) & 1)

int dp[22][1 << 21];

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int a[30][30];
    rep(i, N) rep(j, N) cin >> a[i][j];
    dp[0][0] = 1;
    REP(S, 1, (1 << N) - 1) {
        int i = __builtin_popcount(S);
        REP(j, 0, N - 1) {
            if (bit(S, j) == 1 && a[i - 1][j] == 1) {
                dp[i][S] = (dp[i][S] + dp[i-1][S ^ (1 << j)]) % mod;
            }
        }
    }
    cout << dp[N][(1 << N) - 1] << endl;

    return 0;
}


Measured memory_bytes: 162048
#include<bits/stdc++.h>
//#include<iostream>
//#include<cstdio>
//#include<stdlib.h>
//#include<string.h>
//#include<algorithm>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define READ freopen("in.txt","r",stdin)
#define WRITE freopen("out.txt","w",stdout);
#define pb push_back
#define mem(arr,val) memset(arr,val,sizeof(arr))
#define sf(x) scanf("%d",&x)
#define sf2(x,y) scanf("%d %d",&x,&y)
#define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define sl(x) scanf("%lld",&x)
#define sl2(x,y) scanf("%lld %lld",&x,&y)

#define sl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sd(x) scanf("%lf",&x);
#define pLL pair<long long,long long>
#define pDB pair<double,double>
#define ff first
#define sn second
#define PRINT_CASE  printf("Case %d: ",tc++)
#define PRINT_CASENL  printf("Case %d:\n",tc++)
//#define mx 100005
#define lnd tree[ind<<1]
#define rnd tree[(ind<<1)+1]
#define cnd tree[ind]
#define lndp b,(b+e)>>1,(ind<<1)
#define rndp ((b+e)>>1)+1,e,(ind<<1)+1
#define IN(a,x,y) (a>=x && a<=y)
#define popcountL __builtin_popcountll
#define popcount __builtin_popcount
/// int other=mask^((1<<n)-1);
typedef long long ll;
typedef long long int lln;
typedef pair<int,int> pii;
ll INF=1<<28;
//typedef long long lld;
const double PI=acos(-1.0);
//int fx[]={1,-1,0,0}; //direction array
//int fy[]={0,0,1,-1};
int dir[4][2]={1,0,-1,0,0,-1,0,1};
int knight[8][2]={1,2,1,-2,2,1,2,-1,-1,2,-1,-2,-2,1,-2,-1};
const long double EPS=1e-7;
//#define INF 10000

struct compare
{
  bool operator()(const pair<int,pii>& l, const pair<int,pii>& r)
  {
      if(l.ff==r.ff)
      {
          return l.sn.ff>r.sn.ff;
      }
      return l.ff<r.ff;
  }
};
// bool operator<(pair<int,pii> l, pair<int,pii> r)
//  {
//      if(l.ff==r.ff)
//      {
//          cout<<"ok "<<endl;
//          return l.sn.ff<r.sn.ff;
//      }
//      return l.ff>r.ff;
//  }

/////////////////////////////////////template sesh/////////////////////////////////////////////////////

///code goes from here
const int mx=1000150;
///
ll mod=1e9+7;
ll arr[mx];

int main()
{
//    SPEED;
    int t,tc=1;
//    sf(t);
    t=1;
    while(t--)
    {
        int n;
        sf(n);
        for(int i=0;i<n;i++)
            sl(arr[i]);
        int ans=0;
        for(int i=0;i<n;i++)
        {
            for(int j=i+1;j<n;j++)
            {
                for(int k=j+1;k<n;k++)
                {
                    vector<ll>v;
                    v.pb(arr[i]);
                    v.pb(arr[j]);
                    v.pb(arr[k]);
                    sort(v.begin(),v.end());
                    if(v[0]==v[1] || v[1]==v[2])
                        continue;
                    ll sum=v[0]+v[1];
                    if(sum>v[2])
                    {
                        ans++;
                    }
                }
            }
        }
        cout<<ans<<endl;
    }


    return 0;
}



Measured memory_bytes: 3688
from collections import deque


n, m = map(int, input().split())
s = [0] * m
k = [0] * m
for i in range(m):
    s[i] = deque(map(int, input().split()))
    k[i] = deque.popleft(s[i])
    s[i] = list(s[i])
p = list(map(int, input().split()))
cnt = 0
for i in range(2 ** n):
    l = [0] * n
    for j in range(n):
        if (i >> j) & 1:
            l[j] = 1
    for k in range(m):
        total = 0
        ans = True
        for num in s[k]:
            idx = num - 1
            if l[idx] == 1:
                total += 1
        if total % 2 != p[k]:
            ans = False
            break
    if ans:
        cnt += 1
print(cnt)

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

int main(){
	int w, a, b;
	cin >> w >> a >> b;
	//The lower rectangle goes before
	int dif;
	if(a+w<=b)dif = b-(a+w);
	else if(b+w<=a)dif = a-(b+w);
	
	cout << dif << endl;
	return 0;
}

Measured memory_bytes: 256
N, D = map(int, input().split())
X = []
for i in range(N):
  X.append(list(map(int, input().split())))
  
cnt = 0

for j in range (N-1):
  for k in range(j+1, N):
    t = 0
    for l in range(D):
      t += (X[j][l]-X[k][l])**2
      
    if t**(1/2)%1 ==0:
      cnt += 1
      
print(cnt)

Measured memory_bytes: 3064
// Why I am so dumb? :c
#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()

#define fi first
#define se second

using namespace std;

typedef long long ll;

int n, ans;

void solve() {
	scanf("%d", &n);

	if (n == 1) {
		printf("YES\n");
		return;
	}
                 
	for (int i = 1, x; i <= n; ++i) {
		scanf("%d", &x);
		ans ^= (x & 1);
	}    

	printf(ans ? "NO\n" : "YES\n");
}

int main() {    
    int tt = 1;

    while (tt--) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define yn(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YN(ans) if(ans)printf("YES\n");else printf("NO\n")
#define vector2d(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
ll modpow(ll a, ll b, ll p){ ll ans = 1; while(b){ if(b & 1) (ans *= a) %= p; (a *= a) %= p; b /= 2; } return ans; }

bool charmatch(string s,string t){
    if(s.length()!=t.length())return false;
    int ans=0;
    for(int i=0;i<s.length();i++){
        ans+=(s[i]==t[i]||s[i]=='?'||t[i]=='?');
    }
    if(ans==s.length())return true;
    else return false;
}

int main(){
    string s,t;
    in(s,t);
    int ans=0;
    for(int i=s.length()-t.length()+1;i>=0;i--){
        if(charmatch(t,s.substr(i,t.length()))){
            for(int j=0;j<t.length();j++){
                s[j+i]=t[j];
            }
            ans=1;
            break;
        }
    }
    if(ans==0)out("UNRESTORABLE");
    else{
    for(int i=0;i<s.length();i++){
        if(s[i]=='?')cout<<'a';
        else cout<<s[i];
    }
    cout<<endl;
    }
}

Measured memory_bytes: 3604
#include <iostream>
#include <vector>
#include <set>
#include <limits>

using namespace std;
typedef long long ll;

int main(){
    ll n, m, p;
    cin >> n >> m >> p;

    vector<vector<pair<int, int>>> nn(n);
    vector<vector<int>> inv(n);
    for(int i = 0; i < m; ++i){
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        if(a == b && c - p <= 0){ continue; }
        nn.at(a).push_back(make_pair(b, c - p));
        inv.at(b).push_back(a);
    }

    vector<bool> can_go(n, false);
    can_go.at(n - 1) = true;
    set<int> cur[2];
    cur[0].insert(n - 1);
    for(int i = 0; i < n; ++i){
        cur[(i + 1) % 2].clear();
        for(int x : cur[i % 2]){
            for(int next : inv.at(x)){
                if(!can_go.at(next)){
                    can_go.at(next) = true;
                    cur[(i + 1) % 2].insert(next);
                }
            }
        }
    }

    vector<ll> coins(n, numeric_limits<ll>::min());
    coins.at(0) = 0;
    cur[0].clear();
    cur[0].insert(0);
    int count = 0;
    while(cur[count % 2].size()){
        cur[(count + 1) % 2].clear();
        for(int x : cur[count % 2]){
            for(auto& p : nn.at(x)){
                if(coins.at(p.first) < coins.at(x) + p.second
                   && can_go.at(p.first)){
                    cur[(count + 1) % 2].insert(p.first);
                    coins.at(p.first) = coins.at(x) + p.second;
                }
            }
        }
        if(count > m + 1 && cur[(count + 1) % 2].size()){
            cout << -1 << endl;
            return 0;
        }
        count++;
    }
    cout << max(0LL, coins.at(n - 1)) << endl;
    return 0;
}


Measured memory_bytes: 888
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912
const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[8] = {-1,0,1,0,1,-1,1,-1};
int dy[8] = {0,-1,0,1,1,1,-1,-1};
int num[51][51];
int H,W;
void init(){
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            num[i][j] = MM;
        }
    }
}
int main(){
    cin >> H >> W;
    char s[51][51];
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            cin >> s[i][j];
        }
    }
    init();
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            if(s[i][j] == '#') continue;
            else if(s[i][j] == '.'){
                num[i][j] = 0;
                for(int k = 0; k < 8; k++){
                    int ny = i + dy[k];
                    int nx = j + dx[k];
                    if(0 <= ny && ny < H && 0 <= nx && nx < W && s[ny][nx] == '#'){
                        num[i][j]++;
                    }
                }
            }
        }
    }
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            if(s[i][j] == '#'){
                cout << s[i][j];
            } else if(s[i][j] == '.'){
                cout << num[i][j];
            }
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
using namespace std;
typedef double  dbl;
typedef long long int lld;
#define PI 3.14159265358979323
#define foi(i,n) for(i = 0; i < n; i+=1)
#define fod(i,n) for(i=n-1; i >=0; i-=1)
#define MAX std::numeric_limits<lld>::max()
#define MIN std::numeric_limits<lld>::min()
#define FastIO  ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int main ()
{
      FastIO
      lld n, i;
      string s;
      cin >> n;
      cin >> s;
      lld L = s.length();
      foi(i, L)
      {
            lld t = n;
            lld x = (lld)s[i];
            if (t <= (90 - x))
            {
                  x += t;
            }
            else
            {
                  t-= 90 - x;
                  x = 65+t-1;
            }
            cout <<  (char)x;
      }
      return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()
struct revran {
  const i64 b, e;
  struct iter {
    i64 i;
    constexpr iter(const i64 i) noexcept: i(i) {}
    void operator++() noexcept { --i; }
    constexpr i64 operator*() const noexcept { return i; }
    constexpr bool operator!=(const iter x) const noexcept { return i != x.i; }
  };
  constexpr revran(const i64 e) noexcept: b(0), e(e) {}
  constexpr revran(const i64 b, const i64 e) noexcept: b(b), e(e) {}
  constexpr iter begin() const noexcept { return iter(e - 1); }
  constexpr iter end() const noexcept { return iter(b - 1); }
};

struct ran {
  const i64 b, e;
  struct iter {
    i64 i;
    constexpr iter(const i64 i) noexcept: i(i) {}
    void operator++() noexcept { ++i; }
    constexpr i64 operator*() const noexcept { return i; }
    constexpr bool operator!=(const iter x) const noexcept { return i != x.i; }
  };
  constexpr ran(const i64 e) noexcept: b(0), e(e) {}
  constexpr ran(const i64 b, const i64 e) noexcept: b(b), e(e) {}
  constexpr iter begin() const noexcept { return iter(b); }
  constexpr iter end() const noexcept { return iter(e); }
  constexpr revran rev() const noexcept { return revran(b, e); }
};

constexpr ran rn0(const i64 e) noexcept { return ran(e); }
constexpr ran rn0(const i64 b, const i64 e) noexcept { return ran(b, e); }
constexpr ran rn1(const i64 e) noexcept { return ran(1, e + 1); }
constexpr ran rn1(const i64 b, const i64 e) noexcept { return ran(b, e + 1); }


int main() {
  i64 n, k;
  cin >> n >> k;
  vector<i64> V(n);
  for(int i: ran(n)) cin >> V[i];

  vector<vector<i64>> le(51, vector<i64>(101, -1e9));
  le[0][0] = 0;

  for(int i = 1;i <= n;i++) {
    for(int j = 1; j <= k;j++) {
      le[i][j] = le[i - 1][j - 1] + V[i - 1];
      le[i][j] = max(le[i][j], le[i][j - 1]);
      if(j - 2 >= 0) {
        le[i][j] = max(le[i][j], le[i - 1][j - 2]);
      }
    }
  }
  vector<vector<i64>> ri(52, vector<i64>(101, -1e9));
  ri[n + 1][0] = 0;

  for(int i = n;i >= 1;i--) {
    for(int j = 1; j <= k;j++) {
      ri[i][j] = ri[i + 1][j - 1] + V[i - 1];
      ri[i][j] = max(ri[i][j], ri[i][j - 1]);
      if(j - 2 >= 0) {
        ri[i][j] = max(ri[i][j], ri[i + 1][j - 2]);
      }
    }
  }
  i64 ans = 0;
  for(int i = 1;i <= n;i++) {
    for(int j = 0;j <= k;j++) {
      le[i][j] = max(le[i - 1][j], le[i][j]);
    }
  }
  for(int i = 1;i <= n;i++) {
    for(int j = 0;j <= k;j++) {
      ri[i][j] = max(ri[i + 1][j], ri[i][j]);
    }
  }
  for(int i = 1;i <= n;i++) {
    for(int j = 0;j <= k;j++) {
      ans = max(ans, le[i - 1][j] + ri[i][k - j]);
    }
  }
  cout << ans << endl;
}


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

int main()
{
	int x[10];
	int i,j,tmp;
	for(i=0;i<10;i++){
		cin >> x[i];
	}
	
	sort(x,x+10);
	
	cout <<x[9] <<endl;
	cout <<x[8] <<endl;
	cout <<x[7] <<endl;
    
    
    
	
	return 0;
}

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

int main() {
  int n;
  cin >> n;
  int x;
  set<int> st;
  for(int i; i<n; i++){
    cin >> x;
    st.insert(x);
  }
  if(st.size()==n){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}

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

int main()
{
  	int x1,y1,z1;
  	cin >> x1 >> y1 >> z1;
    if (x1 < y1+2*z1)
        cout << 0 << endl;
    else
        cout << ((x1-z1)/(y1+z1)) << endl;
}

Measured memory_bytes: 3616
#include <cstdio>

const int MOD = 1e9+7;

int n, k, ans;
int dp[55][2505][55];
// dp[i][j][p] signifies that we are processing i,
// have made j oddness, and there's still p empty spaces.

int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &k);
    if (k > n * n / 2)
    {
        printf("0\n");
        return 0;
    }
    dp[0][1251][0] = 1;
    for (int i = 1; i <= n; ++i)
        for (int j = 0; j < 2505; ++j)
            for (int p = 0; p < i; ++p)
            {
                int current = dp[i - 1][j][p];
                int &next0  = dp[i][j][p];
                next0       = (next0 + (long long)current * (p * 2 + 1)) % MOD;
                int &next1  = dp[i][j - i * 2][p + 1];
                next1       = (next1 + current) % MOD;

                if (p == 0) continue;
                int &next2  = dp[i][j + i * 2][p - 1];
                next2       = (next2 + (long long)current * p * p % MOD) % MOD;
            }
    printf("%d\n", dp[n][k + 1251][0]);
    return 0;
}


Measured memory_bytes: 28288
import java.util.Scanner

object Main {
  val MOD = 1000000007L

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val S = sc.next()

    println(solve(S))
  }

  def solve(S: String): String = {
    val N = S.length
    val dp = new Array[(Long, Long, Long, Long)](N + 1) // A, AB, ABC, X
    dp.update(0, (0, 0, 0, 1))
    for (i <- 1 to N) {
      if (S.charAt(i - 1) == 'A') {
        dp.update(
          i,
          (
            (dp(i - 1)._1 + dp(i - 1)._4) % MOD,
            dp(i - 1)._2,
            dp(i - 1)._3,
            dp(i - 1)._4
          )
        )
      } else if (S.charAt(i - 1) == 'B') {
        dp.update(
          i,
          (
            dp(i - 1)._1,
            (dp(i - 1)._2 + dp(i - 1)._1) % MOD,
            dp(i - 1)._3,
            dp(i - 1)._4
          )
        )
      } else if (S.charAt(i - 1) == 'C') {
        dp.update(
          i,
          (
            dp(i - 1)._1,
            dp(i - 1)._2,
            (dp(i - 1)._3 + dp(i - 1)._2) % MOD,
            dp(i - 1)._4
          )
        )
      } else if (S.charAt(i - 1) == '?') {
        dp.update(
          i,
          (
            (dp(i - 1)._1 * 3 % MOD + dp(i - 1)._4) % MOD,
            (dp(i - 1)._2 * 3 % MOD + dp(i - 1)._1) % MOD,
            (dp(i - 1)._3 * 3 % MOD + dp(i - 1)._2) % MOD,
            dp(i - 1)._4 * 3 % MOD
          )
        )
      }
    }
    dp(N)._3.toString
  }
}

Measured memory_bytes: 42660
#include<stdio.h>                                                                                                                                                        
                                                                                    
int main(void) {                                                                    
    int n, m;                                                                       
    scanf("%d %d", &n, &m);                                                         
                                                                                    
    int i, as[n], votes[n];                                                         
    for(i = 0; i < n; i++) {                                                        
        scanf("%d", &as[i]);                                                        
        votes[i] = 0;                                                               
    }                                                                               
                                                                                    
    int j, b;                                                                       
    for(j = 0; j < m; j++) {                                                        
        scanf("%d", &b);                                                            
        for(i = 0; i < n; i++) {                                                    
            if(as[i] <= b) {                                                        
                votes[i]++;                                                         
                break;                                                              
            }                                                                       
        }                                                                           
    }                                                                               
                                                                                    
    int max_index = 0;                                                              
    int max_votes = 0;                                                              
    for(i = 0; i < n; i++) {                                                        
        if(max_votes < votes[i]) {                                                  
            max_index = i;                                                          
            max_votes = votes[i];                                                   
        }                                                                           
    }                                                                               
    printf("%d\n", max_index + 1);                                                  
                                                                                    
    return 0;                                                                       
} 

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}


signed main(){
    vector<int>a(3),b(3);

    rep(i,3)cin>>a[i];
    rep(i,3)cin>>b[i];

    if(a>b)swap(a,b);
    int ans=b[0]-a[0];

    b[0]=a[0];
    if(a<b)ans++;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 10000000000000000
#define endl '\n'
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

int N,T;
int t[105],v[20005],v2[20005],max_v[20005];
bool fw[20005][105],bw[20005][105];

signed main(void){
    
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>N;
    rep(i,N)cin>>t[i];
    rep(i,N){
        int V; cin>>V;
        if(i==0)v[0]=V;
        chmin(v[T],V);
        int tmp=T+1; T+=t[i];
        for(;tmp<=T;tmp++){
            v[tmp]=V;
            v2[tmp-1]=V;
        }
    }
    
    fw[0][0]=true;
    for(int i=1; i<=T; i++){
        rep(j,v[i]+1){
            if(fw[i-1][j])fw[i][j]=true;
            if(j>0 and fw[i-1][j-1])fw[i][j]=true;
        }
    }
    
    bw[T][0]=true;
    for(int i=T-1; i>=0; i--){
        rep(j,v[i]+1){
            if(bw[i+1][j])bw[i][j]=true;
            if(j>0 and bw[i+1][j-1])bw[i][j]=true;
        }
    }
    
    rep(i,20005)rep(j,105)if(fw[i][j] and bw[i][j]){
        chmax(max_v[i],j);
    }
    double ans=0.0;
    rep(i,T+1){
        ans+=1.*max_v[i];
        if(i<T and max_v[i]==max_v[i+1] and max_v[i]<v2[i])ans+=0.25;
    }
    cout<<setprecision(30)<<ans<<endl;
    return 0;
    
}

Measured memory_bytes: 4864
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll n,m;cin >> n >>m;
    vvl g(3*n);
    rep(i,m){
        ll a,b;cin >> a >>b;
        a--;b--;
        g[a].pb(b+n);
        g[a+n].pb(b+n+n);
        g[a+n+n].pb(b);
    }
    ll s,t;cin >>s >>t;s--;t--;
    queue<ll> que;
    que.push(s);
    vl dist(3*n,-1);
    dist[s]=0;
    while(!que.empty()){
        ll v=que.front();
        que.pop();
        for(auto nv:g[v]){
            if(dist[nv]!=-1)continue;
            dist[nv]=dist[v]+1;
            que.push(nv);
            if(nv==t){
                cout << dist[nv]/3 <<endl;
                return 0;
            }
        }
    }
    cout << -1 <<endl;
}

Measured memory_bytes: 18944
def main():
    # n = int(input())
    # h, w, k = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = input()
    x = int(input())
    i = 1
    while (x*i) % 360 != 0:
        i += 1
    print(i)


if __name__ == '__main__':
    main()


Measured memory_bytes: 61864
use std::str::FromStr;

fn get_one<T : FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().parse().ok().unwrap();
}

fn get_vec<T : FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect();
}
fn get_vec_by_lines<T : FromStr>(n : usize) -> Vec<T> {
    let mut v : Vec<T> = Vec::new();
    for _i in 0..n {
        let x : T = get_one();
        v.push(x);
    }
    return v;
}


fn main() {
    let nm : Vec<usize> = get_vec();
    let n : usize = nm[0];
    let m : usize = nm[1];
    let mut v = vec!(0_u32;n);
    if n > 1 {
        v[0] = 1;
    }
    let mut exists = vec!(false;n);
    let mut ans = true;
    for i in 0..m {
        let sc : Vec<u32> = get_vec();
        let s = sc[0] as usize;
        let c = sc[1];
        if exists[s-1] && c != v[s-1] {
            ans = false;
            break;
        }
        v[s-1] = c;
        exists[s-1] = true;
    }
    let mut s = String::new();
    for i in 0..n {
        s = format!("{}{}", s, v[i].to_string());
    }
    if ans {
        if n == 1 {
            println!("{}", s);
        }
        else if v[0] != 0 {
            println!("{}", s);
        }
        else {
            println!("{}", -1);
        }
    }
    else {
        println!("{}", -1);
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n, s) for (int i = (s); i < (n); i++)
#define MOD 1000000007
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, W;
    cin >> N >> W;
    vector<int> w(N), v(N);
    rep(i, N) cin >> w[i] >> v[i];
    vector<vector<ll>> dp(101,vector<ll>(W+1,0));
    rep(i,N){
        rep(j,W+1){
            if(j-w[i]>=0){
                dp[i+1][j]=max(dp[i][j-w[i]]+v[i],dp[i][j]);
            }
            else{
                dp[i+1][j]=dp[i][j];
            }
        }
    }
    cout<<*max_element(dp[N].begin(),dp[N].end())<<endl;
 //   system("pause");
    return 0;
}

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

int ans = 0;

void foo(string &s, int curr=0){
    int n = s.size() - 1;
    for(int i=0; i<n; i++){
        string t = s.substr(i+1);
        string add = s.substr(0,i+1);
        stringstream p(add),q(t);
        int x,y;
        p >> x;
        q >> y;
        ans += curr;
        ans += (x+y);
        foo(t,curr+x);
    }
}

signed main(){
    string s; cin >> s;
    int num;
    stringstream add(s);
    add >> num;
    ans += num;
    foo(s);
    cout << ans << endl;
}

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

class Program
{
    static void Main(string[] args)
    {
        var input = long.Parse(Console.ReadLine());

        long n = 0;

        long fiveH = 0;
        long five = 0;

        fiveH = input / 500;

        n = input % 500;

        five = n / 5;

        Console.WriteLine(fiveH * 1000 + five * 5);

        Console.ReadLine();
    }
}



Measured memory_bytes: 11092
#include <cstdio>
#include <set>
int n, ans;
std::multiset<int> st;

int main() {
	int i, a, x, y;
	scanf("%d", &n);
	for(i=0; i<n; i++) scanf("%d", &a), st.insert(a);
	while(!st.empty()) {
		x = *st.rbegin();
		st.erase(st.find(x));
		for(y=1; y<=x; y<<=1);
		std::multiset<int>::iterator it = st.find(y-x);
		if(it != st.end()) ans++, st.erase(it);
	}
	printf("%d", ans);
	return 0;
}

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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define fin(ans) cout << (ans) << endl;
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef long long lli;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<ll, str>> vpls;
typedef vector<tuple<str, ll, ll>> vtsl;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

//実行部
void Main()
{
  ll a, b, c; cin >> a >> b >> c;
  if(c>=min(a,b)&&c<=max(a,b)) fin("Yes")
  else fin("No")
  return;
}

//前処理
int main()
{
  //ios::sync_with_stdio(false);
  //cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		int L = Integer.parseInt(tokens[0]);
		int R = Integer.parseInt(tokens[1]);
		int d = Integer.parseInt(tokens[2]);
		int count = 0;
		for (int i = L; i <= R; ++i) {
			if (i % d == 0)
				++count;
		}
		System.out.println(count);
	}

	void calc() {
	}

	void showResult() {
	}
}


Measured memory_bytes: 25428
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
namespace mydef {
const int INF = 1ll << 60;
const int MOD = 1e9 + 7;
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
void Yes(bool flag = true) {
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
void No(bool flag = true) {
    Yes(!flag);
}
void YES(bool flag = true) {
    if (flag)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}
void NO(bool flag = true) {
    YES(!flag);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
bool dbg = false;
}  // namespace mydef
using namespace mydef;
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vp vector<pair<int, int>>
#define vvp vector<vector<pair<int, int>>>
#define pi pair<int, int>
//#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define asn ans
#define endl "\n"

int N, x, ans[201010];
int used[201011];

void solve() {
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    cin >> N >> x;
    if (x == 1 || x == N * 2 - 1) {
        No();
        return 0;
    }
    Yes();
    if (N == 2) {
        cout << 1 << endl
             << 2 << endl
             << 3 << endl;
        return 0;
    }
    ans[N] = x;
    used[x] = 1;
    if (x >= N) {
        ans[N - 1] = N * 2 - 1;
        ans[N - 2] = 1;
        ans[N + 1] = 2;
        used[2 * N - 1] = 1;
        used[1] = 1;
        used[2] = 1;
    } else {
        ans[N - 1] = 1;
        ans[N - 2] = N * 2 - 1;
        ans[N + 1] = N * 2 - 2;
        used[N * 2 - 1] = 1;
        used[N * 2 - 2] = 1;
        used[1] = 1;
    }

    int now = 1;
    for (int i = 1; i <= N * 2 - 1; i++) {
        if (ans[i] == 0) {
            while (used[now])
                now++;
            used[now] = 1;
            ans[i] = now;
        }
    }

    for (int i = 1; i <= N * 2 - 1; i++)
        cout << ans[i] << endl;

    solve();
    return 0;
}


Measured memory_bytes: 6792
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k,q;
cin>>n>>k>>q;
vector<int>a(n,k-q);
while(q--){
    int num;
    cin>>num;
    a[num-1]++;
}
for(int x:a){
    if(x<=0)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
}
    return 0 ;
}


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

using namespace std;

typedef long long ll;

const int N_MAX = 200005;

int n;

ll a[N_MAX];

ll dp[N_MAX][3];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    if(n == 2)
    {
        cout << max(a[1], a[2]) << "\n";
        return 0;
    }
    ll ans = LLONG_MIN;
    int up;
    if(n & 1)
        up = 2;
    else
        up = 1;
    dp[1][0] = a[1];
    dp[1][1] = dp[1][2] = LLONG_MIN;
    for(int i = 2; i <= n; i++)
        for(int j = 0; j <= up; j++)
        {
            dp[i][j] = LLONG_MIN;
            for(int k = 0; k <= j; k++)
                if(i - 2 - (j - k) >= 0)
                    if(dp[i - 2 - (j - k)][k] != LLONG_MIN)
                        dp[i][j] = max(dp[i][j], dp[i - 2 - (j - k)][k] + a[i]);
            if(j + (n - i) == up)
                ans = max(ans, dp[i][j]);
        }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 9888
# include <bits/stdc++.h>
  typedef long long ll;
#define pii  pair<int,int>
#define vpii vector<pii>
#define vll  vector<ll>
#define vi  vector<int>
#define pb push_back
#define f  first
#define s  second
#define all v.begin(),v.end()
#define fio ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
typedef unsigned long long ulll;
 
using namespace std ;
int main () {

   int a;
   cin>>a;
   
   if(a<1200)
   cout<<"ABC";
   
     else
     cout<<"ARC";
  return 0;
}

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

int main(int argc, const char * argv[]) {
    int N, L;
    cin >> N;
    cin >> L;
    
    int *apple = new int[N];
    bool zero = false;
    for (int i = 0; i < N; i++) {
        apple[i] = L + i; // (L + (i + 1) - 1)
        if (apple[i] == 0) {
            zero = true;
        }
    }
    
    int sum = 0;
    for (int i = 0; i < N; i++) {
        sum += apple[i];
    }
    
    if (zero) {
        cout << sum << endl;
    }else {
        if (apple[0] > 0) {
            cout << sum - apple[0] << endl;
        }else {
            cout << sum - apple[N-1] << endl;
        }
    }

    
    return 0;
}

Measured memory_bytes: 256
/*input
3 1
4 1 5
*/
#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 int long long 
#define double long double
#define f first
#define s second
#define mp make_pair
#define pb push_back

#define RE(i,n) for (int i = 1; i <= n; i++)
#define RED(i,n) for (int i = n; i > 0; i--)
#define REPS(i,n) for(int i = 1; (i*i) <= n; i++)
#define REP(i,n) for (int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)

#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << *it << " "; cout << endl;
#define debug(x) cout << x << endl;
#define debug2(x,y) cout << x << " " << y << endl;
#define debug3(x,y,z) cout << x << " " << y << " " << z << endl;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

const int INF = 1e18+1;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

int raise(int a,int n,int m = MOD){
  if(n == 0)return 1;
  if(n == 1)return a;
  int x = 1;
    x *= raise(a,n/2,m);
    x %= m;
    x *= x;
    x %= m;
    if(n%2)x*= a;
    x %= m;
    return x;
}

int floor1(int n,int k){
    if(n%k == 0 || n >= 0)return n/k;
    return (n/k)-1;
}

int ceil1(int n,int k){
    return floor1(n+k-1,k);
}

void solve(){
    int h,n,sum = 0;
    cin >> n >> h;
    vector<int> x;
    h = min(n,h);
    REP(i,n){
      int a;cin >> a;
      x.pb(a);
    }
    sort(all(x));reverse(all(x));
    REP(i,n){
      if(i >= h)sum += x[i];
    }
    cout << sum;
}

signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  //freopen(".in","r",stdin);freopen(".out","w",stdout);
  int t = 1;
  //cin >> t;
  while(t--){
    solve();
  }
  return 0;
}

Measured memory_bytes: 2420
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		if (N % K == 0) {
			System.out.println(0);
		} else {
			System.out.println(1);
		}
	}
}

Measured memory_bytes: 21972
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

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

    int f[100][10]; /* f[i][j]は、店iが「ある曜日(1～5)の
                       ある時間帯(1～2)」j(0～9)に
                       営業していれば1,営業していなければ0 */

    int p[100][11]; /* p[i][j]は、店iとお姉ちゃんの店の両方
                       が営業している時間帯の個数がjの
                       ときに得られる利益 */

    rep(i, n) {
        rep(j, 10) {
            cin >> f[i][j];
        }
    }
    rep(i, n) {
        rep(j, 11) {
            cin >> p[i][j];
        }
    }

    //利益の最大値(-INFで初期化)
    int ans = -(1 << 30);
    //00…01(0が9個と1が1個)から11…1(1が10個)のbit列を全て調べる
    for(int b = 1; b < (1 << 10); b++) {

        //お姉ちゃんの店の利益
        int profit = 0;

        //i番目の店について調べる
        rep(i, n) {

            int cnt = 0;    /* i番目の店とお姉ちゃんの店の両方が
                               営業している時間帯の個数 */

            //bのjビット目について調べる
            rep(j, 10) {
                //bのjビット目が1かつf[i][j]が1だったら
                if( (b & (1 << j)) && f[i][j] ) {
                    /* ある曜日のある時間帯jではi番目の店と
                       お姉ちゃんの店の両方が営業している */
                    cnt++;
                }
            }

            //i番目の店についてはp[i][cnt]の利益が得られる
            profit += p[i][cnt];
        }

        //profitの中で最大のものがansに入る
        if(ans < profit) {
            ans = profit;
        }
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e;
    int t;
    cin >> a >> b >> c >> d >> e;
    if(a<0){
        t= -c*a + d + e*b;
    }else{
        t = e*(b-a);
    }

    cout << t << endl;
}


Measured memory_bytes: 3096