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

using namespace std;



#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define euc_dis(x, y) sqrt(x*x + y*y)

#define pb push_back
#define mp make_pair
#define INF 999999999
#define sp ' '
#define begin begin()
#define end end()

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<string> vstr;

vector<string> split(const string &str, char sep)
{
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
            v.pb(buffer);
    }
    return v;
}



int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    string s;
    cin >> s;
    ll sum = 0;
    int n = s.size();


    for(ll b = 1 << n-1; --b;){
        vstr sb;
        string s_tmp = s;
        FOR(i,0,n)
            if(b >> i & 1)
                s_tmp.insert(n-i-1,"+");
        sb = split(s_tmp, '+');
        for(string st : sb)
            sum += stoll(st);
    }
    cout << sum+stoll(s) << endl;




    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define c(P)        cout<<P<<"\n"
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define mii         map<pii,ll>
#define F           first
#define S           second
#define sz(a)       (ll)(a.size())
#define cr(P)       cout<<P<<"\n";return;
#define mem(a,val)  memset(a,val,sizeof(a))
#define fr(i,x,n)   for(ll i=x;i<n;i++)
#define frr(i,x,n)  for(ll i=n-1;i>=x;i--)
using namespace std;


const ll N   =  500005;
const ll mod = 1e9 + 7;



void solve(){

  ll x=0,y=0,c=0,ans=0;
  ll n,m,k;
  cin>>n >> m;
  c(n*m);
  
 
}

signed main(){
     
  ios_base::sync_with_stdio(false);   
  cin.tie(NULL);
  //int T;cin >> T;while (T--)
  solve();
  return 0;
}


Measured memory_bytes: 3616
#include <iostream>
#include <string>

int main()
{
  std::string S, T;
  std::cin >> S >> T;

  int ans = 0;
  std::string::size_type n = S.length();
  for (std::string::size_type i = 0; i < n; ++i)
  {
    if (S[i] != T[i]) { ++ans; }
  }

  std::cout << ans << '\n';

  return 0;
}


Measured memory_bytes: 3924
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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 int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

const double pi = 3.141592653589793;
// -------------------------------------------------------
int N, A, B;

int main() {
  cin >> N >> A >> B;
  int ans = 0;
  repe(i, 1, N) {
    vector<int> n;
    int num = i;
    while (num) {
      n.push_back(num % 10);
      num /= 10;
    }
    int sum = 0;
    for (auto e : n) {
      sum += e;
    }
    if (sum >= A && sum <= B) {
      ans += i;
    }
  }
  cout << ans << endl;
}


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

const int MAX_N = 100;

int main() {
    for(int N; cin >> N, N; ) {
        vector<int> G[MAX_N];
        for(int i = 0; i < N; i++) {
            int M; cin >> M;
            while(M--) {
                int p; cin >> p; p--;
                G[p].push_back(i);
            }
        }

        int K; cin >> K;
        vector<int> A(N, 0);
        for(int i = 0; i < K; i++) {
            int l; cin >> l; l--;
            for(int j = 0; j < (int)G[l].size(); j++) {
                A[G[l][j]]++;
            }
        }

        vector<int> res;
        for(int i = 0; i < N; i++) if(A[i] == K) res.push_back(i + 1);
        // for(int i = 0; i < N; i++) cerr << A[i] << endl;
        if(res.size() == 1) cout << *res.begin() << endl;
        else cout << -1 << endl;
    }
}

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

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

int main() {
  ll n;
  cin >> n;
  vector<ll> v(n);
  rep(i, n) cin >> v[i];
  sort(v.begin(), v.end());
  if (n == 2) {
    //cout << (double)((v[0]+v[1])/2) << endl;
    printf("%f\n", (double)(v[0]+v[1])/2);
    return 0;
  }
  double ans = 0.0;
  ans = (double)(v[0]+v[1])/2;
  for (int i = 2; i < n; i++) {
    //cout << "ans: " << ans << ", v[i]: "<< v[i] << endl;
    //cout << (double)((ans + v[i]) / 2) << endl;
    ans = (double)((ans + v[i]) / 2);
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
	long long S, S1;
	scanf("%lld", &S);
	int x3 = 0, y3 = 0;
	S1 = S;
	if(S % 1000000000 != 0) {
		S1 = (S / 1000000000 + 1) * 1000000000;
	}
	int x1 = 1000000000, y2 = S1 / x1;
	int x2 = S1 - S, y1 = 1;
	printf("%d %d %d %d %d %d\n", x1, y1, x2, y2, x3, y3);
}

Measured memory_bytes: 3760
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <queue>

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
typedef double              DOUBLE;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)

#define INF 1000000001
#define MOD 1000000007
#define INF64 1000000000000000001

#define F first
#define S second

#define Pii pair<SINT32,SINT32>
#define Pll pair<SINT64,SINT64>


using namespace std;

int main() {

	SINT64 X,Y;
	SINT64 ans = 1;
	SINT64 buf = 0;

	cin >> X >> Y;
	buf = X;

	while (buf <= Y) {
		ans++;
		buf = buf * 2;
	}

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

//	sort(DATA.begin(),DATA.end());
//	sort(DATA.begin(),DATA.end(),std::greater<SINT32>());
//	__gcd(ANS,DATA[i]);

//	// DATA.emplace_back(BUF);	//後ろに追加

//  DATA.erase(std::unique(DATA.begin(), DATA.end()), DATA.end());	//ソート後に使用

//	DATA.insert(DATA.begin() + X, 0);	//X番目の要素に0を挿入


//	vector<vector<SINT32>> DP(N,vector<SINT32>(3));	//2次元配列

/*
	SINT32 M = 3;
	vector<pair<SINT32,SINT32>> DATA2(M);
	for (SINT32 i = 0; i < M; i++) {
		cin >> DATA2[i].first;
		cin >> DATA2[i].second;
	}
	sort(DATA2.begin(),DATA2.end());
	cout << DATA2[0].first << endl;
	cout << DATA2[0].second << endl;
*/

// 	vector<pair<int,pair<int,int>>> DATA(M);
//	cin >> DATA[i].first;
//	cin >> DATA[i].second.first;
//	cin >> DATA[i].second.second;


//		APOSI = lower_bound(ADATA.begin(),ADATA.end(),QDATA[i]) - ADATA.begin();	//key以上を探す
//		BPOSI = lower_bound(BDATA.begin(),BDATA.end(),QDATA[i]) - BDATA.begin();


/* 文字列回転
	string N;
	cin >> N;
	N = N[N.length()-1] + N.substr(0,N.length()-1);
*/
/* 文字列合成
	string N,M;
	cin >> N >> M;
	SINT64 ans = 0;
	ans = stoi(N+M);
*/



/* SET コンテナ
	set<SINT32> DATA;
	for (SINT32 i = 0; i < N; i++) {
		SINT32 buf;
		cin >> buf;
		DATA.insert(buf);
	}

	//全表示
    set<string>::iterator it; //  イテレータを用意
    for(it = DATA.begin(); it != DATA.end(); it++) {
        cout << *it << endl;
    }

	//N番目を一部表示
	set<string>::iterator it; //  イテレータを用意
	it = DATA.begin();
	rep (i,0,N) {
		it++;
	}
	cout << *it << endl;
*/

/* map
	map<string,SINT32> mp;
	SINT32 N = 0;
	SINT32 mx = 0;

	cin >> N;
	for (SINT32 i = 0; i < N; i++) {
		string s;
		cin >> s;
		mp[s]++;
	}
	for(auto it=mp.begin();it!=mp.end();it++) {
		mx=max(mx,it->second);
	}

*/

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

int main(){
  long int n, k, i;
  scanf("%ld %ld", &n, &k);
  
  if (n < k) {
    if (labs(n - k) < n)
      n = labs(n - k);
    printf("%ld", n);
    return(0);
  }
  
  i = n / k;
  if (labs(n - i*k) <= labs(n - (i+1)*k))
    n = labs(n - i*k);
  else if (labs(n - i*k) > labs(n - (i+1)*k))
    n = labs(n - (i+1)*k);

  printf("%ld", n);
  return(0);
}


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

int main() {
  int n, k, c = 1;
  cin >> n >> k;
  REP(i, n) {
    if (c * 2 < c + k) c *= 2;
    else c += k;
  }
  cout << c << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vb=vector<bool>;
using vvb=vector<vb>;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pll = pair<ll,ll>;
using vpii = vector<pii>;
using vpli = vector<pli>;
using vpll = vector<pll>;

#define rep(i, n) for(int i=0;i<(int)n;i++)
#define rep2(i, s, n) for(int i=(s);i<(int)n;i++)
int INF=1e9+7;

int main() {
  int N;
  cin >> N;
  vi L(N);
  rep(i,N) cin >> L[i];
  sort(L.begin(),L.end());
  
  int ans=0;
  rep(i,N-2) {
    rep2(j,i+1,N-1) {
      ans+=lower_bound(L.begin(),L.end(),L[i]+L[j])-L.begin()-j-1;
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std; 
typedef long long int ll;
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n;
    cin >> n;
    ll arr[n + 1];
    int temp = 1;
    int flag = 0;
    for(ll i = 0; i < n; i++)
    {
        cin >> arr[i];
        if(arr[i] == temp)
        {
            flag = 1;
            temp++;
        }
    }
    if(flag == 0)
    {
        cout << -1 << endl;
    }
    else
    {
        cout << n - temp + 1 << endl;
    }
    

    return 0;
}

Measured memory_bytes: 1792
#include "bits/stdc++.h"
using namespace std;

using ll = long long;
int INF = numeric_limits<int>::max() / 2;
ll LINF = numeric_limits<ll>::max() / 2;
int MOD = 1e9 + 7;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    ll n = s.size();
    vector<ll> alpha(26,0);
    ll ans = n * (n-1) / 2 + 1;
    for(int i = 0; i < n; i++){
        alpha[s[i] - 'a']++;
    }
    for(int i = 0; i < 26; i++){
        ans -= alpha[i] * (alpha[i] - 1) / 2;
    }
    cout << ans << endl;
}

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

using namespace std;

#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload3(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)

#define REPR(i, n) for(int i = n;i >= 0;--i)

#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl

int gcd(int a,int b){ // log N
    while((a%=b)&&(b%=a));
    return a+b;
}

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

int main(){
    int x,y;
    cin>>x>>y;
    if(x%y==0){
        cout<<-1<<endl;
    }else{
        cout<<x<<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++)
using P = pair<int, int>;

/* 繰り返し自乗法. */
int modPow(long long a, long long n, long long p) {
	if (n == 0) return 1; // 0乗にも対応する場合.
	if (n == 1) return a % p;
	if (n % 2 == 1) return (a * modPow(a, n - 1, p)) % p;
	long long t = modPow(a, n / 2, p);
	return (t * t) % p;
}

signed main() {
    string S, T;
    cin >> S >> T;

    int size = S.size();
    int cnt = 0;
    rep (i, size) {
        if (S[i] != T[i]) cnt++;
    }

    cout << cnt << endl;
}

Measured memory_bytes: 3812
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <stack>
#include <queue>

using namespace std;
#define Fill(a, b) memset(a, b, sizeof(a))
#define Debug(x) cout << #x << "=" << (x) << endl;
typedef long long LL;
const LL inf = 1LL << 61;
const LL mod = 1000000007;
//Fill(dp,0x3f3f3f3f)
#define DEBUG
#ifdef DEBUG
#endif
const int maxn = 1e5+10;



queue<pair<int, int> > que;
int dist[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    int k;
    cin >> k;
    Fill(dist, 0x3f);
    for(int i = 1; i < 10; i++)
    {
        if(i < dist[i%k])
        {
            dist[i%k] = i;
            que.push(make_pair(i%k, i));
        }
    }
    pair<int, int> tmp;//idx, dis
    while(!que.empty())
    {
        tmp = que.front();
        que.pop();
        //cout << tmp.first << " " << tmp.second << endl;
        if(tmp.second>dist[tmp.first])continue;
        for(int i = 0; i < 10; i++)
        {
            int nxt = (tmp.first*10+i)%k;
            int dis = tmp.second+i;
            if(dis < dist[nxt])
            {
                dist[nxt] = dis;
                que.push(make_pair(nxt, dis));
            }
        }
    }
    printf("%d\n", dist[0]);






















    return 0;
}


Measured memory_bytes: 1960
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;



int main(void){
  string A, B;

  cin >> A;
  cin >> B;

  if(A.size() > B.size()){
    cout << "GREATER" << endl;
    return 0;
  }
  if(A.size() < B.size()){
    cout << "LESS" << endl;
    return 0;
  }

  for(int i=0;i<A.size();++i){
    if(A[i] > B[i]){
      cout << "GREATER" << endl;
      return 0;
    }
    if(A[i] < B[i]){
      cout << "LESS" << endl;
      return 0;
    }
  }

  cout << "EQUAL" << endl;

  return 0;
}
 

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

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int board[10][10];
int tmp[10][10];
int n, c;

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

bool flag;
int dfs(int y, int x) {
//   printf("%d,%d\n", y,x);
  int m = tmp[y][x];
//  cout << m << endl;
  tmp[y][x] = -1;
  int res = 1;
  REP(k,6) {
    int yy = y+dy[k];
    int xx = x+dx[k];

    if (yy<0||yy>=n || xx<0||xx>yy) continue;
    if (tmp[yy][xx] == m) {
      res += dfs(yy,xx);
    } else if (tmp[yy][xx] == 0)
      flag = 0;
  }
  return res;
}

int score(int y, int x) {
  int res = 0;
  memcpy(tmp, board, sizeof(board));
  tmp[y][x] = c;      
  REP(i,n) {
    REP(j, i+1) {
      if (tmp[i][j] >= 1) {
        flag = 1;
        int hoge = (tmp[i][j]==c)? -1 : 1;
        hoge *= dfs(i, j);
//        cout << hoge << endl;
        if (flag)
          res += hoge;
//        cout << "res = " << res << endl;
      }
    }
  }
  return res;
}

int main() {
  while(cin >> n >> c, n||c) {
    REP(i,n)
      REP(j, i+1) {
        cin >> board[i][j];
    }
    int res = -INF;
    REP(i,n)
      REP(j, i+1)
      if (board[i][j] == 0)
        res = max(res, score(i,j));
    cout << res << endl;
  }
}

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

int main(){
    long long int n,a,b;
    cin>>n>>a>>b;
    long long int ans=0;
    ans+=n/(a+b)*a;
    if(n%(a+b)>=a)ans+=a;
    else ans+=n%(a+b);
    cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
    int n[6];
    for(int i=0;i<6;i++){
        cin>>n[i];
    }
    for(int j=0;j<4;j++){
        for(int k=j+1;k<5;k++){
            if(n[k]-n[j]>n[5]){
                cout<<":("<<endl;
                return 0;
            }
            else{
            }
        }
    }
    cout<<"Yay!"<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main() {
  int n;
  vector<bool> P(300000, true);
  P[0] = false;
  P[1] = false;
  for (int i = 1; (7*i-1) < 300000; ++i) {
    if (P[7*i-1]) {
      for (int j = 2; (7*i-1)*j < 300000; ++j) {
	P[(7*i-1)*j] = false;
      }
    }
    if (7*i+1 < 300000 && P[7*i+1]) {
      for (int j = 2; (7*i+1)*j < 300000; ++j) {
	P[(7*i+1)*j] = false;
      }
    }
  }
  while (cin >> n, n > 1) {
    cout << n << ":";
    for (int i = 1; 7*i-1 < 300000; ++i) {
      if (P[7*i-1] && !(n%(7*i-1))) cout << " " << 7*i-1;
      if (7*i+1 < 3000000 && P[7*i+1] && !(n%(7*i+1))) cout << " " << 7*i+1;
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 3128
void main() {
    string s = readln.chomp;
    int cnt;
    foreach (x; s) {
        if (x == '+') ++cnt;
        else --cnt;
    }
    cnt.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.uni;

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<set>
using namespace std;
typedef long long LL;
const int INF=0x3f3f3f3f;
const int MAXN=1e5+5;
int a[MAXN];
int G[105][105];

int main()
{
    int h,w;
    while(scanf("%d%d",&h,&w)!=EOF)
    {
        int n;
       cin>>n;
        for(int i=1;i<=n;++i)
            scanf("%d",&a[i]);
        int cnt=1;
        for(int i=1;i<=h;++i)
        {
            if(i&1)
            {
                for(int j=1;j<=w;++j)
                {
                   if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];}
                   else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];}
                }
            }else
            {
                for(int j=w;j>=1;--j)
                {
                    if(a[cnt]>0) {G[i][j]=cnt;--a[cnt];}
                    else if(a[cnt]==0) {++cnt;G[i][j]=cnt;--a[cnt];}
                }
            }
        }
        for(int i=1;i<=h;++i)
        {
            for(int j=1;j<=w;++j)
            {
                if(j!=w) printf("%d ",G[i][j]);
                else printf("%d\n",G[i][j]);
            }
        }
    }
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n;
    cin >> n;
    while (n) {
        if (n % 10 == 7) {
            cout << "Yes" << endl;
            return 0;
        }
        n /= 10;
    }
    cout << "No\n";
    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int ac =0, wa = 0, tle = 0, re = 0;
  int n;
  cin >>n;
  for(int i = 0; i < n; ++i){
    string s;
    cin  >>s;
    if(s[0] == 'A')
      ++ac;
    else if(s[0] == 'W')
      ++wa;
    else if(s[0] == 'T')
      ++tle;
    else 
      ++re;
  }
  cout<<"AC x "<<ac<<"\n";
  cout<<"WA x "<<wa<<"\n";
  cout<<"TLE x "<<tle<<"\n";
  cout<<"RE x "<<re<<"\n";
}


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

int main(){
while(1){//start


	int N, M, r;
	//N；PC数　M；学生数
	cin >> N >> M;
	if(N == 0 and M == 0) break;
	cin >> r;


	//学生数、　時間
	int data[10004][721];
	for(int j = 0; j < 10004; j++){
		for(int k = 0; k < 721; k++) data[j][k] = 0;
	}


	for(int i = 0; i < r; i++){
		// t；時刻、　n;PC番号　m；学生番号　s；１ならログイン、０ならログアウト(配列中では逆)
		int t, n, m;
		bool s;
		cin >> t >> n >> m >> s;
		if(s) data[m][t - 539] += 1;
		else data[m][t - 539] += -1;
	}

	//累積和をとる
	for(int i = 0; i <= M; i++){
		for(int k = 1; k < 721; k++) data[i][k] = data[i][k] + data[i][k - 1];
	}


	//クエリを取得
	int qn;
	cin >> qn;
	for(int i = 0; i < qn; i++){
		int ts, tt, sn;
		cin >> ts >> tt >> sn;

		//学生について調査する
		int ans = 0;
		for(int j = ts - 539; j < tt - 539; j++){
			if(data[sn][j]) ans++;
		}
		cout << ans << endl;
	}

}//end

	return 0;
}



Measured memory_bytes: 31284
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

  set<P> v;
  rep(i,n){
    int ii = n-1-i;
    auto itr = v.lower_bound(P(a[ii]+1,ii));
    if(itr!=v.end()){
      v.erase(itr);
    }
    v.emplace(a[ii],ii);
  }
  cout << v.size() << endl;
}


Measured memory_bytes: 5376
import bisect
import itertools

n = int(input())
s = input()

RGB = [[], [], []]
for i in range(n):
    if s[i] == 'R':
        RGB[0].append(i)
    elif s[i] == 'G':
        RGB[1].append(i)
    else:
        RGB[2].append(i)
total = len(RGB[0]) * len(RGB[1]) * len(RGB[2])
RGB.sort(key=lambda x:len(x))
len_B=len(RGB[2])
max_B=max(RGB[2])
min_B=min(RGB[2])
#for r in RGB[0]:
#    for g in RGB[1]:
bool_B=[False for i in range(n)]
for i in RGB[2]:
    bool_B[i]=True

for rg in itertools.product(RGB[0],RGB[1]):
    r=rg[0]
    g=rg[1]
    dif = abs(r - g)

    up = max(r,g)+dif
    down = min(r,g)-dif

    if max_B >=up:
        if bool_B[up]:
            total-=1
    if min_B <= down and max_B >= down:
        if bool_B[down]:
            total-=1
    if dif % 2 == 0:
        center = (r+g)//2
        if min_B<=center and max_B >= center:
            if bool_B[center]:
                total-=1
print(total)

Measured memory_bytes: 9424
#include <bits/stdc++.h>
using namespace std;
// #define int long long
typedef long long ll;
typedef pair<int,int> pii;
#define ITR(v,c) for(auto v=begin(c);v!=end(c);v++)
#define FOR(v,a,n) for(int v=a;v<(int)(n);v++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(v,n) FOR(v,0,n)
#define RREP(v,n) for(int v=(int)(n);v>=0;v--)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
const int INF = 1e9;
const ll INFLL = 1e18;
template<class T,class U>ostream&operator<<(ostream &os,const pair<T,U> &p){
    os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T>ostream&operator<<(ostream &os,const vector<T> &v){
    ITR(i,v)os<<*i<<(i==end(v)-1?"":" ");return os;}
//------------------------------------------------------------------------------

signed main() {
    while(true) {
        int s=0,all;
        cin>>all;
        if(all==0) break;
        REP(i,9) {
            int a;
            cin>>a;
            s+=a;
        }
        cout<<all-s<<endl;
    }

    return 0;
}

Measured memory_bytes: 3000
#include <stdio.h>
int main(){
	int x1, y1, x2, y2;
	scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
	printf("%d %d %d %d", x2 - (y2 - y1), y2 + (x2 - x1), x1 - (y2 - y1), y1 + (x2 - x1));
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd_(ll a,ll b){if(a%b==0)return b;return gcd_(b,a%b);}
ll lcm_(ll a,ll b){ll c=gcd_(a,b);return ((a/c)*b);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop_(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}

template <typename T>
class Seg_Tree{
public: // 0-index
	vector<T> dat;
	T initial,M;
	int n;
	T unite(T a,T b){//
		return a + b;
	}
	Seg_Tree(int n0_=1,T initial_=1,T M_=1){
		initsize(n0_,initial_,M_);
	}
	void initsize(int n0,T initial_,T M_){
		M = M_;
		initial = initial_;
		int k=1;
		while(1){
			if(n0<=k){
				n=k;
				dat.resize(2*n-1);
				for(int i=0;i<2*n-1;i++)dat[i]=initial;
				break;
			}
			k*=2;
		}
	}
 
	//i banme wo x nisuru
	void update(int i,T x){
		i += n-1;
		dat[i] = x;
		while(i>0){
			i = (i-1) / 2;
			dat[i] = unite(dat[i*2+1],dat[i*2+2]);
		}
	}
 
	//[a,b)
	T query0(int a,int b,int k,int l,int r){
		if(r<=a || b<=l)return initial;
		if(a<=l && r<=b)return dat[k];
		else{
			T vl = query0(a,b,k*2+1,l,(l+r)/2);
			T vr = query0(a,b,k*2+2,(l+r)/2,r);
			return unite(vl,vr);
		}
	}
 
	//return [a,b)
	T query(int a,int b){
		return query0(a,b,0,0,n);
	}
};

int main(){


	ll N,Q;
	cin >> N >> Q;

	Seg_Tree<ll> sg(N,0,MOD);

	FOR(i,0,N){
		ll a;
		cin >> a;
		sg.update(i,a);
	}

	FOR(q,0,Q){
		ll a,b,c;
		cin >> a >> b >> c;
		if(a){
			cout << sg.query(b,c) << endl;
		}else{
			ll k = sg.query(b,b+1) + c;
			sg.update(b,k);
		}
	}

}


Measured memory_bytes: 12516
#include <bits/stdc++.h>
using namespace std;
int main() {
   int N, M;
   cin >> N >> M;
   vector<int> roads(N);
   for(int i=0; i<M; ++i){
       int a, b;
       cin >> a >> b;
       ++roads.at(a-1);
       ++roads.at(b-1);
   }
   for(int i=0; i<N; ++i){
       cout << roads.at(i) << endl;
   }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

const char dat[33] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?";

int main() {
    map<char, string> of;
    of[' '] = "101";
    of['\''] = "000000";
    of[','] = "000011";
    of['-'] = "10010001";
    of['.'] = "010001";
    of['?'] = "000001";
    of['A'] = "100101";
    of['B'] = "10011010";
    of['C'] = "0101";
    of['D'] = "0001";
    of['E'] = "110";
    of['F'] = "01001";
    of['G'] = "10011011";
    of['H'] = "010000";
    of['I'] = "0111";
    of['J'] = "10011000";
    of['K'] = "0110";
    of['L'] = "00100";
    of['M'] = "10011001";
    of['N'] = "10011110";
    of['O'] = "00101";
    of['P'] = "111";
    of['Q'] = "10011111";
    of['R'] = "1000";
    of['S'] = "00110";
    of['T'] = "00111";
    of['U'] = "10011100";
    of['V'] = "10011101";
    of['W'] = "000010";
    of['X'] = "10010010";
    of['Y'] = "10010011";
    of['Z'] = "10010000";
    string s;
    while (getline(cin, s)) {
        string w;
        rep (i, s.size()) if (s[i] != '\r') w += of[s[i]];
        while (w.size() % 5) w += '0';
        for (int k = 0; k < (int)w.size(); k+=5) {
            int a = 0;
            rep (i, 5) a = a*2 + (w[k+i] == '1');
            putchar(dat[a]);
        }
        putchar('\n');
    }
}

Measured memory_bytes: 0
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<array>
#include<vector>
#include<functional>
#include<unordered_map>
#include<map>
#include<numeric>
#include<limits>
#include<utility>
#include<queue>
#include<random>

using namespace std;

int main(){
int N;
int a;
int i;

cin >> N;


for(i= 0;i*i<=N;i++){

a = i*i;

}

cout << a<<endl;


}






Measured memory_bytes: 256
n = int(input())

divisors = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        divisors.append(i)
        if i != n // i:
               divisors.append(n//i)

divisors.append(divisors[-1])

aaa = 0
bbb = 10**12+1
j = 0

for i in range(1,len(divisors)//2+1):
    aaa = divisors[j]+divisors[j+1]-2
    if aaa < bbb:
        bbb = aaa
    j += 2
    
print(bbb)

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll p,q;

vector<string> PP,Q;
vector<ll> ans;

char ot[] = {'(','{','['};
char ct[] = {')','}',']'};

bool check(ll r,ll c,ll s){
    ll cost[] = {r,c,s};
    ll sum = 0;
    rep(i,PP.size() - 1){
        ll cnt = 0;
        rep(j,PP[i].size()){
            rep(k,3){
                if(ot[k] == PP[i][j])sum += cost[k];
                if(ct[k] == PP[i][j])sum -= cost[k];
            }
        }

        rep(j,PP[i+1].size()){
            if(PP[i+1][j] != '.')break;
            cnt++;
        }
        if(cnt != sum)return false;
    }
    return true;
}

void solve(ll r,ll c,ll s){
    ll cnt[3] = {}; 
    rep(i,Q.size() - 1){
        rep(j,Q[i].size()){
            rep(k,3){
                if(ot[k] == Q[i][j])cnt[k]++;
                if(ct[k] == Q[i][j])cnt[k]--;
            }
        }
        ll nn = cnt[0]*r + cnt[1]*c + cnt[2]*s;
        if(ans[i] == 0)ans[i] = nn;
        else if(ans[i] != nn)ans[i] = -1;
    }
}

int main(){
    while(cin >> p >> q && p){
        PP.clear();
        Q.clear();
        ans.clear();
        ans.resize(q-1,0);
        rep(i,p){
            string s;
            cin >> s;
            PP.push_back(s);
        }
        rep(i,q){
            string s;
            cin >> s;
            Q.push_back(s);
        }
        FOR(r,1,21){
            FOR(c,1,21){
                FOR(s,1,21){
                    if(check(r,c,s)){
                        // cout << r << " " << c << " " << s << endl;
                        solve(r,c,s);
                    }
                }
            }
        }
        cout << 0 << " ";
        rep(i,ans.size()){
            if(i != ans.size() - 1)cout << ans[i] << " ";
            else cout << ans[i] << endl;
        }
    }
}


Measured memory_bytes: 3140
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>

const int mod = 1e9 + 7;
const int kmax = 510000;

long long fact[kmax], fact_inv[kmax], inv[kmax];

void init_comb()
{
    fact[0] = fact[1] = 1;
    fact_inv[0] = fact_inv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < kmax; i++) {
        fact[i] = fact[i - 1] * i % mod;
        inv[i] = mod - inv[mod % i] * (mod / i) % mod;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
    }
}

long long comb(int n, int r)
{
    if (n < r) {
        return 0;
    }

    if (n < 0 || r < 0) {
        return 0;
    }

    return fact[n] * (fact_inv[r] * fact_inv[n - r] % mod) % mod;
}

template <typename T, T N>
class UnionFind {
    T parent_[N];
    T rank_[N];
    T size_[N];

public:
    UnionFind();
    T Root(T idx);
    bool IsSame(T x, T y);
    void Unite(T x, T y);
    T GetSize(T idx);
};

template <typename T, T N>
UnionFind<T, N>::UnionFind()
{
    for (T i = 0; i < N; i++) {
        parent_[i] = i;
        rank_[i] = 0;
        size_[i] = 1;
    }
}

template <typename T, T N>
T UnionFind<T, N>::Root(T idx)
{
    return parent_[idx] == idx ? idx : parent_[idx] = Root(parent_[idx]);
}

template <typename T, T N>
bool UnionFind<T, N>::IsSame(T x, T y)
{
    return Root(x) == Root(y);
}

template <typename T, T N>
void UnionFind<T, N>::Unite(T x, T y)
{
    x = Root(x);
    y = Root(y);
    if (x == y) {
        return;
    }

    if (rank_[x] < rank_[y]) {
        parent_[x] = y;
        size_[y] += size_[x];
    } else {
        parent_[y] = x;
        size_[x] += size_[y];
        if (rank_[x] == rank_[y]) {
            rank_[x]++;
        }
    }
}

template <typename T, T N>
T UnionFind<T, N>::GetSize(T idx)
{
    return size_[Root(idx)];
}

long long pow_mod(long long n, long long p, long long m)
{
    if (p == 0) {
        return 1;
    }

    if (p % 2 == 0) {
        long long t = pow_mod(n, p / 2, m);
        return t * t % m;
    }
    return n * pow_mod(n, p - 1, m) % mod;
}

long long nCr_mod(long long n, long long r)
{
    long long x = 1;
    for (long long i = n - r + 1; i <= n; i++) {
        x *= i;
        x %= mod;
    }

    long long a = 1;
    for (long long i = 1; i <= r; i++) {
        a *= i;
        a %= mod;
    }

    long long y = pow_mod(a, mod - 2, mod) % mod;

    return x * y % mod;
}

bool is_prime(long long n)
{
    if (n == 1) {
        return false;
    }

    for (long long i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            return false;
        }
    }

    return true;
}

int main()
{
    long long x, y;
    std::cin >> x >> y;

    long long ans = 0;
    for (auto i : { x, y }) {
        switch (i) {
        case 3:
            ans += 100000;
            break;
        case 2:
            ans += 200000;
            break;
        case 1:
            ans += 300000;
            break;
        }
    }

    if (x == y && y == 1) {
        ans += 400000;
    }

    std::cout << ans << std::endl;
}


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

using namespace std;
using ll = long long int;

const ll MOD = 1e9 + 7;

ll pow_fast(ll n, ll k) {
  if (k == 0) {
    return 1LL;
  }
  if (k == 1) {
    return n;
  }

  if (k % 2 == 0) {
    ll tmp = pow_fast(n, k / 2);
    return tmp * tmp % MOD;
  } else {
    ll tmp = pow_fast(n, (k - 1) / 2);
    tmp *= tmp;
    tmp %= MOD;
    return tmp * n % MOD;
  }
}

template <typename T>
class stack {
 private:
  vector<T> _vec;

 public:
  stack(){};

  void push(T n) {
    _vec.push_back(n);
    return;
  }

  void pop() {
    if (this->empty()) {
      return;
    }
    _vec.erase(_vec.end() - 1);
    _vec.shrink_to_fit();
    return;
  }

  size_t size() { return _vec.size(); }

  T top() { return _vec[this->size() - 1]; }
  bool empty() { return _vec.empty(); }
};

int main() {
  ll n;
  cin >> n;
  string x;
  cin >> x;
  ll ans = 0;
  ll cur = 0;

  for (ll i = 0; i < x.size(); i++) {
    if (x[i] == 'I') {
      cur += 1;
    } else {
      cur -= 1;
    }
    ans = max(ans, cur);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3612
using System;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] dp = new int[30];
            dp[0] = 1;
            dp[1] = 2;
            dp[2] = 4;
            for (int i = 3; i < 30; ++i) 
            {
                dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3];
            }
            while (true)
            {
                int n = int.Parse(Console.ReadLine());
                if (n == 0)
                    break;

                Console.WriteLine(dp[n - 1] / 3650 + 1);
            }
        }
    }
}

Measured memory_bytes: 5608
#include<iostream>
#include<queue>
using namespace std;
int H,W,N,a,b,c,d,nh,nw;
int cost[1000][1000];
char t[1000][1000];
queue< int > qh;
queue< int > qw;
int th[4]={0,-1,0,1};
int tw[4]={1,0,-1,0};
int map[10][2];
int bfs(int tah,int taw){
  int h,w,ans;
  while(!qw.empty()){
    h=qh.front(),qh.pop();
    w=qw.front(),qw.pop();
    for(int i=0;i<4;i++){
      nh=h+th[i];
      nw=w+tw[i];
      if(0<=nh&&nh<H&&0<=nw&&nw<W){
	if(nh==tah&&nw==taw){
	  ans=cost[h][w]+1;
	  return ans;
	}else if(cost[nh][nw]==-1){
	  qh.push(nh);
	  qw.push(nw);
	  cost[nh][nw]=cost[h][w]+1;
	}
      }
    }
  }
}
void syokika(){
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(cost[i][j]!=-2)cost[i][j]=-1;
    }
  }
  while(!qh.empty()){
    qh.pop();
    qw.pop();
  }
}
int main(){
  cin>>H>>W>>N;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cin>>t[i][j];
      if(t[i][j]=='S'){
	map[0][0]=i;
	map[0][1]=j;
      }else if(t[i][j]=='X'){
	cost[i][j]=-2;
      }else if(t[i][j]!='.'){
	map[t[i][j]-'0'][0]=i;
	map[t[i][j]-'0'][1]=j;
      }else{
	
      }
    }
  }
  int sum=0,a;
  for(int i=0;i<N;i++){
    syokika();

    qh.push(map[i][0]);
    qw.push(map[i][1]);
    cost[map[i][0]][map[i][1]]=0;
    a=bfs(map[i+1][0],map[i+1][1]);
    sum+=a;
  }
  cout<<sum<<endl;
  return 0;
}

Measured memory_bytes: 6100
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if a*2 <= b && (b-a*2)%2 == 0 && a*4 >= b {
		fmt.Print("Yes")
	} else {
		fmt.Print("No")
	}
}


Measured memory_bytes: 1752
//includes
#include<iostream>
#include<vector>
#include<set>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<map>
#include<queue>
#include<iomanip>
#include<numeric>
#include<assert.h>
#include<cstring>
#include<unordered_map>
#include<bitset>

//macros and consts
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define FORE(i,a) for(auto &i : a)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define accm accumulate
#define Fi first
#define Se second
#define INF 1e9
#define llINF (1LL<<60)
#define mINF -1e9
#define mllINF -(1LL<<60)
#define endl "\n"
#define CONT continue
#define BRK break
#define modulo(n, m) (((n)%(m)+(m))%m)

//shorter types
using namespace std;
using ll = long long;
using vi = std::vector<int>;
using vc = std::vector<char>;
using vll = std::vector<long long>;
using vs = std::vector<string>;
using Mi = map<int,int>;
using Mll = map<ll,ll>;
using UMi = unordered_map<int,int>;
using UMll = unordered_map<ll,ll>;
using Pi = pair<int,int>;
using Pll = pair<ll,ll>;
using vPi = vector<Pi>;
using vPll = vector<Pll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using pqgi = priority_queue<int,vector<int>,greater<int>>;
using pqsi = priority_queue<int,vector<int>,less<int>>;
using pqgll = priority_queue<int,vector<int>,greater<int>>;
using pssll = priority_queue<int,vector<int>,less<int>>;
template<class T>
using vec = vector<T>;

//here begins your code
signed main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  double H,A;
  cin >> H >> A;

  cout << ceil(H/A) << endl;
  //check types
  //do not eb if you resize
  //resize before you access by idx
  return 0;
} 

Measured memory_bytes: 256
#include <stdio.h>

#define ZERO 0
int main(){
	int slime_count;

	scanf("%d",&slime_count);

	int a[slime_count];                      /*各スライムの色（数字）*/
	int i = ZERO,    j     = ZERO;           /*ループ用変数*/
	int consecutive_count  = 1;              /*ある数字が連続した場合のその連続数*/
	int color_change_count = 0;              /*色（数字）を変更した回数*/

	/*指定したデータ分、入力を行う*/
	for(i = 0; i < slime_count ; i++){
		scanf("%d", &a[i]);
	}

	for(j = 0; j < slime_count ; j++){
		if(j == slime_count - 1)break;
		if(a[j] == a[j+1]){
			consecutive_count++;
			continue;
		}

		color_change_count += consecutive_count/2;
		consecutive_count = 1;
	}
	color_change_count += consecutive_count/2;

	printf("%d",color_change_count);

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define be begin()
#define en end()
#define le length()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (__typeof(n) i = 0; i < n; i++)
#define repo(i, n) for (__typeof(n) i = 1; i <= n; i++)
#define fastIO                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define eps 1e-6
#define pi 3.141592653589793
#define c(a) cout << a << "\n";
#define ao(a)        \
    for (auto i : a) \
        cout << i << " ";
typedef vector<int> vii;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MOD = 1e9 + 7;
const int INF = 1e9;
int main()
{
    ll n;
    cin >> n;
    for (int i = 1; i <= 9; i++)
    {
        if (n % i == 0 && (n / i) < 10)
        {
            c("Yes");
            return 0;
        }
    }
    c("No") return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    int n;
    cin >> n;
    vector<int> block(n);
    for(int i = 0;i < n;i++){
          cin >> block[i];
    }
    int terget = 1;
    int del = 0;
    for(int i = 0;i < n;i++){
          if(block[i] == terget){
                terget++;
          }else{
                del++;
          }
    }
    
    cout << ((del == n) ? -1 : del) << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
//#include <stack>
#include <climits>
#include <map>
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
#define all(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
using namespace std;
typedef long long ll;
//typedef unsigned long long ull;
typedef pair<int, int> P;


string s;

int main(){
    cin >> s;
    if(s.front()==s.back()){
        if(s.size()%2==0){
            put("First");
        }else{
            put("Second");
        }
    }else{
        if(s.size()%2==0){
            put("Second");
        }else{
            put("First");
        }
    }
    return 0;
}


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

//マクロ
#define FOR(i, a, b) for(int i = (a); i < (b), i++)
#define REP(i, n) FOR(i, 0, n);
#define ALL(a) (a).begin(),(a).end()

// 0-1ナップザック問題
// dpの一番最初
// dp[i][j] : i番目(-1インデックス)までの品物の中から重さがｊを超えないように選んだ時の、価値の総和の最大値

// 制約 1 <= n <= 100
// weight[i], value[i]は整数
// 1 <= weight[i], value[i] <= 1000
// 1 <= W <= 10000

#define int long long

signed main(){
    
    //入力
    int n, w; cin >> n >> w;
    vector<int> weight(n);
    vector<int> value(n);
    vector<vector<int> > dp(n, vector<int> (w + 1, 0));
    for(int i = 0; i < n; i++) cin >> weight[i] >> value[i];

    //dp
    for(int i = 0; i < n; i++){
        for(int j = 0; j <= w; j++){
            if(i == 0){
                if(j >= weight[i]) dp[i][j] = value[i];
            }else{
                if(j >= weight[i]) dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - weight[i]] + value[i]);
                else dp[i][j] = dp[i - 1][j];
            }
        }
    }

    /*for(int i = 0; i < n; i++){
        for(int j = 0; j <= w; j++){
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }*/

    cout << dp[n - 1][w] << endl;

    return 0;
}

Measured memory_bytes: 79488
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define EPS      (double)1e-9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cerr<<' ';cerr<<elem;}cerr<<endl;}

int main(){
	int n;
	cin>>n;
	
	vector<llong> a(n+1);
	REP(i,n) cin>>a[i];
	a[n]=0;
	
	llong money=1000;
	llong stock=0;
	REP(i,n){
		if(a[i]<a[i+1]){
			stock+=money/a[i];//買えるまで買う.
			money%=a[i];
		}else if(a[i]>a[i+1]){
			money+=a[i]*stock;//売れるまで売る.
			stock=0;
		}
	}
	
	cout<<money<<endl;
}

Measured memory_bytes: 3580
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    
    int[] s = new int[N+1];
    for (int i = 1; i <= N; i++) {
      s[i] = sc.nextInt();
    }
    
    boolean[][]dp = new boolean[N+1][10000+1];
    dp[0][0] = true;
    for (int i = 1; i <= N; i++) {
      for (int j = 0; j+s[i] <= 10000; j++){
        if (dp[i-1][j]) {
          dp[i][j] = true;
          dp[i][j+s[i]] = true;
        }
      }
    }

    int ans = 0;
    for (int j = 10000; j >= 0; j--) {
      if (dp[N][j] && j % 10 != 0) {
        ans = j;
        break;
      }
    }
    
    System.out.println(ans);
  }
}

Measured memory_bytes: 25940
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String s = sc.next();

		if (s.charAt(0) == s.charAt(1) && s.charAt(1) == s.charAt(2)) {
			System.out.println("No");
			return;
		}
		System.out.println("Yes");

	}

}


Measured memory_bytes: 35688
#include<stdio.h>

int main(){
	int n, x;
	scanf("%d%d", &n, &x);
	int l[n];
	for(int i = 0; i < n; i++){
		scanf("%d", l+i);
	}
	int bound[105];
	bound[0] = 0;
	int ans = 1;
	for(int i = 0; i < n; i++){
		bound[i+1] = bound[i] + l[i];
		if(bound[i+1] <= x) ans++;
	}
	printf("%d\n", ans);
} 


Measured memory_bytes: 1704
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
typedef pair<int, bool> sP;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<ll> vec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-5;
const ld pi = acos(-1.0);
typedef vector<vector<ll>> mat;
typedef vector<ll> vec;

void solve() {
	vector<P> v;
	int n; cin >> n;
	rep(i, n) {
		int a; cin >> a;
		v.push_back({ a,i });
	}
	sort(v.begin(), v.end());
	rep(i, v.size()) {
		if (i > 0)cout << " ";
		cout << v[i].second+1;
	}
	cout << endl;
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//init();
	solve();
	//stop
	return 0;
}



Measured memory_bytes: 1780
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>

using namespace std;


int main(){

  string a, b;
  cin >> a >> b;
  if (a.size() > b.size()){
    cout << "GREATER" << endl;
    return 0;
  }
  else if (a.size() < b.size()){
    cout << "LESS" << endl;
    return 0;
  }
  else {
    for (int i = 0; i < a.size(); i++){
      if (a[i] > b[i]){
        cout << "GREATER" << endl;
        return 0;
      }
      else if ((a[i] < b[i])){
        cout << "LESS" << endl;
        return 0;
      }
      else {
        continue;
      }
    }
  }

  cout << "EQUAL" << endl;

  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
n, *a = map(int, open(0).read().split())
for i in range(n - 1):
    if a[i] < 0:
        a[i] *= -1
        a[i + 1] *= -1
print(sum(a) - 2 * min(abs(i) for i in a) - 2 * a[-1] if a[-1] < 0 else sum(a))


Measured memory_bytes: 20000