akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<queue>
#include<vector>
#include<algorithm>
#include<map>
#include<cstdio>
#define F first
#define S second
#define INF 1<<30
using namespace std;
typedef pair<int,int> P;
int n,m;
int prim();
main(){
  while(1){
    cin>>n;
    if(n==0)break;
    cin>>m;
    cout<<prim()/100-(n-1)<<endl;
  }
}
int prim(){
  vector<P> cost[111];
  bool used[111];
  int ans=0;
  int from,to,mm;
  for(int i=0;i<m;i++){
    scanf("%d,%d,%d",&from,&to,&mm);
    cost[from].push_back(P(to,mm));
    cost[to].push_back(P(from,mm));
  }
  for(int i=0;i<111;i++){
    used[i]=false;
  }
  priority_queue< P ,vector<P>,greater<P> > q;
  q.push(P(0,0));
  while(!q.empty()){
    P p=q.top();
    q.pop();
    if(used[p.S]==true){
      continue;
    }
    used[p.S]=true;
    ans+=p.F;
    for(int i=0;i<cost[p.S].size();i++){
      q.push(P(cost[p.S][i].S,cost[p.S][i].F));
    }
  }
  return ans;
}

Measured memory_bytes: 1540
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, s, n)    for (i64 i = (s), i##_limit = (n); i < i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define VAR(type, ...)  type __VA_ARGS__; read(__VA_ARGS__);
#ifndef DBG
#define dump(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> makeV(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto makeV(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(makeV<T>(initValue, args...))>(sz, makeV<T>(initValue, args...));
}

template <class T>
inline istream& operator>> (istream &is, vector<T> &vec) {
    for (auto &e : vec) is >> e;
    return is;
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail&... tail) { cin >> head; read(tail...); }

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &os, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) os << e << delim[&e == &vec.back()];
    return os;
}
// }}} End Header

// Make PrimeTable [0, N] in Compile Time.
template<size_t N> struct Eratosthenes { // {{{

    bool isPrime[N+1] {};

    explicit Eratosthenes() {
        if (N < 2) return;
        isPrime[2] = true;
        for (int i = 3; i <= N; i += 2) isPrime[i] = true;
        for (int i = 3; i*i <= N; i += 2) {
            if (isPrime[i]) for (int k = i*i; k <= N; k += i) isPrime[k] = false;
        }
    }

    vector<int> primes(size_t n = N) const {
        if ((n = min(n,N)) < 2) return {};
        vector<int> a { 2 };
        for(int i=3; i <= n; i+=2) if (isPrime[i]) a.push_back(i);
        return a;
    }

    bool operator[] (size_t i) const { return isPrime[i]; }

}; // }}}

Eratosthenes<1000010> prime;

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

    VAR(int, N);

    vector<int> ans(N);
    int n = 2;
    rep(i, 0, N) {
        while (!prime[n] || n % 5 != 1) ++n;
        ans[i] = n;
        ++n;
    }

    print(ans);

    return 0;
}


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

using namespace std;

typedef pair<int, int> II;
typedef vector<II> VII;
typedef vector<int> VI;
typedef vector<VI> VVI;

typedef long long int LL;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(), a.end()
#define SET(a, b) memset(a, b, sizeof(a))
#define si(n) scanf("%d", &n)
#define dout(n) printf("%d\n", n)
#define sll(n) scanf("%lld", &n)
#define lldout(n) printf("%lld\n", n)

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1 << std::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...);
}
#else
#define trace(...)
#endif

#define fast_io                     \
  ios_base::sync_with_stdio(false); \
  cin.tie(NULL)

#define endl '\n'

constexpr int N = 100001;

VII g[N];
int vis[N];

void dfs(int u, int len) {
  if (vis[u])
    return;
  vis[u] = 1 + len;
  for (auto c : g[u]) {
    int cn = c.F;
    int cw = c.S;
    dfs(c.F, (c.S + len) % 2);
  }
}
int main() {
  fast_io;
  int n;
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    g[u].PB({v, w});
    g[v].PB({u, w});
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++) {
    cout << vis[i] - 1 << endl;
  }
  return 0;
}


Measured memory_bytes: 7680
// https://beta.atcoder.jp/contests/abc107

#define SUBMIT
#define DEBUG

#include <utility>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <sstream>
#include <map>

using namespace std;
using ui64 = unsigned long long;
using i64 = long long;

int main() {
#ifdef SUBMIT
    auto& stream = cin;
#else
    string program_input_str = R"(1 2 3 4
6 7 8 0
5 10 11 12
9 13 14 15
)";
    stringstream stream(program_input_str);
#endif
    int N, i;
    stream >> N >> i;

    cout << (N - i + 1) << endl;
    return 0;
}


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

const int N = 310;

typedef pair<int, int> P;
typedef long long LL;

int G[2][N * 2][N * 2], n;

vector<P> dir;

void dfs(int x, int y, int t) {
    for (auto v : dir) {
        int tx = x + v.first, ty = y + v.second;
        if (tx > n * 2 || ty > n * 2 || tx < 1 || ty < 1 || G[t][tx][ty]) continue;
        G[t][tx][ty] = 3 - G[t][x][y], dfs(tx, ty, t);
    }
}

void Just_DOIT(int t, int d) {
    dir.clear();
    for (int i = 0; i < 2 * n; i++)
        for (int j = 0; j < 2 * n; j++)
            if ((LL)i * i + (LL)j * j == d) 
                for (int t = 0; t < 4; t++) 
                    dir.push_back(P(t & 1 ? i : -i, t & 2 ? j : -j));
    for (int i = 1; i <= n * 2; i++)
        for (int j = 1; j <= n * 2; j++) if (!G[t][i][j]) 
            G[t][i][j] = 1, dfs(i, j, t);
}

vector<P> fuck[4];

int main() {
    int d1, d2; scanf("%d%d%d", &n, &d1, &d2);
    Just_DOIT(0, d1), Just_DOIT(1, d2);
    for (int i = 1; i <= n * 2; i++)
        for (int j = 1; j <= n * 2; j++)
            fuck[G[0][i][j] + G[1][i][j] * 2 - 3].push_back(P(i, j));
    for (int i = 0; i < 4; i++) if (fuck[i].size() >= n * n) {
        for (int j = 0; j < n * n; j++) printf("%d %d\n", fuck[i][j].first - 1, fuck[i][j].second - 1);
        return 0;
    }
}

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

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

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


const long long int mod = 1000000007;
const long long int INF = 1e18;
long long int N,K,l[234500],sum=0;
pll key[1005];
string str[1234];
int main()
{
    cout << fixed << setprecision(18);
    cin>>N;
    sum=(N/11)*2;
    N%=11;
    if(N==0){
        cout<<sum<<endl;
    }else if(N<=6){
        cout<<sum+1<<endl;
    }else{
        cout<<sum+2<<endl;
    }
}


Measured memory_bytes: 256
#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>
using lll = long long;
using ull = unsigned long long;
using namespace std;



int main(){
  lll ii,jj,kk;
  lll n,k,q;
  cin >> n >> k >> q;
  vector<lll> score,a;
  
  score.resize(n+1);
  for(ii=1;ii<=n;ii++){
    score[ii] = k;
  }
  a.resize(q);

  for(ii=0;ii<q;ii++){
    cin >> a[ii];
  }

  for(ii=0;ii<q;ii++){
    score[a[ii]] += 1;
  }

  for(ii=1;ii<=n;ii++){
    score[ii] -= q;
  }

  for(ii=1;ii<=n;ii++){
    if(score[ii] >=1){
      cout << "Yes" << endl;      
    }
    else{
      cout << "No" << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 2176
<?php
fscanf(STDIN, "%d%d", $N, $A);
$xArray = array_map("intval", explode(" ", trim(fgets(STDIN))));
$dp[0][0] = 1;
foreach($xArray as $i => $x){
  $x-=$A;
  foreach($dp[$i] as $v => $c){
    if(!isset($dp[$i+1][$v]))$dp[$i+1][$v] = 0;
    if(!isset($dp[$i+1][$v+$x]))$dp[$i+1][$v+$x] = 0;
    $dp[$i+1][$v] += $c;
    $dp[$i+1][$v+$x] += $c;
  }
}
echo $dp[$N][0] - 1;


Measured memory_bytes: 5112
import java.util.*;
public class Main
{
  public static void main(String[] args)
  {
    	Scanner s=new Scanner(System.in);
    	int n=s.nextInt();
    	int x=s.nextInt();
    	int t=s.nextInt();
    	int k=(int)(t*Math.ceil((double)n/x));
    	System.out.println(k);
  }
}

Measured memory_bytes: 35712
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(25) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 5100000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
lli gcd(lli num1, lli num2){
    return num2 != 0 ? gcd(num2, num1 % num2) : num1;
}
lli lcm(lli num1, lli num2){
    return num1 / gcd(num1, num2) * num2;
}
int main(){
  lli A,B,C,D,E,F,N,M,K,L,R,X,Y,Z,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> A >> B;
  Out(lcm(A,B));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef struct Node
{
    int value;
    Node *parent, *left, *right;
} Node;

Node *root, *NIL;

void Insert(int k)
{
    Node *y = NIL;
    Node *x = root;
    Node *z;

    z = (Node *)malloc(sizeof(Node));
    z->value = k;
    z->left = NIL;
    z->right = NIL;

    while (x != NIL) {
        y = x;
        if (z->value < x->value) {
            x = x->left;
        } else {
            x = x->right;
        }
    }
    z->parent = y;
    if (y == NIL) {
        root = z;
    } else {
        if (z->value < y->value) {
            y->left = z;
        } else {
            y->right = z;
        }
    }
}
void inorder(Node *u)
{
    if (u == NIL) return;
    inorder(u->left);
    cout << " " << u->value;
    inorder(u->right);
}
void preorder(Node *u)
{
    if (u == NIL) return;
    cout << " " << u->value;
    preorder(u->left);
    preorder(u->right);
}

int main(void)
{
    int n, i, x;
    string com;

    cin >> n;

    for (i = 0; i < n; ++i) {
        cin >> com;
        if (com == "insert") {
            cin >> x;
            Insert(x);
        } else if (com == "print") {
            inorder(root);
            cout << endl;
            preorder(root);
            cout << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 26584
#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <queue>
#include <cmath>
#include <cstring>
using namespace std;

#ifdef ENABLE_LL
#define int long long
#endif

#ifdef ENABLE_LL
#define I "%lld"
#define II "%lld%lld"
#define III "%lld%lld%lld"
#define IIII "%lld%lld%lld%lld"
#define IN "%lld\n"
#define IIN "%lld%lld\n"
#define IIIN "%lld%lld%lld\n"
#define IIIIN "%lld%lld%lld%lld\n"
#else
#define I "%d"
#define II "%d%d"
#define III "%d%d%d"
#define IIII "%d%d%d%d"
#define IN "%d\n"
#define IIN "%d%d\n"
#define IIIN "%d%d%d\n"
#define IIIIN "%d%d%d%d\n"
#endif

#ifdef __LOCALE__
#define see(a) std::cout << #a << "=" << a << std::endl
#define ses(a) std::cout << #a << "=" << a << " " 
#else
#define see(a) //std::cout << #a << "=" << a << std::endl
#define ses(a)
#endif
#define repe(a,b) for (int a=0;a<(int)b.size();a++)
#define rep(i,n) for (int i=0;i<n;i++)
#define repa(i,n) for (int i=1;i<=n;i++)
#define repi(i,a,b) for (int i=a;i<=b;i++) 
#define repb(i,a,b) for (int i=a;i>=b;i--)
typedef pair < int , int > pr;
typedef pair < pr  , int > prr;
#define L first
#define R second
template <class T> inline bool checkMin(T& a , T b) { return (a > b ? a=b,1 : 0); }
template <class T> inline bool checkMax(T& a , T b) { return (a < b ? a=b,1 : 0); }
class Scanner{ private: istream& ist;public: Scanner(istream& in):ist(in){} string next(){ string r; ist >> r; return r; } string nextLine(){ string r; getline(ist,r); return r; } int nextInt(){ int r; ist >> r; return r; } double nextDouble(){ double r; ist >> r; return r; }};
Scanner sc(cin);

const double pi = acos(-1);

void init() {
     
}

void solve() {
    see(pi);
    int a, b, h, m; cin >> a >> b >> h >> m;
    double rh = pi * h / 6 + pi * m / 30 / 12;
    double rm = pi * m / 30;
    double del = abs(rh - rm);
    see(del / pi * 180);
    see(cos(del));
    printf("%.12lf", sqrt(a*a + b*b - 2*cos(del)*a*b));
}


#ifdef ENABLE_LL
#undef int
#endif
int main(){
    init();
    solve();
    return 0;
}

Measured memory_bytes: 4160
#include <stdio.h>

int main(void)
{
	int a,b,menseki,mawari;

	scanf("%d",&a);
	
	scanf("%d",&b);
	
	menseki=a*b;
	mawari=2*a+2*b;
	
	printf("%d %d\n",menseki,mawari);
		
	return 0;
}


Measured memory_bytes: 2608
//  cout << char(i+48) << endl;//なぜかaは47と得る時がある。+48で出力もaにできる。
//  cout << char(97) << endl;//アスキーコードでaを出力
// sort(b.begin(), b.end());//bという配列を小さい方からソート
// reverse(b.begin(), b.end());//bという配列をリターン
// 10桁でdouble出力するパターン１ 
// printf("%.10f\n", ma);
// 10桁でdouble出力するパターン２
//cout << fixed << setprecision(10);
//  cout << ma << endl;

/*01 02 03 12 13 23　と６回見ていくパターン 
for(int i=0;i<n-1;i++){
  for(int j=i+1;j<n;j++){
    }
  }
*///vector<vector<int>> data(3, vector<int>(4));//int型の2次元配列(3×4要素の)の宣言
//int64_t a;
//10のi乗pow(10, i);
/*string s; stringでの文字列を数字型に変える方法
  cin >> s;
  rep(i,s.size()-2) {
  int a= (s.at(i)-'0')*100 + (s.at(i+1)-'0')*10+ s.at(i+2) -'0';
    */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int n,x;
  cin >> n >> x;
  vector<int>m(n);
  int mi = 100010;
  rep(i,n) cin >> m.at(i);
  rep(i,n) x -= m.at(i);
  rep(i,n) mi = min(mi,m.at(i));
  cout << n + x / mi << endl;
}

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

#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

using namespace std;

typedef long long LL;

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "[ ";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "]";

    return os;
}

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

    int A, B;
    cin >> A >> B;

    cout << ceil(float(B - 1) / (A - 1)) << endl;

}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	unsigned long int a, b, c;
	char s[100];
	int i;

	scanf("%ld", &a);

		scanf("%s", &s);
		for (i = 0; i < 100; i++) {
			if (s[i] == '\0') {
				break;
			}
		}

	if (i <= a) {
		printf("%s", s);
	}

	else {
		for (i = 0; i < a; i++) {
			printf("%c", s[i]);
		}
		printf("...");
	}
	
	return 0;
}

Measured memory_bytes: 2144
//#include<cstdio>
//#include<cstdlib>
#include <iostream>
#include <vector>
#include <queue>
//#include<bitset>
//#include<string>
//#include<stack>
//#include<set>
//#include<unordered_set>
//#include<map>
//#include<unordered_map>
//#include<cstring>
//#include<complex>
//#include<cmath>
//#include<iomanip>
//#include<numeric>
#include <algorithm>
#include <stdio.h>
//#include<list>
//#include<functional>
//#include<cassert>
using namespace std;
#define ll long long int
#define llu unsigned long long int
void pv(vector<ll> arr, ll size)
{

    for (ll i = 0; i < size; i++)
    {
        cout << arr[i] << ' ';
    }
}
void gv(vector<ll> &arr)
{
    ll size = arr.size();
    for (ll i = 0; i < size; i++)
    {
        cin >> arr[i];
    }
}
int main(void)
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n, k;
    cin >> n >> k;
    vector<ll> arr(n), dp(n);
    gv(arr);
    dp[n - 1] = 0;
    // dp[n - 2] = abs(arr[n - 1] - arr[n - 2]);
    for (ll i = n - 2; i >= 0; i--)
    {
        dp[i] = INT32_MAX;
        for (ll j = i + 1; (j <= i + k) && j < n; j++)
            dp[i] = min(dp[i], dp[j] + abs(arr[j] - arr[i]));
    }
    cout << dp[0];
    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<deque>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef pair<int,int> P;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main(){
    int n;
    cin >> n;
    int a[n];
    rep(i,n) cin >> a[i];

    int cnt=0;
    rep(i,n){
        if(a[i]<0) cnt++;
    }

    ll sum=0;
    rep(i,n){
        sum += (ll)abs(a[i]);
    }

    ll minimum=LINF;
    rep(i,n) minimum = min(minimum,(ll)abs(a[i]));

    if(cnt%2==0){
        cout << sum << endl;
    }else{
        cout << ll(sum-2*minimum) << endl;
    }

}

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

const int SIZE=4010;
using Bit=bitset<SIZE>;

using ll=long long;
const ll MOD=998244353;

ll powm(ll x,ll k){
    ll res=1;
    while(k){
        if(k&1) res=res*x%MOD;
        x=x*x%MOD;
        k>>=1;
    }
    return res;
}
int main(){
    int n;
    Bit x;
    cin>>n>>x;
    vector<Bit> a(n);
    for(int i=0;i<n;i++) cin>>a[i];
    auto baseId=[&](){
        int id=-1;
        for(int i=0;i<n;i++){
            if(a[i]==0) continue;
            if(id==-1){
                id=i;
                continue;
            }
            for(int j=SIZE-1;j>=0;j--){
                if(a[id][j] && !a[i][j]){
                    id=i;
                    break;
                }
                if(!a[id][j] && a[i][j]) break;
            }
        }
        return id;
    };
    auto topBit=[&](int id){
        for(int i=SIZE-1;i>=0;i--){
            if(a[id][i]){
                return i;
            }
        }
        return -1;
    };
    for(int i=SIZE-1;i>=0;i--){
        int bid=baseId();
        int top=topBit(bid);
        if(i<top) break;
        bool delt=false;
        for(int j=0;j<n;j++){
            if(j!=bid && a[j][i]){
                delt=true;
                a[j]^=(a[bid]<<(i-top));
            }
        }
        if(delt) i++;
    }

    ll res=0;
    int bid=baseId();
    int top=topBit(bid);
    Bit base=a[bid];    
    for(int i=SIZE-1;i>=top;i--){
        if(x[i]) res=(res+powm(2,i-top))%MOD;
    }
    Bit v;
    for(int i=SIZE-1;i>=top;i--){
        if(x[i]^v[i]) v^=(base<<(i-top));
    }
    for(int i=SIZE-1;i>=0;i--){
        if(!x[i] && v[i]){
            break;
        }
        if(x[i] && !v[i]){
            res++;
            break;
        }
        if(i==0) res++;
    }
    res%=MOD;
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 1000000009
#define rep(i,n) for (ll i = 0; i < n; i++)
#define  pb push_back
#define mp make_pair

 int main(){
    ios::sync_with_stdio(false);
  cin.tie(0);
  ll t;
  cin>>t;
  if(t==0){cout<<1;}
  else{
  	cout<<0;
  }
     }
     
 

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

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n, y;
	cin >> n >> y;
	y /= 1000;
	for (int i = 0; i <= y; i += 10) {
		for (int j = 0; j <= y; j += 5) {
			if (i + j <= y) {
				int a = i / 10;
				int b = j / 5;
				if (a + b + y - (i + j) == n) {
					cout << a << " " << b << " " << y - (i + j);
					return 0;
				}
			}
		}
	}
	cout << "-1 -1 -1";
}

Measured memory_bytes: 384
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline ll read()
{
	ll x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

ll n,a[maxn],b[maxn],cnt,B[maxn],ans,c1,c2;
const ll mod=1000000007;
struct node{ll x,y;}p[maxn];

inline bool operator < (node a,node b)
{
	if(a.x==b.x) return a.y<b.y;
	return a.x<b.x;
}

map <node,ll> mp,q;

inline ll M(ll a,ll b){return (a%mod*b%mod)%mod;}

int main()
{
	n=read(); B[0]=1; ans=1;
	rep(i,1,n) B[i]=(B[i-1]*2)%mod;
	rep(i,1,n)
	{
		a[i]=read(),b[i]=read();
		if(a[i]==0&&b[i]==0) {cnt++; continue;}
		else if(a[i]==0) c1++; else if(b[i]==0) c2++;
		else
		{
			ll tmp=__gcd(a[i],b[i]);
			a[i]/=tmp; b[i]/=tmp; if(a[i]<0) a[i]=-a[i],b[i]=-b[i];
			mp[{a[i],b[i]}]++; q[{a[i],b[i]}]++;
		}
	}
	for(map <node,ll>::iterator it=mp.begin();it!=mp.end();it++)
	{
		pair <node,ll> tmp=*it;
		ll tx=tmp.first.x,ty=tmp.first.y;
		if(ty<=0)
		{
			if(q[{-ty,tx}]);
			else ans=M(ans,B[tmp.second]);
		}
		else
		{
			ll p2=q[{ty,-tx}],p1=tmp.second;
			ans=M(ans,(B[p1]+B[p2]-1)%mod);
		}
	}
	ll tmp=(B[c1]+B[c2]-1)%mod;
	cout<<(M(ans,tmp)+cnt-1+mod)%mod<<endl;
	return 0;
}

Measured memory_bytes: 45716
#include<cstdio>
#include<string.h>
#include<vector>
#include<algorithm>
using namespace std;
int n,m,cnt;
vector<int>a[1010];
int main()
{
    scanf("%d",&n);
    for(int i=1;i*(i-1)<=2*n;i++)
        if(i*(i-1)==n*2) m=i;
    if(!m){printf("No\n");return 0;}
    printf("Yes\n");
    printf("%d\n",m);
    for(int i=1;i<=m;i++)
        for(int j=i+1;j<=m;j++)
        {
            cnt++;
            a[i].push_back(cnt);
            a[j].push_back(cnt);
        }
    for(int i=1;i<=m;i++)
    {
        printf("%d ",a[i].size());
        for(int j=0;j<a[i].size();j++)
        {
            if(j!=a[i].size()-1) printf("%d ",a[i][j]);
            else printf("%d\n",a[i][j]);
        }
    }
    return 0;
}


Measured memory_bytes: 2304
#include <bits/stdc++.h>
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << '\n'
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef double db;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a; }
//head

void solve(){
    int n, m;
    cin >> n >> m;
    int l, r;
    cin >> l >> r;
    int max_l = l;
    int min_r = r;
    for (int i = 1; i < m; i++){
        cin >> l >> r;
        max_l = max(max_l, l);
        min_r = min(min_r, r);
    }
    cout << max(0, min_r-max_l+1) << '\n';
}

int main(void){ 
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    //int t; cin >> t; while (t--)
        solve();
}

Measured memory_bytes: 3616
#include<cstdio>
#include<map>
#define ll long long
using namespace std;
map<int,int>mp;
ll sum[100500];
int main(){
	ll n,m;
	scanf("%lld%lld",&n,&m);
	for (int i=1;i<=n;i++){
		ll x;
		scanf("%lld",&x);
		sum[i]=sum[i-1]+x;
		sum[i]%=m;
		mp[sum[i]]++;
	}
	ll ans=mp[0];
	if (mp[0]>1) ans+=1ll*mp[0]*(mp[0]-1)/2;
	mp[0]=0;
	for (int i=1;i<=n;i++)
	if (mp[sum[i]]) ans+=1ll*mp[sum[i]]*(mp[sum[i]]-1)/2,mp[sum[i]]=0;
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 3968
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define pp pair<ll,ll>
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;
ll MOD=1000000007;

 
int main() {
    int n,m;
    cin >> n >> m;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    vector<vector<int>> e(n,vector<int>(0));
    rep(i,m){
        int f,g;
        cin >> f >> g;
        e[f-1].push_back(g-1);
        e[g-1].push_back(f-1);
    }
    int ans=0;
    rep(i,n){
        bool t=true;
        rep(j,e[i].size()){
            if (a[i]<=a[e[i][j]]) t=false;
        }
        if (t) ans++;
    }
    cout << ans << endl;
}


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

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"

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

    return gcd(b, a%b);
}

const ll L = 1e5+5;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    ll L, R;
    cin >> L >> R;

    ll ans = 1e18;
    
    if(R-L >= 2019)
    {
        cout << 0 << endl;
        return 0;
    }
    
    else
    {
        for(ll i=L; i<=R; i++)
        {
            for(ll j=i+1; j<=R; j++)
            {
                ans = min(ans, (i*j)%2019);
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
   string s1;
   cin>>s1;
   if(s1=="SAT") {cout<<"1"<<endl;}
   else if(s1=="SUN") {cout<<"7"<<endl;}
   else if(s1=="MON") {cout<<"6"<<endl;}
   else if(s1=="TUE") {cout<<"5"<<endl;}
   else if(s1=="WED") {cout<<"4"<<endl;}
   else if(s1=="THU") {cout<<"3"<<endl;}
   else if(s1=="FRI") {cout<<"2"<<endl;}
   return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>

int main(){
  int h[300],w[300],i,j,k=0;
  while(1){
    scanf("%d%d",&h[k],&w[k]);
    if(h[k]==0&&w[k]==0){
      break;
    }
    k++;
  }
  k=0;
  while(1){
    if(h[k]==0&&w[k]==0){
      break;
    }
    for(j=0;j<w[k];j++){
        printf("#");
    }
    printf("\n");
    for(i=1;i<h[k]-1;i++){
      printf("#");
      for(j=1;j<w[k]-1;j++){
        printf(".");
      }
      printf("#\n");
    }
     for(j=0;j<w[k];j++){
        printf("#");
     }
    printf("\n\n");
    k++;
  }
  return 0;
}


Measured memory_bytes: 2052
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
MOD = 10 ** 9 + 7
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    S = SS()

    # 各アルファベットに対して、どこか1個以下使うパターンがある
    ans = 1
    cnt = collections.Counter(S)
    for i in cnt.values():
        ans *= (i + 1)
        ans %= MOD
    ans -= 1

    print(ans)

if __name__ == '__main__':
    resolve()


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

ll LSB(ll i){
	return (i&(-i));	
}

const int maxn=2e5+5;
int p[maxn];
int n,k;
ll bit[maxn];
ll ak[maxn];
ll sb[maxn];

void add(int i,int x){
	while (i<maxn){
		bit[i]+=x;
		i+=LSB(i);
	}
	return;
}

ll ask(int i){
	ll sm=0;
	while (i){
		sm += bit[i];
		i -= LSB(i);
	}
	return sm;
}

int main(){
	cin >> n >> k;
	for (int i=1;i<=n;i++){
		cin >> p[i]; 
		add(i,p[i]);
	}
	int maxi=0;
	for (int i=1;i<k;i++){
		ak[i]=ask(i);	
	}
	for (int i=k;i<=n;i++){
		ak[i]=ask(i);
		sb[i]=ak[i]-ak[i-k];
//		cout << i << ' ' << i-k << ' ' << ak[i] << ' ' << ak[i-k] << ' ' << sb[i] << endl;	
		if (sb[i]>maxi) maxi=sb[i];
	}
	double ans;
	ans += maxi;
	ans += k;
	ans /= 2;
	printf("%lf",ans);
	return 0;
}




Measured memory_bytes: 5760
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int a[]=new int[n-1];
        int sum[]=new int[n];
        for(int i=0;i<n-1;i++)
        {
            a[i]=sc.nextInt();
            sum[a[i]-1]++;
        }
        for(int i=0;i<n;i++)
            System.out.println(sum[i]);
    }
}


Measured memory_bytes: 62864
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const long long INF = 1LL << 60;

const int MAX_N = 110;
const int MAX_V = 100100;

int N;
ll W, w[MAX_N], v[MAX_N];

ll dp[MAX_N][MAX_V];

int main(){
  cin >> N >> W;
  rep(i, N) cin >> w[i] >> v[i];

  rep(i, MAX_N) rep(j, MAX_V) dp[i][j] = INF;

  dp[0][0] = 0;
  rep(i, N){
    rep(sum_v, MAX_V){
      if(sum_v-v[i] >= 0) chmin(dp[i+1][sum_v], dp[i][sum_v-v[i]] + w[i]);
      chmin(dp[i+1][sum_v], dp[i][sum_v]);
    }
  }

  int res = 0;
  rep(sum_v, MAX_V) if(dp[N][sum_v] <= W) res = sum_v;

  cout << res << endl;

  return 0;
}


Measured memory_bytes: 86272
import Data.Char

main :: IO ()
main = do
  s <- map (subtract (ord 'a').ord) <$> getLine
  k <- readLn
  putStrLn $ map (chr . (+(ord 'a'))) $ calc s k

m :: Int -> Int
m = (`mod`26)

calc :: [Int] -> Int -> [Int]
calc [x] i = [m $ x+i]
calc (x:xs) i = if x == 0 then x:calc xs i else if x + i >= 26 then 0 : calc xs (i-(26-x)) else x:calc xs i

Measured memory_bytes: 5116
W, H, N = gets.split.map(&:to_i)

left, right, top, bottom = 0, W, H, 0

N.times do
	x, y, a = gets.split.map(&:to_i)
	
	if a == 1
		left = [left, x].max
	elsif a == 2
		right = [right, x].min
	elsif a == 3
		bottom = [bottom, y].max
	else
		top = [top, y].min
	end
end

if right - left > 0 && top - bottom > 0
	puts (right - left) * (top - bottom)
else
	puts 0
end


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

int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    for(int i=0;i<S.length();i++){
        S[i] += N;
        while(S[i]>'Z'){
            S[i]-=26;
        }
        cout << char(S[i]);
    }
    cout <<endl;
}

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

int main() {
    long long k, a, b;
    cin >> k >> a >> b;
    if (a >= k) {
        cout << 1 << endl;
        return 0;
    }
    if (b >= a) {
        cout << -1 << endl;
        return 0;
    }
    k -= a;
    cout << ((k + (a - b - 1)) / (a - b)) * 2 + 1 << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
using namespace std;
int n,a[51],m=1;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	for(int i=2;i<=n;i++)
		if(abs(a[i])>abs(a[m]))  m=i;
	printf("%d\n",2*n);
	if(a[m]>=0)
	{
		printf("%d %d\n%d %d\n",m,n,m,n);
		for(int i=1;i<n;i++)
			printf("%d %d\n%d %d\n",n,i,n,n);
	}else{
		printf("%d %d\n%d %d\n",m,1,m,1);
		for(int i=n;i>1;i--)
			printf("%d %d\n%d %d\n",1,i,1,1);
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P std::pair<int,int>
#define PiP std::pair<int,std::pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp std::make_pair
#define prique(T) std::priority_queue<T,vector<T>,greater<T>>
using namespace std;
template<class T> inline void chmax(T& a, T b) { a = std::max(a, b); }
template<class T> inline void chmin(T& a, T b) { a = std::min(a, b); }

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
int get_rand(int MIN, int MAX) {
	std::random_device rnd;
	std::mt19937_64 mt64(rnd());
	std::uniform_int_distribution<int>engine(MIN, MAX);
	return engine(mt64);
}
/*--------Library Zone!--------*/

int h, w;
char c[2005][2005];
int up[2005][2005], dow[2005][2005], ri[2005][2005], le[2005][2005];
signed main() {
	cin >> h >> w;
	rep(i, h)rep(j, w)cin >> c[i][j];
	//up
	rep(j, w){
		int cnt = 0;
		rep(i, h) {
			if (c[i][j] == '.')cnt++;
			else cnt = 0;
			up[i][j] = cnt;
		}
	}
	//dow
	rep(j, w) {
		int cnt = 0;
		for (int i = h - 1; i >= 0; i--) {
			if (c[i][j] == '.')cnt++;
			else cnt = 0;
			dow[i][j] = cnt;
		}
	}
	//le
	rep(i, h) {
		int cnt = 0;
		rep(j, w) {
			if (c[i][j] == '.')cnt++;
			else cnt = 0;
			le[i][j] = cnt;
		}
	}
	//ri
	rep(i, h) {
		int cnt = 0;
		for (int j = w - 1; j >= 0; j--) {
			if (c[i][j] == '.')cnt++;
			else cnt = 0;
			ri[i][j] = cnt;
		}
	}
	int ans = 0;
	rep(i, h)rep(j, w) {
		if (c[i][j] == '#')continue;
		chmax(ans, up[i][j] + dow[i][j] + ri[i][j] + le[i][j] - 3);
	}
	cout << ans << endl;
}


Measured memory_bytes: 129792
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
typedef long long int ll;
using namespace std;

int main(int argc, char const *argv[]) {
  ll N, M, Q, l, r, p, q;
  std::cin >> N >> M >> Q;
  vvl dp = vv(N, N, 0, ll);
  vvl zahyo = vv(N, N, 0, ll);
  for(int i=0;i<M;i++) {
    std::cin >> l >> r;
    zahyo[l-1][r-1]++;
  }
  for(int i=0;i<N;i++)for(int j=0;j<N;j++) dp[i][j] = (j==0?0:dp[i][j-1]) + zahyo[i][j];
  for(int i=N-1;i>=0;i--) for(int j=0;j<N;j++) dp[i][j] += (i==N-1?0:dp[i+1][j]);
  for(int i=0;i<Q;i++) {
    std::cin >> p >> q;
    std::cout << dp[p-1][q-1] << '\n';
  }
  return 0;
}


Measured memory_bytes: 4864
# -*- coding: utf-8 -*-
 
# 整数の入力
list_num = [int(num) for num in input().split()]

# 計算と出力
if (list_num.count(5) == 2)  and  (list_num.count(7) == 1) :
    print("YES")
else :
    print("NO")

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
int main(){
  string N; cin >> N;
  bool ans = false;
  for(int i = 0; i < 3; i++){
    if(N[i] == '7') ans = true;
  }
  if(ans) cout << "Yes";
  else cout << "No";
  return 0;
}

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

int main(){
  int a,cou;
  while(cin>>a){
    cou=0;
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
	for(int k=0;k<10;k++){
	  for(int q=0;q<10;q++){
	    if(i+j+k+q==a)cou++;
	  }
	}
      }
    }
    cout<<cou<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
using namespace std;
int n;
int k;
long res;

int main(){
  cin >> n >> k;
  if(n<=k) res = 0;
  else{
    int h[n];
    for(int i=0;i<n;i++){
      cin >> h[i];
      res += h[i];
    }
    sort(h,h+n);
    
    for(int i=0;i<k;i++) res -= h[n-i-1];
  }
  cout << res <<endl;
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
using namespace std;
int main(){
    int N,M,X,Y;
    cin >> N >> M >> X >> Y;
    
    int x[100] = {};
    int y[100] = {};
    
    for(int i=0;i<N;i++){
        cin >> x[i];
    }
    for(int i=0;i<M;i++){
        cin >> y[i];
    }
    
    sort(x,x+N,greater<int>());
    sort(y,y+M);
    
    if(x[0]<y[0] && X<Y && x[0]<Y && y[0]>X){
        cout << "No War" << endl;
    }else{
        cout << "War" << endl;
        
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
   // freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll a,b,x;
    cin >> a >> b >> x;
    ll cnt;
    if(a == 0)cnt = b/x+1;
    else cnt = (b/x) - ((a-1)/x);
    cout << cnt << endl;
    return 0;
}


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


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 30;
const ll INFL = 1LL << 60;
const ll mod = 1000000007;






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

	vector<pair<int, int>> p;

	VVI v(1005, VI(1005, 0));

	int white = 0;
	int black = 0;

	REP(i, n) {
		int a, b;
		cin >> a >> b;
		char c;
		cin >> c;
		a %= 2 * k;
		b %= 2 * k;
		if ((a / k + b / k) % 2 == 1) {
			if (c == 'B')c = 'W';
			else c = 'B';
		}
		a %= k;
		b %= k;


		if (c == 'B') {
			v[a][b]++;
			black++;
		}
		else {
			v[a][b]--;
			white++;
		}
	}

	VVI s(1005, VI(1005, 0));
	VVI t(1005, VI(1005, 0));

	REP(i, 1001)REP(j, 1001) {
		s[i][j + 1] = s[i][j] + v[i][j];
	}
	REP(i, 1001)REP(j, 1001) {
		s[i + 1][j] += s[i][j];
	}	
	

	int ans = 0;

	REP(i, k) {
		REP(j, k) {
			int wh = s[i][j];
			wh += s[k][k] - s[k][j] - s[i][k] + s[i][j];
			wh += white;

			ans = max({ ans,wh,n - wh });
		}
	}

	cout << ans << endl;



	



}


Measured memory_bytes: 12160
#include <bits/stdc++.h>
#define ll long long int
#define endl '\n'
#define mod 1000000007
#define PI 3.1415926535
using namespace std;
ll power(ll x, ll y)
{
	if (y == 0)
		return 1;
	else if (y % 2 == 0)
		return power(x, y / 2) * power(x, y / 2);
	else
		return x * power(x, y / 2) * power(x, y / 2);
}
ll modExpo(ll x,ll n)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)
        return modExpo((x*x)%mod,n/2);
    else                            
        return (x*modExpo((x*x)%mod,(n-1)/2))%mod;

}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	auto start_time = clock();
	cerr << setprecision(3) << fixed;
#endif
	ll n,k;
	cin>>n>>k;
	ll i,a[n];
	for(i=0;i<n;i++)
		cin>>a[i];
	ll dp[n];
	for(i=0;i<n;i++)
		dp[i]=INT_MAX;
	dp[0]=0;
	for(i=1;i<n;i++)
	{
		for(ll j=0;i-j>=0 && j<=k;j++)
			dp[i]=min(dp[i],dp[i-j]+abs(a[i]-a[i-j]));
	}
	cout<<dp[n-1]<<endl;
#ifdef LOCAL
	auto end_time = clock();
	cerr << "Execution time: " << (end_time - start_time) * (int)1e3 / CLOCKS_PER_SEC << " ms\n";
#endif
}


Measured memory_bytes: 5168
from math import ceil
n, m = map(int, input().split())
a = list(map(int, input().split()))
c = ceil(sum(a) / (4 * m))
d = 0
for e in a:
    if e >= c:
        d += 1
        if d == m:
            print('Yes')
            exit(0)
print('No')


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int a,b;
int ans=1;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;char ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*f;
}
int main(){
	a=read(),b=read();
	int c=a;
    if(b==1){
    	puts("0");
    	exit(0);
	}
	while(c<b){
		c+=a-1;
		ans++;
	}
	cout<<ans;
} 

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

int main() {
    int k, s;
    cin >> k >> s;
    int x, y, z, count;
    count = 0;
    for (int i = k; i >= 0; i--) {
        if (s-i >= 0 && s-i <= 2*k) {
            for (int j = k; j >= 0; j--) {
                if (s-i-j >= 0 && s-i-j <= k) count++;
                else continue;
            }
        } else continue;
    }
    cout << count << endl;
}

Measured memory_bytes: 256
#!/usr/bin/python
class Ternary:
	def __init__(self,n): 
		self.n=n
	def __int__(self):
		return self.n
	def __neg__(self):
		return Ternary(2-int(self))
	def __mul__(self,o):
		return Ternary(min(int(self),int(o)))
	def __add__(self,o):
		return Ternary(max(int(self),int(o)))

import sys, itertools
from functools import reduce
R=[0,1,2]
while True:
	s=sys.stdin.readline().rstrip()
	if s=='.': break
	r=0
	for (a,b,c) in itertools.product(R,repeat=3):
		t=reduce(lambda t,e:t.replace(e[0],'Ternary(%d)'%e[1]),[['0',0],['1',1],['2',2],['P',a],['Q',b],['R',c]],s)
		if int(eval(t))==2: r+=1
	print(r)



Measured memory_bytes: 6284
//
//  main.cpp
//

#include <iostream>
//#include <algorithm>
#include <vector>
//#include <limits>
#include <math.h>
//#include <queue>
//#include <tuple>
//#include <stdio.h>
//#include <stdlib.h>
//#include <string>
//#include "string.h"
//#include <unordered_map>
#include <unordered_set>
//#include <array>
#include <set>
#include <limits>

using namespace std;

using ll = long long;

int main() {
    while (true) {
        int N;
        cin >> N;
        if (N == 0) {
            return 0;
        }
        set<int> cities;
        vector<vector<int>> dists(10, vector<int>(10, 100000));
        for (int i = 0; i < 10; i++) {
            dists[i][i] = 0;
        }
        for (int i = 0; i < N; i++) {
            int ai, bi, ci;
            cin >> ai >> bi >> ci;
            dists[ai][bi] = ci;
            dists[bi][ai] = ci;
            cities.insert(ai);
            cities.insert(bi);
        }
        for (int k = 0; k < 10; k++) {
            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 10; j++) {
                    dists[i][j] = min(dists[i][j], dists[i][k]+dists[k][j]);
                }
            }
        }
        int minCity = -1;
        int minSum = numeric_limits<int>::max();
        for (int cityA : cities) {
            int sum = 0;
            for (int cityB : cities) {
                sum += dists[cityA][cityB];
            }
            if (sum < minSum) {
                minCity = cityA;
                minSum = sum;
            }
        }
        printf("%d %d\n", minCity, minSum);
    }
    return 0;
}

/*
6
0 1 80
1 2 20
0 2 60
2 3 50
3 4 60
1 4 90
0
*/



Measured memory_bytes: 3132
# python3.4.2用
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def lprint(l): print(*l, sep='\n')
def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

N = iin()
A = iln()

dp = [[0 for _ in range(2)] for _ in range(N+1)]
dp[0][1] = -1*INF

for i in range(N):
    dp[i+1][0] = max(dp[i][0]+A[i], dp[i][1]-A[i])
    dp[i+1][1] = max(dp[i][0]-A[i], dp[i][1]+A[i])

# 最後の数字は操作できないため、dp[N][0]を出力する
print(dp[N][0])


Measured memory_bytes: 29104
def resolve():
    n = int(input())
    d = [0 for i in range(n)]
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                if x**2 + y**2 + z ** 2 + x*y + y*z + z*x <= n:
                    d[x**2 + y**2 + z ** 2 + x*y + y*z + z*x - 1] += 1

    for i in d:
        print(i)

resolve()

Measured memory_bytes: 9216