akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <math.h>
#include <string>
#include <sstream>
#include <stack>
#include <deque>
#define pb push_back
#define make make_pair
#define kaku(a) cout << a << endl
#define isort(a) sort(a.begin(),a.end())

using namespace std;

#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define PI 3.14159265359
long long gcd(long long a,long long b){ return b==0?a:gcd(b,a%b);}
long long lcm(long long a,long long b){ return a/gcd(a,b)*b;}

typedef pair<ll,ll> Pair;
const ll inf =1000000007;

int main(){
    int i,N,P;
    string s;
    cin >> s;
    P=2019;
    N=s.size();
    vector<int> S(N);
    for(i=0; i<N; i++){
        S[i]=s[i]-'0';
    }
    long long ans=0;
    if(P == 2 || P == 5){
        for(i=0; i<N; i++){
            if(S[i]%P == 0) ans += i+1;
        }
        cout << ans;
    }
    else{
        vector<long long> ret(P,0);
        vector<int> digit_ret(N);
        long long tmp=1;
        //初期化
        for(i=0; i<N; i++){
            digit_ret[i] = tmp;
            tmp = (tmp*10)%P;
        }
        tmp = 0;
        for(i=N-1; i>=0; i--){
            tmp = (tmp + S[i]*digit_ret[N-i-1])%P;
            ret[tmp]++; //あまりがtmpのところを++してる？
        }
        for(i=0; i<P; i++){
            tmp = ret[i];//あまりについて計算
            ans += tmp*(tmp-1)/2;
        }
        cout << ans+ret[0];
    }
    return 0;
}

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

int main() {

int H, N;
int sum=0;
cin >> H >> N;
vector<int> vec(N+1);
for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
    sum += vec.at(i);
}

if(H>sum){
    cout << "No" << endl;
}
else{
    cout << "Yes" << endl;
}

}

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

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

  int n, k;
  cin >> n >> k;
  set<int> s;
  for (int i = 0; i < k; ++i) {
    int m;
    cin >> m;
    while (m--) {
      int x;
      cin >> x;
      s.insert(x);
    }
  }

  cout << n - s.size() << '\n';
}

Measured memory_bytes: 3656
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

A,B,C = LI()
K = I()



for i in range(K):
    if A >= B:
        B *= 2
    elif B >= C:
        C *= 2

if A < B < C:
    print('Yes')
else:
    print('No')

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

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define rrep(i, n) for(ll i=(n)-1; i >=0; i--)
#define ALL(v) v.begin(),v.end()
#define rALL(v) v.rbegin(),v.rend()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define debug_print(var) cerr << #var << "=" << var <<endl;
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cerr<<v[i]<<" "
#define fi first
#define se second

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct edge{ll x, c;};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  ll b=mod, u=1, v=0;
  while(b){
    ll t=a/b;
    a-=t*b; swap(a, b);
    u-=t*v; swap(u, v);
  }
  u%=mod;
  if(u<0)u+=mod;
  return u;
}

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

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}
/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll x;
  cin >> x;
  cout << 1-x<<endl;
  return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
//#include <stdio.h>
//#include <stack>
//#include <queue>
#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <fstream>
//#include <list>
//#include <iomanip>
#include <cctype>

using namespace std;

#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(),z.end())
#define eerase(z) z.erase(unique(z.begin(),z.end()),z.end())


void printVec(std::vector<int> & vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
void printVec1(std::vector<string>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
	vector.erase(vector.begin() + index);
}

int vector_finder(std::vector<string> vec, string number) {
	auto itr = std::find(vec.begin(), vec.end(), number);
	size_t index = std::distance(vec.begin(), itr);
	if (index != vec.size()) { // 発見できたとき
		return 1;
	}
	else { // 発見できなかったとき
		return 0;
	}
}

#include <sstream> 
std::vector<std::string> StringSplit(const std::string& str, char sep)
{
	std::vector<std::string> v;
	std::stringstream ss(str);
	std::string buffer;
	while (std::getline(ss, buffer, sep)) {
		v.push_back(buffer);
	}
	return v;
}

Int gcd(Int a, Int b) {
	return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(Int a, Int b) {
	return a * b / gcd(a, b);
}

bool comp(const string a, const string b) {
	return a.length() < b.length();
}

bool integer(double num) {
	return floor(num) == num;
}

string gen(int num) {
	string str = "";
	for (int i = 0; i < num; i++) str += ".";
	return str;
}
Int fact(int num) {
	if (num == 0) return 1;
	else return num * fact(num - 1);
}

int main() {
	string s; cin >> s;
	int apos = 1000000, zpos = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'A') apos = min(apos, i);
		if (s[i] == 'Z') zpos = max(zpos, i);
	}
	cout << zpos - apos + 1;

	
	cout << endl;
	return 0;
}

Measured memory_bytes: 640
#coding: UTF-8

while True:
	l = raw_input().split()
	H = int(l[0])
	W = int(l[1])

	if H == 0 and W == 0:
		break

	else:
		a = 0
		if H % 2 == 0 and W % 2 == 0:
			while a < H:
				print "#." * int (W / 2) +"\n" +".#" * int (W / 2)
				a += 2
			print 

		if H % 2 == 0 and W % 2 != 0:
			while a < H:
				print "#." * int (W / 2)+"#" +"\n" +".#" * int (W / 2)+"."
				a += 2
			print 

		a = 1
		if H % 2 != 0 and W % 2 == 0:
			while a < H:
				print "#." * int (W / 2) +"\n" +".#" * int (W / 2)
				a += 2
			print"#." * int(W/2) 
			print

		if H % 2 != 0 and W % 2 != 0:
			while a < H:
				print "#." * int (W / 2)+"#" +"\n" +".#" * int (W / 2)+"."
				a += 2
			print"#." * int(W/2)+"#"
			print 

Measured memory_bytes: 6476
import java.util.*;

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

        Integer[] D = new Integer[3];

        for (int i = 0; i < 3; i++)
            D[i] = sc.nextInt();
        Arrays.sort(D);

        System.out.println(D[0] + D[1]);

    }
}


Measured memory_bytes: 21844
S=list(str(input()))
a=[]
for i in range(len(S)):
    if (i+1)%2==0 and (S[i]=='L' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    elif (i+1)%2==1 and (S[i]=='R' or S[i]=='U' or S[i]=='D'):
        a.append('Yes')
    else:
        a.append('No')
if 'No' in a:
    print('No')
else:
    print('Yes')

Measured memory_bytes: 9028
import { readFileSync } from "fs";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const range = (n: number | bigint) => [...Array(Number(n))].map((_, i) => i);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const tuple = <T extends unknown[]>(...ts: T) => ts;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [cin, nCin, biCin] = (() => {
  const inputs = readFileSync("/dev/stdin", "utf-8").split(/[\n|\s]+/);
  let count = 0;
  const cin = () => inputs[count++];
  return tuple(
    cin,
    () => Number(cin()),
    () => BigInt(cin())
  );
})();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const isNumber = (x: unknown): x is number => typeof x === "number";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const isBigint = (x: unknown): x is bigint => typeof x === "bigint";
type NumberOrBigintOrElse<T> = number | bigint extends T
  ? undefined
  : T extends number
  ? number
  : T extends bigint
  ? bigint
  : undefined;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const max = <T extends number | bigint>(...ts: T[]): NumberOrBigintOrElse<T> =>
  (ts.length === 0
    ? undefined
    : typeof ts[0] === "number"
    ? Math.max(...((ts as unknown) as number[]))
    : ((ts as unknown) as bigint[]).reduce((acc, t) =>
        acc >= t ? acc : t
      )) as NumberOrBigintOrElse<T>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const min = <T extends number | bigint>(...ts: T[]): NumberOrBigintOrElse<T> =>
  (ts.length === 0
    ? undefined
    : typeof ts[0] === "number"
    ? Math.min(...((ts as unknown) as number[]))
    : ((ts as unknown) as bigint[]).reduce((acc, t) =>
        acc <= t ? acc : t
      )) as NumberOrBigintOrElse<T>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const abs = <T extends number | bigint>(t: T): NumberOrBigintOrElse<T> =>
  (typeof t === "number"
    ? t >= 0
      ? t
      : -t
    : typeof t === "bigint"
    ? t > 0n
      ? t
      : -t
    : undefined) as NumberOrBigintOrElse<T>;

/**
 * Program
 */
type Color = "R" | "W";

const getAns = (N: number, cs: Color[]): number => {
  const rNum = cs.filter((c) => c === "R").length;
  return min(rNum, N - rNum, cs.slice(0, rNum).filter((c) => c === "W").length);
};

{
  const N = nCin();
  const cs = cin()
    .split("")
    .map((c) => c as Color);
  const ans = getAns(N, cs);
  console.log(ans);
}


Measured memory_bytes: 41300
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <ccomplex>
#include <unordered_map>
#include <cstring>
#include <iostream>
#include <numeric>
#include <sstream>
#include <set>
#include <map>
#include <tuple>
#include <iomanip>

using namespace std;
#define MAX 1LL << 60
#define MOD 1000000007
#define BOX 200000

typedef long long ll;

#define rep(i, s, e) for(unsigned int i = s; i < e; i++)
#define repR(i, s, e) for(ll i = s; i > e; i--)
#define reft0(i, j) setfill('0') << setw(i) << j
#define fix(i) fixed << setprecision(i)
#define so(a) sort(begin(a), end(a))
#define soR(a) sort(begin(a), end(a), greater<ll>())
#define sum(a) accumulate(begin(a), end(a), 0)


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



int main() {
    ll n, m;
    cin >> n >> m;
    cout << (n - 1) * (m - 1) << endl;

    return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using piii = pair<int, pair<int, int>>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;

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

    int n;
    cin >> n;
    int cnt = 0;
    vector<int> idx(n, -1);
    for (int i = 0; i <= n; ++i) {
        int a;
        cin >> a;
        a--;
        if (~idx[a])
            cnt = idx[a] + n - i;
        else
            idx[a] = i;
    }

    vector<ll> inv(n + 2), fac(n + 2), finv(n + 2);
    inv[1] = 1;
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    for (int i = 2; i < n + 2; ++i) {
        inv[i] = MOD - (MOD / i) * inv[MOD % i] % MOD;
        fac[i] = fac[i - 1] * i % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

    auto binomial = [&](int a, int b) {
        if (a < b)
            return 0LL;
        return (fac[a] * finv[b] % MOD) * finv[a - b] % MOD;
    };

    for (int k = 1; k <= n + 1; ++k) {
        ll res = binomial(n + 1, k) - binomial(cnt, k - 1);
        if (res < 0)
            res += MOD;
        cout << res << '\n';
    }

    return 0;
}


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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

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

    string S;
    cin >> S;

    ll n = S.size()-1;
    for (ll bit = 0; bit < (1<<n); bit++) {
        ll sum = S[0]-'0';
        string s; 
        s += S[0];
        for (ll i = 0; i < n; i++) {
            if (bit & (1<<i)) {
                s += '+';
                sum += S[i+1]-'0';
            } else {
                s += '-';
                sum -= S[i+1]-'0';
            }
            s += S[i+1];
        }

        if (sum == 7) {
            cout << s + "=7" << endl;
            break;
        }
    }
    return 0;
}

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

int main(){
  string s;
  cin >>s;
  string s1, s2;
  
  s1 = s.substr(2,1);
  s2 = s.substr(3,1);
  
  //cout << s1 <<" " <<s2 <<endl;
  string ans = "No";
  if(s1 == s2){
    s1 = s.substr(4,1);
    s2 = s.substr(5,1);
    
    if (s1 == s2){
      ans = "Yes";
    }
  }
  cout <<ans <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,a=0,b=0,c=0,ans=0;
    cin >> n;
    string s[n];
    for(int i=0;i<n;i++){
        cin >> s[i];
        int k = s[i].size()-1;
        if(s[i][0]=='B') a++;
        if(s[i][k]=='A') b++;
        if(s[i][0]=='B'&&s[i][k]=='A') c++;
        for(int j=0;j<k;j++){
            if(s[i][j]=='A'&&s[i][j+1]=='B') ans++;
        }
    }
    a-= c;
    b-= c;
        if(a>0&&b>0) ans += c+1+min(a-1,b-1);
        else if((a==0&&b>0)||(a>0&&b==0)) ans += c;
        else ans += max(0,c-1);
    cout << ans << endl;
}


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

#define pb(x) push_back(x);
#define in(y) insert(y);
#define tt(t) while(t--)
#define itr ::iterator it;
#define ll long long
#define vi vector<int>
#define ii pair<int, int>
#define vii vector<ii>
#define si set<int>                      
#define msi map<string, int>
#define new cout<<endl
#define ff(n) for(int i=0;i<n;i++)
#define all(v) sort(v.begin(),v.end())

using namespace std;

int main(){
	int x;
	cin>>x;
	if(x<1200){
		cout<<"ABC";
	}
	else cout<<"ARC";
    
    return 0;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
#define all(x) x.begin() , x.end()
#define ll long long 
#define pb push_back
#define mp make_pair

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n , m ; cin>>n>>m;
    cout<<((n < m)?0:10)<<endl;

}

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

int main()
{
    long long int A, B;
    cin >> A >> B;

    long long int a = A / 4, b = B / 4;
    long long int ans = 0;
    while (A <= (4 * a + 3))
        ans = ans xor A++;
    while (B > (4 * b - 1))
        ans = ans xor B--;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
#include <numeric> //lcm
#include <iomanip> //double精度 setprecision

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = n-1; i >= 0; --i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define all(vec) (vec).begin(),(vec).end()

#define debug(vec) for(auto v : vec) cerr << v << " "; cerr << endl;
#define debug2D(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << v << " "; cerr << endl; } 
#define debugP(vec) for(auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl;
#define debug2DP(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl; } 

typedef long long ll;

constexpr ll INF = 1000000000; //10^10
//const ll MOD = 998244353;
constexpr ll MOD = 1000000007;

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

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

	int n; cin >> n ;
	
	if (n%10 == 3) cout << "bon" << endl;
	else if (n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8) cout <<"pon" << endl;
  else cout << "hon" << endl;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
using ll = long long;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  ll ans = 0;
  for (int i = 1; i <= n; i++)
    ans += (i+n/i*i)*(n/i)/2;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3568
N = int(input())

all_10_checker = True
score_total = 0
non_10_minimum = 100

for _ in range(N):
    s = int(input())
    
    if s % 10 != 0:
        all_10_checker = False
        
        if non_10_minimum > s:
            non_10_minimum = s
        
    score_total += s
    
if all_10_checker:
    print(0)
else:
    if score_total % 10 == 0:
        print(score_total - non_10_minimum)
    else:
        print(score_total)

Measured memory_bytes: 38256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
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();}
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 EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int dx[]={1,-1},dy[]={-1,1};
int shiftdx[]={1,0},shiftdy[]={0,1};
int main() {
	int n;
	int cs=1;
	while(cin>>n,n){
		vvi m(n,vi(n));
		int x=0,y=0;
		int d=0;
		m[0][0]=1;
		int cnt=2;
		while(x!=n-1||y!=n-1){
			int xx=x+dx[d],yy=y+dy[d];
			if(xx<0||yy<0||xx>=n||yy>=n){
				int nx=x+shiftdx[d];
				int ny=y+shiftdy[d];
				if(nx>=n||ny>=n){
					x+=shiftdy[d];
					y+=shiftdx[d];
				}else{
					x=nx;
					y=ny;
				}
				
				d=(d+1)%2;
			}else{
				x=xx;
				y=yy;
			}
			m[x][y]=cnt;
			cnt++;
		}
		cout<<"Case "<<cs<<":"<<endl;
		REP(i,n){
			REP(j,n){
				printf("%3d",m[j][i]);
			}
			cout<<endl;
		}
		cs++;
	}
}

Measured memory_bytes: 1260
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const int nax=1e4;
int n,m;

vector<vector<int>> v[10];
void fun(int l){
    if(l==0){
        for(int i=1;i<=m;i++){
            vector<int> t(1,i);
            v[l].push_back(t);
        }
        return ;
    }
    fun(l-1);
    for(auto x : v[l-1]){
        int last=x[l-1];
        for(int i=last;i<=m;i++){
            v[l].push_back(x);
            v[l][(int)v[l].size()-1].push_back(i);
        }
    }
}
struct S{
    int a,b,c,d;
};
void solve(){
    int q;
    cin>>n>>m>>q;
    fun(n-1);
    vector<S> v1(q);
    for(int i=0;i<q;i++){
        cin>>v1[i].a>>v1[i].b>>v1[i].c>>v1[i].d;
    }
    ll ans=0;
    for(auto x: v[n-1]){
        ll g=0;
        for(auto y : v1){
            if(x[y.b-1]-x[y.a-1]==y.c) g+=y.d;
        }
        ans=max(ans,g);
    }
    cout<<ans<<'\n';
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int tc;
 //   cin>>tc;
    tc=1;
    while(tc--){
        solve();
    }
return 0;
}


Measured memory_bytes: 21204
class Point
  attr_accessor :x, :y
  def initialize(x, y)
    @x = x
    @y = y
  end

  def +(p)
    Point.new(@x + p.x, @y + p.y)
  end

  def -(p)
    Point.new(@x - p.x, @y - p.y)
  end

  def *(k)
    Point.new(@x * k, @y * k)
  end

  def to_s
    "#{@x} #{@y}"
  end
end

def dot(a, b)
  a.x * b.x + a.y * b.y
end

def cross(a, b)
  a.x * b.y - a.y * b.x
end

def norm(a)
  a.x * a.x + a.y * a.y
end

Segment = Struct.new('Segment', :p1, :p2)

def project(s, p)
  base = s.p2 - s.p1
  r = dot(p - s.p1, base).to_f / norm(base)
  s.p1 + base * r
end

def reflect(s, p)
  p + (project(s, p) -p) * 2.0
end

x0, y0, x1, y1 = gets.split.map(&:to_i)
p0 = Point.new(x0, y0)
p1 = Point.new(x1, y1)
base = Segment.new(p0, p1)

n = gets.to_i
n.times do
  x, y = gets.split.map(&:to_i)
  p = Point.new(x, y)
  puts reflect(base, p).to_s
end


Measured memory_bytes: 8928
N,K = map(int,input().split())
a = list(map(int,input().split()))

dp = [False]*(K+1)

for i in range(1,K+1):
    #初期化
    judge = False
    #選択できる石を選ぶ
    for stone in a:
        #小さい石から選ぶのでこの時点で負け
        if i - stone < 0:
            break
        #ひとつでも勝てるパターンが見つかり次第break
        if dp[i-stone] == False:
            judge = True
            break
    dp[i] = judge
            
print('First' if dp[K] else 'Second')

Measured memory_bytes: 42860
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int a;
		int ans=0;
		Scanner scan = new Scanner(System.in);
		a = scan.nextInt();
		for(int i = 0; i < 3; ++i) {
			if(a%10 == 1) {
				ans++;
			}
			a /= 10;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 21844
using System;
using System.Collections.Generic;
using System.Linq;

namespace ziyuutyou
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine().Split(' ');
            var aaa = int.Parse(str[0]);
            var bbb = int.Parse(str[1]);
            var sum = 0;

            for(var x = 0; x <= aaa; x++)
            {
                for(var y = 0; y <= aaa; y++)
                {
                    if(0 <= bbb - x - y  && bbb - x - y <= aaa)
                    {
                        sum++;
                    }
                }
            }
            Console.WriteLine(sum);
        }
    }
}


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

int main() {
  ll N;cin>>N;
  string S;cin>>S;
  
  int ans=1;
  for(int i=0;i<S.size()-1;i++){
    if(S[i]!=S[i+1]) ans++;
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 3756
import sys
import io
import math
import re

menu_num = 5
menu_sum = 0
menu_time_divided = 9
flag_a = 0
flag_b = 0

time_info_min = 10000000000000000

data_info = input().split()
passenger_info = int(data_info[0])

for num in range(menu_num):
    data_info = input().split()
    time_info = int(data_info[0])
    if time_info < time_info_min:
        time_info_min = time_info

if time_info_min != 1:
    print( 5 + math.floor(passenger_info/time_info_min))
else:
    print( 5 + math.floor(passenger_info/time_info_min) -1)


Measured memory_bytes: 3316
package main

import "fmt"

func sum(x int) int {
	return (1 + x) * x / 2
}

func main() {
	var s string
	fmt.Scan(&s)

	cnt1, cnt2 := 0, 0
	ans := 0
	for i := range s {
		if s[i] == '<' {
			cnt1++
		} else {
			cnt2++
		}

		if i == len(s)-1 || (s[i] == '>' && s[i+1] == '<') {
			max, min := cnt1, cnt2
			if min > max {
				max, min = min, max
			}
			ans += sum(max)
			ans += sum(min - 1)
			cnt1, cnt2 = 0, 0
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
using namespace std;
 
int two(long a) {
  int ret = 0;

  while (a % 2 == 0) {
    ret += 1;
    a /= 2;
  }
  return ret;
}

int main() {
  int N;
  cin >> N;
  vector<long> a(N);
  int ans = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    ans += two(a[i]);
  }
  cout << ans;
}

Measured memory_bytes: 384
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.List
import Data.Maybe
import Data.Function (fix)
import Data.Array (Array, array, (!))
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS8

modular :: Integer
modular = 1000000007
 
getInts :: IO [Int]
getInts = (map parseInt . BS8.words) <$> BS.getLine 
    where parseInt = fst . fromJust . BS8.readInt

getIntegers :: IO [Integer]
getIntegers = (map parseInteger . BS8.words) <$> BS.getLine 
    where parseInteger = fst . fromJust . BS8.readInteger

solve :: [String] -> String
solve strs = concatMap (make strs) ['a'..'z'] 
    where find ch = length . filter (==ch)
          make strs ch = replicate (minimum $ map (find ch) strs) ch

main :: IO ()
main = do
    [n] <- getInts
    strs <- replicateM n getLine
    putStrLn (solve strs)

Measured memory_bytes: 892
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <utility>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1e9 + 7
#define INF 1e9
#define SENTINEL 2e9
#define PIE 3.14159265358979323

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;}
template <class T>
inline T GCD(T a, T b){if (b == 0) return a; else return GCD(b, a % b);}
template <class T>
inline T LCM(T a, T b) {return (a * b) / GCD(a, b);}

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> b(a);
    sort(b.begin(), b.end());
    int fmax = b[b.size() - 1];
    int smax = b[b.size() - 2];
    rep(i, n){
        if (a[i] != fmax)
            cout << fmax << endl;
        else
            cout << smax << endl;
    }
    return 0;
}

Measured memory_bytes: 3200
//Catchharsh
    #include<bits/stdc++.h>
    #define ll long long int 
    #define ld long double
    #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define F first
    #define S second
    #define pb push_back
    #define endl '\n'
    const ll MOD = 1e9+7;
    const ll INF = 1011111111;
    const ll LLINF = 1000111000111000111LL;
    const ld EPS = 1e-10;
    const ld PI = 3.14159265358979323;
    using namespace std;
    ll power (int x,int n)
    {
        if(n==0)
        return 1;
        else if(n%2==0)
        return power((x*x),n/2);
        else
        return x*power((x*x),(n-1)/2); 
    }
    vector<ll> seve;
    void  seveprime()
    {
      int prime[1000000]={0};
      for(int i=2;i*i<1000000;i++)
       {
        if(prime[i]==0)
         {
      	  for(int j=i*2;j<=1000000;j+=i)
           prime[j]=1;
         }
       }
       for(int i=2;i<=1000000;i++)
       {
       	if(prime[i]==0)
       		seve.pb(i);
       }
    }
             double dp[10000+1][10000+1];
    int main()
    {   
         IOS;
         int n,m,i,j,k;
         cin>>n;
         double temp;

         cin>>temp;
         dp[1][0]=temp;
         dp[1][1]=1-temp;
         for(i=2;i<=n;i++)
         {
         	 cin>>temp;
         	for(j=0;j<=n;j++)
              {
              	if(j==0)
              	{
              		dp[i][j]=dp[i-1][j]*temp;
              	}
              	else
              	{
              		dp[i][j]=1.0*(1-temp)*(dp[i-1][j-1])+1.0*(temp)*dp[i-1][j];
              	}
              }
         }
         // for(i=1;i<=n;i++)
         // {
         // 	for(j=0;j<=n;j++)
         // 	{
         // 		cout<<dp[i][j]<<" ";
         // 	}
         // 	cout<<endl;
         // }
         double ans=0;
         for(i=0;i<=(n/2);i++)
         	ans+=dp[n][i];
         cout<<fixed<<setprecision(10)<<ans;
    }

Measured memory_bytes: 234368
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//inline int in() { int x; scanf("%d",&x); return x;}
inline ll in() { ll x; cin >> x; return x; }
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

vector<int> to[2505];
vector<int> rto[2505];
bool reachablefrom1[2505];
bool reachableToN[2505];
bool ok[2505];

void dfs(int v) {
  if (reachablefrom1[v]) return;
  reachablefrom1[v] = true;
  for (int u : to[v]) {
    dfs(u);
  }
}
void rdfs(int v) {
  if (reachableToN[v]) return;
  reachableToN[v] = true;
  for (int u : rto[v]) {
    rdfs(u);
  }
}

int main() {
  int a = in(), b = in();
  int ans = ((a - 1) + (b - 1) - 1) / (a - 1);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 384
while True:
  n = int(input())
  if n==0:
    break
  dp = [1,2,4]
  for i in range(3,n):
    dp.append(dp[i-3]+dp[i-2]+dp[i-1])
  day = (dp[n-1]-1)//10+1
  year = (day-1)//365+1
  print(year)


Measured memory_bytes: 5596
#include <iostream>
using namespace std;
struct T {char s; int w, l;} t[10];
int main()
{
	int n, a, i, j, k;
	while (cin >> n, n)
	{
		for (i = 0; i < n; i++)
		{
			cin >> t[i].s;
			for (j = t[i].w = t[i].l = 0; j < n-1; j++)
			{
				cin >> a;
				if (a == 0)
					t[i].w++;
				if (a == 1)
					t[i].l++;
			}
		}
		for (i = 0; i < n-1; i++)
		{
			for (j = 0; j < n-1; j++)
			{
				if (t[j].w < t[j+1].w)
					swap(t[j], t[j+1]);
				else if (t[j].w == t[j+1].w && t[j].l > t[j+1].l)
					swap(t[j], t[j+1]);
			}
		}
		for (i = 0; i < n; i++)
			cout << t[i].s << endl;
	}
}

Measured memory_bytes: 0
#include <stdio.h>

int main()
{
  int x,y,d,c,r;
  scanf("%d %d",&x,&y);
  if(x<y){
    c=x;
    x=y;
    y=c;
  }

  r=x%y;
  while(r!=0){
    x=y;
    y=r;
    r=x%y;
  }

  printf("%d\n",y);
  return 0;
}

Measured memory_bytes: 592
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define f1(i, x, n) for(ll i = x; i <= n; i++)
#define f2(i, x, n) for(ll i = x; i >= n; i--)
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

int main(){
    ios
    ll t=1;
//    cin>>t;
    while(t--){
        string s;
  cin>>s;
  if(s[2]==s[3] && s[4]==s[5])
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;


    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#define pb push_back
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0);cout<<fixed<<setprecision(16);
#define ll long long int
#define ld long double
#define el '\n'
#define El '\n'
#define PI (ld)3.141592653589793238462643383279502884197169399375105820974944
#define inf (ll)1000000000
#define mod (ll)1000000007
#define mod1 (ll)998244353
#define fo(i, n) for (long long i = 0; i < n; i++)
#define pll pair<ll, ll>
#define ml map<ll,ll>
#define vpl vector<pll>
#define vvl vector<vector<ll> >
#define vvpl vector< vector<pll> >
#define ff first
#define ss second
#define pqueue priority_queue< ll >
#define pdqueue priority_queue< ll,vl ,greater< ll > >
#define mem(a,b) memset(a,b,sizeof(a));
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define sz(a) (ll)a.size()
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define vl vector<ll>
//#define x ff
//#define y ss
#define pt(a) for(auto it:a)cout<<it<<" ";cout<<endl;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
using namespace std;

// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << t<<" "; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << v.first << " " << v.second ; }

double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }

long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)

      res = res * a % m;
      a = a * a % m;
      b >>= 1;
  }
  return res;
}


ll kv;
ll t,n,x,y,h,k,z,p,q,w,r;
string s,s1,s2;
//vvl v;
//vl vis,d;

int main() {
    IOS;
    cin>>x>>y;
    if(x>=1&&x<=9&&y>=1&&y<=9)cout<<x*y;
    else cout<<-1;
    return 0;
}



Measured memory_bytes: 256
import sys
import math
# import decimal
# import queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # queue
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    o = input()
    e = input()
    ans = []
    for i in range(len(e)):
        ans.append(o[i])
        ans.append(e[i])
    if len(o)!=len(e):
        ans.append(o[-1])
    print(''.join(ans))
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 3060
string = input().split(' ')

H = int(string[0])
W = int(string[1])

ans = 0
if W == 1 or H == 1:
  ans = 1
elif W % 2 == 0:
  ans = ((H + 1) //2 + H // 2) * (W // 2)
else:
  ans = ((H + 1) //2 + H // 2) * (W // 2) + (H + 1) //2
    
print(ans)

Measured memory_bytes: 3064
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    vector<vector<T>>(h,vector<T>(w))
#define VVI(T,h,w,i) vector<vector<T>>(h,vector<T>(w,i))
using namespace std;
using ll = unsigned long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
    ll n, m; cin >> n >> m;

    vector<ll>a(n);
    REP(i, n)cin >> a[i];
    sort(ALL(a));

    vector<pair<ll, ll>>bc(m);
    REP(i, m) {
        ll b, c;
        cin >> b >> c;
        bc[i] = make_pair(c, b);
    }
    sort(ALL(bc), greater<pair<ll, ll>>());

    ll inow = 0;
    ll ans = 0;
    REP(i, m) {
        ll b = bc[i].second, c = bc[i].first;
        for (ll j = inow; j < min(inow + b, n); ++j) {
            ans += max(a[j], c);
        }
        inow += b;
    }
    for (ll j = inow; j < n; ++j)ans += a[j];

    cout << ans << endl;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define ms(x, n) memset(x,n,sizeof(x));
#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define rep1(i, n) for(int i = 1; i <= (int)n; ++i)
#define pb push_back
#define PI acos(-1.0)
#define LONG_LONG_MAX 9223372036854775807
#define LONG_LONG_MIN -9223372036854775808
typedef long long int ll;
typedef unsigned long long int ull;
using namespace std;

const int maxn = 1e5 + 10;
int n, m, a, b;
ll ans;
struct node {
    int d, p;
}job[maxn];
multiset<int> mts;

bool cmp(node a, node b) {
    return a.d < b.d;
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n >> m;
    rep(i, n) {
        cin >> a >> b;
        if (m - a < 0) continue;
        job[i].d = m - a;
        job[i].p = b;
    }
    ans = 0;
    sort(job, job+n, cmp);
    int now = 0;
    rep(i, n) {
        if (now <= job[i].d) {
            ++now;
            ans += job[i].p;
            mts.insert(-job[i].p);
        } else {
            int x = -*prev(mts.end());
            if (job[i].p > x) {
                ans -= x;
                mts.erase(prev(mts.end()));
                mts.insert(-job[i].p);
                ans += job[i].p;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5760
<?php
fscanf(STDIN, "%d%d", $N, $M);
for($i = 0; $i < $N; $i++){
  $danger[] = intval(trim(fgets(STDIN)));
}
foreach($danger as $d){
  $map[$d] = true;  
}

$dp[-1] = 0;
$dp[0] = 1;
for($i = 1; $i <= $N; $i++){
  if(isset($map[$i])){
    $dp[$i] = 0;
  }else{
    $dp[$i] = $dp[$i-2] + $dp[$i-1];
  }
  $dp[$i] %= 10**9+7;
}
echo $dp[$N];


Measured memory_bytes: 21232
using System;
using static System.Console;
using static System.Math;
using System.Collections.Generic;
using System.Linq;

class Program
{
    public static void Main()
    {
        string S = ReadLine();
        string T = ReadLine();

        List<string> res = RotateList(S);
        if (res.Contains(T)||S==T) WriteLine("Yes");
        else WriteLine("No");
    }
    public static List<string> RotateList(string s)
    {
        s =Reverse(s);
        List<string> res = new List<string>();
        for(int i = 1; i < s.Length; i++)
        {
            string temp = "";
            for (int j = i; j <= s.Length; j++)
            {
                if (j == s.Length)
                {
                    for(int k = 0; k < i; k++)
                    {
                        temp += s[k];
                    }
                }
                else
                {
                    temp += s[j];
                }
            }
            res.Add(Reverse(temp));
        }
        return res;
    }
    public static string Reverse( string s)

    {
        string res = "";
        for(int i = s.Length - 1; i >= 0; i--)
        {
            res += s[i].ToString();
        }
        return res;
    }
    public static partial class EnumerableCommon
    {
        public static IEnumerable<int> Range(int count)
        {
            return Enumerable.Range(0, count);
        }
    }
}


Measured memory_bytes: 15072
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <list>
#include <set>
#include <bitset>
#include <iterator>
#define loop(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define debug(x)  cout << #x << " = " << (x) << endl;

using namespace std;
using LL = long long int;
using ULL = unsigned long long;
const LL MOD = 1e9 + 7;

map<int, int> prime_factorize(int n) {
    map<int, int> prime_factors;
    for (int i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ++prime_factors[i];
            n /= i;
        }
    }
    if (n != 1) prime_factors[n] = 1;
    return prime_factors;
}
int main() {
    int n; cin >> n;

    map<LL, int> factors;
    loop(i, 1, n + 1) {
        for (auto it : prime_factorize(i)) {
            int p, cnt; tie(p, cnt) = it;
            factors[p] += cnt;
        }
    }
    LL ans = 1;
    for (auto it : factors) {
        int cnt = it.second;
        ans = ans * (1 + cnt) % MOD;
    }
    cout << ans % MOD << endl;
    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef double dd;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

const int mx=1e6+11;
const double PI = acos(-1);
#define MOD 1000000007


#define nl '\n'
#define pb push_back
#define F first
#define S second
#define I insert
#define mp make_pair

#define sz(x) x.size()
#define tt int t; cin>>t; while(t--)
#define lo(i,a,b) for(int i=a;i<b;i++)
#define rlo(i,n) for(int i=n-1;i>=0;i--)
#define be(a) (a).begin(),(a).end()
#define rbe(a) (a).rbegin(),(a).rend()
#define mem(a,b) memset(a,b,sizeof(a))
#define pr(a) {for(auto x:a)cout<<x<<" ";cout<<nl;}
#define ac cout<<"AC"<<nl
#define wa cout<<"WA"<<nl
#define su ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define frac cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)
void faltu () {            cerr << endl;}
template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}

void f()
{
  string s;
  cin>>s;
  int n=sz(s),c=0,C=0,a=0;
  if(s[0]=='A')
  {
    for(int i=1;i<n;i++)
    {
      if(s[i]=='C')
        c++;
    }
    if(c>1||c==0)
      wa;
    else
    {
      for(int i=2;i<n-1;i++)
      {
        if(s[i]=='C')
          C++;
      }
      if(C==1)
      {
        for(int i=1;i<n;i++)
        {
          if(s[i]!='C'&&s[i]>='a'&&s[i]<='z')
            a++;
        }
        if(2+a==n)
          ac;
        else
          wa;
      }
      else
        wa;
    }
  }
  else
    wa;
}

int main()
{
    su;
    ///tt
    f();
    return 0;
}


Measured memory_bytes: 3660
#include <iostream>

using namespace std;

int main()
{
    int n, Ans=0;

    int c[50], v[50];

    cin >> n;

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

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

    for(int i=0; i<n; i++)
    {
        if(c[i]>v[i])
        {
            Ans += (c[i]-v[i]);
        }
    }

    cout << Ans << endl;

    return 0;

}


Measured memory_bytes: 256
def read_a(n, m):
    A = []
    for _ in range(0, n):
        A.append([int(x) for x in input().split()])

    return A

def read_b(m):
    B = []
    for _ in range(0, m):
        B.append(int(input()))

    return B

def multiply(A, B):
    C = []
    for a in A:
        C.append(sum(map(lambda x, y:x*y, a, B)))

    return C

def main():
    n, m = [int(x) for x in input().split()]

    A = read_a(n, m)
    B = read_b(m)
    C = multiply(A, B)

    print("\n".join([str(x) for x in C]))

if __name__ == '__main__':
    main()



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

    int a[8];
    for(int i=0;i<8;i++){
      a[i]=0;
    }
    int n;
    cin>>n;
    int g=0;
  int f=0;
    int b[101];
    for(int i=0;i<n;i++){
      cin>>b[i];
      if(b[i]<400){
        a[0]++;
      }else if(b[i]>=400 && b[i]<=799){
        a[1]++;
      }else if(b[i]>=800 && b[i]<=1199){
        a[2]++;
      }else if(b[i]<=1599 && b[i]>=1200){
        a[3]++;
      }else if(b[i]<=1999 && b[i]>=1600){
        a[4]++;
      }else if(b[i]<=2399 && b[i]>=2000){
        a[5]++;
      }else if(b[i]<=2799 && b[i]>=2400){
        a[6]++;
      }else if(b[i]<3200 && b[i]>=2800){
        a[7]++;
      }else{
        g++;
      }
    }
    for(int i=0;i<8;i++){
      if(a[i]>0){
        g++;
        f++;
      }
    }
  if(f>0){
    cout<<f<<" "<<g;
  }
  if(g>0 && f==0){
    cout<<1<<" "<<g;
  }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll t;
    cin >> t;
    ll n;
    vector<ll> ans;
    while(t--){
    	cin >> n;
    	vector<ll> a(n);
    	for(int i=0;i<n;i++){
    		cin >> a[i];
    	}
    	string s;
    	cin >> s;
    	int ok = 0;
    	vector<ll> dp(61, 0);
    	for(int i=n-1;i>=0;i--){
    		if(s[i] == '1'){
    			for(int j=60;j>=0;j--){
    				if(a[i] >> j & 1LL) a[i] ^= dp[j];
    			}
    			if(a[i]) ok = 1;
    		}else{
    			for(int j=60;j>=0;j--){
    				if(a[i] >> j & 1LL) {
    					if(dp[j] >> j & 1LL){
    						a[i] ^= dp[j];
    					}else{
    						dp[j] = a[i];
    						j = -1;
    					}
    				}
    			}
    		}
    	}
    	ans.pb(ok);
    }
    for(auto& i: ans ){
    	cout << i << endl;
    }
    return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <string.h>
 
using namespace std;
 
int main(void){
  char S[60];
  
  cin >> S;
  
  if (S == "Sunny"s) cout << "Cloudy" << endl;
  else if (S == "Cloudy"s) cout << "Rainy" << endl;
  else if(S == "Rainy"s) cout << "Sunny" << endl;
    }

Measured memory_bytes: 256
#include   <cstdio>
#include  <cstring>
#include <iostream>
using namespace std;

int n;

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		double xx = (i * 1.00) * 1.08;
		int yy = xx;
		if (yy == n) {
			printf("%d", i);
			return 0;
		}
	}
	printf(":(");
	return 0;
}

Measured memory_bytes: 256