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

using namespace std;

int main(){
	string s;
	while(cin >> s, s != "#"){
		vector<string> v;
		for(unsigned long long S = 0; S < (1<<s.size()); S++){
			if(s[0] != 'a' && !(S >> s.size()-1 & 1)) continue;
			bool possible = true;
			bool used[26] = {0};
			used[0] = true;
			string t = s;

			for(int j=0; j < s.size(); j++){
				if(S >> j & 1){
					if(t[s.size()-j-1] == 'z'){possible = false; break;}
					t[s.size()-j-1]++;
				}
			}
			if(!possible) continue;
			string p = t;
			for(int j=0; j < t.size(); j++) if(!used[t[j]-'a']){used[t[j]-'a'] = true; t[j]--;}
			if(s == t) v.push_back(p);
		}
		cout << v.size() << endl;
		if(v.size() <= 10){
			for(int i=0; i < v.size(); i++) cout << v[i] << endl;
		}
		else {
			for(int i=0; i < 5; i++) cout << v[i] << endl;
			for(int i=v.size()-5; i < v.size(); i++) cout << v[i] << endl;
		}
	}
}

Measured memory_bytes: 2348
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <map>
#include <utility>
#include <vector>
using namespace std;

#define FOR(it,c) for(__typeof((c).begin())it=(c).begin(); it!=(c).end();++it)

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

	int n, m;
	cin >> n >> m;

	map<int, vector<int> > treasure;

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

	vector<int> prev = treasure.rbegin()->second;
	map<int, vector<int> >::reverse_iterator rit = treasure.rbegin();
	++rit;
	while(rit != treasure.rend()) {
		vector<int>& cur = rit->second;
		for(int i = 0; i < prev.size(); ++i)
			cur.push_back(prev[i]);

		prev = rit->second;
		++rit;
	}

	FOR(it, treasure)
		sort(it->second.begin(), it->second.end());

	treasure.insert(make_pair(1000000001, vector<int>()));
	for(int i = 0; i < m; ++i) {
		int x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;

		const vector<int>& v1 = treasure.lower_bound(x1)->second;
		const vector<int>& v2 = treasure.upper_bound(x2)->second;

		int num1 = upper_bound(v1.begin(), v1.end(), y2) - lower_bound(v1.begin(), v1.end(), y1);
		int num2 = upper_bound(v2.begin(), v2.end(), y2) - lower_bound(v2.begin(), v2.end(), y1);
		cout << num1 - num2 << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 87332
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
char s[1210][1210];
int main() {
	int r = 0;
	while(1) {
		if(scanf("%s", s[r]) == EOF) break;
		++r;
	}

	rep(i,r) {
		for(int j = 0; s[i][j] != '\0'; ++j) {
			int c = s[i][j] - 'a';
			int d = s[i][j] - 'A';
			if(c >= 0 && c < 26) {
				cout << (char) ('A' + c);
			} else if(d >= 0 && d < 26) {
				cout << (char) ('a' + d);
			} else cout << s[i][j];
		}
		if(i != r - 1) cout << " ";
	}
	cout << endl;
 	return 0;
}

Measured memory_bytes: 1360
using System;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
using System.Collections.Specialized;
using System.IO.Pipes;

namespace ConsoleC____
{
    
    class Program
    {
        static long beki(long a, long b)
        {
            long ans = 1;
            for (long i = 0; i < b; i++) ans *= a;
            return ans;
        }
        static void Main()
        {
            long N = long.Parse(Console.ReadLine());
            //N--;
            //long N2 = N;
            //Console.WriteLine(N);
            long ketasu = 1;
            long i;
            char[] alphabet = new char[27];
            for (long j = 0; j < 26; j++) alphabet[j] = (char)('a' + j);
            //alphabet[0] = 'z';
            //char[] ans = new char[10010];
            for (i = 26; ;i *= 26)
            {
                //ketasu++;
                if (N - i > 0)
                {
                    //ans[ketasu] = alphabet[((N - 1) % i)];
                    N -= i;
                    //Console.WriteLine("N:" + N);
                    //Console.WriteLine("i:" + i);
                    ketasu++;
                }
                else
                {
                    //ans[ketasu] = alphabet[((N - 1) % i)];
                    //Console.WriteLine("break!");
                    //Console.WriteLine("N:" + N);
                    //Console.WriteLine("i:" + i);
                    break;
                }
            }
            //for (long j = 0; j < ketasu; j++) Write(ans[ketasu - 1 - j]);
            
            long tmp;
            //char[] ans = new char[10010];
            char[] ans = new char[ketasu];
            N--;
            for (long j = 0; j < ketasu; j++)
            {
                //N2 += j;
                tmp = N % 26;//beki(26, j);
                //Console.WriteLine(alphabet[tmp]);
                ans[ketasu - 1 - j] = alphabet[tmp];
                N /= 26;//beki(26, j);
            }
            for (long j = 0; j < ketasu; j++)
            {
                Write(ans[j]);
            }
        }
    }
}

Measured memory_bytes: 17640
N, M = map(int, input().split())
switches = [list(map(int, input().split())) for _ in range(M)]
p = list(map(int, input().split()))
ans = 0
onofflist = [format(i,'0'+str(N)+'b') for i in range(2**N)]
for onoff in onofflist:
    flag=True
    for i,swittch in enumerate(switches):
        cur = 0
        for s in swittch[1:]:
            cur += int(onoff[s-1])
        if cur % 2 != p[i]:
            flag=False
    if flag:
        ans+=1
print(ans)

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

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

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

  long long sum = 0;

  for (int a = 1; a <= N; a++) {
    for (int b = 1; b <= N; b++) {
      int t = gcd(a, b);
      for (int c = 1; c <= N; c++) {
        sum += gcd(t, c);
      }
    }
  }

  cout << sum << endl;

  return 0;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll; 
typedef pair<int, int> pii; 
typedef pair<ll, ll> pll; 
typedef pair<string, string> pss; 
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef vector<pii> vii; 
typedef vector<int, pii> viii; 
typedef vector<pll> vll; 
typedef vector<ll> vl; 
typedef vector<vl> vvl; 
typedef vector<vector<vl>> vvvl; 
const ll MAXN = 1000500;
vector<ll>spf(MAXN+1); 
ll gcd1(ll a, ll b) { 
    if (b == 0) 
        return a; 
    return gcd1(b, a % b);  
} 
void sieve() { 
    for (ll i=1; i<MAXN; i++) 
        spf[i] = i; 
    for (ll i=2; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (ll i=3; i*i<MAXN; i++) { 
        if (spf[i] == i) { 
            for (ll j=i; j<MAXN; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} 
vector<ll> getFactorization(ll x) { 
    vector<ll> ret; 
    ll count=0;
    while (x != 1) { 
        if(count==0 || ret[count-1]!=spf[x]){
            ret.push_back(spf[x]); 
            count++;
        }
        x = x / spf[x]; 
    } 
    return ret; 
} 

int main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout); 
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ; cout.tie(NULL);
    ll n,m,i,j,k;
    cin>>n;
    vector<int>a(n);
    for(i=0;i<n;i++)cin>>a[i];
    vector<ll>mark(1e6+500,0);
    ll flag=1;
    sieve();
    for(i=0;i<n;i++){
        vl p = getFactorization(a[i]);
        ll k=p.size();
        for(j=0;j<k;j++){
            if(mark[p[j]]==0)mark[p[j]]=1;
            else {
                flag=0;
            }
        }
    }
    if(flag)cout<<"pairwise coprime";
    else {
        ll gcd=a[0];
        for(i=1;i<n;i++){
            gcd = gcd1(gcd, a[i]);
        }
        if(gcd==1)cout<<"setwise coprime";
        else cout<<"not coprime";
    }
    return 0;
}


Measured memory_bytes: 22720
#include<bits/stdc++.h>
using namespace std;
bool t[1000];
int main(){
	int a,b,c,cnt=0;
	cin>>a>>b>>c;
	t[a]=true;t[b]=true;t[c]=true;
	for(int i=1;i<=100;i++){
		if(t[i]==true) cnt++;
	}
	cout<<cnt;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){

int r,g,b,k;

scanf("%d %d %d %d",&r,&g,&b,&k);

int count=0;

while(1){
  if(g>r){
    break;
  }else{
    count++;
  g=g*2;
}
}

while(1){
if(b>g){
  break;
}else{
  count++;
  b=b*2;
}
}

if(k>=count){printf("Yes");}
if(k<count){printf("No");}

return 0;
}

Measured memory_bytes: 1732
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        
        // n (10^12以下なら高速)
        long count = sc.nextLong();
        long n = sc.nextLong();
        
        // map: nの素因数の頻度 (60 => (2 -> 2, 3 -> 1, 5 -> 1)
        // list: nの素因数のリスト (60 => [2, 2, 3, 5])
        Map<Long, Integer> map = new HashMap<Long, Integer>();
        List<Long> list = new ArrayList<Long>();
        long m = n;
        for (long i = 2; (i * i) <= n; i++) {
            int cnt = 0;
            
            while ((m % i) == 0) {
                cnt++;
                m /= i;
                list.add(i);
            }
            
            if (cnt > 0) {
                map.put(i, cnt);
            }
        }
        if (m > 1) {
            map.put(m, 1);
            list.add(m);
        }
        
        long ans = 1;
        for (Long key : map.keySet()) {
            int val = map.get(key);
            // System.out.println(key + " " + val);
            
            // if (val >= count) {
                for (int i = 0; i < val /count; i++) {
                    ans *= key;
                }
            // }
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 37824
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,x); REP(i,sizeof(a)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}

int main(){
  int X,Y,Z; cin>>X>>Y>>Z;
  printf("%d %d %d\n",Z,X,Y);
  

}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
int main()
{
    int l[5];
    rep(i, 5) scanf("%d", &l[i]);
    int k;
    scanf("%d", &k);
    rep(i, 5)
    {
        rep(j, 5)
        {
            if (abs(l[i] - l[j]) > k)
            {
                printf(":(\n");
                return 0;
            }
        }
    }
    printf("Yay!\n");
    return 0;
}

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

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define nfor(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define fore(i, l, r) for (int i = int(l); i < int(r); i++)
#define correct(x, y, n, m) (0 <= (x) && (x) < (n) && 0 <= (y) && (y) < (m))
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())
#define pb(a) push_back(a)
#define mp(x, y) make_pair((x), (y))
#define x first
#define y second

using namespace std;

typedef long long li;
typedef long double ld;
typedef pair<int, int> pti;

template<typename X> inline X abs(const X& a) { return a < 0? -a: a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

template<typename A, typename B> inline ostream& operator<< (ostream& out, const pair<A, B>& p) { return out << "(" << p.x << ", " << p.y << ")"; }
template<typename T> inline ostream& operator<< (ostream& out, const vector<T>& a) { out << "["; forn(i, sz(a)) { if (i) out << ','; out << ' ' << a[i]; } return out << " ]"; }
template<typename T> inline ostream& operator<< (ostream& out, const set<T>& a) { return out << vector<T>(all(a)); }
template<typename X, typename Y> inline ostream& operator<< (ostream& out, const map<X, Y>& a) { return out << vector<pair<X, Y>>(all(a)); }
template<typename T> inline ostream& operator<< (ostream& out, const pair<T*, int>& a) { return out << vector<T>(a.x, a.x + a.y); }

inline ld gett() { return ld(clock()) / CLOCKS_PER_SEC; }

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-9, PI = 3.1415926535897932384626433832795;

#ifdef SU1
//#define GEN
#ifndef GEN
#define LOG
#endif
#endif

const int N = 100100;

int n, a[N];

bool read() {
  if (!(cin >> n)) return false;
  forn(i, n) assert(scanf("%d", &a[i]) == 1);
  return true;
}

int cnt[4];

void solve() {
  memset(cnt, 0, sizeof(cnt));
  forn(i, n) cnt[a[i] % 4]++;

  int need = cnt[1] + cnt[3] + (cnt[2] > 0);
  need--;
  puts(cnt[0] >= need ? "Yes" : "No");
}

int main() {
#ifdef SU1
  assert(freopen("input.txt", "rt", stdin));
  //assert(freopen("output.txt", "wt", stdout));
#endif

  cout << setprecision(10) << fixed;
  cerr << setprecision(5) << fixed;

  while (read()) {
    ld stime = gett();
    solve();
#ifdef SU1
    cerr << "Time: " << gett() - stime << endl;
#endif
    //break;
  }

  return 0;
}


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

using namespace std;

int main(){
  int a[3] = {};
  int n;
  int temp;
  cin >> n;
  for( int i = 0; i < n; ++i){
    cin >> temp;
    if( temp%4 == 0){
      ++a[0];
    }else if( temp%2 == 0){
      ++a[1];
    }else{
      ++a[2];
    }
  }
  if( (a[2]-a[0] <= 1 && a[1] == 0) ||(a[1] > 0 && a[2]-a[0] <= 0 )){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	private static int pgcd(int m, int n, int l) {
		int pgcd =0;
		int reste = 0;
		 while(n!=0)
	        {
	            reste=m%n;
	            m=n;
	            n=reste;
	        }
		 while(l !=0) {
			 reste = m%l;
			 m=l;
			 l=reste;
		 }
		return m;
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int somme = 0;
		for(int i = 1; i <= n ;i ++) {
			for(int j = 1 ; j <= n;j++) {
				for(int k=1; k<= n;k++) {
					somme+= pgcd(i,j,k);
				}
			}
		}
		System.out.println(somme);
	}

}


Measured memory_bytes: 35824
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
#define REP(i, n) for ( int i = 0; i < (n); i++ )
 
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);

  int N;
  cin >> N;

  string S;
  cin >> S;

  vector<int> X(26, 0), Y(26, 0);
  REP(i, N) Y[S[i]-'a']++;

  int ans = 0;
  REP(i, N) {
    int now = 0;
    X[S[i]-'a']++;
    Y[S[i]-'a']--;
    REP(j, 26) if ( X[j] && Y[j] ) now++;
    ans = max(ans, now);
  }

  cout << ans << endl;
  
  return 0;
}


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

using namespace std;

int N;
vector<long> H;

void solve();
void printAns(bool enable);

int main() {
  cin >> N;
  H.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> H[i];
  }
  solve();
}

void printAns(bool enable) {
  if (enable) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

void solve() {
  bool enable = true;
  reverse(H.begin(), H.end());
  for (int i = 0; i < N - 1; i++) {
    if (H[i] >= H[i + 1]) {
      continue;
    }

    H[i + 1]--;

    if (H[i] >= H[i + 1]) {
      continue;
    } else {
      enable = false;
      break;
    }
  }
  printAns(enable);
}

Measured memory_bytes: 1024
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
const ll INF = 1LL << 62;

int main() {
  //
  ll n;
  cin >> n;
  map<ll, ll> mp;
  rep(i, n) {
    ll a;
    cin >> a;
    if (mp.find(a) == mp.end()) {
      mp[a] = 1;
    } else {
      mp[a]++;
    }
  }
  vl b;
  for (auto& x : mp) {
    b.push_back(x.second);
  }
  sort(ALL(b));
  vl s(b.size(), 0);
  s[0] = b[0];
  REP(i, 1, s.size()) {
    s[i] = s[i - 1] + b[i];
    // cerr << b[i] << "," <<s[i] << endl;
  }
  REP(k,1,n+1) {
    ll m = 0;
    ll M = s[s.size()-1] / k + 1;
    while (M - m > 1) {
      ll mid = (m + M) / 2;
      // OK?
      // cerr <<"#"<< k << ":" << m << M << endl;
      vl::iterator it = upper_bound(ALL(b), mid);
      int i = it - b.begin();
      ll bsum = 0;
      if (i > 0) {
        bsum += s[i-1];
      }
      bsum += mid * (b.size() - i);
      // cerr << "!"<<i << "," << bsum << endl;
      if (bsum >= mid * k) {
        m = mid;
      } else {
        M = mid;
      }
    }
    cout << m << endl;
  }
  return 0;
}


Measured memory_bytes: 24044
N = int(input())
P = list(map(float,input().split()))

dp = [0] * (N + 1)
dp[0] = 1

for i in range(len(P)):
  for j in range(len(dp) - 1, -1, -1):
    if j != 0:
      dp[j] = dp[j] * (1 - P[i]) + dp[j - 1] * P[i]
    else:
      dp[j] = dp[j] * (1 - P[i])
      
ans = 0
for i in range(N // 2 + 1, len(dp)):
  ans += dp[i]
  
print(ans)

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

string s, t;

int main() {
	ios::sync_with_stdio(0);
	cin >> s >> t;

	int lens = s.size(), lent = t.size();
	if(lent - lens == 1) {
		bool ok = true;
		for(int i = 0; i < lens; i++)
			if(s[i] != t[i]) ok = false;
		if(ok) {
			cout << "Yes";
			return 0;
		}
	}
	cout << "No";
	return 0;
}

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

#define fio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
#define sortv(v) sort(v.begin(),v.end());
#define sorta(a,n) sort(a,a+n);
#define arrayin(a,n) for(int i=0;i<n;i++) cin>>a[i];
#define arrayout(a,n) for(int i=0;i<n;i++) cout<<" ";cout<<"\n";
#define whatIs(x) cout<<#x<<" is "<<x<<endl;
#define fillA(a,value) memset(a,value,sizeof(a));
#define len(s) s.length()
#define reached cout<<"reached "<<endl;
#define INF INT_MAX //Infinity
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define MOD 1000000007
#define fi first
#define se second
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define vi64 vector<lli>
#define viii vector<tuple<int,int,int>>
#define prq priority_queue<int>
#define mii map<int,int>
#define msi multiset<int>
#define nl "\n"
#define sii set<int,int>
#define sz size

typedef long long int lli;
typedef unsigned long long int ulli;
typedef double ld;

using namespace std;

int main()
{
	fio;
	/*int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
	}*/
	int n;
	cin>>n;
	map<lli,int> m;
	REP(i,n)
	{
		lli x;
		cin>>x;
		m[x]++;
	}
	lli largest=0;
	int f=0;
	for(auto x:m)
	{
		if(x.se>1)
		{
			if(x.fi>largest)
			{
				f=1;
				largest=x.fi;
			}
		}
	}
	if(m[largest]>=4)
	{
		cout<<largest*largest<<endl;
	}
	else
	{
		int flag=0;
		lli selargest=0;
		for(auto x:m)
		{
			if(x.se>1)
			{
				if(x.fi>selargest&&x.fi!=largest)
				{
					flag=1;
					selargest=x.fi;
				}
			}
		}
		cout<<largest*selargest<<endl;
	}
	return 0;
}

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

class Abc143b
{
    static int n;
    static List<int> d;

    static void Scan()
    {
        n = int.Parse(Console.ReadLine());
        d = Console.ReadLine().Split().ToList().ConvertAll(int.Parse);
    }

    static void Main(string[] args)
    {
        Scan();
        var sum = 0;
        for(var i = 0; i != n - 1; ++i) {
            for(var j = i + 1; j != n; ++j) {
                sum += d[i] * d[j];
            }
        }
        System.Console.WriteLine(sum);
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
typedef  long long ll;
int gcd(int f , int s){if(s==0)return f;else return gcd(s,f%s);}
int const N = 1000006;
ll const M = 998244353;
long double const ep = .000000000000000001;
int frqA[N] , frqB[N];
vector<int>G[N];
bool vis[N];
string s;
deque<int>q;
void del(int node){
	for(int i = 0 ; i < G[node].size() ; i++){
		int el = G[node][i];
		if(s[node]=='A')frqA[el]--;
		else frqB[el]--;
		if((frqA[el]==0||frqB[el]==0)&&!vis[el]){q.push_back(el);vis[el]=1;}
	}
}
int main() {
	
	int a , e;
	scanf("%d%d", &a , &e);
	cin >> s;
	s = "1"+s;
	for(int i = 0 ; i < e ; i++){
		int t , t1;
		cin >> t >> t1;
		G[t].pb(t1);
		G[t1].pb(t);
		if(t == t1){
			if(s[t]=='A')frqA[t]++;
			else frqB[t]++;
		}else {
			if(s[t]=='A')frqA[t1]++;
			else frqB[t1]++;
			if(s[t1]=='A')frqA[t]++;
			else frqB[t]++;
		}
	}
	for(int i = 1 ; i <= a ; i++)
		if(frqA[i] == 0 || frqB[i] == 0){q.push_back(i);vis[i]=1;}
	while(!q.empty()){
		del(q.front());
		q.pop_front();
	}
	for(int i = 1 ; i <= a; i++){
		if(!vis[i]){printf("Yes\n");return 0;}
	}
	printf("No\n");
	return 0;	
}

Measured memory_bytes: 36168
import sys
import heapq
sys.setrecursionlimit(10 ** 8)

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N, M, K = ZZ()
    A = ZZ()
    B = ZZ()
    k = 0
    for i in range(N):
        if k + A[i] <= K: k += A[i]
        else: break
    else: i += 1
    ans = i
    for j in range(M):
        if k + B[j] <= K: k += B[j]
        else: break
    else: j += 1
    ans += j
    for ii in range(1, i+1):
        k -= A[i-ii]
        while j < M and k + B[j] <= K:
            k += B[j]
            j += 1
        ans = max(ans, i+j-ii)
    print(ans)

    return

if __name__ == '__main__':
    main()


Measured memory_bytes: 119212
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int l=0;
    int ret=0;
    for(char c: S.toCharArray()){
      switch(c){
        case 'A':
        case 'T':
        case 'C':
        case 'G':
          l++; break;
        default:
          l=0;
      }
      ret = Math.max(ret, l);
    }
    System.out.println(ret);
  }
}

Measured memory_bytes: 21844
def route_x(sx, tx):
    dx = tx - sx
    dx2 = dx if dx >= 0 else -dx
    buf = "R"*dx2 if dx >= 0 else "L"*dx2
    return buf

def route_y(sy, ty):
    dy = ty - sy
    dy2 = dy if dy >= 0 else -dy
    buf = "U"*dy2 if dy >= 0 else "D"*dy2
    return buf

def route(sx, sy, tx, ty):
    return route_x(sx, tx) + route_y(sy, ty)

def route2(sx, sy, tx, ty):
    dx = tx - sx
    dy = ty - sy
    if dx >= 0 and dy >= 0:
        buf = "L" + route_y(sy, ty+1) + route_x(sx-1, tx) + "D"
    if dx >= 0 and dy < 0:
        buf = "U" + route_x(sx, tx+1) + route_y(sy+1, ty) + "L"
    if dx < 0 and dy >= 0:
        buf = "D" + route_x(sx, tx-1) + route_y(sy-1, ty) + "R"
    if dx < 0 and dy < 0:
        buf = "R" + route_y(sy, ty-1) + route_x(sx+1, tx) + "U"
    return buf

if __name__ == "__main__":
    sx, sy, tx, ty = [int(i) for i in input().split()]
    r1 = route(sx, sy, tx, ty) + route(tx, ty, sx, sy)
    r2 = route2(sx, sy, tx, ty) + route2(tx, ty, sx, sy)
    print(r1 + r2)

Measured memory_bytes: 3188
import Text.Printf

main :: IO()
main = do
  input <- getLine
  let [a,b] = map (\x -> read x :: Int) $ words input
  putStrLn $ "a " ++ judge a b ++ " b"

judge :: Int -> Int -> String
judge a b
      | a > b  = ">"
      | a == b = "=="
      | a < b = "<"

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

int main(void){
    int n;
    cin >> n;
    vector<int> vec1(n), vec2(n);
    for(int i=0; i<n; i++){
        cin >> vec1.at(i);
        vec2.at(i) = vec1.at(i);
    }

    sort(vec2.begin(), vec2.end());

    for(int i=0; i<n; i++){
        if(vec1.at(i) <= vec2.at(n/2-1)){
            cout << vec2.at(n/2) << endl;
        }else{
            cout << vec2.at(n/2-1) << endl;
        }
    }
    
    return 0;
}


Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
#define mod 998244353

#define MAX_N 3000010
long long inv[MAX_N];
long long factorial[MAX_N];
long long inv_factorial[MAX_N];

void GetInv(){
    for (int i = 1; i < MAX_N; i++) {
        if (i == 1) inv[i] = 1;
        else {
            inv[i] = (mod - (mod / i) * inv[mod % i]) % mod;
            if (inv[i] < 0) inv[i] += mod;
        }
    }
}
void GetFactorial(){
    factorial[0] = 1; inv_factorial[0] = 1;
    for (int i = 1; i < MAX_N; i++) {
        factorial[i] = factorial[i-1] * i;
        factorial[i] %= mod;
        inv_factorial[i] = inv_factorial[i-1] * inv[i];
        inv_factorial[i] %= mod;
    }
}

long long combination(int n, int r) {
    if (n-r < 0) return 0;
    assert(max(n, r) < MAX_N);
    long long ret = factorial[n] * inv_factorial[r];
    ret %= mod;
    ret *= inv_factorial[n-r];
    return ret % mod;
}

long long modpow(int n, int r) {
    long long ret = 1; long long tmp = (long long) n;
    while (r != 0) {
        if (r % 2) ret *= tmp;
        tmp *= tmp; tmp %= mod; ret %= mod;
        r /= 2;
    }
    return ret;
}

int solve(int n, int m) {
    GetInv(); GetFactorial();
    long long all = combination(3*m+n-1, n-1);
    long long sub = 0;
    for (int k = m+1; k <= n; k++) {
        if (k > n) break;
        int remain = 3*m - k;
        if (remain < 0) continue;
        if (remain % 2 != 0) continue;
        long long tmp = combination(n, k);
        tmp = tmp * combination(remain/2 + n-1, n-1) % mod;
        sub = (sub + tmp) % mod;
    }
    long long sub2 = 0;
    for (int k = 2 * m+1; k <= 3*m; k++) {
        int remain = 3*m - k;
        if (remain < 0) continue;
        long long tmp = combination(remain+n-2, n-2) * n % mod;
        sub2 = (sub2 + tmp) % mod;
    }
    cout << (all + mod * 2 - sub - sub2) % mod << endl;
    return 0;
}

int main() {
    int n, m; cin >> n >> m;
    solve(n, m);
    return 0;
}

Measured memory_bytes: 70528
#include <bits/stdc++.h>
using namespace std;
string solve()
{
    int N;
    cin>>N;
    int last = 1;
    for(int i=2; i*i<=N; i++){
        if(N%i==0){
            last = i;
        }
    }
    N = N/last;
    if(N>9 || last>9)return "No";
    return "Yes";
}
int main()
{
    cout << solve() << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip> //! for setprecision(10)
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>
#include <limits.h>

using namespace std;

typedef long long LL;

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define dumpMap(m) { for (auto it: m) cout << it.first << "=>" << it.second << ' '; }

const int MOD = 1000000007;

const int MAXN = 100000;
int dpa[MAXN+1];
int dpb[MAXN+1];
int dpc[MAXN+1];
int a[MAXN+1];
int b[MAXN+1];
int c[MAXN+1];

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(0);
    
    int N;
    cin >> N;
    for (int i = 1; i <= N; ++i) {
        cin >> a[i] >> b[i] >> c[i];
    }

    dpa[1] = a[1];
    dpb[1] = b[1];
    dpc[1] = c[1];

    for (int i = 2; i <= N; ++i) {
        dpa[i] = max(dpb[i-1], dpc[i-1]) + a[i];
        dpb[i] = max(dpc[i-1], dpa[i-1]) + b[i];
        dpc[i] = max(dpa[i-1], dpb[i-1]) + c[i];
    }

    cout << max(dpa[N], max(dpb[N], dpc[N])) << endl;

    return 0;
}


Measured memory_bytes: 2560
a,b,c  = map(int, input().split())
INF = 10**4
cnt = 0
while a%2==0 and b%2==0 and c%2==0:
    # print(cnt)
    if cnt == INF:
       print(-1)
       exit()
    x = a + (b+c)//2
    y = b + (c+a)//2
    z = c + (a+b)//2
    a,b,c = x,y,z
    cnt+=1
print(cnt)

Measured memory_bytes: 3064
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
#include<limits.h>
#include<unordered_map>
#include<unordered_set>
#include<deque>
#include<cstdio>
using namespace std;
typedef long long int ll;
const int N = 1000000;
const int mod = 1000000007;
const int INF = 1 << 30;
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
#define rep(i,n) for(ll i=(ll)0;i<(ll)n;++i)
#define vin(v,n) rep(i,n)cin>>v[i];
#define ALL(x) x.begin(),x.end()
#define pp pair<ll,ll>
#define sz size()
#define fi first
#define se second
#define pb push_back
#define prquete priority_queue<ll,vector<ll>,greater<ll>>
string YN(bool b) { return(b ? "YES" : "NO"); }
string yn(bool b) { return(b ? "Yes" : "No"); }
ll h, w;
char v[55][55];
bool b=1;
int main(){
	cin >> h >> w;
	rep(i, h)rep(j, w)cin >> v[i][j];
	rep(i, h) {
		rep(j, w) {
			int n = 0;
			if (v[i][j] == '#') {
				if (i > 0 && v[i - 1][j] == '#')++n;
				if (i < h - 1 && v[i + 1][j] == '#')++n;
				if (j > 0 && v[i][j - 1] == '#')++n;
				if (j < w - 1 && v[i][j + 1] == '#')++n;
				if (n == 0) {  b = 0; break; }
			}
		}
		if (!b)break;
	}
	cout << yn(b) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define rrep(i, a, b) for (int i = (a); i < (b); ++i)
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using tl = tuple<ll, ll, ll>;

template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
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; }

ll INF = 1001001001;
ll LINF = 1001001001001001001ll;

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

    ll x, n; cin>>x>>n;
    vl ps(n); cin>>ps;

    vector<bool> used(102);
    rep(i, n) used[ps[i]] = true;
    ll m = LINF;
    ll ans = 0;
    rep(i, 102) {
        if (!used[i] && chmin(m, abs(x - i))) ans = i;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
#ifdef LOCAL_DEBUG
#define DEBUG 1
#define CERR if(DEBUG) cerr
#define MACRO(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,NAME,...) NAME
#define pr(...) CERR<<MACRO(__VA_ARGS__,pr10,pr9,pr8,pr7,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__)<<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
#define pr9(a,b,c,d,e,f,g,h,i) pr1(a)<<pr8(b,c,d,e,f,g,h,i)
#define pr10(a,b,c,d,e,f,g,h,i,j) pr1(a)<<pr9(b,c,d,e,f,g,h,i,j)
#define prArr(a){CERR<<(#a)<<"={";int i=0;for(auto t:(a))CERR<<(i++?", ":"")<<t;CERR<<"}"<<endl;}
#else
#define DEBUG 0
#define pr(...)
#define prArr(a)
#endif
using namespace std;
using Int = long long;
using _int = int;
using ll = long long;
using Double = long double;
const Int INF = (1LL<<60)+1e9; // ~ 1.15 * 1e18
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template<class T1, class T2> ostream& operator<<(ostream& o,pair<T1,T2> p){return o<<"("<<p.first<<","<<p.second<<")";}
template<class T1, class T2, class T3> ostream& operator<<(ostream& o,tuple<T1,T2,T3> t){return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
template<class T1, class T2> istream& operator>>(istream& i,pair<T1,T2> &p){return i>>p.first>>p.second;}
template<class T> ostream& operator<<(ostream& o,vector<T> a){Int i=0;for(T t:a)o<<(i++?" ":"")<<t;return o;}
template<class T> istream& operator>>(istream& i,vector<T> &a){for(T &t:a)i>>t;return i;}
//INSERT ABOVE HERE


signed main(){
  srand((unsigned)time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  Int N;
  cin>>N;
  vector<Int> A(N);
  cin>>A;
  sort(A.begin(), A.end(), greater<Int>());

  map<Int, Int> cnt;
  for(Int a:A) cnt[a]++;

  Int ans = 1;
  ans &= (Int)cnt.size() == A[0]/2 + 1;

  if(A[0] % 2 == 0) {
    ans &= cnt[A[0]/2] == 1;
    cnt.erase(A[0]/2);
  }
  else{
    ans &= cnt[A[0]/2 + 1] == 2;
    cnt.erase(A[0]/2 + 1);
  }

  for(Int a:A) ans &= a >= (A[0] + 1) / 2;

  for(auto p:cnt){
    Int a, num; tie(a, num) = p;
    ans &= num >= 2;
  }

  cout<<(ans? "Possible":"Impossible")<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
  
  int n,a;
  cin>>n>>a;
  int ans;
  int total=n*3+a;
  ans=total/2;
  cout<<ans;

    return 0;
}

Measured memory_bytes: 256
# @oj: atcoder
# @id: hitwanyang
# @email: 296866643@qq.com
# @date: 2020-05-19 17:18
# @url:https://atcoder.jp/contests/abc135/tasks/abc135_d
import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string
# region fastio

BUFSIZE = 8192

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
# ------------------------------
def main():
    # python取模注意每次都需要取模，否则会导致tle
    s=str(input())
    S=s[::-1]
    dp=[[0]*13 for i in range(len(S))]
    mod=10**9+7
    p=1 # 每位的权重10的幂次
    for i in range(len(S)):
        if i==0:
            if S[i]!='?':
                t=p*int(S[i])%13
                dp[i][t]+=1
            else:
                for j in range(10):
                    dp[i][j]+=1
        else:
            if S[i]!='?':
                t=p*int(S[i])%13
                for j in range(13):
                    dp[i][(t+j)%13]=dp[i-1][j]%mod
            else:
                for j in range(10):
                    for k in range(13):
                        temp=(p*j%13+k)%13
                        dp[i][temp]=(dp[i][temp]+dp[i-1][k])%mod
        p=(p%13*10%13)%13
    # print (dp)
    print (dp[len(S)-1][5])
if __name__ == "__main__":
    main()

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

// int/long:		-2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536,870,912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

#define	MOD 1000000007

int	main() {
	long M;
	cin >>M;
	vector<vector<long>> D(M, vector<long> (2, 0));
	for (long i=0; i<M; i++)
		cin >>D.at(i).at(0) >>D.at(i).at(1);
	vector<vector<long>> L(M+1, vector<long> (2, 0));
	vector<vector<long>> R(M+1, vector<long> (2, 0));
	L.at(0)={0, -1};
	for (long i=1; i<=M; i++) {
		long N=D.at(i-1).at(0)*D.at(i-1).at(1)+L.at(i-1).at(0);
		L.at(i).at(1) = L.at(i-1).at(1)+D.at(i-1).at(1);
		L.at(i).at(0) = (N-1)%9+1;
		L.at(i).at(1) += (N-1)/9;
	}
	R.at(M)={0, -1};
	for (long i=M-1; i>=M; i--) {
		long N=D.at(i+1).at(0)*D.at(i+1).at(1)+R.at(i+1).at(0);
		R.at(i).at(1) = R.at(i+1).at(1)+D.at(i+1).at(1);
		R.at(i).at(0) = (N-1)%9+1;
		R.at(i).at(1) += (N-1)/9;
	}
	long S=max(R.at(0).at(1), L.at(M).at(1));
	for (long i=0; i<=M; i++) {
		long SS=L.at(i).at(1)+R.at(i).at(1)+1;
		if (9<L.at(i).at(0)+R.at(i).at(0))
			SS++;
		S = max(S, SS);
	}
	cout <<S <<endl;
	return 0;
}



Measured memory_bytes: 33024
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <cmath>

using namespace std;

#define int long long

#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

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

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); };

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

const int inf = TEN(9) + 10;
const int mod = TEN(9) + 7;

signed main()
{
	map<int, int> m;
	int n; cin >> n;
	rep(i, n) {
		m[read()]++;
	}

	int ans = 0;
	for (pii a : m) {
		ans += a.scd % 2;
	}

	cout << ans << endl;
}


Measured memory_bytes: 6528
#include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#define INF 900000000

using namespace std;

int main()
{
	int a,b;
	
	cin>>a>>b;
	
	if(a<b)cout<<"a < b"<<endl;
	
	if(a>b)cout<<"a > b"<<endl; 
    
    if(a==b)cout<<"a == b"<<endl; 
    return 0;
}



Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int32_t main()
{
	//freopen("input.txt", "r", stdin);
	IOS;
	
	string s; cin >> s;

	if(s[0] == s[1] && s[1] == s[2] && s[0] == 'R') cout << "3\n";
	else if(s[0] == s[1] && s[0] == 'R') cout << "2\n";
	else if(s[2] == s[1] && s[2] == 'R') cout << "2\n";
	else {
		for(auto x: s) {
			if(x == 'R') {
				cout << "1\n";
				return 0;
			}
		}
		cout << "0\n";
	}
	return 0;
}

Measured memory_bytes: 3636
#include <iostream>

using namespace std;

int main(void){

  int A, B, K;

  cin >> K;

  cin >> A;
  cin >> B;

  for(int i=1; i<1000; i++){
    if(K*i>=A && K*i<=B){
      cout << "OK" << endl;
      break;
    }
    if(K*i>B){
      cout << "NG" << endl;
      break;
    }
  }

  return 0;
}


Measured memory_bytes: 3636
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using lint = long long;
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; }
const long long INF = 1LL << 60;

int main()
{
    int n;
    cin >> n;
    vector<int64_t> b(n-1),a(n);
    rep(i,n-1) cin >> b[i];

    rep(i,n){
        if(i == 0) a[i] = b[i];
        else if(i == n-1) a[i] = b[i-1];
        else a[i] = min(b[i],b[i-1]);
    }

    int64_t ans = 0;

    rep(i,n) ans+=a[i];

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
from itertools import combinations, product


def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)


def get(fmt):
    ps = input().split()
    r = []
    for p, t in zip(ps, fmt):
        if t == "i":
            r.append(int(p))
        if t == "f":
            r.append(float(p))
        if t == "s":
            r.append(p)
    if len(r) == 1:
        r = r[0]
    return r

def put(*args, **kwargs):
    print(*args, **kwargs)


def rep(n, f, *args, **kwargs):
    return [f(*args, **kwargs) for _ in range(n)]
    
def rep_im(n, v):
    return rep(n, lambda: v)
    
YES_NO = ["NO", "YES"]


N, K, X, Y = rep(4, get, "i")

p = N * X - max(N - K, 0) * (X - Y)

put(p)


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <iomanip>
#include <limits>
#include <utility>
#include <bitset>
#include <sstream>
#define ll long long
#define lint long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
#define INF 1e9

#define mod 1000000007
int i, j, k;

int main()
{
    int H, W;
    cin >> H >> W;
    vector<string> ss(H);
    rep(i, H) cin >> ss[i];

    int L[H + 1][W + 1];
    for (i = 0; i < H; i++)
    {
        for (j = 0; j < W; j++)
        {
            L[i][j] = (ss[i][j] == '.') ? 1 : 0;
            //cout << L[i][j] << " ";
        }
        //cout << endl;
    }

/*
    int yoko[H + 1][W + 1] = {};
    for (i = 0; i < H; i++)
    {

        for (j = 0; j < W; j++)
        {
            yoko[i][j] = L[i][j];
            if (j > 0)
                yoko[i][j] += yoko[i][j - 1];
        }
    }

    int tate[H + 1][W + 1] = {};
    for (j = 0; j < W; j++)
    {
        for (i = 0; i < H; i++)
        {
            tate[i][j] = L[i][j];
            if (i > 0)
                tate[i][j] += tate[i - 1][j];
        }
    }

    cout << endl;
    rep(i, H)
    {
        rep(j, W)
        {
            cout << yoko[i][j] << " ";
        }
        cout << endl;
    }
    cout << endl;
    rep(i, H)
    {
        rep(j, W)
        {
            cout << tate[i][j] << " ";
        }
        cout << endl;
    }
*/
    int yoko_2[H + 1][W + 1] = {};
    int ind = 0;
    int c;
    for (i = 0; i < H; i++)
    {
        for (j = 0; j < W; j++)
        {
            if (j > 0 && L[i][j] == 1 && yoko_2[i][j-1] != 0)
                yoko_2[i][j] = yoko_2[i][j - 1];
            else if (L[i][j] == 0)
                yoko_2[i][j] = 0;
            else if (L[i][j] == 1)
            {
                // search
                c = 1;
                for (k = j + 1; k < W; k++)
                {
                    if (L[i][k] != 1)
                        break;
                    c++;
                }
                yoko_2[i][j] = c;
            }
        }
    }
/*
    cout << endl;
    rep(i, H)
    {
        rep(j, W)
        {
            cout << yoko_2[i][j] << " ";
        }
        cout << endl;
    }
    cout << endl;
*/
    int tate_2[H + 1][W + 1] = {};
    for(i=0;i<W;i++){
        for(j=0;j<H;j++){
            if (j>0 && L[j][i] == 1 && tate_2[j-1][i] != 0)
                tate_2[j][i] = tate_2[j-1][i];
            else if (L[j][i] == 0)
                tate_2[j][i] = 0;
            else if (L[j][i] == 1){
                c=1;
                for (k=j+1;k<H;k++){
                    if(L[k][i] != 1)
                        break;
                    c++;
                }
                tate_2[j][i] = c;
            }
        }
    }
/*
    cout << endl;
    rep(i, H)
    {
        rep(j, W)
        {
            cout << tate_2[i][j] << " ";
        }
        cout << endl;
    }
*/
    int ans = 0;
    for(i=0;i<H;i++){
        for(j=0;j<W;j++){
            ans = max(ans,(yoko_2[i][j] + tate_2[i][j] - 1));
        }
    }

    cout<<ans<<endl;

return 0;
}

Measured memory_bytes: 51328
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    //optimize
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //---------
    int a,b;
    cin >> a >> b;
    cout << ((a * b) % 2 == 0 ? "Even" : "Odd") << endl;
}
// vim: set fileencoding=utf-8


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

int main() {
	int n;cin>>n;
  	char s;
  	for(int i=0;i<n;i++){
    	cin>>s;
      	if(s=='Y') {cout<<"Four";return 0;}
    }
  	cout<<"Three";
  	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
#include <iomanip>
#include <map>
#include <math.h>
typedef long long ll;
using namespace std;
const int MOD = 1000000007;

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }

int main()
{
    int N;
    cin >> N;
    int B[N-1];
    for(int i = 0; i < N-1; i++) cin >> B[i];
    vector<int> A(N,0);
    A[N-1] = B[N-2];
    A[0] = B[0];
    for(int i = 1; i < N - 1; i++)
    {
        if(B[i] > B[i-1])
        {
            A[i] = B[i -1];
        }
        else
        {
            A[i] = B[i];
        }
    }
    ll ans = 0;
    for(int i = 0; i < N; i++)
    {
        ans += A[i];
    }
    cout << ans << endl;

}

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

using namespace std;

unsigned long long euclidean_gcd(unsigned long long a, unsigned long long b) {
  while(1) {
    if(a < b) swap(a, b);
    if(!b) break;
    a %= b;
  }
  return a;
}

int main(){
	unsigned long long a, b, c, d, ans, cd;
    cin >> a >> b >> c >> d;

    cd = c*d/euclidean_gcd(c,d);

    ans = (b-a+1) - (b/c - (a-1)/c) - (b/d - (a-1)/d) + (b/cd - (a-1)/cd);

    cout << ans << endl;
}

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

using namespace std;
typedef pair<double, double> P;

double CalcTriSquare(P p1, P p2, P p3)
{
	double a, b, c;
	double s;
	a = sqrt((p2.first - p1.first) * (p2.first - p1.first) + (p2.second - p1.second) * (p2.second - p1.second));
	b = sqrt((p3.first - p1.first) * (p3.first - p1.first) + (p3.second - p1.second) * (p3.second - p1.second));
	c = sqrt((p3.first - p2.first) * (p3.first - p2.first) + (p3.second - p2.second) * (p3.second - p2.second));
	s = (a + b + c) / 2;
	return(sqrt(s * (s - a) * (s - b) * (s - c)));
}

void solve()
{
	P p[4];
	while(cin >> p[0].first >>p[0].second >> p[1].first >> p[1].second >> p[2].first >> p[2].second >> p[3].first >> p[3].second)
	{
		double sum = 0;
		sum += CalcTriSquare(p[0], p[1], p[3]);
		sum += CalcTriSquare(p[0], p[2], p[3]);
		sum += CalcTriSquare(p[1], p[2], p[3]);
		double square = CalcTriSquare(p[0], p[1], p[2]);
		if(fabs(sum - square) < 0.001)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

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

Measured memory_bytes: 0