akhauriyash/Code-Regression huggingface dataset:
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;

int main()
{
    int a;
    string s;
    cin >> a >> s;
    
    if (a < 3200) cout << "red" <<endl;
    else if (a >= 3200) cout <<s <<endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n;
  cin >> n;
  ll ans = 0;
  rep(i, n) ans += (i + 1) * (n - i);
  rep(i, n - 1) {
    ll u, v;
    cin >> u >> v;
    if(u > v) swap(u, v);
    ans -= u * (n - v + 1);
  }
  cout << ans << endl;
}

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

int main() {
  int n,min=0,max=INF;
  cin >>n;
  
  vector<int> vec(n);
  bool ans=true;
  
  for(int i=0;i<n;i++){
    int x;
    cin >> x;
    vec[i]=x;
  }
  
  if(n==1){
    cout << "Yes" <<endl;
    return 0;
  }
  
  for(int i=n-1;i>0;i--){
    if(vec[i-1]>vec[i]+1){
      ans=false;
      break;
    }
    else if(vec[i-1]==vec[i]+1){
      vec[i-1] -= 1;
    }
  }
  
  if(ans) cout << "Yes" << endl;
  else cout << "No" <<endl;
  
  return 0;
}

Measured memory_bytes: 640
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

int main()
{
 
string a;
std::cin >> a;


for(int i=0;i<a.length();){
  
std::cout << a[i];
i=i+2;
}
    return 0;
}


Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;

public class Hello
{
    public static void Main()
    {
        hoge();
        //System.Console.ReadLine();
    }

    public static void hoge()
    {
        System.Console.ReadLine();
        var vars = System.Console.ReadLine().Split(' ').Select(long.Parse).ToArray();


        long ans = 1;
        if (vars.Contains(0))
        {
            System.Console.WriteLine(0);
            return;
        }
        try
        {
            foreach(var v in vars)
            {
                checked
                {
                    ans *= v;
                }
                
            }
            if(ans > 1000000000000000000)
            {
                ans = -1;
            }
        }
        catch(Exception e)
        {
            ans = -1;
        }

        System.Console.WriteLine(ans);
    }
}

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

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	long long x;
	cin >> x;
	for (long long a = 1; a <= 120; a++) {
		long long aa = a*a*a*a*a;
		long long bb = abs(aa - x);
		int s = aa - x >= 0 ? 1 : -1;
		long long tb = pow(bb, 1.0/5.0);
		if (tb * tb * tb * tb * tb == bb) {
			cout << a << " " << s * tb << endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 4116
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;

ll mod_pow(ll a,ll x){
    ll ret=1;
    while(x>0){
        if(x&1){ret*=a;}
        x>>=1;
        a*=a;
    }
    return ret;
}



int main(){
    ll n,p;
    cin>>n>>p;
    map<ll,ll> M;
    for(ll i=2;i*i<=p;i++){
        while(p%i==0){
            p/=i;
            M[i]++;
        }
    }
    if(p!=1){M[p]++;}
    ll ret=1;
    for(auto i=M.begin();i!=M.end();i++){
        ret*=mod_pow(i->first,i->second/n);
    }
    cout<<ret<<endl;
    
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <complex>
#include <cstdio>
#include <utility>
#include <vector>
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
typedef pair<P,double> C;
typedef vector<P> Poly;
#define X real()
#define Y imag()
const double EPS = (1e-10), INF = (1e15), pi = acos(-1);

//2D version
double dot(P a, P b){ return a.X * b.X + a.Y * b.Y;}
double cross(P a, P b){ return a.X * b.Y - a.Y * b.X;}

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if(cross(b,c) > EPS) return +1;
  if(cross(b,c) < -EPS) return -1;
  if(dot(b,c) < 0) return +2;
  if(abs(b) + EPS < abs(c)) return -2;
  return 0;
}

P projection(P a, P b){ return dot(a, b)/abs(b)/abs(b)*b;}

double ps_dist(P a, L s){
  if(dot(s.second-s.first,a-s.first) >= 0 && dot(s.first-s.second,a-s.second) >= 0)
    return abs(cross(s.first-s.second,a-s.second))/abs(s.first-s.second);
  return min(abs(a-s.first), abs(a-s.second));
}

double pl_dist(P a, L s){ return abs(cross(s.first-s.second,a-s.second))/abs(s.first-s.second);}

L cpcl(C c, L l){
  //円cと直線lの交点
  //接する場合は同一の点を二つ返す
  double d = pl_dist(c.first,l), r = c.second;
  P m = l.first + projection(c.first-l.first,l.second-l.first);
  P x = sqrt(r*r-d*d)/abs(l.second-l.first)*(l.second-l.first);
  if(dot(x,l.second-l.first) < 0) x *= -1;
  return make_pair(m-x,m+x);
}

double common_area_cp(C c, Poly p){
  //円と非凸多角形の共通面積
  double ret = 0, r = c.second;
  int n = p.size();
  for(int i = 0; i < n; ++i) p[i] -= c.first;
  for(int i = 0; i < n; ++i){
    if(abs(p[i]) < EPS || abs(p[(i+1)%n]) < EPS) continue;
    double d = arg(p[(i+1)%n]/p[i]);
    ret += r*r*d/2.0;
    if(ps_dist(P(0,0),L(p[i],p[(i+1)%n])) < r - EPS){
      L cps = cpcl(C(P(0,0),r),L(p[i],p[(i+1)%n]));
      P a, b;
      if(ccw(p[i],p[(i+1)%n],cps.first) == 0 &&
         ccw(p[i],p[(i+1)%n],cps.second) == 0)
        a = cps.first, b = cps.second;
      else if(ccw(p[i],p[(i+1)%n],cps.first) == 0)
        a = cps.first, b = p[(i+1)%n];
      else if(ccw(p[i],p[(i+1)%n],cps.second) == 0)
        a = p[i], b = cps.second;
      else
        a = p[i], b = p[(i+1)%n];
      if(abs(a) < EPS || abs(b) < EPS) continue;
      d = arg(b/a);
      ret += cross(a,b)/2.0 - r*r*d/2.0;
    }
  }
  return ret;
}

int main(){
  int N, r;
  cin >> N >> r;
  Poly p;
  for(int i = 0; i < N; ++i){
    double x, y;
    cin >> x >> y;
    p.emplace_back(x,y);
  }
  double ans = 0;
  for(int i = 1; i <= r; ++i){
    if(i%2) ans += common_area_cp(C(P(0,0),i),p) - common_area_cp(C(P(0,0),i-1),p);
    else ans += (2*i-1)*pi - common_area_cp(C(P(0,0),i),p) + common_area_cp(C(P(0,0),i-1),p);
  }
  printf("%.9f\n", ans);
  return 0;
}



Measured memory_bytes: 3508
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223372036854775807
#define INF 2147000000
#define MOD 1000000007
using namespace std;

ll d[105][105];

int main(int argc, char* argv[])
{
    long n, m;
    scanf("%ld%ld", &n, &m);
    
    long i, j;
    for(i=0; i<n; i++) {
        for(j=0; j<n; j++) {
            if(i==j) d[i][j]=0;
            else     d[i][j]=INF;
        }
    }
    vector<long> a(m), b(m), c(m);
    for(i=0; i<m; i++) {
        scanf("%ld%ld%ld", &a[i], &b[i], &c[i]);
        d[a[i]-1][b[i]-1]=d[b[i]-1][a[i]-1]=c[i];
    }

    long k;
    for (k=0; k<n; k++) {
        for (i=0; i<n; i++) {
            for (j=0; j<n; j++) {
                if (d[i][k] + d[k][j] < d[i][j]) {
                    d[i][j] = d[i][k] + d[k][j];
                }
            }
        }
    }

    long ans=0;
    for(i=0; i<m; i++) {
        if (c[i] > d[a[i]-1][b[i]-1]) {
            ans++;
        }
    }
    printf("%ld\n", ans);

    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <iomanip>
#include <queue>
#include <functional>
#include <cassert>
#include <cmath>

using namespace std;
using ll = unsigned long long;

int main() {

	int n;
	int a[100010];
	bool b[100010] = { 0 };

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

	int x = 0;
	int cnt = 0;
	while (x != 1) {
		if (b[x]) {
			cout << -1 << endl;
			return 0;
		}
		b[x] = true;
		x = a[x] - 1;
		cnt++;
	}
	
	cout << cnt << endl;


	return 0;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set> 
#include<math.h>
#define pai 3.14159265358979323846264338327950288;
#define keta(n) cout << fixed << setprecision((n));
using ll = long long;
int main(){
  string s;
  cin>>s;
  string ans = s.substr(4);
  cout<<"2018"<<ans<<endl;

}


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


int main()
{
    ll A, B, gcd;
    cin >> A >> B;
    ll tmpA = A, tmpB = B;

    A = max(tmpA, tmpB);
    B = min(tmpA, tmpB);

    while (B != 0) {
        tmpA = A;
        A = B;
        B = tmpA % B;
    }
    gcd = A;

    vector<ll> prime(1, 0);
    ll rep_max = sqrt(gcd);
    for (ll i = 2; i <= rep_max; i++) {
        ll count = 0;
        
        while (gcd % i == 0) {
            count++;
            gcd /= i;
        }

        if (count > 0) {
            prime.push_back(count);
        }

        if ((gcd == 1)) {
            break;
        }
    }
    if (gcd != 1) {
        prime.push_back(1);
    }

    cout << prime.size() << endl;
    return 0;
}

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pairInt;
#define FOR(i, n) for (int i = 0; i < int(n); i++)
#define FOR1(i, m, n) for (int i = int(m); i < int(n); i++)
#define MAX(a, b) ((a) >= (b) ? (a) : (b))
#define MIN(a, b) ((a) <= (b) ? (a) : (b))

int main(int argc, char *argv[]) {
  array<int, 2> p0, p1, v1;
  int q;

  scanf("%d%d%d%d%d", &p0[0], &p0[1], &p1[0], &p1[1], &q);
  v1[0] = p1[0] - p0[0];
  v1[1] = p1[1] - p0[1];

  FOR(i, q) {
    array<int, 2> p2, v2;
    scanf("%d%d", &p2[0], &p2[1]);
    v2[0] = p2[0] - p0[0];
    v2[1] = p2[1] - p0[1];

    int op = v1[0] * v2[1] - v1[1] * v2[0];
    int ip = v1[0] * v2[0] + v1[1] * v2[1];

#ifdef DEBUG
    printf("v1=(%d,%d),v2=(%d,%d),op=%d,ip=%d\n", v1[0], v1[1], v2[0], v2[1],
           op, ip);
#endif

    if (op > 0)
      printf("COUNTER_CLOCKWISE\n");
    else if (op < 0)
      printf("CLOCKWISE\n");
    else if (ip < 0)
      printf("ONLINE_BACK\n");
    else if (abs(v2[0]) > abs(v1[0]) || abs(v2[1]) > abs(v1[1]))
      printf("ONLINE_FRONT\n");
    else
      printf("ON_SEGMENT\n");
  }
  return 0;
}

Measured memory_bytes: 3164
#include <stdio.h>
int main() {
    int N;
    scanf("%d", &N);
    int array[10000];
    for (int i = 0; i < N; i++){
        scanf(" %d", &array[i]);
    }
    for (int i = N - 1; i >= 0; i--) {
        if (i == N - 1) printf("%d", array[i]);
        else printf(" %d", array[i]);
    }
    printf("\n");
}



Measured memory_bytes: 2692
#include<bits/stdc++.h>
using namespace std;
 
int X,N, dt[105];
 
bool cari(int x){
	int kiri = 1;
	int kanan = N;
	int hasil = 0;
	while(kiri<=kanan&&hasil==0){
		int tengah=(kiri+kanan)/2;
		if(x<dt[tengah])
			kanan=tengah-1;
		else if(x>dt[tengah])
			kiri=tengah+1;
		else
			hasil=tengah;
	}
	if(hasil==0)
		return false;
	return true;
}
 
int main(){
	cin>>X>>N;
	for(int i=1;i<=N;i++){
		cin>>dt[i];
	}
 
	for(int i=1;i<N;i++)
		for(int j=i+1;j<=N;j++)
			if(dt[j]<dt[i])
				swap(dt[i],dt[j]);
 
	int kecil = X;
	int besar = X;
 
	while(1==1){
		if(cari(kecil)==false){
			cout<<kecil<<endl;
			return 0;
		}
		if(cari(besar)==false){
			cout<<besar<<endl;
			return 0;
		}
		kecil-=1;
		besar+=1;
	}
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
int main(){
  int A, B, K;
  cin >> A >> B >> K;
  for (int i = 0; i < K; i++){
    if (i % 2 == 0){
      if (A % 2 == 1){
        A--;
      }
      B += A / 2;
      A /= 2;
    } else {
      if (B % 2 == 1){
        B--;
      }
      A += B / 2;
      B /= 2;
    }
  }
  cout << A << ' ' << B;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    int m;
    for (int i = sqrt(n); i >= 1;i--){
        if(n%i==0){
            m =  i;
            n /= i;
            break;
        }
    }
    cout << n + m - 2 << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <cmath>
#include <stack>

using namespace std;
using ll = long long int;

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

ll inf = 100100100;

int main(){
  ll n, m;
  cin>> n >> m;
  vector<pair<ll,ll>> v;
  for(ll i=0; i<m; i++) {
    ll a, b;
    cin>>a>>b;
    ll s=0;
    for(ll j=0; j<b; j++) {
      ll c;
      cin>>c;
      s |= (1<<(c-1));
    }
    v.push_back(make_pair(s, a));
  }
  vector<ll> dp(1<<n, inf);
  dp[0]=0;
  for(ll i=0; i<(1<<n); i++) {
    for(ll j=0; j<m; j++) {
      ll t = i | v[j].first;
      dp[t] = min(dp[t], dp[i]+v[j].second);
    }
  }
  ll ans = dp[(1<<n)-1];
  if(ans == inf) ans = -1;
  std::cout << ans << std::endl;
  return 0;
}



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

int main() {
	int n, m;
	char a[55][55], b[55][55];
	cin >> n >> m;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> a[i][j];
		}
	}

	for (int i = 0; i < m; i++) {
		for (int j = 0; j < m; j++) {
			cin >> b[i][j];
		}
	}

	bool exist = false;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (i + m - 1 >= n || j + m - 1 >= n) continue;

			bool match = true;
			for (int k = 0; k < m; k++) {
				for (int l = 0; l < m; l++) {
					if (a[i + k][j + l] != b[k][l]) match = false;
				}
			} 
			if (match) exist = true;
		}
	}

	if (exist) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }

void main() {
  auto N = readln.chomp.to!(int);
  auto P = readln.split.to!(int[]);

  void solve() {
    int answer;
    int min = 999999;
    foreach(i; 0..N) {
      min = min < P[i] ? min : P[i];
      if (min >= P[i]) answer++;
    }

    answer.writeln();
  }

  solve();
}


Measured memory_bytes: 11152
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#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 ALL(a) (a).begin(),(a).end()
#define SORT(v) sort(ALL(v))
//#define scanf scanf_s

int main()
{
	int n, r;
	while (cin >> n >> r, n)
	{
		int p, c;
		vector<int> deck;
		vector<int> tmp;
		REP(i, n) deck.push_back(n - i);
		REP(s, r)
		{
			tmp = deck;
			cin >> p >> c;
			REP(i, c)
			{
				deck[i] = tmp[p + i - 1];
			}
			REP(i, p - 1)
			{
				deck[i + c] = tmp[i];
			}

		}
		cout << deck[0] << endl;
	}
	return 0;
}

Measured memory_bytes: 1220
#include <cstdio>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
  int num;
  scanf("%d", &num);
  for (int i=1;;++i){
    if(i*i>num) {
      printf("%d\n", (i-1)*(i-1));
      break;
    }
  }
  return 0;
}


Measured memory_bytes: 256
A = gets.chomp.to_i(10)
B = gets.chomp.to_i(10)

if A == 1 && B == 2 then
  puts "3"
elsif A == 1 && B == 3 then
  puts "2"
elsif A == 2 && B == 1 then
  puts "3"
elsif A == 2 && B == 3 then
  puts "1"
elsif A == 3 && B == 1 then
  puts "2"
elsif A == 3 && B == 2 then
  puts "1"
else
  #全ての条件式が偽の時に実行する処理
end

Measured memory_bytes: 1788
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main()
{
	int N;
	double A[128], B[128], D1 = 0, D2 = 0, D3 = 0, DI = 0;
	cin >> N;
	
	for(int i = 0; i < N; ++i)
	{
		cin >> A[i];
	}
	
	for(int i = 0; i < N; ++i)
	{
		cin >> B[i];
	}
	
	for(int i = 0; i < N; ++i)
	{
		D1 += abs(A[i] - B[i]);
		D2 += pow(A[i] - B[i], 2);
		D3 += abs(pow(A[i] - B[i], 3));
		if(abs(A[i] - B[i]) > DI)
		{
			DI = abs(A[i] - B[i]);
		}
	}
	
	cout << fixed << setprecision(8) << D1 << endl;
	cout << fixed << setprecision(8) << sqrt(D2) << endl;
	cout << fixed << setprecision(8) << cbrt(D3) << endl;
	cout << fixed << setprecision(8) << DI << endl;

    return 0;
}



Measured memory_bytes: 3436
# coding: utf-8

list = []

while True:
    num = input().rstrip().split(" ")
    if (int(num[0]) == 0) and (int(num[1]) == 0):
        break
    list.append(num)

for i in range(len(list)):
    for j in range(int(list[i][0])):
        for k in range(int(list[i][1])):
            print("#", end="")
        print()
    print()

Measured memory_bytes: 8972
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

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

    int ans = -1;
    for (int i=0; i<10000; i++) {
        if ((int)(i*0.08) == a && (int)(i*0.1) == b) {
            ans = i;
            break;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,m=map(int, readline().rstrip().split())
    print(n*(n-1)//2+m*(m-1)//2)
    #arr=list(map(int, readline().rstrip().split()))
    #n=int(readline())
    #ss=readline().rstrip()
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Measured memory_bytes: 6252
//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

const int maxn=100+10;

char s[maxn];
int a[maxn],c[maxn],n;

inline int check(int l){
	// for(int i=1;i<=n;++i) printf("%d ",a[i]); puts("");
	for(int i=1;i<=l;++i) if(!a[i]) return 0;
	return 1;
}

int main()
{
	scanf("%s",s+1);
	n=strlen(s+1);
	int ans=n;
	for(int pos=0;pos<26;++pos){
		for(int i=1;i<=n;++i) if(s[i]-'a'==pos) a[i]=1;else a[i]=0;

		int len=n;
		for(;len>0&&!check(len);--len)
		{
			for(int j=1;j<len;++j) 
				if(a[j]|a[j+1]) a[j]=1; 
				else a[j]=0;
		}
		ans=min(ans,n-len);
	}
	cout<<ans<<endl;

	return 0;
}

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

#define INF INT_MAX

void init();
void update(int i,int x);
int find(int x,int y,int node,int left,int right);

int n,q;
int data[2000001];

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

  init();

  for(int i=0;i<n;++i){
    update(i,INF);
  }

  int comm,x,y;
  for(int i=0;i<q;++i){
    cin >> comm >> x >> y;
    if(comm == 0){
      update(x,y);
    }else if(comm == 1){
      cout << find(x,y,0,0,n-1) << endl;
    }
  }

  return 0;
}

void init(){
  int temp=1;
  while(temp<n){
    temp <<= 1;
  }
  n=temp;


  for(int i=0;i<=2*n;i++){
    data[i]=INF;
  }

  return;
}

void update(int i,int x){
  i+=n-1;
  data[i]=x;
  while(i>0){
    i=(i-1)/2;
    data[i]=min(data[(i*2)+1],data[(i*2)+2]);
  }
  return;
}

int find(int x,int y,int node,int left,int right){
  if(right<x || y<left) return INF;
  if(x<=left && right<=y) return data[node];
  int fleft=find(x,y,(node*2)+1,left,(left+right)/2);
  int fright=find(x,y,(node*2)+2,(left+right)/2+1,right);
  return min(fleft,fright);
}

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


int main(){
 int n;
 cin >> n;
 vector <int> a(n-1);
 rep(i,n-1) cin >>  a[i];
 rep(i,n-1) a[i]--;
 vector<int> cnt(n-1); 
 rep(i,n-1){
    cnt[a[i]]++;
 }
rep(i,n-1) cout << cnt[i] << endl;
cout <<0 << endl;
   }

Measured memory_bytes: 4848
import java.util.*;
import java.util.ArrayDeque;
import java.util.Queue;
import java.math.RoundingMode;
import java.math.BigDecimal;


public class Main{
	 public static void main(String[] args){
	   Scanner sc = new Scanner(System.in);
	   long A = sc.nextLong();
	   long B = sc.nextLong();
	   long ans = 1;
	   long N = gcd(A,B);
	   long now = N;
	   for(int i = 2; i <= Math.sqrt(N); i++) {
		   if(now%i != 0) {
			   continue;
		   }
		   ans++;
		   while(now%i==0) {
			   now/=i;
		   }
	   }
	   if(now != 1) {
			 ans++;
		 }
	  System.out.println(ans);
	 }
	  private static long gcd(long m, long n) {
		  if(m < n) return gcd(n, m);
		  if(n == 0) return m;
		  return gcd(n, m % n);
	  }
	}

Measured memory_bytes: 22100
#include<stdio.h>

int main(){
    int N, M, n, tmp, result=0;
    scanf("%d%d", &N, &M);
    int a[30];
for(int i = 0; i<30; i++) a[i] = 0;
    
    for(int i = 0; i<N; i++){
        scanf("%d", &n);
        for(int j = 0; j<n; j++){
            scanf("%d", &tmp);
            a[tmp-1] += 1;
        }
    }

    for(int i = 0; i<30; i++){
        if(a[i]==N) result++;
    }

    printf("%d\n", result);
    return 0;
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define dbg(x) { cerr<<"> "<<#x<<": "<<x<< endl; }
#define dbg2(x,y) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
const int inf = INT_MAX;
const double eps = 0.0000001;
const double PI = acos(-1.0);
const int MOD = 1e9+7;
const int N  = 2e5+5;

int a[N], c[N];

signed main(){
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif  
    IOS;

    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
    	cin >> a[i];
    	c[a[i]]++;
    }
    int mx = *max_element(a, a + n);
    if (c[mx] > 1) {
    	for (int i = 0; i < n; i++) {
    		cout << mx << endl;
    	}
    	return 0;
    }
    int mmx = 0;
    for (int i = 0; i < n; i++) {
    	if (a[i] == mx) continue;
    	mmx = max(mmx, a[i]);
    }
    for (int i = 0; i < n; i++) {
    	if (a[i] == mx) cout << mmx << endl;
    	else cout << mx << endl;
    }
    return 0;
}

Measured memory_bytes: 4480
#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <climits>

using namespace std;

int main() {
	int d, t, s;
	cin >> d >> t >> s;

	if (s * t >= d)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

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

int main() {
  int64_t U,M,K,Z=0,Q=998244353;
  cin>>U>>M>>K;
  
  vector<int64_t> q(200001,1);
  for(int i=1;i<=200000;i++){
    int64_t N=Q-2; //ここから
       int64_t a=1,b=0,c=1;
       while(N>0){
         a*=2;
         if(N%a!=0){
           N-=a/2;
           int64_t d=i;
           for(int j=0;j<b;j++){
            d=d*d;
             d=d%Q;
          }
           c=c*d;
          c=c%Q;
         }
        b++;
      } //ここまで
    q.at(i)=(c*q.at(i-1))%Q;
  }
  vector<int64_t> r(200001,1);
  for(int i=1;i<=200000;i++){
    r.at(i)=(i*r.at(i-1))%Q;
  }

  for(int i=K;i>=0;i--){
    int64_t E;
    int64_t N=U-i-1; //ここから
       int64_t a=1,b=0,c=1;
       while(N>0){
         a*=2;
         if(N%a!=0){
           N-=a/2;
           int64_t d=M-1;
           for(int j=0;j<b;j++){
            d=d*d;
             d=d%Q;
          }
           c=c*d;
          c=c%Q;
         }
        b++;
      } //ここまで
    E=c;
    E=(E*M)%Q;
    int64_t A=U-1,B=i,C=1;
      C=(q.at(B)*q.at(A-B))%Q;
      C=(C*r.at(A))%Q;
    E=(E*C)%Q;
    Z=(Z+E)%Q;
  }
  cout<<Z<<endl;
}





Measured memory_bytes: 6408
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#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 repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;cin>>n;
  vector<string>s(n);
  rep(i,n){
    cin>>s[i];
    sort(all(s[i]));
  }
  map<string,ll>ma;
  rep(i,n){
    ma[s[i]]++;
  }
  ll res=0;
  for(auto tp:ma){
    res+=tp.second*(tp.second-1)/2;
  }
  cout<<res<<endl;
  return 0;

}


Measured memory_bytes: 16640
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    if (a == b && b == c)
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<endl
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

ll calc(ll k,ll d) {
  return k*(k+1)/2*d;
}

const ll n=26;
ll c[n],q[444];
ll a[444][n];
set<ll> s[n];

ll solve(ll x,ll y) {
  ll ans=0;
  {
    ans-=a[x][q[x]];
    iter(s[q[x]]) it2=s[q[x]].lower_bound(x);
    iter(s[q[x]]) it1=it2,it3=it2;it1--,it3++;
    ans+=calc(*it2-*it1-1,c[q[x]]);
    ans+=calc(*it3-*it2-1,c[q[x]]);
    ans-=calc(*it3-*it1-1,c[q[x]]);
    s[q[x]].erase(it2);
  }
  {
    q[x]=y;
    s[q[x]].in(x);
    ans+=a[x][q[x]];
    iter(s[q[x]]) it2=s[q[x]].lower_bound(x);
    iter(s[q[x]]) it1=it2,it3=it2;it1--,it3++;
    ans-=calc(*it2-*it1-1,c[q[x]]);
    ans-=calc(*it3-*it2-1,c[q[x]]);
    ans+=calc(*it3-*it1-1,c[q[x]]);
  }
  return ans;
}

         
void Main() {
  srand((unsigned)time(NULL));
  int T;
  R T;
  rep(i,n) R c[i];
  rep(i,T)rep(j,n) R a[i][j];
  rep(i,n) s[i].in(-1),s[i].in(T);
  ll ans[T];
  mem(ans);
  rep(k,T) {
    ll M=0,x=0;
    rep(i,n) {
      if(M<a[k][i]) {
        M=a[k][i];
        x=i;
      }
    }
    q[k]=x;
    s[x].in(k);
    ans[k]=x;
  }
  clock_t t2=clock();
  for(int tt=0;;tt++) {
    ll e[2][3],sum=0;
    rep(i,2) {
      ll x=rand()%T,y=rand()%n;
      e[i][0]=q[x],e[i][1]=x,e[i][2]=y;
      sum+=solve(x,y);
    }
    if(sum<0) {
      rrep(i,2) {
        int x=e[i][1];
        s[q[x]].erase(x);
        q[x]=e[i][0];
        s[q[x]].in(x);
      }
    } else {
      rep(i,2) ans[e[i][1]]=e[i][2];
    }
    clock_t t3=clock();
    double t4=(double)(t3-t2)/CLOCKS_PER_SEC;
    if(tt>=2&&(double)t3/CLOCKS_PER_SEC+t4*2>1.900) break;
    t2=t3;
  }
  rep(i,T) pr(ans[i]+1);
}

int main(){Main();return 0;}


Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ln "\n"
#define pb push_back
#define pll pair<ll,ll>
#define ppll pair<ll,pll>
#define vll vector<ll>
#define vs vector<string>
#define vpll vector<pll>
#define vvll vector<vector<ll>>
#define vvpll vector<vpll>
#define f first
#define s second
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define Test ll T;cin>>T; while(T--)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define init(x,n,v) for(ll i=0;i<=n;i++) x[i]=v;
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define pi 3.14159265358979323846
#define MOD 1000000007
#define MAX 2000000000000000000
#define MAXN 100005
void inout()
{
    fast_io;
    #ifndef ONLINE_JUDGE
        freopen("input.txt" , "r" , stdin);
        freopen("output.txt" , "w" , stdout);
    #endif
}
void solve() {
	ll h, w, m, a, b , i;
    cin >> h >> w >> m;
    vector<ll> l(h + 5, 0), r(w + 5, 0);
    map<pll, ll> t;
    for(i = 0 ; i < m ; i++){
        cin >> a >> b;
        l[a]++;
        r[b]++;
        pll p = make_pair(a, b);
        t[p]++;
    }
    ll max_l = *max_element(l.begin(), l.end());
    ll max_r = *max_element(r.begin(), r.end());
    vector<ll> ndx_l, ndx_r;
    for(i = 0 ; i < h + 1 ; i++) if (l[i] == max_l) ndx_l.push_back(i);
    for(i = 0 ; i < w + 1 ; i++) if (r[i] == max_r) ndx_r.push_back(i);
    ll ans = max_l + max_r - 1;
    for (auto x: ndx_l){
        for (auto y: ndx_r){
            pll p = make_pair(x, y);
            if (t[p]==0){
                ans = max_l + max_r;
                cout << ans << endl;
                return ;
            }
        }
    } 
    cout << ans << endl;
}
int main() {
    inout();
    //Test 
    solve();
    #ifndef ONLINE_JUDGE
    	cout<<"\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
	#endif
    return 0;
}

Measured memory_bytes: 34848
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<bitset>
#include<math.h>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int N=300000+100;
const db pi=acos(-1.0);
#define lowbit(x) ((x)&(-x))
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u],v=sq[i].to;i;i=sq[i].nxt,v=sq[i].to)
#define fir first
#define sec second
#define mkp make_pair
#define pb push_back
const int p=200003;
#define eps 1e-8
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

inline ll readll()
{
    ll x=0;int f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

struct Complex{
    double x,y;
    Complex(double _x=0.0,double _y=0.0) {x=_x;y=_y;}
};

Complex operator +(Complex a,Complex b) {return Complex(a.x+b.x,a.y+b.y);}
Complex operator -(Complex a,Complex b) {return Complex(a.x-b.x,a.y-b.y);}
Complex operator *(Complex a,Complex b) {return Complex(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
int r[N<<2];
Complex f[N<<2];

void fft(int lim,Complex *a,int typ)
{
    rep(i,0,lim-1)
        if (i<r[i]) swap(a[i],a[r[i]]);
    for (int mid=1;mid<lim;mid<<=1)
    {
        Complex wn=Complex(cos(pi/mid),sin(pi/mid)*typ);
        int len=(mid<<1);
        for (int sta=0;sta<lim;sta+=len)
        {
            Complex w=Complex(1,0);
            for (int j=0;j<mid;j++,w=w*wn)
            {
                Complex x=a[sta+j],y=a[sta+j+mid]*w;
                a[sta+j]=x+y;
                a[sta+j+mid]=x-y;
            }
        }
    }
}

int n,a[N],mp[N],cnt[N];

int main()
{
    n=read();
    int g=1;
    rep(i,0,p-2)
    {
        mp[g]=i;g=g*2%p;
    }
    rep(i,1,n)
    {
        a[i]=read();
        if (!a[i]) continue;
        int x=mp[a[i]];cnt[x]++;
        //cout << a[i] << " " << x << endl;
    }
    rep(i,0,p-1) f[i]=Complex(cnt[i],0);
    int lim=1,cnt=0;
    while (lim<(p<<1)) {lim<<=1;cnt++;}
    rep(i,0,lim-1) 
        r[i]=((r[i>>1]>>1)|((i&1)<<(cnt-1)));
    fft(lim,f,1);
    rep(i,0,lim-1) f[i]=f[i]*f[i];
    fft(lim,f,-1);
    g=1;ll ans=0;
    rep(i,0,(p-1)<<1)
    {
        ll now=(ll)(f[i].x/lim+0.5);
        ans+=now*g;
        g=g*2%p;
    }
    rep(i,1,n) ans-=1ll*a[i]*a[i]%p;
    ans/=2;
    printf("%lld",ans);
    return 0;
}



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

int main(){
  double N;
  cin >> N;
  vector<double> v(N);
  vector<double> a(N);
  
  
  for(int i=0;i<N;i++){
    cin >> v.at(i);
    a.at(i) = pow(2,i);
  }
  
  sort(v.begin(),v.end());
  
  double s = v.at(0) / a.at(N-1);
  
  for(int i=1;i<N;i++){
    s = s + v.at(i) / a.at(N-i);
  }
  
  //double k;
  //k=pow(2,5);
  
  cout << fixed << setprecision(8);
  //cout << s << endl;
  cout << s << endl;
  
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define EPS (1e-15)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define bet(x, a, b) (a) <= (x) && (x) < (b)
typedef long long ll;
typedef unsigned long long ull;

int A[100000];

int main()
{
	ll H, sum = 0;
	int N;

	cin >> H >> N;
	rep(i, N) cin >> A[i];

	rep(i, N) sum += A[i];

	cout << (sum >= H ? "Yes" : "No") << endl;

	return 0;
}


Measured memory_bytes: 640
m = 1046527
H = [""] * m


def str_to_nume(word):
    ans = ""
    for _ in word:
        if _ == "A":
            ans += ("1")
        elif _ == "C":
            ans += ("2")
        elif _ == "G":
            ans += ("3")
        elif _ == "T":
            ans += ("4")
    return ans


def convert_type(word):
    # print("word", word)
    # print("value", int(str_to_nume(word)))
    return int(str_to_nume(word))


def hash1(key):
    return key % m


def hash2(key):
    '''hash1で衝突したとき用
    '''
    return 1 + key % (m-1)


def find(str_key):
    key = convert_type(str_key)
    for i in range(m):
        h = (hash1(key) + i * hash2(key)) % m
        if H[h] == str_key:
            return 1
        elif len(H[h]) == 0:
            return 0
    return 0


def insert(str_key):
    key = convert_type(str_key)
    for i in range(m):
        h = (hash1(key) + i * hash2(key)) % m
        if H[h] == str_key:
            return 1
        elif len(H[h]) == 0:
            H[h] = str_key
            return 0
    return 0


sols = []
n = int(input())
# print("hoge")
for i in range(n):
    col = input().split()
    if col[0] == "insert":
        insert(col[1])
    else:
        if find(col[1]) == 1:
            sols.append("yes")
        else:
            sols.append("no")
for _ in sols:
    print(_)



Measured memory_bytes: 35020
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
        init();

        long n = nextLong();
        if (n % 2 == 1) {
            System.out.println(0);
            return;
        }

        long numOf10s = 0;

        long p10 = 1;
        while (n >= p10) {
            p10 *= 5;
            numOf10s += (n/p10)/2;
        }

        System.out.println(numOf10s);
    }

    //Input Reader
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    }

    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}


Measured memory_bytes: 22484
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

S = input()
L = len(S)

a2 = S[0]
a3 = S[1]

if a2 == a3:
	print(1,2)
	sys.exit()

for i in range(0,L-2):
	a1 = a2
	a2 = a3
	a3 = S[i+2]
	if a1 == a2 or a1 == a3 or a2 == a3:
		print(i+1,i+3)
		sys.exit()

print(-1,-1)

Measured memory_bytes: 4576
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ITP1_8_D
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string p = Console.ReadLine();
            string circletxt = s + s;

            if (circletxt.Contains(p))
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }

        }
    }
}



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

typedef long long ll;
#define mod 1000000007

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

void solve() {
    int n, m;
    cin>>n>>m;
    unordered_map<int, int> hs;
    for (int i = 0; i < n; ++i) {
        int k;
        cin>>k;
        for (int j = 0; j < k; ++j) {
            int temp;
            cin>>temp;
            hs[temp] += 1;
        }
    }
    int ans = 0;
    for(auto& e:hs){
        if(e.second == n){
            ans += 1;
        }
    }
    cout<<ans;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    // cin >> t;
    // pre();
    while (t--)
        solve();

    return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define F(i,a,b) for(int i=(a);i<=(b);++i)
#define F2(i,a,b) for(int i=(a);i<(b);++i)
#define dF(i,a,b) for(int i=(a);i>=(b);--i)
#define dF2(i,a,b) for(int i=(a);i>(b);--i)
#define dF3(i,a,b) for(int i=(a)-1;i>=(b);--i)
using namespace std;typedef long long ll;typedef double ld;int INF=0x3f3f3f3f;int INF2=0x7fffffff;ll LNF=0x3f3f3f3f3f3f3f3f;ll LNF2=0x7fffffffffffffff;

int n;
char str[100007];
int son[2][100007],cnt=1;
ll dep[100007],Ans;

void Add(char*s){
	int now=1;
	for(int i=0;s[i];++i){
		if(!son[s[i]-'0'][now]) son[s[i]-'0'][now]=++cnt, dep[cnt]=dep[now]-1;
		now=son[s[i]-'0'][now];
	}
}

int main(){
	scanf("%d%lld",&n,dep+1);
	F(i,1,n){
		scanf("%s",str);
		Add(str);
	}
	F(i,1,cnt){
		if(!son[0][i]&&son[1][i]||son[0][i]&&!son[1][i]) Ans^=(dep[i]&-dep[i]);
	}
	printf(Ans?"Alice":"Bob");
	return 0;
}

Measured memory_bytes: 1920
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
using namespace std;
int main(){
 long long int n,a[5];
  cin >> n;
  for(int i=0; i<5; i++)
    cin >> a[i];
  sort(a,a+5);
  cout << setprecision(16)<< 4+ceil(n*1.0/a[0]);
  return 0;
}



Measured memory_bytes: 256
//
//  main.cpp
//  CoderProj
//
//  Created by Minoru Hayashi on 2020/03/12.
//  Copyright © 2020 Minoru Hayashi. All rights reserved.
//
//
//
//

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

#define REP(i,n) for (int i=0; i<(n); i++)
#define REP2(i,x,n) for (int i=x; i<(n); i++)
#define ALL(n) begin(n), end(n)

using ll = long long;

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

// const ll INF = 1LL<<60;
// const int INF = 1<<29;
// const ll MOD = 1000000007;
//#define __DBG__

bool check(string T){
  int a=(int)T.size();
  REP(i,(a+1)/2){
    if(T[i]!=T[a-i-1]){
      return false;
    }
  }
  return true;
}


void solve(void){
  
  double L;
    
  cin >> L;

  double a=L/3;
  
  cout << fixed;
  cout << setprecision(15) << a*a*a << endl;

  return;
   
}


int main(int argc, const char * argv[]) {

    cin.tie(0);
    ios::sync_with_stdio(false);

    solve();
 
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
/*	#include <boost/math/common_factor.hpp>  boost::math::lcm(10,20) ---> use it to find lcm. fill_n(&an[0][0],n*m,0); typedef long long ll;*/
using namespace std;
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long 
#define PI pair<int , int >
#define mpr make_pair
#define ff first
#define ss second
#define endl "\n"
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define FO(i,a,b) for(int i = (int)a;i < (int)b;++i)
#define FE(i,a,b) for(int i = (int)a;i <= (int)b;++i)
const int MOD = 1e9+7;
const int MAXN = 1e5+3;
const int inf = 2e9;
int max(int a,int b){	if(a > b)return a; else return b; }
int min(int a, int b){	if(a < b)return a; else return b; }
int dx[] = {1,-1,0,0};
int dy[] = {0,0,-1,1};
bool cmp(PI p1,PI p2){
	if(p1.ff < p2.ff)return true;	// You should not be writing p1.ss <= p2.ss !!!
	else if(p1.ff == p2.ff){ if(p1.ss < p2.ss)return true; return false; }
	return false;
}

void solve(){
	int n,k,s;
	cin >> n >> k >> s;
	FO(i,0,k){
		cout << s << " " ;
	}
	FO(i,k,n){
		if(s!=1e9)cout << s+1 << " ";
		else if(s!=1) cout << s-1 << endl;
	}
	cout << endl;
}
/* When you have to multiply many things , do it in different (multiple) lines, not in a single line .*/
int32_t main(){
	IO;
	#ifndef ONLINE_JUDGE
	//freopen("input.txt", "r", stdin);
	#endif // ONLINE_JUDGE
	// std::cout << std::setprecision(15); std::cout << std::fixed;
	int nT = 1;
	//cin >> nT;
	FE(i,1,nT)
		solve();
	return 0;
}


Measured memory_bytes: 1280
N=int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
                divisors.append((i,n//i))
                
    # divisors.sort()
    return divisors
D=make_divisors(N)
print(max(len(str(D[-1][0])),len(str(D[-1][1]))))

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

#define pi 3.141592654
#define fix(n) cout << fixed << setprecision(n)

#define rep(i,a,b) for(int i=a;i<b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)

#define ll  long long
#define ull unsigned long long

#define mp make_pair
#define pb push_back
#define fi first
#define se second

#define vi      vector<int>
#define pii     pair<int,int>
#define piii    pair<pair<int,int>,int>
#define all(v)  v.begin(), v.end()

int mod = 1000000007;
const int N = 1005;

// gcd
ll gcd(ll a , ll b)
{
    if ( b == 0)
    return a;
    return gcd( b, a % b);
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n, a, b;
	cin >> n >> a >> b;
	cout << min(b,n*a) << endl;
   
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
using namespace std;
int main()
{
  string s;
  cin>>s;
  ll d=s.length();
  for(ll i=0;i<d;i++)
  {
    cout<<'x';
  }
  return 0;
}  

Measured memory_bytes: 256
import numpy as np
n,w=map(int,input().split())
wv=[]
for _ in range(n):
      wv.append(list(map(int,input().split())))

# dp[j]:重さの総和がj以下となるように選択した時の最大
dp=np.zeros(w+1,np.int64)
for i in range(n):
      # i+1個目までの商品の中から選ぶときのdpを計算する
      # i+1個目の計算をするときはdpはi個目までの商品の中から選んだ時のdpとなっている
      # i=0 ->dp=zeros
      w_=wv[i][0]
      v_=wv[i][1]
      # dp[w_:]:i+1個目の商品を加えられるのはこの部分のみ。
      # dp[w_:]:i+1個目の商品を加えないパターン
      # dp[:-w_]+v_:i+1個目の商品を加えたパターン。商品の重さだけwを減らした時の最大価値に商品の価値をプラスしている。
      dp[w_:] = np.maximum(dp[w_:], dp[:-w_] + v_)
print(dp[-1])


Measured memory_bytes: 16700
#include<stdio.h>

int main()
{
  int n,q;
  int S[10000],T[500];
  int i,j,cnt;

  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d",&S[i]);
    }

  scanf("%d",&q);
  for(j=0;j<q;j++)
    {
      scanf("%d",&T[j]);
    }

  cnt=0;
  for(j=0;j<q;j++)
    {
      for(i=0;i<n;i++)
	{
	  if(T[j]==S[i])
	    {
	      cnt++;
	      break;
	    }
	}
    }
  printf("%d\n",cnt);

  return 0;

  
}



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

int main() {
    int N;
    cin >> N;
    int A[N];
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    float sum = 0;
    for(int i = 0; i < N; i++){
        sum += 1/(float)A[i];
    }
    cout << 1/sum << endl;
}

Measured memory_bytes: 256