akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long lol;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(lol i=0;i<lol(n);i++)
#define REPD(i,n) for(lol i=n-1;i>=0;i--)
#define FOR(i,a,b) for(lol i=a;i<=lol(b);i++)
#define FORD(i,a,b) for(lol i=a;i>=lol(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) lol(x.size()) //sizeをsize_tからllに直しておく
//定数
#define PI 3.1415926535897932385 //pi
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//最大値最小値
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main()
{
    lol result{1};
    lol n; cin >> n;
    lol k; cin >> k;
    lol nnega{0};
    bool fl = false;
    
    vector<lol> a(n);
    REP(i, n)
    {
        cin >> a[i];
        if(a[i] < 0)
            nnega++;
        if(a[i] == 0)
            fl = true;
    }
    lol l = 0, r = n-1;
    sort(ALL(a));
    if(nnega == n && k%2 == 1)
    {
        while(k != 1)
        {
            lol newn;
            newn = (a[r]*a[r-1])%MOD;
            result = (result*newn)%MOD;
            r -= 2; k -= 2;
        }
        result *= a[r];
    }
    else if(k%2 == 0)
    {
        while(k != 0)
        {
            if(a[l]*a[l+1] < a[r]*a[r-1])
            {
                lol newn;
                newn = (a[r]*a[r-1])%MOD;
                result = (result*newn)%MOD;
                r -= 2; k -= 2;
            }
            else
            {
                lol newn;
                newn = (a[l]*a[l+1])%MOD;
                result = (result*newn)%MOD;
                l += 2; k -= 2;
            }
            
        }
    }
    else
    {
        result = (result*a[r])%MOD;
        r--; k--;
        while(k != 0)
        {
            
            if(a[l]*a[l+1] < a[r]*a[r-1])
            {
                lol newn;
                newn = (a[r]*a[r-1])%MOD;
                result = (result*newn)%MOD;
                r -= 2; k -= 2;
            }
            else
            {
                lol newn;
                newn = (a[l]*a[l+1])%MOD;
                result = (result*newn)%MOD;
                l += 2; k -= 2;
            }
            
        }
        
    }
    if(fl && (result < 0))
        result = 0;

    if(result < 0)
    {
        lol sa = abs(result)%MOD;
        result = MOD - sa;
    }
    
    
    
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 4792
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll N; cin >> N ;
    vector<ll> H(N); for(auto& in:H) cin >> in;
    reverse(H.begin(),H.end());
    
    ll cnt = 0;
    for(int i = 1; i < N;i++){
        res = max(res,cnt);
        
        if(H[i] >= H[i-1]){
            cnt++;
        }else{
            cnt = 0;
        }
    }
    res = max(res,cnt);
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 1024
// atcoder/agc022/A/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }
template<typename P, typename Q> inline pair<Q, P> reverse(pair<P, Q> p) { return make_pair(p.second, p.first); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr lli mod = 1e9 + 7;

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  string s;
  while (cin >> s) {
    const string S = s;

    {
      set<char> vis;
      each (c, s) vis.insert(c);
      for (char c = 'a'; c <= 'z'; ++c) {
        if (vis.count(c) == 0) {
          s += c;
        }
      }
    }

    vector<string> v;
    string pref;
    for (int i = 0; i < s.size(); ++i) {
      pref += s[i];
      string t = pref;
      t.pop_back();
      set<char> vis;
      each (c, t) vis.insert(c);
      for (char c = pref.back() + 1; c <= 'z'; ++c) {
        if (vis.count(c) == 0) {
          t += c;
        }
      }
      each (c, t) vis.insert(c);
      for (char c = 'a'; c <= 'z'; ++c) {
        if (vis.count(c) == 0) {
          t += c;
        }
      }
      set<char> z(t.begin(), t.end());
      bool f = (z.size() == t.size());
      each (c, t) {
        f = f && ('a' <= c && c <= 'z');
      }
      if (f && S < t) {
        v.push_back(t);
      }
    }
    sort(v.begin(), v.end());

    if (v.empty()) {
      cout << -1 << endl;
      continue;
    }

    string x = v.front();
    string y;
    for (int i = 0; i < S.size(); ++i) {
      y += x[i];
      if (S < y) break;
    }
    if (S == y) y += x[S.size()];
    cout << y << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
//#include <random>
//#include <unordered_set>
#include <complex>
using namespace std;                     //设10的9次方+7=a； 
int main()                              //算n的阶乘，每当n的阶乘超过a时，都把n的阶乘%一下a，每次%掉的数肯定是a的整数倍，就算每次%掉的数还乘了下一个数， 
{                                      //甚至一直乘下去，最后总要%，也会一起%掉的，为避免溢出，所以如此做；每次%不掉的部分最后还是一样留下来 
    long long n,i,ans=1;              //
    cin>>n;                          //                      
    for(i=2;i<=n;i++) //--------------
    {
        ans*=i;
        if(ans>1000000007) ans%=1000000007;
    }
    cout<<ans;
    system ("pause"); 
    return 0;
}

Measured memory_bytes: 504
# 2つの入力を空白で分割し、数値化
N = int(input())

ans = {}

for a in range(1, 10):
    for b in range(1,10):
        ans[str(a * b)] = True


try:
    t = ans[str(N)]
    print("Yes")
except KeyError:
    # 例外処理
    print("No")



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

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

    int N;
    cin >> N;
    vector<int> A(N + 1);
    vector<int> B(N);
    for (int i = 0; i <= N; i++) {
        cin >> A[i];
    }
    for (int i = 0; i < N; i++) {
        cin >> B[i];
    }
    long long ans = 0;
    // b基準に回す
    for (int i = 0; i < N; i++) {
        if (A[i] != 0) {
            if (A[i] >= B[i]) {
                A[i] -= B[i];
                ans += B[i];
                B[i] = 0;
            } else {
                ans += A[i];
                B[i] -= A[i];
                A[i] = 0;
            }
        }
        if (A[i + 1] != 0) {
            if (A[i + 1] >= B[i]) {
                A[i + 1] -= B[i];
                ans += B[i];
                B[i] = 0;
            } else {
                ans += A[i + 1];
                B[i] -= A[i + 1];
                A[i + 1] = 0;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCorder
{
	public class Program
	{
		static void Main(string[] args)
		{
			Scanner cin = new Scanner();
			string s = cin.Next();
			string t = cin.Next();

			int n = s.Length;
			for (int i = 0; i < n; i++) {
				bool ok = true;
				for (int j = 0; j < n; j++) {
					if (s[(i + j) % n] != t[j]) {
						ok = false;
						break;
					}
				}

				if (ok) {
					Console.WriteLine("Yes");
					return;
				}
			}

			Console.WriteLine("No");
		}
	}

	public class Scanner
	{
		private readonly char[] delimiter_ = new char[] { ' ' };
		private string[] buf_;
		private int index_;

		public Scanner()
		{
			buf_ = new string[0];
			index_ = 0;
		}

		public string Next()
		{
			if (index_ < buf_.Length) {
				return buf_[index_++];
			}

			string st = Console.ReadLine();
			while (st == "") {
				st = Console.ReadLine();
			}

			buf_ = st.Split(delimiter_, StringSplitOptions.RemoveEmptyEntries);
			if (buf_.Length == 0) {
				return Next();
			}

			index_ = 0;
			return buf_[index_++];
		}

		public int Int() => int.Parse(Next());
		public long Long() => long.Parse(Next());
		public double Double() => double.Parse(Next());

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Int() + add;
			}
			return Array;
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Long() + add;
			}
			return Array;
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Double() + add;
			}
			return Array;
		}
	}
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
using pint = pair<int,int>;


const long long INFLL = 1LL << 60;
const int INFI = 1000000000;


int main(){
    long long N; cin >> N;
    long long m=pow(10,15)+10;
    for(int i=0;i<5;i++){long long n; cin >> n; if(n<m) m=n;}
    cout << 5+(N-1)/m<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int read()
{
	char s;
	int k=0,base=1;
	while((s=getchar())!='-'&&s!=EOF&&!(s>='0'&&s<='9'));
	if(s==EOF)exit(0);
	if(s=='-')base=-1,s=getchar();
	while(s>='0'&&s<='9')
	{
		k=k*10+(s-'0');
		s=getchar();
	}
	return k*base;
}
void write(int x)
{
	if(x<0)
	{
		putchar('-');
		write(-x);
	}
	else
	{
		if(x/10)write(x/10);
		putchar(x%10+'0');
	}
}
int x,t;
int main()
{
	x=read();t=read();
	if (t>=x)
	{
		printf("0");
		return 0;
	}
	printf("%d",x-t);
	return 0;
}


Measured memory_bytes: 256
import collections

N, M = map(int, input().split())
dic = {i+1:[] for i in range(N)}
for i in range(M):
    x, y = input().split()
    dic[int(x)].append(y)
    
ac = 0
cnt = 0
for key in dic.keys():
    tmp = 0
    tmp_ac = 0
    for i in range(len(dic[key])):
        if(dic[key][i] == "AC"):
            ac += 1
            tmp_ac = 1
            break
        tmp += 1
    if(tmp_ac == 1):
        cnt += tmp
print(ac, cnt)

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

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

costs = [0]*N

for i in range(1,N):
    tmp = costs[i-1]+abs(h[i]-h[i-1])
    for j in range(2,min(K+1,i+1)):
        tmp = min(tmp,costs[i-j]+abs(h[i]-h[i-j]))
    # print(tmp)
    costs[i] = tmp
    
print(costs[N-1])

Measured memory_bytes: 52832
#include <cstdio>
#include <vector>

using namespace std;

int cnt[600][600];

int main() {
    int n, d1, d2, i, j, k;
    vector <int> v;
    vector <pair<int, int>> ans;
    
    scanf("%d %d %d", &n, &d1, &d2);
    
    v.push_back(d1);
    v.push_back(d2);
    
    for (i = 0; i < 2; i++) {
        int c = 0;
        
        while (1) {
            if (v[i] % 2 == 1) {
                for (j = 0; j < n * 2; j++) {
                    for (k = 0; k < n * 2; k++) {
                        int x = j >> c;
                        int y = k >> c;
                        
                        if ((x + y) % 2 == 0) cnt[j][k]++;
                    }
                }
                
                break;
            } else if (v[i] % 4 == 2) {
                for (j = 0; j < n * 2; j++) {
                    for (k = 0; k < n * 2; k++) {
                        int x = j >> c;
                        int y = k >> c;
                        
                        if (x % 2 == 0) cnt[j][k]++;
                    }
                }
                
                break;
            } else {
                v[i] /= 4;
                c++;
            }
        }
    }
    
    for (i = 0; i < n * 2; i++) {
        for (j = 0; j < n * 2; j++) {
            if (cnt[i][j] == 2) ans.push_back(make_pair(i, j));
        }
    }
    
    for (i = 0; i < n * n; i++) printf("%d %d\n", ans[i].first, ans[i].second);
    
    return 0;
}


Measured memory_bytes: 3828
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>pii;
#define sf(x) scanf("%d",&x)
#define sfl(x) scanf("%lld",&x)
#define lli long long int
#define ll64 int64_t
#define pb push_back
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define frr(i,a) for(int i=0;i<a;i++)
#define frl(i,a) for(lli i=0;i<a;i++)
//priority_queue<int, vector<int>, std::greater<int> >
int main()
{
    lli n;
    cin>>n;
    lli x=(n/1000);
    if(n%1000>0)
    {
        x++;
    }
    lli ans=x*1000-n;
    cout<<ans<<endl;
}


Measured memory_bytes: 3632
A,B=map(int,input().split())
A=max(0,A-1)
P=[2**i for i in range(41)]
i=0
ans=0
while P[i]<=B:
  q=((B+1)//P[i])
  r=(B+1)%P[i]
  Q=((A+1)//P[i])
  R=(A+1)%P[i]
  coB=(q//2)*P[i]+[0,r][q%2]
  coA=(Q//2)*P[i]+[0,R][Q%2]
  if (coB-coA)%2==1:
    ans+=P[i]
  i+=1
print(ans)

Measured memory_bytes: 3064
S = $stdin.gets.chomp

(0..S.size).each { |i|
  if 1 <= i
    if S[i-1] == S[i]
      puts "#{i} #{i+1}"
      exit
    end
  end
  if 2 <= i
    if S[i-2] == S[i]
      puts "#{i-1} #{i+1}"
      exit
    end
  end      
}

puts "-1 -1"


Measured memory_bytes: 1916
#include <iostream>

int main() {
	int n;
	std::cin >> n;

	int ans = 1;
	for (int i = 0; i < n; ++i)
		ans *= 3;

	int sub = 1;
	for (int i = 0; i < n; ++i) {
		int a;
		std::cin >> a;
		sub *= (a % 2 == 0 ? 2 : 1);
	}

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

Measured memory_bytes: 256
/*
 
@author
_      _          _                 _      _
\\    // /\    | | \  |     |    /\ \\    //     
 \\  // /__\   | |_/  |_____|   /__\ \\  //
  \\// /    \  | | \  |     |  /    \ \\//
   \/ /      \ | |_/  |     | /      \ \/
@ Indian Institute of Technology Bhilai

With practice comes perfection,
with knowledge comes wisdom.
Incorporate wisdom in you, practice will harvest better results.
Always learn from others, your method is good but someone's even better.
Results take time, run for wisdom, for innovation, for getting better.
Points are mere objects, either you solve first or you solve better.
Seek for betterment, for quality, pace is important but cannot outstand
the quality you persist.
Times are bad just as now but it'll improve, this is my passion and I promise 
I won't let it go. I'll build myself again like a fighter gets back up after 
being thrown to the ground.
I'll learn. I bet that. I promise that.
*/
 
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
#define rep(i,n) for(ll i=0; i<n; i++)
#define rep1(i,n) for(ll i=1; i<=n; i++)
#define pb push_back
#define fi first
#define se second
#define all(v) v.begin(), v.end()
#define alla(arr,n) arr, arr+n
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define fsync ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const ll maxx =  1e9+7;

bool compare(const pair<ll,ll> &a, const pair<ll,ll> &b){
    return a.fi>b.fi;
}

ll inline power(ll a, ll b, ll p){
    a %= p;
    ll ans = 1;
    while(b>0){
        if(b & 1)
            ans = (ans*a)%p;
        a = (a*a)%p;
        b >>= 1;
    }
    return ans;
}

ll inv(ll n, ll p){
    return power(n,p-2, p);
}

bool inline isPrime(ll n) { 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
    for (ll i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
    return true; 
}

template<class T>
void printv(T &v, ll n){
    if(n==-1)
        n = v.size();
    rep(i,n)
        cout << v[i] << " ";
    cout << "\n";
}

void solve(){
    string s,t;
    cin>>s>>t;
    if(t.substr(0,s.length())==s)
        cout << "Yes\n";
    else
        cout << "No\n";
}

int main(){
    fsync
    ll test=1;
    // cin >> test;
    while(test--){
        solve();
    }
}

Measured memory_bytes: 3652
#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 <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>
#include <cstdint>
#include <tuple>
#include <regex>
#include <numeric>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
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(); }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#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())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define MOD 998244353
#define SQ(x) ((x)*(x))

bool prime[10000];
int primes[2000];
LL mat[501][501];

int main() {
	memset(prime, 1, sizeof(prime));
	prime[0] = prime[1] = false;
	int cnt = 0;
	REP(i, 10000) {
		if (!prime[i])continue;
		primes[cnt++] = i;
		for (int j = 2 * i; j < 10000; j += i)prime[j] = false;
	}
	REP(i, 501)REP(j, 501)mat[i][j] = 1LL;
	REP(t, 501) {
		int d = 2 * ((t + 1) / 2)*((t & 1) ? -1 : 1);
		REP(i, 501) {
			FOR(j, i+d-1 , i+d+2) {
				if (0 <= j && j <= 500)mat[i][j] *= primes[2*t + 1];
				if (0 <= j && j <= 500)mat[500-i][j] *= primes[2*t + 2];
			}
		}
	}
	REP(i, 501) {
		REP(j, 501) {
			if ((j^i) & 1)mat[i][j]++;
		}
	}
	int n;
	cin >> n;
	REP(i, n) {
		REP(j, n) {
			printf("%lld ", mat[i][j]);
		}
		printf("\n");
	}
	return 0;
}

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

int main() {
  int M, D;
  cin >> M >> D;
  int ans = 0;
  for (int d = 1; d <= D; d++) {
    int d1 = d % 10;
    if (d1 < 2) {
      continue;
    }
    int d10 = d % 100 / 10;
    if (d10 < 2) {
      continue;
    }
    if (d1 * d10 <= M) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
// 
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i,n) for(int i=0;i<int(n);i++)
#define e_b emplace_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> ipair;
typedef pair<ll,ll> lpair;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v) //vectorの中身を見る
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
void map_p(map<int,int>& d){cout<<"map: ";for(auto a : d){cout<<"{"<<a.first<<":"<<a.second<<"}";}cout<<endl;} //mapの中身を見る
void set_p(set<int>& d){cout<<"set: ";for(int a : d){cout<<a<<" ";}cout<<endl;} //setの中身を見る


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

    int n;
    cin>>n;
    int a=(n+999-(n+999)%1000)/1000;
    cout<<1000*a-n<<endl;
    return 0;
}

Measured memory_bytes: 3640
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean foundC = false;
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (!foundC && c != 'C') {
                continue;
            }
            foundC = true;
            if (c == 'F') {
                System.out.println("Yes");
                return;
            }
        }
        System.out.println("No");
    }

}


Measured memory_bytes: 21716
#include <iostream>
#include <cmath>
#include <climits>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <map>
#include <numeric>
#include <set>
using namespace std;

#define ll long long
#define ld long double
#define pi 3.14159265359;

// v:vector  type:型  order:greater or less
#define _sort(v,type,order) do { sort(v.begin(),v.end(),order<type>()); } while(0)
// vector 要素の総和算出
// v:vector  default_value:初期値
#define _sum(v,default_value) accumulate(v.begin(),v.end(),default_value )
// vector 最大値( return ite )
#define _max_element(v) max_element(v.begin(),v.end())
// vector 最大値が格納されている要素値
#define _max_element_number(v) distance(v.begin(),max_element(v.begin(),v.end()))
// 特定コンテナの中から特定の値をカウントする
#define _count(v,value) count(v.begin(),v.end(),value)

//set<uint32_t> member;	// 重複するデータを保持する事はできない member.insert(2) member.insert(2) ⇒ member.count(2)は1
//                                                              member.emplace(2)とかも同じ
//multiset<uint32_t> v;	// 重複するデータも保持する事はできる   member.insert(2) member.insert(2) ⇒ member.count(2)は2

// 丸め
#define _round(v) round(v)
// 2乗 / 3乗
#define _square(v) pow(v,2)
#define _cube(v)   pow(v,3)
// 大小判定
#define _max(x,y) max(x,y)
#define _min(x,y) min(x,y)
// string ⇒ int
#define _stringtoi(s) stoi(s)
// double 平方根
#define _sqrt(x) sqrt(x)
// double 引数 x 以上で最小の整数値 ex) 3.30303 ⇒ 4
#define _ceil(x) ceil(x)
// 指定された要素以上の値が現れる最初の位置のイテレータを取得する
#define _lower_bound(v,min) lower_bound(v.begin(), v.end(), min)
// 指定された要素より大きい値が現れる最初の位置のイテレータを取得する
#define _upper_bound(v,min) upper_bound(v.begin(), v.end(), min)

// 順列 n個の数が与えられる
// 0,1,2,...,n-1
// 全ての並べ方を1行ごとに出力する
// ex 0 1 2 / 0 2 1 / 1 0 2 / 1 2 0 / 2 0 1 / 2 1 0
#define _next_permutation(v) do {   \
	for (auto num : v) {            \
		printf("%d ", num);         \
	}                               \
	printf("\n");                   \
} while (next_permutation(v.begin(), v.end()))

// 絶対値
static int32_t _abs(const int32_t x) { return  (x > 0 ? x : -x); }
// 最大公約数
static int gcd(int a, int b)
{
	if (a < b) {
		a ^= b;
		b ^= a;
		a ^= b;
	}
	return b ? gcd(b, a % b) : a;
}
// 最小公倍数
static int lcm(int a, int b) { return a * b / gcd(a, b); }
// 多次元 std::vector 生成
template<class T>
vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...)); }
// ex) auto dp = make_vec<uint64_t>(SIZE + 1, 2, 2);

// UINT32_MAX
// 4294967295 ≒ 4 * 1e9 


/*

*/
// ABC 161 A
// https://atcoder.jp/contests/abc161/tasks/abc161_a
int main()
{
	uint32_t a,b,c;

	cin >> a >> b >> c;
	printf("%d %d %d\n", c, a, b);

	return 0;
}

Measured memory_bytes: 3684
#include <bits/stdc++.h> 
 
#define INF (1<<31) - 1 //INT_MAX/2
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using P = std::pair<int, int>;

int main(int argc, char *argv[])
{
    int N, K;
    std::cin >> N >> K;

    std::vector<int> h(N);
    for (int i = 0; i < N; i++) {
        std::cin >> h[i];
    }

    std::sort(h.rbegin(), h.rend());

    ll min = INF;
    for (int i = 0; i < N-K+1; i++) {
        int temp = h[i] - h[i+K-1]; 
        if (min > temp) {
            min = temp;
        }
    }

    std::cout << min << std::endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 301;

struct edge
{
    int from,to,cost;
    bool operator<(const edge& another) const {
		return cost < another.cost;
	}
};

struct eda
{
    int to,cost;
};

ll d[MAX_N][MAX_N];
vector<edge> es;
ll len[MAX_N];
vector<eda> G[MAX_N];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    rep(i,n){
        rep(j,n){
            cin >> d[i][j];
        }
    }
    rep(i,n){
        if(d[i][i] != 0){
            cout << "-1\n";
            return 0;
        }
        for(int j=i+1;j<n;j++){
            if(d[i][j] != d[j][i]){
                cout << "-1\n";
                return 0;
            }
        }
    }
    rep(i,n){
        for(int j=i+1;j<n;j++){
            ll mn = (1LL<<60);
            rep(k,n){
                mn = min(mn,d[i][k]+d[k][j]);
            }
            if(d[i][j] != mn){
                cout << "-1\n";
                return 0;
            }
        }
    }
    rep(i,n){
        for(int j=i+1;j<n;j++){
            es.pb((edge){i,j,d[i][j]});
        }
    }
    sort(all(es));
    ll ans = 0;
    rep(i,es.size()){
        int u = es[i].from,v = es[i].to;
        rep(j,n){
            len[j] = (1LL << 60);
        }
        queue<int> que;
        que.push(u);
        len[u] = 0;
        while(!que.empty()){
            int p = que.front();
            que.pop();
            rep(j,G[p].size()){
                if(len[p]+G[p][j].cost < len[G[p][j].to]){
                    len[G[p][j].to] = len[p]+G[p][j].cost;
                    que.push(G[p][j].to);
                }
            }
        }
        if(len[v] > d[u][v]){
            G[u].pb((eda){v,d[u][v]});
            G[v].pb((eda){u,d[u][v]});
            ans += d[u][v];
        }
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int a[100001], b[100001];

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    sort (a, a + n);
    int j = 0;
    for (int i = 0; i < n; ++i) {
        if (i != n-1) {
            while (a[i] == a[i+1]) {
                b[j]++;
                i++;
            }
        }
        b[j]++;
        j++;
    }
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        if (b[i] % 2 != 0) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
n,h=map(int,input().split())
A=list(tuple(map(int,input().split())) for i in range(n))
A,B=zip(*A)
a=max(A)
count=0
for i in sorted(B)[::-1]:
    if h<=0:break
    elif i>=a:
        count +=1
        h -=i
if h>0:
    if h%a==0:count +=h//a
    else:count +=h//a+1

print(count)

Measured memory_bytes: 25304
#! /usr/bin/ruby -w
# encoding: utf-8
#
# ??????????????????
#

def puts_array(a)
  sep = ''
  a.each do |e|
    print sep + e.to_s
    sep = ' '
  end
  puts
end

def bubble_sort(a, n)
  count = 0
  0.upto(n - 1) do |i|
    (n - 1).downto(i + 1) do |j|
      e1 = a[j]
      e2 = a[j - 1]
      if e1 < e2
        a[j] = e2
        a[j - 1] = e1
        count += 1
      end
    end
  end
  count
end
if $0 == __FILE__
  n = gets.to_i
  a = gets.chomp.split.map(&:to_i)
  n = bubble_sort(a, n)
  puts_array(a)
  puts n
end

Measured memory_bytes: 8640
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;
long long int INF = 1e18;
long long int MOD = 1000000007;

int main(){
	
	while(true){
		int n;
		cin >> n;
		if(n == 0){
			break;
		}
		
		vector<int> v;
		
		string str1, str2;
		cin >> str1 >> str2;
		
		int num = (str1[0] - str2[0] + 10) % 10;
		v.push_back(num);
		
		for(int i = 1; i < n; i++){
			int d1 = str1[i] - str1[i - 1];
			int d2 = str2[i] - str2[i - 1];
			num = (d1 - d2 + 100) % 10;
			v.push_back(num);
		}
		
		num = (str2[n - 1] - str1[n - 1] + 10) % 10;
		v.push_back(num);
		
		sort(v.begin(), v.end());
		
		int ans = 10000;
		
		do{
			int cnt = 0;
			int pre = 0;
			int S = 0;
			for(int i = 0; i < v.size(); i++){
				S += v[i];
				if(S % 10 == 0){
					cnt += i - pre;
					pre = i + 1;
				}
			}
			ans = min(ans, cnt);
		}while(next_permutation(v.begin(), v.end()));
		
		cout << ans << endl;
	}
	
	return 0;
}



Measured memory_bytes: 3104
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <list>
#include <stack>
#include <queue>
#include <utility>

using namespace std;

#define ll long long
#define MOD 1000000007
#define rep(i, n) for(int i = 0;i < n;i++)


int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    int counter = 1;
    for (int i = 1; i < n; i++)
    {
        if (s[i]!=s[i-1])
        {
            counter++;
        }
    }
    cout << counter << endl;
    
}

Measured memory_bytes: 512
#[allow(unused_imports)]
use proconio::{input, marker::*};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

fn main() {
    use std::f64::consts::PI;
    input! {
        a: f64,
        b: f64,
        h: f64,
        m: f64,
    }

    let th = PI / 2.0 - (h + m / 60.0) * 2.0 * PI / 12.0;
    let tm = PI / 2.0 - m * 2.0 * PI / 60.0;

    let hx = a * th.cos();
    let hy = a * th.sin();
    let mx = b * tm.cos();
    let my = b * tm.sin();

    let dx = hx - mx;
    let dy = hy - my;

    println!("{}", (dx * dx + dy * dy).sqrt());
}


Measured memory_bytes: 2916
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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

    int a,b;
    cin >>a >> b;
    int x=b-a;
    int ans=0;
    for(int i=1;i<=x;i++){
        ans+=i;
    }
    cout << ans-b << endl;



}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
    int i,j;
    int h,w;
    
    scanf("%d",&h);
    scanf("%d",&w);
    
    char S[h+1][w+1];
    int B[h+1][w+1];
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            B[i][j] = 0;
        }
    }
    
    for(i=0;i<h;i++){
        scanf("%s",S[i]);
    }
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            if(S[i][j] == '#'){
                if(i>=1 && j>=1) B[i-1][j-1]++;
                if(i>=1) B[i-1][j]++;
                if(i>=1 && j<=w-1) B[i-1][j+1]++;
                if(j>=1) B[i][j-1]++;
                if(j<=w-1) B[i][j+1]++;
                if(i<=h-1 && j>=1) B[i+1][j-1]++;
                if(i<=h-1) B[i+1][j]++;
                if(i<=h-1 && j<=w-1) B[i+1][j+1]++;
                //bombN
                
                
            }
        }
    }
    
    
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            if(S[i][j] == '#'){
                printf("#");
            }else{
                printf("%d",B[i][j]);
            }
        }
        printf("\n");
    }
    return 0;
}



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

const int MAX = 1e6+1;

void solve(){
    int n; cin>>n;
    int arr[n];
    for (int i=0; i<n; i++)
        cin>>arr[i];

    int cont = 0;
    for (int i=0; i<n-2; i++){
        int a = arr[i];
        for (int j=i+1; j<n-1; j++){
            int b = arr[j];
            for (int k=j+1; k<n; k++){
                int c = arr[k];
                if(a+b>c && a+c>b && b+c>a && a^b && b^c && a^c)
                    cont++;
            }
        }
    }
    cout<<cont<<endl;
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 3628
N = int(input())
A, B = map(int,input().split())
li = list(map(int, input().split()))

cd1 = 0
cd2 = 0
cd3 = 0

for n in li:
    if n <= A: cd1 += 1
    elif n >= A + 1 and n <= B : cd2 += 1
    elif n >= B+1: cd3 += 1

print(min(cd1, cd2, cd3))


Measured memory_bytes: 3060
module Main where

import Control.Applicative
import Numeric

main :: IO ()
main = loop

loop :: IO ()
loop = do
  { [h, w] <- getInts
  ; if h == 0 && w == 0 then done
    else do
      { putStrLn $ unlines $ frame h w
      ; loop
      }
  }

tedge :: Int -> String
tedge n = replicate n '#'

mbody :: Int -> String
mbody n = case n of
            0 -> ""
            1 -> "#"
            _ -> "#" ++ replicate (n-2) '.' ++ "#"

frame :: Int -> Int -> [String]
frame h w = case h of
          0 -> []
          1 -> [tedge w]
          _ -> [tedge w] ++ replicate (h-2) (mbody w) ++ [tedge w]

--

getInts :: IO [Int]
getInts = map read . words <$> getLine

putInts :: [Int] -> IO ()
putInts = putStrLn . unwords . map show

getDoubles :: IO [Double]
getDoubles = map read . words <$> getLine

putDoubles :: [Double] -> IO ()
putDoubles = putStrLn . unwords . map showDouble

showDouble :: Double -> String
showDouble d = showFFloat Nothing d ""

done :: IO ()
done = return ()



Measured memory_bytes: 4228
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
using ll = long long;
int main(){
	ll n,x,mid,sum,ans;
	cin >> n;
	vector<long long> vc(n);
	for(ll i=0;i<n;i++){
			cin >> vc[i];
			vc[i]-=(i+1);
	}
	if(n==1){
		cout << 0 << endl;
		return 0;
	}
	sort(vc.begin(),vc.end());
	sum = 0;
	mid = (vc[n/2]);
	for(ll i=0;i<n;i++)	sum+=abs(vc[i]-mid);
	ans = sum;
	sum = 0;
	mid = vc[n/2+1];
	for(ll i=0;i<n;i++)	sum+=abs(vc[i]-mid);
	ans = min(ans,sum);
	sum = 0;
	mid = vc[n/2-1];
	for(ll i=0;i<n;i++)	sum+=abs(vc[i]-mid);
	ans = min(ans,sum);
	cout << ans << endl;
	return 0;
}

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

int n,m,cnt,black,white,flag[maxn],head[maxn];

struct E{
	int to,nxt;
}edge[maxn<<1];

inline void add(int u,int v){edge[++cnt]=(E){v,head[u]};head[u]=cnt;}

void dfs(int u,int col){
	flag[u]=col;
	for(int i=head[u];i;i=edge[i].nxt){
		int v=edge[i].to;
		if(flag[v]==-1) dfs(v,col^1);
		if(flag[v]==col){
			printf("%lld",n*(n-1)/2-m);
			exit(0);
		}
	}
}

signed main(){
	scanf("%lld%lld",&n,&m);
	memset(flag,-1,sizeof(flag));
	for(int i=1;i<=m;i++){
		int x,y;
		scanf("%lld%lld",&x,&y);
		add(x,y);
		add(y,x);
	}
	dfs(1,0);
	for(int i=1;i<=n;i++) flag[i] == 1 ? white++ : black++;
	printf("%lld",white*black-m);
	return 0;
}

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

typedef long long int ll;
typedef pair<int,int> pi;
priority_queue<pi, vector<pi>, greater<pi> > pq; //min heap

ll mini(ll a,ll b){	return a<b?a:b;}
ll maxi(ll a,ll b){	return a>b?a:b;}
ll gcd(ll a,ll b){	if(b == 0)	return a;return gcd(b,a%b);}
ll binpow(ll n,ll x){	ll ans = 1;while(x){if(x & 1)	ans *= n;n *= n;x >>= 1;}return ans;}

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

    ll a;
    cin>>a;

    cout<<a + a*a + a*a*a<<"\n";

    return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define NMAX 110000
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

int main()
{	
    int x,a;
	cin>> x >> a;
    if(x < a) cout << 0 << endl;
    else cout << 10 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>

using namespace std;


class Solution{

public:
    bool isHaiku(vector<int>& lines){

        sort(lines.begin(), lines.end());
        return lines[0] == 5 && lines[1] == 5 && lines[2] == 7;
    }
};

int main() {

    vector<int> lines(3);
    for(int i = 0; i < 3; i ++)
        scanf("%d", &lines[i]);

    printf("%s\n", Solution().isHaiku(lines) ? "YES" : "NO");

    return 0;
}


Measured memory_bytes: 3632
#include <stdlib.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
const long long INF=1LL << 60;
long long a,b;
long long dp[100200][110];
long long w[110],v[110];

int main() {
    int n,a,b,c,d;
    cin>>n>>a>>b>>c>>d;
    string way;
    cin>>way;
    a-=1;b-=1;c-=1;d-=1;
    if(c<d){
        bool flag=true;
        for(int i=a;i<=d;i++){
            if(way.at(i)=='#'&&way.at(i+1)=='#'){
                flag=false;       
            }
        }
        if(flag){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
    else{
        bool flag=false;
        for(int i=b;i<=d;i++){
            if(way.at(i-1)=='.'&&way.at(i)=='.'&&way.at(i+1)=='.'){
                flag=true;
            }
        }
        if(flag){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
}


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

using namespace std;

int main() {
	int n; scanf("%d", &n);
	map<int, int> occs;
	for (int i = 0; i < n; ++i) {
		int x; scanf("%d", &x);
		occs[x]++;
	}
	// a b a^b a b a^b a (= b)
	// x x 0 x x 0
	//
	string answer = "No";
	if (occs.count(0) > 0 && occs[0] == n) answer = "Yes";
	if (n % 3 == 0) {
		bool allEqual = true;
		int xorAll = 0;
		if (occs.size() == 3) {
			for (auto pp : occs) {
				if (pp.second != n / 3) allEqual = false;
				xorAll ^= pp.first;
			}
		} else xorAll = 1;
		if (allEqual && (xorAll == 0)) answer = "Yes";
		if (occs.size() == 2 && occs[0] == n/3) answer = "Yes";
	}
	printf("%s\n", answer.c_str());
	return 0;
}


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

using namespace std;

int cor;
string pred, act;

int main () {
  cor = 0;
  cin >> pred >> act;
  for(int ana = 0; ana < 3; ana++) {
    if(pred[ana] == act[ana]) cor++;
  }
  cout << cor << '\n';
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    char str[10];
    scanf("%s", str);
    int len = strlen(str), sum = 0;
    for (int i = 0; i < len; i++) {
        sum += str[i] - '0';
    }
    if (sum == 1) sum *= 10;
    printf("%d\n", sum);
    return 0;
}


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

using namespace std;
typedef long long ll;

inline int at(ll x, int k){ return (x >> k) & 1; }
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)


int main() {
	string s;
	cin >> s;
	if(s=="ABC"){
		cout << "ARC" << endl;
	}
	else{
		cout << "ABC" << endl;
	}



}


Measured memory_bytes: 3620
//{
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(i,n) memset(i,n,sizeof i)
#define X first
#define Y second
#define SZ(_a) (int)_a.size()
#define ALL(_a) _a.begin(),_a.end()
#define pb push_back
#ifdef brian
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // brian
//}


const ll MAXn=1e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=ll(1e15);

ll dp[2][MAXn];

void add(ll &a, ll b)
{
    a += b;
    if(a >= MOD) a -= MOD;
}
void sub(ll &a, ll b)
{
    a -= b;
    if(a < 0)a += MOD;
}


int main()
{
    IOS();
    bool fg = 0;
    dp[0][0] = 1;
    ll n, k;
    cin>>n>>k;
    while(n--)
    {
        fg = !fg;
        ll a;
        cin>>a;
        ll s = 0;
        for(int i = 0;i <= k;i ++)
        {
            add(s, dp[!fg][i]);
            if(i - a - 1>= 0)sub(s, dp[!fg][i - a - 1]);
            dp[fg][i] = s;
        }
    }
    cout<<dp[fg][k]<<endl;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    string s[n];
    int t[n];
    for(int i=0;i<n;i++){
        cin >> s[i] >> t[i];
    }
    string x;
    cin >> x;
    int y=0;
    for(int i=0;i<n;i++){
        if(x==s[i]){
            for(int j=i+1;j<n;j++){
                y+=t[j];
            }
            cout << y;
            return 0;
        }
    }
    cout << 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
    ll n,i,count=0; cin>>n;
    ll a[n+1],b[n];
    for(i=0;i<n+1;i++) cin>>a[i];
    for(i=0;i<n;i++) cin>>b[i];
    for(i=0;i<n;i++){
        if(a[i]<=b[i]){
            b[i]-=a[i];
            count+=a[i];
            a[i]=0;
            if(a[i+1]<=b[i]){
                count+=a[i+1];
                a[i+1]=0;
            }else{
                count+=b[i];
                a[i+1]-=b[i];
            }
        }else{
            count+=b[i];
        }
    }
    cout<<count<<"\n";
}

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

#define all(A) begin(A), end(A)
#define rall(A) rbegin(A), rend(A)
#define sz(A) int(A.size())
#define pb push_back
#define mp make_pair

using namespace std;

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

int main () {
  ios::sync_with_stdio(false); cin.tie(0);
  int p;
  cin >> p;
  auto mul = [&] (int a, int b) { return (a * b) % p; };
  auto add = [&] (int a, int b) { return (a + b) % p; };
  auto modPow = [&] (int a, int b) {
    int ret = 1;
    while (b) {
      if (b & 1) ret = mul(ret, a);
      a = mul(a, a);
      b >>= 1;
    }
    return ret;
  };
  vector <int> fact(p);
  vector <int> inv(p);
  fact[0] = fact[1] = 1;
  inv[0] = inv[1] = 1;
  for (int i = 2; i < p; i++) {
    fact[i] = mul(fact[i - 1], i);
    inv[i] = modPow(fact[i], p - 2);
  }
  vector <vector <int>> bin(p, vector <int> (p, -1));
  auto binomial = [&] (int a, int b) {
    if (bin[a][b] != -1) return bin[a][b];
    return bin[a][b] = mul(mul(fact[a], inv[b]), inv[a - b]);
  };
  vector <int> ans(p, 0);
  for (int i = 0; i < p; i++) {
    int bit;
    cin >> bit;
    if (bit == 0) continue;
    int power = 1;
    for (int k = 0; k < p; k++) {
      int coef = p - binomial(p - 1, k);
      ans[p - 1 - k] = add(ans[p - 1 - k], mul(coef, power));
      power = mul(power, p - i);
    }
    ans[0] = add(ans[0], 1);
  }
  for (int i = 0; i < p; i++) cout << ans[i] << " \n"[i == p - 1];
  return (0);
}


Measured memory_bytes: 35584
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<string, int> P;

bool pairCompare(const P& firstElof, const P& secondElof)
{
  if(firstElof.first != secondElof.first){
    return firstElof.first < secondElof.first;
  }else{
    return firstElof.second > secondElof.second;
  }
}

int main(){
  int n; cin >> n;
  vector<P> vec;
  vector<string> ls_string(n);
  vector<int> ls_int(n);
  for(int i=0; i<n; i++){
    cin >> ls_string[i] >> ls_int[i];
    vec.push_back(make_pair(ls_string[i], ls_int[i]));
  }
  sort(vec.begin(), vec.end(), pairCompare);
  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++){
      if(vec[i].first == ls_string[j] && vec[i].second == ls_int[j]){
        cout << j+1 << endl;
        break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>
#include <list>
#include <queue>
#include <stack>

using namespace std;


int main() {
	string s;
	cin >> s;
	if (s[0] == '7' || s[1] == '7' || s[2] == '7')cout << "Yes" << endl;
	else cout << "No" << endl;


	return 0;
}



Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s; cin >> s;
  vector<long long> dp(2019);
  long long ans = 0LL;
  for (char c : s) {
  	vector<long long> dp2(2019);
    for (int i = 0; i < 2019; i++) {
    	dp2[(i * 10 + (c - '0')) % 2019] += dp[i]; 
    }
    dp2[c - '0']++;
    ans += dp2[0];
    dp.swap(dp2);
  }
  cout << ans << endl;
}


Measured memory_bytes: 3740