akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main(){
  ll n,a,b ;
  cin>>n>>a>>b ;
  if(n==1){
    if(a==b) cout <<1<<endl ;
    else cout<<0<<endl ;
  }
    
    else{
      if(a>b) cout<<0<<endl ;
      else cout<<(n-2)*(b-a)+1 <<endl ;
    }
    return 0;
  }

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

int main(){
	string order = "xxx";
	cin >> order;

	int price = 700;
	for (int i=0; i<3; i++){
		if (order.at(i) == 'o')
			price += 100;
	}

	cout << price << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()

/* do your best */

lint cnt[10][10] = {};

int main() {
  
  lint n; cin >> n;
  for(int i = 1; i <= n; i++) {
    lint x = i;   
    lint shita = x % 10;
    while(x >= 10) {
      x /= 10;
    }
    lint ue = x;
    cnt[shita][ue]++;
  }

  lint ans = 0;
  for(int i = 1; i <= 9; i++) {
    for(int j = 1; j <= 9; j++) {
      ans += cnt[i][j] * cnt[j][i];
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <utility>
#include <string>

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ul;

const int iinf = 1 << 29;
const long long linf = 1l << 61;

int N, M, R;
int r[8];
int d[210][210];

int main(int argc, char* argv[])
{
	scanf("%d %d %d", &N, &M, &R);
	for(int i = 0; i < R; i++)
	{
		scanf("%d", &r[i]);
		r[i]--;
	}
	memset(d, -1, sizeof(d));
	for(int i = 0; i < N; i++) d[i][i] = 0;
	for(int i = 0; i < M; i++)
	{
		int a, b ,c;
		scanf("%d %d %d", &a, &b, &c);
		a--; b--;
		d[a][b] = c;
		d[b][a] = c;
	}

	//ワーシャルフロイド
	for(int k = 0; k < N; k++)
	{
		for(int i = 0; i < N; i++)
		{
			for(int j = 0; j < N; j++)
			{
				int a = d[i][j];
				int b = (d[i][k] != -1 && d[k][j] != -1) ? d[i][k] + d[k][j] : -1;
				if(a == -1)
				{
					if(b == -1) d[i][j] = -1;
					else d[i][j] = b;
				}
				else if(b == -1) d[i][j] = a;
				else d[i][j] = min(a, b);
			}
		}
	}

	ll ans = linf;
	sort(r, r + R);
	do
	{
		ll s = 0;
		for(int i = 0; i < R - 1; i++) s += d[r[i]][r[i + 1]];
		ans = min(ans, s);
	} while(next_permutation(r, r + R));
	printf("%lld\n", ans);

	return 0;
}


Measured memory_bytes: 512
#include <stdio.h>

int main(void){
	int n, u, k, v;
	int Adj[100][100] = { 0 };
	int i, j;

	scanf("%d", &n);
	for (i = 0; i < n; i++){
		scanf("%d %d", &u, &k);
		for (j = 0; j < k; j++){
			scanf("%d", &v);
			Adj[u - 1][v - 1] = 1;
		}
	}

	for (i = 0; i < n; i++){
		for (j = 0; j < n; j++){
			if (j != n - 1)
				printf("%d ", Adj[i][j]);
			else
				printf("%d\n", Adj[i][j]);
		}
	}

	return 0;
}

Measured memory_bytes: 648
#pragma region // {{{ by unolight
#include <bits/stdc++.h>
#include <unistd.h>
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define RALL(x) rbegin(x),rend(x)
#define REP(i,n) for ( int i=0; i<int(n); i++ )
#define REP1(i,a,b) for ( int i=(a); i<=int(b); i++ )
#define MP make_pair
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

namespace { namespace unolight {
// Read Input
template<class T> void _R( T &x ) { cin>>x; }
void _R( int &x ) { scanf("%d",&x); }
void _R( int64_t &x ) { scanf("%" PRId64,&x); }
void _R( double &x ) { scanf("%lf",&x); }
void _R( char &x ) { scanf(" %c",&x); }
void _R( char *x ) { scanf("%s",x); }
void R() {}
template<class T, class... U> void R( T& head, U&... tail ) { _R(head); R(tail...); }
// Write Output
template<class T> void _W( const T &x ) { cout<<x; }
void _W( const int &x ) { printf("%d",x); }
void _W( const int64_t &x ) { printf("%" PRId64,x); }
void _W( const double &x ) { printf("%.16f\n",x); }
void _W( const char &x ) { putchar(x); }
void _W( const char *x ) { printf("%s",x); }
template<class T> void _W( const vector<T> &x ) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W( const T& head, const U&... tail ) { _W(head); putchar(sizeof...(tail)?' ':'\n'); W(tail...); }

#ifdef UNOLIGHT
#include "dump.hpp"
#else
#define dump(...)
#endif

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}
#pragma endregion // }}}

void main() {
    int m,n;
    R(m,n);
    vector<vector<PII>> a(n);
    REP(i,m) {
        int s,t,c;
        R(s,t,c);
        --s; --c;
        a[c].PB({s,t});
    }
    vector<PII> b;
    REP(i,n) {
        if ( SZ(a[i])==0 ) continue;
        sort(ALL(a[i]));
        PII t={-1,-1};
        REP(j,SZ(a[i])) {
            if ( t.first==-1 || t.second<a[i][j].first ) {
                b.push_back(t);
                t=a[i][j];
            } else {
                t.second = a[i][j].second;
            }
        }
        b.push_back(t);
    }
    sort(b.begin(),b.end());
    multiset<int> s;
    int ans=0;
    REP(i,SZ(b)) {
        if ( !SZ(s) || *s.begin()>b[i].first ) {
            s.insert(b[i].second);
        } else {
            s.erase(s.begin());
            s.insert(b[i].second);
        }
        chmax(ans,SZ(s));
    }
    W(ans);
}

}} // {{{ main
int main() { unolight::main(); return 0; }
// }}}

Measured memory_bytes: 5484
#include <bits/stdc++.h>
using namespace std;
#define vi vector<long long int>
#define vs vector<string>
#define mii map<long long int, long long int>
#define M 1000000007

void show(auto a){
  long long int i = 0;
  while(i < a.size()){
    cout<<a[i]<<" ";
    i++;
  }
  cout<<endl;
}


int main(){
  ios_base::sync_with_stdio(false);


  long long int h, w;
  cin>>h>>w;

  char in[h+1][w+1];
  long long int dp[h+1][w+1];

  for(long long int i = 1; i <= h; i++){
  	string s;
  	cin>>s;
  	for(long long int j = 0; j < s.length(); j++){
  		in[i][j+1] = s[j];

  	}
  }

  for(long long int i = 0; i <= h; i++){
  	for(long long int j = 0; j <= w; j++){
  		dp[i][j] = 0;
  	}
  }

  for(long long int i = 1; i <= h; i++){
  	if(in[i][1] == '#') break;
  	  	dp[i][1] = 1;

  }

  for(long long int i = 1; i <= w; i++){
  	if(in[1][i] == '#') break;
  	dp[1][i] = 1;

  }

  for(long long int i = 2; i <= h; i++){
  	for(long long int j = 2; j <= w; j++){
		if(in[i][j] == '.') dp[i][j] = (dp[i-1][j]%M + dp[i][j-1]%M)%M;
		else dp[i][j] = 0;
  	}
  }
  

  cout<<dp[h][w]%M<<endl;

  // for(long long int i = 1; i <= h; i++){
  // 	for(long long int j = 1; j <= w; j++){
  // 		cout<<dp[i][j]<<" ";
  // 	}
  // 	cout<<endl;
  // }
  
}



Measured memory_bytes: 9088
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int maxn=105;
int a[105];
int main(){
	double m,n,sum=0;
	cin>>n>>m;
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum+=a[i];
	}
	int res=0;
	double mk=sum/(4*m);
	for(int i=0;i<n;i++){
		if(a[i]>=mk)
		
			res++;
	}
	if(res>=m)
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll h,w;
	cin>>h>>w;
	ll c[10][10];
	for(ll i=0;i<10;i++){
		for(ll j=0;j<10;j++){
			cin>>c[i][j];
		}
	}
	for(ll k=0;k<10;k++){
		for(ll i=0;i<10;i++){
			for(ll j=0;j<10;j++){
				c[i][j]=min(c[i][j],c[i][k]+c[k][j]);
			}
		}
	}
	ll ans=0;
	for(ll i=0;i<h;i++){
		for(ll j=0;j<w;j++){
			ll now;
			cin>>now;
			if(now==-1){
				continue;
			}
			ans+=c[now][1];
		}
	}
	cout <<ans;
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
const ll N = 1e6 +9;
const ll p = 31;
const ll m = 1e9 + 7;
const ll inf= 1e14;
ll mod = 1e9+7;
ll powm(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; }
 
int main() {   
     ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
   
     ll t = 1;
     // cin>>t;
 
     while(t--){
          ll n;cin>>n;
          string s,t;
          cin>>s>>t;
          for(int i =0;i<n;i++){
               cout<<s[i]<<t[i];
          }
     }
}         

Measured memory_bytes: 256
#include <stdio.h>
#include <ctype.h>
 
int main(void){
    int abc[26] = {0}, i;
    char ch;
 
    while (scanf("%c", &ch) != EOF){
        if (!isalpha(ch))continue;
 
        if (isupper(ch))ch = tolower(ch);
        abc[ch - 'a']++;
    }
 
    for ( i = 0; i < 26; i++){
        printf("%c : %d\n", 'a' + i, abc[i]);
    }
     
    return 0;
}
  

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

const ll MOD=1000000007;

int main(){
    int N;
    int K;
    cin>>N>>K;
    vector<int>A(N,0);
    for(int i=0;i<K;i++){
        int d;
        cin>>d;
        for(int j=0;j<d;j++){
            int a;
            cin>>a;
            A.at(a-1)=1;
        }
    }
    int count=0;
    for(int i=0;i<N;i++){
        if(A.at(i)==0){
            count=count+1;
        }
    }
    cout<<count<<endl;

}

Measured memory_bytes: 3604
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

bool f(char c) { return (c == 'A' || c == 'C' || c == 'G' || c == 'T'); }

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

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

  int ans = 0;
  for (int l = 0; l < n; l++) {
    if (!(s[l])) {
      continue;
    }
    int r = l;
    while (r < n && f(s[r])) {
      r++;
    }
    ans = max(ans, r - l);
  }
  cout << ans << "\n";

  return 0;
}

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

bool dfs(int v, vector<vector<int> > &adj, vector<int> &col){
    for(int next : adj[v]){
        if(col[next] == col[v]) return false;
        if(col[next] == 0){
            col[next] = 3-col[v];
            if(!dfs(next, adj, col)){
                return false;
            }
        }
    }
    return true;
}

bool bipartite_coloring(vector<vector<int> > &adj, vector<int> &col){
    for(int i=0; i<(int)adj.size(); i++){
        if(col[i] == 0) col[i] = 1;
        if(!dfs(i, adj, col)){
            return false;
        }
    }
    return true;
}

int main(){
    while(1){
        int n,m;
        cin >> n >> m;
        if(n == 0) break;

        vector<vector<int> > adj(n);
        for(int i=0; i<m; i++){
            int s,t;
            cin >> s >> t;
            s--; t--;
            adj[s].push_back(t);
            adj[t].push_back(s);
        }
        vector<int> color(n, 0);
        if(!bipartite_coloring(adj, color)){
            cout << 0 << endl;
            continue;
        }
        int count=0;
        for(int i=0; i<n; i++){
            if(color[i] == 1) count++;
        }
        if(count > n-count){
            count = n-count;
        }
        
        int k=0;
        int ans[2];
        for(int d=0; d<2; d++){
            if(count%2 == 0){
                ans[k] = count/2;
                k++;
            }
            count = n-count;
        }
        if(k==2 && ans[0] == ans[1]){
            k--;
        }
        cout << k << endl;
        for(int i=0; i<k; i++){
            cout << ans[i] << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 3208
#include <iostream>
#include <algorithm>
using namespace std;
 
typedef long long lli;
 
int n;
lli m,C[61][61];
 
void init(){
  for(int i=0;i<=60;i++) C[i][i] = C[i][0] = 1LL;
  for(int i=2;i<=60;i++)
    for(int j=1;j<i;j++)
      C[i][j] = C[i-1][j] + C[i-1][j-1];
}
 
void solve(){
  int one;
  lli sum = 1;
  string str = "";
  for(int i=1;i<=n;i++){
    //cout << sum << " <= " << m << " < " << sum+C[n][i] << endl;
    if(sum <= m && m < sum+C[n][i]){
      one = i;
      break;
    }
    sum += C[n][i];
  }
 
  m -= sum;
  sum = 0;
  for(int i=1;i<=n;i++){
    //cout << m << " < " << C[n-i][one-1] << endl;
    if(one == 0) break;
    if(m-sum < C[n-i][one]) str += '0';
    else{
      str += '1';
      sum += C[n-i][one];
      one--;
    }
  }
  for(int i=str.size();i<n;i++) str += '0';
  cout << str << endl;
}
 
int main(){
  init();
  while(cin >> n >> m && (n|m)){
    if(m == 1){
      for(int i=0;i<n;i++) cout << '0';
      cout << endl;
    } else {
      m--;
      solve();
    }
  }
}

Measured memory_bytes: 1244
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

def check(x,y,X,Y):
    # print(x,y)
    x.append(X)
    y.append(Y)
    # print(x,y)
    if min(y)>max(x):
        return True
    return False
if check(x,y,X,Y):
    print('No War')
else:
    print('War')

Measured memory_bytes: 3064
/*
时间:2020-7-25
书籍：算法和数据结构
内容：稳定排序
页数：P48
*/
#include<iostream>
using namespace std;
class Card
{
public :
	char suit;
	char value;
	Card& operator=(Card& c) {
		this->suit = c.suit;
		this->value = c.value;
		return *this;
	}
};
void printArray( Card a[],int length)
{
	for (int i = 0; i < length - 1; ++i)
		cout << a[i].suit<<a[i].value << " ";
	cout << a[length-1].suit<<a[length - 1].value;                       //防止行元素后的空格多余导致PE
	cout << endl;                             //每一行结束输出要换行

}
void selectionSort(Card a[], int length)
{
	int count = 0;
	for (int i = 0; i < length; ++i)
	{
		int min = i;
		for (int j = i + 1; j < length; ++j)
			if (a[j].value < a[min].value)
				min = j;
		if (i != min)
		{
			++count;
			swap(a[i], a[min]);
		}
	}
}
void bubbleSort(Card b[], int length)
{
	bool flag = true;
	for (int i = 0; i < length&&flag; ++i)
	{
		flag = false;
		for (int j = 0; j < length - i - 1; ++j)
		{
			if (b[j].value > b[j + 1].value)
			{
				flag = true;
				swap(b[j], b[j + 1]);
			}
		}
	}
}
bool ifnStable(Card a[], Card b[],int n)         //判断选择排序是否稳定
{                                                //可以将选择排序的结果与冒泡排序的结果相比较，减少时间复杂度
	for (int i = 0; i < n; ++i)
	{
		if (a[i].suit != b[i].suit)
			return false;
	}
	return true;
}
int main()
{
	int n;
	cin >> n;
	Card* a = new Card[n];
	Card* b = new Card[n];
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i].suit >> a[i].value;
		b[i] = a[i];
	}
	selectionSort(a, n);
	bubbleSort(b, n);
	printArray(b, n);
	cout << "Stable" << endl;
	printArray(a, n);
	cout << (ifnStable(a, b, n) ? ("Stable") :( "Not stable")) << endl;
	delete[]a;
	delete[]b;
	return 0;
}


Measured memory_bytes: 3128
#include<stdio.h>
int main(void){
    int a,b;
    for(;scanf("%d%d",&a,&b)!=EOF;){
        int wa=a+b;
        int cnt=1;
        while(!(wa<10)){
            wa/=10;
            cnt++;
        }
        printf("%d\n",cnt);
    }
    return 0;
}

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

int main()
{
    int N;
    cin >> N;
    map<string, int> A;
    rep(i, N)
    {
        string s;
        cin >> s;
        A[s]++;
    }
    map<string, int> B;
    int M;
    cin >> M;
    rep(i, M)
    {
        string t;
        cin >> t;
        B[t]++;
    }

    int64_t total = 0;
    for (auto x : A)
    {
        //      cout << x.first << " " << x.second << endl;
        //      cout << B[x.first] << endl;
        int64_t tmp = x.second - B[x.first];
        total = max(total, tmp);
        //      total -= B[x.first];
    }

    cout << total << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define Tp template<typename Ty>
#define Ts template<typename Ty,typename... Ar>
#define Reg register
#define RI Reg int
#define Con const
#define CI Con int&
#define I inline
#define W while
#define N 185
#define Gmax(x,y) (x<(y)&&(x=(y)),x)
using namespace std;
int n,m,s[N+5][N+5],f[2][N+5][N+5][N+5];char st[N+5][N+5];
I int Find(CI p,CI i,CI j,CI k)
{
	RI l=i,r=j-1,mid,t=0;W(l<=r) mid=l+r>>1,t=max(t,min(f[p][i][mid][k],
		f[p][mid+1][j][k])),f[p][i][mid][k]>f[p][mid+1][j][k]?l=mid+1:r=mid-1;return t;
}
int main()
{
	RI i,j,k,p=1,t,w;for(scanf("%d%d",&n,&m),i=1;i<=n;++i)
		for(scanf("%s",st[i]+1),j=1;j<=m;++j) s[i][j]=s[i-1][j]+(st[i][j]=='#');
	for(i=1;i<=n;++i) for(j=i;j<=n;++j) for(k=1;k<=m;++k)
	{
		if(f[0][i][j][k]=k-1,(t=s[j][k]-s[i-1][k])&&t^(j-i+1)) continue;
		W(f[0][i][j][k]^m&&s[j][f[0][i][j][k]+1]-s[i-1][f[0][i][j][k]+1]==t) ++f[0][i][j][k];
		W(k+1<=f[0][i][j][k]) f[0][i][j][k+1]=f[0][i][j][k],++k;
	}
	for(t=0;f[p^1][1][n][1]^m;p^=1,++t) for(i=1;i<=n;++i)
		for(j=i;j<=n;++j) for(k=1;k<=m;++k) (w=f[p^1][i][j][k])^m?
			(f[p][i][j][k]=f[p^1][i][j][w+1])^m&&Gmax(f[p][i][j][k],Find(p^1,i,j,k)):(f[p][i][j][k]=m);
	return printf("%d\n",t),0;
}

Measured memory_bytes: 31016
#include <bits/stdc++.h>
#define len(x) (int) (x.size())
using namespace std;
typedef long long ll;

int main() {
    int a = 0, b = 0;
    string s;
    cin >> s;

    for(char c : s) {
        if (c == 'A') a++;
        if (c == 'B') b++;
    }

    if (a != 0 && b != 0) {
        cout << "Yes" << '\n';
    }
    else {
        cout << "No" << '\n';
    }
    
    return 0;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub fn read_n<T: FromStr>(n: usize) -> Vec<T> {
    read_n_logic::<T>(n, vec![])
}

pub fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
    match n {
        0 => a,
        _ => {
            a.push(read::<T>());
            read_n_logic(n - 1, a)
        }
    }
}
use std::cmp::{max, min};
use std::collections::HashSet;

fn divisors(N: i64) -> HashSet<i64> {
  let mut ds = vec![];
  let mut d = 1;
  while d * d <= N {
    if N % d == 0 {
      ds.push(d);
      ds.push(N / d);
    }
    d += 1;
  }
  let uniq: HashSet<i64> = ds.into_iter().collect();
  uniq
}

fn main() {
    let n: i64 = read();
    let mut cnt: i64 = 0;
    for i in 1..n+1 {
        if i %2 == 1 && divisors(i).len() == 8 {
            cnt += 1;
        }
    }
    println!("{}", cnt);
}


Measured memory_bytes: 4352
import java.util.*;
import java.io.*;
class Main {
    static long ans=0;
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        HashSet<Integer> hs = new HashSet();
        hs.add(Integer.parseInt(st.nextToken()));
        hs.add(Integer.parseInt(st.nextToken()));
        hs.add(Integer.parseInt(st.nextToken()));

        
        System.out.println(hs.size());
    }
}


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

int main() {
    string s,b;
    string tmp;
    vector<string> lst;
    int ind = -1;
    cin>>s>>b;
    if (s.size() >= b.size()) {
        for (int i=0;i<s.size();i++) {
            bool ok = 1;
            for (int j=0;j<b.size();j++) {
                if (s[i+j] != b[j] && s[i+j] != '?') {
                    ok = 0;
                    break;
                }
            }
            if (ok) {
                tmp = s;
                for (int k=0;k<tmp.size();k++) {
                    if (tmp[k] == '?') tmp[k] = 'a';
                    if (k == i) {
                        for (int l=0;l<b.size();l++) {
                            tmp[k] = b[l];
                            k++;
                        }
                        k--;
                    }
                }
                lst.push_back(tmp);
            }
        }
        if ((int) lst.size() == 0) {
            cout<<"UNRESTORABLE"<<endl;
        } else {
            sort(lst.begin(), lst.end());
            cout<<lst[0]<<endl;
        }
    } else {
        cout<<"UNRESTORABLE"<<endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
using namespace std;
typedef long long int ll;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)

int main(){
    int n;
    string s;
    cin >> n >> s;

    for(int i=0; i<s.size(); i++){
        int t = s[i]-'A';
        t += n;
        t%=26;
        cout << char(t+'A');
    }
    return 0;
}


Measured memory_bytes: 256
S = input().replace("><", "> <").split()
ans = 0
for s in S:
    up = s.count("<")
    down = len(s) - up
    if up < down: 
        up -= 1
        ans += up * (up+1) // 2 + down * (down+1) // 2
    else:
        down -= 1
        ans += up * (up+1) // 2 + down * (down+1) // 2
print(ans)

Measured memory_bytes: 12464
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int GCD(int a, int b) {
  if (a == 0) return b;
  return GCD(b % a, a);
}

void Output(bool ok) {
  cout << (ok ? "POSSIBLE" : "IMPOSSIBLE") << endl;
  exit(0);
}

int main()
{
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  if (n == 1) Output(a[0] == k);
  vector<int> l = a;
  vector<int> r = a;
  for (int i = 0; i < n - 1; ++i) l[i + 1] = GCD(l[i], l[i + 1]);
  for (int i = n - 1; i > 0; --i) r[i - 1] = GCD(r[i - 1], r[i]);
  for (int i = 0; i < n; ++i) {
    int L = 0, R = 0;
    if (i > 0) L = l[i - 1];
    if (i < n - 1) R = r[i + 1];
    int g = GCD(L, R);
    if (a[i] < k) continue;
    if ((a[i] - k) % g == 0) Output(true);
  }
  Output(false);
  return 0;
}


Measured memory_bytes: 1408
#include <stdio.h>

int n, a[50];

int solve(int i,int m){
    if (m == 0) {
        return 1;
    }
    if (i >= n) {
        return 0;
    }
    
    int res = solve(i+1, m) || solve(i+1, m - a[i]);
    return res;
}

int main(void){
    int q, M, i;
    
    scanf("%d", &n);
    for (i = 0; i < n; i++)scanf("%d", &a[i]);
    scanf("%d", &q);
    for (i = 0; i < q; i++) {
        scanf("%d", &M);
        if (solve(0, M))printf("yes\n");
        else printf("no\n");
    }
    
    return 0;
}

Measured memory_bytes: 1008
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define MAX_C 1000000001

int main() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n; i+=2) {
    int divs = 0;
    for (int m = 1; m <= i; m++) {
      divs += ((i % m) == 0);
    }
    if (divs == 8) cnt++;
  }

  cout << cnt << endl;
}

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

int sum(int n)
{
    int s = 0;
    while (n != 0)
    {
        s += (n % 10);
        n /= 10;
    }
    return s;
}

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

    if (n % sum(n) == 0)
    {
        cout << "Yes\n";
    }
    else
    {
        cout << "No\n";
    }

    return 0;
}


Measured memory_bytes: 256
#define rep(i, a, b) for(int i = a; i < (int)(b); i++)
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;
template<class T> inline void chmax(T &a, const T &b) {if(a < b) a = b;}
template<class T> inline void chmin(T &a, const T &b) {if(a > b) a = b;}
const long long INF = 1LL<<60;
const long long MOD = (ll)1e9+7;
const long long MAX = (ll)1e5+100;

class Mo{
   public:
   vector<ll> fNum;
   Mo(vector<ll> &num) {fNum = num;};
   bool operator<=(const Mo &tar) const {
      rep(i,0,26) {
         if (fNum[i] != tar.fNum[i]) {
            return (fNum[i] < tar.fNum[i]);
         }
      }
      return true;
   };
   bool operator==(const Mo &tar) const {
      return (*this <=tar && tar<= *this);
   };
   bool operator<(const Mo &tar) const {
      return (*this <= tar && !(tar <= *this));
   };

};

int main(void) {
   ll N;
   cin>>N;
   map<Mo,ll> vMo;
   rep(i,0,N) {
      string s;
      cin>>s;
      vector<ll> Num(26,0);
      rep(i,0,s.size()) Num[(int)s[i]-(int)'a']++;
      Mo this_mo = Mo(Num);
      vMo[this_mo]++;
      // vMo.push_back(new Mo(Num));
   }

   ll ans = 0;
   for (auto el: vMo) {
      // cout<<el.second<<endl;
      ans += el.second * (el.second-1)/2;
   }
   cout<<ans<<endl;




   return 0;
}

Measured memory_bytes: 29952
n=int(input())
s={}
for i in range(n):
  a=input()
  if (a in s):
    s[a]+=1
  else:
    s[a]=1
  
m=int(input())
for i in range(m):
  b=input()
  if (b in s):
    s[b]-=1
  
print (max(max(s.values()),0))

Measured memory_bytes: 3060
// IlyM

#include <bits/stdc++.h>
#define pb push_back
#define sp " "
#define sl "\n"
#define fi first
#define se second
#define mp make_pair
#define sz(a) ((int)a.size())
#define tra(a,b) for (auto a:b) 
#define fo(a,b,c) for (int a=b;a<=c;a++) 
#define ms(a,b) memset(a,b,sizeof(a)) 
#define all(a) a.begin(),a.end()
#define rev(a) reverse(a.begin(),a.end())
#define bit(i,j) (i&(1<<j))

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<int,ii> iii;

const int N=2e5+5,mod=998244353;
int n,r[N],g[N],b[N];
string a;
ll c;
char k;
int s;
int main()
{
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	cin>>n>>a;
	for (int i=n-1;i>=0;i--) {
		if (a[i]=='R') r[i]++;
		if (a[i]=='G') g[i]++;
		if (a[i]=='B') b[i]++;
		r[i]+=r[i+1]; g[i]+=g[i+1]; b[i]+=b[i+1];
	}
	fo(i,0,n-1) {
		fo(j,i+1,n-1) {
			if (a[i]!=a[j]) {
				if ('R'!=a[i] && 'R'!=a[j]) k='R';
				if ('G'!=a[i] && 'G'!=a[j]) k='G';
				if ('B'!=a[i] && 'B'!=a[j]) k='B';
				s=j-i;
	  			if (k=='R') { c+=r[j+1]; if (j+s<n && a[j+s]=='R') c--; }
	  			if (k=='G') { c+=g[j+1]; if (j+s<n && a[j+s]=='G') c--; }
	  			if (k=='B') { c+=b[j+1]; if (j+s<n && a[j+s]=='B') c--; }
			}
		}
	}
	cout<<c;
	return 0;
}


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

void print(int s,int t,char c){
	for(int i=min(s,t);i<max(s,t);++i){
		cout<<c;
	}
}

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int sx,sy,tx,ty; cin>>sx>>sy>>tx>>ty;
	print(sx,tx,'R');
	print(sy,ty,'U');
	print(tx,sx,'L');
	print(ty,sy-1,'D');
	print(sx,tx+1,'R');
	print(sy-1,ty,'U');
	print(0,1,'L');
	print(0,1,'U');
	print(tx,sx-1,'L');
	print(ty+1,sy,'D');
	print(0,1,'R');
	cout<<"\n"s;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(v) (v).begin(),(v).end()
using ll = long long;
using P = pair<int, int>;

int main(){
    int n;
    cin >> n;
    vector<int> x(n);
    rep(i, n) cin >> x[i];
    auto y = x;
    sort(all(y));
    int b1 = y[n / 2 - 1];
    int b2 = y[n / 2];
    rep(i, n) {
        if (x[i] <= b1) cout << b2 << endl;
        else cout << b1 << endl;
    }
    return 0;
}

Measured memory_bytes: 3712
#include<iostream>
#include<complex>
#include<complex>
#include<cmath>
using namespace std;

typedef complex<double> P;

const double eps = 1e-10;

//
//0:a include b
//1:b include a
//2:intersected
//3:same
//4:far away
// r1 >= r2
int is_intersected_circle(P a,P b,double r1,double r2){
  double d = abs(a-b);
  if (d<eps && abs(r1-r2)<eps)return 3;
  if (d+r2 < r1)return 0;
  if (d+r1 < r2)return 1;
  if (d > r1+r2)return 4;
  
  return 2;
}

main(){
  int op[5]={2,-2,1,100,0};
  P a,b;
  double r1,r2;
  int te;
  cin>>te;
  while(te--){
    cin>>a.real()>>a.imag()>>r1>>
      b.real()>>b.imag()>>r2;

      cout << op[is_intersected_circle(a,b,r1,r2)]<<endl;
  }
  
}

Measured memory_bytes: 0
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
using namespace std ;

typedef long long ll ;
#define rep (i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

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

	string s;
	cin >> s;

	int len = s.size();
	int count = 0;
	for (int i = 0; i <len; i++)
	{
		if (s[i] == 'p')
		{
			count++;
		}
	}

	int to = len / 2;

	cout << to - count << endl;

	
	return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<algorithm>

using namespace std;

void Print(int A[], int N)
{
	for (int i = 0; i < N - 1; i++)
	{
		cout << A[i] << " ";
	}
	cout << A[N - 1] << endl;
}

int main()
{
	int A[100];
	int N;
	cin >> N;
	int sum = 0;
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
	}
	for (int i = 0; i < N; i++)
	{
		int tmp = i;
		for (int j = i + 1; j < N; j++)
		{
			if (A[j] < A[tmp])
			{
				tmp = j;

			}
		}
		if (i != tmp)
		{
			swap(A[i], A[tmp]);
			sum++;
		}


	}
	Print(A, N);
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 3080
#include<cstdio>
#include<cstring>
#include<iostream>
#define mod 1000000007
using namespace std;
int n,k,tmp;
long long dp[2005][2005],fact[4000005],inv[4000005];
inline long long quick_pow(long long x,int p){
	long long result=1;
	while(p){
		if(p&1){
			result*=x;
			result%=mod;
		}
		p>>=1;
		x*=x;
		x%=mod;
	}
	return result;
}
inline void init(){
	dp[0][0]=1;
	fact[0]=1;
	for(register int i=1;i<=n*k;i++){
		fact[i]=fact[i-1]*i%mod;
	}
	inv[n*k]=quick_pow(fact[n*k],mod-2);
	for(register int i=n*k-1;i>=0;i--){
		inv[i]=inv[i+1]*(i+1)%mod;
	}
}
inline long long c(int n,int m){
	return (fact[n]*inv[m]%mod)*inv[n-m]%mod;
}
int main(){
	scanf("%d%d",&n,&k);
	if(k==1){
		printf("1\n");
		return 0;
	}
	init();
	for(register int i=1;i<=n;i++){
		for(register int j=0;j<=i;j++){
			if(j==0){
				dp[i][0]=dp[i-1][0];
				continue;
			}
			tmp=n*k-(j-1)*(k-1)-i-1;
			dp[i][j]=(dp[i-1][j]+dp[i][j-1]*(n-j+1)%mod*c(tmp,k-2))%mod;
		}
	}
	printf("%lld\n",dp[n][n]);
	return 0;
}

Measured memory_bytes: 88816
IDENTIFICATION DIVISION.
       PROGRAM-ID. test1.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 INP PIC X(100).
       01 A PIC 999999.
       01 B PIC 999999.
       01 C PIC 999999999.
       01 REN PIC 9999999.
       01 RE PIC Z(7).
       01 temp1 PIC 9999.
       01 temp2 PIC 9999.
       01 N PIC 9999.
       PROCEDURE DIVISION.
       MAIN.
       	ACCEPT INP.
      	PERFORM VARYING temp1 FROM 1 BY 1 UNTIL INP(temp1:1)=SPACE
      	END-PERFORM.
      	SUBTRACT 1 FROM temp1.
      	MOVE INP(1:temp1) TO A.
      	ADD 2 TO temp1.
      	PERFORM VARYING temp2 FROM temp1 BY 1 UNTIL INP(temp2:1)=SPACE
      	END-PERFORM.
      	COMPUTE N=temp2 - temp1.
      	MOVE INP(temp1:N) TO B.
      	ADD 1 TO temp2.
      	PERFORM VARYING temp1 FROM temp2 BY 1 UNTIL INP(temp1:1)=SPACE
      	END-PERFORM.
      	COMPUTE N=temp1 - temp2.
      	MOVE INP(temp2:N) TO C.
      	IF A = B AND B NOT = C THEN
      		DISPLAY 2
      	ELSE IF A NOT = B AND B = C THEN
      		DISPLAY 2
      	ELSE IF A = C AND B NOT = C THEN
      		DISPLAY 2
      	ELSE IF A = C AND B = C THEN
      		DISPLAY 1
      	ELSE 
      		DISPLAY 3
      	END-IF.
        STOP RUN.

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a, b, c, k;
  cin >> a >> b >> c >> k;
  if(a + b >= k) cout << min(a, k) << endl;
  else cout << a - (k - b - a) << endl;
  return 0;
}

Measured memory_bytes: 3652
s = int(input())
if s==1 or s==2 or s==4:
    print(4)
else:
    t = {}
    while True:
        if s not in t:
            t.setdefault(s, 0)
        t[s]+=1
        if (4 in t) and t[4]==2:
            break
        if s%2==0:
            s//=2
        else:
            s = 3*s+1
    print(sum(list(t.values())))

Measured memory_bytes: 3060
import java.util.*;
import java.io.*;

public class Main {

    int[] a;

    void solve() {
	int N = sc.nextInt();
	int ans = 0;
	for (int i = 1; i < N+1; i++) {
	    ans += i;
	}

	System.out.println(ans);

    }

    void print(int[] a) {
	out.print(a[0]);
	for (int i = 1; i < a.length; i++) out.print(" " + a[i]);
	out.println();
    }

    public static void main(String[] args) throws Exception {
	new Main().run();
    }

    MyScanner sc = null;
    PrintWriter out = null;
    public void run() throws Exception {
	sc = new MyScanner(System.in);
	out = new PrintWriter(System.out);
	for (;sc.hasNext();) {
	    solve();
	    out.flush();
	}
	out.close();
    }

    class MyScanner {
	String line;
	BufferedReader reader;
	StringTokenizer tokenizer;

	public MyScanner(InputStream stream) {
	    reader = new BufferedReader(new InputStreamReader(stream));
	    tokenizer = null;
	}
	public void eat() {
	    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
		try {
		    line = reader.readLine();
		    if (line == null) {
			tokenizer = null;
			return;
		    }
		    tokenizer = new StringTokenizer(line);
		} catch (IOException e) {
		    throw new RuntimeException(e);
		}
	    }
	}
	public String next() {
	    eat();
	    return tokenizer.nextToken();
	}
	public String nextLine() {
	    try {
		return reader.readLine();
	    } catch (IOException e) {
		throw new RuntimeException(e);
	    }
	}
	public boolean hasNext() {
	    eat();
	    return (tokenizer != null && tokenizer.hasMoreElements());
	}
	public int nextInt() {
	    return Integer.parseInt(next());
	}
	public long nextLong() {
	    return Long.parseLong(next());
	}
	public double nextDouble() {
	    return Double.parseDouble(next());
	}
	public int[] nextIntArray(int n) {
	    int[] a = new int[n];
	    for (int i = 0; i < n; i++) a[i] = nextInt();
	    return a;
	}
    }
}


Measured memory_bytes: 8020
#include <sys/time.h>

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <utility>
#include <cctype>

using namespace std;

using ll = long long;
using P = pair<double, double>;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)
ll mod = 1000000007LL;



int main() {
	int ac = 0;
	int wa = 0;
	int tle = 0;
	int re = 0;
	int n;

	cin >> n;
	rep(i, n) {
		string s;
		cin >> s;
		if (s == "AC") {
			ac++;
		} else if (s == "WA") {
			wa++;
		} else if (s == "TLE") {
			tle++;
		} else if (s == "RE") {
			re++;
		}
	}
	cout <<"AC x " << ac << endl; 
	cout <<"WA x " << wa << endl; 
	cout <<"TLE x " << tle << endl; 
	cout <<"RE x " << re << endl; 

	return 0;
}


Measured memory_bytes: 3192
//2019.7.27 by ljz
//email 573902690@qq.com
//if you find any bug in my code
//please tell me
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define LL long long
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f
#define eps 1e-10
#define RG register
#define db double
#define lb long db
#define pc(x) __builtin_popcount(x)
typedef pair<int,int> Pair;
#define mp make_pair
#define fi first
#define se second
#define pi acos(-1.0)
#define pb push_back
#define gc getchar
#define Pi 2.0*acos(-1.0)
//inline char gc() {
//    static char buf[100000],*p1,*p2;
//    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
//}
inline int read() {
    res s=0,ch=gc();
    while(ch<'0'||ch>'9')ch=gc();
    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
    return s;
}
//inline int read() {
//    res s=0,ch=gc(),w=1;
//    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=gc();}
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s*w;
//}
//inline LL Read() {
//    RG LL s=0;
//    res ch=gc();
//    while(ch<'0'||ch>'9')ch=gc();
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s;
//}
//inline LL Read() {
//    RG LL s=0;
//    res ch=gc(),w=1;
//    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=gc();}
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s*w;
//}
//inline void write(RG __int128 x){
//    if(x>10)write(x/10);
//    putchar(x%10+'0');
//}
inline void swap(res &x,res &y) {
    x^=y^=x^=y;
}
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
namespace MAIN{
    int A,B;
    inline void MAIN(){
        A=read(),B=read();
        if(A>B)swap(A,B);
        if((A+B)&1)puts("IMPOSSIBLE");
        else printf("%d\n",(A+B)>>1);
    }
}
int main(){
//    freopen("compound1.in","r",stdin);
//    freopen("compound.out","w",stdout);
    MAIN::MAIN();
    return 0;
}

Measured memory_bytes: 256
/** coder Mohammad Al-Hussein *_^ */
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define mp make_pair
#define All(v) v.begin(),v.end()
#define mod  1000000007
#define write freopen("output.txt","w",stdout)
#define read freopen("test (1).txt","r",stdin)
#define FIO std::ios_base::sync_with_stdio(false);
using namespace std;



string s[101];
int r,n,cnt[10];
vector<int> v;
void generate(int x)
{
    v.push_back(x);

    if(x > n) return ;
    for(int i=0; i<=9; i++)
        if(!cnt[i] && ((!i && x) || i))
            generate(x*10+i);

}


int main()
{
    int k;
    cin >> n >> k;

    for(int i=0; i<k; i++)
    {
        int x;
        cin >> x;
        cnt[x] = 1;
    }
    generate(0);

    sort(All(v));

    cout << *lower_bound(All(v),n) <<  endl;





    return 0;
}














Measured memory_bytes: 892
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

int main()
{
  ll R;
  cin >> R;
  if (R < 1200) {
    cout << "ABC" << endl;
  }
  else if (R < 2800) {
    cout << "ARC" << endl;
  }
  else {
    cout << "AGC" << endl;
  }
}


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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)
#define mod 1000000007
typedef long long ll;

int main() {
    int a,b;cin>>a>>b;

    if((0<a&&a<10)&&(0<b&&b<10)){
        cout<<a*b<<endl;
        return 0;

    }
    cout<<-1<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<pii>
#define vll vector<pll>
#define all(v) v.begin(),v.end()
#define mp make_pair

using namespace std;

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
    int x,y,a,b,c;
    cin>>x>>y>>a>>b>>c;
    ll p[a],q[b],r[c];
    for(int i=0;i<a;i++){
        cin>>p[i];
    }
    for(int i=0;i<b;i++){
        cin>>q[i];
    }
    for(int i=0;i<c;i++){
        cin>>r[i];
    }
    sort(p,p+a, greater<int>());
    sort(q,q+b, greater<int>());
    sort(r,r+c, greater<int>());
    ll ans = 0;
    int i=0,j=0,k=0;
    int red=0,green=0,col=0;
    while(x>red && y>green && red+green+col<x+y){
        if(r[k]>p[i] && r[k]>q[j]){
            ans += r[k];
            k++;
            col++;
        }
        else{
            if(p[i]>q[j]){
                ans += p[i];
                i++;
                red++;
            }
            else{
                ans += q[j];
                j++;
                green++;
            }
        }
    }
    while(x>red && red+green+col<x+y){
        if(r[k]<=p[i]){
            ans += p[i];
            i++;
            red++;
        }
        else{
            ans += r[k];
            k++;
            col++;
        }
    }
    while(y>green && red+green+col<x+y){
        if(r[k]<=q[j]){
            ans += q[j];
            j++;
            green++;
        }
        else{
            ans += r[k];
            k++;
            col++;
        }
    }
    cout<<ans;
	return 0;
}


Measured memory_bytes: 2560
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		char[] moji3=new char[3];
		String moto=sc.next();
		for(int i=0; i<3; i++) {
			moji3[i]=moto.charAt(i);
		}
		int[] ookisa=new int[3];
		for(int i=0; i<3; i++) {
			ookisa[i]=moji3[i]*1-96;
		}

		if(ookisa[0]*ookisa[1]*ookisa[2]==6) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 21844
<?php
$x = explode(' ', trim(fgets(STDIN)));
$n = $x[1];
$x = $x[0];
$p = explode(' ', trim(fgets(STDIN)));
if ($p[0] == '') $p = [];
$q = [];

$i = 0;
foreach ($p as $pp) {
	$q[$pp] = true;
}

for ($i = 0; $i < 200; $i++) {
	if (!isset($q[$x - $i])) {
		echo ($x - $i) . "\n";
		exit;
	} elseif (!isset($q[$x + $i])) {
		echo ($x + $i) . "\n";
		exit;	
	}
}

Measured memory_bytes: 16160
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
	int n;
	cin >> n;
	vector<vector<pair<int, int>>> G(n);
	int root = -1;
	for (int i = 0; i < n-1; i++) {
		int u, v;
		long long w;
		cin >> u >> v >> w;
		G[u-1].push_back(make_pair(v-1, w));
		G[v-1].push_back(make_pair(u-1, w));
		if (w%2 == 1)
			root = u-1;
	}
	if (root == -1) {
		for (int i = 0; i < n; i++)
			cout << 0 << endl;
		return 0;
	}
	queue<int> q;
	vector<bool> visited(n, false);
	vector<int> colors(n, -1);
	vector<long long> w(n);
	colors[root] = 0;
	w[root] = 0;
	q.push(root);
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		if (visited[v])
			continue;
		visited[v] = true;
		if (w[v]%2 == 1) {
			colors[v] = 1;
		} else {
			colors[v] = 0;
		}
		for (auto e : G[v]) {
			if (!visited[e.first]) {
				q.push(e.first);
				w[e.first] = w[v] + e.second;
			}
		}
	}
	for (auto e : colors) {
		cout << e << endl;
	}


	return 0;
}

Measured memory_bytes: 10324
#include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);
#define ADD +
#define SUBTRACT -
#define MULTIPLY *
#define DIVIDE /
#define MOD %
#define INCREMENT(x) ++x
#define DECREMENT(x) --x
#define in(a,b) cin>>a>>b;
#define out(a,b) cout<<a<<endl<<b<<endl;
#define scan(a) scanf("%d",&a);
#define print(a) printf("%d\n",a);
#define scanii(a,b) scanf("%d %d",&a,&b);
#define printii(a,b) printf("%d\n%d\n",a,b);
#define scaniii(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define ll long long
#define ull unsigned long long
#define sll signed long long
#define pi acos(-1)
#define mod 1000000007
#define TRUE 1
#define FALSE 0
#define ZERO 0
#define MP make_pair
#define F first
#define S second
#define f1(i,a) for(int i=0;i<a;++i)
#define f2(i,a) for(int i=a-1;i>=0;--i)
#define en puts("");
#define elif else if
typedef ll int lli;
typedef sll int slli;
typedef ull int ulli;
const int sz=10000;
using namespace std;

int clue();
int result();
void show();
bool check();


bool cmp(pair<int,int>p,pair<int,int>q) {
    // return p.first>q.first;//descending by first
    // return p.first<q.first;//ascending by first
    // return p.second>q.second;//descending by second
    return p.second<q.second;//ascending by second
}

// bool cmp(int p,int q) {
    // return p>q;//descending
    // return p<q;//ascending
// }

int main() {

    int t;
    // cin>>t;
    t=1;
    while(t-->0) {
        clue();
    }

    return 0;
}
int clue() {

    int a,b,c;
    cin>>a>>b>>c;
    cout<<c<<" "<<a<<" "<<b<<endl;

    // (det)?cout<<"Yes"<<endl:cout<<"No"<<endl;
    
    return 0;
}

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

const int MOD = 1000000007;

struct Sieve {
  vector<int> table, primes;
  // table[i] := i をふるいにかけた素数 p を記録

  Sieve(int N = 1) {
    table.resize(N+1);
    table.at(0) = table.at(1) = -1;
    for (long long i = 2; i <= N; i++) {
      if (table.at(i) > 0) continue;
      primes.push_back(i);
      table.at(i) = i;
      for (long long j = i*i; j <= N; j += i) {
        if (table.at(j) == 0) table.at(j) = i;
      }
    }
  }

  bool isPrime(int x) { return table.at(x) == x; }

  vector<pair<int, int>> prime_factorize(int x) {
    vector<int> factors;
    while (x != 1) {
      factors.push_back(table.at(x));
      x /= table.at(x);
    }
    if (factors.size() == 0) return {};
    vector<pair<int, int>> res;  // first: 素因数, second: 個数
    res.push_back(make_pair(factors.at(0), 0));
    for (int prime : factors) {
      if (res.back().first == prime) res.back().second++;
      else res.push_back(make_pair(prime, 1));
    }
    return res;
  }
};

long long modpow(long long a, long long b, long long p) {
  if (b == 0) return 1;
  long long res = modpow(a, b / 2, p);
  if (b % 2 == 0) res = (res * res) % p;
  else res = (((res * res) % p) * a) % p;
  return res;
}

// mod p における a の逆元 a^{p-2} mod p を返す
long long inverse(long long a, long long p) {
  return modpow(a, p-2, p);
}

int main() {
  int N; cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  const int MAX_A = 1000000;
  Sieve sieve(MAX_A);
  map<int, int> M;  // 最小公倍数を素因数分解した状態で保持
  for (int i = 0; i < N; i++) {
    auto pf = sieve.prime_factorize(A.at(i));
    for (auto p : pf) {
      if (M.count(p.first)) M[p.first] = max(M[p.first], p.second);
      else M[p.first] = p.second;
    }
  }
  long long L = 1;
  // 最小公倍数 (mod p) を計算
  for (auto p : M) {
    L =  L * modpow(p.first, p.second, MOD) % MOD;
  }
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    long long b = L * inverse(A.at(i), MOD) % MOD;  // B_i = LCM / A_i
    ans = (ans + b) % MOD;
  }
  cout << ans << endl;
}

Measured memory_bytes: 4984
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <queue>
# define MOD 1000000000+7
# define INF 1000000000
#define rep(i,rept)	for(ll i = 0; i<rept;i++)
typedef long long ll;
using namespace std;
unsigned long long int a = 0, b = 0, c = 0, d = 0, e = 0, ans = 0, x = 0, y = 0, z = 0, N = 0, m = 0, maxy = 0, mini = 9999, counter = 0, endp = 0, checker = 0;

std::vector <long long int> vec{}, vecsec{}, vecth{};
long long int iremono[100010], koware[100001];
long long  int iremono2[100001], check[100001], xpo[10000001], ypo[10000001], hei[1000001];
std::vector<std::string>kinds{}, kaku{};
char maze[1000][1000];
int sx, sy;
int gx, gy;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
bool okada = false, okada2 = false;
long long int dp[4][100003] ,ire[4][100003];
std::string input[103],one,two,three;
char re;

int H, W;//はんい
bool qw = false, er = false, ty = false, ui = false;
std::string code;
int main() {
	cin >> a;
	rep(i, a) {
		cin >> ire[1][i+1] >> ire[2][i+1] >> ire[3][i+1];
	}
	dp[1][0] = 0; dp[2][0] = 0; dp[3][0]=0;
	for (int i = 1; i <= a;i++) {
		dp[1][i] = std::max(dp[2][i - 1] + ire[1][i], dp[3][i - 1] + ire[1][i]);
		dp[2][i] = std::max(dp[1][i - 1] + ire[2][i], dp[3][i - 1] + ire[2][i]);
		dp[3][i] = std::max(dp[1][i - 1] + ire[3][i], dp[2][i - 1] + ire[3][i]);
	}
	cout << max(dp[1][a],max(dp[2][a],dp[3][a])) << endl;
}


Measured memory_bytes: 7680