akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pie 3.142857143
#define ll long long int
#define fr(i,a,n) for(ll i=a;i<n;i++)
#define vi vector<int>
#define vlli vector<ll>
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fv(i,a) for(auto i:a)
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()
#define frv(i,c) for(auto i = c.begin(); i != c.end(); i++)

void solve()
{
	ll n;
	cin >> n;
	vi h(n);
	fr(i, 0, n)
	cin >> h[i];
	int d[n];
	d[0] = 0;
	d[1] = abs(h[1] - h[0]);
	fr(i, 2, n)
	{
		d[i] = min(d[i - 1] + abs(h[i] - h[i - 1]), d[i - 2] + abs(h[i] - h[i - 2]));
	}
	cout << d[n - 1] << endl;
}


int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen ("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	//cin>>t;
	t = 1;
	while (t--)
	{
		solve();
	}


	return 0;
}

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

void trace(int A[], int N){
  int i;
  for(i = 0;i<N;i++){
    if(i >0 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}
//挿入ソート
void insertionSort(int A[], int N){
  int j, i, v;
  for(i = 1; i < N; i++){
    v = A[i];
    j = i-1;
    while( j >= 0 && A[j] > v){
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;
    trace(A,N);
  }
}

int main(){
  int N, i , j;
  int A[100];

  scanf("%d", &N);
  for(i = 0; i<N; i++) scanf("%d", &A[i]);

  trace(A,N);
  insertionSort(A,N);
 }


Measured memory_bytes: 3208
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <stack>
using namespace std;
struct edge{
	int pre,to;
	#define pre(i) ed[i].pre
	#define to(i) ed[i].to
}ed[100010];
int cnt,head[100010];
void merge(int a,int b){
	++cnt;
	to(cnt)=b;
	pre(cnt)=head[a];
	head[a]=cnt;
}
int n,k,ans;
int a[100010],seg[100010];
void dfs(int x,int pre){
	for(int t=head[x];t;t=pre(t)){
		int l=to(t);
		dfs(l,x);
		seg[x]=max(seg[x],seg[l]+1);
	}
	if(seg[x]>=k-1&&x!=1&&pre!=1){
		ans++;
		seg[x]=-1;
	}
}
int main(){
	scanf("%d%d",&n,&k);
	for(int t=1;t<=n;++t){
		scanf("%d",&a[t]);
		if(t!=1)merge(a[t],t);
	}
	if(a[1]!=1)ans++;
	dfs(1,0);
	printf("%d",ans);
}

Measured memory_bytes: 6912
#include<bits/stdc++.h>
//#include<unordered_map>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<stack>
#include<set>
#include<bitset>
#include<sstream>
using namespace std;
#define int long long
#define ll long long
#define str string
#define db double
#define ac() cout<<"Yes"<<endl
#define wa()  cout<<"No"<<endl
#define ddd cout<<"---debug---"<<endl;
#define ff(a,b) for(signed long long (a)=1;(a)<=(b);(a)++)
#define fff(a,b) for(signed long long (a)=0;(a)<(b);(a)++)
#define re readdd()
#define pr(a) printtt(a)
#define pee puts("");
#define eee putchar(' ');
#define pss(a) push_back(a)
#define ps(a) push(a)
#define SZ(x) x.size()
#define epp empty()
#define all(x) x.begin(),x.end()
#define PA pair<int,int>
#define asd signed QP;scanf("%d",&QP);while(QP--)
typedef vector<int> VE;
int gcd(int a,int b){return b==0?a:gcd(b,a%b);}//
int ppow(int a,int b,int mod){a%=mod;//
int ans=1%mod;while(b){if(b&1)ans=(long long)ans*a%mod;
a=(long long)a*a%mod;b>>=1;}return ans;}
int readdd(){int x=0,f=1;char c=getchar();//
while(!isdigit(c)&&c!='-')c=getchar();
if(c=='-')f=-1,c=getchar();
while(isdigit(c))x=x*10+c-'0',c=getchar();
return f*x;}
void printtt(int x){if(x<0)putchar('-'),x=-x;
if(x>=10)printtt(x/10);putchar(x%10+'0');}
bool addd(int a,int b){return a>b;}
int lowbit(int x){return x&-x;}
const int dx[4]={0,0,1,-1};
const int dy[4]={1,-1,0,0};
//
const double eps=1e-6;
const int mod=1e9+7;
const int modd=mod-1;
//
const int maxm=3e5+5;
int a[maxm];


void solve(){
    int a=re,b=re,c=re,d=re;
    while(1){
        c-=b;
        if(c<=0){
            puts("Yes");
            return ;
        }
        a-=d;
        if(a<=0){
            puts("No");
            return ;
        }
    }

}
signed main(){
//    while(1)
//    asd
        solve();
    return 0;
}
/*

*/


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


typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _  %  MOD
#define __ %= MOD

#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), greater<auto>())
#define      fill(a)           memset(a, 0, sizeof (a))

#define      swap(a,b)        {a=a+b;b=a-b;a=a-b;}
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) <<endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;} // modular exponent

int main()
{
    ios_base::sync_with_stdio(false); // don't use printf and scanf
    cin.tie(NULL); // cout<<fixed<<setprecision
    ll x[5];
    ll ans;
    rep(i,5)
    {
      cin>>x[i];
      if(x[i]==0) ans=i+1;
    }
    cout<<ans<<'\n';
    return 0;
}
// JUST ASK YOURSELF DID YOU GIVE YOUR BEST ? ISSE ZYADA
// KUCH KAR BHI NAHI SAKTE !! ENJOY AND GIVE YOUR BEST!!

Measured memory_bytes: 3640
require 'pp'

n = gets.chomp!.to_i
h_n = gets.chomp!.split(" ").map(&:to_i)

h = h_n[0] - 1
ok = true
1.upto(n-1) do |i|
    if h == h_n[i]
        h = h_n[i]
    elsif h > h_n[i]
        ok = false
        break
    else
        h = h_n[i] - 1
    end
end

puts ok ? "Yes" : "No"


Measured memory_bytes: 8828
#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 fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef long double ld; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll x,k,d; cin>>x>>k>>d;
	ll moves = abs(x)/d; //number of moves in the gg direction
	if(x<0)
	{
		x+=min(k,moves)*d;
		k-=min(k,moves);
	}
	else
	{
		x-=min(k,moves)*d;
		k-=min(k,moves);
	}
	//k moves left to oscillate
	k%=2;
	for(int z=0;z<k;z++)
	{
		if(x<0)
		{
			x+=d;
		}
		else
		{
			x-=d;
		}
	}
	cout<<abs(x)<<'\n';
}

Measured memory_bytes: 3620
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int a = 0;
    int b = 0;
    int c = 0;
    for (int i = 0; i < S.length(); i++) {
      char x = S.charAt(i);
      if (x == 'a') a++;
      if (x == 'b') b++;
      if (x == 'c') c++;
    }
    if ((a == b && b == c)
        || (a+1 == b && b == c)
        || (a-1 == b && b == c)
        || (a == c && b+1 == c)
        || (a == c && b-1 == c)
        || (a == b && b == c+1)
        || (a == b && b == c-1)) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    } 
  }
}

Measured memory_bytes: 22500
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <cassert>

using namespace std;
typedef long long ll;
#define REP(i,n) for (ll i = 0; i < (n); ++i)

struct Network {
private:
    vector<map<ll, ll>> adj;
    bool directed;
public:
    explicit Network(bool directed) : directed(directed) {}

    void add_edge(ll from, ll to, ll weight){
        assert(from >= 0);
        assert(to >= 0);
        assert(weight >= 0);
        if(adj.size() < max(from, to) + 1){
            adj.resize(max(from, to) + 1);
        }
        adj.at(from)[to] = weight;

        if(!directed){
            adj.at(to)[from] = weight;
        }
    }

    bool has_edge(ll from, ll to) const {
        if(adj.size() <= max(from, to)){
            return false;
        }else{
            return adj.at(from).count(to);
        }
    }

    ll get_weight(ll from, ll to) const {
        return adj.at(from).at(to);
    }

    void dijkstra(ll src, vector<ll>& out){
        const ll n = adj.size();
        out.resize(n);
        fill(out.begin(), out.end(), -1);
        out[src] = 0;
        priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> que;
        que.emplace(0, src);
        while(!que.empty()){
            const auto p = que.top();
            que.pop();
            const ll v = p.second;
            if(out[v] < p.first){
                continue;
            }
            for(auto nxt : adj[v]){
                if(out[nxt.first] == -1 ||
                   out[nxt.first] > out[v] + nxt.second){
                    out[nxt.first] = out[v] + nxt.second;
                    que.emplace(out[nxt.first], nxt.first);
                }
            }
        }
    }

    void floyd_warhsall(vector<vector<ll>>& out){
        const ll n = adj.size();
        out.resize(adj.size(), vector<ll>(n, -1));
        for(ll i = 0; i < n; ++i){
            for(auto p : adj.at(i)){
                out.at(i).at(p.first) = p.second;
            }
            out.at(i).at(i) = 0;
        }

        for(ll k = 0; k < n; ++k){
            for(ll i = 0; i < n; ++i){
                if(out.at(i).at(k) == -1){
                    continue;
                }
                const ll dik = out.at(i).at(k);
                for(ll j = 0; j < n; ++j){
                    if(out.at(k).at(j) == -1){
                        continue;
                    }
                    const ll dkj = out.at(k).at(j);
                    const ll dij = out.at(i).at(j);

                    if(dij == -1 || dij > dik + dkj){
                        out.at(i).at(j) = dik + dkj;
                    }
                }
            }
        }
    }
};

int main(){
    ll n, m;
    cin >> n >> m;
    Network net(true);
    REP(i, m){
        ll li, ri, ci;
        cin >> li >> ri >> ci;
        li--; ri--;
        if(!net.has_edge(li, ri) ||
           net.get_weight(li, ri) > ci){
            net.add_edge(li, ri, ci);
        }
    }
    REP(i, n - 1){
        net.add_edge(i + 1, i, 0);
    }

    vector<ll> dist;
    net.dijkstra(0, dist);
    cout << dist[n - 1] << endl;
    return 0;
}


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

int main() {
    int a, b, c, ans = 0;
    cin >> a >> b >> c;
    for (int i = a; i <= b; i++) {
        if (c % i == 0) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3092
ls = list(input())
if ls[0] == ls[1] and ls[2] == ls[3] and ls[0] != ls[2]:
  print('Yes')
elif ls[0] == ls[2] and ls[1] == ls[3] and ls[0] != ls[1]:
  print('Yes')
elif ls[0] == ls[3] and ls[1] == ls[2] and ls[0] != ls[1]:
  print('Yes')
else:
  print('No')

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

int main(){
  int N; cin >> N;
  vector<int> A(N);
  for(int i = 0; i < N; i++){
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  cout << A[N/2] - A[N/2 - 1] << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const ll mod = 1e9 + 7;
const ll inf = 1e18;

int main(){
	cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    ll n, k;
    cin >> n >> k;
    vll a(n);
    REP(i, n) cin >> a[i];
    ll end = 0;
    REP(x, k) {
        vll c(n + 1), b(n);
        REP(i, n) {
            c[max(i - a[i], 0LL)]++;
            c[min(i + a[i] + 1, n)]--;
        }
        b[0] = c[0];
        REP(i, n - 1) {
            b[i + 1] = min(b[i] + c[i + 1], n);
        }
        a = b;
        end = 1;
        REP(i, n) {
            if (a[i] != n) end = 0;
        }
        if (end) break;
    }
    REP(i, n) cout << a[i] << " ";
    cout << endl;
    return 0;
}

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

int main(){
  int n;
  cin >> n;
  
    long a[n+1],b[n],ans=0.0;
  
  rep(i,0,n)cin >> a[i];
  rep(i,0,n-1)cin >> b[i];
  
  rep(i,0,n-1){
  	if(b[i]==0)continue;
	
    if(b[i] <= a[i]){
      ans += b[i];
      continue;
    }
    
    if(b[i] <= a[i] + a[i+1]){
      ans += b[i];
      b[i] -= a[i];
      a[i+1] -= b[i];
      continue;
    }
    
    ans += a[i] + a[i+1];
    a[i+1] = 0;
    
  }
  
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if(min(b,d)-max(a,c) < 0){
    cout << 0 << endl;
  }
  else{
    cout << min(b,d)-max(a,c) << endl;
  }
}

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

using namespace std;

typedef long long ll;

#define endl "\n"


int main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    int a, b, c;
    cin >> a >> b >> c;
    if (c >= a && c <= b)
    	cout << "Yes" << endl;
    else
    	cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3616
//
//  sublime text 3,
//  emre yazicioglu
//

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair <ll, ll> pll;
typedef vector <ll> vll;
typedef vector <pll> vpll;
#define pb push_back
#define fi first
#define se second
#define INF (ll) (1e18 + 7)
#define MOD (ll) (1e9 + 7)

const int N = 2e6 + 7;
ll mn = INF, mx = -INF;
ll n, m, k, s, q, t;
ll a, b, c, d, e;
ll ans, cur, sum, cnt;
ll ar[N], p[N], dp[N];
string str; bool h[N];
pll pp[N]; vll v;

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

  // freopen("../in.txt","r",stdin);
  // freopen("../out.txt","w",stdout);

  cin >> n >> k;
  for(int i = 1; i <= n; i++) {
    cin >> ar[i];
    if(ar[i] >= k)
      ans++;
  }
  cout << ans;
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair <int, int>;
const double PI = acos(-1);
const ll MOD = 1000000007;

int main() {
  int N;
  cin >> N;
  int h = N % 10;
  if(h == 2 || h == 4 ||h == 5 ||h == 7 ||h == 9 ) cout << "hon" << endl;
  else if (h == 0 || h == 1 ||h == 6 ||h == 8) cout << "pon" << endl;
  else cout << "bon" << endl;
}


Measured memory_bytes: 3596
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
using namespace std;
typedef long long ll;
#define fori(n) for ( int i = 0; i < (n);i++)
#define forj(n) for ( int j = 0; j < (n);j++)
#define fork(n) for ( int k = 0; k < (n);k++)
#define forghj(n) for ( int ghj = 0; ghj < (n);ghj++)
#define fori1(n) for ( int i = (n)-1; i >= 0;i--)
#define all(vector) (vector).begin(),(vector).end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
/*
                            |~~~~~~~|
                            |       |
                            |       |
                            |       |
                            |       |
                            |       |
 |~.\\\_\~~~~~~~~~~~~~~xx~~~         ~~~~~~~~~~~~~~~~~~~~~/_//;~|
 |  \  o \_         ,XXXXX),                         _..-~ o /  |
 |    ~~\  ~-.     XXXXX`)))),                 _.--~~   .-~~~   |
  ~~~~~~~`\   ~\~~~XXX' _/ ';))     |~~~~~~..-~     _.-~ ~~~~~~~
           `\   ~~--`_\~\, ;;;\)__.---.~~~      _.-~
             ~-.       `:;;/;; \          _..-~~
                ~-._      `''        /-~-~
                    `\              /  /
                      |         ,   | |
                       |  '        /  |
                        \/;          |
                         ;;          |
                         `;   .       |
                         |~~~-----.....|
                        | \             \
                       | /\~~--...__    |
                       (|  `\       __-\|
                       ||    \_   /~    |
                       |)     \~-'      |
                        |      | \      '
                        |      |  \    :
                         \     |  |    |
                          |    )  (    )
                           \  /;  /\  |
                           |    |/   |
                           |    |   |
                            \  .'  ||
                            |  |  | |
                            (  | |  |
                            |   \ \ |
                            || o `.)|
                            |`\\\\) |
                            |       |
                            |       |
                            |       |
*/


int main() {
    ios::sync_with_stdio(false);
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    if (abs(b-a) <= d && abs(c-b) <= d) {
        cout << "Yes";
        return 0;
    }
    if (abs(c-a) <= d) {
        cout << "Yes";
        return 0;
    }
    cout << "No";
    return 0;
}














Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <complex>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 100010


int main(){
  string s;
  int n, k;
  
  cin >> s >> k;
  n = s.size();

  vector<string> vec;
  
  for(int i=0;i<n;i++){
    for(int j=1;j<=k && i+j<=n;j++){
      vec.push_back(s.substr(i, j));
    }
  }

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

  int counter = 0;
  
  for(int i=0;i<vec.size();i++){
    if(i == 0 || vec[i-1] != vec[i]) counter++;
    if(counter == k){
      cout << vec[i] << endl;
      break;
    }
  }
  
  return 0;
}



Measured memory_bytes: 1660
#include<iostream>
using namespace std;
int main(){
    int n;
    
    int dim1[4][13] = {0};
    
    cin >> n;
    
    char s;
    int num;
    
    for(int i = 0; i < n + 1; i++){
        
        cin >> s >> num;
        
        if(s == 'S'){
            dim1[0][num - 1] = 1;
        }
        
        else if(s == 'H'){
            dim1[1][num - 1] = 1;
        }
        
        else if(s == 'C'){
            dim1[2][num - 1] = 1;
        }
        
        else if(s == 'D'){
            dim1[3][num - 1] = 1;
        }
    }
    
    for(int j = 0; j < 4; j++){
        
        for(int i = 0; i < 13; i++){
            if(dim1[j][i] == 0){
                if(j == 0){
                    cout << "S " << i + 1 << endl;
                }
                else if(j == 1){
                    cout << "H " << i + 1 << endl;
                }
                else if(j == 2){
                    cout << "C " << i + 1 << endl;
                }
                else if(j == 3){
                    cout << "D " << i + 1 << endl;
                }
            }
        }  
    }   
    
}


Measured memory_bytes: 3032
#include<iostream>
#include<vector>
#include<map>
#include<string>
using namespace std;
vector<string> mp;
char c[]={'U','R','D','L'};
int dx[]={0,1,0,-1},
	dy[]={-1,0,1,0},
	fx[]={1,0,-1,0},
	fy[]={0,1,0,-1};
void func(int y,int x,int dir){
	cout<<c[dir];
	if((y==1&&x==0&&dir==0)||(y==1&&x==1&&dir==3)){
		cout<<endl;
		return;
	}
	//ツ前
	if(mp[dy[dir]+2*y][dx[dir]+2*x]=='1'){
		func(y,x,(dir+3)%4);
		return;
	}
	if(mp[y*2+dy[(dir+1)%4]+2*dy[dir]][x*2+dx[(dir+1)%4]+2*dx[dir]]=='1'){
		func(y+dy[dir],x+dx[dir],dir);
		return ;
	}
	//
	if(mp[2*y+dy[dir]+dy[(dir+1)%4]*2][2*x+dx[dir]+dx[(dir+1)%4]*2]=='1'){
		int q=(dir+1)%4;
		func(y+dy[dir]+dy[q],x+dx[dir]+dx[q],q);
		return;
	}
	func(y+fy[dir],x+fx[dir],(dir+2)%4);
	return;
}
int main(){
	string pre;
	mp.push_back(" 0 0 0 0 0 ");
	for(int i=0;i<9;i++){
		string s;
		if(i%2==0){
			s="0 ";
			cin>>pre;
			for(int j=0;j<4;j++){
				s+=pre[j];
				s+=' ';
			}
			s+='0';
			mp.push_back(s);
		}
		else{
			cin>>pre;
			s+=' ';
			for(int j=0;j<5;j++){
				s+=pre[j];
				s+=' ';
			}
			s+=' ';
			mp.push_back(s);
		}
	}
	mp.push_back(" 0 0 0 0 0 ");
	func(0,1,1);
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<cmath>

using namespace std;

int n,t,a;
long small=1000000000;

int main(){
  cin >>n >> t >> a;
  long h[n];
  int res;
  for(int i=0;i<n;i++){
  cin >> h[i];
   if(small>abs(1000*t-6*h[i]-1000*a)) {
     small=abs(1000*t-6*h[i]-1000*a);
     res=i+1;
   }
  }  
    
  cout << res << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int a, b, c, d, e;
  int k;
  
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  scanf("%d",&d);
  scanf("%d",&e);
  scanf("%d",&k);
  
  if(e-a<=k)
    printf("Yay!\n");
  else
    printf(":(\n");
  
  return 0;
}


Measured memory_bytes: 1632
#include <cmath>
#include <iostream>
#include <functional>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <stdio.h>
using namespace std;

int main(){    
  int A,P;
  cin >> A >> P;
  
  int P2 = A*3+P;
  cout << P2/2 << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int div(int a,int b);
int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  printf("%d\n",div(a,b));
  return(0);
}

int div(int a,int b){
  if(b%a==0){
    return(a+b);
  }
  return(b-a);
}


Measured memory_bytes: 128
#include <stdio.h>

int main() {
	int f, i, num, r[10], rs, v1, v2;
	double x;
	while(1) {
		f = 0;
		for( i=0; i<10; i++) if (scanf("%d,", &r[i])==EOF) {
				f = 1;
				break;
			}
		if (f==1) break;
		scanf("%d,%d", &v1, &v2);
		
		rs = 0;
		for( i=0; i<10; i++) rs+=r[i];
		
		x = (double)v1 / (double)(v1+v2) * (double)rs;
		
		rs = 0;
		num = 0;
		for( i=0; i<10; i++) {
			rs += r[i];
			if ( x<=(double)rs ) {
				num = i+1;
				break;
			}
		}
		printf("%d\n", num);
	}
	return 0;
}

Measured memory_bytes: 0
/*
** author:mahmoud magdy
*/
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define endl "\n"

inline int D()
{
    int m ;
    cin>>m;
    return m ;
}
inline ll lD()
{
    ll m ;
    cin>>m;
    return m ;
}
inline double dD()
{
    double m;
    cin>>m;
    return m;
}
void fast()
{
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}
int n;
ll cm[100005],a[100005];
int main()
{
    fast();
    n=D();
    for(int i=0;i<n;++i)a[i]=D();
    cm[0]=0;
    int c=1;
    cm[1]=abs(a[1]-a[0]);
    for(int i=2; i<n; ++i)
    {
      cm[i] =  min(cm[i-2]+abs(a[i]-a[i - 2]),cm[i-1] + abs(a[i] - a[i - 1]));
    }
    cout<<cm[n-1]<<endl;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
 
typedef long long int ll;
#define endl "\n"
#define ff first
#define ss second 
#define pb push_back
#define INF ll(1e18)
#define MOD 1000000007
#define debug(x) cout<<x<<"\n";
#define pll pair<ll,ll>
#define mp make_pair
#define Craig ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define all(v) v.begin(),v.end()
#define MAX 9999999999999
#define vll vector<ll>
 
int main()
{ 

    ll t;
    cin>>t;
    if(t==0)
      cout<<1;
    else 
      cout<<0;
}

Measured memory_bytes: 3628
#include<stdio.h>

int main(void)
{
	int a, b,result;
	char op;
	scanf("%d %c %d", &a, &op, &b);
	if (op == '+')
	{
		result = a + b;
	}
	else
	{
		result = a - b;
	}
	printf("%d\n", result);
	return 0;
}

Measured memory_bytes: 128
def main():
    N = int(input())
    A = list(map(int, input().split()))

    for i in range(N):
        if A[i] % 2 == 0:
            if (A[i] % 3 != 0) and (A[i] % 5 != 0):
                print("DENIED")
                return 0
    print("APPROVED")
    return 0


if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;

int main()
{
    //データ定義
    double x_1, x_2, y_1, y_2;
    double distance;

    //データ入力
    cin >> x_1 >> y_1 >> x_2 >> y_2;

    //２点間の距離を求める
    distance = sqrt(pow((x_2 - x_1), 2) + pow((y_2 - y_1), 2));

    //結果出力
    cout << fixed << setprecision(5) << distance << endl;

    return 0;
}


Measured memory_bytes: 3284
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	string S;
	int K;
	cin >> S >> K;
	int N = S.length();
	cat ans = 0;
	for(int i = 0; i < N; i++) if(i == 0 || S[i] != S[i-1]) {
		int r = i;
		while(r < N && S[r] == S[i]) r++;
		if(S[0] == S[N-1]) if(i == 0 || r == N) continue;
		ans += 1LL * ((r-i) / 2) * K;
	}
	if(S[0] == S[N-1]) {
		bool eq = true;
		for(int i = 0; i < N; i++) if(S[i] != S[0]) eq = false;
		if(eq) ans = (1LL*K*N)/2;
		else {
			int nl = 0, nr = 0;
			while(S[nl] == S[0]) nl++;
			while(S[N-1-nr] == S[0]) nr++;
			ans += nl/2;
			ans += nr/2;
			ans += 1LL * ((nl+nr)/2) * (K-1);
		}
	}
	cout << ans << "\n";
	return 0;
}

// look at my code
// my code is amazing


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#define F first
#define S second
#define vec vector
#define pb push_back
#define pll pair<ll,ll>
#define pdd pair<ld, ld>
#define umap unordered_map
#define uset unordered_set
#define pii pair<int, int>
#define pnn pair<Node*, Node*>
#define all(m) m.begin(), m.end()
#define uid uniform_int_distribution
#define init(m, x) memset(m, x, sizeof(m));
#define FILE ifstream in("input.txt");ofstream out("output.txt");
#define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
using namespace std;
typedef string str;
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

ll a,k;
vec<ll> m;

ll check(ll d){
    ll e = 0;
    for(ll c : m){
        e += (c-1)/d;
    }
    return e<=k;
}

int main() {
    fast;
    cin>>a>>k;
    m = vec<ll>(a);
    for(int q=0; q<a; q++){
        cin>>m[q];
    }
    ll l = 0, r = 2e9;
    for(; l+1<r; ){
        ll md = (l+r)/2;
        if(check(md)) r = md;
        else l = md;
    }
    cout<<r;
}

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

int main(){
    int d,g;
    cin>>d>>g;

    vector<int> p(d),c(d);
    rep(i,0,d){
        int _p,_c;
        cin>>_p>>_c;
        p.at(i)=_p;
        c.at(i)=_c;
    }

    int min_num=10000;
    rep(i,0,(1<<d)){
        bitset<10> b(i);
        int score=0,num=0;
        rep(j,0,d){
            if(b.test(j)) {
                score+=c.at(j)+p.at(j)*100*(j+1);
                num+=p.at(j);
            }
        }

        if(score<g){
            for(int j=d-1;j>=0;j--){
                if(!b.test(j)){
                    if((p.at(j)-1)*100*(j+1)<g-score){
                        score+=(p.at(j)-1)*100*(j+1);
                        num+=p.at(j)-1;
                    }else{
                        num+=ceil((g-score)/((j+1)*100.0));
                        score+=g-score;
                        break;
                    }
                }
            }
        }

        if(score>=g && num<min_num) min_num=num;
    }

    cout<<min_num<<endl;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    S = list(input())
    S_Rev = S[::-1]
    n = len(S)

    pos = 0
    while pos < n:
        if S_Rev[pos] == "m":
            if pos + 5 <= n and "".join(S_Rev[pos:pos + 5]) == "maerd":
                pos += 5
            else:
                print("NO")
                break
        elif S_Rev[pos] == "e":
            if pos + 5 <= n and "".join(S_Rev[pos:pos + 5]) == "esare":
                pos += 5
            else:
                print("NO")
                break
        elif S_Rev[pos] == "r":
            if pos + 6 <= n and "".join(S_Rev[pos:pos + 6]) == "resare":
                pos += 6
            elif pos + 7 <= n and "".join(S_Rev[pos:pos + 7]) == "remaerd":
                pos += 7
            else:
                print("NO")
                break
        else:
            print("NO")
            break
    else:
        print("YES")


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 4776
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        int N = sc.nextInt();
        Map<Long, Integer> map = new HashMap<>();
        for (int i = 0; i < N; ++i) {
            long A = sc.nextInt();
            Integer cnt = map.get(A);
            if (cnt == null) {
                cnt = 0;
            }
            map.put(A, cnt + 1);
        }

        if (map.size() % 2 == 0) {
            _out.println((map.size() - 1));
        } else {
            _out.println(map.size());
        }
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
}

Measured memory_bytes: 66584
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long;
#define endl '\n'
#define rep(i, n) for(ll i=0;i<n;++i)
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep3(i,a,b) for(ll i=a;i>=a;--i)

int main(){
    int x;
    cin >> x;
    if(x>=30)printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 3632
import java.util.*;
import java.awt.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(in);
        int size=1000000;
        long[] fact=new long[size];
        long[] inv=new long[size];
        fact[0]=1;
        inv[0]=1;
        long mod=1000000007;
        for (int i = 1; i < size; i++) {
            fact[i]=(fact[i-1]*i)%mod;
            inv[i]=power(fact[i],(int)mod-2)%mod;
        }
        //comb=fact[n]*inv[k]%mod*inv[n-k]%mod
        int n=sc.nextInt();
        int m=sc.nextInt();
        if(m==1){
            out.println(1);
        }else{
            HashMap<Integer,Integer> map=new HashMap<>();
            for (int i = 2; i <= m; i++) {
                while(m%i==0){
                    m/=i;
                    map.put(i,map.getOrDefault(i, 0)+1);
                }
            }
            if(map.isEmpty())map.put(m,1);
            long ans=1;
            for(int k:map.keySet()){
                ans=(ans*comb(fact,inv,n-1+map.get(k),n-1))%mod;
            }
            out.println(ans);
        }
      }
    static long power(long x,int n){
        long mod=1000000007;
        long ans=1;
        while (n>0) {
            if((n&1)==1){
                ans=(ans%mod*x%mod)%mod;
            }
            x=(x%mod*x%mod)%mod;
            n>>=1;
        }
        return ans;
    }
    static long comb(long[] fact,long[] inv,int n,int k){
        long mod=1000000007;
        return fact[n]%mod*inv[k]%mod*inv[n-k]%mod;
    }
}

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

int main()
{
	int A,B,C;
	cin>>A>>B>>C;
	if(A==B&&B!=C||B==C&&C!=A||C==A&&A!=B)    cout<<"Yes"<<endl;
	
 	else cout<<"No"<<endl;

		

	return 0;
}


Measured memory_bytes: 256
import sys
import math

N = sys.stdin.readline()
H = list(map(int, sys.stdin.readline().split(' ')))

m = 0
s = 0
for x, y in zip(H[:-1], H[1:]):
    if x >= y:
        s += 1
        m = max(s, m)
    else:
        s = 0

print(m)

Measured memory_bytes: 14252
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int max = 0;
		int min = Integer.MAX_VALUE;

		for(int i = 0; i < n; i++){
			int tmp = sc.nextInt();

			max = Math.max(max, tmp);
			min = Math.min(min, tmp);
		}

		System.out.println(max - min);
	}
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main() {
    FAST
    int n,k;
    cin>>n>>k;
    int d,s;
    int done[n+1]={0};
    for(int i=1;i<=n;i++){
        cin>>d;
        for(int j=1;j<=d;j++){
            cin>>s;
            done[s]=1;
        }
    }
    int cnt=0;
    for(int i=1;i<=n;i++){
        if(!done[i]) cnt++;
    }
    cout<<cnt;
    return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

int main() {
	int N;
	cin >> N;
	string in;
	cin >> in;
	map<char, int> chars;
	for (int c : in) {
		chars[c]++;
	}
	for (int i = 1; i < N; ++i) {
		cin >> in;
		map<char, int> charstmp;
		for (int c : in) {
			charstmp[c]++;
		}
		for (char c = 'a'; c <= 'z'; ++c) {
			chars[c] = min(chars[c], charstmp[c]);
		}
	}
	for (char c = 'a'; c <= 'z'; ++c) {
		for (int i = 0; i < chars[c]; ++i) {
			cout << c;
		}
	}
	cout << endl;
	cin >> ws;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int isu,width,part,ans,y;
    scanf("%d %d %d",&isu,&width,&part);
    ans=0;
    y=part;
    while(1){
        y+=width+part;
        if(y>isu){
            break;
        }
        ans++;
    }
    printf("%d\n",ans);
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <random>
#include <utility>
#include <string.h>
#include <iomanip>
#include <stdlib.h>
#include <algorithm>
using namespace std;
typedef pair<int,int> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
long long int i,j,k;
long long int n,m;
long long int x[1002][1002];
long long int a,b,c;
 
 
int main(){
	cin>>n>>m;
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			if(i==j)x[i][j]=0;
			else x[i][j]=INF;
		}
	}
	for(i=0;i<m;i++){
		cin>>a>>b>>c;
		x[a-1][b-1]=-c;
	}
	for(k=0;k<n;k++){
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				if(x[i][k]+x[k][j]<x[i][j])x[i][j]=x[i][k]+x[k][j];
			}
		}
	}
	/*bool flag=false;
	for(i=0;i<n;i++){
		if(x[i][i]<0){
			flag = true;
			break;
		}
	}*/
	if(x[0][0]<0){
		cout<<"inf"<<endl;
	}else{
		cout<<-x[0][n-1]<<endl;
	}
	return 0;
}

Measured memory_bytes: 8064
#copipe
#1次元で格納

def main():
    h,w = map(int,input().split())
    a = []
    for i in range(h):
        a.append(input())

    used = [True]*(h*w)

    p = []
    for i in range(h):
        for j in range(w):
            if a[i][j] == '#':
                p.append(i*w+j)
                used[i*w+j] = False


    
    res = 0
    while p:
        tank = []
        for e in p:
            if e>w-1 and used[e-w]:
                tank.append(e-w)
                used[e-w] = False
            if e%w > 0 and used[e-1]:
                tank.append(e-1)
                used[e-1] = False
            if e<(h-1)*w and used[e+w]:
                tank.append(e+w)
                used[e+w] = False
            if e%w<w-1 and used[e+1]:
                tank.append(e+1)
                used[e+1] =  False
        p = tank
        res += 1
    print(res-1)

if __name__ == '__main__':
    main()


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

using namespace std;
using ll = long long;
typedef pair<int, int> ii;
typedef vector<ii> vii; 
typedef vector<int> vi;

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

	int n;
	cin >> n;
	
	cout << (n * (n + 1)) / 2 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int INF = 100100100;
const double PI = 3.14159265358979323846;
typedef long long ll;
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define REP(i, n) for (ll i = 0; i < (n); ++i)

int main() {
  ll n, count = 0, ans = 0;
  cin >> n;
  FOR(i, 1, n + 1) {
    ll x = i;
    while (x > 0) {
      x /= 10;
      count++;
    }
    if (count % 2 == 1) ans++;
    count = 0;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repq(i,a,n) for(int i=a; i<=n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

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

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int main() {
    string s; cin >> s;
    bool a = false, b = false;
    rep(i,0,s.size()) {
        if(s[i] == 'C') a = true;
        else if(s[i] == 'F' && a) b = true;
    }
    if(a && b) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include<iostream>
using namespace std;
typedef long long ll;

const ll mod=1e9+7;
ll p(ll a, ll n)//快速幂递归式 
{
    if(n == 0) return 1;//如果次方是0则直接返回1 
    ll x = p(a, n/2);//因为最后结果是取余，所以可将其开根号，n奇偶分情况，若为基数会少乘一个a 
    ll ans = x * x % mod;//然后平方因为可能越界所以取余 
    if(n % 2 == 1) ans = ans *a % mod;//若n为奇数则需要再次乘以a 
    return ans%mod;
}

ll C(ll n,ll m) {
    if(n < m) return 0;//求组合计数 
    ll res = 1;
    for(ll i=1; i<=m; i++) {//n!/m!*(n-m)!==(n!/(n-m!)/m!约分后得下式 
        ll a = (n+i-m)%mod;//从n+1-m乘到n ，注意取余 
        ll b = i%mod;//从1乘到m，注意取余 
        res = res*(a*p(b,mod-2)%mod)%mod;//费马小定理求逆元 
    }
    return res;
}

ll Lucas(ll n,ll m) {
    if(m == 0) return 1;
    return C(n%mod, m%mod) * Lucas(n/mod,m/mod) % mod;//卢卡斯定理 
}

ll n,a,b;
int main(){
    cin>>n>>a>>b;
    ll ans=p(2,n)-Lucas(n,a)-Lucas(n,b)-1;
    while(ans<0) {
        ans+=mod;
    }
    cout<<ans%mod;
    return 0;
}

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

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

  n %= 26;
  for (auto &c : s)
  {
    c += n;
    if (c > 90)
    {
      c -= 26;
    }
  }

  cout << s << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	double x=0,y=0,z=0,w=0;int a=0,b=0,c=0;
	scanf("%d%d",&a,&b);
	x=(double)a*12.5;	y=x+12.5;
	z=(double)b*10;		w=z+10;
	if(x>=w||z>=y)printf("%d",-1);
	else{
		if(x>z){
			if(abs(round(x)-x)<0.00001){printf("%d",(int)x);
			}else{
			printf("%d",(int)x+1);
		}
		}else {
			if(abs(round(z)-z)<0.00001){printf("%d",(int)z);
			}else{
			printf("%d",(int)z+1);
			}
		}
	}
}

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

class Program
{
    static void Main(string[] args)
    {
        var sol = new Solve();
        sol.Exec();
    }
}

class Solve
{
    public void Exec()
    {
        var N = int.Parse(Console.ReadLine());
        Console.WriteLine(N % 2 == 0 ? N / 2 : N / 2 + 1);
    }
}

public class Util
{
}


Measured memory_bytes: 13140
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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;
}

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

ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

long long modpow(long long a, long long n, long long mod)
{
    long long res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

//----------------------------------------------------------------


int main(){
ll r;
cin>>r;
cout<<3*r*r<<endl;
}









Measured memory_bytes: 256
#include <stdio.h>

int main(){
  
  int	N;
  char	s[8] = {0};
  
  scanf("%d", &N);
  sprintf(s, "%d", N);

  if(s[0]=='7' || s[1]=='7' || s[2]=='7'){ printf("Yes"); }
  else{ printf("No"); }

  return 0;
}

Measured memory_bytes: 1704
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
int f(int n){
    int sum=0;
    for (int i = 1; i <= sqrt(n); ++i) {
        for (int j = 1; j <= sqrt(n-i*i); ++j) {
            for (int k = 1; k <= sqrt(n-i*i-j*j); ++k) {
                if (i*i+j*j+k*k+i*j+i*k+j*k==n)
                    sum++;
                if (i*i+j*j+k*k+i*j+i*k+j*k>n)
                    break;
            }
        }
    }
    return sum;
}

int main() {
    using namespace std;
    int n;
    cin>>n;
    for (int i = 1; i <= n ; i++) {
        cout<<f(i)<<endl;
    }
    return 0;
    }

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

int main()
{
	long long a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << (long long)max(b*d,max(a*c,max(a*d,b*c))) << endl;
	return 0;
}

Measured memory_bytes: 3672
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

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

    int ans = 0;
    int cnt = 0;
    bool f = false;
    for(int i=0; i<s.size(); i++){
        if(s[i]=='A' || s[i]=='C' || s[i]=='G' || s[i]=='T'){
            cnt++;
            ans = max(ans, cnt);
            f = true;
        
        }else if(f){
            cnt = 0;
            f = false;
        }
    }

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

Measured memory_bytes: 3592