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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
//constexpr long long MOD = (ll)1e9 + 7;
constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

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

struct Edge {
    ll to, rev;
    long double cap;
    Edge(ll _to, long double _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph &G, ll from, ll to, long double cap, bool revFlag,
              long double revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

class UnionFind {
    vector<int> data;
    int num;

  public:
    UnionFind(int size) : data(size, -1), num(size) {}
    bool unionSet(int x, int y) {
        x = root(x);
        y = root(y);
        if(x != y) {
            if(data[y] < data[x])
                swap(x, y);
            data[x] += data[y];
            data[y] = x;
            num--;
        }
        return x != y;
    }
    bool findSet(int x, int y) {
        return root(x) == root(y);
    }
    int root(int x) {
        return data[x] < 0 ? x : data[x] = root(data[x]);
    }
    int size(int x) {
        return -data[root(x)];
    }
    int numSet() {
        return num;
    }
};

void solve() {
    ll n, m;
    cin >> n >> m;
    UnionFind uni(n);
    REP(i, m) {
        ll x, y, z;
        cin >> x >> y >> z;
        uni.unionSet(--x, --y);
    }
    cout << uni.numSet() << en;
}

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

    solve();
    // ll t;cin>>t;REP(i,t) solve();

    return 0;
}


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

typedef long long ll;
typedef int64_t i6;

#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n) for (ll i = 1; i <= n; ++i)
#define Sort(x) sort(x.begin(), x.end())
#define Sort_rev(x) sort(x.begin(), x.end(), greater<int>())
#define ALL(v) (v).begin(), (v).end()

// π M_PI
// deg = rad*180/M_PI

ll nCr(ll n , ll r) {
    if ( n == r || n == 1 || r == 0 ) {
        return 1;
    }

    r = min(r, n-r);
    if ( r == 1 ) {
        return n;
    } else {
        std::vector<std::vector<ll> > v(n + 1,std::vector<ll>(n + 1, 0));
        for (int i = 0; i < v.size(); i++) {
            v[i][0] = 1;
            v[i][i] = 1;
        }
        for (int j = 1; j < v.size(); j++) {
            for (int k = 1; k < j; k++) {
                v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
            }
        }
        return v[n][r];
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    int ans = 0;
    if ( n >= 2 && m >= 2 ) {
        ans = nCr(n, 2)+nCr(m, 2);
    } else {
        if ( m < 2 ) {
            if ( n >= 2 ) {
                ans = nCr(n, 2);
            } else {
                ans = 0;
            }
        } else {
            if ( m >= 2 ) {
                ans = nCr(m, 2);
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int MAX = 100000;

vector<int> G[MAX];
int N;
bool visited[MAX];
int prenum[MAX], parent[MAX], lowest[MAX], timer;

void dfs(int current, int prev){
    prenum[current] = lowest[current] = timer;
    timer++;

    visited[current] = true;
    int next;

    for(int i=0; i<G[current].size(); i++){
        next = G[current][i];
        if(!visited[next]){
            parent[next] = current;

            dfs(next, current);

            lowest[current] = min(lowest[current], lowest[next]);
        }else if(next != prev){
            lowest[current] = min(lowest[current], prenum[next]);
        }
    }
}

void art_points(){
    for(int i=0; i<N; i++) visited[i] = false;
    timer = 1;
    dfs(0, -1);

    set<int> ap;
    int np = 0;
    for(int i=1; i<N; i++){
        int p = parent[i];
        if(p == 0) np++;
        else if(prenum[p] <= lowest[i]) ap.insert(p);
    }
    if(np > 1) ap.insert(0);
    for(auto itr = ap.begin(); itr!=ap.end(); itr++){
        cout << *itr << endl;
    }
}

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

    for(int i=0; i<m; i++){
        int s, t; cin >> s >> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }
    art_points();
}


Measured memory_bytes: 6968
def smaller(a,b):
  if a>b:
    return b
  else:
    return a

N=int(input())
P=list(map(int,input().split()))
res=0

S=[P[0]]
for i in range(1,N):
  S.append(smaller(S[i-1],P[i]))
  

for i in range(N):
  if P[i]==S[i]:
    res+=1
print(res)

Measured memory_bytes: 24744
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <bitset>
#include<vector>
#include<utility>
#include<fstream>
#include<queue>
using namespace std;
typedef long long ll;
#define rep(i,k) for(i=0;i<k;i++)
#define P pair<int,int>
ll n,p, k, b, c, i, j, x, y, z = 1, m = 0;
ll a[100000] = {}, yy[100000] = {};
string s;
P pp[100000];
vector<ll> v;
char cc[100000][10];
int main() {
	
	cin>>b >> s;
	if (b < 3200)	cout << "red";
	else cout << s;

	return 0;
}



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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll = long long;

const double PI = 3.14159265358979;

void solve()
{
  ll n;
  cin >> n;
  n++;
  vector<ll> a(n);
  for(int i = 0; i < n; ++i)
  {
    cin >> a[i];
  }

  vector<ll> b(a);
  reverse(ALL(b));
  for(int i = 1; i < n; ++i)
  {
    b[i] += b[i - 1];
  }
  reverse(ALL(b));

  ll next_branch = 1;  
  ll ans = 0;
  for(int i = 0; i < n; ++i)
  {
    b[i] = min(b[i], next_branch);
    next_branch = min((next_branch - a[i]) * 2, (1LL << 62));
    if (next_branch < 0 || (next_branch == 0 && i < n - 1) )
    {
      cout << -1;
      return;
    }
    ans += b[i];
  }

  cout << ans;
}

int main()
{
  fastio;
  solve();

  return 0;
}

Measured memory_bytes: 4780
#include <bits/stdc++.h>
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

int main() {
	int n, x; scanf("%d%d", &n, &x); int k = 1000 * n;
	std::vector<std::vector<i64>> dp(n + 1, std::vector<i64>(k + 1, 1LL << 60));
	dp[0][0] = 0;
	for(int i = 0; i < n; i++) {
		int a, b; scanf("%d%d", &a, &b);
		for(int j = 0; j <= k; j++) dp[i + 1][j] = dp[i][j];
		for(int j = 0; j < k; j++) {
			if(j + b > k) break;
			dp[i + 1][j + b] = std::min(dp[i + 1][j + b], dp[i][j] + a);
		}
	}
	
	int ans = 0;
	for(int i = 0; i <= k; i++) if(dp[n][i] <= x) ans = std::max(ans, i);
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 80256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip> 
using namespace std;
 
int main() {
	long long a, ans;
	cin>>a;
	double b;
	cin>>b;
	long long c3;
	b*=100;
	b+=0.000001;
	//cout<<b<<endl;
	long long k=(long long)b;
	//cout<<k<<endl;
	c3=k%100;
	k/=100;
	//cout<<c3<<" "<<k<<endl;
	//cout<<a*c3/100<<endl;
	ans=a*k+a*c3/100;
	//double t=2.32;
	//t+=0.000001;
	//t=t*(int)100;
	//cout<<fixed<<setprecision(5)<<t<<endl;
//	cout<<(long long)t<<endl;
	cout<<ans<<endl;
	
  return 0;
}



Measured memory_bytes: 3668
#include <iostream>
using namespace std;
int main(){
	int x,y;
	cin>>x>>y;
	
	for(int i=1;;i++){
	if(x<y){
		cout<<x<<" "<<y<<endl;
	}
	else{
		cout<<y<<" "<<x<<endl;
	}
	cin>>x>>y;
	if(x==0&&y==0) break;
	}

return 0;
}


Measured memory_bytes: 2992
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  string s="ABC";
  string t="ABD";
  string f;
  cin >> f;
  if(f.size()<=3)cout << s << endl;
  else cout << t << endl;
}


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

int main(){
    long long int a, b, c;

    cin >> a;
    scanf("%lld.%lld", &b, &c);

    b = b * 100 + c;

    cout << (b * a) / 100 << "\n";
    return 0;
}

Measured memory_bytes: 3764
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;


signed main() {
  int N, K;
  cin >> N >> K;

  vector<double> p(N);
  REP(i, N){
    cin >> p[i];
    p[i] = (1+p[i])/2;
  }

  double sum = 0;
  int left = 0, right = K;
  REP(i, K) sum += p[i];
  double ans = sum;
  while(right < N){
    sum += p[right]-p[left];
    chmax(ans, sum);

    right++;
    left++;
  }

  printf("%.9lf\n", ans);

  return 0;
}

Measured memory_bytes: 1792
s = input()

ret = True
if s[0] != 'A':
	ret = False
if s[2: len(s) -1].count('C') != 1:
	ret = False
if not s.replace('A', 'a').replace('C', 'c').islower():
    ret = False
if (ret):
	print ("AC")
else:
    print ("WA")

Measured memory_bytes: 3060
#include <algorithm>
#include <deque>
#include <functional>
#include <iostream>

using namespace std;

int main(){
	int hills[10];
    
    for(int i=0;i<10;i++) cin >> hills[i];
    
	partial_sort( hills, hills + 3, hills+10, greater<int>() );
    
    for(int i=0;i<3;i++) cout << hills[i] <<endl;
    
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const long long INF = 1LL << 60;
typedef pair<int, int> PR;

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define fr(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijo(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i <=n;i++){
    num*=yakusu[i];
  }
  return num;
}
 

//cout<<""<<endl;
int main(){
  int N;cin>>N;
  string s;cin>>s;
  vvi a={{1,0},{1,1},{0,1},{0,0}};
  bool okk=false;
 for(int j=0;j<4;j++){
   for(int i=1;i<N-1;i++){
    if(s[i]=='o'&& a[j][i]==0)a[j].pb(a[j][i-1]); 
    else if(s[i]=='x'&& a[j][i]==0)a[j].pb((a[j][i-1]+1)%2);
    else if(s[i]=='x'&& a[j][i]==1)a[j].pb(a[j][i-1]);
    else a[j].pb((a[j][i-1]+1)%2);
   }
 
  
   int x=0;
    if(s[N-1]=='o'&& a[j][N-1]==0)x=a[j][N-2]; 
    else if(s[N-1]=='x'&& a[j][N-1]==0)x=(a[j][N-2]+1)%2;
    else if(s[N-1]=='x'&& a[j][N-1]==1)x=a[j][N-2];
    else if(s[N-1]=='o'&& a[j][N-1]==1)x=(a[j][N-2]+1)%2;
    bool ok=true;
    if(x!=a[j][0])ok=false;
    if(s[0]=='o'&&a[j][0]==0&&a[j][N-1]!=a[j][1])ok=false;
    else if(s[0]=='x'&&a[j][0]==0&&a[j][N-1]==a[j][1] )ok=false; 
    else if(s[0]=='x'&&a[j][0]==1&&a[j][N-1]!=a[j][1] )ok=false;
    else if(s[0]=='o'&&a[j][0]==1&&a[j][N-1]==a[j][1] )ok=false;
    
    if(ok){
      okk=true;
      rep(i,N){
        if(a[j][i]==0)cout<<'S';
        else cout<<'W';
      }
      cout<<endl;
      break;
    }
     
   }
  if(!okk)cout<<-1<<endl;
  
}





Measured memory_bytes: 5236
#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-05-28 23:52:54
 **/

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

#if __cplusplus >= 201703L
template <class Ch, class Tr, class Tuple, std::size_t... Is>
void tuple_out(std::basic_ostream<Ch, Tr>& os, const Tuple& tp, std::index_sequence<Is...>) {
  ((os << (Is ? ", " : "(") << std::get<Is>(tp)), ...) << ")";
}

template <class Ch, class Tr, class... Args>
auto& operator<<(std::basic_ostream<Ch, Tr>& os, const std::tuple<Args...>& tp) {
  tuple_out(os, tp, std::index_sequence_for<Args...>{});
  return os;
}
#endif

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class Compare>
std::ostream& operator<<(std::ostream& os, const std::set<T, Compare>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class U, class Compare>
std::ostream& operator<<(std::ostream& os, const std::map<T, U, Compare>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

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

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

  return 0;
}


Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <cctype>

using namespace std;

typedef string::const_iterator State;

struct Parsing {
	int expression(State& it) {
		int res = term(it);
		while (true) {
			if (*it == '+') res += term(++it);
			else if (*it == '-') res -= term(++it);
			else break;
		}
		return res;
	}

	int factor(State& it) {
		int res = 0;
		if (*it == '(') {
			res = expression(++it);
			++it;
		} else res = number(it);
		return res;
	}

	int term(State& it) {
		int res = factor(it);
		while (true) {
			if (*it == '*') res *= factor(++it);
			else if (*it == '/') res /= factor(++it);
			else break;
		}
		return res;
	}

	int number(State& it) {
		int res = 0;
		while (isdigit(*it)) {
			res *= 10;
			res += *it - '0';
			++it;
		}
		return res;
	}
};

int main() {
	int n; cin >> n;
	Parsing solve;
	while (n--) {
		string s; cin >> s;
		State begin = s.begin();
		cout << solve.expression(begin) << endl;
	}

	return 0;
}


Measured memory_bytes: 3204
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int n;
    cin>>n;
    for(int i=0; i<n; i++){
        int tri[3] = {0};
        cin>>tri[0]>>tri[1]>>tri[2];
        sort(tri, tri+3);
        if(tri[0]*tri[0] + tri[1]*tri[1] == tri[2]*tri[2]){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
    
    return 0;
}

Measured memory_bytes: 1168
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<algorithm>
#include<set>
#include<sstream>
#include<iostream>

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define pb push_back
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
using namespace std;

int main(){
	int n, h, m = 0;
	vector<int> vb;
	cin>>n>>h;
	REP(i,n){
		int a, b;
		cin>>a>>b;
		if(m < a)m = a;
		vb.pb(b);
	}
	sort(RALL(vb));
	vb.pb(-1);
	int ans = 0;
	REP(i,n + 1){
		if(vb[i] < m){
			ans += (h - 1) / m + 1;
			break;
		}
		h -= vb[i];
		ans++;
		if(h <= 0)break;
	}
	cout<<ans<<endl;
	return 0;
}

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a);i>(b);--i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1000000000;
const LL MOD = 1000000007;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

int main() {
  int N;
  bool ans = false;
  cin >> N;
  REP(i,10) {
    REP(j,10) {
      if(i*j == N) {
        ans = true;
        break;
      }
    }
  }
  if(ans) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define INF 1000000007

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

int main()
{
    string s;
    cin >> s;
    string test = "abc";
    bool has_abc[3] = {false, false, false};
    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            if (s[i] == test[j])
            {
                has_abc[j] = true;
            }
        }
    }

    if (has_abc[0] && has_abc[1] && has_abc[2])
    {
        cout << "Yes" << endl;
        return 0;
    }
    else
    {
        cout << "No" << endl;
        return 0;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long gcd(long a, long b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

long lcm(long a, long b)
{
   return a * b / gcd(a, b);
}

int main() {
  long A,B;
  cin >> A >> B;
  
  cout << lcm(A,B) << endl;
  
  
  
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {

	int n, x, i, ii, iii, a;
	int all = 0;

	for (a = 0; a < 1; a--) {
		scanf("%d%d", &n, &x);

		if (n == 0 && x == 0) break;
		
		for (i = 1; i <= n; i++) {
			for (ii = 1; ii <= n; ii++) {
				for (iii = 1; iii <= n; iii++) {
					if (i != ii && i != iii && ii != iii && i < ii && ii < iii && i < iii) {
						if (i + ii + iii == x) {
							all++;
						}
					}
				}
			}
		}
		printf("%d\n", all);
		all = 0;
	}
	return 0;
}

Measured memory_bytes: 600
K = gets.to_i
A = [nil]*((K+1)**2)
K.downto(1){|d|
	(1..K/d).to_a.product([*1..K/d]){|d1,d2|
		A[K*d*d1 + d*d2] ||= d
		A[K*d*d2 + d*d1] ||= d
	}
}
p 1.upto(K).map{|a|
	a +
	(a+1).upto(K).map{|b|
		(ab = A[K*a+b]) +
		(b+1).upto(K).map{|c|
			A[K*ab+c]
		}.sum
	}.sum*6
}.sum


Measured memory_bytes: 17716
N = int(input())
S = input()

if S[0] == "E":
    count = S.count("E") -1
    result = count
    for i in range(1,N):
        if S[i-1] == "W" and S[i] == "W":
            count += 1
        elif S[i-1] == "E" and S[i] == "E":
            count -= 1
            if result > count:
                result = count
else:
    count = S.count("E")
    result = count
    for i in range(1,N):
        if S[i-1] == "W" and S[i] == "W":
            count += 1
        elif S[i-1] == "E" and S[i] == "E":
            count -= 1
            if result > count:
                result = count

print(result)

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

#define For(i, j, k) for (int i = j; i <= k; i++)
#define Forr(i, j, k) for (int i = j; i >= k; i--)

using namespace std;

const int N = 1e6 + 10;
const int Mod = 1e9 + 7;

int Pow(int x, int e) {
	int ret = 1;
	while (e) {
		if (e & 1) ret = 1ll * ret * x % Mod;
		x = 1ll * x * x % Mod;
		e >>= 1;
	}
	return ret;
}

int n;
int fac[N], rfac[N];

int C(int a, int b) {
	return 1ll * fac[a] * rfac[b] % Mod * rfac[a - b] % Mod;
}

int main() {

	scanf("%d", &n);

	fac[0] = 1;
	For(i, 1, n) fac[i] = 1ll * fac[i - 1] * i % Mod;
	rfac[n] = Pow(fac[n], Mod - 2);
	Forr(i, n, 1) rfac[i - 1] = 1ll * rfac[i] * i % Mod;

	int ans = 1ll * fac[n - 1] * (n - 1) % Mod;
	For(i, n / 2 - 1, n - 2) {
		int x = (i - 1) * 2 - (n - 2);
		if (x < 0) continue;
		ans = (ans - 1ll * C(i - 1, x) * fac[i] % Mod * fac[n - 1 - i] % Mod + Mod) % Mod;
	}
	printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 8064
#include <iostream>
#define MAX 100
#define int long long
using namespace std;

static const int INFTY = 1LL<<32;
int n, A[MAX][MAX];

void floyd(){
    for(int k=0;k<n;k++){
        for(int i=0;i<n;i++){
            if(A[i][k]==INFTY) continue;
            for(int j=0;j<n;j++){
                if(A[k][j]==INFTY) continue;
                A[i][j] = min(A[i][j], A[i][k] + A[k][j]);
            }
        }
    }
}

signed main(){
    int e, a, b, d;
    cin >> n >> e;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(i==j) A[i][j] = 0;
            else A[i][j] = INFTY;
        }
    }

    for(int i=0;i<e;i++){
        cin >> a >> b >> d;
        A[a][b] = d;
    }

    floyd();

    bool negative = false;
    for(int i=0;i<n;i++){
        if(A[i][i]<0) negative = true;
    }
    if(negative){
        cout << "NEGATIVE CYCLE" << endl;
    } 
    else{
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                if(j) cout << " ";
                if(A[i][j]==INFTY) cout << "INF";
                else cout << A[i][j];
            }
            cout << endl;
        }
    }

}


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

const int MAXN = 8;

int n;
int x[MAXN], y[MAXN];

double dist(int i, int j) {
	return sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i];
	}
	double sum = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			sum += dist(i, j);
		}
	}
	cout << fixed << setprecision(10) << sum / n << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int sum,A,B,a,b,c,d,e,T;
  sum=0;
  cin >> A >> B;
  for (int i=A;i<=B;i++){
    e=i%10;
    T=i/10;
    d=T%10;
    T=T/10;
    c=T%10;
    T=T/10;
    b=T%10;
    T=T/10;
    a=T%10;
    if ((a==e) && (b==d))
      sum++;
  }
  cout << sum << endl;  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
char c[100005];
char s[100005];
int num[1000005];
long long ans=0;
int main(){
	scanf("%s",c);
	int l=strlen(c);
	int tot=0;
	for(int i=0;i<l;i++){
		if(c[i]!='x'){
			s[++tot]=c[i];
		}
	}
	for(int i=1;i<=tot/2;i++){
		if(s[i]!=s[tot-i+1]){
			printf("-1\n");
			return 0;
		}
	}
	int tot2=0;
	for(int i=0;i<l;i++){
		if(c[i]!='x'){
			int kz=i+1;
			tot2++;
			while(c[kz]=='x'){
				num[tot2]++;
				kz++;
			}
		}
	}
	for(int i=1;i<=(tot2-1)/2;i++){
		ans+=abs(num[i]-num[tot2-i]);
	}
	int xx=0;
	int num1=0,num2=0;
	//for(int i=1;i<=tot2-1;i++)cout<<num[i]<<endl;
	while(c[xx]=='x'){
		num1++;
		xx++;
	}
	xx=l-1;
	while(c[xx]=='x'){
		num2++;
		xx--;
	}
	ans+=abs(num1-num2);
	printf("%lld\n",ans);
	return 0;
}

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

#define ll long long int
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define all(A) A.begin(), A.end()
#define sz(A) (int)A.size()
typedef vector <int> vi;
typedef vector <ll> vl;
typedef pair <int, int> pii;
const ll mod = 1e9 + 7;
//const ll mod = 998244353;
const int inf = 1e9;
//const ll inf = 1e18;
const int N = 2e5;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int x, y, z;
	cin >> x >> y >> z;
	cout << z << " " << x << " " << y << "\n";
 	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define ARRAY_LEN(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int INTINF = 2147483647;
const int MOD = 1000000007;

int main() {
  int N, A; cin >> N >> A;
  int result = pow(N,2) - A;
  cout << result << endl;
  return 0;
}

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

int main(){
  int H,W;
  while(1){
    cin >> H >> W;
    
    if(H==0&&W==0)
      break;
    
    for(int i=1; i<=H; i++){
      for(int j=1; j<=W; j++){
        if(i==1 || i==H){
          cout << "#";
        }
        else if(j==1 || j==W){
            cout << "#";
          }
          else 
            cout << ".";
          
        }
        cout << endl;
      }
    cout << endl;
    }
  }



Measured memory_bytes: 3036
#include <iostream>
#include <cmath>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <list>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)

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

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include <algorithm>
#include<float.h>
#include <limits>
#include <vector> 
#include <numeric>

#define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define ll long long

using namespace::std;

int jo(ll int jxo, ll int jyo){
	ll int jhogeo = 1;
	rep(jinto,0,jyo) jhogeo=jhogeo*jxo;
	return jhogeo;
}
char tobig(char toxbig){
  return (toxbig-0x20);
}
char tolow(char toxlow){
  return (toxlow+0x20);
}
  


int main(){
  int N,A;
  cin>>N>>A;
  cout<<N*N-A;
  
}
// int *p = new int[N];

//  vector<int> 変数名(要素数);
//  sort(変数名.begin(),変数名.end());//昇順ソート

// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));

//


Measured memory_bytes: 256
(let ((a (read-line))
      (str ""))
  (loop for i below (length a)
        if (not (equal (char a i) #\Space)) do (setf str (format nil "~a~a" str (char a i))))
  (setf str (parse-integer str))
  (format t "~A~%" (if (= str (expt (floor (sqrt str)) 2)) "Yes" "No"))
  )


Measured memory_bytes: 7520
#include<bits/stdc++.h>
using namespace std;
 
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MP make_pair
#define pb push_back
#define ff first
#define ss second
#define sz(x) x.size()
#define all(c) c.begin(),c.end()
#define int long long
#define fr(i,j,x) for(int i=j;i<x;i++)
#define rep(i,j,x) for(int i=j;i<=x;i++)
#define mem(x,val) memset(x,val,sizeof(x))
//#define endl '\n'
#define vi vector<int>
#define pii pair<int,int>
#define piii pair<int,pii>
 
const int mod=1e9+7;
const int N=2e5+10;
const int MAXN=2e6+10;
const int INF=1e18;

string to_string(string s) { return '"' + s + '"';}
string to_string(char s) { return string(1, s);}
string to_string(const char* s) { return to_string((string) s);}
string to_string(bool b) { return (b ? "true" : "false");}
template <typename A> string to_string(A);
template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template <typename A> string to_string(A v) {bool f = 1; string r = "{"; for (const auto &x : v) {if (!f)r += ", "; f = 0; r += to_string(x);} return r + "}";}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {cerr << " " << to_string(H); debug_out(T...);}
#define pr(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

vi g[N];
int vis[N],n,m;
int siz=0;
  
void dfs(int u){
    siz++;
    vis[u]=1;
    for(auto v:g[u]){
        if(!vis[v]){
            dfs(v);
        }
    }
}

void solve(){
    cin>>n>>m;
    rep(i,1,m){
        int a,b;
        cin>>a>>b;
        g[a].pb(b);
        g[b].pb(a);
    }
    mem(vis,0);
    int ans=0;
    rep(i,1,n){
        if(!vis[i]){
            siz=0;
            dfs(i);
        }
        ans=max(ans,siz);
    }
    cout<<ans<<endl;
}


int32_t main()
{
    // #ifndef ONLINE_JUDGE
    //     freopen("inputf.in", "r", stdin);
    //     //freopen("outputf.in", "w", stdout);
    // #endif
    SPEED;
    int T=1;
    //cin>>T;
    int t1=1;
    while(true)
    {  
        //cout<<"Case #"<<t1<<": ";
        solve();
        t1++;
        if(t1>T)
            break;
    }
}

Measured memory_bytes: 22388
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <functional>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
#define scanf scanf_s

string s;

int main()
{
	while (getline(cin, s))
	{
		if (s[0] == '.') break;
		vector<char> v;
		REP(i,105)v.push_back('0');
		bool f = true;
		REP(i, s.size())
		{
			if (s[i] == '[') v.push_back('[');
			if (s[i] == '(') v.push_back('(');
			if (s[i] == ']')
			{
				if (v.back() == '[')
				{
					v.pop_back();
				}
				else f = false;
			}
			if (s[i] == ')')
			{
				if (v.back() == '(')
				{
					v.pop_back();
				}
				else f = false;
			}
		}
		if (f&&v.back()=='0') cout << "yes" << endl;
		else cout << "no" << endl;
	}
	return 0;
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pl;
#define all(a) (a).begin(),(a).end()
#define overload4(_1, _2, _3, _4, name, ...) name
#define rep1(n) for(ll i = 0;i < (n);i++)
#define rep2(i,n) for(ll i = 0;i < (n);i++)
#define rep3(i,a,b) for(ll i = (a);i < (b);i++)
#define rep4(i,a,b,c) for(ll i = (a);i < (b);i += (c))
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep1(n) for(ll i = (n)-1;i >= 0;i--)
#define rrep2(i,n) for(ll i = (n)-1;i >= 0;i--)
#define rrep3(i,a,b) for(ll i = (a)-1;i >= (b);i--)
#define rrep4(i,a,b,c) for(ll i = (a)-1;i >= (b);i -= (c))
#define rrep(...) overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define SHOW(x) cout << #x << ": " << x << endl;
template<class T> ll sumArr(const T& a){ return accumulate(all(a), 0LL);}
template<class T> auto minArr(const T& a){ return *min_element(all(a));}
template<class T> auto maxArr(const T& a){ return *max_element(all(a));}
template<class T> void DEBUG_PRINT(T tmp){cout<<tmp<<endl;}
template<class T1,class... T2> void DEBUG_PRINT(T1 tmp,T2... tmp2){cout<<tmp<<" ";DEBUG_PRINT(tmp2...);}
ll gcd(ll a, ll b){ while(b){ ll c = b; b = a % b; a = c; } return a; }
ll lcm(ll a, ll b){ if(!a || !b) return 0; return a / gcd(a, b) * b; }
const ll INF=1e18,MOD = 1e9+7;
const int iINF = 1e9;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    ll N,n,h,w;
    bool flag = false;
    cin>>N;
    rep(b,1,3501){
        if(flag)break;
        rep(c,1,3501){
            if(flag)break;
            ll y = N * b * c,x = (4* b * c - (N * c + N * b));
            if(!x || !y)continue;
            ll a = y/x;
            if(a > 0 && a * x == y){
                h = a;
                n = b;
                w = c;
                flag = true;
            }
        }
    }
    cout<<h<<" "<<n<<" "<<w<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 300010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
int A, B;
int cnt[3];

void solve() {
	cin >> N;
	cin >> A >> B;
	rep(i, 0, N) {
		int p; cin >> p;
		if(p <= A) cnt[0]++;
		else if(A < p && p <= B) cnt[1]++;
		else cnt[2]++;
	}
	cout << min(min(cnt[0], cnt[1]), cnt[2]) << "\n";
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
	srand((unsigned int)time(NULL));
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



Measured memory_bytes: 256
"""
=int(input())
=map(int,input().split())
=list(map(int,input().split()))

# アレイ import numpy as np =np.array(list(map(float,input().split())))

# 文字列 =list(str(input()).split(" " or ","))

# 一文字＆連番(縦横可能) =map(int, open(0).read().split())

# 2-d list
lis=[[] for _ in range(M)]
for i in range(M):
    lis[i] = list(map(int,input().split()[0:]))

# Each list
N = int(input())
a = [0] * N
b = [0] * N
c = [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())
"""
import math
x=int(input())
count=0
k=100
for i in range(100000):
    k=math.floor(k*1.01)
    count+=1
    if k>=x:
        break
print(count)

Measured memory_bytes: 9164
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<time.h>
#include<map>
#include<queue>
#include<set>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
int a,b,c,d;
int main(){
	scanf("%d%d%d%d",&a,&b,&c,&d);
	if (c>a) a=c;
	if (d<b) b=d;
	if (b>=a) printf("%d\n",b-a);else printf("0\n");
	return 0;
}

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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl;
const int MOD = 1e9 + 7;

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

    int res = 1;
    while (n > 1)
    {
        res*=2;
        n /= 2;
    }

    cout << res << endl;
    return (0);
}


Measured memory_bytes: 3560
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String k = sc.next();
        int s = 0;
        for (int i = 0;i < k.length();++i){
            s += Integer.valueOf(k.charAt(i) + "");
        }
        System.out.println(Integer.valueOf(k) % s == 0 ? "Yes" : "No");
    }

}


Measured memory_bytes: 23124
#include <iostream>
    #include <stdio.h>
    #include <string>
    #include <math.h>
    #include<algorithm>
    #include <numeric>
    using namespace std;
     
    int main(){
      int N;
      cin >> N;
      string W[N];
      for(int i=0;i<N;i++){
       cin >> W[i]; 
      }
      bool flag=true;
      for(int i=0;i<N-1;i++){
       if(W[i][W[i].size()-1]!=W[i+1][0]){
        flag=false; 
       }
        if(i!=0){
         for(int j=0;j<=i-1;j++){
           if(W[i]==W[j]){
            flag=false; 
           }
         }
        }
      }
      for(int i=0;i<=N-2;i++){
       if(W[N-1]==W[i]){
        flag=false; 
       }
      }
      if(flag){
      cout << "Yes" << endl;    
      }
      else{
       cout << "No" << endl; 
      }
      return 0;}

Measured memory_bytes: 256
# 解説を参考に作成
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(H, W, Si):
    R = [[0] * W for _ in range(H)]
    L = [[0] * W for _ in range(H)]
    D = [[0] * W for _ in range(H)]
    U = [[0] * W for _ in range(H)]

    # for R
    for h in range(H):
        for w in range(W):
            if Si[h][w] == '#':
                R[h][w] = 0
                continue
            if w == 0:
                R[h][w] = 1
            else:
                R[h][w] = R[h][w - 1] + 1
    # for L
    for h in range(H):
        for w in range(W):
            if Si[h][W - w - 1] == '#':
                L[h][W - w - 1] = 0
                continue
            if w == 0:
                L[h][W - w - 1] = 1
            else:
                L[h][W - w - 1] = L[h][W - w] + 1
    # for D
    for w in range(W):
        for h in range(H):
            if Si[h][w] == '#':
                D[h][w] = 0
                continue
            if h == 0:
                D[h][w] = 1
            else:
                D[h][w] = D[h - 1][w] + 1
    # for U
    for w in range(W):
        for h in range(H):
            if Si[H - h - 1][w] == '#':
                U[H - h - 1][w] = 0
                continue
            if h == 0:
                U[H - h - 1][w] = 1
            else:
                U[H - h - 1][w] = U[H - h][w] + 1

    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans, R[h][w] + L[h][w] + D[h][w] + U[h][w] - 3)
    print(ans)


if __name__ == '__main__':
    H, W = map(int, input().split())
    Si = [input() for _ in range(H)]

    # # test
    # import func
    # H, W = 2000, 2000
    # Si = [''.join([func.random_str(W, '.')]) for _ in range(H)]
    # for s in Si:
    #     print(s)
    solve(H, W, Si)


Measured memory_bytes: 206032
#include <iostream>
#include <cmath>

using namespace std;

int n, d;

int main()
{
    cin >> n >> d;
    int q = n / (2 * d + 1);
    if (n % (2 * d + 1) != 0)
    {
        q++;
    }
    cout << q << endl;
}

Measured memory_bytes: 256
//test
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 100010;
int q,n,len[N],val[N],ans[N],m;
void doit(int x,int v) {
  if (!x) return;
  int t = upper_bound(len+1,len+m+1,x) - len - 1;
  if (t == 0) ans[1] += v, ans[x+1] -= v;
  else {
    val[t] += (x / len[t]) * v;
    doit(x % len[t],v);
  }
}
signed main() {
  int x;
  scanf("%lld%lld",&n,&q);
  len[++m] = n;
  for (int i = 1 ; i <= q ; ++ i) {
    scanf("%lld",&x);
    while (m && len[m] >= x) -- m;
    len[++m] = x;
  }
  val[m] = 1;
  for (int i = m ; i >= 2 ; -- i) {
    val[i-1] += val[i] * (len[i] / len[i-1]);
    doit(len[i] % len[i-1],val[i]);
  }
  ans[1] += val[1];
  ans[len[1]+1] -= val[1];
  for (int i = 2 ; i <= n ; ++ i)
    ans[i] += ans[i-1];
  for (int i = 1 ; i <= n ; ++ i)
    printf("%lld\n",ans[i]);
  return 0;
}

Measured memory_bytes: 4096
#include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <functional>
#include <algorithm>

using namespace std;

typedef pair<int, int> pii;
typedef vector<pii> vp;
typedef vector<int> vi;
typedef priority_queue<int, vi, greater<int> > pqi;

int main() {
    int n, c;
    cin >> n >> c;
    vp b[c];
    for (int i = 0; i < n; i++) {
        int s, t, c;
        cin >> s >> t >> c;
        c--;
        b[c].push_back(pii(s, t));
    }

    vp bn;
    for (int i = 0; i < c; i++) {
        sort(b[i].begin(), b[i].end());
        for (int j = 0; j < b[i].size(); j++) {
            if (j == 0 || b[i][j].first != bn[bn.size()-1].second) {
                bn.push_back(b[i][j]);
            } else {
                bn[bn.size()-1].second = b[i][j].second;
            }
        }
    }
    sort(bn.begin(), bn.end());

    pqi r;
    for (int i = 0; i < bn.size(); i++) {
        if (r.size() > 0 && r.top() < bn[i].first) {
            r.pop();
        }
        r.push(bn[i].second);
    }

    cout << r.size() << endl;

    return 0;
}

Measured memory_bytes: 2552
# inputs = list(map(int, (input().split())))

n = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14,
     1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

a = int(input())

print(n[a-1])


Measured memory_bytes: 2940
#include <cstdio>
#include <iostream>
using namespace std;
long long n,a,b,xh,ans;
int main()
{
	scanf("%lld%lld%lld",&n,&a,&b);
	xh=n/(a+b);
	ans=xh*a+min(a,n%(a+b));
	printf("%lld",ans);
	return 0;
}

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

int main() {
	int n, t;
	cin >> n >> t;
	int ans = 1e9;
	for (int i = 0; i < n; ++i) {
		int x, y;
		cin >> x >> y;
		if (y <= t) {
			ans = min(ans,x);
		}
	}
	if (ans != 1e9) 
		cout << ans;
	else 
		cout << "TLE";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fo(i,a,b)for(int i=a,_e=b;i<=_e;++i)
using namespace std;
const int N=1e5+5;
int n,x,y,ans,s,B,fa[N],su[N],rt;
int f[N][2];
vector<int>e[N];
bool b[N],is[N];
void dfs(int x){
	su[x]=b[x];
	for(int i:e[x])if(i!=fa[x])
		fa[i]=x,dfs(i),su[x]+=su[i];
	is[x]=su[x];
}
void work(int x){
	int mx[2]={0,0},cmx[2]={0,0},ad=b[x]?2:0;
	for(int i:e[x])if(is[i]&&i!=fa[x]){
		work(i);
		fo(o,0,1){
			if(f[i][o]+ad>mx[o])cmx[o]=mx[o],mx[o]=f[i][o]+ad;else
			if(f[i][o]+ad>cmx[o])cmx[o]=f[i][o]+ad;
		}
	}
	B=max(max(B,mx[0]+cmx[1]-ad),mx[1]+cmx[0]-ad);
	f[x][1]=max(mx[1],ad);
	f[x][0]=mx[0];
	B=max(B,f[x][0]);
}
int main(){
	scanf("%d",&n);
	fo(i,2,n)scanf("%d%d",&x,&y),e[x].push_back(y),e[y].push_back(x);
	scanf("\n");
	fo(i,1,n)b[i]=getchar()=='W';
	dfs(1);
	if(!su[1])return printf("0"),0;
	for(rt=1;;){
		int cnt=0;
		for(int i:e[rt])if(i!=fa[rt])cnt+=su[i]>0;
		if(cnt>=2||b[rt])break;
		is[rt]=0;
		for(int i:e[rt])
			if(i!=fa[rt]&&su[i]>0){
				rt=i;
				break;
			}
	}
	fo(i,1,n)if(is[i]){
		++ans;
		for(int j:e[i])if(is[j])b[i]^=1;
		s+=b[i];
	}
	ans=(ans-1)*2+s;
	work(rt);
	cout<<ans-B;
}

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

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

  cin >> N;
  cin >> A;
  int ans = N * N - A;
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef long double ld;

int main(){
ll a,b;
string c;
cin>>c;
if(c=="AAA" || c=="BBB"){
  cout<<"No"<<endl;
}else{
  cout<<"Yes"<<endl;
}
}

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

int main() {
  int H, W;
  cin >> H >> W;
  for (int i=0; i<W+2; i++){
  cout << "#" ;
  }
  cout << endl;
 for(int j=0; j<H; j++){
   cout << "#";
  vector <char> A(W);
  for(int i=0; i<W; i++) {
    cin >> A.at(i);
    cout << A.at(i);
    }
  cout << "#" << endl;
}
  
  for (int i=0; i<W+2; i++){
  cout << "#" ;
  }
  cout  << endl;

  
}


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

using namespace std;

#define endl '\n'

typedef long long ll;

int dx[] = {0, -1, 1, 0, -1, 1, -1, 1, 0};
int dy[] = {-1, 0, 0, 1, -1, -1, 1, 1, 0};

int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}

#define _rep3(i,p,n) for(int i=(p),i##_counter=(n); i<i##_counter;++i)
#define _rep2(i,n,_) _rep3(i,0,n)
#define _rep_call(a, b, c, name, ...) name(a, b, c)
#define rep(...) _rep_call(__VA_ARGS__, _rep3, _rep2)

#define dump(x)  cerr << #x << " = " << (x) << '\n'
#define debug(x) cerr << #x << " = " << (x) << " (at line " << __LINE__ << ")" << " " << __FILE__ << '\n'

void Main() {
    int N; cin >> N;
    cout << (N * (N + 1)) / 2 << endl;
}

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

Measured memory_bytes: 256