akhauriyash/Code-Regression huggingface dataset:
// https://atcoder.jp/contests/agc003/tasks/agc003_b

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <tuple>
#include <vector>
using namespace std;

typedef long long ll;
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    ll ans = 0, sum = 0;
    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> m;
        if (m == 0) {
            ans += sum / 2;
            sum = 0;
        }
        sum += m;
    }
    if (sum > 0) {
        ans += sum / 2;
    }
    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
N = int(input())
S1 = input()
S2 = input()

MOD = 1000000007
i = 1
ans = 3
tp = 0
if S1[0] != S2[0]:
    i = 2
    ans = 6
    tp = 1
while i < N:
    if S1[i] == S2[i]:
        ans = (ans * [2, 1][tp]) % MOD
        i += 1
        tp = 0
    else:
        ans = (ans * [2, 3][tp]) % MOD
        i += 2
        tp = 1

print(ans)


Measured memory_bytes: 3188
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<numeric>
#define INF 1e+8
#define EPS 0
#define PB push_back
#define fi first
#define se second
#define reps(i,j,k) for(int i = j; i < k; i++)
#define rep(i,j) reps(i,0,j)
using namespace std;
const int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
typedef long long ll;
typedef pair<int,int> Pii;
int main(){
	char field[10][10][2]={{0}};
	rep(i,8){
		char x[10];
		scanf("%s",x);
		rep(j,8){
			field[i][j][0] = x[j];
		}
	}
	rep(n,3){
		printf("%d\n",90+90*n);
		rep(i,8){
			rep(j,8){
				field[j][7-i][(n+1)%2] = field[i][j][n%2];
			}
		}
		rep(i,8){
			rep(j,8){
				printf("%c",field[i][j][(n+1)%2]);
			}
			puts("");
		}
	}
	return 0;
}

Measured memory_bytes: 1144
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pb push_back 
#define fr first
#define sc second
#define Rep(i,n) for(int i=0;i<(n);i++)
#define All(v) v.begin(),v.end()
#define Uniq(v) v.erase(unique(All(v)),v.end())
typedef pair<int, int> Pii; 
typedef pair<int, Pii> Pip;
typedef pair<string, int> Psi;
typedef vector<int> Vi;
const int INF = (1<<30);
const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};

int main()
{
  int n = 0, w = 0, s = 0, e = 0;
  string S;
  int N;
  cin >> S;
  N = S.size();
  for(int i=0; i<N; i++) {
    if( S[i] == 'N' ) n++;
    if( S[i] == 'W' ) w++;
    if( S[i] == 'S' ) s++;
    if( S[i] == 'E' ) e++;
  }

  if( (n == 0 && s != 0) || (s == 0 && n != 0) || (w == 0 && e != 0) || (e == 0 && w != 0) ) cout << "No" << endl;
  else cout << "Yes" << endl;
} 

Measured memory_bytes: 256
#include <stdio.h>
 
int main(){
  char op;
  int a,b,ans=0;  
 
  while(1){
    scanf("%d %c %d", &a, &op, &b);
    if(op == '?')
      break;
    if(op == '+') ans = a + b;
    if(op == '-') ans = a - b;
    if(op == '/') ans = a / b;
    if(op == '*') ans = a * b;
   
    printf("%d\n", ans);
  }
   
  return 0;
}

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

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

// debug
#define test(x) cout << #x << " = " << x << endl

// answer output
#define Yes(c) cout << ((c) ? "Yes" : "No") << endl;
#define YES(c) cout << ((c) ? "YES" : "NO") << endl;
#define yes(c) cout << ((c) ? "yes" : "no") << endl;
 
#define possible(c) cout << ((c) ? "possible" : "impossible") << endl;
#define POSSIBLE(c) cout << ((c) ? "POSSIBLE" : "INPOSSIBLE") << endl;

int main() {
  
  string s;
  cin >> s;
  
  for ( int i = 0; i < s.size(); i = i + 2 ){
    cout << s[i];
  }
  
  cout << endl;

}

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

int main()
{
	int N;
	string S;
	cin >> N >> S;
	vector<long long> count(26, 0);
	for (int i = 0; i < N; ++i) {
		count[(int)(S[i] - 'a')]++;
		//cout << (int)(S[i] - 'a') << ":" << count[(int)(S[i] - 'a')] << endl;
	}
	long long mod = 1000000007;
	long long ans = mod + 1;
	for (int i = 0; i < 26; ++i) {
		//cout << i << ":" << count[i] << endl;
		ans = ((ans % mod) * (count[i] + 1)) % mod;
	}
	ans -= 1;
	cout << ans << endl;
	return 0;
}


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



int main() {
	int A, B;
	int ans;
	cin >> A >> B;
	ans = A - (B * 2);

	if (ans>=0) {
		cout << ans << endl;
	}
	else cout << 0 << endl;
}

Measured memory_bytes: 380
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define REP(i, n) for(i=0; i<n; i++)
#define REPR(i, n) for(i=n; i>=0; i--)
#define FOR(i, m, n) for(i=m; i<n; i++)
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define INF 1000000000
#define MOD 1000000007LL
#define MAX 100005
#define NIL -1
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PA;
typedef priority_queue<ll> PQ;
typedef pair<double, double> doup;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll a[200000];

int main() {
    ll n;
    ll i, d;
    set<ll> set;
    cin >> n;
    for(i=0; i<n; i++) {
        cin >> d;
        set.insert(d);
    }
    
    cout << set.size() << endl;
    
}


Measured memory_bytes: 256
num = int(input())
li = [input() for i in range(num)]

dic = {}
ans = 0
for i in range(num):
    now = "".join(sorted(li[i]))
    if now in dic:
        dic[now] += 1
    else:
        dic[now] = 1
for i in dic:
    n = dic[i]
    ans += int((n*(n-1))/2)

print(ans)

Measured memory_bytes: 24976
#include <bits/stdc++.h>
#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long

using namespace std;

int main() {
  int r, d, x2000;
  scanf("%d %d %d", &r, &d, &x2000);

  ll x = x2000;
  for (int i = 0; i < 10; i++) {
    x = x * r - d;
    cout << x << endl;
  }
}


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

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  while(1){
    c -= b;
    if(c <= 0){
      puts("Yes");
      return 0;
    }
    a -= d;
    if(a <= 0){
      puts("No");
      return 0;
    }
    
  }
  return 0;
}


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

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

void destroy(char x,char y){
	map[x][y]='0';
	for(int k=0;k<4;k++){
		int nx=x+dx[k],ny=y+dy[k];
		if(nx>=0 && ny>=0 && nx<12 && ny<12 && map[nx][ny]=='1') destroy(nx,ny);
	}
}

int main(){
	while(1){
		int count=0;
		int j;
		for(int i=0;i<12;i++) cin>>map[i];
		if(cin.eof()) break;
		
		for(int i=0;i<12;i++){
			for(int j=0;j<12;j++){
				if(map[i][j]=='1'){
					destroy(i,j);
					count++;
				}
			}
		}
		cout<<count<<endl;
	}
return 0;
}

Measured memory_bytes: 1140
#include<bits/stdc++.h>
using namespace  std;
const int maxn = 1e5+5;
const int maxm = 1e5+5;
const int mod  = 1e9+7;
const int inf  = 0x3f3f3f3f;
//typedef __int128  II;
typedef long long LL;
typedef pair<int,int> pii;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
int n,k,l; LL a[1010],b[1000010];
int main()
{
    scanf( "%d%d" , &n , &k ); for( int i=1 ; i<=n ; i++ ) scanf( "%lld" , &a[i] );
    a[0] = 0; l = 0; for( int i=2 ; i<=n ; i++ ) a[i] += a[i-1];
    for( int i=1 ; i<=n ; i++ ) for( int j=i ; j<=n ; j++ ) b[++l] = a[j]-a[i-1];
    LL ans = 0;
    for( int i=45 ; i>=0 ; i-- )
    {
        LL t = 1LL<<i; int cnt = 0;
        for( int j=1 ; j<=l ; j++ )
        {
            LL tmp = ans|t;
            if ( (b[j]&tmp)==tmp ) cnt++;
        }
        if ( cnt>=k ) ans = ans|t;
    }
    printf( "%lld\n" , ans );
    return   0;
}


Measured memory_bytes: 4352
N = int(input())
e = [0] * (N+1)
for i in range(2, N+1):
    cur = i
    for j in range(2,i+1):
        while cur % j == 0:
            e[j] += 1
            cur //= j
def num(m):
    return len(list(filter(lambda x:x >= m-1,e)))
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

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

using namespace std;

typedef long long int ll;


int main()
{
   ios::sync_with_stdio(false);
   ll n;
   cin>>n;
   if(n%1000==0){
       cout<<0;
   }
   else{
       cout<<(n/1000+1)*1000-n;
   }
}


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

int binary_search(vector<int>& a, int key) {
    int left = 0, right = (int)a.size() - 1; // 配列 a の左端と右端
    while (right >= left) {
        int mid = left + (right - left) / 2; // 区間の真ん中
        if (a[mid] == key) return mid;
        else if (a[mid] > key) right = mid - 1;
        else if (a[mid] < key) left = mid + 1;
    }
    return -1;
}
int main(){
  int x,n;
  cin >> x;
  cin >> n;
  vector<int> p(n);
  for(int i=0;i < n;i++){
    cin >> p[i];
  }
  sort(p.begin(), p.end());
  for(int i = 0;i < 100;i++){
    if(binary_search(p, x-i) == -1){
      cout << x-i << endl;
      return 0;
    }
    if(binary_search(p, x+i) == -1){
      cout << x+i << endl;
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 3632
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

int main() {
	int n, k;

	std::cin >> n >> k;

	std::vector<std::string> hate(k);

	for (int i = 0; i < k; i++) {
		std::cin >> hate[i];
	}

	for (int i = 1; i < 1000000; i++) {
		bool flag = false;
		std::string ss = std::to_string(i);


		std::sort(ss.begin(), ss.end());

		for (int j = 0; j < k; j++) {
			if (i < n || ss.find(hate[j]) != std::string::npos) {
				flag = true;
				break;
			}
		}

		if (!flag) {
			std::cout << i << std::endl;
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
back = []
forward = []
a = 0
b = 0
for i in range(n + 1):
    a += i
    b += n - i
    forward.append(a)
    back.append(b)
ans = 0
for i in range(k, n + 1):
    ans += back[n - i] - forward[n - i] + 1
ans = (ans + 1) % (10 ** 9 + 7)
print(ans)

Measured memory_bytes: 30388
from itertools import product
s = input()

def tolist(sign):
    # len(sign) == len(s)-1とする
    ans = [int(s[0])]
    for i in range(len(sign)):
        if sign[i]: # Trueの時+とする
            ans.append(int(s[i+1]))
        else:
            prev = ans.pop()
            ans.append(int(str(prev)+s[i+1]))
    return ans

ans = 0
for sign in product([True, False], repeat=len(s)-1):
    ans+=sum(tolist(sign))
print(ans)

Measured memory_bytes: 9208
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		int A = sc.nextInt();
		int B = sc.nextInt();
		String U = sc.next();
		if (S.equals(U)) A--;
		else B--;
		System.out.println(A + " " + B);
	}
}

Measured memory_bytes: 23892
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+7;
typedef long long ll;
ll fa[maxn];
int T;
struct Node
{
    ll x,y;
}e[maxn];
int Find(int x)
{
    if(fa[x]==x)
        return x;
    else
        return fa[x]=Find(fa[x]);
}
ll x,y,n,m;
ll sum;
ll ans[maxn],f[maxn];
int main()
{
    scanf("%lld%lld",&n,&m);
    for(int i=1;i<=n;i++)
        fa[i]=i,f[i]=1;
    for(int i=1;i<=m;i++)
    {
        scanf("%lld%lld",&e[i].x,&e[i].y);
    }
    sum=n*(n-1)/2;
    for(int i=m;i>=1;i--)
    {

        ans[i]=sum;
        x=e[i].x,y=e[i].y;
        x=Find(x);

        y=Find(y);
        if(x==y)
            continue;

        fa[y]=x;
        sum-=f[x]*f[y];
        f[x]+=f[y];
        //ans[i]=sum;
        //cout<<"====="<<endl;
    }
    for(int i=1;i<=m;i++)
       printf("%lld\n",ans[i]);
}


Measured memory_bytes: 5248
#include <iostream>
#include <string>
int main(int argc, char *argv[])
{
  int a;
  std::string s;
  std::cin >> a >> s;
  if (a < 3200)
  {
    std::cout
        << "red" << std::endl;
  }
  else
  {
    std::cout
        << s << std::endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int n,ans,i;
int a[100001];

void swap(void){
    int tmp;
    if(ans<a[i+1]){
        tmp = ans;
        ans = a[i];
        a[i] = tmp;
    }
}

int euclideanAlgorithm(void){
    int r;
    r = ans % a[i+1];
    while(r!=0){
        ans = a[i+1];
        a[i+1] = r;
        r = ans % a[i+1];
    }
    return a[i+1];
}

int main(){
    scanf("%d",&n);
    for(i=0;i<n;i++)scanf("%d",&a[i]);
    ans=a[0];
    for(i=0;i<n-1;i++){
        swap();
        ans = euclideanAlgorithm();
    }
    printf("%d\n",ans);
    return 0;
}

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

int main() {
	string T;
	cin >> T;

	rep(i, T.size()) {
		if(T[i] == '?') T[i] = 'D';
	}

	cout << T << endl;

	return 0;
}

Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define dd double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
const ll Mod=1000000007;
const ll INF=999999999999999999;
const ll NN=(ll)(1e6+5);
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y) 
{ 
    if (y==0) 
        return 1; 
    else if (y%2==0) 
        return power(x,y/2)*power(x,y/2); 
    else
        return x*power(x,y/2)*power(x,y/2); 
}
ll hcf(ll a,ll b) 
{ 
    if(b==0) 
        return a; 
    return hcf(b,a%b);  
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE 
    	freopen("input.txt", "r", stdin); 
    	freopen("output.txt", "w", stdout); 
    	freopen("error.txt", "w", stderr); 
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {
       ll n,i,j,k,ans=0;
       cin>>n;
       vector <ll> v(n);
       for(auto &u:v)
        cin>>u;
       sort(v.begin(),v.end());
       for(i=0;i<n-2;i++)
        for(j=i+1;j<n-1;j++)
         for(k=j+1;k<n;k++)
          if(v[i]+v[j]>v[k]&&v[i]!=v[j]&&v[j]!=v[k]&&v[k]!=v[i])
           ans++;
       cout<<ans;     
   }
}

Measured memory_bytes: 3656
#include<bits/stdc++.h>
#define f first
#define se second
#define pb push_back
#define pf push_front
#define eb emplace_back
#define emp emplace
#define ins insert
#define sz(s) (int)s.size()
#define rep(i,a,b) for( int i=a;i<b;i++)
#define repr(i,a,b) for( int i=a;i>=b;i--)
#define bitcount __builtin_popcount
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mem(n,m) memset(n,m,sizeof(n))
#define ii pair<int,int>
#define iii tuple<int, int, int>
#define si set<int>
#define vi vector<int>
#define vii vector<ii>
#define mi map<int,int>
#define lb lower_bound
#define ub upper_bound
#define present(s,x) (s.find(x) != s.end())
#define ford(container, it) for(auto it:container)
#define fors(container, it, a, b) for(auto it = a; it != b; it++)
#define Anurag_Gupta ios_base::sync_with_stdio(0);
#define IIIT_ALLD cin.tie(0);cout.tie(0);
#define mod 987654319
#define EPSILON 1e-9
#define PI acos(-1)
#define inf 1e17
#define int long long
#define debug(a) cerr<<#a<<": ";for(auto i:a)cerr<<i<<" ";cerr<<'\n';
#define trace(a) cerr<<#a<<": "<<a<<"\n"
#define gcd(a,b) __gcd(a,b)
using namespace std;
int add(int a, int b, int c){int res=a+b;return(res>=c?res-c:res);}
int mod_neg(int a, int b, int c){int res;if(abs(a-b)<c)res=a-b;else res=(a-b)%c;return(res<0?res+c:res);}
int mul(int a, int b, int c){int res=(int)a*b;return(res>=c?res%c:res);}
template<typename T>T power(T e, T n){T x=1,p=e;while(n){if(n&1)x=x*p;p=p*p;n>>=1;}return x;}
template<typename T>T mdpower(T e, T n, T m){T x=1,p=e;while(n){if(n&1)x=mul(x,p,m);p=mul(p,p,m);n>>=1;}return x;}
template<typename T>T extended_euclid(T a, T b, T &x, T &y){T xx=0,yy=1;y=0;x=1;while(b){T q=a/b,t=b;b=a%b;a=t;\
t=xx;xx=x-q*xx;x=t;t=yy;yy=y-q*yy;y=t;}return a;}
template<typename T>T mod_inverse(T a, T n){T x,y,z=0;T d=extended_euclid(a,n,x,y);return(d>1?-1:mod_neg(x,z,n));}
/*------------------------------------------------------------------------------------------------------------------*/
const int N = 10000007;
int primes[N];
int prime[N];
void seive(int n){
    for(int i=0;i<=n;i++){
        prime[i] = i;
        primes[i] = 1;
    }

    for(int i=2;i<=n;i++) {
        if(prime[i]==i){
            for(int j = i;j<=n;j+=i){
              //  if(i==3) cout<<j<<"\n";
                if(prime[j]==j)
                    prime[j] = i;

                int count=0;
                int temp = j;
                while(temp%i==0)
                {
                    count++;
                    temp/=i;
                }
                primes[j]*=(count+1);

            }
        }
    }
}


int32_t main()
{
    Anurag_Gupta
    IIIT_ALLD
 
   

    
    int n;
    cin>>n;
    seive(n);

    int ans=0;

    for(int i=1;i<=n;i++)
    ans+=i*primes[i];

  

    cout<<ans<<"\n";





  
 
 






 
#ifndef LOCAL_DEFINE
        cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
}


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

int f(string s){

    int n = (int)s.size();
    int d = 0;
    for(int i = 0; i < n; i++){
        if(s[i] == '*') continue;

        if(s[i] == '(') d++;
        else d--;
        if(d < 0) return 0;
    }

    return (d == 0);
}

int main(){

    
        string s; cin >> s;
        int n = (int)s.size();
        int star_idx;
        for(int i = 0; i < n; i++){
            if(s[i] == '*'){
                star_idx = i;
                break;
            }
        }

        int ans = 0;
        for(int l = 0; l < star_idx; l++){

            string t = "";
            for(int i = l + 1; i < star_idx; i++) t = t + s[i];

            for(int r = star_idx + 1; r < n; r++){
                t = t += s[r - 1];
                if(s[l] == '(' && s[r] == ')') ans += f(t);
            }
        }

        cout << ans << endl;
    

    return 0;
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
#define eps 1e-6
#define rep(i,n) for(int i=0;i<n;++i)
#define rep2(i,n) for(int i=1;i<=n;i++)
#define snc(a,b,c) ((a)?(b):(c))
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl;
#define No cout<<"No"<<endl;
#define ins insert
#define pb push_back
using namespace std; 

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  cout << min(a,b)+min(c,d) << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int N = 3;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		sc.close();
		out.println(n*(n+1)/2);
	}
}


Measured memory_bytes: 20948
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;


int main(){

    int a, b;
    cin >> a >> b;
    if(a*b % 2 == 0) cout << "Even" << endl;
    else cout << "Odd" << endl;

    return 0;
}

Measured memory_bytes: 3560
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long  w,h,x,y;
    cin >> w >> h >> x >> y;
    double ans=(w*h)/2.0;
    printf("%.6lf ",ans);
    if(w==2*x && h==2*y){
        cout << "1" << endl;
    }
    else cout << "0" << endl;
}


Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

string a[]={"0111111",
			"0000110",
			"1011011",
			"1001111",
			"1100110",
			"1101101",
			"1111101",
			"0100111",
			"1111111",
			"1101111",
			};

void mainmain(){
	vint v(10);
	rep(i,10){
		rep(j,7){
			v[i]<<=1;
			v[i]+=a[i][j]-'0';
		}
	}
	int n;
	while(cin>>n,n>=0){
		int tmp=0;
		rep(i,n){
			int t;
			cin>>t;
			bitset<7> ans=tmp^v[t];
			tmp=v[t];
			cout<<ans.to_string()<<endl;
		}
	}
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

Measured memory_bytes: 3176
#include <stdio.h>
#include <math.h>
#define N 50060

void Eratos(void);

int prime[N];

int main(void){
	int n;
	int lessmax, bigmin;

	Eratos();

	while(scanf("%d", &n) != EOF){
		for(int i=n-1;; i--){
			if(prime[i] == 1){
				lessmax = i;
				break;
			}
		}
		for(int i=n+1;; i++){
			if(prime[i] == 1){
			   	bigmin = i;
				break;
			}
		}

		printf("%d %d\n", lessmax, bigmin);
	}

	return 0;
}

void Eratos(void){
	for(int i=0; i<N; i++){
		prime[i] = 1;
	}
	prime[0] = prime[1] = 0;

	for(int i=2; i <= sqrt(N); i++){
		for(int j=2; i*j < N; j++){
			prime[i*j] = 0;
		}
	}
}

Measured memory_bytes: 0
S=input()
N=len(S)
i=0
if((N-1)/2%2==1):
    while (i<=((N-1)/2-1)/2):
        if( (S[i]==S[int((N-1)/2-i-1)]) & (S[i]==S[int((N-1)/2+1+i)]) & (S[i]==S[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==int(((N-1)/2-1)/2+1)):
        print('Yes')
    else:
        print('No')
    
else:
    while (i<=(N-1)/4):
        if( (S[i]==S[int((N-1)/2-i-1)]) & (S[i]==S[int((N-1)/2+1+i)]) & (S[i]==S[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==int((N-1)/4+1)):
        print('Yes')
    else:
        print('No')

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

const int N = 6e5 + 5;
const int Base = 1e5 + 5;

#define int long long

int A[N], B[N], n, m, x, y;

#define lowbit(x) (x & (-x))

int S[N];

void add(int x, int v) {
	++ x;
	for(int i = x; i < N; i += lowbit(i)) S[i] += v;
}

int sum(int x) {
	++ x;
	int res = 0;
	for(int i = x; i; i -= lowbit(i)) res += S[i];
	return res;
}

int calc(int x) {
	int ans = 0;
	for(int i = 1; i <= n; ++ i) if(A[i] >= x) B[i] = 1;
	else B[i] = -1;
	//for(int i = Base - n - 1; i <= Base + n + 1; ++ i) S[i] = 0;
	memset(S, 0, sizeof(S));
	add(0 + Base, 1);
	for(int i = 1; i <= n; ++ i) {
		B[i] = B[i - 1] + B[i];
		//if(x == 30) cerr << B[i] << " " << sum(B[i] - 1 + Base) <<" " << sum(-1 + Base) <<  endl;
		ans += sum(B[i] + Base);
		add(B[i] + Base, 1);
	}
	return ans;
}

set <int> all;

main(void) {
	cin >> n;
	for(int i = 1; i <= n; ++ i) scanf("%lld", &A[i]), all.insert(A[i]);
	int tot = n * (n + 1) / 2;
	tot = tot - (tot / 2 + 1);
	//cerr << calc(30) << endl;
	int l = 0, r = 1e9, res = 0;
	while(l <= r) {
		int mid = (l + r) >> 1;
		if(calc(mid + 1) <= tot) {
			r = mid - 1;
			res = mid;
		}
		else l = mid + 1;
	}
	res = *(all.lower_bound(res));
	cout << res << endl;
}

Measured memory_bytes: 13056
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
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; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const LL mod=1000000007;
const LL LINF=1LL<<62;
const int INF=1<<30;
int dx[]={1,0,-1,0,-1,1,1,-1};
int dy[]={0,1,0,-1,-1,-1,1,1};


struct UnionFind{
    vector<int> data;

    UnionFind(int sz){
        data.assign(sz, -1);
    }

    int find(int k){
        if(data[k] < 0) return k;
        return data[k] = find(data[k]);
    }

    bool unite(int x, int y){
        x = find(x), y = find(y);
        if(x == y) return false;
        if(data[x] > data[y]) swap(x, y);
        data[x] += data[y];
        data[y] = x;
        return true;
    }

    bool same(int x, int y){
        return find(x) == find(y);
    }

    int size(int k){
        return -data[find(k)];
    }

};

int main(){
    int n,m;cin >> n >> m;
    UnionFind uf(n);
    for (int i = 0; i < m; i++) {
        int a,b;cin >> a >> b;
        a--,b--;
        uf.unite(a,b);
    }
    int ans = 0;
    for (int i = 0; i < n; i++) {
        if(uf.find(i) == i) chmax(ans, uf.size(i));
    }
    cout << ans << endl;
    return 0;
}





Measured memory_bytes: 4044
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long n,d,ans=0;
  cin>>n>>d;
  for(int i=0;i<n;i++){
  	long long x,y;
    cin>>x>>y;
    if(x*x+y*y<=d*d) ans++;
  }
	cout<<ans;
}

Measured memory_bytes: 3632
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
*this << "[";
for (auto it = d.b; it != d.e; ++it)
*this << ", " + 2 * (it == d.b) << *it;
ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int  long long int
#define pb push_back
#define fe first
#define lb lower_bound 
#define ub upper_bound
#define pii pair<pair<int,int>,pair<int,int> >
#define se second
#define endl "\n"
#define pi pair<int, int>
#define mi          map<int,int>
#define mii         map<pi,int>
#define vi vector<int> 
#define vvi vector<vi>
#define bs   binary_search
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,a,b) for(int i=a;i<=b;i++)	
#define all(c) (c).begin(),(c).end()
#define sz(x)       (int)x.size() 
#define PI 3.14159265358979323846

 const int N=5e5+5;

 int mod= 1e9+7;
 int dx[4]={0,0,+1,-1};
 int dy[4]={+1,-1,0,0};  
 
 
int po(int a, int b) {
	a %= mod;
	int res = 1;
	while (b > 0) {
		if (b & 1)
			res = (res * a) % mod;
		a =(a*a) % mod;
		b >>= 1;
	}
	 return res;	
   }


void solve() {
     int a,b,c;
     cin>>a>>b>>c;
     swap(a,b);
     swap(a,c);
     cout<<a<<" "<<b<<" "<<c<<endl; 
              
}

    
int32_t main() {
	cool;
	int t=1;	

	//cin>>t;
	while(t--)
	  solve();

  return 0;	   
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793

int main(){
    int n, a, b;
    cin >> n >> a >> b;
    int ans = 0;
    for(int i = 1; i <= n; i++){
        int tmp = i;
        int sd = 0;
        while(tmp){
            sd += tmp % 10;
            tmp /= 10;
        }
        if(sd >= a && sd <= b)
            ans += i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
// #pragma GCC optimize("no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma vector temporal
// #pragma simd
// #pragma GCC diagnostic ignored "-W"

#include<cassert>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<sstream>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<vector>
#include<utility>
#include<functional>
#include<complex>
#include<climits>

// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>

using namespace std;
// using namespace __gnu_pbds;

#define ll long long
#define ld long double
#define X first
#define Y second
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define vint vector<int>
#define SS stringstream
#define PQ priority_queue
#define MS(x,v) memset((x),(v),sizeof(x))
#define RZUNI(x) sort(x.begin(),x.end()), x.resize(unique(x.begin(),x.end())-x.begin())
#define FLH fflush(stdout)
#define CPPinput ios_base::sync_with_stdio(0); cin.tie(0)
#define FIN(fname) freopen(fname,"r",stdin)
#define FOUT(fname) freopen(fname,"w",stdout)

#define tm Ovuvuevuevue
#define y1 Enyetuenwuevue
#define left Ugbemugbem
#define ws Osas
#define dec tetteterette
#define exp expexpexpexp
#define expl explexplexpl

#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl

#ifdef WEAK
#include"/home/edison/Coding/cpp/template/debug.cpp"
#define DEB(...) printf(__VA_ARGS__),fflush(stdout)
#define WHR() printf("%s: Line %d",__PRETTY_FUNCTION__,__LINE__),fflush(stdout)
#define LOG(...) printf("%s: Line %d ",__PRETTY_FUNCTION__,__LINE__),printf(__VA_ARGS__),fflush(stdout)
#define DEBUG 1
#define exit(x) cout<<"exit code "<<x<<endl, exit(0)
#else
#define PDE(...) ;
#define DEB(...) ;
#define WHR() ;
#define LOG(...) ;
#define DEBUG 0
#endif

#define lowbit(x) ((x)&(-(x)))

#if __cplusplus >= 201103L
#include<unordered_map>
#include<unordered_set>
#include<tuple>
#endif

void JIZZ(string output=""){cout<<output; exit(0);}

const ld PI=3.14159265358979323846264338327950288;
const ld eps=1e-13;
const ll mod=1e9+7;

int a[104];

int main(){
    CPPinput;
    int n; cin>>n;
    for(int i=1;i<=n;++i)cin>>a[i];
    vector<int> g;
    for(int i=1;i<=n;++i)if(a[i]==a[i-1])++g.back(); else g.pb(1);
    int ans=0;
    for(int i:g){
        ans+=(i)/2;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <string>
#include <string.h>


using namespace std;

int main()
{
    int W, H, N;
    cin >> W >> H >> N;

    int x0 = 0;
    int y0 = 0;
    int x1 = W;
    int y1 = H;

    for (int i=0; i<N; ++i) {
        int x, y, a;
        cin >> x >> y >> a;
        switch(a) {
        case 1:
            x0 = min(max(x, x0), x1);
            break;
        case 2:
            x1 = max(min(x, x1), x0);
            break;
        case 3:
            y0 = min(max(y, y0), y1);
            break;
        case 4:
            y1 = max(min(y, y1), y0);
            break;

        }
    }
    int area = (x1-x0)*(y1-y0);
    cout << area << endl;
    return 0;
}

Measured memory_bytes: 256
from math import gcd
from functools import reduce

N, M, *A = map(int, open(0).read().split())

def lcm(x, y):
    return x * y // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

def even_count(n):
    res = 0
    while n % 2 == 0:
        res += 1
        n //= 2
    return res


x = [v // 2 for v in A]
if all(even_count(v) == even_count(x[0]) for v in x):
    num = lcm_list(x)
    print(-(-(M // num) // 2))
else:
    print(0)



Measured memory_bytes: 96876
#include <iostream>
 
using namespace std;
 
int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    if(a <= b && b <= c)
        cout << a << " " << b << " " << c << endl;
    else if(a <= c && c <= b)
        cout << a << " " << c << " " << b << endl;
    else if(b <= a && a <= c)
        cout << b << " " << a << " " << c << endl;
    else if(b <= c && c <= a)
        cout << b << " " << c << " " << a << endl;
    else if(c <= a && a <= b)
        cout << c << " " << a << " " << b << endl;
    else if(c <= b && b <= a)
        cout << c << " " << b << " " << a << endl;
}



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

using namespace std;

int main(){
   int N;
   cin >> N;
   if(N / 100 == 7 || (N % 100) / 10 == 7 || N %10 == 7)  cout << "Yes" << endl;
   else cout << "No" << endl;
   return 0;
}

Measured memory_bytes: 3672
#include<stdio.h>

int i,j,n,a[5],b[5];

int main(){
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
		scanf("\n%d %d %d",&a[0],&a[1],&a[2]);
		for(j=0;j<3;j++)b[j]=a[j]*a[j];
		if(b[0]==b[1]+b[2])printf("YES\n");
		else if(b[1]==b[2]+b[0])printf("YES\n");
		else if(b[2]==b[0]+b[1])printf("YES\n");
		else printf("NO\n");
	}
	
	return 0;
}

Measured memory_bytes: 0
N = int(input())
A = sorted(list(map(int, input().split())))
if N == 1:
    print(1)
elif A[0] == 1 and A[1] == 1:
    print(0)
elif A[0] == 1:
    print(1)
else:
    Eratos = [False]*1000001
    ans = 0
    for i in range(N):
        if Eratos[A[i]]:
            ans += 1
        else:
            if i < N-1 and A[i] == A[i+1]:
                ans += 1
            for j in range(A[i], 1000001, A[i]):
                Eratos[j] = True
    print(N-ans)

Measured memory_bytes: 32280
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const long long INF = 1LL << 60;

using namespace std;
using Edge = pair<int, long long>;
int N, M;
vector<vector<Edge>> G;

int main() {
    cin >> N >> M;
    G.clear(); G.resize(N);
    for (int i = 0; i < M; ++i) {
        int a, b; ll w;
        cin >> a >> b >> w; --a; --b;
        G[a].push_back(Edge(b, -w));
    }

    vector<ll> dist(N, INF);
    bool negative = false;
    dist[0] = 0;
    for (int iter = 0; iter <= N*2; ++iter) {
        for (int v = 0; v < N; ++v) {
            if (dist[v] >= INF / 2) continue;
            for (auto e: G[v]) {
                if (chmin(dist[e.first], dist[v] + e.second)) {
                    if (e.first == N - 1 && iter == N * 2) negative = true;
                }
            }
        }
    }

    if(!negative) cout << -dist[N-1] << endl;
    else cout << "inf" << endl;

}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main()
{
  string s, t;
  cin >> s >> t;
  sort(ALL(s));
  sort(ALL(t));
  reverse(ALL(t));
  if (s < t)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int x,y; 
	
	
	//x??¨y?????\????????¨??????0??????????????§x,y?????????
	
	while(true){
	
		scanf("%d %d",&x,&y);
		
		if(x == 0 && y == 0)
			break;
	
	
	
	//??§???????????????,?°???????????????????
		if(x < y){
			printf("%d %d\n",x,y);
		}
		else {
			printf("%d %d\n",y,x);
		}
	}
	
	return 0;
}

Measured memory_bytes: 2584
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

// #define rep(i,n) for(int i=0;i<(n);++i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define rrep(i,n) for(int i=(n);i>=0;--i)
const int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
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;}

// debug
template<class T>ostream& operator<<(ostream& os,const vector<T>& vec){os<<"{";for(int i=0;i<vec.size();++i)os<<(i?", ":"")<<vec[i];os<<"}";return os;}
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>& rhs){os<<"("<<rhs.first<<", "<<rhs.second<<")";return os;}

#ifdef LOCAL
void debug() {cerr << "\n";}
template<class First> void debug(const First& first) {cerr<<first<<"\n";}
template<class First, class... Rest> void debug(const First& first, const Rest&... rest) {cerr<<first<<",";debug(rest...);}
#else
#define debug(...) 42
#endif


int main() {
  string S; cin >> S;
  int N = S.size();
  rep(i, N) {
    if (S[i] != S[N-1-i]) {
      cout << "No\n";
      return 0;
    }
  }
  rep(i, N-(N+3)/2) {
    if (S[i+(N+3)/2-1] != S[N-1-i]) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int tmp=0;
int main(){
    int max_diff=0;
    int ans=0;
    int tmp=0;
    for(int i=0;i<5;i++){
        int A;
        cin>>A;
        if(A%10!=0){
            ans+=A-A%10+10;
            if(max_diff<10-A%10){
                max_diff=10-A%10;
                tmp=A;
            }
        }else{
            ans+=A;
        }
    }
    if(max_diff!=0){
        ans-=tmp-tmp%10+10;
        ans+=tmp;
    }
    cout<<ans<<endl;
    return 0;

}

Measured memory_bytes: 256
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


s = S()
n = len(s)
ans = 0
cnt = 0
before_cnt = 0
now = s[0]
for x in s:
    if now == x:  # 同じ不等号が連続しているとき
        cnt += 1
    else:  # 不等号が変わるとき
        ans += cnt * (cnt + 1) // 2
        if now == '>':  # > から < に変わるとき
            if before_cnt < cnt:
                ans -= before_cnt
            else:
                ans -= cnt

        before_cnt = cnt
        cnt = 1
        now = x

ans += cnt * (cnt + 1) // 2
if now == '>':
    if before_cnt < cnt:
        ans -= before_cnt
    else:
        ans -= cnt
print(ans)


Measured memory_bytes: 9976
#include <cstdio>

int n, m, beg, tag;
char s[412345];

int main() {
	scanf("%d%d%s", &n, &m, s + 1);
	beg = 1;
	for(;;) {
		if(!m || beg > n) {
			break;
		}
		--m;
		if((s[beg] == 'A') ^ tag) {
			s[beg] = 'B' - s[beg] + 'A';
		}
		else {
			++beg;
			tag ^= 1;
		}
	}
	if(tag) {
		for (int i = beg; i <= n; ++i) {
			s[i] = 'B' - s[i] + 'A';
		}
	}
	int End = beg + n;
	s[End] = 'B';
	for (int i = End - 1; i > n; --i) {
		s[i] = 'B' - s[i + 1] + 'A';
	}
	s[End] = 0;
	if(!m) {
		puts(s + beg);
		return 0;
	}
	if(n & 1) {
		if(m & 1) {
			s[beg] = 'B';
		}
	}
	puts(s + beg);
	return 0;
}

Measured memory_bytes: 768
#include<cstdio>
#include<iostream>
#include<math.h>
using namespace std;
int main(void){
	int n,gin,kinri,i,m,maxgin;
	double y,nenri,ganri,max,d;
	while(1){
		m=10000;
		cin>>n;
		if(n==0) break;
		cin>>y;
		max=-1;
		for(i=0;i<n;i++){
			cin>>gin>>nenri>>kinri;
			if(kinri==1) ganri=m*(1+y*(nenri/100));
			if(kinri==2){
				d=(1+nenri/100);
				d=pow(d,y);
				ganri=m*d;
			}
			if(max<ganri){
				max=ganri;
				maxgin=gin;
			}
		}
		cout<<maxgin<<endl;
	}
	return 0;
}

Measured memory_bytes: 3440
#include "bits/stdc++.h"
using namespace std;
int main() {
	int n, k;
	cin>>n>>k;
	vector<int>x(n);for(auto &v : x)cin >> v;
	int ans = INT_MAX;
	for (int l = 0; l <= n - k; l++) {
		int r = l + k - 1;
		ans = min(ans, x[r] - x[l] + min(abs(x[l]), abs(x[r])));
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
typedef pair<int, int>P;
typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll MOD = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 5010;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)
//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };
ll dp[101010];

//union-find木について
ll par[101010];
ll rank2[101010];

void init(ll n) {
	rep(i, n) {
		par[i] = i;
		rank2[i] = 0;
	}
}

ll find(ll x) {
	if (par[x] == x) {
		return x;
	}
	else {
		return par[x] = find(par[x]);
	}
}

void unite(ll x, ll y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (rank2[x] < rank2[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if (rank2[x] == rank2[y]) {
			rank2[x]++;
		}
	}
}

long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

char c[2010][2010];
bool flag[2010][2010];
ll cnt[2010][2010];

//long longしか使わない
//素数は1より大きい
int main() {
	ll n;
	cin >> n;
	vector<ll>a(n);
	ll minus = 0;
	ll plus = 0;
	rep(i, n) {
		cin >> a[i];
		if (a[i] > 0)plus++;
		else if (a[i] < 0)minus++;
	}
	if (minus % 2 == 0) {
		ll total = 0;
		rep(i, n) {
			total += abs(a[i]);
		}
		cout << total << endl;
	}
	else {
		vector<ll>total;
		rep(i, n) {
			total.push_back(abs(a[i]));
		}
		sort(total.begin(), total.end());
		ll ans = -1 * total[0];
		for (ll i = 1;i < n;++i) {
			ans += total[i];
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 2168
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int top,S[1000];

void push(int x){
    S[++top]=x;
}

int pop(){
    return S[top--];
}

int main(){
    int a,b;
    top=0;
    char s[100];
    while(scanf("%s",s)!=EOF){
        if(s[0]=='+'){
            a = pop();
            b = pop();
            push(b+a);
        }
        else if(s[0]=='-'){
            a = pop();
            b = pop();
            push(b-a);
        }
        else if(s[0]=='*'){
            a = pop();
            b = pop();
            push(b*a);
        }
        else push(atoi(s));
    }
    
    printf("%d\n",pop());
    //printf("%d %d ",S[1],S[2]);
    
    return 0;
}



Measured memory_bytes: 2104
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <cstring>
#include <iostream>
#include <algorithm>

#define fi first
#define se second
#define pb push_back
#define MP std::make_pair
#define PII std::pair<int, int>
#define all(x) (x).begin(), (x).end()
#define CL(a, b) memset(a, b, sizeof a)
#define rep(i, l, r) for (int i = (l); i <= (r); ++ i)
#define per(i, r, l) for (int i = (r); i >= (l); -- i)
#define PE(x, a) for (int x = head[a]; x;x = edge[x].next)

typedef long long ll;
#define int long long

ll n;

signed main() {
	scanf("%lld", &n);
	ll ans = LLONG_MAX;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0) {
			int j = n / i;
			ans = std::min(ans, i + j - 2);
		}
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << "\n";
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (int i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    ll x, k, d;
    cin >> x >> k >> d;

    x = abs(x);

    ll c = abs(x) / d;

    if (k >= c) {
        x %= d;
        if ((k - c) % 2 == 1) print(abs(d - x));
        else print(abs(x));
    } else {
        print(abs(x) - k * d);
    }
    
}


Measured memory_bytes: 3616
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
char a[100],b[100];
int main()
{
	int r=0;
	scanf("%s",a);
	for(int i=0;i<strlen(a);i++){
        if(a[i]=='0'||a[i]=='1'){
            b[r]=a[i];
            r++;
        }
        else
            r--;
        if(r<0)
            r=0;
	}
//	printf("%s",a);
//	printf("%d\n",r);
	for(int i=0;i<r;i++){
        printf("%c",b[i]);
	}
	printf("\n");
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
  string S, T;
  cin >> S >> T;
  int ans = 0;
  for (int i = 0; i < S.size(); ++i) {
   if (S[i] != T[i]) ++ans; 
  }
  cout << ans;
  return 0;
}

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

int main (){
    string K;
    int S;
    cin >> S >> K;
    int size = K.size();
    if(size <= S){
        cout << K << endl;
    }
    else{
        for(int i = 0; i < S ;i++){
            cout << K.at(i);
        }
        cout << "..." << endl;
    }
}

Measured memory_bytes: 3576