akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define boost_io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define num(a) a-'0'
#define rep(i,a,b) for(int i=a;i<b;i++)
#define maxs(a,b) if(b>a)a=b
#define mins(a,b) if(b<a)a=b
#define debug(x) cerr<<#x<<":"<<x<<" "
#define all(a) (a).begin(), (a).end()
#define vi vector<int>
#define vl vector<long long int>
#define v vector
#define p pair
#define pb push_back
#define mk make_pair
#define f first
#define s second
#define ln "\n"
typedef long long int ll;
typedef long double ld;
typedef double d;
using namespace std;
ll modF=1e9+7;
ll INF=1e11;

void solve(){
	int k;
	cin>>k;
	if(__gcd(k,10)!=1){
		cout<<-1<<ln;
	}
	else{
		int h=7;
		h=h%k;
		int ans=1;
		while(h!=0){
			h=(h*10)%k;
			h=(h+7)%k;
			ans++;
		}
		cout<<ans<<ln;
	}
}	

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


Measured memory_bytes: 3560
N = int(input())
A = list(map(int, input().split()))
a = True
for x in A:
	if x % 2 == 0:
		if x % 3 != 0 and x % 5 != 0:
			a = False
			break
if a:
	print('APPROVED')
else:
	print('DENIED')


Measured memory_bytes: 9172
#include <iostream>

using namespace std;

int main()
{
   int a, b, c;
   cin >> a >> b >> c;
  
   if (a <= b && b <= c)
       cout << a << " " << b << " " << c << endl; 
   else if (a <= c && c <= b)
       cout << a << " " << c << " " << b << endl;
   else if (b <= a && a <= c)
       cout << b << " " << a << " " << c << endl;
   else if (b <= c && c <= a)
       cout << b << " " << c << " " << a << endl;
   else if (c <= b && b <= a)
       cout << c << " " << b << " " << a << endl;
   else
       cout << c << " " << a << " " << b << endl;
   
   return 0;
}


Measured memory_bytes: 3116
#pragma GCC optimize ("Ofast")
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
#define int long long int
#define pb push_back
#define fi first
#define se second
#define deb cerr << "Line no." << __LINE__
#define fr(i, a, b) for(int i = a; i <= b; i++)
#define aint(x) x.begin(), x.end()
#define IO ios :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pii pair<int,int>
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
const int mod = 1e9 + 7;
const int mod1 = 998244353;
typedef long double f80;
#ifndef LOCAL
#define endl '\n'
#endif
const f80 PI = acos(-1);

template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
int pwr(int a,int b){
    int ans = 1;
    while(b){
        if(b & 1) ans = (ans * a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return ans;
}
const int N = 1e5 + 5;
pii p[N];
inline bool cmp(const pii &a, const pii &b){
    return a.fi + a.se > b.fi + b.se;
}
void solve(){
    int n;
    cin >> n;
    fr(i, 1, n){
        cin >> p[i].fi >> p[i].se;
    }
    sort(p + 1, p + n + 1, cmp);
    int s = 0;
    fr(i, 1, n){
        if(i & 1) s += p[i].fi;
        else s -= p[i].se;
    }
    cout << s;
}
signed main(){
    IO;
    #ifdef LOCAL
        freopen("inp.txt","r", stdin);
        // freopen("out.txt", "w", stdout);
    #endif
    clock_t clk = clock();
    int t = 1;
    // cin >> t;
    fr(tt, 1, t){
        solve();
    }
    cerr << endl << setprecision(10) << fixed << (double)(clock() - clk) / CLOCKS_PER_SEC;
    return 0;
}

Measured memory_bytes: 1792
import java.util.*;
public class Main{
  public static void main(String args[]){
      int i,x,n;
      Scanner scn =new Scanner(System.in);
      x=scn.nextInt();
      n=scn.nextInt();
      int[] a= new int[n];
      HashMap<Integer,Boolean> map = new HashMap<>();
      for(i=0;i<n;i++){
         a[i]=scn.nextInt();
         map.put(a[i],true);
       }
      int check = x;
      int diff =0;

       while(true){
          if(!map.containsKey(check-diff)){
             System.out.println(check-diff);
             break;
           }
           
          else if(!map.containsKey(check+diff)){
             System.out.println(check+diff);
             break;
           }
           
           else diff++;
        }
   }
}




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

#if DEBUG
template <typename T>
void debug(const T& value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(const T& value, const Ts&... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                        \
  do {                                  \
    cerr << #__VA_ARGS__ << ": ";       \
    debug(__VA_ARGS__);                 \
    cerr << " (L" << __LINE__ << ")\n"; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define rd(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << '\n';
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define wt(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

template <typename T>
using V = std::vector<T>;
template <typename T>
using VV = V<V<T>>;

using namespace std;

int main() {
  rd(int, a, b, c, k);
  int m = max({a, b, c});
  int ans = a + b + c - m;
  rep(i, k) m *= 2;
  wt(ans + m);
}


Measured memory_bytes: 3612
import java.util.*;

@SuppressWarnings("unchecked")
public class Main {
	// public static void printArray(int[] a) {
	// 	for (int i = 0; i < a.length; i++) {
	// 		System.out.print(a[i] + ", ");
	// 	}
	// 	System.out.println();
	// }

	// public static<T> void printArrayT(T[] a) {
	// 	for (int i = 0; i < a.length; i++) {
	// 		System.out.print(a[i] + ", ");
	// 	}
	// 	System.out.println();
	// }

	public static String joinInt(int[] a, String separator) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < a.length; i++) {
			if (i > 0) {
				sb.append(separator);
			}
			sb.append(a[i]);
		}
		return sb.toString();		
	}

	static int[] nextIntArray(Scanner sc, int N) {
		int[] arr = new int[N];
		for (int i = 0; i < N; i++) {
			arr[i] = sc.nextInt();
		}
		return arr;
	}

	static long sum(int[] P, int left, int right) {
		long sum = 0;
		for (int i = left; i < right; i++) {
			int max = P[i];
			int sec = 0;
			for (int j = i + 1; j <= right; j++) {
				if (max > P[j]) {
					if (P[j] > sec) {
						sec = P[j];
					}
				} else {
					sec = max;
					max = P[j];
				}
				sum += (long)sec;
			}
		}
		return sum;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] P = new int[N];
		int[] Q = new int[N + 1];
		for (int i = 0; i < N; i++) {
			int p = sc.nextInt();
			P[i] = p;
			Q[p] = i;
		}
		TreeSet<Integer> set = new TreeSet<>();
		set.add(-1);
		set.add(N);

		long sum = 0;
		for (int i = N; i > 0; i--) {
			int pos = Q[i];
			set.add(pos);
			int l1 = set.lower(pos);
			Integer l2 = set.lower(l1);
			int r1 = set.higher(pos);
			Integer r2 = set.higher(r1);
			int l1diff = pos - l1;
			int l2diff = l2 == null ? 0 : (l1 - l2);
			int r1diff = r1 - pos;
			int r2diff = r2 == null ? 0 : (r2 - r1);
			long pat = (long)l1diff * r2diff + (long)l2diff * r1diff;
			// System.out.println(pat + " * " + i);
			sum += pat * i;
		}
		// System.out.println(sum(P, 0, N - 1));
		System.out.println(sum);
	}
}


Measured memory_bytes: 62108
#include <string>
#include <iostream>
#include <queue>
#include <vector>
#define int long long
using namespace std;

class BIT{
	int zero;
	vector<int> bit;
public:
	BIT(int siz){
		bit.resize(siz + 1,0);
		zero = 0;
	}
	void add(int i,int x){
		if(!i){
			zero += x;
			return;
		}
		while(i < bit.size()){
			bit[i] += x;
			i += i & -i;
		}
	}
	int sum(int i){
		int s = zero;
		while(i){
			s += bit[i];
			i -= i & -i;
		}
		return s;
	}
};

signed main(){
	string s;
	bool used[200010] = {};
	vector<int> ans;
	int k,now = 0;
	queue<int> ind[26];
	cin >> s >> k;
	BIT bit(s.length() + 5);
	for(int i = 0;i < s.length();i++) ind[s[i] - 'a'].push(i);
	for(int pos = 0;now <= k && pos < s.length();pos++){
		for(int i = 0;i < 26;i++){
			if(!ind[i].empty()){
				int t = ind[i].front();
				t += bit.sum(t);
				if(t - pos + now <= k){
					ans.push_back(ind[i].front());
					bit.add(0,1);
					bit.add(ind[i].front(),-1);
					now += t - pos;
					ind[i].pop();
					break;
				}
			}
		}
	}
	for(int t : ans){
		cout << s[t];
		used[t] = true;
	}
	for(int i = 0;i < s.length();i++) if(!used[i]) cout << s[i];
	cout << endl;
	return 0;
}

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

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;
  int count = 0;
  
  for(int i = 0; i < A + 1; i++) {
    for(int j = 0; j < B + 1; j++) {
      for(int k = 0; k < C + 1; k++) {
       if((500 * i) + (100 * j) + (50 * k) == X) {
         count ++;
       }
      }
    }
  }
  
  cout << count <<endl;
}

Measured memory_bytes: 256
<?php
// Your code here!
$a = trim(fgets(STDIN));
$b = trim(fgets(STDIN));
$c = trim(fgets(STDIN));
$d = trim(fgets(STDIN));
$count = 0;
for($i=0; $i<=$a; $i++){
    for($j=0; $j<=$b; $j++){
        for($k=0; $k<=$c; $k++){
            $sum = 500*$i+100*$j+50*$k;
            if($sum == $d){
                $count++;
            }
        }
    }
}
echo $count;
?>


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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////

ll N, M, S[100], C[100];
ll mk[100];
ll i, j, k;

ll calc(ll ii,ll ans){
    if(ii==N){
        return ans;
    }
    ll i, j;
    fornum(i,0,10){
        if(i==0&&ii==0)
            continue;
        fornum(j,0,M){
            if(S[j]==ii&&C[j]!=i){
                break;
            }
        }
        if(j==M){
            ll a = calc(ii + 1, ans * 10 + i);
            if(a>0)
                return a;
        }
    }
    return 0;
}
int main(){
    scanf("%lld%lld", &N, &M);
    fornum(i,0,N+1){
        mk[i] = -1;
    }
    fornum(i,0,M){
        scanf("%lld%lld", &S[i], &C[i]);
        --S[i];
    }
    if (N == 1){
        fornum(i,0,M){
            if(C[i]!=0)
                break;
        }
        if(i==M){
            printf("0");
            return 0;
        }
    }
    ll a = calc(0, 0);
    if(a==0){
        printf("-1");
    }else{
        printf("%lld", a);
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int LL;
#define fi first
#define se second
#define pb push_back
const int N = 2e5 + 5;
int n, m;
vector<int> G[N];
int d[N];
int main(){
// ios::sync_with_stdio(false);
cin >> n >> m;
for(int i = 0; i < m; i++){
	int u, v;
	cin >> u >> v;
	G[u].pb(v);
	G[v].pb(u);
}
for(int i = 0; i < N; i++)d[i] = 100;
d[1] = 0;
for(auto u : G[1])
	d[u] = 1;
for(auto u : G[n])
	if(d[u] == 1){
		cout << "POSSIBLE";
		return 0;
	}

cout << "IMPOSSIBLE";	
} 

Measured memory_bytes: 12784
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const long long INF = 1e10;
const long long MOD = 1e9+7;
using Graph = vector<vector<ll>>;
using pll = pair<ll, ll>;
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;}

// 0 false, 1 true 
// string to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    std::cout << std::fixed << std::setprecision(15);

    while(true){
        ll n; cin >> n;
        if(n == 0){
            break;
        }
        vector<ll> imos(240000);
        rep(i, n){
            string start, end; cin >> start >> end;
            ll num = 100000;
            ll start_num = 0, end_num = 0;
            rep(j, 8){
                if(j % 3 == 2){
                    j++;
                }
                start_num += (ll)(start[j] - 48) * num;
                end_num += (ll)(end[j] - 48) * num;
                num /= 10;
            }
            imos[start_num]++;
            imos[end_num]--;
        }
        
        ll ans = 0;
        rep(i, 240000){
            if(i > 0){
                imos[i] += imos[i-1];
            }
        }
        rep(i, 240000){
            if(imos[i] > ans){
                ans = imos[i];
            }
        }

        cout << ans << endl;

    }
    

}


Measured memory_bytes: 5060
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
template<class Read>void in(Read &x){
    x=0;
    int f=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        f|=(ch=='-');
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    x=f?-x:x;
    return;
}
const int Mod=1000000007;
int n,m,f[1005][1005];
char s[1005][1005];
int main(){
    in(n);in(m);
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            s[i][j]=getchar();
            if(s[i][j]!='.'&&s[i][j]!='#')s[i][j]=getchar();
        }
    }
    f[1][1]=1;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(s[i][j]=='#')continue;
            f[i][j]=(f[i][j]+f[i-1][j]+f[i][j-1])%Mod;
        }
    }
    printf("%d\n",f[n][m]);
	return 0;
}


Measured memory_bytes: 5120
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(long long x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl

#define all(x) x.begin(),x.end()
typedef pair<long long,long long> P;
typedef pair<long long,P> PP;
string s;
long long ss;
long long num;
long long ans;
long long Count(long long a,long long b)
{
	if(a>=b)return 1;
	else return (long long)pow(2,b-a);
}
int main()
{
	cin>>s;
	ss=s.size();
	for(long long start=0;start<ss;start++)
	{
		for(long long fin=start;fin<ss;fin++)
		{
			num=0;
			rep2(k,start,fin+1)
			{
				num*=10;
				num+=(long long)(s[k]-'0');
			}
			ans+=num*Count(0,start-1)*Count(fin+1,ss-1);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
//#include<stdio.h>
//#include<iostream>
//#include<algorithm>
//#include<vector>
//#include<cstring>
//#include<cmath>
//#include<map>
#include<bits/stdc++.h>
using namespace std;

#define fast ios_base::sync_with_stdio(false)
#define outs(x) cout << x << " "
#define outn(x) cout << x << "\n"
#define sf scanf
#define pf printf

int main()
{
    fast;
    int n;
    while(cin >> n)
    {
        outn(n * (n+1) / 2);
    }

    return 0;
}


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

#define ll long long
#define INF_LL 1LL << 60
#define INF 99999999
#define MOD (ll)1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, a, n) for(int i = a; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

void put_double(double obj){printf("%.12f\n",obj);};

template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}

template<typename T> vector<ll> divisor( T n)
{
  vector<ll> ret;
  for(ll i = 1; i * i <= (ll)(n); i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(all(ret));
  return ret;
}

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


int main()
{
    int N;
    cin >> N;

    vector<ll> keys;
    if( N < 105 ) cout << 0 << endl;
    else
    {
        int ans = 0;
        REP(i,105, N+1)
        {
            if(i%2==0)continue;
            keys = divisor(i);
            if( keys.size() == 8 ) ans++;
        }
        cout << ans << endl;
    }
}


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

long long N,A,B;
vector<long long> v(100010,0);

bool enough(long long T){
	long long S = 0;
	for(int i=0;i<N;i++){
		if(v[i] > B*T){
			S += (v[i]-B*T+A-B-1)/(A-B);
		}
	}
	if(T>=S) return true;
	else return false;
}

int main(){
	cin >> N >> A >> B;
	for(int i=0;i<N;i++){
		cin >> v[i];
	}
	long long max = *max_element(v.begin(),v.end());
	long long l = 0, r = (max+B-1)/B;
	long long m;
	while(l+1<r){
		m = (l+r)/2;
		if(enough(m)) r = m;
		else l = m;
	}
	cout << r << endl;
}

Measured memory_bytes: 1024
#include<stdio.h>
int main(){
  int i,j,n,cards[256][14];
  int mark[4]={'S','H','C','D'};
  for(i=0;i<256;i++){
      for(j=0;j<14;j++){
          cards[i][j]=0;
      }
  }
  scanf("%d\n",&n);
  for(i=0;i<n;i++){
      char c=0;
      int n=0;
      scanf("%c %d\n",&c,&n);
      cards[c][n]=1;
  }
  for(j=0;j<4;j++){
      for(i=1;i<14;i++){
          if(cards[mark[j]][i]==0){
              printf("%c %d\n",mark[j],i);
          }
      }
  }
  return 0;  
}


Measured memory_bytes: 2052
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

void solve()
{
    int64_t N, K;
    std::cin >> N >> K;
    std::vector<int64_t> A(N);
    for (auto& v : A) std::cin >> v;

    for (int64_t i = K; i < N; i++)
    {
        std::string ans = A[i - K] < A[i] ? "Yes" : "No";
        std::cout << ans << std::endl;
    }
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    solve();
}


Measured memory_bytes: 4764
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main(){
  ll n,sum=1;
  cin >> n;
  REP(i,n){
    ll tmp; cin >> tmp;
    tmp++;
    tmp %= 2;
    sum *= tmp;
  }
  cout << (sum%2?"second":"first") << endl;
}



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

#define N 20
#define Q 200
#define LIM 2000

int A[N],n;

int search(int num,int key){
  int ans;
  
  if (key==0) return 1;
  if(num>=n) return 0;
  ans=search(num+1,key) || search(num+1,key-A[num]);
  return ans;
}

int main(void){
  int q,m,i;

  scanf("%d",&n);
  if(n>N) exit(3);
  for(i=0;i<n;i++) {
    scanf("%d",&A[i]);
    if(A[i]>LIM) exit(4);
  }
  scanf("%d",&q);
  if(q>Q)exit(2);
  for(i=0;i<q;i++){
    scanf("%d",&m);
    if(m>LIM) exit(1);
    if(search(0,m)) printf("yes\n");
    else printf("no\n");
  }


  
    return 0;
  }

Measured memory_bytes: 580
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
    int n;
    long long ans = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        if (i % 3 != 0 && i % 5 != 0) {
            ans += i;
        }
    }
    cout << ans;
    return 0;
}

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

using namespace std;
const string S[] = {"Sunny", "Cloudy", "Rainy"};
int main() {
#ifndef ONLINE_JUDGE
//	freopen("input.in", "r", stdin);
#endif
	string s;
	cin >> s;
	for (int i = 0; i < 3; ++i)
		if (s == S[i])
			cout << S[(i + 1) % 3] << endl;
	return 0;
}


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

using namespace std;
using Graph = vector<vector<int>>;
using Grid= vector<vector<char>>;
using vin= vector<int>;
using ll=long long;
using vll= vector<ll>;
using vbl=vector<bool>;
using vch=vector<char>;
using pnn=pair<int ,int>;

#define ft first
#define sd second
#define fn front
#define pb push_back
#define it insert
#define si(v) int((v).size())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rell(i,n) for (ll i=0; i< (ll)(n); i++)
#define sot(x) sort(x.begin(), x.end())
#define rese(x) reverse(x.begin(), x.end())
#define vnn(x,y,s,name) vector<vector<int>> name(x, vector<int>(y,s))
#define mse(x) memset(x, 0, sizeof(x))
#define mii(x,y,z) min(x,min(y,z))
#define maa(x,y,z) max(x,max(y,z))

string yes="Yes",no="No";

int main() {
   ll n;
   cin>>n;
   vll kosu(n+5,0);
   ll sqn;
   for(int i=1;i<n;i++){
    if((i+1)*(i+1)>n){
        sqn=n;
        break;
    }
   }
   for(int i=1;i<=n;i++){
       
      for(int j=1;j*i<=n;j++){
          kosu[i*j]++;
      }
   }
   ll ans=0;
   rep(i,n) ans+=kosu[i];
   cout<<ans<<endl;
}   
   



Measured memory_bytes: 11120
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for (int i = 0 ; i <= n ; i++) {
            int sum = 0;
            int x = i;
            while (x > 0) {
                sum += x % 10;
                x /= 10;
            }
            if (sum >= a && sum <= b) count += i;
        }
        System.out.println(count);
    }

}


Measured memory_bytes: 21588
#include <cstdio>
#include <iostream>
#include <vector>

#define rep(i,n) for(int i=0;i<(n);i++)


int main(){
        int N,M;
        scanf("%d %d",&N,&M);
        int dum[2];
        int A[N+1] = {0};
        int B[N+1] = {0};
        int ans = 0;
        rep(i,M){
                scanf("%d %d",dum,dum+1);
                if (dum[0] == 1){
                        A[dum[1]] = 1;
                        if (B[dum[1]] == 1){
                                ans = 1;
                                break;
                        }
                }
                if (dum[1] == N){
                        B[dum[0]] = 1;
                        if (A[dum[0]] == 1){
                                ans = 1;
                                break;
                        }
                }
        }
        if (ans == 1){
                std::cout << "POSSIBLE" << std::endl;
        }
        else{
                std::cout << "IMPOSSIBLE" << std::endl;
        }
        return 0;
}



Measured memory_bytes: 1792
N = int(input())
c = input()
red = 0

for i in c:
    if i=="R":
        red += 1

br = 0
ans = 10**12 if red else 0
for i in range(red):
    if c[i]=="R":
        br += 1
    white = i+1 - br
    disappear = red - br - white
    ans = min(ans, white+disappear)

print(ans)


Measured memory_bytes: 9380
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n;
	cin>>n;
	long long a[n],ans=0-n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		ans+=a[i];
	}
	cout<<ans;
	return 0;
} 

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


int main() {
    int N;
    string S;
    cin >> N;
    cin >> S;
    N = S.length();
    int totalWhite = 0;
    int totalBlack = 0;
    int black[N];
    int white[N];
    rep(i, N) {
        if (S[i] == '#') {
            totalBlack++;
        } else {
            totalWhite++;
        }
        black[i] = totalBlack;
        white[i] = totalWhite;
    }

    int ans = INT_MAX;
    rep(i, N) {
        int leftBlack = black[i];
        int leftWhite = white[i];
        int rightBlack = totalBlack - black[i];
        int rightWhite = totalWhite - white[i];
        //全部白にするときの数
        int allWhite = leftBlack + rightBlack;
        //左を白、みぎを黒にするときの数
        int turn = leftBlack + rightWhite;
        //全部黒にする
        int allBlack = leftWhite + rightWhite;
        
        ans = min(ans, allWhite);
        ans = min(ans, allBlack);
        ans = min(ans, turn);
    }
    if (ans == INT_MAX) {
        cout << 0 << endl;
    } else {
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 2180
#include <bits/stdc++.h>
 
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>
#define debug cout << "Ok" << endl;

using namespace std;

bool check(string s, int in, int end){

	while(in<=end){
		if(s[in]!=s[end]) return false;
		in++;
		end--;
	}
	return true;
}
 
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	string s;
	cin >> s;

	if(check(s,0,s.size()-1)  and check(s,0,(s.size())/2-1) and check(s,s.size()/2+1,s.size()-1))
		cout << "Yes" << endl;
	else 
		cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
  using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define int long long
  #define all(v) v.begin(),v.end()
  #define rep(i,a,b) for(int i = a; i <=b; i++)
  #define rep2(i,a,b) for(int i = a; i>=b; i--)
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define db long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)

int32_t main()
{



    int x;
     cin >> x;
     if(x == 5 or x == 7 or x == 3)
     {
      cout <<"YES";
     }
     else
     {
      cout << "NO";
     }

   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define all(x) (x).begin(), (x).end()
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> A(n);
    vector<vector<int> > x(n, vector<int>(n, 0)), y(n, vector<int>(n, 0));
    for (int i = 0; i < n; i++) {
        cin >> A[i];
        for (int j = 0; j < A[i]; j++) {
            cin >> x[i][j] >> y[i][j];
            x[i][j]--;
        }
    }
    int ans = 0;
    for (int bit = 0; bit < (1 << n); bit++) {
        bool flag = true;
        int cnt = 0;
        for (int i = 0; i < n; i++) {
            if (!(bit >> i & 1)) continue;
            cnt++;
            for (int j = 0; j < A[i]; j++) {
                if (((bit >> x[i][j]) & 1) ^ y[i][j]) flag = false;
            }
        }
        if (flag) ans = max(ans, cnt);
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<LL , LL> , LL> P3;
typedef pair<pair<LL , LL> , pair<LL , LL> > P4;
#define PB(a,b,c,d) push_back(make_pair(make_pair(a,b),make_pair(c,d)))
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define fst first.first
#define snd first.second
#define trd second.first
#define fth second.second

const LL mod = 1e9 + 7;
LL A,B,C,D;
vector<P4> V;

int main(){
	cin >> A >> B >> C >> D;
	LL x = min(A,D+1) , y = min(B,D+1) , z = min(C,D+1);
	LL ans = x * y * z % mod;
	repp(i,1,D+1){
		if(i<A) V.PB(i,B*i/A,C*i/A,1);
		if(i<B) V.PB(A*i/B,i,C*i/B,2);
		if(i<C) V.PB(A*i/C,B*i/C,i,3);
		if(A-i>0) V.PB(A-i,B*(A-i)/A,C*(A-i)/A,-1);
		if(B-i>0) V.PB(A*(B-i)/B,B-i,C*(B-i)/B,-2);
		if(C-i>0) V.PB(A*(C-i)/C,B*(C-i)/C,C-i,-3);
	}
	V.PB(A,B,C,0);
	sort(V.begin(),V.end());
	LL a = 0 , b = 0 , c = 0;
	for(auto u : V){
		/*for(auto w : {u.fst,u.snd,u.trd,u.fth,ans}) cout << w << ' ';
		cout << endl;*/
		(ans += y * z % mod * max((LL)0,(min(u.fst,A-D-1)-a))) %= mod;
		(ans += x * z % mod * max((LL)0,(min(u.snd,B-D-1)-b))) %= mod;
		(ans += x * y % mod * max((LL)0,(min(u.trd,C-D-1)-c))) %= mod;
		(abs(u.fth) == 1 ? x : (abs(u.fth) == 2 ? y : z)) += (u.fth > 0 ? 1 : -1);
		a = u.fst , b = u.snd , c = u.trd;
	}
	cout << ans % mod << endl;
	return 0;
}


Measured memory_bytes: 18664
a = [list(map(int, input().split())) for _ in range(3)]
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k] == b:
                a[j][k] = 0
ans = "No"
for i in range(3):
    if a[i][0] == a[i][1] == a[i][2] == 0:
        ans = "Yes"
    if a[0][i] == a[1][i] == a[2][i] == 0:
        ans = "Yes"
if a[0][0] == a[1][1] == a[2][2] == 0:
    ans = "Yes"
if a[2][0] == a[1][1] == a[0][2] == 0:
    ans = "Yes"
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<ll>H(n);
	for(int i=0;i<n;i++)
		cin>>H[i];
	int res=0;
	vector<int>dp(n,0);
	dp[n-1]=0;
	for(int i=n-2;i>=0;i--){
		dp[i]=H[i]>=H[i+1]?dp[i+1]+1:0;
	}
	for(int i=0;i<n;i++)
		res=max(res,dp[i]);
	cout<<res;
	return 0;
}

Measured memory_bytes: 1408
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
sum, hoge = 0, 100
for i in range(n):
    sum += b[a[i]-1]
    if hoge + 1 == a[i]:
        sum += c[hoge-1]
    hoge = a[i]
print(sum)

Measured memory_bytes: 3064
#include<stdio.h>
int main()
{
    char str[5];
    scanf("%s",str);
    for(int i=0; i<3; i++)
    {


        if(str[i]==str[i+1])
        {
            printf("Bad\n");
            goto a;
        }



    }
    printf("Good\n");
a:
    return 0;
}


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

int main() {
  int a[4];
  for (int i=0; i<4; i++) {
    cin>>a[i];
  }
  if (a[1]<a[2]||a[3]<a[0]) {
    cout<<0<<endl;
    return 0;
  }
  sort(a,a+4);
  cout<<a[2]-a[1]<<endl;
  return 0;
}

Measured memory_bytes: 256
require 'prime'

def max(a,b); a > b ? a : b; end
dp = Array.new(41, -1); dp[0] = 0
(1 .. 40).each do |a|
  40.downto(1) do |sum|
    dp[sum] = max(dp[sum], dp[sum - a] + 1) if dp[sum - a] >= 0 && sum - a >= 0
  end
end
N = gets.to_i
ans = N.prime_division.inject(0) do |s, (n,e)|
  s + dp[e]
end
puts ans


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

#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

typedef pair<int, int> pint;

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front

#define MOD (1000 * 1000 * 1000 + 7)

signed main() {
    string s;
    cin >> s;

    if (s == "SUN") cout << 7 << endl;
    if (s == "MON") cout << 6 << endl;
    if (s == "TUE") cout << 5 << endl;
    if (s == "WED") cout << 4 << endl;
    if (s == "THU") cout << 3 << endl;
    if (s == "FRI") cout << 2 << endl;
    if (s == "SAT") cout << 1 << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
const ll mod=998244353;

const int N=2e5+1;

int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll T=clock();

    ll n,x,m;
    cin>>n>>x>>m;
    vector<ll> pref(N,0);
    map<ll,ll> mpp;
    pref[0]=x;
    mpp[x]=0;
    ll i=1, pval=x, val;
    while(i<n){
        val=(pval*pval)%m;
        if(val==0){
            cout<<pref[i-1];
            return 0;
        }
        if(mpp.find(val)!=mpp.end())
            break;
        pref[i]=pref[i-1]+val;
        mpp[val]=i++;
        pval=val;
    }
    if(i==n){
        cout<<pref[n-1];
        return 0;
    }
    ll pos=mpp[val];
    ll len=i-pos;
    ll seg=pref[i-1];
    if(pos!=0) seg-=pref[pos-1];
    n-=i;
    ll ans=pref[i-1];
    ans=ans+(n/len)*seg;
    ll rem=n%len;
    if(rem!=0){
        ans=ans+pref[pos+rem-1];
        if(pos!=0) ans-=pref[pos-1];
    }
    cout<<ans;
    //cout<<i-pos<<"\n";



    cerr<<"\n\nTIME: "<<(double)(clock()-T)/CLOCKS_PER_SEC<<" sec\n";
    T = clock();
    return 0;
}

Measured memory_bytes: 7940
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x,y = iim()

if y == 1 or x%y == 0:
    print(-1)
else:
    print(x*(y-1))

Measured memory_bytes: 3064
# coding: utf-8
H, W = map(int, input().split())
maze = []
for i in range(H):
    maze.append(input())
ans = [[0 for _ in range(W)] for _ in range(H)]

dx = [0, 0, 1, 1, 1, -1, -1, -1]
dy = [1, -1, 0, 1, -1, 0, 1, -1]
for i in range(H):
    for j in range(W):
        if maze[i][j] == "#":
            ans[i][j] = "#"
            continue
        cnt = 0
        for k in range(len(dx)):
            if 0 <= i + dx[k] <= H-1 and 0 <= j + dy[k] <= W-1:
                if maze[i+dx[k]][j+dy[k]] == "#":
                    cnt += 1
        ans[i][j] = str(cnt)
for i in range(H):
    print("".join(ans[i]))


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

int main(){
	int W,H,N;
	int x,y,a;
	cin>>W>>H>>N;
	int arr[100][100]={1};
	for(int i=0;i<H;++i){
		for(int j=0;j<W;++j){
			arr[i][j]=0;
		}
	}
	for(int i=0;i<N;++i){
		cin>>x>>y>>a;
		if (a==1){
			for(int h=0;h<H;++h){
				for(int w=0;w<x;++w){
					arr[h][w]++;
				}
			}
		}
		if (a==2){
			for(int h=0;h<H;++h){
				for(int w=x;w<W;++w){
					arr[h][w]++;
				}
			}
		}
		if (a==3){
			for(int h=0;h<y;++h){
				for(int w=0;w<W;++w){
					arr[h][w]++;
				}
			}
		}
		if (a==4){
			for(int h=y;h<H;++h){
				for(int w=0;w<W;++w){
					arr[h][w]++;
				}
			}
		}
	}
	int ans=0;
	for(int i=0;i<H;++i){
		for(int j=0;j<W;++j){
			if(arr[i][j]==0) ans++;
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    if(a==b && b==c){
        cout << 1 << endl;
    }
    else if(a==b || b==c || c==a){
        cout << 2 << endl;
    }
    else{
        cout << 3 << endl;
    }
}

Measured memory_bytes: 256
import sys

N = int(input())
*B, = map(int, input().split())

ok = 1
for i in range(N):
    if B[i] > i+1:
        ok = 0
if not ok:
    print(-1)
    exit(0)

ans = []
S = [0]*N
for i in range(N):
    rest = i
    for j in range(N-1, -1, -1):
        if S[j] == 1:
            rest -= 1
            continue
        if rest+1 == B[j]:
            ans.append("%d\n" % B[j])
            S[j] = 1
            break
sys.stdout.writelines(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define int long long
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

vector<int> init(int size){
  vector<int> par(size,-1);
  return par;
}

int root(int x, vector<int>& par){
  if(par[x] < 0){
    return x;
  }else{
    return par[x] = root(par[x],par);
  }
}

bool same(int x, int y, vector<int>& par){
  return root(x, par) == root(y, par);
}

void unite(int x, int y, vector<int>& par){
  x = root(x, par), y = root(y, par);
  if(same(x,y, par))return;
  par[x] += par[y];
  par[y] = x;
}

int size(int x, vector<int>& par){
  return -par[root(x, par)];
}

signed main(){
  int n,h=0,ans=0;cin>>n;
  rep(i,n){
    int a;cin>>a;
  if(h<=a){
   ans++;
    h=a;
  }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
// This code wrote by chtholly_micromaker(MicroMaker)
#include <bits/stdc++.h>
#define reg register
#define int long long
using namespace std;
template <class t> inline void read(t &s)
{
	s=0;
	reg int f=1;
	reg char c=getchar();
	while(!isdigit(c))
	{
		if(c=='-')
			f=-1;
		c=getchar();
	}
	while(isdigit(c))
		s=(s<<3)+(s<<1)+(c^48),c=getchar();
	s*=f;
	return;
}
map<int,int> cnt;
signed main(void)
{
	reg int x,ans=0;
	int n;cin>>n;
	for(int i=1;i<=n;++i)
	{
		read(x);
		ans+=cnt[i-x];
		++cnt[i+x];
	}
	cout<<ans<<endl;
	return 0;
}




Measured memory_bytes: 26152
#include<math.h>
main(){
  int d,e;
  double x=0.0,y=0.0,a=-M_PI/2;
  for(;;){
    scanf("%d,%d",&d,&e);
    if(d==0&&e==0)
      break;
    x+=cos(a)*d;
    y+=sin(a)*d;
    a+=(double)(e)/180*M_PI;
  }
  printf("%d\n%d\n",(int)x,-(int)y);
  return 0;
}

Measured memory_bytes: 0
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll X;
    cin >> X;
    ll amari = X % 100;
    ll shou = X / 100;
    if(amari > shou*5){
        print(0);
    }else{
        print(1);
    }


}

Measured memory_bytes: 256
#include <iostream>

using ll = long long;
constexpr ll MOD = (1e9) + 7;

class Parser {
  private:
    std::string s;
    std::string::const_iterator it;
    
  public:
    Parser (std::string s) {
        this->s = s;
        it = this->s.begin();
    }

    ll number()
    {
        ll res = 0;
        while (isdigit(*it)) {
            res *= 10;
            res += *it - '0';
            ++it;
        }
        return res;
    }
    
    ll term()
    {
        ll res = 0;
        if (isdigit(*it)) {
            res = number();
        } else if (*it == 'S') {
            it += 2; // S <            
            res = expr() % MOD;            
            res = (res * res) % MOD;
            ++it; // >
        }
        return res;
    }

    bool is_term(char ch)
    {
        return (isdigit(ch) || ch == 'S');
    }

    void shift(ll &x, ll y)
    {
        for (ll i = 0; i < y; i++) {
            if (x == 0) {
                return;
            }
            x >>= 1;
        }
    }
    
    ll expr()
    {
        ll res = term();
        while (*it == '>' && *(it + 1) == '>' && is_term(*(it + 2))) {
            it += 2;
            shift(res, term());            
            res %= MOD;
        }
        return res;
    }
};

std::string remove_spaces(const std::string &s)
{
    std::string res;
    for (char c : s) {
        if (c != ' ') {
            res += c;
        }
    }
    return res;
}

int main()
{
    std::string s;
    while (1) {
        std::getline(std::cin, s);
        if (s == "#") {
            break;
        }
        s = remove_spaces(s);
        
        Parser p{s};
        std::cout << p.expr() << std::endl;
    }
    return 0;
}

Measured memory_bytes: 5836
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()

ll mpow(ll a, ll b){
	if(b==0){
		return a;
	}else if(b%2==0){
		ll memo = mpow(a,b/2);
		return memo*memo%MOD;
	}else{
		return mpow(a,b-1) * a % MOD;
	}
}

int main(void){
	int x,a;
	cin>>x>>a;
	cout<<(x<a?0:10)<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
int n, ma=0, mi=IINF;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 0, n){
    int a;
    cin >> a;
    maxs(ma, a);
    mins(mi, a);
  }
  cout << ma-mi << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int N;

int  main(void){
	scanf("%d",&N);
	for(int i=1;i<=9;i++){
		if(N/i<=9){
			if(N%i==0){
				printf("Yes");
				return 0;
			}else{
				continue;
			}
		}else{
			continue; 
		}
	
	}
	printf("No");
	return 0;
}

Measured memory_bytes: 128
int(input())
a=str(input())
b,c,d=set(),set(),set()
e=0
for i in range(len(a)):
    for j in range(i):
        b.add(a[j])
    for k in range(i,len(a)):
        c.add(a[k])
    for l in range(len(b)):
        b=list(b)
        if b[l] in c:
            e+=1
    d.add(e)
    b,c=set(),set()
    e=0
print(max(d))

Measured memory_bytes: 3064
import java.util.Scanner;
import java.math.*;

public class Main {

	/*
	 * 余りの最大値を求める。
	 */
	public static void main(String[] args) {

		/*
		 * Scannerで値取得。
		 */
		Scanner s = new Scanner(System.in);
		int number = s.nextInt();
		int stan_height = s.nextInt();

		int sum = 0;
		int height = 0;
		for(int i = 0; i < number; i++) {
			height = s.nextInt();
			if(height >= stan_height) {
				sum++;
			}
		}
		
		System.out.println(sum);
	}

}


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

int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> distances;
  distances.push_back(0);
  for (int i = 1; i < n; i++) {
    int tmp;
    cin >> tmp;
    distances.push_back(tmp+distances[i-1]);
  }

  int move_sum = 0, pos = 0;
  for (int i = 0; i < m; i++) {
    int move;
    cin >> move;
    if (move > 0) {
      move_sum += distances[pos+move] - distances[pos];
    } else {
      move_sum += distances[pos] - distances[pos+move];
    }
    pos += move;
    move_sum %= 100000;
  }

  cout << move_sum << endl;
  return 0;
}

Measured memory_bytes: 1672
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, H, M = MAP()

deg = (60*H + M)*5.5%360
arg = min(360-deg, deg)
#print(arg)
ans = (A**2 + B**2 - 2*A*B*cos(radians(arg)))**0.5

print(ans)

Measured memory_bytes: 10376
#include <bits/stdc++.h>
#include<iostream>
using namespace std;
 
int main() {
 	map<int,int>a;
  	int A;
  	for(int i = 0;i < 3;i++){
      cin >> A;
      a[A] = 1;      
    }
  cout << a.size();
  	

}
   

Measured memory_bytes: 3576
#include<bits/stdc++.h>
#define ll long long int
#define vec vector<ll>
#define mat vector<vec>

using namespace std;

const ll mod=1000000007;
const ll inf=LONG_LONG_MAX;
ll dx4[4]={1,0,-1,0};
ll dy4[4]={0,-1,0,1};
ll dx8[8]={1,0,-1,1,-1,1,0,-1};
ll dy8[8]={1,1,1,0,0,-1,-1,-1};

int main(){

  ll m,n;
  cin >> m >> n;

  ll ans=0;
  if(m==1 && n==1){
    ans=1;
  }
  else if(m==1){
    ans=n-2;
  }
  else if(n==1){
    ans=m-2;
  }
  else{
    ans=(m-2)*(n-2);
  }
  cout << ans << endl;

}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const long long INF = 1001001001;
const long long MOD = 1000000007;
const double EPS = 1e-10;

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

    int n;
    cin>>n;
    int a[n],cnt[1010101]={};
    int g=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        cnt[a[i]]++;
        g=__gcd(g,a[i]);
    }
    for(int i=2;i<1010101;i++){
        for(int j=i*2;j<1010101;j+=i)cnt[i]+=cnt[j];
    }
    bool flag=true;
    for(int i=2;i<1010101;i++){
        if(cnt[i]>1)flag=false;
    }
    if(flag)cout<<"pairwise coprime"<<endl;
    else if(g==1)cout<<"setwise coprime"<<endl;
    else cout<<"not coprime"<<endl;
}

Measured memory_bytes: 11456