akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
#define INF 10e10

using namespace std;

//  #define y cout << "yes"<< endl
  #define Y cout << "YES" << endl
  #define y cout << "Yes" << endl
//  #define n cout << "no"<< endl
  #define N cout << "NO" << endl
  #define n cout << "No" << endl
  #define pu(q) cout << q ;
  #define put(q) cout << q << " ";
  #define puts(q) cout << q << endl;
  
  
	int a,b,c,d,e,f,g,h,ans,res;
	int a1,a2,a3,a4,a5,a6,a7,a8,a9,a10;
//	char a,b,c,d,e,f,g,h,ans,res;
//	string a,b,c,d,e,f,g,h,ans,res;
//	double a,b,c,d,e,f,g,h,ans,res;
	
void take(int x);
  
int main(void){
	take(6);//数
	a1=abs(a-b);
	a2=abs(a-c);
	a3=abs(a-d);
	a4=abs(a-e);
	a5=abs(b-c);
	a6=abs(b-d);
	a7=abs(b-e);
	a8=abs(c-d);
	a9=abs(c-e);
	a10=abs(d-e);
	
	if(((a1<=f&&a2<=f)&&(a3<=f&&a4<=f)) && ((a5<=f&&a6<=f)&&(a7<=f&&a8<=f))){
		if(a9<=f&&a10<=f){
			puts("Yay!");
		}else{
			puts(":(");}
	//	y;	//Yes
	//	Y;	//YES
	//	n;	//No
	//	N;	//NO
	}
	/*
	else if(){
		
		
	//	y;
	//	Y;
	//	n;
	//	N;
		
	}/*
	else if(){
		
		
	//	y;
	//	Y;
	//	n;
	//	N;
		
	}/*
	else if(){
		
		
	//	y;
	//	Y;
	//	n;
	//	N;
		
	}*/
	
	else{
		
	puts(":(");	
	//	y;
	//	Y;
	//	n;
	//	N;
		
	}
//	cout << ans << endl;
	
	return 0;
}
void take(int x){
	if(x==1)
		cin >> a;
	else if(x==2)
		cin >> a >> b;
	else if(x==3)
		cin >> a >> b >> c;
	else if(x==4)
		cin >> a >> b >> c >> d;
	else if(x==5)
		cin >> a >> b >> c >> d >> e;
	else if(x==6)
		cin >> a >> b >> c >> d >> e >> f;
	else if(x==7)
		cin >> a >> b >> c >> d >> e >> f >> g;
	else if(x==8)
		cin >> a >> b >> c >> d >> e >> f >> g >> h;
	return ;
}

Measured memory_bytes: 256
//This is getting accepted!
#include<bits/stdc++.h>
#define ll long long
#define oo 1000000009
#define isset(x, i) (((x)>>(i))&1)
#define setbit(x, i) ((x)^(1ll<<(i)))
#define clearbit(x, i) ((x)&(~(1ll<<(i))))
#define twoexp(i) (1ll<<(i))

using namespace std;

const int MOD = 1000000007;
const double EPS = 1e-8;
const double PI = 2 * acos(0);
const int MAXN = 1e5 + 6;

int n;
ll a[MAXN];
ll sum[MAXN];
ll res[MAXN];
ll total;

bool input() {
	
	cin >> n;
	total = 0;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		sum[i] = a[i]*2;
		total += a[i];
	}
	
	return !cin.fail();
}

void clear_input() {
	n = 0;
}

void preprocess() {
	
}

void process(int itest) {
	
	ll elast = 0;
	for (int i = 0; i < n-1; i+=2)
		elast += sum[i];
	
	res[n-1] = total - elast;
	res[0] = sum[n-1] - res[n-1];
	for (int i = 1; i < n-1; ++i)
		res[i] = sum[i-1] - res[i-1];
	
	for (int i = 0; i < n; ++i)
		cout << res[i] << " ";
	cout << endl;
}

void oneTest() {
	
	while(input()) {
		preprocess();
		process(0);
		clear_input();
	}
	
}

void multiTest() {
	
	int t;
	cin >> t;
	
	for (int it = 1; it <= t; ++it) {
		input();
		preprocess();
		process(it);
	}
}

int main(){
    #ifndef ONLINE_JUDGE
//    freopen("../out.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	oneTest();
//	multiTest();

    return 0;

}


Measured memory_bytes: 3712
package main

import (
	"strconv"
	"bufio"
	"os"
	"fmt"
)

func main() {
	sc := NewScanner()
	s := sc.NextLine()
	d := [26]int{}
	for _, v := range s {
		d[v - 'a']++
	}
	for i := 0; i < 26; i++ {
		if d[i] % 2 == 1 {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	result = append(result, v)

	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>

using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

int main() {

    ll a;
    cin >> a;
    if(a<3200) cout << "red" << endl;
    else{
        string s;
        cin >> s;
        cout << s << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import copy
N = int(input())
S = input()

cnt = [0]*10
for x in S:
    cnt[int(x)] += 1

tars = []
for i in range(10):
    for j in range(10):
        for k in range(10):
            tars.append(str(i)+str(j)+str(k))

ans = 0
for tar in tars:
    id = 0
    copy_cnt = copy.copy(cnt)
    if copy_cnt[int(tar[0])] == 0 or copy_cnt[int(tar[1])] == 0 or copy_cnt[int(tar[2])] == 0:
        continue
    while S[id] != tar[0]:
        copy_cnt[int(S[id])] -= 1
        id += 1
    copy_cnt[int(S[id])] -= 1
    id += 1
    if copy_cnt[int(tar[1])] == 0 or copy_cnt[int(tar[2])] == 0:
        continue
    while S[id] != tar[1]:
        copy_cnt[int(S[id])] -= 1
        id += 1
    copy_cnt[int(S[id])] -= 1
    if copy_cnt[int(tar[2])] == 0:
        continue
    else:
        ans += 1

print(ans)

Measured memory_bytes: 74576
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

const int MOD = 1000000007;

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> x(n);
    for(int i=0; i<n; ++i)
        cin >> x[i];

    vector<vector<long long> > dp(n+1, vector<long long>(256, 0));
    dp[0][0] = 1;
    for(int i=0; i<n; ++i){
        for(int a=n-1; a>=0; --a){
            for(int b=0; b<256; ++b){
                dp[a+1][b^x[i]] += dp[a][b] * (a + 1);
                dp[a+1][b^x[i]] %= MOD;
            }
        }
    }

    int ans = 0;
    for(int i=0; i<=n; ++i){
        ans += dp[i][k];
        ans %= MOD;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 512
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b){
  ll r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


ll LCM(ll a,ll b){
  ll c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

vector<pair<char,ll>> runlength(string s,vector<pair<char,ll>> p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
    return p;
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
  return p;
}


ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  ll a,b,c,d;
  cin>>a>>b;
  c=(b-a+1)/2;
  if(a==b){
    cout<<a<<endl;
    return 0;
  }
  if(a%2==1 && b%2==1){
    d=c%2;
    cout<<(a^d)<<endl;
  }else if(a%2==1 && b%2==0){
    c--;
    d=c%2;
    cout<<((a^b)^d)<<endl;
  }else if(a%2==0 && b%2==1){
    d=c%2;
    cout<<d<<endl;
  }else if(a%2==0 && b%2==0){
    d=c%2;
    cout<<(b^d)<<endl;
  }
  
}

Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())

counter = 0
for i in range(A+1) :
    for j in range(B+1):
        for k in range(C+1):
            if 500*i+100*j+50*k==X: counter += 1

print(counter)



Measured memory_bytes: 3060
// inputに入力データ全体が入る
function Main(input) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split("\n");
  //文字列から10進数に変換するときはparseIntを使います
  var R = parseInt(input[0], 10);
  if (0 <= R && R < 1200 ) {
    console.log('ABC');
  } else if (1200 <= R && R < 2800) {
    console.log('ARC');
  } else if (2800 <= R && R <= 4208){
    console.log('AGC');
  } else {
    return;
  }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
#pragma GCC optimize("O3")
#pragma GCC target ("sse4")

#include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define f first
#define s second

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const 
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
string s;
vector<int> res, loc;
int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> s;
    int prv = -1;
    res.assign(sz(s), 0);
    FOR(i, 1, sz(s))
    {
        if(s[i] == 'L' && s[i - 1] == 'R') loc.pb(i - 1);
    }
    vector<int> rloc = loc;
    reverse(rloc.begin(), rloc.end());
    F0R(i, sz(s))
    {
        if(s[i] == 'R') 
        {
            auto itx = lower_bound(loc.begin(), loc.end(), i);
            int c = (*itx);
            //check
            if((c - i)%2) res[c + 1]++;
            else res[c]++;
        }
        else
        {
            auto itx = lower_bound(rloc.begin(), rloc.end(), i, greater<int>());
            int c = (*itx);
            //check
            if((c - i)%2) res[c + 1]++;
            else res[c]++;
        }
    }
    for(auto i : res) cout << i << " ";
    return 0;
}

Measured memory_bytes: 1484
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Cube test = new Cube();
		test.num();

	}
}
	

class Cube{
	public void num(){

		String	i = new Scanner(System.in).nextLine();
		int number = Integer.parseInt(i);
		System.out.println((int)Math.pow(number,3));

	}
}

Measured memory_bytes: 26196
#include "bits/stdc++.h"

using namespace std;

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

    // sieve of eratosthenes
    vector<int> pnums(1000000,0);
    for(int i=2;i<1000000;i++) pnums[i]=1;
    for(int i=2;i*i<1000000;i++){
        if(pnums[i]){
            for(int j=i*i;j<1000000;j+=i){
                pnums[j]=0;
            }
        }
    }
    vector<int> primes;
    for(int i=2;i<10000;i++)if(pnums[i]) primes.push_back(i);
    int m,a,b;
    while(cin>>m>>a>>b,m||a||b){
        int p=0,q=0,ma=p*q;
        for(int i=0;i<(int)primes.size();i++){
            for(int j=i;j<(int)primes.size();j++){
                if(primes[i]*primes[j]>m || a*primes[j]>b*primes[i]) continue;
                if(ma<primes[i]*primes[j]){
                    p=primes[i];q=primes[j];ma=primes[i]*primes[j];
                }
            }
        }
        cout<<p<<" "<<q<<endl;
    }
}

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

int main(){
	int a,b,c;
  	cin >> a >> b >> c;
  	if(a==b && b!=c || a==c && c!=b || b==c && a!=b){
    	cout << "Yes\n";
    } else 
      cout << "No\n";
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
using namespace std;

int main(){
  string s, t, u;
  int a, b;
  cin >> s >> t >> a >> b >> u;
  
  if(s == u){
    a--;
  }else if(t == u){
    b--;
  }
  
  cout << a << " "<< b;

}

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

int main() {
  string n, m;
  cin >> n >> m;
  int x = 0;
  
  for(int i = 0; i < 3; i++) {
    if(i == 0) {
      if(n.at(0) == m.at(2)) {
        x++;
      }
    }
    if(i == 1) {
      if(n.at(1) == m.at(1)) {
        x++;
      }
    }
    if(i == 2) {
      if(n.at(2) == m.at(0)) {
        x++;
      }
    }
  }
  
  if(x == 3) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
      
}

Measured memory_bytes: 3608
#include<stdio.h>
int dp(int);
int main() {
  int n, m;
  while (1) {
    scanf("%d", &n);
    if (!n) break;
    m = dp(n) / 10 + 1;
    if (m % 365) printf("%d\n", m / 365 + 1);
    else printf("%d\n", m / 365);
  }
  return 0;
}
int dp(int n) {
  int kai[31];
  int i;
  kai[1] = 1; kai[2] = 2; kai[3] = 4;
  for (i = 4; i < 31; i ++) kai[i] = kai[i - 3] + kai[i - 2] + kai[i - 1];
  return kai[n];
}

Measured memory_bytes: 600
$M=10**9 +  7

(n,k)=gets.split.map(&:to_i)

$fact = [1]

(1..2*n).each{|i|
    $fact[i] = $fact[i-1]*i
}

def comb(n,k)
    $fact[n] / $fact[n-k] / $fact[k] % $M
end
b=k
r=n-k

(1..k).each{|i|
    r0 = r - (i-1)
    b0 = b - i
    p comb(r0+i,i) * comb(b0+i-1,i-1) % $M
}

Measured memory_bytes: 13564
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <utility>
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pul pair<ull, ull>
#define all(a) (a).begin(), (a).end()
#define mp make_pair
#define pb push_back
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << endl; }
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void yes() { cout << "yes" << endl; }
void no() { cout << "no" << endl; }
void Taka() { cout << "Takahashi" << endl; }
void Aoki() { cout << "Aoki" << endl; }
void digit(int d) { cout << fixed << setprecision(d); }
void IOup() { cin.tie(0); ios::sync_with_stdio(false); }

ll c[100001];

int main() {
	ll n, k, a, b;
	cin >> n >> k;
	while (n--) {
		cin >> a >> b;
		c[a] += b;
	}

	ll cnt = 0;
	for (int i = 1; ; ++i) {
		if (cnt <= k && k <= cnt + c[i]) {
			cout << i << endl;
			break;
		}
		cnt += c[i];
	}

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <set>
#include <numeric>

#include <map>
#include <math.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <bitset>

#define INF 100100100

typedef long long int llint;

using namespace std;

typedef pair<int, int>Pii;

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

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

int main(){
  string s,t;
  string ans;
  bool flag=false;
  cin >> s >> t;
  reverse(s.begin(),s.end());reverse(t.begin(),t.end());
  for(int i =0;i<s.size();i++){
    if(flag==false)for(int j=0;j<t.size();j++){
	if(s[i+j]!=t[j]&&s[i+j]!='?')break;
	if(j==t.size()-1){
	  flag=true;
	  s.replace(i,t.size(), t);
	}
      }
    if(s[i]=='?')s[i]='a';
  }
  reverse(s.begin(),s.end());
  flag==true?cout << s << endl:cout << "UNRESTORABLE" << endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
from collections import deque, defaultdict
from math import sqrt, factorial, gcd
# def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline().strip() # warning bytes
# def input(): return sys.stdin.buffer.readline().decode('utf-8')


def solve():
    n, c, k = [int(x) for x in input().split()]
    a = []
    for _ in range(n):
        a.append(int(input()))
    a.sort()
    ans = 0
    bus = 0
    deadline = 0
    for t in a:
        if t <= deadline and bus < c:
            bus += 1
        else:
            bus = 1
            ans += 1
            deadline = t + k
    print(ans)



t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()


"""

abc

"""


Measured memory_bytes: 13576
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <string.h>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#define INF 100000000
 
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;
const ll M = 998244353;
 
int main(void) {
    ll n, m, a, b, tmp1, tmp2;
    cin >> n >> m;
    ll high[n];
    bool is_good[n];
    fill(is_good, is_good+n, true);
    for(ll i=0;i<n;i++) cin >> high[i];
    for(ll i=0;i<m;i++) {
        cin >> a >> b;
        tmp1 = high[a-1];
        tmp2 = high[b-1];
        if(tmp1==tmp2) {
        	is_good[a-1] = false;
        	is_good[b-1] = false;
        } else if(tmp1 > tmp2) {
        	is_good[b-1] = false;
        } else if(tmp2 > tmp1) {
        	is_good[a-1] = false;
        }
    }
    tmp1=0;
    for(ll i=0;i<n;i++) {
    	if(is_good[i]==true) tmp1++;
    }
    cout << tmp1 << endl;
}

Measured memory_bytes: 4504
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
const int tab[] = {-1, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int dp[maxn],pre[maxn],N,M;
bool vis[10];
int main(){
	scanf("%d%d",&N,&M);
	for(int i = 0 ; i < M ; ++i){
		int x;
		cin>>x;
		vis[x] = 1;
	}
	memset(dp,-1,sizeof dp);
	dp[0]= 0 ;
	for(int i = 1 ; i <= N; ++i){
		for(int j = 9 ; j >= 1 ; --j){
			if(vis[j] && i - tab[j] >= 0){
				int p = i - tab[j];

				if(dp[p] + 1 > dp[i]){
					dp[i] = dp[p] + 1;
					pre[i] = j;
				}
			}
		}
	}
	
	vector<int> ans;
	int p = N;
	while(p){
		ans.push_back(pre[p]);
		p -= tab[pre[p]];
	}
	sort(ans.begin(),ans.end(),greater<int>());
	for(int x : ans)printf("%d",x);
	puts("");
	return 0;
}

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

#define llint long long int
#define pb push_back

using namespace std;

int main(){
  int n;
  cin >> n;
  float sum = 0;
  while(n--){
    float a;
    string s;
    cin >> a >> s;
    if(s[0] == 'J')
      sum += a;
    else
      sum += a*380000;
  }
  cout << sum;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
typedef long long ll;
ll dist(ll a, ll b, ll c){
	if((a<=c && c<=b) || (b<=c && c<=a)){
		return abs(a - b) + min(abs(b - c),abs(a - c));
	}
	return max(abs(b-c),abs(c-a));
}
vector<ll> s,t;
int main(){
	int i,a,b,q;
	cin >> a >> b >> q;
	s.push_back(-1000000000000000);
	t.push_back(-1000000000000000);
	for(i=0;i<a;i++){
		ll x; cin >> x;
		s.push_back(x);
	}
	s.push_back(100000000000000000);
	for(i=0;i<b;i++){
		ll x; cin >> x;
		t.push_back(x);
	}
	t.push_back(100000000000000000);
	for(i=0;i<q;i++){
		ll x; cin >> x;
		int y = lower_bound(s.begin(),s.end(),x) - s.begin();
		int z = lower_bound(t.begin(),t.end(),x) - t.begin();
		cout << min({dist(s[y],t[z],x),dist(s[y - 1],t[z],x),dist(s[y - 1],t[z - 1],x), dist(s[y],t[z - 1],x)}) << endl;
	}
}

Measured memory_bytes: 3060
var lines = [];
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var N = Number(lines[0]);
    var S = lines[1]
    var red = 0, blue = 0;

    for (var value of S) {
        if (value === "R") { red++; }
        else { blue++; }
    }
    blue < red ? console.log("Yes") : console.log("No");
});

Measured memory_bytes: 7500
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int i,n,k;
  cin>>n>>k;
  int a[n];
  
  for(i=0;i<n;i++)
     cin>>a[i];
  sort(a,a+n);
  int sum=0;
  for(i=0;i<k;i++)
    sum+=a[i];
  cout<<sum<<endl;
}

Measured memory_bytes: 3624
#include <stdio.h>
void buildMaxHeap(int*);
void maxHeapify(int*, int);
int extractMax(int*);
void insert(int*,int);
int H,A[2000000];
int main(){
  int k,i;
  char com[30];
  H=0;
  
  while(1){
    scanf("%s",com);
    if(com[0]=='i'){
      scanf("%d",&k);
      insert(A,k);
    }
    else if(com[1]=='x'){
      printf("%d\n",extractMax(A));
    }
    else break;
  }
  return 0;
}
void buildMaxHeap(int* A){
  int i;
  for(i=H/2;i>=1;i--)
    maxHeapify(A, i);
}
void maxHeapify(int*A, int i){
  int l,r,largest,B;
  l=2*i;
  r=2*i+1;
  if(l <=H && A[l]>A[i])
    largest=l;
  else largest = i;
  if(r<=H && A[r]>A[largest])
    largest=r;

  if(largest!=i){
    B=A[i];
    A[i]=A[largest];
    A[largest]=B;
    maxHeapify(A, largest);
  }
}
int extractMax(int*A){
  int maxVal=A[1];
  A[1]=A[H];
  H--;
  maxHeapify(A, 1);
  return maxVal;
}
void insert(int*A,int k){
  int i,S;
  H++;
  A[H]=k;
  for(i=H;i!=1&&A[i]>A[i/2];i=i/2){
    S=A[i];
    A[i]=A[i/2];
    A[i/2]=S;
  }
}
  
  



Measured memory_bytes: 5704
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
#define loop(i,a,n) for (int i = (a); (i) < (n); ++ (i))
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF (int)1e9
#define MOD 0
//#define int ll
using namespace std;
typedef vector<int> vi;

signed main(){
    int n,m,sum=0;
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >> m;
    vector<int> x(m);
    vector<int> dis(m-1);
    rep(i,m) {
        cin >> x[i];
    }
    sort(x.begin(),x.end());
    rep(i,m-1) {
        dis[i] = x[i+1] - x[i];
    }
    sort(dis.begin(),dis.end());
    if(n >= m) puts("0");
    else {
        rep(i,m-n) {
            sum += dis[i];
        }
        cout << sum << endl;
    }
    return 0;
}

Measured memory_bytes: 1024
N, M, C = gets.split(" ").map(&:to_i)
B = gets.split(" ").map(&:to_i)
A = Array.new(N)

correct_num = 0
sum = 0

N.times do |n|
  A[n] = gets.split(" ").map(&:to_i)
  M.times do |m|
    sum += A[n][m] * B[m]
  end
  if sum + C > 0
    correct_num += 1
  end
  sum = 0
end

puts correct_num


Measured memory_bytes: 1788
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>

static const int INF = 1 << 30;

enum DIRECTION { ZERO = 0, UPPER, LEFT, UPPER_LEFT };

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

int main() {
  // Input
  std::string s;
  std::string t;
  std::cin >> s >> t;
  const int sLength = s.length();
  const int tLength = t.length();
  assert(1 <= sLength and sLength <= 3000);
  assert(1 <= tLength and tLength <= 3000);
  // use 1-indexed strings
  s.insert(s.begin(), 's');
  t.insert(t.begin(), 't');

  // Initialization
  std::vector<std::vector<int>> dp(1 + sLength + 1);
  std::vector<std::vector<DIRECTION>> prev(1 + sLength + 1);
  for (int i = 0; i <= sLength + 1; ++i) {
    dp[i].assign(1 + tLength + 1, -INF);
    prev[i].assign(1 + tLength + 1, ZERO);
  }

  // Initial condition
  dp[0][0] = 0;

  // DP main
  for (int i = 0; i <= sLength; ++i) {
    for (int j = 0; j <= tLength; ++j) {
      if (dp[i][j] == -INF)
        continue;
      if (s[i + 1] == t[j + 1] and chmax(dp[i + 1][j + 1], dp[i][j] + 1))
        prev[i + 1][j + 1] = UPPER_LEFT;
      if ((j == 0 or s[i + 1] != t[j]) and chmax(dp[i + 1][j], dp[i][j]))
        prev[i + 1][j] = UPPER;
      if ((i == 0 or s[i] != t[j + 1]) and chmax(dp[i][j + 1], dp[i][j]))
        prev[i][j + 1] = LEFT;
    }
  }

  // Result construction
  std::string lcs;
  {
    int i = sLength;
    int j = tLength;
    while (prev[i][j] != ZERO) {
      assert(prev[i][j] == UPPER or prev[i][j] == LEFT or
             prev[i][j] == UPPER_LEFT);
      switch (prev[i][j]) {
      case UPPER:
        i -= 1;
        break;
      case LEFT:
        j -= 1;
        break;
      case UPPER_LEFT:
        assert(s[i] == t[j]);
        lcs.push_back(s[i]);
        i -= 1;
        j -= 1;
        break;
      default:
        assert(false);
      }
    }
  }
  std::reverse(lcs.begin(), lcs.end());

  // Output
  std::cout << lcs << std::endl;

  return 0;
}


Measured memory_bytes: 70912
# coding: utf-8
# Your code here!


n = int(input())

al = list(input())
bl = list(input())
cl = list(input())

ans = 0
for i,j,k in zip(al,bl,cl):
    a = [i,j,k]
    if max(a.count(i), a.count(j), a.count(k)) == 1:
        ans += 2
    elif max(a.count(i), a.count(j), a.count(k)) == 2:
        ans += 1
    else:
        pass
    
print(ans)

Measured memory_bytes: 38384
import java.util.*

var n = -1
var g = BooleanArray( 0 )
var e = Array( 0, { BooleanArray( 0 ) } )
var u = IntArray( 0 )

fun main( args: Array<String> ) {
    val sc = Scanner( System.`in` )
    n = sc.nextInt()
    val x1 = IntArray( n )
    val y1 = IntArray( n )
    val x2 = IntArray( n )
    val y2 = IntArray( n )
    for ( i in 0 until n ) {
        x1[i] = sc.nextInt()
        y1[i] = sc.nextInt()
    }
    for ( i in 0 until n ) {
        x2[i] = sc.nextInt()
        y2[i] = sc.nextInt()
    }

    e = Array( n, { i -> BooleanArray( n, { j -> x1[i] < x2[j] && y1[i] < y2[j] } ) } )
    u = IntArray( n, { -1 } )
    var r = 0
    for ( i in 0 until n ) {
        g = BooleanArray( n, { false } )
        if ( dfs( i ) ) {
            r ++
        }
    }
    println( r )
    System.out.flush()
}

fun dfs( v: Int ): Boolean {
    if ( v < 0 ) return true
    if ( g[v] ) return false
    g[v] = true
    for ( i in 0 until n ) {
        if ( e[v][i] && dfs( u[i] ) ) {
            u[i] = v
            return true
        }
    }
    return false
}


Measured memory_bytes: 31264
#include <iostream>
#include <vector>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	
	int s;
	cin >> s;
	
	vector<int> arr;
	arr.push_back(s);
	
	while (true) {
		int l1 = arr[arr.size()-1];
		if (l1 % 2) {
			arr.push_back(l1*3+1);
		} else {
			arr.push_back(l1/2);
		}
		int last = arr[arr.size()-1];
		for (int i=0; i<arr.size()-1; i++) {
			if (last == arr[i]) {
				cout << arr.size() << '\n';
				return 0;
			}
		}
		/*
		for (int i=0; i<arr.size(); i++) {
			cout << arr[i] << ' ';
		}
		cout << '\n';
		*/
	}
	
	return 0;
}	


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef vector<int> intvec;
#define ALL(a) (a).begin(),(a).end()
#define REP(i,a,b) for(int i=(a);i<(b);i++)

int main(void) {
    int n;
    cin >> n;
    
    intvec L(2*n);
    REP(i, 0, 2*n) {
        cin >> L[i];
    }

    sort(ALL(L));

    int sum = 0;
    for (int i=0; i<2*n; i+=2) {
        sum += L[i];
    }
    cout << sum << "\n";

    return 0;
}



Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static StreamReader sr;

        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static long Mod = (long)998244353;
        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var NMK = Sarray();
            var N = NMK[0];
            var M = NMK[1];
            var K = NMK[2];
            var cmb = new Combination(N, Mod);
            var ans = 0L;
            for (var i = 0; i <= K; ++i)
            {
                var t = cmb.nCk((int)N - 1, i) * modpow(M - 1, N - 1 - i, Mod) % Mod;
                t = M * t % Mod;
                ans = (ans + t) % Mod;
            }
            WriteLine(ans);
            //Out.Flush();
        }
        static long modpow(long a, long n, long mod)
        {
            var res = 1L;
            while (0 < n)
            {
                if (n % 2 != 0) res = res * a % mod;
                a = a * a % mod;
                n >>= 1;
            }
            return res;
        }
        public class Combination
        {
            readonly long mod;
            readonly long[] fac, finv, inv;
            public Combination(long n, long mod = 1000000007)
            {
                long max = n + 1;
                this.mod = mod;
                fac = new long[max];
                finv = new long[max];
                inv = new long[max];
                fac[0] = fac[1] = 1;
                finv[0] = finv[1] = 1;
                inv[1] = 1;
                for (int i = 2; i < max; ++i)
                {
                    fac[i] = fac[i - 1] * i % mod;
                    inv[i] = mod - inv[mod % i] * (mod / i) % mod;
                    finv[i] = finv[i - 1] * inv[i] % mod;
                }
            }
            public long nCk(int n, int k)
            {
                if (n < k) return 0;
                if (n < 0 | k < 0) return 0;
                return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
            }
        }
    }
}

Measured memory_bytes: 33080
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	int N, K;
	int L[51];

	cin >> N >> K;
	rep(i, 0, N)
	{
		cin >> L[i];
	}

	sort(L, L + N, greater<int>());

	int ans = 0;
	rep(i, 0, K)
	{
		ans += L[i];
	}

	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0160
AC
"""
import sys
from sys import stdin
from collections import namedtuple
from bisect import bisect_left
input = stdin.readline
price = namedtuple('price', ['size', 'weight', 'cost'])


def main(args):
    prices = [price(60, 2, 600), price(80, 5, 800), price(100, 10, 1000), price(120, 15, 1200),
              price(140, 20, 1400), price(160, 25, 1600), price(float('inf'), float('inf'), 0)]

    while True:
        n = int(input())
        if n == 0:
            break

        s_key = [x.size for x in prices]
        w_key = [x.weight for x in prices]
        total = 0
        for _ in range(n):
            x, y, h, w = map(int, input().split())
            i = bisect_left(s_key, x+y+h)
            j = bisect_left(w_key, w)
            total += prices[max(i, j)].cost

        print(total)



if __name__ == '__main__':
    main(sys.argv[1:])
    

Measured memory_bytes: 8192
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    LL N;cin >> N;
    vector<LL> A(N);
    rep(i,N)cin >> A[i];

    vector<LL> rui(N+1);
    rui[0] = 0;
    rep(i,N){
        rui[i+1] = rui[i] + A[i];
    }

    map<LL,LL> m;
    rep(i,N+1){
        m[rui[i]]++;
    }

    LL ans = 0;

    for(auto t : m){
        LL s = t.S;
        ans += s*(s-1)/2;
    }

    cout << ans << endl;
}


Measured memory_bytes: 15872
using System;
using System.Globalization;
using System.IO.Pipes;
using System.Runtime.InteropServices;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[]  str= Console.ReadLine().Split(' ');
            int a, b;
            a = int.Parse(str[0]);
            b = int.Parse(str[1]);
            if (a%2==1 && b% 2 == 1) Console.WriteLine("Yes");
            else Console.WriteLine("No");
               


        }

    }
}


Measured memory_bytes: 27376
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

ll H, W;
vector<vector<ll>> h_sum, w_sum;
void init(vector<vector<char>>& maze)
{
  for (ll i = 1; i <= H + 1; ++i) {
    ll l = 1, cnt = 0;
    for (ll j = 1; j <= W + 1; ++j) {
      if (maze.at(i).at(j) == '#') {
        for (ll k = l; k < j; ++k) {
          w_sum.at(i).at(k) = cnt;
        }
        cnt = 0;
        l = j + 1;
      }
      else {
        cnt += 1;
      }
    }
  }
  for (ll i = 1; i <= W + 1; ++i) {
    ll l = 1, cnt = 0;
    for (ll j = 1; j <= H + 1; ++j) {
      if (maze.at(j).at(i) == '#') {
        for (ll k = l; k < j; ++k) {
          h_sum.at(k).at(i) = cnt;
        }
        cnt = 0;
        l = j + 1;
      }
      else {
        cnt += 1;
      }
    }
  }
}

int main()
{
  cin >> H >> W;
  h_sum = vector<vector<ll>>(H + 2, vector<ll>(W + 2));
  w_sum = vector<vector<ll>>(H + 2, vector<ll>(W + 2));
  vector<vector<char>> maze(H + 2, vector<char>(W + 2, '#'));
  for (ll i = 0; i < H; ++i) {
    for (ll j = 0; j < W; ++j) {
      cin >> maze.at(i + 1).at(j + 1);
    }
  }
  init(maze);
  ll ans = 0;
  for (ll i = 1; i <= H; ++i) {
    for (ll j = 1; j <= W; ++j) {
      ans = max(ans, h_sum.at(i).at(j) + w_sum.at(i).at(j) - 1);
    }
  }
  cout << ans << "\n";
}


Measured memory_bytes: 67072
def f(x):
    cnt=0
    for i in range(N):
        num=x//F[i]
        if A[i]>num:
            cnt+=A[i]-num
    return cnt

N,K=map(int,input().split())
A=list(map(int,input().split()))
F=list(map(int,input().split()))

A.sort()
F.sort(reverse=True)

low=0
high=10**12+1
while high-low>0:
    mid=(high+low)//2
    xxx=f(mid)
    if xxx<=K:
        high=mid
    else:
        if low==mid:
            low=high
        else:
            low=mid

print(low)

Measured memory_bytes: 119500
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("avx,avx2")
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# include <bits/stdc++.h>

# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
 
template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void setIO(string s = "") {
	// cin.exceptions(cin.failbit); 
	// throws exception when do smth illegal
	// ex. try to read letter into int
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9; 
const int N = 6e5+5;                                         
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
 
int rnd (int l, int r) {
	return uniform_int_distribution<int> (l, r)(gen);
}
int dp[N];
int main () {
	SpeedForce;
	int n;
	cin >> n;
	dp[0] =1;
	for (int s = 0; s < n; ++s) {
		for (int val = 3; val + s <= n; ++val) {
			(dp[val+s] += dp[s]) %= mod;
		}
	}
	cout << dp[n];
	
	
	return Accepted;
}

// B...a


Measured memory_bytes: 3656
let f a b = Printf.sprintf "%dx%d=%d\n" a b (a * b) in
let rec loop2 a b = if b < 10 then (f a b) ^ (loop2 a (b + 1)) else "" in
let rec loop1 a = if a < 10 then (loop2 a 1) ^ (loop1 (a + 1)) else "" in
print_string (loop1 1)

Measured memory_bytes: 2256
#include <iostream>
#include <string>
using namespace std;
unsigned long long N;
string out;
 
int main()
{
    cin>>N;
    out = "";
    while (N>0){
 
        N = N - 1;
        out = char(97 + (N % 26))+out;
        N = N / 26;
    }
 
    cout<<out<<endl;
    return 0;
}

Measured memory_bytes: 3500
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<math.h>
#include<iomanip>
#include<stdio.h>
using namespace std;

int main(){

  int a, b, c, d;
  char x, u, v, w;

  cin >> x >> u >> v >> w;

  a=x-'0';
  b=u-'0';
  c=v-'0';
  d=w-'0';

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

  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

		int W = Integer.parseInt(sc.next());
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());

		System.out.println(Math.max(Math.abs(b - a) - W, 0));
	}
}


Measured memory_bytes: 22736
import scala.math.ceil

object Main extends App {

  val sc = new java.util.Scanner(System.in) 
  val t = Array.fill(5)(sc.nextInt())
  val fractions = t.map(x => x % 10).filter(x => x != 0)
  if (fractions.isEmpty) {
    println(t.sum)
  } else {
    val up = t.map(x => (ceil(x.toDouble / 10) * 10).toInt).sum
    println(up - (10 - fractions.min))
  }
}

Measured memory_bytes: 55764
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int X = in.nextInt();
		in.close();
		if(X == 3 || X == 5 || X == 7) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}

	}

}

Measured memory_bytes: 25300
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

int main()
{
	string str;
	cin >> str;
	if (str[0] == '9' || str[1] == '9')
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return	0;
}

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


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		int n = Integer.parseInt(input);
		
		int size[] = new int[n];
		for(int i = 0; i < n; i++){
			size[i] = Integer.parseInt(br.readLine());
		}
		
		Arrays.sort(size);
		int result = 1;
		for(int i = 1; i < n; i++){
			if(size[i - 1] != size[i]){
				result++;
			}
		}
		
		System.out.println(result);
	}

}


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

string S;

int main() {
    cin >> S;
    string ans = "AC";

    int cnt = 1;

    if (S[0] != 'A') {
        ans = "WA";
    }
    else {
        for (int i = 2; i < S.length()-1; i++) {
            if (isupper(S[i])) {
                if (S[i] != 'C') {
                    ans = "WA";
                }
                cnt++;
            }
        }
    }
    if (cnt != 2) {
        ans = "WA";
    }
    if (isupper(S[S.length()-1]) || isupper(S[1])) {
        ans = "WA";
    }
    
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var x = long.Parse(ReadLine());
        var mod = x % 11;
        x = x / 11 * 2;
        if (mod == 0) { }
        else if (mod < 7) { x++; }
        else { x += 2; }
        WriteLine(x);
    }
}



Measured memory_bytes: 2648
#include <bits/stdc++.h>
using namespace std;
static auto faster_iostream = []() { ios::sync_with_stdio(0); cin.tie(0); return 0; }();
typedef long long ll; typedef long double db;
const int N = 1e5 + 5, M = 1e9 + 7;

int main() {
  int n; cin >> n;
  for (int i = 0; i < n; i++) {
    int x; cin >> x;
    if (x % 2 == 0 && x % 3 && x % 5) {
      puts("DENIED");
      return 0;
    }
  }
  puts("APPROVED");
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians, log10
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul, xor
from copy import copy, deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits
from datetime import date

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A,B,Q=MAP()

S=[0]*(A+2)
for i in range(A):
    S[i+1]=INT()
T=[0]*(B+2)
for i in range(B):
    T[i+1]=INT()
S[-1]=T[-1]=INF

# Si番目の神社から左に一番近い寺
L1=[INF]*(A+2)
# Si番目の神社から右に一番近い寺
R1=[INF]*(A+2)
for i in range(1, A+1):
    idx=bisect_right(T, S[i])-1
    if idx!=0:
        L1[i]=S[i]-T[idx]
    idx=bisect_left(T, S[i])
    if idx!=INF:
        R1[i]=T[idx]-S[i]
# Ti番目の寺から左に一番近い神社
L2=[INF]*(B+2)
# Ti番目の寺から右に一番近い神社
R2=[INF]*(B+2)
for i in range(1, B+1):
    idx=bisect_right(S, T[i])-1
    if idx!=0:
        L2[i]=T[i]-S[idx]
    idx=bisect_left(S, T[i])
    if idx!=INF:
        R2[i]=S[idx]-T[i]

for i in range(Q):
    dist1=dist2=dist3=dist4=INF
    x=INT()
    idx=bisect_right(S, x)-1
    if idx!=0:
        dist1=x-S[idx]
        dist1+=min(L1[idx], R1[idx])
    idx=bisect_left(S, x)
    if idx!=INF:
        dist2=S[idx]-x
        dist2+=min(L1[idx], R1[idx])
    idx=bisect_right(T, x)-1
    if idx!=0:
        dist3=x-T[idx]
        dist3+=min(L2[idx], R2[idx])
    idx=bisect_left(T, x)
    if idx!=INF:
        dist4=T[idx]-x
        dist4+=min(L2[idx], R2[idx])
    print(min(dist1, dist2, dist3, dist4))


Measured memory_bytes: 30124
s = input()

lis = ['A', 'C', 'G', 'T']

n_max = 0
n_acgt = 0
for c in s:
  if c in lis:
    n_acgt += 1
  else:
    if n_acgt > n_max:
      n_max = n_acgt
    n_acgt = 0

if n_acgt > n_max:
      n_max = n_acgt
    
print(n_max)

Measured memory_bytes: 3060