akhauriyash/Code-Regression huggingface dataset:
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <iostream>
#include <string>

#include <algorithm>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <vector>

#define PB push_back
#define MP make_pair

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

#define ALL(v) (v).begin(),(v).end()

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

typedef pair<int, int> PII;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VPII;

const int MOD = 1000000007;
const int INF = 1e9;

const double EPS = 1e-9;
const double PI = acos(-1.0);

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

int N;
VS s;

int main() {
    cin >> N;
    REP (i, N) {
        string t;
        cin >> t;
        sort(ALL(t));
        s.PB(t);
    }
    sort(ALL(s));
    LL acc = 0, ans = 0;
    REP (i, N - 1) {
        if (s[i] == s[i + 1]) {
            ans += ++acc;
        }
        else {
            acc = 0;
        }
    }
    cout << ans << endl;
    return 0;
}


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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    int n,k; cin >> n >> k;
    vl p(n);
    rep(i,n) cin >> p[i];
    vl s(n+1,0);
    rep(i,n) s[i+1] = s[i]+p[i];
    double res = 0.0;
    for(int i=0;i+k<n+1;i++){
        double ans = s[i+k]-s[i] + k;
        res = max(res,ans);
    }
    cout << fixed << setprecision(10) << res/2.0 << endl;
}


Measured memory_bytes: 3456
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<utility>
#include<functional>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;

ll N,M,K,C;
ll a,b,c,d;
string s;
int main(){
    cin>>N>>M;
    ll pre;
    ll ans=0;
    cin>>pre;
    for(int i=1;i<N;i++){
        ll t;
        cin>>t;
        ans+=min(t-pre,M);
        pre=t;
    }
    cout<<ans+M<<endl;

    
    return 0;
}

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

int n, k;
typedef  long long ll;
int main(){

    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N,K; cin >> N >> K;
    vector <int> H(N);
    for(int i = 0; i < N+1; i++){
        cin >> H[i];
        // cout << H[i] << endl;
    }
    sort(H.begin(), H.end());
    //cout << "after sort" << endl;
    int ans = 1000000000;
    REP(i,N){
        // cout << H[i] << endl;
    }
    for(int i=0; i < N-K+1; i++){
        ans = min(ans,H[i+K-1]-H[i]);
        // cout << H[i] << endl;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int x1 = in.nextInt();
            int y1 = in.nextInt();
            int x2 = in.nextInt();
            int y2 = in.nextInt();
            int a = x1 - x2;
            int b = y1 - y2;
            int x3 = x2 + b;
            int y3 = y2 - a;
            int x4 = x3 + a;
            int y4 = y3 + b;
            out.printf("%d %d %d %d", x3, y3, x4, y4);
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 22740
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
const int Nmax = 1e5 + 5;

int n,m,u,v;
int par[Nmax];

vector <int> adj[Nmax];
vector <int> topo;

bool visited[Nmax];
void dfs(int u)
{
    visited[u] = true;
    for (int v : adj[u])
    {
        if (!visited[v]) dfs(v);
    }
    topo.push_back(u);
}


int main()
{
    //freopen("file.inp","r",stdin);
    cin >> n >> m;
    for (int i = 1; i < n + m; i++)
    {
        cin >> u >> v;
        adj[u].push_back(v);
    }
    for (int i = 1; i <= n; i++)
    {
        if (!visited[i]) dfs(i);
    }
    reverse(topo.begin(), topo.end());
    for (int i = 0; i < n; i++)
    {
        int u = topo[i];
        for (int v : adj[u])
        {
            par[v] = u;
        }
    }
    for (int i = 1; i <= n; i++)
    {
        cout << par[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 10484
#include <iostream>
using namespace std;
  
int main()
{
  int x,y,z,temp;
  cin>>x>>y>>z;
  temp=x;
  x=y;
  y=temp;
  temp=z;
  z=x;
  x=temp;
  cout<<x<<" "<<y<<" "<<z;
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
int main()
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	if(a==b)		printf("%d\n",c);
	else if(a==c)	printf("%d\n",b);
	else printf("%d\n",a);
	return 0;
}

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

typedef long long int ll;
typedef vector<int> vi;
typedef set<int> si;
typedef set<ll> sll;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define pvec(v) for(auto e: v) cout << e << " ";
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define rep(i, a, b) for(int i = (a); i<(b); ++i)
#define pb push_back
#define INF 1000000005
#define MOD 1000000007
#define all(v) v.begin(), v.end()

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

ll power(ll x, ll y, ll p = MOD){  
    ll res = 1LL; 
    x = x % p;
    if (x == 0) return 0;
    while (y > 0){
        if (y & 1LL)  
            res = (res*x) % p;
        y = y>>1LL; 
        x = (x*x) % p;  
    }  
    return res;  
}  

int main(){
	IO
	int n;
	cin >> n;
	vi arr(n);
	int *freq = new int[1000005];
	bool hasOne = false;
	rep(i, 0, n){
		cin >> arr[i];
		++freq[arr[i]];
		if(arr[i] == 1) hasOne = true;
	}

	if(hasOne){
		if(freq[1] > 1)
			cout << 0 << endl;
		else
			cout << 1 << endl;
		return 0;
	}

	int cnt = 0;
	bool f = true;
	for(int i = 0; i<n; ++i){
		if(freq[arr[i]] > 1)
			continue;
		f = true;
		for(int j = 2; j*j<=arr[i]; ++j){
			if(arr[i]%j == 0 && (freq[j] || freq[arr[i]/j])){
				f = false;
				break;
			}
		}
		if(f) ++cnt;
	}

	cout << cnt << endl;
	return 0;
}

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

int main(){
	int N,cnt=1,x=1;
    cin>>N;
	vector<int> a(N);
	for (int i = 0; i < N; i++) {
		cin>>a.at(i);
	}
	x=a.at(0)-1;
  	if(x!=1){
      for(int i = 0; i < N; i++) {
          x=a.at(x)-1;
          cnt++;
          if(x==1)
              break;
      }
    }
	if(x!=1)
		cout << -1 << endl;
	else
		cout << cnt << endl;
}

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

using namespace std;

int main() {
  ll n, k, o = 0;
  cin >> n >> k;
  for(int i = k + 1; i <= n; i++)
    o += n / i * (i - k) + max(0LL, n % i - k + 1);
  cout << (k ? o : n * n) << '\n';
}

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

int A[100000], n;

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) scanf("%d", A + i);
    int q, key, count = 0;
    int *pos;
    cin >> q;
    for (int i = 0; i < q; i++) {
        scanf("%d", &key);
        pos = lower_bound(A, A + n, key);
        if (*pos == key) count++;
    }

    cout << count << endl;

    return 0;
}


Measured memory_bytes: 3504
#include<iostream>
using namespace std;
int main() {
    int rooms[5][4][11], n;
    for (int i=1; i<=4; i++){
        for (int j=1; j<=3; j++){
            for (int k=1; k <= 10; k++){
                rooms[i][j][k] = 0;
            }
        }
    }
    cin >> n;
    for (int i=0; i<n; i++){
        int b, f, r, v;
        cin >> b >> f >> r >> v;
        rooms[b][f][r] += v;
    }

    for (int f=1; f<=4; f++){
        if (f > 1){
            cout << "####################" << endl;
        }
        for (int b=1; b<=3; b++){
            for (int r=1; r<=10; r++){
                cout << " " << rooms[f][b][r];
            }
            cout << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3100
#include<iostream>
using namespace std;
int main()
{
  int n,f=0;
  cin >> n;
  while(n)
  { if(n%10==7){f=1;break;}
   n=n/10;}
  if(f==1)cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair

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; }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


#define MAX_F 3000

int main() {
    i64 A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;

    vector<i64> wtot;
    REP(i, 31) {
        REP(j, 31) {
            i64 amount = 100 * A * i + 100 * B * j;
            if (amount >= F) break;
            wtot.pb(amount);
        }
    }
    sort(wtot.begin(), wtot.end());
    UNIQUE(wtot);
    vector<i64> stot;
    REP(i, F + 1) {
        REP(j, F + 1) {
            i64 amount = C * i + D * j;
            if (amount >= F) break;
            stot.pb(amount);
        }
    }
    sort(stot.begin(), stot.end());
    UNIQUE(stot);

    f64 maxc = -1.0;
    i64 maxw = 0;
    i64 maxs = 0;
    REP(i, SIZE(wtot)) {
        REP(j, SIZE(stot)) {
            if ((wtot[i] + stot[j]) > F) continue;
            if ((E * wtot[i] / 100) < stot[j]) continue;
            if (chmax(maxc, 100.0 * (f64)(stot[j]) / (f64)(wtot[i] + stot[j]))) {
                maxw = wtot[i];
                maxs = stot[j];
            }
        }
    }
    cout << (maxw + maxs) << " " << maxs << endl;


    return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;

int main()
 {
 	int h,n,sum=0,i;
 	cin>>h>>n;
 	int a[n];
 	for(i=0;i<n;i++)
 		cin>>a[i];
 	for(i=0;i<n;i++)
 		sum+=a[i];
 	if(sum>=h)
 		cout<<"Yes"<<endl;
 	else
 		cout<<"No"<<endl;
 }

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

int main() {
  // ここにプログラムを追記
  int A;
  int N;
  cin >> N >> A ;

  int x;
  x = N % 500;
  if(x <= A){
      cout << "Yes" << endl;

  }else{
      cout << "No" << endl;
      
  }


 

}

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

using namespace std;

typedef long long ll;
const ll inf = 0x3f3f3f3f;
#define case(i) "Case #" << i << ": "
 
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
    out << '(' << p.first << ", " << p.second << ')';
    return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
    ll l = v.size();
    for (ll i = 0; i < l - 1; i++) out << v[i] << ' ';
    if (l > 0) out << v[l - 1];
    return out;
}

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

    int x, n;
    cin >> x >> n;

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

    int i = 0;
    while(true) {
        if(s.find(x - i) == s.end()) {
            cout << x - i << endl;
            return 0;
        }
        else if(s.find(x + i) == s.end()) {
            cout << x + i << endl;
            return 0;
        }
        else i++;
    }
}

Measured memory_bytes: 3620
main(void){
    int a[10001],i=0,x;
    
    a[0]=1;
    while(a[i]!=0){
        i++;
        scanf("%d",&a[i]);
    }
    for(x=1;x<i;x++){
        printf("Case %d: %d\n",x,a[x]);
    }
}


Measured memory_bytes: 2056
n,m,l = map(int, input().split())
A,B = [],[]
C = [[0 for i in range(l)] for j in range(n)]
for i in range(n):
    A.append(list(map(int, input().split())))
for i in range(m):
    B.append(list(map(int, input().split())))
for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k]*B[k][j]
for c in C:
    for i in range(len(c)):
        if i+1 == len(c):
            print(c[i])
        else:
            print(c[i], end=" ")
        
        

Measured memory_bytes: 9184
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<iomanip>
#include<vector>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll=long long;
 


int main(){
	int ans=0,one=0,zero=0;
	string s;

	cin >> s;

	rep(i, s.size()) {
		if (s[i] == '1')one++;
		else zero++;
	}
	ans = min(one, zero)*2;
	cout << ans;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

// mod. m での a の逆元 a^{-1} を計算する
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// a^n mod を計算する
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

// 二項係数nCr
const int MAX = 210000;

ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理O(n)
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}

// 二項係数計算O(1)
ll COM(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

int main() {

    ll n;
    cin >> n;

    ll res;

    res = modpow(10, n)-modpow(9, n)-modpow(9, n)+modpow(8, n);
    res %= MOD;
    res = (res+MOD)%MOD;

    cout << res << endl;

    return 0;
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

/////////////////////////////////////////////////////////
class UnionFind {
 public:
  static const int MAX_N_LIB = (int)(2e5 + 100);

  int uf_par[MAX_N_LIB];
  int uf_rank[MAX_N_LIB];
  int uf_size[MAX_N_LIB];

  UnionFind(int n) { init(n); }

  void init(int n) {
    for (int i = 0; i < n; ++i) {
      uf_par[i] = i;
      uf_rank[i] = 0;
      uf_size[i] = 1;
    }
  }

  int find(int x) {
    if (uf_par[x] == x)
      return x;
    else {
      return uf_par[x] = find(uf_par[x]);
    }
  }

  void unite(int leaf_x, int leaf_y) {
    int x = find(leaf_x);
    int y = find(leaf_y);

    if (x == y) return;

    if (uf_rank[x] < uf_rank[y]) {
      uf_par[x] = y;
      uf_size[y] += uf_size[x];
    } else if (uf_rank[x] > uf_rank[y]) {
      uf_par[y] = x;
      uf_size[x] += uf_size[y];
    } else {
      uf_par[y] = x;
      uf_size[x] += uf_size[y];
      uf_rank[x] += 1;
    }
  }

  bool same(int x, int y) { return find(x) == find(y); }

  int size(int x) { return uf_size[find(x)]; }
};
/////////////////////////////////////////////////////////

const int MAX_N = (int)(1e5 + 5);

int n, m;
vector<pair<int, int>> edge;

int out[MAX_N];
vector<int> graph[MAX_N];

UnionFind uf(MAX_N);

vector<pair<int, int>> ans;

void routine(int cur, int parent) {
  if (out[cur] % 2 == 1) {
    ans.push_back(make_pair(cur, parent));
    out[cur] += 1;
  } else {
    ans.push_back(make_pair(parent, cur));
    out[parent] += 1;
  }
  return;
}

void dfs(int cur, int parent) {
  if (graph[cur].size() > 1) {
    for (auto &e : graph[cur]) {
      if (e == parent) continue;
      dfs(e, cur);
    }
  }

  routine(cur, parent);
  return;
}

int main(void) {
  // Here your code !
  scanf("%d %d", &n, &m);

  for (int i = 0; i < m; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);

    edge.push_back(make_pair(a, b));
  }

  if (m % 2 == 1) {
    printf("%d\n", -1);
    return 0;
  }

  for (int i = 1; i <= n; ++i) {
    out[i] = 0;
  }

  for (auto &e : edge) {
    if (uf.same(e.first, e.second)) {
      ans.push_back(e);
      out[e.first] += 1;
    } else {
      graph[e.first].push_back(e.second);
      graph[e.second].push_back(e.first);
      uf.unite(e.first, e.second);
    }
  }

  for (auto &e : graph[1]) {
    dfs(e, 1);
  }

  for (auto &e : ans) {
    printf("%d %d\n", e.first, e.second);
  }

  return 0;
}


Measured memory_bytes: 14452
M, D = map(int, input().split())
ans = 0
for i in range(1, M + 1):
    for j in range(1, D + 1):
        d1, d10 = j % 10, j // 10
        if d1 >= 2 and d10 >= 2 and d1 * d10 == i:
            ans += 1
print(ans)

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main(){
int A,B,C;
cin>>A >>B >>C;
if (A==7){
	if (B==5 and C==5){
		cout<<"YES"<<endl;
	}
	else{
		cout<<"NO"<<endl;
	}
}
else{
	if (A==5){
		if (B==5 and C==7){
			cout<<"YES"<<endl;
		}
		else {
			if (B==7 and C==5){
				cout<<"YES"<<endl;
			}
			else{
				cout<<"NO"<<endl;
			}
		}
	}
	else{
		cout<<"NO"<<endl;
	}
}
return 0;	
}



Measured memory_bytes: 256
using System;
using System.IO;
using System.Linq;

class Program
{
    static void Main(string[] args) {
        var writer = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(writer);
        Console.WriteLine(Solve());
        Console.Out.Flush();
    }
    static object Solve() {
        var w = Console.ReadLine();
        var b = Enumerable.Repeat(true,26).ToArray();
        var len = w.Length;
        for (int i = 0; i < len; i++) {
            b[w[i] - 'a'] = !b[w[i] - 'a'];
        }
        return b.Contains(false) ? "No" : "Yes";
    }
}

Measured memory_bytes: 26616
#include <stdio.h>
int main(){
    int m, f, r;
  while(1){
      scanf("%d %d %d ", &m, &f, &r);
      if(m==-1&&f==-1&&r==-1)break;
      if(m==-1||f==-1){
          printf("F\n");
      }else if(m+f>=80){
          printf("A\n");
      }else if(m+f>=65){
          printf("B\n");
      }else if(m+f>=50){
          printf("C\n");
      }else if(m+f>=30){
          if(r>=50){
              printf("C\n");
          }else{
              printf("D\n");
          }
      }else{
          printf("F\n");
      }
  }
  return 0;
}


Measured memory_bytes: 2052
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=105;
int n;
int a[MAXN];
int b[MAXN],c[MAXN];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(int i=1;i<=n;i++)
	{
		if(a[i]>i)
		{
			printf("-1\n");
			return 0;
		}
		for(int j=1;j<i;j++)
		{
			if(a[i]<=j+b[j]&&j+b[j]<i)
			{
				b[i]--;
				b[j]++;
			}
		}
	}
	for(int i=1;i<=n;i++)
	{
		c[i+b[i]]=a[i];
	}
	for(int i=1;i<=n;i++)
		printf("%d\n",c[i]);
}

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

int main(){
  int x,y,z,yy;
  cin >> x >> y >> z;
  yy = y;
  y = x;
  x = z;
  z = yy;
  
  cout << x << ' ' <<  y << ' ' <<  z << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {


    bool s[13] = {};
    bool h[13] = {};
    bool c[13] = {};
    bool d[13] = {};
    char mark;
    int num;
    int n;
    cin >> n;


    for (int i = 0; i < n; i++) {
        cin >> mark;
        cin >> num;
        if (mark == 'S') {
            s[num - 1] = true;
        } else if (mark == 'H') {
            h[num - 1] = true;
        } else if (mark == 'C') {
            c[num - 1] = true;
        } else if (mark == 'D') {
            d[num - 1] = true;
        }
    }
    for (int i = 0; i < 13; i++) {
        if (!s[i]) {
            cout << "S" << " " << i + 1 << "\n";
        }

    }

    for (int i = 0; i < 13; i++) {
        if (!h[i]) {
            cout << "H" << " " << i + 1 << "\n";
        }
    }

    for (int i = 0; i < 13; i++) {
        if (!c[i]) {
            cout << "C" << " " << i + 1 << "\n";
        }
    }

    for (int i = 0; i < 13; i++) {
        if (!d[i]) {
            cout << "D" << " " << i + 1 << "\n";
        }
    }
}

Measured memory_bytes: 3088
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
#define INF (1<<29)
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N,M,R;
  cin >> N >> M >> R;
  vector<int> r={};
  int t;
  for(int i=1;i<=R;i++){
    cin >> t;
    r.push_back(t);
  }

  sort(r.begin(),r.end());
  ll dist[204][204];
  for(int i=1;i<=N;i++){
    for(int j=1;j<=N;j++){
      dist[i][j]=INF;
      if(i==j){
        dist[i][j]=0;
      }
    }
  }

  int A,B,C;
  for(int i=1;i<=M;i++){
    cin >> A >> B >> C;
    dist[A][B]=dist[B][A]=C;
  }
  ll ans=INF;
  for(int k=1;k<=N;k++){
      for(int i=1;i<=N;i++){
          for(int j=1;j<=N;j++){
            if(dist[i][j]>dist[i][k]+dist[k][j]){
              dist[i][j]=dist[i][k]+dist[k][j];
            }
          }
      }
  }

  do{
    ll pns=0;
    for(int j=0;j<R-1;j++){
      pns+=dist[r[j]][r[j+1]];
    }
    ans=min(ans,pns);
  }while(next_permutation(r.begin(),r.end()));
  cout << ans << endl;
  return 0;
}

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


int ctoi(char a){
    return (int)a-'0';
}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	string N;
	cin>>N;
    int a;
    int old_a= -1;
    int over=0;
    int ans = 0;
    int dp[N.length()][2] = {};
    a = ctoi(N[N.length()-1]);
    dp[0][0] = a;
    dp[0][1] = 10-a;
    rep(i,N.length()-1){
        a = ctoi(N[N.length()-1-1-i]);
        dp[i+1][0] = min(a+ dp[i][0],a+1+dp[i][1]);
        dp[i+1][1] = min(10-a+ dp[i][0],10-(a+1)+dp[i][1]);
    }

    ans += min(dp[N.length()-1][0],dp[N.length()-1][1]+1);

    cout<<ans<<"\n";
	
	return 0;
}

Measured memory_bytes: 9116
import Data.Char (toLower)
import Control.Monad (liftM)
    
main :: IO ()
main = do
  w <- liftM (map toLower) getLine
  t <- liftM (map toLower) getContents
  print $ countWord w $ concatMap words $ init (lines t)

countWord :: String -> [String] -> Integer
countWord w = foldr (\x acc -> if x == w then acc + 1 else acc) 0

Measured memory_bytes: 3792
NY=list(map(int,input().strip().split()))
N=NY[0]
Y=NY[1]

s=False
for a in range(N+1):
    for b in range(a,N+1):
        sumN=a*10000+(b-a)*5000+(N-b)*1000
        if sumN==Y:
            s=True
            x=a
            y=b-a
            z=N-b
    if s:
        break

if s==True:
    print("{} {} {}".format(x,y,z))
else:
    print("-1 -1 -1")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()
const string YES = "Yes";
const string NO = "No";
void solve(long long A, long long B, long long C){
  cout <<(A<=C && C<=B ? YES:NO) << endl;
}

int main(){
    long long A;
	scanf("%lld",&A);
	long long B;
	scanf("%lld",&B);
	long long C;
	scanf("%lld",&C);
    solve(A, B, C);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    ll a,v,b,w,t;
    cin >> a >> v >> b >> w >> t;
    YES((v-w)*t>=abs(b-a));
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 3652
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cmath>

using namespace std;

#define int long long
#define endl "\n"
#define all(v)  v.begin(),v.end()
#define fir first
#define sec second
#define m_p make_pair
#define rep(i,n)  for(int i=0; i<(int) (n); i++)


const double pai = 3.1415926535897;
const int mod = 1000000007;
const int INF = 2000000015;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];


int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}
int krag(double xx) {
	return INF - (int)(INF - xx);
}
//x未満の要素数を返す二分探索関数
int b_s(vector<int>& vec, int xx) {
	int t = -1;
	int f = vec.size();
	while (f - t > 1) {
		int m = (t + f) / 2;
		if (vec[m] < xx) {
			t = m;
		}
		else {
			f = m;
		}
	}
	return f;
}
template<typename T>
void vecout(vector<T>& vec) { for (T t : vec) cout << t << " "; cout << endl; }
template<typename TT>
void vecin(vector<TT>& vec) { for (TT t : vec) cin >> t; }


// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
//n個を1個以上のx組のグループに分ける重複組み合わせはcom(n-1,x-1)
//グループが0個でもいいときはnにxを足す
// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	if (xx == 1) {
		return 0;
	}
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}


signed main() {
	vector<int>vec(5);
	rep(i, 5) {
		cin >> vec[i];
	}
	rep(i, 5) {
		if (!vec[i]) {
			cout << i + 1 << endl;
		}
	}
}


Measured memory_bytes: 3576
import qualified Data.Array.IO as A
import qualified Data.List as L

main :: IO ()
main = do
    n <- read <$> getLine :: IO Int
    ls <- L.reverse . L.sort . map read . words <$> getLine :: IO [Int]
    print (sum . pairs $ ls)

pairs :: [Int] -> [Int]
pairs [] = []
pairs (_:[]) = []
pairs (x:y:xs) = let
    in min x y : pairs xs

(!) :: (A.Ix x) => A.IOArray x y -> x -> IO y
arr ! n = A.readArray arr n
{-# INLINE (!) #-}
 
(!?) :: (A.Ix x) => A.IOArray x y -> x -> IO (Maybe y)
arr !? n = do
    (start, last) <- A.getBounds arr
    if n >= start && last >= n 
        then Just <$> A.readArray arr n 
        else return Nothing
{-# INLINE (!?) #-}
 
(<<-) :: (A.Ix x) => (A.IOArray x y, x) -> y -> IO ()
(arr, i) <<- v = A.writeArray arr i v
{-# INLINE (<<-) #-}
 

Measured memory_bytes: 1020
import java.util.*;
import static java.lang.Math.*;

public class Main {

	static String worm;
	static Scanner sc = new Scanner(System.in);
	
	static boolean read() {
		worm = sc.next();
		return (worm.equals("0")) ? false : true;
	}
	
	static String solve() {
		return bfs(worm);
	}
	
	static String bfs(String w) {
		HashSet<String> set = new HashSet<String>();
		Queue<State> que = new LinkedList<State>();
		
		que.add(new State(w, 0));
		set.add(w);
		State s;
		while(!que.isEmpty()) {
			s = que.poll();
			if(same(s.worm)) return new Integer(s.level).toString();
			for(int i = 0; i < s.worm.length() - 1; i++) {
				w = changeColor(s.worm, i);
				if(w == null) continue;
				if(!set.contains(w)) {
					set.add(w);
					que.add(new State(w, s.level + 1));
				}
			}
		}
		return "NA";
	}
	
	static boolean same(String w) {
		boolean ans = true;
		char c = w.charAt(0);
		for(int i = 1; i < w.length(); i++) {
			if(c != w.charAt(i)) {
				ans = false;
				break;
			}
		}
		return ans;
	}
	
	static String changeColor(String w, int index) {
		String c = getColor(w.substring(index, index+1), w.substring(index+1, index+1+1));
		if(c == null) return null;
		
		if(index == 0) {
			return c + c + w.substring(2);
		} else if(index == w.length() - 1) {
			return w.substring(0, w.length() - 2) + c + c; 
		} else {
			return w.substring(0, 0 + index) + c + c + w.substring(index + 2, w.length());
		}
	}
	
	static String getColor(String c1, String c2) {
		if(c1.equals("r")) {
			if(c2.equals("g")) {
				return "b";
			} else if(c2.equals("b")) {
				return "g";
			}
		} else if(c1.equals("g")) {
			if(c2.equals("r")) {
				return "b";
			} else if(c2.equals("b")) {
				return "r";
			}
		} else if(c1.equals("b")) {
			if(c2.equals("r")) {
				return "g";
			} else if(c2.equals("g")) {
				return "r";
			}
		}
		return null;
	}
	
	
	public static void main(String[] args) {
		while(read()) {
			System.out.println(solve());
		}

	}

}

class State {
	int level;
	String worm;
	
	State(String worm, int level) {
		this.worm = worm; this.level = level;
	}
}

Measured memory_bytes: 16000
import java.util.*;

public class Main {


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int [] pointArray = new int [100];
		int [] rankArray = new int [100];
		int numberOfTeams, maxNumber;
		int a, b, aPoint, bPoint;
		
		numberOfTeams = sc.nextInt();
		maxNumber = numberOfTeams * (numberOfTeams - 1) / 2;
		
		for (int i = 0; i < numberOfTeams; i++) {
			pointArray[i] = 0;
			rankArray[i] = 1;
		}
		
		for (int i = 0; i < maxNumber; i++) {
			a = sc.nextInt()-1;
			b = sc.nextInt()-1;
			aPoint = sc.nextInt();
			bPoint = sc.nextInt();
			
			if (aPoint > bPoint) {
				pointArray[a] += 3;
			}else if (aPoint < bPoint) {
				pointArray[b] += 3;
			}else {
				pointArray[a]++;
				pointArray[b]++;
			}
		}
		
		for (int i = 0; i < numberOfTeams; i++) {
			for (int j = 0; j < numberOfTeams; j++) {
				if (pointArray[i] < pointArray[j]) {
					rankArray[i]++;
				}
			}
		}
		
		for (int i = 0; i < numberOfTeams; i++) {
			System.out.printf("%d\n", rankArray[i]);
		}

	}

}

Measured memory_bytes: 42908
use std::io::prelude::*;

fn input<T: std::str::FromStr>() -> T {
    let stdin = std::io::stdin();
    let it = stdin.lock().bytes().map(|c| c.unwrap() as char);
    let (fs, ft) = (|c: &char| c.is_whitespace(), |c: &char| !c.is_whitespace());
    let token = it.skip_while(fs).take_while(ft).collect::<String>();
    token.parse().ok().unwrap()
}
#[allow(dead_code)]
fn with_stdout_lock<F: FnOnce(std::io::BufWriter<std::io::StdoutLock>)>(f: F) {
    let out = std::io::stdout();
    f(std::io::BufWriter::new(out.lock()));
}
#[allow(unused_macros)]
macro_rules! debug {
    ($($var:expr),*) => { #[cfg(debug_assertions)] {
        $({ match &$var { v => eprint!("{}={:?} ", stringify!($var), v) } })*
        eprintln!();
    }};
}

fn main() {
    let n: usize = input();
    let nc: usize = input();
    let d: Vec<Vec<usize>> = (0..nc)
        .map(|_| (0..nc).map(|_| input()).collect())
        .collect();
    let c: Vec<Vec<usize>> = (0..n).map(|_| (0..n).map(|_| input()).collect()).collect();

    let mut color = vec![vec![0; nc]; 3];
    for i in 0..n {
        for j in 0..n {
            color[(i + j) % 3][c[i][j] - 1] += 1;
        }
    }

    let mut cost = vec![vec![0; nc]; 3];
    for i in 0..3 {
        for col in 0..nc {
            for x in 0..nc {
                cost[i][col] += color[i][x] * d[x][col];
            }
        }
    }

    let mut ans = usize::max_value();
    for i in 0..nc {
        for j in 0..nc {
            if i == j {
                continue;
            }
            for k in 0..nc {
                if i == k || j == k {
                    continue;
                }
                ans = std::cmp::min(ans, cost[0][i] + cost[1][j] + cost[2][k]);
            }
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 6396
#include<stdio.h>
int main(void){
  int x, y;
  scanf("%d %d",&x,&y);
  if(y%2==1){
    printf("No");
  }else if((y<2*x)||(4*x<y)){
    printf("No");
  }else{
    printf("Yes");
  }
  return 0;
}

Measured memory_bytes: 1732
from collections import defaultdict
import bisect
N, M = map(int, input().split())
PY = []
PYd = defaultdict(list)
for i in range(M):
    x, y = map(int, input().split())
    PYd[x].append(y)
    PY.append((x,y))

for i in PYd.keys():
    PYd[i].sort()

for p,y in PY:
    str_p = str(p).zfill(6)
    index = str(bisect.bisect(PYd[p],y)).zfill(6)
    print(str_p + index)


Measured memory_bytes: 35512
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
//#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 55;
const int K = 60;
const int mod = 1e9 + 7;
map < int, int > mp;
int a[N];
int dp[2][N * N][N + N][N];
int cnt[N][N], p[N];
int solve(int n, int k){
    dp[0][0][0][0] = 1;
    for (int i = 1; i <= n; i++){
        int c1 = i % 2;
        int c2 = c1 ^ 1;
        for (int j = 0; j <= n * n; j++){
            for (int l = 0; l <= i + i; l++){
                for (int t = 0; t <= l; t++){
                    dp[c1][j][l][t] = 0;
                    if (j >= l) dp[c1][j][l][t] = (dp[c1][j][l][t] + 1LL * (1 + l) * dp[c2][j - l][l][t]) % mod;
                    if (j >= l + 2) dp[c1][j][l][t] = (dp[c1][j][l][t] +  1LL * (t + 1) * (l - t + 1) * dp[c2][j - (l + 2)][l + 2][t + 1]) % mod;
                    if (j >= l - 2 && l - 2 >= 0 && t >= 1) dp[c1][j][l][t] = (dp[c1][j][l][t] + dp[c2][j - (l - 2)][l - 2][t - 1]) % mod;
                }
            }
        }
    }
    return dp[n % 2][k][0][0];
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int n, k;
    cin >> n >> k;
    int np = 1;
    cout << solve(n, k);
}


Measured memory_bytes: 121088
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		String line = null;
		try (Scanner sc = new Scanner(System.in)) {
			line = sc.nextLine();

			String[] tmpArray = line.split(" ");
			int cntFive = 0;
			int cntSeven = 0;
			for (String tmpStr : tmpArray) {
				if (tmpStr.equals("5")) {
					cntFive++;
				} else if (tmpStr.equals("7")) {
					cntSeven++;
				}
			}

			String result = "NO";
			if (cntFive == 2 && cntSeven == 1) {
				result = "YES";
			}

			System.out.println(result);

		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}

Measured memory_bytes: 22996
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    char c;
    cin >> c;

    if (c < 'a') c = 'A'; else c = 'a';

    cout << c << endl;

    return 0;
}

Measured memory_bytes: 3628
N, W = map(int, input().split())

dp = [[0 for j in range(W+1)] for i in range(N+1)]


def main():
    v, w = [0 for i in range(N)], [0 for i in range(N)]
    for i in range(N):
        v[i], w[i] = map(int, input().split())

    for i in range(W+1):
        dp[N][i] = 0
    for i in range(N-1, -1, -1):
        for j in range(W+1):
            if j < w[i]:
                dp[i][j] = dp[i+1][j]
            else:
                dp[i][j] = max(dp[i+1][j], dp[i+1][j-w[i]]+v[i])

    print(dp[0][W])


if __name__ == '__main__':
    main()



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

using namespace std;

#define N 300000

int n,tot,pre[N],a[N];
bool vis[N];
long long ans;
char s[N];

int main(){
	scanf("%s",s+1); n=strlen(s+1);
	for (int i=1;i<=n;++i){
		a[i]=s[i]-'0';
		pre[i]=pre[i-1]+(a[i]==0);
	}
	for (int i=1;i<=n;++i){
		if (a[i]==1){
			ans+=((i&1)+pre[i]+1)/2;
			if (!vis[i-1]){
				vis[i]=1;
				ans+=pre[n]-pre[i];
			}
		}
	}
	for (int i=n-pre[n]-1;i>0;--i) ans+=(i+1)/2;
	printf("%lld\n",ans);
	
	return 0;
}
			

Measured memory_bytes: 5788
#include<bits/stdc++.h>
 
#define rep(i,n) for(ll i = 0;i < n;++i)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
typedef pair<int,int> P;
 
const int INF = 1001001001;
const long double PI = (acos(-1));
const int mod = 1e9+7;
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};


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

    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n) {
        cin >> a[i];
    }
    vector<bool> dp(k+1,false);
    rep(i,k+1){
        rep(j,n){
            if(i-a[j] >= 0 && dp[i-a[j]] == false) dp[i] = true; 
        }
    }
    if(dp[k]) cout << "First" << endl;
    else cout << "Second" << endl;    
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define dhoom ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);  
typedef long long ll;
typedef long double ld;
const ll inf = 1e18;
const int nax = 2e6 + 7;
const ll mod = 1e9 + 7;
//ll tree[4 * nax];
//9uS-22RSwk7gQqh
ll gcd(ll a , ll b){
	if(b == 0) return a;
	return gcd(b , a % b);	
}
ll lcm(ll a , ll b){
	ll g = gcd(a , b);
	ll lc = (a/g) * b;
	return lc;
}
//char a[55][55];
int dx[] = {1,0,-1,0,1,1,-1,-1};
int dy[] = {0,1,0,-1,1,-1,-1,1};
ll a[100];
int main()
{
	dhoom;
	int a , b;
	cin >> a >> b;
	string s;
	cin >> s;
	int flag = 1;
	if(s[a] != '-')
		flag = 0;
	for(int i = 0 ;i < (int)s.size() ; i++){
		if(i == a)
			continue;
		if(s[i] == '-')
			flag = 0;
	}
	if(flag == 1)
		cout << "Yes" << endl;
	else 
		cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
int n,m,x,y,p;
long long ans;
char s[100011],t[100011];
int gcd(int x,int y)
{
	if(x==0)return(y);
	else return(gcd(y%x,x));
}
int main()
{
	scanf("%d%d",&n,&m);
	scanf("%s",s+1);
	scanf("%s",t+1);
	p=gcd(n,m);ans=p;
	for(int i=0;i<m;i++)if(i%(m/p)==0)
	{
		long long x=1ll*i*n/m;
		if(x<n)
		{
		if(s[x+1]!=t[i+1])
		{
			ans=-1;
			break;
		}
		}
	}
	if(ans>0)ans=1ll*n*m/ans;
	printf("%lld\n",ans);
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
 
typedef vector<int> vi; 
typedef pair<int,int> pi;
typedef long long ll;
#define F first 
#define S second 
#define PB push_back 
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)

vector<ll> dp;

int main(){
	
	ll n, h, v,w;
	
	cin >> n >> w; 
	
	dp.assign(w+1, 0);
	
	for(ll i = 0; i < n; i++){
		
		cin >> h >> v;
		
		for(ll i2 = w - h; i2 >= 0; i2--){
			dp[i2 + h] = max( dp[i2+h], dp[i2] + v );
		}
		
	}
	
	ll maxi = 0;
	
	for(ll i = 0; i <= w; i++){
		maxi = max(maxi, dp[i]);
	}
	
	cout << maxi << endl;
	
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef vector<pii> vii;
typedef vector<pll> vll;
#define fi first
#define se second
#define pi 3.141592653589793
#define mod 1000000007
#define pb push_back
#define all(v) v.begin(),v.end()
#define rall(v) v.begin(), v.end(), greater<ll>()
#define tc int t;cin>>t;while(t--)
#define pqmax priority_queue<int>
#define pqmin priority_queue<int,vi,greater<int>>
#define fast_io ios_base::sync_with_stdio(0), cin.tie(NULL)
#define tc_g int tt;cin>>tt;for(int ti=1;ti<=tt;ti++)
#define case_g "Case #"<<ti<<": "
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef tree<int, int, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_map;
using namespace std;
int main() {
    ll a, b, c;
    char ch;
    cin >> a >> b;
    cin >> ch;
    cin >> c;
    b *= 100;
    b += c;
    cout << (a * b)/100;
}


Measured memory_bytes: 3632
//{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a,b,c,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,n,0)
#define rrep3(i,begin,end) for(int i=(int)(begin-1),i##_end=(int)(end);i>=i##_end;--i)
#define foreach(x,a) for(auto&x:a)
using ll=long long;
const ll mod=(ll)1e9+7;
//}}}

string ids[100000];
int main(){
  int N, M;
  cin >> N >> M;
  vector<vector<int>> v;
  rep(i, M){
    int p, y;
    cin >> p >> y;
    vector<int> vv = {p, y, i};
    v.push_back(vv);
  }
  sort(v.begin(), v.end());
  int prev = -1;
  foreach(x, v){
    int a, b;
    a = x[0];
    if(prev != a){
      prev = a;
      b = 0;
    }
    b++;
    char buff[20];
    sprintf(buff, "%06d%06d", a, b);
    ids[x[2]] = buff;
  }
  rep(i, M){
    cout << ids[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 13232
#include<bits/stdc++.h>
using namespace std;
char s[200010];
int dp[200010];
int n;
int main(){
	cin>>(s+1);
	n=strlen(s+1);
	dp[1]=1;
	if(s[2]==s[1])dp[2]=1;
	else dp[2]=2;
	for(int i=3;i<=n;i++){
		if(s[i]==s[i-1])dp[i]=dp[i-3]+2;
		else dp[i]=dp[i-1]+1;
	}
	cout<<dp[n]<<endl;
	return 0;
}


Measured memory_bytes: 1280
<?php
fscanf(STDIN, "%d %d %d %d", $a,$b,$c,$d);

while($a >= 0){
   $c -= $b;
   if($c <= 0){
    echo "Yes";
    break;
   }
   $a -= $d;
   if($a <= 0){
    echo "No";
    break;
   }
}

?>

Measured memory_bytes: 16216