akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
int p[100000];
int find(int a){
    while(p[a]!=a){
        a=p[a];
    }
    return a;
}
int main() {
   /* #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif  */
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL); 
    int n,m;
    cin>>n>>m;
    ll a[n];
    for(int i=0;i<n;i++) cin>>a[i];
    int h[n]={0};
    pair<ll,ll> cc[n];
    for(int i=0;i<n;i++){
        p[i]=i;
        cc[i].first=a[i];
        cc[i].second=0;
    }
    int ans=0;
    pair<ll,pair<int,int>> edges[m];
    for(int i=0;i<m;i++){
        int a,b; ll w; 
        cin>>a>>b>>w;
        a--; b--;
        edges[i]={w,{a,b}};
    }
    sort(edges,edges+m);
    for(int i=0;i<m;i++){
        int x=edges[i].second.first; int y=edges[i].second.second;
        ll w=edges[i].first;
        int X=find(x);
        int Y=find(y);
        if(X==Y){
            if(cc[X].first < w){ cc[X].second++; ans++;}
        }
        else{
            int z=-1;
            if(h[X]>=h[Y]){
                p[y]=X; p[Y]=X;
                z=X;
                if(h[X]==h[Y]) h[X]++;
            }
            else{
                p[x]=Y; p[X]=Y;
                z=Y;
            }
            cc[z].first=cc[X].first+cc[Y].first;
            cc[z].second=cc[X].second+cc[Y].second;
            if(cc[z].first  < w){
                ans++;
                cc[z].second++;
            }
            else{
                ans-=cc[z].second;
                cc[z].second=0;
            }
        }
    }
    cout<<ans;
}

Measured memory_bytes: 4992
#include <stdio.h>

int main( void ) {
	int i, a, b, first = 1, exist;

	while ( scanf( "%d %d", &a, &b ), a ) {
		if ( !first )
			putchar( '\n' );

		exist = 0;
		for ( i = ( a - 1 ) / 4 * 4 + 4; i <= b; i += 4 )
			if ( !( i % 16 ) || i % 25 ) {
				printf( "%d\n", i );

				exist = 1;
			}
		if ( !exist )
			puts( "NA" );

		first = 0;
	}

	return 0;
}

Measured memory_bytes: 616
def main():
    n = int(input())
    s = input()
    w = [0]
    e = [sum([i=="E" for i in list(s)[1:]])]
    for i in range(1,n):
        appear = s[i-1]
        delete = s[i]
        ne = e[-1]
        nw = w[-1]
        if delete == "E":
            ne -= 1
        if appear == "W":
            nw += 1
        w.append(nw)
        e.append(ne)
    ans = [i+j for i,j in zip(w,e)]
    print(min(ans))  
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 103084
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define INF 100000000
using namespace std;

int main() {
    string a,b,c;
    int N,M;
    cin>>a>>b>>N>>M>>c;
    // vector<int> A(N);
    // for(int i=0; i<N; i++){cin>>A[i];}
    // vector<vector<int>> A(N,vector<int>(M));
    // for(int i=0; i<N; i++){for(int j=0; j<M; j++){cin>>A[i][j];}}
    //sort(A.begin(),A.end());
    //for (int i = 0; i < N; i++) { maximum = max(maximum , A[i])}
    //for (int i = 0; i < N; i++) { minimum = min(minimum , A[i])}
  if(c==a)cout<<N-1<<" "<<M<<endl;
  else cout<<N<<" "<<M-1<<endl;
    //cout <<  << endl;
}


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

int main(){
    int N,C,p[200];
    cin>>N>>C;
    int sum=0;
    for(int i=0;i<C;i++){
        cin>>p[i];
        sum+=p[i];
    }

    cout<<sum/(N+1)+(sum%(N+1)!=0)<<endl;

    return 0;
}


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

const int inf = 1000*1000*1000;

struct Edge {
	int from, to, w;
};

vector<int> g[2505];

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n, m, p;
	cin >> n >> m >> p;
	vector<Edge> edges;
	for(int i = 0; i < m; i++) {
		int u, v, w;
		cin >> u >> v >> w;
		u--, v--;
		g[u].push_back(v);
		edges.push_back({u, v, -(w-p)});
	}
	
	vector<int> dist(n, inf);
	dist[0] = 0;
	for(int i = 0; i < n-1; i++) {
		for(Edge e : edges) {
			int u = e.from, v = e.to, w = e.w;
			if(dist[u] == inf) continue;
			if(dist[u] + w < dist[v]) {
				dist[v] = dist[u] + w;
			}
		}
	}
	
	auto can = [&](int u) {
		vector<int> q = {u}, inq(n);
		inq[u] = 1;
		for(int i = 0; i < (int) q.size(); i++) {
			u = q[i];
			if(u == n-1) {
				return true;
			}
			for(int v : g[u]) {
				if(!inq[v]) {
					inq[v] = true;
					q.push_back(v);
				}
			}
		}
		return false;
	};
	
	bool ok = true;
	for(Edge e : edges) {
		int u = e.from, v = e.to, w = e.w;
		if(dist[u] == inf) continue;
		if(dist[u] + w < dist[v] && can(v)) {
			//$ cerr << v << endl;
			ok = false;
		}
	}
	
	if(ok) {
		cout << max(0, -dist[n-1]) << endl;
	} else {
		cout << -1 << endl;
	}
			
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n) ;i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b){ a = b; return 1; } return 0; }



int main(int argc, char const *argv[]) {
  int n,m;
  cin >>  n  >> m;
  if(n==m) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <climits>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main() {
    int N, X;
    cin >> N >> X;
    priority_queue<int, vector<int>, greater<int> > q;
    int total = 0;
    for (int i = 0; i < N; i++) {
        int m;
        cin >> m;
        total += m;
        q.push(m);
    }
    int r = X - total;
    cout << N + (r / q.top()) << endl;
    return 0;
}


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

using namespace std;

using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int cnt = 0;
  while (n > 0) {
    n /= k;
    cnt++;
  }
  cout << cnt << '\n';
  return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<int, int> pi;
const int MAXN = 3005;
const int mod = 1e9 + 7;
#define sz(v) ((int)v.size())

lint ipow(int x, int p){
	lint ret = 1, piv = x;
	while(p){
		if(p & 1) ret = ret * piv % mod;
		piv = piv * piv % mod;
		p >>= 1;
	}
	return ret;
}

int n, q, a[MAXN];
int l[MAXN], r[MAXN];

struct ds{
	int val[MAXN];
	int lazy = 1;
	int lzinv = 1;
	void mul(int x){
		lazy *= 2;
		lzinv = (1ll * lzinv * ((mod + 1) / 2)) % mod;
		lazy %= mod;
	}
	void set(int x, int v){
		val[x] = 1ll * v * lzinv % mod;
	}
	int get(int x){
		return 1ll * val[x] * lazy % mod;
	}
}dp[MAXN];

struct rew{
	int x, y, z;
};

int main(){
	cin >> n >> q;
	for(int i=1; i<=n; i++) cin >> a[i];
	for(int i=1; i<=n; i++){
		for(int j=1; j<i; j++) dp[i].set(j, 1);
	}
	for(int i=0; i<q; i++){
		cin >> l[i] >> r[i];
		if(l[i] > r[i]) swap(l[i], r[i]);
	}
	for(int i=q-1; i>=0; i--){
		vector<rew> rewr;
		for(int j=1; j<=n; j++){
			if(l[i] == j){
				for(int k=1; k<=n; k++){
					if(r[i] == k){
						rewr.push_back({j, k, dp[j].get(k) + dp[k].get(j)});
					}
					else if(j != k){
						rewr.push_back({j, k, dp[j].get(k) + dp[r[i]].get(k)});
					}
				}
			}
			else if(r[i] == j){
				for(int k=1; k<=n; k++){
					if(l[i] == k){
						rewr.push_back({j, k, dp[j].get(k) + dp[k].get(j)});
					}
					else if(j != k){
						rewr.push_back({j, k, dp[j].get(k) + dp[l[i]].get(k)});
					}
				}
			}
			else{
				rewr.push_back({j, l[i], dp[j].get(l[i]) + dp[j].get(r[i])});
				rewr.push_back({j, r[i], dp[j].get(l[i]) + dp[j].get(r[i])});
			}
		}
		for(int j=1; j<=n; j++) dp[j].mul(2);
		for(auto &j : rewr) dp[j.x].set(j.y, j.z);
	}
	lint ret = 0;
	for(int i=1; i<=n; i++){
		for(int j=1; j<=n; j++){
			if(a[i] < a[j]) ret += dp[i].get(j);
		}
	}
	cout << ret % mod << endl;
}


Measured memory_bytes: 35920
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define int long long
using namespace std;


signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);  
//#ifndef ONLINE_JUDGE
  // freopen ("INPUT.txt" , "r" , stdin);
 //  freopen ("OUTPUT.txt" , "w" , stdout);
//#endif

    clock_t clk;
	clk = clock();

// --------------Code s0tarts here---------------------------------------------------------------------

    int a,b;
    cin>>a>>b;
    if(a<10 && b<10)
    {
        cout<<a*b;
    }
    else
    {
        cout<<-1;
    }
    

// -------------------------------------Code ends here------------------------------------------------------

    clk = clock() - clk;
	cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << "\n";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main () {
  
  int a,b,c;
  std::cin >> a >> b >> c;
  
  if(a == b && a != c) {
    std::cout << "Yes\n";
    return 0;
  }
 	
 	if(b == c && c != a) {
      std::cout << "Yes\n";
      return 0;
    }
 
  	if(c == a && a != b) {
      std::cout << "Yes\n";
      return 0;
    }
  
  std::cout << "No\n";
}

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

int main(){
  string s;
  cin >> s;
  int a = s[0]-48,b = s[1]-48,c = s[2]-48,d = s[3]-48;
  if(a+b+c+d == 7){
    cout <<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7"<<endl;
    return 0;
  }
  if(a+b+c-d == 7){
    cout <<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7"<<endl;
    return 0;
  }if(a+b-c+d == 7){
    cout <<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7"<<endl;
    return 0;
  }if(a+b-c-d == 7){
    cout <<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7"<<endl;
    return 0;
  }if(a-b+c+d == 7){
    cout <<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7"<<endl;
    return 0;
  }if(a-b+c-d == 7){
    cout <<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7"<<endl;
    return 0;
  }if(a-b-c+d == 7){
    cout <<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7"<<endl;
    return 0;
  }if(a-b-c-d == 7){
    cout <<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7"<<endl;
    return 0;
  }
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	char x[1000];
	int i,a,sum=0;

	for(;;)
	{
	i=0; a=0; sum=0;
	scanf("%s",x);
	if(x[0]=='0') break;
//	printf("%s",x);	

	for(i=0; x[i]!='\0'; i++)
	{
			a = x[i]-'0';
			sum+=a;
	}

	printf("%d\n",sum);

	}
	

return 0;
}



Measured memory_bytes: 2052
#include <algorithm>
#include <iostream>
#include <climits>
#include <cstdio>
#include <cctype>

using namespace std;

typedef long long LL;
typedef long double db;

inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while (!isdigit(ch)) f=ch=='-'?-1:f,ch=getchar();
	while (isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	return x*f;
}

int buf[30];

inline void write(LL x)
{
	if (x<0) putchar('-'),x=-x;
	for (;x;x/=10) buf[++buf[0]]=x%10;
	if (!buf[0]) buf[++buf[0]]=0;
	for (;buf[0];putchar('0'+buf[buf[0]--]));
}

const int N=300005;
const int Q=300005;

LL f[N],g[N],F[N],G[N],s[N],h[N],t[N];
int a[N];
int n,n_,q,top;

inline LL max(LL x,LL y){return x>y?x:y;}
inline void update(LL &x,LL y){x=x>y?x:y;}

struct L
{
	LL k,b;

	inline L (LL k_=0,LL b_=0){k=k_,b=b_;}
}stack[N];

db ict(L l1,L l2){return ((db)(l2.b-l1.b))/((db)(l1.k-l2.k));}

LL query(int x)
{
	for (;top>1&&ict(stack[top],stack[top-1])<x;--top);
	return top?stack[top].k*x+stack[top].b:LLONG_MIN>>1;
}

void dp(LL *f)
{
	s[0]=0;
	for (int i=1;i<=n;++i) s[i]=s[i-1]+a[i];
	stack[top=1]=L(0,f[0]=0);
	for (int i=1;i<=n;++i)
	{
		f[i]=max(query(i)+(1ll*i*(i+1)>>1)-s[i],f[i-1]);
		L cur=L(-i,f[i]+(1ll*i*(i-1)>>1)+s[i]);
		for (;top>1&&ict(stack[top],stack[top-1])<ict(stack[top],cur);--top);
		stack[++top]=cur;
	}
}

void cdq(int l,int r,bool sig)
{
	if (l==r) return;
	int mid=l+r>>1;
	//if (!((l+r)&1)&&sig) --mid;
	top=0;
	for (int i=r;i>mid;--i)
	{
		for (;top&&stack[top].b<=G[i];--top);
		stack[++top]=L(-i,G[i]);
	}
	reverse(stack+1,stack+1+top);
	for (int i=l;i<=mid;++i) t[i]=query(i+1)+F[i];
	for (int i=l+1;i<=mid;++i) update(t[i],t[i-1]),update(h[i],t[i-1]);
	cdq(l,mid,sig),cdq(mid+1,r,sig);
}

int main()
{
	//freopen("genocide.in","r",stdin),freopen("genocide.out","w",stdout);
	n=read();
	for (int i=1;i<=n;++i) a[i]=read();
	dp(f),reverse(a+1,a+1+n),dp(g),reverse(g+1,g+1+n),reverse(a+1,a+1+n);
	for (int i=0;i<=n+1;++i) h[i]=LLONG_MIN>>1;
	s[0]=0;
	for (int i=1;i<=n;++i) s[i]=s[i-1]+a[i];
	for (int i=0;i<=n+1;++i) F[i]=f[i]+(1ll*(i+1)*i>>1)+s[i],G[i]=g[i]+(1ll*(i+1)*i>>1)-(i?s[i-1]:0);
	cdq(0,n+1,0),reverse(h+0,h+1+n+1),reverse(a+1,a+1+n),reverse(f+0,f+1+n+1),reverse(g+0,g+1+n+1);
	for (int i=0;i<=n+1;++i) swap(f[i],g[i]);
	s[0]=0;
	for (int i=1;i<=n;++i) s[i]=s[i-1]+a[i];
	for (int i=0;i<=n+1;++i) F[i]=f[i]+(1ll*(i+1)*i>>1)+s[i],G[i]=g[i]+(1ll*(i+1)*i>>1)-(i?s[i-1]:0);
	cdq(0,n+1,1),reverse(h+0,h+1+n+1),reverse(a+1,a+1+n),reverse(f+0,f+1+n+1),reverse(g+0,g+1+n+1);
	for (int i=0;i<=n+1;++i) swap(f[i],g[i]);
	q=read();
	for (int i=1,x,y;i<=q;++i) x=read(),y=read(),write(max(f[x-1]+g[x+1],h[x]+a[x]-y)),putchar('\n');
	//fclose(stdin),fclose(stdout);
	return 0;
}

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

typedef unsigned long long int ulint;
typedef long long int lint;

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

  string S;
  cin >> S;

  ulint c = 0;
  for (int i = 0; i < N - 2; ++i) {
    if ((S[i] == 'A') && S[i+1] == 'B' && S[i+2] == 'C') {
      ++c;
    }
  }
  cout << c << endl;

}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (long long i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (long long i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define fi first
#define se second
using ii = pair<int, int>;
vector<ii> dirs = {
  {1, 0}, {0, 1}, {-1, 0}, {0, -1},  // 4方向
  {1, 1}, {-1, 1}, {-1, -1}, {1, -1},  // 斜め
  {0, 0},  // 自身
};
template <class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template <class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <class T, class S> vector<T> make_vec(size_t n, S x) { return vector<T>(n, x); }
template <class T, class... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(n, make_vec<T>(ts...)); }

// debug
template <class T> ostream& operator<<(ostream& s, vector<T>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : " "); return s; }
template <class T> ostream& operator<<(ostream& s, vector<vector<T>>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : "\n"); return s; }
template <class T, class S> ostream& operator<<(ostream& s, pair<T, S>& p) { s << "{" << p.first << ", " << p.second << "}"; return s; }
template <class T, class S> ostream& operator<<(ostream& s, map<T, S> m) { for (auto it = m.begin(); it != m.end(); it++) { s << *it << (next(it) == m.end() ? "" : "\n"); } return s; }
#ifdef _MY_DEBUG
  #define dump(...) cerr << "/* " << #__VA_ARGS__ << " :[" << __LINE__ << ":" << __FUNCTION__ << "]" << endl, dump_func(__VA_ARGS__), cerr << "*/\n\n";
#else
  #define dump(...)
  #define endl "\n"
#endif
void dump_func() { cerr << endl; }
template <class Head, class... Tail> void dump_func(Head&& h, Tail&&... t) { cerr << h << (sizeof...(Tail) == 0 ? "" : ", "), dump_func(forward<Tail>(t)...); }

struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); } } fast;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
constexpr int MOD = 1000000007;
// *************** TEMPLATE END *************** 

signed main() {
  string s; cin >> s;
  vector<string> ts;
  string tmp;
  REP (i, s.size() - 1) {
    if (s[i] == 'A') {
      tmp.push_back('A');
    } else if (s[i] == 'B' && s[i + 1] == 'C') {
      tmp.push_back('X');
      i++;
    } else {
      ts.push_back(tmp);
      tmp = "";
    }
  }
  if (s.back() == 'A') tmp.push_back('A');
  ts.push_back(tmp);
  dump(ts);

  int ans = 0;
  for (string& t : ts) {
    int k = t.size();
    int a = 0;
    REP (i, k) {
      if (t[i] == 'A') a++;
      else ans += a;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 5388
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

int main(){
  int h,w,k;
  cin>>h>>w>>k;
  
  int A[10][10];
  char x;
  rep(i,h){
    rep(j,w){
      cin>>x;
      if(x=='.') A[i][j]=0;
      else A[i][j]=1;
    }
  }
  
  int ans=0;
  int B[10][10];
  rep(i,h){
    rep(j,w) B[i][j]=0;
  }
  
  
  for(int hb=0;hb<(1<<h);hb++){
    for(int wb=0;wb<(1<<w);wb++){
      int cnt=0;
      for(int i=0;i<h;i++){
        if(hb&(1<<i)){
          for(int j=0;j<w;j++) B[i][j]=2;
        }
      }
      for(int i=0;i<w;i++){
        if(wb&(1<<i)){
          for(int j=0;j<h;j++) B[j][i]=2;
        }
      }
      for(int m=0;m<h;m++){
        for(int l=0;l<w;l++){
          if(B[m][l]!=2 && A[m][l]==1) cnt++;
        }
      }
      rep(m,h){
        rep(l,w) B[m][l]=0;
      }
      if(cnt==k) ans++;
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, ans;
	cin>>n;
	ans = 0;
	for(int i = 1; i <= n; i+=2){
		int res = 0;
		for(int j = 1; j <= i; j++){
			if(i % j == 0)res++;
		}
		if(res == 8)ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i <= (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define REP(a,b) for (int i = a; i <= (b); ++i) 
#define mREP(a,b) for (int i = a; i == (b); --i) 
typedef long long ll;
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
/*
　　　　　 　 _... ..._
　　　　　 , ´⌒ ⌒ヽ
　　　 　 ﾉｨ（ノﾉ）ﾉ）ﾉ）
　　　 　 （（q|.ﾟ ヮﾟﾉ|ﾊ
　　　　　　△ﾑ,8ﾑﾌつ
　　　　　/(ﾝ_/＿ヽ＼
　　　　 ～～i_ﾌ_ﾌ～´
*/
	string s;
	cin >> s;
	int ans = 0;
	int size = 0;
	rep0(i, s.length() - 1) {
		if (s[i] == 'A' or s[i] == 'G' or s[i] == 'C' or s[i] == 'T') {
			++size;
		}
		else {
			size = 0;
		}
		ans = max(size, ans);
	}
	cout << ans << endl;
	return 0;
} 

Measured memory_bytes: 888
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

m1,d1=map(int,input().split())
m2,d2=map(int,input().split())
if m1!=m2:
    print(1)
else:
    print(0)

Measured memory_bytes: 38256
def gcd(a, b)
    r = a % b
    while r != 0 do
        a = b
        b = r
        r = a % b
    end
    return b
end

a, b, c, d = gets.chomp.split(" ").map(&:to_i)
e = c * d / gcd(c, d)

can_c = b/c - (a-1)/c
can_d = b/d - (a-1)/d
can_e = b/e - (a-1)/e

cannot = (b - a + 1) - (can_c + can_d - can_e)
puts cannot

Measured memory_bytes: 1788
#include<bits/stdc++.h>
#define ll long long
#define N 100005
#define M 1000000007
#define pii pair<ll,ll>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
main()
{
    int n;
    cin>>n;
    int a[3*n];
    for(int i=0;i<3*n;i++)
        cin>>a[i];
    sort(a,a+3*n);
    ll sum=0;
    int p=0;
    for(int i=3*n-2;;i-=2)
    {
        sum+=a[i];
        p++;
        if(p==n)
            break;
    }
    cout<<sum;

}


Measured memory_bytes: 1408
/*  ex3_4
    pptenshi  */

#include<stdio.h>

int main(void) {
    int n;

    //input
    scanf("%d", &n);

    //output
    for (int i = 1; i < 10; i++) {

        // nがiの段かどうかを判定
        if (n % i == 0 && n / i < 10) {
            printf("Yes\n");
            return 0;
        }
    }
    // 条件を満たさない場合
    printf("No\n");
    
    return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <string>
#include <iostream>
#include <stack>
#include <bitset>
using namespace std;
typedef long long ll;
typedef pair<ll,int> pii;
const ll mod = 1e9+7;
const int inf  = 0x3f3f3f3f;

struct cmp
{
	bool operator()(const pii & a, const pii & b)
	{
		return a.second > b.second;
	}
};

const int maxn = 8005;

std::vector<int> vv[maxn];
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	for(int  i= 1; i <= m; i ++ )
	{
		int t;
		scanf("%d",&t);
		for(int  i= 1; i <= t; i ++ )
		{
			int x;
			scanf("%d",&x);
			vv[x].push_back(i);
		}
	}
	int ans =0 ;
	for (int  i= 1; i <= n; i ++ )
	{
		if(vv[i].size() == 0)
			ans ++ ;
	}
	printf("%d\n",ans);
}

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

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

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            int[] b = new int[n];
            int[] c = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
                b[i] = in.nextInt();
                c[i] = in.nextInt();
            }
            int[] dpA = new int[n];
            int[] dpB = new int[n];
            int[] dpC = new int[n];
            dpA[0] = a[0];
            dpB[0] = b[0];
            dpC[0] = c[0];
            for (int i = 1; i < n; i++) {
                dpA[i] = a[i] + Math.max(dpB[i - 1], dpC[i - 1]);
                dpB[i] = b[i] + Math.max(dpA[i - 1], dpC[i - 1]);
                dpC[i] = c[i] + Math.max(dpA[i - 1], dpB[i - 1]);
            }
            int ans = Math.max(Math.max(dpA[n - 1], dpB[n - 1]), dpC[n - 1]);
            out.println(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

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

    }
}

Measured memory_bytes: 46716
fun main(args: Array<String>) {
  val c = (1..3).map{readLine()!!.split(" ").map{it.toInt()}}
  val rows = c.map{row ->
    (0..1).map{index ->
      row[index + 1] - row[index]
    }
  }

  val colums = (0..2).map{i ->
    (0..1).map{j ->
      c[i][j + 1] - c[i][j]
    }
  }
  if(judge(rows)&&judge(colums)) {
    println("Yes")
    return
  }
    println("No")
}

fun judge(list:List<List<Int>>): Boolean{
  return (0 until 2).all{index ->
    list[index] == list[index + 1]
  }
}

Measured memory_bytes: 38032
#include<stdio.h>
int main()
{
    int i,j;
    char s[100],p[100];
    scanf("%s %s",s,p);
    for(i=0; i<strlen(s); i++)
    {
        if(s[i]==p[0])
        {
            for(j=1; j<strlen(p); j++)
            {
                if(i+j<strlen(s))
                {
                    if(s[i+j]!=p[j])
                        break;
                }
                else
                {
                    if(s[i+j-strlen(s)]!=p[j])
                        break;
                }
            }
            if(j==strlen(p))
            {
                printf("Yes\n");
                break;
            }
        }
    }
    if(i==strlen(s))
    {
        printf("No\n");
    }
    return 0;
}



Measured memory_bytes: 2112
#include<iostream>
#include<string>
using namespace std;
# define maxn 100000 

int main(){
  int S;
  cin>>S;
  int y1=S/100;
  int y2=S%100;
  if (y1!=0 && y1<=12){
    if (y2!=0 && y2<=12){
      cout << "AMBIGUOUS";
    }else{
      cout<<"MMYY";
    }
  }else{
    if (y2!=0 && y2<=12){
      cout << "YYMM";
    }else{
      cout<<"NA";
    }
  }
  return 0;
}


Measured memory_bytes: 256
def inpl(): return [int(i) for i in input().split()]
def hmd(a, b):
    ctr = -1
    while H[ctr+1][a] < b:
        ctr += 1
    vn = H[ctr][a]
    if (vn == b and ctr == 0) or ctr == -1:
        return 1
    return 2**ctr + hmd(vn,b)
N = int(input())
x = inpl() + [10**10]
L = int(input())
H = []
G = [N-1]*N
b = 0
for a in range(N):
    while x[b+1] - x[a] <= L:
        if b == N-1:
            break
        b += 1
    G[a] = b
H.append(G)
while G[0] != N-1:
    G = [G[i] for i in G]
    H.append(G)
H.append([10**10]*N)
Q = int(input())
for _ in range(Q):
    a, b = sorted(inpl())
    print(hmd(a-1,b-1))

Measured memory_bytes: 27776
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(long long i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
long long gcd(long long a,long long b){
    if(b > a){
        swap(a,b);
    }
    bool flag = true;
    long long gcdl;
    while(flag){
        if(a%b == 0){
            flag = false;
            gcdl = b;
        }
        else{
            swap(a,b);
            b = b % a;
        }
    }
    return gcdl;
}
int main(){
    long long n,m;
    cin >> n >> m;
    string sn,sm;
    cin >> sn >> sm;
    long long gcdnm = gcd(n,m);
    long long a = n/gcdnm;
    long long b = m/gcdnm;
    bool fl = true;
    rep(i,gcdnm){
        if(sn[i*a] != sm[i*b]){
            cout << -1 << endl;
            fl = false;
            break;
        }
    }
    if(fl){
        cout << a*b*gcdnm << endl;
    }
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;

int main(){
    int N;
    cin >> N;
    vector<int> H(N+1);
    int sum=0;
    int ma=0;
    for(int i=0;i<N;i++) cin >> H[i];
    H[N]=INF;
    for(int i=0;i<N-1;i++){
        if(H[i]>=H[i+1]){
            sum++;
        }else{
            ma = max(ma,sum);
            sum = 0;
        }
    }
    cout << max(ma,sum) << endl;
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
string side[4],Longitudinal[5];
void righ(int x,int y);
void lef(int x,int y);
void up(int x,int y);
void down(int x,int y);
void serch(int x,int y,int then);
int main()
{
    for(int i=0;i<4;i++)cin>>Longitudinal[i]>>side[i];
    cin>>Longitudinal[4];
    cout<<"R";
    serch(1,0,0);
}
void righ(int x,int y)
{
    if(x+1<5&&Longitudinal[y][x]=='1'){
        cout<<"R";
        serch(x+1,y,0);
    }
}
void lef(int x,int y)
{
    if(x-1>-1){
        if(Longitudinal[y][x-1]=='1'){
            cout<<"L";
            serch(x-1,y,2);
        }
    }
}
void up(int x,int y)
{
    if(y-1>-1){
        if(side[y-1][x]=='1'){
            cout<<"U";
            serch(x,y-1,3);
        }
    }
}
void down(int x,int y)
{
    if(y+1<5&&side[y][x]=='1'){
            cout<<"D";
            serch(x,y+1,1);
        }
}
void serch(int x,int y,int then)
{
    if(x==0&&y==0){
        cout<<endl;
        exit(0);
    }
    if(then==0){
        up(x,y);
        righ(x,y);
        down(x,y);
        lef(x,y);
    }
    else if(then==1){
        righ(x,y);
        down(x,y);
        lef(x,y);
        up(x,y);
    }
    else if(then==2){
        down(x,y);
        lef(x,y);
        up(x,y);
        righ(x,y);
    }
    else{
        lef(x,y);
        up(x,y);
        righ(x,y);
        down(x,y);
    }
}

Measured memory_bytes: 1184
/* Author: $%U%$
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/
#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (int i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<int, int> Pair;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  string s;
  cin >> s;
  if (s[1] == 'B')
    s[1] = 'R';
  else
    s[1] = 'B';
  cout << s << endl;

  return 0;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
  string n;
  cin>>n;
  for(int i=0;i<n.size();i++){
    if(n[i]=='1') n[i]='9';
    else if(n[i]=='9') n[i]='1';
  }
  cout<<n<<endl;
  return 0;
    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b,c;
  cin>>a>>b>>c;
  vector<int> ans{a, b, c};
  sort(ans.begin(), ans.end());
  if(ans[0]=5 && ans[1]==5 && ans[2]==7) {
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int a,b;
	scanf("%d%d",&a,&b);
	if(a>=b){
		if(a-1>b)printf("%d\n",a*2-1);
		else printf("%d\n",a+b);
	}else{
		if(b-1>a)printf("%d\n",b*2-1);
		else printf("%d\n",a+b);
	}
	return 0;
}

Measured memory_bytes: 128
// Ala be zekrellah tatmaenolgholoob ...
// :)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define MP make_pair
using namespace std;
using namespace __gnu_pbds;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T> using ordered_multiset =  tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int64;
typedef pair<int,int> pii;
typedef pair<int64,int64> pii64;
const int maxn = 1e5+9;
const int64 mod = 1e9+7;
const int64 inf = 1e9;

string s;
int num;
int64 ans;

int main () {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> s;
	num = s.length();	
	for (int i = s.length() - 1; i >= 0; i--) {
		if (s[i] == 'B') {
			num--;
			ans += num - i;
		}
	}
	cout << ans << "\n";
}



Measured memory_bytes: 720
import sys
n = int(input())
c = list(map(int, input().split()))
c = [x-1 for x in c]
# print(c)
adj = [[] for i in range(n)]
for i in range(n-1):
    a, b = tuple(map(int, input().split()))
    a -= 1
    b -= 1
    adj[a].append(b)
    adj[b].append(a)


size = [1 for i in range(n)]
stack = [[] for color in range(n)]
in_time = [-1 for i in range(n)]
out_time = [-1 for i in range(n)]
timer = 0
total = n*(n+1)//2
ans = [total for color in range(n)]
# print(ans)


def dfs(parent, root):
    global timer
    in_time[root] = timer
    timer += 1

    color = c[root]
    s = stack[color]
    for child in adj[root]:
        if parent == child:
            continue

        dfs(root, child)
        size[root] += size[child]

        cnt = size[child]
        while s:
            x = s[-1]
            if in_time[x] > in_time[root] and out_time[x] != -1:
                cnt -= size[x]
                s.pop()
            else:
                break
        ans[color] -= cnt*(cnt+1)//2

    out_time[root] = timer
    timer += 1

    stack[c[root]].append(root)


sys.setrecursionlimit(10**6)

dfs(0, 0)
# print(size)
for color in range(n):
    cnt = n
    while len(stack[color]) > 0:
        x = stack[color][-1]
        cnt -= size[x]
        stack[color].pop()
    # print("node:", -1, "color:", color, "cnt:", cnt)
    ans[color] -= cnt*(cnt+1)//2
    print(ans[color])


Measured memory_bytes: 399516
fun main(){
    val s = readLine()!!.split(" ")[0].toCharArray()
    var ans = 0
    for (i in 0 until 3){
        if (s[i] == 'R'){
            if (i == 0) ans++
            else if (ans == 0) ans++
            else if (s[i - 1] == 'R')ans++
        }
    }
    println(ans)

}

Measured memory_bytes: 36432
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;

const int MX = 100005;

int main(){
	int n;
	cin >> n;
	vector<ll> cnt(MX);
	for(int i=0;i<n;i++){
		int a;
		cin >> a;
		cnt[a]++;
	}
	ll tot = 0;
	for(int i=0;i<MX;i++){
		tot += i*cnt[i];
	}
	int q;
	cin >> q;
	for(int i=0;i<q;i++){
		int b,c;
		cin >> b >> c;
		tot -= b*cnt[b];
		tot -= c*cnt[c];
		cnt[c] += cnt[b];cnt[b] = 0;
		tot += b*cnt[b];
		tot += c*cnt[c];
		cout << tot << endl;
	}
	return 0;
}


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

#define MAX_V 10
#define MAX_E 45
#define INF 1<<28
int d[MAX_V][MAX_V];
int n;
int main() {
    while (cin >> n) {
        if (n == 0) break;
        for (int i = 0; i < MAX_V; i++) {
            for (int j = 0; j < MAX_V; j++) {
                if (i == j) {
                    d[i][j] = 0;
                } else {
                    d[i][j] = INF;
                }
            }
        }
        int biggest_c = 0;
        for (int i = 0; i < n; i++) {
            int from, to, weight;
            cin >> from >> to >> weight;
            d[from][to] = weight;
            d[to][from] = weight;
            if (biggest_c < to) biggest_c = to;
        }

//        for (int i = 0; i <= biggest_c; i++) {
//            for (int j = 0; j <= biggest_c; j++) {
//                cout << d[i][j] << ' ';
//            }
//            cout <<endl;
//        }

        for (int k = 0; k <= biggest_c; k++) {
            for (int i = 0; i <= biggest_c; i++) {
                for (int j = 0; j <= biggest_c; j++) {
                    if (d[i][j] > d[i][k] + d[k][j]) {
                        d[i][j] = d[i][k] + d[k][j];
                    }
                }
            }
        }

        int sums[biggest_c];
        for (int i = 0; i <= biggest_c; i++) {
            sums[i] = 0;
        }
        int min_sum = INF;
        int best_city = INF;
        for (int i = 0; i <= biggest_c; i++) {
            for (int j = 0; j <= biggest_c; j++) {
                sums[i] += d[i][j];
//                cout << d[i][j] << ' ';
            }
//            cout << endl;
        }
        for (int i = 0; i <= biggest_c; i++) {
            if (min_sum > sums[i]) {
                min_sum = sums[i];
                best_city = i;
            }
        }

        cout << best_city << ' ' << min_sum << endl;
    }
    return 0;
}

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

int main(){
    int h,w;
    cin >> h >> w;
    bool ww[100] = {},hh[100] = {};
    char ch[100][100] = {};
    for(int i = 0; i < h; ++i){
        for(int j = 0; j < w; ++j){
            cin >> ch[i][j];
            if(ch[i][j] == '#'){
                hh[i] = true;
                ww[j] = true;
            }
        }
    }

    for(int i = 0; i < h; ++i){
        if(!hh[i])continue;
        for(int j = 0; j < w; ++j){
            if(j == 0)cout << endl;
            if(!ww[j])continue;
            cout << ch[i][j];

        }
    }
    cout << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define XX first
#define YY second
#define pb emplace_back
#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))
#define EFOR(i,a,b) for(int (i)=(a);i<=(b);++(i))
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define REP rep
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define all(X) (X).begin(),(X).end()
#define eb emplace_back

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef ll LL;
typedef pii PII;
typedef pll PLL;
const ll MOD=1e9+7;

#define rall(X) (X).rbegin(),(X).rend()
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rreps(X,S,Y) for (int (X) = (Y)-1;(X) >= (S);--(X))
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}

template<ll mod>
struct ModInt{
  using M=ModInt;
  ll a;
  M& put(ll v){
    a=(v<mod)?v:v-mod;
    return *this;
  }
  ModInt(ll v=0){put(v%mod+mod);}
  M operator+(M x){return M().put(a+x.a);}
  M operator-(M x){return M().put(a+mod-x.a);}
  M operator*(M x){return M().put(a*x.a%mod);}
  M operator/(M x){return x.inv()*a;}
  M& operator+=(M x){return *this=*this+x;};
  M& operator-=(M x){return *this=*this-x;};
  M& operator*=(M x){return *this=*this*x;};
  M& operator/=(M x){return *this=*this/x;};
  bool operator==(M x){return a==x.a;}
  M pow(ll m) {
    M x=*this,res=1;
    while(m){
      if(m&1)res*=x;
      x*=x;
      m>>=1;
    }
    return res;
  }
  M inv(){return pow(mod-2);}
};
using mint = ModInt<MOD>;

int N, M, L, R;
mint fact[614514];

mint Comb(int n, int k) {
  assert(0 <= k && k <= n);
  //if (!(0 <= k && k <= n)) return 0;
  return fact[n]/fact[k]/fact[n-k];
}

mint Calc(int L) {
  auto ret = Comb(L+N, N)/fact[N];
  vector<mint> f(L+1);
  rep(l, N-M+1) {
    mint coef = Comb(N-M, l) * mint(-1).pow(l);
    for (int idx=M; idx<=L; idx+=l+M) {
      f[idx] -= coef;
    }
    for (int idx=M+l; idx<=L; idx+=l+M) {
      f[idx] += coef;
    }
  }
  rep(j, L+1) {
    int k = L-j;
    ret -= Comb(k+N, N)*f[j]/fact[M]/fact[N-M];
  }
  return ret;
}

signed main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);

  fact[0] = 1;
  reps(i, 1, 614514) {
    fact[i] = fact[i-1] * i;
  }

  cin >> N >> M >> L >> R;
  auto ans = (Calc(R) - Calc(L-1)) * fact[N];
  cout << ans.a << endl;
}


Measured memory_bytes: 7464
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
#define YY cout << "Yes" << endl;
#define NN cout << "No" << endl;
#define ve vector
const int INF = 1000000007;
const long double eps = 1.0E-14;
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
// *max_element(all(d));
int solve(){
  long double a,b,c;
  cin >> a >> b >> c;
  if(a + b + 2 * sqrtl(a * b) < c)cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0; 
}
int main(){
  // ios::sync_with_stdio(false);cin.tie(nullptr);
  // cout << fixed;cout << setprecision(16) << endl; 
  solve();
  return 0;
} 

Measured memory_bytes: 256
import java.util.*;


public class Main{

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		
		String s=sc.next();
		int ans=0;
		
		for(int i=0;i<s.length();i++) {
			int k= Character.getNumericValue(s.charAt(i));
			ans+=k;
			ans%=9;
		}
		if(ans==0)System.out.println("Yes");
		else System.out.println("No");

	

	
	}
}


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

#define INF (1 << 30)
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define out(x) cout << x << endl;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;

int main(){
    int N;
    cin >> N;
    int ans = 0;
    rep(i, N){
        int degit = 1;
        if( (int)log10((double)(i+1)) % 2 == 0 ){
            ans++;
        }
    }
    out(ans);
    return 0;
}

Measured memory_bytes: 640
#include <stdio.h>

int main()
{
  int n,i,j,max,min,ori[200000];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&ori[i]);
  }
  max=-1000000000;
  min=ori[0];

  for(j=1;j<n;j++){
    if(max<ori[j]-min) max=ori[j]-min;
    if(min>ori[j]) min=ori[j];
  }

  printf("%d\n",max);

  return 0;
}



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

#define endl '\n'

int const N = 2001, INF = (int) 1e9;
vector<int> adj[N];
int n, dist[N];

void dijkstra(int x){
    for (int i=0; i<n; i++) dist[i] = INF;
    dist[x] = 0;
    priority_queue<int, vector<int>, greater<int>> pq;
    pq.push(x);
    while(!pq.empty()){
        int top = pq.top(); pq.pop();
        for (int f : adj[top]){
            if (dist[f] > dist[top] + 1){
                dist[f] = dist[top] + 1;
                pq.push(f);
            }
        }
    }
}

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

    int x, y; cin >> n >> x >> y;
    
    for (int i=0; i<n-1; i++){
        adj[i].push_back(i+1);
        adj[i+1].push_back(i);
    }
    adj[--x].push_back(--y);
    adj[--y].push_back(--x);

    int ans[n];
    memset(ans, 0, sizeof ans);
    for (int i=0; i<n; i++){
        dijkstra(i);
        for (int j=i+1; j<n; j++){
            ans[dist[j]]++;
        }
    }
    for (int i=1; i<n; i++) cout << ans[i] << endl;
}

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

int main(){
  int n;
  cin >> n;
  
  if(n%1000==0)cout << 0 << endl;
  else cout << 1000-n%1000 << endl;
}

Measured memory_bytes: 3632
// ConsoleApplication77.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include <iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
#include<string>
using namespace std;
string a[200500];
int aa[200500];
int main()
{
	map<string,int>la,lu;
	int n,l;
	cin >> n;
	int ma = 1;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		la[a[i]]++;
		ma = max(ma, la[a[i]]);
	}

for (auto& x : la)
		{
			if(x.second==ma)
			cout << x.first << "\n";
		}

}



Measured memory_bytes: 26752
#include <cstdio>
#include <algorithm>

typedef long long ll;

using namespace std;

ll gcd(ll a, ll b) {
    if (a < b) return gcd(b, a);
    if (a % b) return gcd(b, a % b);
    return b;
}

int main() {
    ll n, k, a, b, m;
    scanf("%lld%lld%lld", &n, &k, &a);
    m = a;
    for (ll i = 1; i < n; ++i) {
        scanf("%lld", &b);
        a = gcd(a, b);
        m = max(m, b);
    }
    printf("%s\n", (k % a || k > m ? "IMPOSSIBLE" : "POSSIBLE"));
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

int main(){
    int a,b;
    cin>>a>>b;
    int c = a*b;
    if(c%2==0){
        cout<<"Even";
    }else{
        cout<<"Odd";
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int a,b=0,c=0,i;
	for(i=0;i<4;i++){
		scanf("%d",&a);
		b+=a;
	}
	for(i=4;i<8;i++){
		scanf("%d",&a);
		c+=a;
	}
	if(b<c){
		printf("%d\n",c);
	}
	else{
		printf("%d\n",b);
	}
	return 0;
}

Measured memory_bytes: 2700
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint

#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
# ko=list("abcdefghijklmnopqrstuvwxyz")

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def soinsubunkai_e(n,m): #高速素因数分解 m[n]=nを割ることの出来る最小の素数
    a = set()
    i = 1
    while n>1:
        a.add(m[n])
        n=n//m[n]
    nokori=n
    a.add(nokori)
    return a

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def era(n): #b[n]=nを割ることの出来る最小の素数　の配列を生成　エラトステネスの篩
    b=[i for i in range(n+1)]
    for i in range(2,int(math.sqrt(n)+10)):
        j=1
        temp=i*j
        while temp<=n:
            b[temp]=min(i,b[temp])
            temp+=i
    return b


def main():
    #l,r,d=map(int,input().split())
    n=int(input())
    ans=0
    not0=1
    all=1
    not01=1
    for i in range(n):
        not0*=9
        all*=10
        not01*=8
        not0%=MOD
        all%=MOD
        not01%=MOD
    if n>=2:
        ans=all-2*not0+not01
        ans%=MOD
    #a
    print(ans)






if __name__ == "__main__":

    main()


Measured memory_bytes: 72928
S = int(input())
mod = (10 ** 9 + 7)
if S < 3:
  print(0)
else:
  ans = 1
  max_length = S // 3
  dp = [[-1 for i in range(S-3+1)] for j in range(max_length+1)]
  for diff_size in range(S-3+1):
    for length in range(max_length+1):
      if length == 0:
        dp[length][diff_size] = 0
      elif length == 1 or diff_size == 0:
        dp[length][diff_size] = 1
      elif length == 2:
        dp[length][diff_size] = diff_size + 1
      elif diff_size == 1:
        dp[length][diff_size] = length
      else:
        if dp[length][diff_size] == -1:
          dp[length][diff_size] = dp[length-1][diff_size] + dp[length][diff_size-1]
  for length in range(2, max_length + 1):
    diff = S - length * 3
    ans += dp[length][diff]
    ans %= mod

  print(ans) 


Measured memory_bytes: 332092
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#define ll long long
#define INF 1e+15
#define MOD 1000000007
using namespace std;


int main(){
    string s;
    cin >> s;
    
    int m = (s[5]-'0')*10+(s[6]-'0');
    int d = (s[8]-'0')*10+(s[9]-'0');
    
    if(m<=4){
        cout<<"Heisei"<<endl;
    }else{
        cout<<"TBD"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n,m,d;
	int i,j,k;
	
	cin>>n>>m>>d;
	char data[101][101];
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			cin>>data[i][j];
		}
	}
	int cnt=0;
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			
				for(k=i;k<i+d;k++){	
					if(data[k][j]!='.')	break;
					//cout<<"K="<<k<<" "<<"J="<<j<<endl;
				}
				if(k==i+d)	cnt++;
			
			
				for(k=j;k<j+d;k++){
					if(data[i][k]!='.')	break;
					//cout<<"I="<<i<<" "<<"K="<<k<<endl;
				}
				if(k==j+d)	cnt++;
		
		}
	}
	cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 3104
//abc121_a.cpp
//Sun Mar 17 23:02:34 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
	int H,W,h,w;
	cin >> H >> W >> h >> w;

	cout << H*W-h*W-(H-h)*w<< endl;
//	printf("%.4f\n",ans);
}

Measured memory_bytes: 256