akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;


#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d %d", &a, &b)
#define siii(a, b, c) scanf("%d %d %d", &a, &b, &c)

#define sl(a) scanf("%I64d", &a)
#define sll(a, b) scanf("%I64d %I64d", &a, &b)
#define slll(a, b, c) scanf("%I64d %I64d %I64d", &a, &b, &c)

#define outi(a) printf("%d\n", a)
#define outii(a, b) printf("%d %d\n", a, b)
#define outiii(a, b, c) printf("%d %d %d\n", a, b, c)

#define outl(a) printf("%I64d\n", a)
#define outll(a, b) printf("%I64d %I64d\n", a, b)
#define outlll(a, b, c) printf("%I64d %I64d %I64d\n", a, b, c)

#define cel(n, k) ((n-1)/k+1)
#define sets(a) memset(a, -1, sizeof(a))
#define clr(a) memset(a, 0, sizeof(a))


#define fr(i, n) for(ll i=0; i<n;i++)
#define fr1(i, n) for(ll i=1; i<=n;i++) 

#define readf(f) freopen(f, "r", stdin)
#define writef(f) freopen(f, "w", stdout)

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(v) v.begin(), v.end()

template< class T > T sq(T x) { return x * x; }
template< class T > T gcd(T a, T b) { return (b != 0 ? gcd<T>(b, a%b) : a); }
template< class T > T lcm(T a, T b) { return (a / gcd<T>(a, b) * b); }

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


int main()
{
    // #ifndef LOCAL
    // readf("in.txt");
    // writef("out.txt");
    // #endif

    long long h, total = 0, cnt = 1;

    cin>>h;

    while(h){

        if(h == 1){
            h = 0;
            total++;
        }
        else{
            h /= 2;
            cnt *= 2;
            total += cnt;
        }
    }

    cout<<total<<"\n";   


    return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG //エラーを出すためのおまじない
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
//#include <cstdlib>  // abs() for integer
#include <cmath>    // abs() for float, and fabs()
#include <math.h>
using namespace std;
#define coYES cout << "YES" << endl
#define coNO cout << "NO" << endl
#define coYes cout << "Yes" << endl
#define coNo cout << "No" << endl
#define coyes cout << "yes" << endl
#define cono cout << "no" << endl
//#define cocount cout << count << endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define Cinint(n) int n;\
cin >> n;
#define Cinvecint(a, n) vector<int> a(n);\
for (int i = 0; i < (int)(n); i++) {\
  int num;\
  cin >> num;\
  a.at(i) = num;\
}
#define Cinstring(s) string s;\
cin >>s;


int main() {
  int n;
  cin >> n;
  int count = 0;
  for(int i=1; i<n+1; i++) {
    int j = 1;
    while(i*j <= n-1) {
      count++;
      j++;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("OK");}else{puts("NG");}
#define MAX_N 200005

int main() {
    int k,a,b;
    cin >> k >> a >> b;

    int flag = 0;
    srep(i,a,b+1){
        if(i % k == 0)flag = 1;
    }

    if(flag)yn;
    return 0;
}




Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <map>

using namespace std;

#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) < (b)) ? (b) : (a))
using ll = long long;
using ld = long double;

int const nmax = 100000;
ll dist[1 + nmax];
int ind[1 + nmax], sz[1 + nmax];
bool compare(int x, int y){
  return dist[x] < dist[y];
}

vector<int> g[1 + nmax];
int level[1 + nmax];

ll dfs(int node){
  ll result = level[node];
  for(int h = 0; h < g[node].size(); h++){
    int to = g[node][h];
    level[to] = level[node] + 1;
    result += dfs(to);
  }
  return result;
}

int main()
{
  int n;
  cin >> n;
  map<ll,int> code;
  for(int i = 1; i <= n; i++)
    cin >> dist[i];
  for(int i = 1; i <= n; i++) {
    ind[i] = i;
    sz[i] = 1;
    code[dist[i]] = i;
  }
  sort(ind + 1, ind + n + 1, compare);

  for(int i = n; 1 < i; i--){
    int node = ind[i];
    int far = code[dist[node] + sz[node] - (n - sz[node])];
    if(far == 0){
      cout << "-1";
      return 0;
    } else {
      g[far].push_back(node);
      sz[far] += sz[node];
    }
  }
  ll result = dfs(ind[1]);
  if(dist[ind[1]] == result){
    for(int i = 1;i <= n; i++)
      for(int h = 0; h < g[i].size(); h++)
        cout << i << " " << g[i][h] << '\n';
  } else
    cout << -1;
  return 0;
}


Measured memory_bytes: 17408
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
template<class T>
void dump(vector<T> &vec){
	for(int i=0;i<vec.size();i++){
		cout << vec[i];
		if(i+1<vec.size())cout << ' ';
		else cout << endl;
	}
	return;
}
double f(int n){
	if(n==1){
		return 1.0;
	}else{
		return 1.0 + (2.0*(double)(n+1)/2.0/(double)n)*f(n-1);
	}
}
int N;
double d,x;
int main(){
	cin >> N >> d >> x;
	double D = d+(2.0*(double)N-1.0)/2.0*x;
	printf("%.12f\n",D*f(N));	
	return 0;
}


Measured memory_bytes: 6528
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt(), K = scn.nextInt(), S = scn.nextInt();
		int MAX = 1000000000;
		int[] ans = new int[N];
		if (S == MAX) {
			for (int i = 0; i < N; i++) {
				if (K > 0) {
					ans[i] = S;
					K--;
				} else {
					ans[i] = S-1;
				}
			}
		} else {
			for (int i = 0; i < N; i++) {
				if (K > 0) {
					ans[i] = S;
					K--;
				} else {
					ans[i] = MAX;
				}
			}
		}
		printArrayLine(ans);
	}

	static void printArrayLine(int[] a) {
		int N = a.length;
		for (int i = 0; i < N; i++) {
			System.out.print(a[i] + ((i == N - 1) ? "\n" : " "));
		}
	}

}


Measured memory_bytes: 42948
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
//constexpr ll MOD = 998244353;
//constexpr ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
constexpr ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
#define FINALANS(A) do {cout << (A) << '\n'; exit(0);} while (false)

int main()
{
  vector<ll> A = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

  ll K;
  cin >> K;

  cout << A.at(K - 1) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
int a[20][20],n,m,k,t[20],ans;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
		for(int o=1;o<=n;o++)
			a[i][o]=3;
	for(int i=1;i<=n;i++)
	{
		cin>>m;
		for(int o=1;o<=m;o++)
		{
			cin>>k;
			cin>>a[i][k];
		}	
	}
	while(t[n+1]!=1)
	{
		t[1]++;
		for(int i=1;i<=n;i++)
			if(t[i]==2)
			{
				t[i]=0;
				t[i+1]++;
			}
		bool no=false;
		for(int i=1;i<=n;i++)
		{
			if(t[i]==1)
			{
				for(int o=1;o<=n;o++)
				{
					if(t[o]!=a[i][o] && i!=o && a[i][o]!=3)
					{
						no=true;
						break;
					}
				}
				if(no==true)
					break;
			}
		}
		if(no==false)
		{
			int h=0;
			for(int i=1;i<=n;i++)
				if(t[i]==1)
					h++;
			ans=max(h,ans);		
		}
	}
	cout<<ans<<endl;
} 

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include<limits>
#include<iomanip>
#include<cassert>

using namespace std;

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

#define debug(x) cout << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n-1;i >= 0;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second

const long double pi = 3.141592653589793;
const int mod = 1e9 + 7;

int main() {

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

 ios_base::sync_with_stdio(false);
 cin.tie(NULL);

 int D, CT = 26;
 cin >> D;
 vector<int> C(CT);
 vector<vector<int>> S(D, vector<int>(CT));
 rep(i, CT) cin>>C[i];
 rep(i, D) rep(j, CT) cin>>S[i][j];

 for(int i = 0;i < D;i++) {
   int j = max_element(S[i].begin(), S[i].end()) - S[i].begin();
   cout << j + 1 << endl;
 }


 return 0;
}


Measured memory_bytes: 3620
<?php
# 入力部
// fscanf(STDIN, "%s", $s);
fscanf(STDIN, "%d %d", $n, $r);
// $s1 = fgets(STDIN); //"\n"の2文字
// $s2 = fgets(STDIN);
// fscanf(STDIN, "%d", $n);
// fscanf(STDIN, "%s", $s);
// fscanf(STDIN, "%s", $s2);

# 処理部
// $arr = str_split($s);
// $arr2 = str_split($s2);
// $arr1 = explode(" ", $s1);
// $arr2 = explode(" ", $s2);
// for ($i = 0; $n > $x * $i; $i++) {
// }
// if (strpos($s, 'RRR') !== false) {
//   $r = 3;
// } elseif (strpos($s, 'RR') !== false) {
//   $r = 2;
// } elseif (strpos($s, 'R') !== false) {
//   $r = 1;
// } else {
//   $r = 0;
// }
// $s = "No";
// if ($x >= 30) {
//   $s = "Yes";
// }
// for ($i = 0; $i * 1000 < $n; $i++) {
// }
// $c = "a";
// if (ctype_upper($a)) {
//   $c = "A";
// }
// $s = "Yes";
// echo count($arr1);
// for ($i = 0; $i < strlen($s1); $i++) {
//   if ($arr1[$i] != $arr2[$i]) {
//     $s = "No";
//   }
// }
// $unit;
// switch ($n % 10) {
//   case 0:
//   case 1:
//   case 6:
//   case 8:
//     $unit = "pon";
//     break;
//   case 3:
//     $unit = "bon";
//     break;
//   default:
//     $unit = "hon";
//     break;
// }
// if ($s == "ABC") {
//   $r = "ARC";
// } else {
//   $r = "ABC";
// }
// $r = "NG";
// for ($i = $a; $i <= $b; $i++) {
//   if ($i % $k == 0) {
//     $r = "OK";
//   }
// }
// $r = "safe";
// if ($s <= $w) {
//   $r = "unsafe";
// }
// $r = "No";
// if (strpos($n, "7") !== false) {
//   $r = "Yes";
// }
// $r = "No";
// if ($arr[2] == $arr[3] && $arr[4] == $arr[5]) {
//   $r = "Yes";
// }
// $r = "Yes";
// if ($s == "AAA" || $s == "BBB") {
//   $r = "No";
// }
// if ($n % 2 == 0) {
//   $r = $n / 2;
// } else {
//   $r = ($n + 1) / 2;
// }
if ($n < 10) {
  $r += (10 - $n) * 100;
}


# 出力部
// echo ($n * ($n - 1) / 2) + ($m * ($m - 1) / 2) . "\n";
// echo $z . " " . $x . " " . $y . "\n";
// echo ($i * 1000) - $n . "\n";
echo $r . "\n";


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

using namespace std;

#define INP "solve"
#define OUT "solve"

const int QQ = 3e5 + 10;
const int maxN = 3e5 + 100;
const int maxM = 3e5 + 10;
const long long oo = 1e18;
const int module = 1e9 + 7;
const long double du = 1e-9;

void doc() {
    freopen(INP ".inp","r",stdin);
    freopen(OUT ".out","w",stdout);
}

void solve() {
    int n, K;
    cin >> n >> K;
    map <int, int> M;
    M[0] = 1;
    int S = 0;
    long long T[n + 1];
    T[0] = 0;
    long long Res = 0;
    for (int i = 1; i <= n; i++) {
        int x;
        cin >> x;
        S = (S + x - 1) % K;
        T[i] = S;
        if (i >= K) M[T[i - K]] -= 1;
        Res += M[S]++;
        ///cout << S << " " << Res << '\n';
    }
    cout << Res;
}
int main(int argc,char *argv[]) {
    //srand(time(nullptr));
    ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);
    ///doc();
    solve();
}


Measured memory_bytes: 11264
#include<bits/stdc++.h>
using namespace std;
const int maxn=200010;
int n,a[maxn],b[maxn],tim=0;
vector<pair<int,int> > v(maxn);
void die()
{
	puts("No");
	exit(0);
}
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>v[i].second>>v[i].first;
	sort(v.begin(),v.end());
	for(int i=0;i<v.size();i++)
	{
		tim+=v[i].second;
		if(tim>v[i].first)
			die();
	}
	puts("Yes");
	return 0;
}

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

using namespace std;

int main(){
    char c;
    cin >>c;
    if(c=='a' || c=='i' || c=='u' || c=='e' || c=='o'){
        cout << "vowel" << endl;
    }else{
        cout << "consonant" << endl;
    }

    return 0;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string w;
  cin>>w;
  for(int i=0;i<w.size();i++){
    char c=w.at(i);
    int count=0;
    for(int j=0;j<w.size();j++){
      if(c==w.at(j)){count++;}
    }
    if(count%2!=0){cout<<"No"<<endl;return 0;}
  }
  cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,M;
  cin >> N;
  vector<string> vecs(N);
  for(int i = 0; i < N; i++){
    cin >> vecs.at(i);
  }
  
  cin >> M;
  vector<string> vect(M);
  for(int i = 0; i < M; i++){
    cin >> vect.at(i);
  }
  
  string temp;
  int count=0,total=0,answer=0,judgeval=0,i=0;
  bool judge = false;
  while(N  >= total){
    while(i < N){
      if(i == judgeval){
        temp = vecs.at(i);
      }
      if(vecs.at(i) == temp){
        count++;
      }
      if(judge == 0){
        if(vecs.at(i) != temp){
          judgeval = i;
          judge = true;
        }
      }
    i++;
    }
    total += count;
    for(int j = 0; j < M; j++){
      if(vect.at(j) == temp) count--;
    }
    if(answer < count) answer = count;
    count = 0;
    temp = "";  
    judge = false;
    i = judgeval;

  }
  cout << answer << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
char a[1001][1001];
int x[8]={1,1,0,-1,-1,-1,0,1};
int y[8]={0,-1,-1,-1,0,1,1,1},n=0,m=0;
int main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>a[i][j];
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(a[i][j]=='#'){
                cout<<'#';
            }
            else{
                int num=0;
                for(int m=0;m<8;m++){
                    if(a[i][j]!='.'){
                        continue;
                    }
                    if(a[i+x[m]][j+y[m]]=='#')
                    {
                        num++;
                    }
                }
                cout<<num;
            }
        }
        cout<<endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<set>
#include<string>
using namespace std;
int gcd(int a, int b) {
	int c = a % b;
	while (c != 0) {
		a = b;
		b = c;
		c = a % b;
	}
	return b;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};
typedef long long ll;

const ll M = 1000000007;

vector<ll> fac(300001); //n!(mod M)
vector<ll> ifac(300001); //k!^{M-2} (mod M)

ll mpow(ll x, ll n) {
	ll ans = 1;
	while (n != 0) {
		if (n & 1) ans = ans * x % M;
		x = x * x % M;
		n = n >> 1;
	}
	return ans;
}
ll comb(ll a, ll b) {
	if (a == 0 && b == 0)return 1;
	if (a < b || a < 0)return 0;
	ll tmp = ifac[a - b] * ifac[b] % M;
	return tmp * fac[a] % M;
}
int main() {
	int count = 0;
	char s[22];
	cin >> s;
	for (int i = 0; s[i] != '\0';i++)
		if (s[i] == 'x')
			count++;
	if (count < 8)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define range(i, l, r) for(int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    if (v.size() == 0) return os << "]";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    if (s.begin() == s.end()) return os << "}";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    if (m.begin() == m.end()) return os << "}";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

lint pow(lint num, lint e, lint MOD) {
    lint res = 1;
    lint cur_num = num;
    while (e) {
        if (e & 1) {
            res *= cur_num;
            res %= MOD;
        }
        cur_num *= cur_num;
        cur_num %= MOD;
        e >>= 1;
    }
    return res;
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    string S; cin >> S;
    map<string, string> tomorrow_weather = {
        {"Sunny", "Cloudy"},
        {"Cloudy", "Rainy"},
        {"Rainy", "Sunny"}
    };
    cout << tomorrow_weather[S] << "\n";
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int candy;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO ツ篠ゥツ督ョツ青カツ青ャツつウツづェツつスツδソツッツドツ・ツスツタツブ
		while(read()){
			slove();
		}
	}
	static boolean read(){
		if(!sc.hasNext())
			return false;
		candy = sc.nextInt();
		return true;
	}
	static  void slove(){
		int ans;
		ans = candy%39;
		System.out.print(3+"C");
		
		if(ans > 0 && ans < 10){
			System.out.print(0);
			System.out.println(ans);
		}else if(ans != 0){
			System.out.println(ans);
		}else{
			System.out.println(39);
		}
	}
}

Measured memory_bytes: 11000
require 'set'; require 'prime'
INF=Float::INFINITY
MOD=10**9+7
n,m = gets.chomp.split.map(&:to_i)
a=Set.new
m.times do |i|
  a.add gets.chomp.to_i
end

dp=Array.new(n)
dp[0] = 1
dp[1] = a.include?(1) ? 0 : 1
2.upto(n).each do |i|
  if a.include?(i)
    dp[i] = 0
  else
    dp[i] = (dp[i-1] + dp[i-2]) % MOD
  end
end

puts dp[n] % MOD


Measured memory_bytes: 9596
#include <bits/stdc++.h>
#define LOCAL
using namespace std;
template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
out << "(" << a.first << "," << a.second << ")";
return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
out << "["; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
out << "{"; bool first = true;
for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define int long long
using P = pair<int,int>;
//#########################################
signed main(){
	int h,n;cin >> h >> n;
	vector<int> a(n);
	rep(i,n)cin >> a[i];
	int s = 0;
	rep(i,n)s += a[i];
	cout << (s >= h?"Yes":"No") << endl;
	return 0;
}

Measured memory_bytes: 3896
public class
Main
{
  private static final int N = 999983;

  public void
  run (
    final java.util.Scanner sc,
    final java.io.PrintStream out
    )
  {
    final int[ ] sum = new int[ N + 1 ];
    int i, j;

    java.util.Arrays.fill ( sum, 2, sum.length, 1 );
    for ( i = 2; i * i < sum.length; ++i )
    {
      if ( sum[ i ] == 0 ) continue;
      for ( j = i + i; j < sum.length; j += i )
        sum[ j ] = 0;
    }
    for ( i = 1; i < sum.length; ++i )
      sum[ i ] += sum[ i - 1 ];

    for ( ; ; )
    {
      int res;
      int n;

      n = sc.nextInt ( );
      if ( n == 0 ) break ;

      res = -n;
      for ( i = 0; i < n; ++i )
      {
        int p, m;

        p = sc.nextInt ( );
        m = sc.nextInt ( );
        res += sum[ Math.min ( sum.length - 1, p + m ) ] - sum[ Math.max ( 0, p - m - 1 ) ];
      }
      out.println ( res );
    }
  }

  public static void
  main (
    final String[ ] args
    )
  {
    ( new Main ( ) ).run ( new java.util.Scanner ( System.in ), System.out );
  }
}

Measured memory_bytes: 33252
#include<bits/stdc++.h>
using namespace std;
int main()
{

    long int a,b=0,sum=0;
    cin>>a;
    b=(a%1000);
    if(a%1000!=0)
    {
        sum=1000-b;
        cout<<sum<<endl;
    }

    else
    {
        cout<<0<<endl;
    }
    return 0;

}



Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define sp ' '
#define nyan "(=^・ω・^=)"
#define mkp make_pair
#define intmax 2147483647
#define llmax 9223372036854775807
#define lP pair<ll,ll>
#define iP pair<int,int>
typedef long long ll;
using namespace std;
const int mod = 1000000007;

int K, N, cnt;
int main() {
	cin >> N >> K;
	for (int i = 1; i < N; i += K - 1)
		++cnt;
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef double          D;
typedef long long int   LL;
typedef long double     LD;
#define OR              ||
#define AND             &&
#define nl              '\n'
#define S               string
#define inf             INT_MAX
#define SQR(a)          (a) * (a)
#define pb              push_back
#define GCD(a, b)       __gcd(a, b)
#define PI              2.0*acos(0.0)
#define LCM(a, b)       (a * b) / GCD(a, b)
#define mem(a,b)        memset(a,b,sizeof(a))
#define srtv(v)         sort(v.begin(),v.end())
#define T               int t; cin>>t; while(t--)
#define Rep(i,a,b)      for(int i = a; i <= b; i++)
#define rep(i,a,b)      for(int i = a; i >= b; i--)
#define boost		    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inout           freopen("input.txt","r",stdin);freopen("output.txt","w",stdout)

#define si(x)           scanf("%d",&x)
#define pi(x)           printf("%d",x)
#define ss(str)         scanf("%s",str)
#define pl(x)           printf("%lld",x)
#define sl(x)           scanf("%lld",&x)
#define sii(x,y)        scanf("%d %d",&x,&y)
#define sll(x,y)        scanf("%lld %lld",&x,&y)
#define siii(x,y,z)     scanf("%d %d %d",&x,&y,&z)
#define slll(x,y,z)     scanf("%lld %lld %lld",&x,&y,&z)
using namespace std;



/*
int bs(int l,int r)
{
    int mid,res=inf;

    while(l<=r)
    {
        mid=l+(r-l)/2;

    }

    return res;
}*/

//--------------------------code starts here---------------------------------------
LL a[200005];
deque<LL> dq;


int main()
{
   int n;
   si(n);
   LL mn,mx,x,sum=0;

   Rep(i,1,n)
   {
       sl(a[i]);

   }

   sort(a+1,a+n+1);
   sum+=a[n];
   int count=1;

   for(int i=n-1;i>=1;i--)
   {
       if(count==n-1)
        break;
       sum+=(a[i]);
       count++;

       if(count==n-1)
        break;
       sum+=a[i];
       count++;
   }


   printf("%lld\n",sum);




   return 0;

}



Measured memory_bytes: 5308
#include<bits/stdc++.h>
using namespace std;
int n,x,y,ans[20010];
int main() 
{
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++)
	{
		for(int j=i+1;j<=n;j++)
		{
			if(i<=x)
			{
				if(j<=x)
					ans[j-i]++;
				else if(j<=y)
					ans[min(j-i,(x-i)+1+(y-j))]++;
				else
					ans[x-i+1+j-y]++;
			}
			else if(i<=y)
			{
				if(j<=y)
					ans[min(j-i,i-x+1+y-j)]++;
				else
					ans[min(j-i,j-y+1+i-x)]++;
			}
			else
				ans[j-i]++;
		}
	}
	for(int i=1;i<=n-1;i++)
		cout<<ans[i]<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int s=0,t=0,a,b;
for(int i=0;i<4;i++){
cin >> a;
s+=a;
}
for(int i=0;i<4;i++){
cin >> b;
t+=b;
}
if(s>=t)printf("%d\n",s);
else printf("%d\n",t);
return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef string st;
typedef double db;
typedef vector<long long> vecll;
typedef vector<char> vechar;

int main(){
    ll A, P;
    cin >> A >> P;

    ll apple = (3 * A + P) / 2;
    cout << apple << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    int k,s;
    cin>>k>>s;
    int ans=0;
    for(int i=0;i<=k;i++)
    {
        for(int j=0;j<=k;j++)
        {
            int ij=s-i-j;
            if(ij<=k && ij >=0)ans++;

        }
    }
    cout<<ans<<endl;
}

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

int main() {
	
	string s;
	cin >> s;
	int red = 0, blue = 0;
	rep(i, s.size()){
		if(s[i] == '0') red++;
		else blue++;
	}
	cout << s.size() - max(red - blue, blue - red) << endl;
	
	return 0;
}

Measured memory_bytes: 512
# MM : 1
# YYexcptMM : 2
# NONE : 3


def judge_category(i):
    if(1 <= i and i <= 12):
        return 1
    elif (0 <= i and i <= 99):
        return 2
    else:
        return 3


S = list(input())
left = int(S[0] + S[1])
right = int(S[2] + S[3])

a_l = judge_category(left)
a_r = judge_category(right)

if(a_l == 3 or a_r == 3):
    print("NA")
elif(a_l == 1 and a_r == 1):
    print("AMBIGUOUS")
elif(a_l == 1 and a_r == 2):
    print("MMYY")
elif(a_l == 2 and a_r == 1):
    print("YYMM")
elif(a_l == 2 and a_r == 2):
    print("NA")


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
int main(){
  int N = 0;
  int A = 0;
  bool ok = true;
  std::cin >> N;


  for(int i = 0; i < N; i++){
    std::cin >> A;
    if(A % 2 == 0){
      if( (A % 5 == 0) || (A % 3 == 0) ){
        ok = true;
        continue;
      }
      ok = false;
      break;
    }
  }
  if (ok){
    std::cout << "APPROVED" << std::endl;

  }else {
    std::cout << "DENIED" << std::endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
const long long int mod1=1000000007;
const long long int mod2 = -1;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pp pop_back                                       
#define ff first
#define ss second
#define ll long long int
#define ull unsigned long long int
#define ordered_set tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define ordered1 tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define inf mod1
ll gcd(ll a, ll b){
    ll c;
     while(b){
        c = b;
        b = a % b;
        a = c;
     }
     return a;
}
ll power1(ll a, ll b){
     if(b == 0) return 1;
     else if(b % 2) return a * power1(a, b - 1);
     else {
        ll temp = power1(a, b / 2);
        return temp * temp;
     }
}
ll power2(ll a, ll b, ll m){
     a %= m;
     if(b == 0) return 1;
     else if(b % 2) return (a * power2(a, b - 1, m)) % m;
     else{
        ll temp = power2(a, b / 2, m);
        return (temp * temp) % m;
     }
}
ll mod(ll x, ll p){
return (x % p + p) % p;
}
ll lcm(ll x, ll y){
return (x * y)/gcd(x, y);
}
int main(){
	fast;
	ll h = 1;
	//cin >> h;
    while(h--){
        ll n;
        cin >> n;
        ll p[n], q[n], r[n];
        for(int i = 0; i < n; i++){
            cin >> p[i];
            r[i] = i + 1;
        }
        for(int i = 0; i < n; i++){
            cin >> q[i];
            r[i] = i + 1;
            //cout << r[i] << " ";
        }
        //cout << endl;
        ll r1 = -1, r2 = -1;
        ll cnt = 0;
        while(r1 == -1 || r2 == -1){
            bool f = 1;
            for(int i = 0; i < n; i++){
                if(p[i] != r[i]){
                    f = 0;
                    break;
                }
            }
            if(f){
                r1 = cnt;
                //cout << r1 << endl;
            }
            bool g = 1;
            for(int i = 0; i < n; i++){
                if(q[i] != r[i]){
                    g = 0;
                    break;
                }
            }
            if(g){
                r2 = cnt;
                //cout << r2 << endl;
            }
            cnt ++;
            next_permutation(r, r + n);
        }
       // cout << cnt << endl;
        cout << abs(r1 - r2) << endl;
}
}

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


#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define iout(x) printf("%d\n",x)
#define lout(x) printf("%lld\n",x)
#define REP(x,l,u) for(int x = (l);x<=(u);x++)
#define RREP(x,l,u) for(int x = (l);x>=(u);x--)
#define mst(x,a) memset(x,a,sizeof(x))
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define se second
#define fi first
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define sz(x) ((int)x.size())
#define cl(x) x.clear()

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;

const int maxn = 200010;
const int mod = 1e9+7;
const int MAX = 1000000010;
const double eps = 1e-6;
const double PI = acos(-1);

template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}

template<typename A,typename B> inline void read(A&x,B&y){read(x);read(y);}
template<typename A,typename B,typename C> inline void read(A&x,B&y,C&z){read(x);read(y);read(z);}
template<typename A,typename B,typename C,typename D> inline void read(A&x,B&y,C&z,D&w){read(x);read(y);read(z);read(w);}
template<typename A,typename B> inline A fexp(A x,B p){A ans=1;for(;p;p>>=1,x=1LL*x*x%mod)if(p&1)ans=1LL*ans*x%mod;return ans;}
template<typename A,typename B> inline A fexp(A x,B p,A mo){A ans=1;for(;p;p>>=1,x=1LL*x*x%mo)if(p&1)ans=1LL*ans*x%mo;return ans;}

int n;

int A[maxn],B[maxn],f[maxn];

int main(){
	read(n);
	REP(i,1,n)read(A[i]),B[A[i]]=i;
	int ans=1;
	REP(i,1,n){
		f[i]=1;
		if(B[A[i]-1]<i)f[i]=f[B[A[i]-1]]+1;
		ans=max(ans,f[i]);
	}
	cout<<n-ans<<endl;
	return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <tuple>
#include <cassert>
#include <exception>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
static const int INF = 1e+9+7;
ll n,m,l;
string s,t;
int d[200010],dp[1010][1010];
double w[1000],v[1000];
double box[200010];
char field[200][200];

int main(){
  while(1){
    cin >> n;
    if(!n)break;
    vi vec;
    rep(i,0,n){
      cin >> l;
      vec.pb(l);
    }
    sort(all(vec));
    ll ans = INF;
    rep(i,0,vec.sz-1){
      if(abs(vec[i]-vec[i+1]) < ans){
        ans = abs(vec[i]-vec[i+1]);
      }
    }
    print(ans);
  }
  return 0;
}


Measured memory_bytes: 3172
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;

public class Program
{

    public void Proc()
    {
        this.Ekicount = int.Parse(Reader.ReadLine());
        this.EkiInfo = new int[this.Ekicount][];

        for (int i = 0; i < Ekicount-1; i++) {
            this.EkiInfo[i] = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
        }

        List<long> ans = new List<long>();
        for (int i = this.Ekicount - 1; i >= 0; i--) {
            ans.Add(GetAns(i, 0));
        }
        ans.Reverse();
        StringBuilder txt = new StringBuilder();
        ans.ForEach(a=>txt.AppendLine(a.ToString()));
        Console.Write(txt.ToString());
    }

    private Dictionary<int, Dictionary<int, long>> dic = new Dictionary<int, Dictionary<int, long>>();

    private long GetAns(int ekiNum, int startTime) {
        if(ekiNum == this.Ekicount-1) {
            return startTime;
        }

        int first = this.EkiInfo[ekiNum][1];
        int interval = this.EkiInfo[ekiNum][2];
        int nextMove = this.EkiInfo[ekiNum][0];

        int subStart = Math.Max(startTime, first);
        if(subStart%interval != 0) {
            subStart += interval - (subStart % interval);
        }
        if (!dic.ContainsKey(ekiNum))
        {
            dic.Add(ekiNum, new Dictionary<int, long>());
        }
        if (dic[ekiNum].ContainsKey(subStart))
        {
            return dic[ekiNum][subStart];
        }

        long ans = GetAns(ekiNum + 1, subStart + nextMove);
        dic[ekiNum][subStart] = ans;
        return ans;
    }

    private int[][] EkiInfo;

    private int Ekicount;

    public class Reader
    {
        private static StringReader sr;
        public static bool IsDebug = false;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (sr == null)
                {
                    sr = new StringReader(InputText.Trim());
                }
                return sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        private static string InputText = @"




3
6 5 1
1 10 1



";
    }

    public static void Main(string[] args)
    {
#if DEBUG
        Reader.IsDebug = true;
#endif
        Program prg = new Program();
        prg.Proc();
    }
}


Measured memory_bytes: 26072
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const int N=1e5+5;
ll dp[N]={-1},v[N],k,n;
const int inf=0x3f3f3f3f;
ll check(int index);


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
ll i,j,m;
memset(dp,-1,sizeof(dp));
    cin>>n>>k;
    for(i=0;i<n;i++)
        cin>>v[i];
    cout<<check(0)<<"\n";

    return 0;
}

ll check(int index){
    if(index>=n)return inf;
    else if(dp[index]!=-1)return dp[index];

    else if(index==n-1)return dp[index]=0;
    ll var=inf;
    for(int i=index+1;i<=min(n-1,k+index);i++)
        var=min(var,abs(v[index]-v[i])+check(i));
    return dp[index]=var;
}

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

string t[30][30];

int main() {
    int h, w;
    cin >> h >> w;
    char a1 = 'A';
    int a2=0;
    rep(i, h) rep(j, w) {
        cin >> t[i][j];
        if (t[i][j] == "snuke") {
            a1 += j;
            a2 = i+1;
        }
    }
    cout << a1 << a2 << endl;
}


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

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 1000100
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()


template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }


void solve(void)
{
  int n;cin>>n;
  vector<int> vec (n,0);
  for (int i = 0; i < n; i++)
  {
    cin>>vec[i];
    if(i != 0)
    vec[i] += vec[i-1];
  }
  int i1 = 0;
  int i2 = 1;
  int i3 = 2;
  int res = INF;
  while(i2 < n-2)
  {
    while(i1 < i2 - 1)
    {
      if(abs(vec[i1] - (vec[i2] - vec[i1])) > abs(vec[i1+1] - (vec[i2] - vec[i1+1])) )
      i1 ++;
      else
      {
        break;
      }
    }

    while(i3 < n - 2)
    {
      if(abs(vec[n-1] - vec[i3] - (vec[i3] - vec[i2])) >abs(vec[n-1] - vec[i3+1] - (vec[i3+1] - vec[i2])) )
      i3 ++;
      else
      {
        break;
      }
    }
    int p1 = vec[i1];
    int p2 = vec[i2] - vec[i1];
    int p3 = vec[i3] - vec[i2];
    int p4 = vec[n-1] - vec[i3];
    int m1 = max(max(p1,p2),max(p3,p4));
    int m2 = min(min(p1,p2),min(p3,p4));
    chmin(res,m1 - m2);
    i2++;
  }
  cout<<res<<endl;

  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 4788
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define r0 return 0;
#define f(k,i,n,j) for(ll k=i;k<=n;k=k+j)
#define cin(a) cin>>a;
#define loop while(t--)
#define vi vector<int>
#define vii vector<long long int>
#define SORT(v) sort(v.begin(),v.end());
#define mod (1e9+7)
#define crap ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl "\n"
signed main()
{
    crap;
    int n,r;
    cin>>n>>r;
    if(n>=10)
    cout<<r<<endl;
    else
    {
        cout<<r+(100*(10-n))<<endl;
    }
}

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

int main() {
  int a,b,c,d;
  
  cin >> a >> b >> c >> d;
  if (a+b>c+d) 
    cout << "Left" << endl;
  else if(a+b==c+d)
    cout << "Balanced" << endl;
  else
    cout << "Right" << endl;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

int main() {
    fastio();
    int n;
    cin >> n;
    cout << (n + 1) / 2 << endl;

    return 0;
}

Measured memory_bytes: 256
a,b,x= input().split()
a= float(a)
b= float(b)
x= float(x)

import math

upper = b - (x / a / a)
under = a/2
if upper <= (b/2):
    print(math.degrees(math.atan(upper/under)))
else:
    print(math.degrees(math.atan(b/(2*x/a/b))))

Measured memory_bytes: 40528
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  vector<int>p(n);
  for (int i=0; i<n; i++){
    cin >> p[i];
  }
  
  sort(p.begin(),p.end());
  
  int ans=0;
  for (int j=0; j<k; j++){
    ans += p[j];
  }
  cout << ans;
}

Measured memory_bytes: 3632
import itertools

n = int(input())

p = list(map(int,input().split()))
q = list(map(int,input().split()))

p_s = tuple(p)
q_s = tuple(q)


base = list(itertools.permutations(set(p)))
a = base.index(p_s) + 1
b = base.index(q_s) + 1
print(abs(a-b))

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

int main() {
  string s;
  cin>>s;
  int N=s.size();
  int zero=0,one=0;
  for(int i=0;i<N;i++){
    if(s.at(i)=='0')
      zero++;
    else
      one++;
  }
  int ans=N-abs(zero-one);
  cout<<ans<<endl;
}


Measured memory_bytes: 3768
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
	double W, H, x,y;
	scanf("%lf%lf%lf%lf", &W, &H, &x,&y);
	
	if (x == W / 2.0 && y == H / 2.0)printf("%f 1", (W*H) / 2.0);
	else printf("%f 0", (W*H) / 2.0);

	
	

}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define N 501
#define INF 1e9
using namespace std;
typedef pair<int,int> P;
vector<P> G[N];



int dijkstra(int s,int g){
  int D[N];
  for(int i=0;i<N;i++) D[i]=INF;
  priority_queue<P,vector<P>,greater<P> > Q;
  Q.push(P(0,s));
  D[s]=0;
  while(!Q.empty()){
    P t=Q.top();Q.pop();
    int cost=t.first, pos=t.second;
    if(pos==g) return cost;
    if(D[pos]<cost) continue;
    
    for(int i=0;i<G[pos].size();i++){
      int nx=G[pos][i].first;
      int ncost=cost+G[pos][i].second;
      if(D[nx]>ncost) Q.push(P(ncost,nx)),D[nx]=ncost;
    }
  }
  cout<<"OK"<<endl;
  return -1;
}


int main(){
  while(1){
  int n,m;
  cin>>n>>m;
  if(!n&&!m)break;
  string s,p,g;
  cin>>s>>p>>g;
  map<string,int> M;
  for(int i=0;i<N;i++) G[i].clear();
  for(int i=0,d,t,cnt=0;i<m;i++) {
    string a,b;
    cin>>a>>b>>d>>t;
    if(!M.count(a)) M[a]=cnt++;
    if(!M.count(b)) M[b]=cnt++;
    G[M[a]].push_back(P(M[b],d/40+t));
    G[M[b]].push_back(P(M[a],d/40+t));
  }
  int ans= dijkstra(M[s],M[p]);
  ans=ans+dijkstra(M[p],M[g]);

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

Measured memory_bytes: 3336
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int x;
  cin >> x;
  int g = gcd(x, 360);
  int ans = 360/g;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

signed main(){

  int n; cin >> n;
  vector<int> d(n);
  for(int i = 0; i < n; i++) cin >> d[i];

  int ans = 0;
  for(int i = 0; i < n; i++){
    for(int j = i+1; j < n; j++){
      ans += d[i] * d[j];
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
function main(input) {
  const lines = input.trim().split("\n");
  const S = lines[0];
  const T = lines[1];

  const res = T.match(new RegExp('^' + S + '.$')) ? 'Yes' : 'No';
  
  console.log(res);
}

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

Measured memory_bytes: 29588
#!/usr/bin/env python3
def main():
    N, A, M = map(int, input().split())

    ans = 0
    loop = set([A])
    lst = [A]
    for _ in range(N):
        ans += A
        A = pow(A, 2, M)
        if A in loop:
            loop_start = lst.index(A)
            loop_sum = sum(lst[loop_start:])
            loop_length = len(lst[loop_start:])
            a = sum(lst[:loop_start])
            b = loop_sum * ((N - loop_start) // loop_length)
            c = sum(lst[loop_start:loop_start + ((N - loop_start) % loop_length)])
            ans = a + b + c
            break
        else:
            loop.add(A)
            lst.append(A)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 13340
n = int(input())
s1 = 0
s2 = 0
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float,input().split())
    if abs((x2-x1)*(y4-y3)-(x4-x3)*(y2-y1)) <= 10**(-10): print("YES")
    else: print("NO")


Measured memory_bytes: 5628
N, M = map(int,input().split())
H = list(map(int, input().split()))
A_B = [list(map(int,input().split())) for i in range(M)]

ans_label = [1]*len(H)

new_A_B = []

for ele in A_B:
    if H[ele[0]-1] < H[ele[1]-1]:
        new_A_B.append(ele[0])
    elif H[ele[0]-1] > H[ele[1]-1]:
        new_A_B.append(ele[1])
    else:
        new_A_B.append(ele[0])
        new_A_B.append(ele[1])

# A_B = [[ele[0],ele[1]] if H[ele[0]-1] < H[ele[1]-1] else [ele[1],ele[0]]for ele in A_B]

# A_B.sort(key=lambda x: x[0])

for ele in new_A_B:
    ans_label[ele-1] = 0

# print(ans_label)

print(sum(ans_label))

Measured memory_bytes: 32724
//In the name of Allah :)
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 2e5 + 10 , MOD = 1e9 + 7;


int main(){
	ios_base::sync_with_stdio(NULL);cin.tie(nullptr);cout.tie(nullptr);
        int n;
        string str;
        cin >> n >> str;
        if(str.size() <= n) return cout << str << '\n' , 0;
        str.resize(n);
        cout << str << "...\n";
}


Measured memory_bytes: 3644
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

using namespace std;

string sort_str(string s){

  int n = (int)s.length();

  for(int i = 0; i < n ; ++i){
    for(int j = n - 1; j > i; --j){
      if(s[j] < s[j - 1]){
        char temp = s[j];
        s[j] = s[j - 1];
        s[j - 1] = temp;
      }
    }
  }

  return s;
}

int main(){
  int n;
  long long res = 0;
  cin >> n;
  vector<string> v;
  string in_str;
  for(int i = 0; i < n; ++i){
    cin >> in_str;
    v.push_back(sort_str(in_str));
  }

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

  long long count = 1;
  for(int i = 0; i < n - 1; ++i){
    if(v[i] == v[i+1]){
      ++count;
    }else{
      res += count * (count - 1) / 2;
      //count reset
      count = 1;
    }

    if(i == n - 2){
      res += count * (count - 1) / 2;
    }
  }

  cout << res << endl;
  return 0;
}


Measured memory_bytes: 5748