akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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; }
const int INF=1001001001;
const int mod=1e9+7;

int main() {
  string s;
  cin>>s;
  int n=s.size();
  vector<int64_t>a(n+1);
  for(int i=0;i<n;i++){
    if(s[i]=='<'){a[i+1]=a[i]+1;}
  }
  for(int i=n-1;i>=0;i--){
    if(s[i]=='>'){a[i]=max(a[i],a[i+1]+1);}
  }
  int64_t sum=0;
  for(int i=0;i<=n;i++){
    sum+=a[i];
  }
  cout<<sum<<endl;
  return 0;
}


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

int main(){
    ll n;
    cin>>n;
    int cnt=1;
    bool flag=true;
    while(n>=10){
        if(n%10!=9) flag=false;
        n/=10;
        cnt++;
    }
    if(flag) cout<<n+9*(cnt-1)<<"\n";
    else cout<<n+9*(cnt-1)-1<<"\n";
    return 0;
}

Measured memory_bytes: 3616
import java.util.Scanner;

//Sum and Average
public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int v = 0;
		int n = 0;
		int k = 0;
		while(sc.hasNext()){
			String[] s = sc.next().split(",");
			k++;
			int m = Integer.parseInt(s[1]);
			n+=m;
			v+=Integer.parseInt(s[0])*m;
		}
		System.out.printf("%.0f\n%.0f\n", v*1.0, n*1.0/k);
	}
}

Measured memory_bytes: 12000
n,q = map(int, input().split())
s = input()
t = [0]*(n+1)
for i in range(n):
    if s[i:i+2]=="AC":
        t[i+1] = t[i] + 1
    else:
        t[i+1] = t[i]

for i in range(q):
    l,r = map(int, input().split())
    print(t[r-1]-t[l-1])

Measured memory_bytes: 6060
h, w = gets.chomp.split.map(&:to_i)
a_s = h.times.map{gets.chomp.chars}


def remove a_s
  a_s.each do |a|
    a_s.delete(a) unless a.include?("#")
  end
  a_s
end

a_s = remove a_s
a_s = remove a_s.transpose
a_s = a_s.transpose

a_s.each do |a|
  puts a.join()
end


Measured memory_bytes: 2300
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
const int INF = 1e9;

const double PI = 3.141592653589;

int main() {
  int r;
  cin >> r;
  cout << r * 2 * PI << endl;
}


Measured memory_bytes: 3776
#include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=n-1;i>=0;++i)
#define rep1(i,n) for(int i=1; i<=n; ++i)
#define per1(i,n) for(int i=n; i>=1; ++i)
#define debug cout << "line : " << __LINE__ << " debug" << endl
#define Dcout(N) cout << setprecision(20) << N << endl
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define INF 1e8
#define MOD 1000000007
typedef long long ll;

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

      ll x; cin >> x;

      rep(i,10000){
          rep(j,10000){
              if((pow(i,5)-pow(j,5))==x) {
                  cout << i << " " << j << endl;
                  return 0;
              }
              if((pow(-1*i,5)-pow(j,5))==x) {
                  cout << -1*i << " " << j << endl;
                  return 0;
              }
              if((pow(i,5)-pow(-1*j,5))==x) {
                  cout << i << " " << -1*j << endl;
                  return 0;
              }
          }
      }


      rep(i,10000){
          rep(j,10000){
              if(pow(i,5)-pow(j,5)==x) {
                  cout << i << " " << j << endl;
                  return 0;
              }
          }
      }


      return 0;
}


Measured memory_bytes: 4244
#include <bits/stdc++.h>
#define RI register int
#define lc (x << 1)
#define rc (x << 1 | 1)
#define mid ((l + r) >> 1)
typedef long long LL;

using namespace std;

char buf[1000000], *p1 = buf, *p2 = buf;
inline char gc() {
  if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin);
  return p1 == p2 ? EOF : *(p1++);
}
template <class T> inline void read(T &n) {
  n = 0; RI ch = gc();
  while (ch < '0' || ch > '9') ch = gc();
  while (ch >= '0' && ch <= '9') n = n * 10 + (ch ^ 48), ch = gc();
}

int const MAXN = 2e5 + 5;
int a[MAXN];
LL min1[MAXN * 4], min2[MAXN * 4], ans[MAXN * 4], add[MAXN * 4];

inline void Update(int x) {
  min1[x] = min(min1[lc], min1[rc]);
  min2[x] = min(min2[lc], min2[rc]);
  ans[x] = min(ans[lc], ans[rc]);
}
inline void Add(int x, LL num) {
  min1[x] += num;
  min2[x] += num;
  add[x] += num;
  ans[x] += num;
}
inline void Pushdown(int x) {
  if (add[x]) {
    Add(lc, add[x]);
    Add(rc, add[x]);
    add[x] = 0;
  }
}
void Build(const int x, const int l, const int r, const int &num) {
  if (l == r) return ans[x] = abs(num - l), min1[x] = ans[x] - l, min2[x] = ans[x] + l, void();
  Build(lc, l, mid, num), Build(rc, mid + 1, r, num);
  Update(x);
}
void Modify(const int x, const int l, const int r, const int &pos, const LL &num) {
  if (l == r) return ans[x] = min(ans[x], 1ll * num), min1[x] = ans[x] - l, min2[x] = ans[x] + l, void();
  Pushdown(x);
  if (pos <= mid) Modify(lc, l, mid, pos, num);
  else Modify(rc, mid + 1, r, pos, num);
  Update(x);
}
LL Query(const int x, const int l, const int r, const int i, const int j, const int op) {
  if (i <= l && r <= j) return op ? min1[x] : min2[x];
  Pushdown(x);
  LL re = 0x7f7f7f7f7f7f7f7f;
  if (i <= mid) re = min(re, Query(lc, l, mid, i, j, op));
  if (j > mid) re = min(re, Query(rc, mid + 1, r, i, j, op));
  return re;  
}

int main() {
//  freopen("move.in", "r", stdin);
//  freopen("move.out", "w", stdout);
  int n, Q, A, B;
  read(n), read(Q), read(A), read(B);
  for (RI i = 1; i <= Q; ++i) read(a[i]);
  a[0] = A;
  Build(1, 1, n, B);
  for (RI i = 1; i <= Q; ++i) {
    LL Min = std :: min(Query(1, 1, n, 1, a[i], 1) + a[i], Query(1, 1, n, a[i], n, 0) - a[i]);
    Add(1, abs(a[i] - a[i - 1]));
    Modify(1, 1, n, a[i - 1], Min);
  }
  printf("%lld\n", ans[1]);
  return 0;
}


Measured memory_bytes: 27008
#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;


struct mint{
    static const long long MOD = 1000000007;

    long long v;

    mint() : v(0) {}
    mint(long long x){
        x = x % MOD;
        if(x < 0){ x += MOD; }
        v = x;
    }
    mint& operator+=(mint a){
        v += a.v;
        if(v >= MOD){ v -= MOD; }
        return *this;
    }
    mint& operator*=(mint a){
        v *= a.v;
        v %= MOD;
        return *this;
    }
    mint& operator-=(mint a){
        v -= a.v;
        if(v < 0){ v += MOD; }
        return *this;
    }
    mint& operator/=(mint a){
        return (*this) *= a.inv();
    }

    mint operator*(mint a) const{
        return mint(v) *= a;
    }

    mint operator+(mint a) const {
        return mint(v) += a;
    }

    mint operator-(mint a) const {
        return mint(v) -= a;
    }

    mint pow(long long k) const {
        mint res(1),tmp(v);
        while(k){
            if(k&1) res *= tmp;
            tmp *= tmp;
            k >>= 1;
        }
        return res;
    }
    mint inv(){return pow(MOD - 2); }

    static mint comb(long long n, int k){
        mint res(1);
        for(int i = 0; i < k; ++i){
            res *= mint(n - i);
            res /= mint(i + 1);
        }
        return res;
    }

    static mint factorial(long long n){
        mint res(1);
        for(int i = n; i > 1; --i){
            res *= mint(i);
        }
        return res;
    }

    bool operator<(const mint &a) const {
        return v < a.v;
    };
};


ll k;
vector<vector<ll>> ns;
vector<bool> visited;
vector<ll> nums;

void solve(ll cur, ll order, ll parent, ll depth){
    visited.at(cur) = true;
    if(depth == 0){
        nums.at(cur) = k;
    }else{
        nums.at(cur) = k - (order + 1 + (depth > 1));
    }

    ll i = 0;
    for(ll n : ns.at(cur)){
        if(visited.at(n)){ continue; }
        solve(n, i, cur, depth + 1);
        i += 1;
    }
}

int main(){
    ll n;
    cin >> n >> k;
    ns.resize(n);
    for(int i = 0; i < n - 1; ++i){
        ll a, b;
        cin >> a >> b;
        ns.at(a - 1).push_back(b - 1);
        ns.at(b - 1).push_back(a - 1);
    }

    visited.resize(n, false);
    nums.resize(n, 0);
    solve(0, 0, 0, 0);

    mint ans(1);
    for(ll x : nums){
        if(x <= 0){
            cout << 0 << endl;
            return 0;
        }
        ans *= x;
    }
    cout << ans.v << endl;
    return 0;
}


Measured memory_bytes: 9984
#include<bits/stdc++.h>
using namespace std;
# define ll long long int 
int main()
{
    ll count=0;
    ll k;
    string s;
    cin>>s;
    k=s.length();
    for(int i=0;i<k;i++)
    {
        if(s[i]=='o')
        count++;
    }
    if(count+(15-k)>=8)
    cout<<"YES";
    else
    cout<<"NO";
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);

#define REP(i,n)	for(int i=0;i<(int)n;++i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define FOR(i,s,n)	for(int i=s;i<(int)n;++i)

int n, l;
string s[100];

int main(int argc, char **argv) {
	cin >> n >> l;
	REP(i, n) cin >> s[i];
	sort(s, s + n);
	REP(i, n) cout << s[i];
	cout << endl;
	return 0;
}


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

#define x first
#define y second
#define y1 Y1
#define y2 Y2
#define mp make_pair
#define pb push_back
#define DEBUG(x) cout << #x << " = " << x << endl;

using namespace std;

typedef long long LL;
typedef pair <int, int> pii;

template <typename T> inline int Chkmax (T &a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> inline int Chkmin (T &a, T b) { return a > b ? a = b, 1 : 0; }
template <typename T> inline T read ()
{
	T sum = 0, fl = 1; char ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') fl = -1;
	for (; isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + ch - '0';
	return sum * fl;
}

inline void proc_status ()
{
	ifstream t ("/proc/self/status");
	cerr << string (istreambuf_iterator <char> (t), istreambuf_iterator <char> ()) << endl;
}

const int Maxn = 1e5 + 100;
const int Mod = 1e9 + 7;

int N, A[Maxn];
int Sum[Maxn];

inline int Pow (int a, int b)
{
	int ans = 1;
	for (int i = b; i; i >>= 1, a = (LL) a * a % Mod) if (i & 1) ans = (LL) ans * a % Mod;
	return ans;
}

inline void Add (int &a, int b) { if ((a += b) >= Mod) a -= Mod; }

inline int fac (int n)
{
	int ans = 1;
	for (int i = 1; i <= n; ++i) ans = (LL) ans * i % Mod;
	return ans;
}

inline void Solve ()
{
	for (int i = 1; i <= N; ++i) Sum[i] = (Sum[i - 1] + Pow (i, Mod - 2)) % Mod;

	int ans = 0;
	for (int i = 1; i <= N; ++i)
	{
		int l = i, r = N - i + 1;
		Add (ans, (LL) A[i] * (Sum[l] + Sum[r] - 1) % Mod);
	}

	ans = (LL) ans * fac (N) % Mod;

	cout << ans << endl;
}

inline void Input ()
{
	N = read<int>();
	for (int i = 1; i <= N; ++i) A[i] = read<int>();
}

int main()
{

#ifdef hk_cnyali
	freopen("B.in", "r", stdin);
	freopen("B.out", "w", stdout);
#endif

	Input ();
	Solve ();

	return 0;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int maxn = 1e3+5;
const int mod = 1e9+7;
 
int H,W,dp[maxn][maxn];
char G[maxn][maxn];
bool vis[maxn][maxn];
 
int main(){
	scanf("%d%d",&H,&W);
	for(int i = 1;i <= H;i++){
		scanf(" %s",G[i] + 1);
	}
	dp[1][1] = 1;
	for(int i = 1;i <= H;i++){
		dp[i][0] = 0;
		for(int j = 1; j <= W;++j){
			dp[0][j] = 0;
			if(i == 1 && j == 1)
				continue;
			if(G[i][j] != '#')
				dp[i][j] = (dp[i-1][j] + dp[i][j-1])%mod;
			else 
				dp[i][j] = 0;
		}
	}
	printf("%d\n",dp[H][W]%mod);
	return 0;
}

Measured memory_bytes: 5120
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest.ABC_132
{
    class A
    {
        static void Main(string[] args)
        {
            Method(args);
        }

        static void Method(string[] args)
        {
            string s = Read();
            Dictionary<char, int> dict = new Dictionary<char, int>();
            for(int i = 0; i < s.Length; i++)
            {
                if (!dict.ContainsKey(s[i]))
                {
                    dict.Add(s[i], 0);
                }
                dict[s[i]]++;
            }

            int cnt = 0;
            foreach(char val in dict.Keys)
            {
                cnt = dict[val];
                break;
            }

            if (cnt == 2 && dict.Count == 2) WriteLine("Yes");
            else WriteLine("No");
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    ll N, X;
    cin >> N >> X;

    vector<ll> x(N);

    REP(i, N){
        cin >> x[i];
    }

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

    if(N == 1){
        cout << abs(x[0]-X) << endl;
        return 0;
    }
    vector<ll> B(N-1);
    ll mind = INF;
    REP(i, N){
        mind = min(mind, abs(X - x[i]));
        if(i==0) continue;
        B[i-1] = x[i] - x[i-1];
    }

    ll ans = gcd(mind, B[0]);
    REP(i, N-1){
        ans = gcd(ans, B[i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,j,n) for(int i = j; i < n; i++)
#define rrep(i,j,n) for(int i = j-1; i >= n; i--)
#define prec(n) fixed << setprecision(n)
#define print_array(v) rep(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define fi first
#define se second
#define endl "\n"
using namespace std;

constexpr int inf = 2147483647;
constexpr int64_t inf64 = 9223372036854775807;
constexpr int mod = 1e9+7;

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

  string s, t;
  cin >> s >> t;

  int idx = s.size()+1;
  while(idx--) {
    if(s == t) { cout << "Yes" << endl; return 0; }
    string new_s = s.substr(1,s.size()-1);
    new_s.push_back(s[0]);
    s = new_s;
  }

  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int h, w;
	cin>>h>>w;
	string s[101];
	for(int i=0; i<h; i++) cin>>s[i];
	int dp[101][101];
	if(s[0][0]=='#') dp[0][0]=1;
	else dp[0][0]=0;
	for(int i=0; i<h; i++){
		for(int j=0; j<w; j++){
			if(i==0 && j==0) continue;
			dp[i][j]=1e9;
			if(i>0){
				if(s[i-1][j]=='.' && s[i][j]=='#') dp[i][j]=min(dp[i][j], dp[i-1][j]+1);
				else dp[i][j]=min(dp[i][j], dp[i-1][j]);
			}
			if(j>0){
				if(s[i][j-1]=='.' && s[i][j]=='#') dp[i][j]=min(dp[i][j], dp[i][j-1]+1);
				else dp[i][j]=min(dp[i][j], dp[i][j-1]);
			}
		}
	}
	cout<<dp[h-1][w-1]<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
 
int main() {
    int n, k;
    cin >> n >> k;
    int h[n];
    rep(i, n) cin >> h[i];
    sort(h, h + n);
 
    int ans = 1e9;
    rep(i, n - k + 1) ans = min(ans, h[i + k - 1] - h[i]);
 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
int main() {
    int n; cin >> n;
    vector<string> s(2);
    rep(i, 2) cin >> s[i];
    bool tate;
    mint ans = 1;
    rep(i, n) {
        if(s[0][i]==s[1][i]) {//tate
            if(i==0) ans *= 3;
            else if(tate) ans *= 2;
            tate = true;
        } else {//yoko
            if(i==0) ans *= 6;
            else if(tate) ans *=2;
            else ans *= 3;
            tate = false;
            i += 1;
        }
    }
    cout << ans.x;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;
typedef long long  ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)

int main() {
	char N[5]; cin >> N;

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ar array
int vis[1000006];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0; i<n; i++){
    cin >> a[i];
    vis[a[i]]++;
  }
  int ans = 0;
  for(int i=0; i<n; i++) {
    vis[a[i]]--;
    bool bl = 1;
    for(int x=1; x*x<=a[i]; x++) {
      if(a[i]%x==0){
        if(vis[x]||vis[a[i]/x]){
          bl = 0;
          break;
        }
      }
    }
    vis[a[i]]++;
    ans += (bl==1);
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 7852
#include <stdio.h>
#include <stdlib.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)

//辺の情報を個別に持つタイプ
typedef struct edge{ll s,g;}E;
typedef struct graph{
	int vcnt,ecnt;
	E  e[200010];//適宜変える(ecnt)
	int id[100010];//適宜変える(vcnt)
}G;
G g;

int esort(const void*a,const void*b){
	E*p=(E*)a,*q=(E*)b;
	if((*p).s<(*q).s)return -1;
	if((*p).s>(*q).s)return  1;
	if((*p).g<(*q).g)return -1;
	return 1;
}
void readgraph(){
	//適宜変える
	ll n;
	scanf("%lld",&n);
	rep(i,0,n){
		ll x,y;
		scanf("%lld%lld",&x,&y);
		x--,y--;
		g.e[2*i].s=x;
		g.e[2*i].g=y;
		g.e[2*i+1].s=y;
		g.e[2*i+1].g=x;
	}
	g.vcnt=n;
	g.ecnt=2*n;
	qsort(g.e,g.ecnt,sizeof(E),esort);

	int p=0;
	rep(i,0,g.vcnt){
		while(p<g.ecnt&&g.e[p].s<i)p++;
		g.id[i]=p;
	}
	g.id[g.vcnt]=g.ecnt;//番兵
}

int path[100010],cnt;
int flag[100010];
//dfs
ll dfs(int v,int pre){
	path[cnt++]=v;
	if(flag[v])return 1;
	flag[v]++;
	rep(i,g.id[v],g.id[v+1]){
		if(g.e[i].g!=pre){
			if(dfs(g.e[i].g,v))return 1;
		}
	}
	cnt--;
	flag[v]--;
	return 0;
}

int main(){
	readgraph();
	dfs(0,-1);
	for(int i=0;path[i]!=path[cnt-1];i++)flag[path[i]]--;
	int q;
	scanf("%d",&q);
	while(q--){
		int a,b;
		scanf("%d%d",&a,&b);
		printf("%d\n",1+(flag[--a]&&flag[--b]));
	}
}


Measured memory_bytes: 12404
#include<bits/stdc++.h>
using namespace std;
#define maxn 200001
int main(){
    int n,a[maxn];
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=n-1;i>=0;i-=2)
        cout<<a[i]<<" "<<flush;
    for(int i=n%2==1?1:0;i<n;i+=2)
        cout<<a[i]<<" "<<flush;
    cout<<endl;
    return 0;
}

Measured memory_bytes: 2944
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = (int)1e7;  
using  p = pair<int,int>;
using  v = vector<ll>;
int main(){
  ll n;
  cin >> n;
  auto a = v(n,0);
  auto b = v(n,0);
  auto c = v(n,0);
  for (int i = 0; i < 3; i++)
  {
     for (int j = 0; j < n; j++)
     {
        if(i==0){
           cin >> a[j];
        }else if(i==1){
           cin >> b[j];
        }else{
           cin >> c[j];
        }
     }
  }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  sort(c.begin(),c.end());

  ll sum = 0;
  for (auto i :b)
  {
     auto aa = --lower_bound(a.begin(),a.end(),i)-a.begin()+1;
     auto cc = c.size() - (upper_bound(c.begin(),c.end(),i)-c.begin());
     sum += aa*cc;
  }
  cout << sum;
}
  
  

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

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

int main()
{
	int A, B, C, D;
	bool turnTakahashi = true;

	cin >> A >> B >> C >> D;

	while (true) {
		if (turnTakahashi) {
			C -= B;
			if (C <= 0) {
				cout << "Yes" << endl;
				break;
			}
		}
		else {
			A -= D;
			if (A <= 0) {
				cout << "No" << endl;
				break;
			}
		}
		turnTakahashi = !turnTakahashi;
	}

	return 0;
}


Measured memory_bytes: 3652
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, string
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
mod = 10**9+7
ans = inf ;count = 0 ;pro = 1

n=int(input())
k=int(input())
for i in range(2**n):
    tmp=1
    for l in range(n):
        if i>>l & 1:
            tmp+=k
        else:
            tmp*=2
    ans=min(ans,tmp)
print(ans)

Measured memory_bytes: 39920
def d_equal_cut(N, A):
    import itertools
    import bisect

    cumsum = [0] + list(itertools.accumulate(A))  # Aの累積和

    def get_sum(left, right):
        # A[left]~A[right]の総和を得る
        return cumsum[right+1] - cumsum[left]

    def get_optimum_division(left, right):
        # A[left]~A[right]を、前後の総和の差を最小にするように分解する
        total = get_sum(left, right)
        # A[left]~A[right]の総和の半分以上になる要素の要素番号を求める
        # left, right はAの要素番号を指定しているので、
        # cumsumのために[0]をつけた分+1して、最後に-1している
        mid = bisect.bisect_right(
            cumsum, cumsum[left] + total/2, left+1, right+1) - 1

        # midがleftまたはrightと一致しないとき、真ん中の切り方は2通りある
        # (真ん中の要素を左側に入れるか右側に入れるか)ので、
        # 両方計算して差が小さな方を採用する
        diff1, diff2 = float('inf'), float('inf')
        if mid != left:
            sum_L1 = get_sum(left, mid-1)
            sum_R1 = get_sum(mid, right)
            diff1 = abs(sum_L1 - sum_R1)
        if mid != right:
            sum_L2 = get_sum(left, mid)
            sum_R2 = get_sum(mid+1, right)
            diff2 = abs(sum_L2 - sum_R2)
        return [sum_L1, sum_R1] if diff1 <= diff2 else [sum_L2, sum_R2]

    # 真ん中の区切りを全通り試す
    ans = float('inf')
    # 0~mid_cut番の要素を「左側」、mid_cut~N-1番の要素を「右側」とする
    # Aの1番からN-3番までが「左と右を分ける仕切り」になれる
    # (0, N-2, N-1番をその仕切りにすると、空な部分列ができてしまう)
    for mid_cut in range(1, (N-3) + 1):
        total = []
        total.extend(get_optimum_division(0, mid_cut))
        total.extend(get_optimum_division(mid_cut+1, N-1))
        ans = min(ans, abs(max(total) - min(total)))
    return ans

N = int(input())
A = [int(i) for i in input().split()]
print(d_equal_cut(N, A))

Measured memory_bytes: 24668
#include <stdio.h>

int main(){
	int r,D,x20;
	scanf("%d%d%d",&r,&D,&x20);
	int sum=x20;
	for(int i=0;i<10;i++){
		sum=r*sum-D;
		printf("%d\n",sum);
	}
	return 0;
}

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

int main(){
    string str;
    long long int k;
    cin >> str;
    cin >> k;
    for (int i = 0; i < str.length(); i++){
        if (str[i]=='1') {
            str.erase(0,1);
            k -= 1;
            i -= 1;
            if(k==0) {
                cout << '1' << endl;
                break;
            }
        }
        else{
            cout << str[0] << endl;
            break;
        }
    }
}

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

int main() {
    int N; cin >> N;
    vector<int> B(N - 1);
    for (int i = 0; i < N - 1; i++) {
        cin >> B.at(i);
    }
    
    vector<int> A(N);
    A.at(0) = B.at(0), A.at(N - 1) = B.at(N - 2);
    int sum = A.at(0) + A.at(N - 1);
    for (int i = 1; i < N - 1; i++) {
        A.at(i) = min(B.at(i - 1), B.at(i));
        sum += A.at(i);
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793

int main(){
   int n,d,x;
   cin >> n ;
   cin >> d >> x;
   VI a(n);
   rep(i,n){
      cin >> a.at(i);
   }
   int cnt=0;
   rep(i,n){
      cnt+=((d-1)/a.at(i))+1;
   }
   cout << cnt + x << endl;
}

Measured memory_bytes: 3576
temp = list(map(int,input().split()))
A = temp[0]
B = temp[1]
C = temp[2]
cnt = 0
div = 1
ok = []
while div <= min(A, B):
    if A % div == 0 and B % div == 0:
        ok.append(div)
    div += 1
ok.sort(reverse = True)
print(str(ok[C-1]))


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
using namespace __gnu_pbds;
typedef tree<pair<ll,pair<ll,ll> >, null_type, less<pair<ll,pair<ll,ll> > >, rb_tree_tag, tree_order_statistics_node_update>ordered_set;
#define me BOSS
#define bug() cout<<"AIkahne aise"<<endl
#define PI acos(-1)
/* Precode Start Here *\
     Sieve
void sieve()
{
    for(ll i=3; i<=2000; i+=2)
    {
        for(ll j=i*i; j<=4000000; j+=i)
            A[j]=1;
    }
    v.push_back(2);
    for(ll i=3; i<=4000000; i+=2)
        if(A[i]==0)
            v.push_back(i);
}

     Power Function Modulo P

ll modPow(ll a, ll x, ll p) {
    //calculates a^x mod p in logarithmic time.
    long res = 1;
    while(x > 0) {
        if( x % 2 != 0) {
            res = (res * a) % p;
        }
        a = (a * a) % p;
        x /= 2;
    }
    return res;
}


   factorial

ll fact(ll n)
{
    ll ans=1;
    for(ll i=1;i<=n;i++)
    {
        ans=(ans*i)%mod;
    }
    return ans;
}
     Calculating nCr using Fermats law Theorem

ll modInverse(ll a, ll p) {
    //calculates the modular multiplicative of a mod m.
    //(assuming p is prime).
    return modPow(a, p-2, p);
}


ll modBinomial(ll n, ll k, ll p) {
// calculates C(n,k) mod p (assuming p is prime).

    ll numerator = 1; // n * (n-1) * ... * (n-k+1)
    for (ll i=0; i<k; i++) {
        numerator = (numerator * (n-i) ) % p;
    }

    ll denominator = 1; // k!
    for (ll i=1; i<=k; i++) {
        denominator = (denominator * i) % p;
    }

    // numerator / denominator mod p.
    return ( numerator* modInverse(denominator,p) ) % p;
}
     num of divisor and euler totient

ll phi[1000001],mark[1000001],divi[1000001];;
void divisorPhi(ll n)
{
    for(int i=1;i<=n;i++)
        phi[i]=i;
    for(int i=2;i<=n;i++)
    {
        if(!mark[i])
        {
            for(int j=i;j<=n;j+=i)
            {
                mark[j]=1;
                phi[j]*=(1-1/(double)i);
            }
        }
    }
    for(ll i=1;i<=n;i++)
    {
        for(ll j=i;j<=n;j+=i)
            divi[j]++;
    }
}
/* Precode Ends */
#define mod 1000000007
ll A[5000001],B[5000001];
vector<ll>v;
map<ll,ll>myMap;
set<ll>mySet;
vector<pair<ll,ll> >vp;
priority_queue<ll> pq;
priority_queue<ll, vector<ll>, std::greater<ll> > first;
ll po(ll a,ll n)
{
  ll ans=1;
  for(int i=1;i<=n;i++)
       ans*=a;
    return ans;
}

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



 ll a,b,k;
  cin>>k>>a>>b;
  for(ll i=a;i<=b;i++)
  {
      if(i%k==0)
      {
          cout<<"OK"<<endl;
          goto x;
      }
  }
  cout<<"NG"<<endl;
  x:
      a=1;
return 0;
}



Measured memory_bytes: 3668
n=int(input())
x=[0]*n
y=[0]*n
for i in range(n):
  x[i],y[i]=map(int,input().split())
if n==2:#2点しかなければそれを直径とする円
  print(((x[0]-x[1])**2+(y[0]-y[1])**2)**(1/2)/2)
else:#3点以上存在する場合
  ans=10**5
  for i in range(n-1):
    for j in range(i+1,n):
      xc=(x[i]+x[j])/2
      yc=(y[i]+y[j])/2
      r=((x[i]-xc)**2+(y[i]-yc)**2)**(1/2)
      rr=max(r*1.000000999,r+0.000000999)
      aa=0
      for l in range(n):
        if ((x[l]-xc)**2+(y[l]-yc)**2)**(1/2)>rr:
          aa=1
      if aa==0:
        if r<ans:
          ans=r
  A=[0]*3#A,Bは直線の式の係数の箱
  B=[0]*3
  for i in range(n-2):
    for j in range(i+1,n-1):#P[i],P[j]の垂直二等分線:A[0]x+A[1]y=A[2]
      A[0]=x[j]-x[i]
      A[1]=y[j]-y[i]
      A[2]=A[0]*(x[i]+x[j])/2+A[1]*(y[i]+y[j])/2
      for k in range(j+1,n):#P[i],P[k]
        B[0]=x[k]-x[i]
        B[1]=y[k]-y[i]
        B[2]=B[0]*(x[i]+x[k])/2+B[1]*(y[i]+y[k])/2
        #中心(xc,yc),半径r
        if A[0]*B[1]==A[1]*B[0] and A[0]*B[1]!=0:#三点が同一直線状に存在1,軸と平行でない
          r=((max(x[i],x[j],x[k])-min(x[i],x[j],x[k]))**2+(max(y[i],y[j],y[k])-min(y[i],y[j],y[k]))**2)**(1/2)/2
          xc=(max(x[i],x[j],x[k])+min(x[i],x[j],x[k]))/2
          yc=(max(y[i],y[j],y[k])+min(y[i],y[j],y[k]))/2
        elif A[0]==B[0]==0:#2
          r=(max(y[i],y[j],y[k])-min(y[i],y[j],y[k]))/2
          xc=x[i]
          yc=(max(y[i],y[j],y[k])+min(y[i],y[j],y[k]))/2
        elif A[1]==B[1]==0:#3
          r=(max(x[i],x[j],x[k])-min(x[i],x[j],x[k]))/2
          yc=y[i]
          xc=(max(x[i],x[j],x[k])+min(x[i],x[j],x[k]))/2
        else:#P[i],P[j],P[k]で三角形を作ることができる
          xc=(A[2]*B[1]-A[1]*B[2])/(A[0]*B[1]-A[1]*B[0])
          yc=(A[0]*B[2]-A[2]*B[0])/(A[0]*B[1]-A[1]*B[0])
          r=((x[i]-xc)**2+(y[i]-yc)**2)**(1/2)
        aa=0
        rr=max(r*1.000000999,r+0.000000999)#許容される誤差の緩い方
        for l in range(n):
          if ((x[l]-xc)**2+(y[l]-yc)**2)**(1/2)>rr:
            aa=1
        if aa==0:
          if r<ans:
            ans=r
  print(ans)

Measured memory_bytes: 3320
#include <stdio.h>
#define MAX 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY 100000000

int num,M[MAX][MAX];

int prim(){
  int i,u,v,mincost,total=0;
  int d[MAX],p[MAX],color[MAX];

  for(i=0; i<num; i++){
    color[i] = WHITE;
    d[i] = INFTY;
    p[i] = -1;
  }
  d[0] = 0;
  p[0] = -1;

  while(1){
    mincost = INFTY;
    for(i=0; i<num; i++){
      if(color[i] != BLACK && d[i] < mincost){
	mincost = d[i];
	u = i;
      }
    }

    if(mincost == INFTY) break;

    color[u] = BLACK;

    for(v=0; v<num; v++){
      if(color[v] != BLACK && M[u][v] != INFTY){
	if(M[u][v] < d[v]){
	  d[v] = M[u][v];
	  p[v] = u;
	  color[v] = GRAY;
	}
      }
    }
  }
  for(i=0; i<num; i++){
    if(p[i] != -1) total += M[i][p[i]];
  }
  return total;
}


int main(){
  int i,j;
  scanf("%d",&num);
  for(i=0; i<num; i++){
    for(j=0; j<num; j++){
      scanf("%d",&M[i][j]);
      if(M[i][j] == -1) M[i][j] = INFTY;
    }
  }
  printf("%d\n",prim());

  return 0;
}

Measured memory_bytes: 632
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    set<string> st;
    string S;
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> S;
        st.insert(S);
    }
    cout << (int) st.size() << '\n';
}


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

const int INF = 1e9;

int main() {
  int n, m, x;
  cin >> n >> m >> x;
  vector<int> c(n);
  vector<vector<int>> a(n, vector<int>(m));
  rep(i, n) {
    cin >> c[i];
    rep(j, m) cin >> a[i][j];
  }
  int ans = INF;
  for (int bit = 0; bit < (1 << n); ++bit) {
    int sum[m] = {0};
    int cost = 0;
    for (int i = 0; i < n; ++i) {
      if (bit & (1 << i)) {
        rep(j, m) sum[j] += a[i][j];
        cost += c[i];
      }
    }

    bool ok = true;

    rep(j, m) {
      if (sum[j] < x) ok = false;
    }
    if (ok) ans = min(ans, cost);
  }

  if (ans != INF) {
    cout << ans << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}

Measured memory_bytes: 3628
///
// File:  0582.go
// Author: ymiyamoto
//
// Created on Wed Feb 28 22:51:48 2018
//
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	steep = iota
	orth
	obtuse
)

func max(a, b, c int) (int, int, int) {
	if a < b {
		if b < c {
			return c, a, b
		} else {
			return b, c, a
		}
	} else {
		if a < c {
			return c, a, b
		} else {
			return a, b, c
		}
	}
}

func triangle(a, b, c int) int {
	if a*a == b*b+c*c {
		return orth
	} else if b*b+c*c-a*a > 0 {
		return steep
	} else {
		return obtuse
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)

	var num, st, or, ob int
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)

		m, n1, n2 := max(a, b, c)
		if m < n1+n2 {
			switch triangle(m, n1, n2) {
			case steep:
				st++
			case orth:
				or++
			case obtuse:
				ob++
			}
			num++
		} else {
			break
		}
	}
	fmt.Println(num, or, st, ob)
}



Measured memory_bytes: 1148
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long k,a[300000],n,b=0;
  cin>>n>>k;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a,a+n);
  for(int i=0;i<n;i++){
    if(n-i>k)
      b+=a[i];
  }
  cout<<b<<endl;
  return(0);
}

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

#define int long long
#define fi first
#define se second
#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 rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF LONG_LONG_MAX

int k,x;

signed main() {
    cin >> k >> x;
    if (k*500 >= x) cout << "Yes" << endl;
    else cout << "No" << endl;

}






Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

func main() {
	N, K := nextInt(), nextInt()
	a := make([]int, N)
	for i := 0; i < N; i++ {
		a[i] = nextInt()
	}

	var ans int
	for l := 0; l <= K; l++ {
		for r := 0; r <= K-l; r++ {
			if l+r > N {
				continue
			}

			d := K - l - r
			var now int
			var s []int
			for i := 0; i < l; i++ {
				now += a[i]
				s = append(s, a[i])
			}
			for i := N - r; i < N; i++ {
				now += a[i]
				s = append(s, a[i])
			}

			sort.Ints(s)
			for i := 0; i < d; i++ {
				if i >= len(s) {
					break
				} else if s[i] > 0 {
					break
				}

				now -= s[i]
			}

			ans = max(ans, now)
		}
	}

	fmt.Println(ans)
}

// Input. ----------

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer([]byte{}, math.MaxInt64)
	sc.Split(bufio.ScanWords)
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}

	return i
}

func nextFloat() float64 {
	sc.Scan()
	f64, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}

	return f64
}

func nextString() string {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}

	return sc.Text()
}

// ---------- Input.

// Util. ----------

func abs(x int) int {
	return int(math.Abs(float64(x)))
}

func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}

func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}

// ---------- Util.


Measured memory_bytes: 1664
//#include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<numeric>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<ctype.h>
#include <fstream>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
using namespace std;
typedef long long ll;//int64
typedef unsigned long long ull;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}
int dy[4]={0,1,0,-1};
//----------program from here----------

int main(){
  string a,b;
  cin >> a >> b;
  if((a[0]==b[2])&&(a[1]==b[1])&&(a[2]==b[0])){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int H, W;
const int MAX_K = 85 * 85 * 2 + 1;
bool dp[80][80][MAX_K] = {};

int main() {
    cin >> H >> W;
    vector<vector<int>> A(H, vector<int>(W)), B(H, vector<int>(W));
    for(int i=0; i<H; ++i) {
        for(int j=0; j<W; ++j) {
            cin >> A[i][j];
        }
    }
    for(int i=0; i<H; ++i) {
        for(int j=0; j<W; ++j) {
            cin >> B[i][j];
        }
    }

    dp[0][0][abs(A[0][0] - B[0][0])] = true;
    for(int i=0; i<H; ++i) {
        for(int j=0; j<W; ++j) {
            for(int k=0; k<MAX_K; ++k) {
                if(i + 1 < H) {
                    if(abs(k + A[i + 1][j] - B[i + 1][j]) < MAX_K) dp[i + 1][j][abs(k + A[i + 1][j] - B[i + 1][j])] |= dp[i][j][k];
                    if(abs(k - A[i + 1][j] + B[i + 1][j]) < MAX_K) dp[i + 1][j][abs(k - A[i + 1][j] + B[i + 1][j])] |= dp[i][j][k];
                }
                if(j + 1 < W) {
                    if(abs(k + A[i][j + 1] - B[i][j + 1]) < MAX_K) dp[i][j + 1][abs(k + A[i][j + 1] - B[i][j + 1])] |= dp[i][j][k];
                    if(abs(k - A[i][j + 1] + B[i][j + 1]) < MAX_K) dp[i][j + 1][abs(k - A[i][j + 1] + B[i][j + 1])] |= dp[i][j][k];
                }
            }
        }
    }

    for(int k=0; k<MAX_K; ++k) {
        if(dp[H - 1][W - 1][k]) {
            cout << k << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 90624
n, m = [int(_) for _ in input().split()]
a = [-1]
for i in range(m):
    a.append(int(input()))
a.append(n+1)

m = len(a)

diffs = []
for i in range(m-1):
    diffs.append(a[i + 1] - a[i] - 2)
diffs.sort()

fibs = []
for i in range(0, max(diffs) + 1):
    if i == 0:
        fibs.append(1)
    elif i == 1:
        fibs.append(1)
    else:
        fibs.append(fibs[-1] + fibs[-2] % 1000000007)

def func(k):
    if (k == -2):
        return 1
    elif (k == -1):
        return 0
    else:
        return fibs[k]

ans  = 1
for i in range(len(diffs)):
    ans = ans * func(diffs[i]) % 1000000007

print(ans)


Measured memory_bytes: 7852
W,H,x,y,r = input().split()
W = int(W)
H = int(H)
x = int(x)
y = int(y)
r = int(r)

if  r <= x <= W-r:
  if  r <= y <= H-r:
    print("Yes")
  else:
    print("No")  
else:
  print("No")


Measured memory_bytes: 5596
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
typedef pair<int,int> P;
const int inf = 1012345678;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};

float a;
float b;
float cd;

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

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


int main(){
  ll a, b, c, d;
  ll ans = 0;
  cin >> a >> b >> c >> d;
  a--;
  ll lc = lcm(c,d);
  ans += (b - (b/c) - (b/d) + b/lc);
  ans -= (a - (a/c) - (a/d) + a/lc);
  cout << ans << endl;
}



Measured memory_bytes: 256
# C
n = int(input())
ans = []
while n > 26:
    # print(n)
    if n % 26 == 0:
        ans.append(26)
    else:
        ans.append(n % 26)
    if n <= 26:
        break
    n = (n - 1) // 26
ans.append(n)
ans.reverse()
# print(ans)
for i in ans:
    print(chr(i + 96), end='')


Measured memory_bytes: 8964
#include <bits/stdc++.h>
#define int llint
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = ((int)(a)-1);(i) >= (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, a, n) &((x)[a]), &((x)[n])
#define ADD(a, b) ((((a)%MOD)+((b)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define CEIL(x) ((int)ceil(((double)x)))
#define POW(x, y) ((int)pow(x, y))
#define UNIQUE(x) (x).erase(unique(ALL((x))), (x).end())
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define EPS (1e-20)
#define INF 214748364700000
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using VLL = std::vector<llint>;
using MCI = std::map<char, int>;
using namespace std;


int N;
vector<string> s1, s2;
map<int, string> m1, m2;


string solve(){
	if(N == 0) return "0";
	string ansA;
	string ans;
	rep(i, 0, 1<<17){
		string sub;
		rep(j, 0, 17)
			if((i>>j)&1) sub.pb('1');
			else sub.pb('0');
		s1.pb(sub);
		sub.clear();
	}
	rep(i, 0, 1<<17){
		string sub;
		rep(j, 0, 17)
			if((i>>j)&1) sub.pb('1');
			else sub.pb('0');
		s2.pb(sub);
	}
	for(string s : s1){
		int sum = 0;
		rep(i, 0, 17) sum += (s[i]-'0')*POW(-2, i);
		m1[sum] = s;
	}
	for(string s : s2){
		int sum = 0;
		rep(i, 0, 17) sum += (s[i]-'0')*POW(-2, i+17);
		m2[sum] = s;
	}
	for(pair<int, string> p : m1) if(m2.find(N-p.fi) != m2.end()) ansA = p.se+m2[N-p.fi];
	reverse(ALL(ansA));
	int i;
	for(i = 0;i < SIZE(ansA);i++)
		if(ansA[i] != '0') break;
	for(;i < SIZE(ansA);i++) ans.pb(ansA[i]);
	return ans;
}


signed main(){
	cin >> N;

	cout << solve() << endl;

	return 0;
}

Measured memory_bytes: 55796
import java.util.*;
public class Main {
    public static void main(String[] args){
      // 入力
      Scanner sc = new Scanner(System.in);
      int K = sc.nextInt();
      
      // 判定
      int count = 0;
      int amari = 0;
      int total = 0;
      boolean exist = false;
      while(!exist){
        count++;
        if(count == 1){
          amari = 7 % K;
          total = amari;
        }else{
          amari = (amari * 10) % K;
          total = (total + amari) % K;
        }
        //loggerInt("count",count);
        //loggerInt("amari",amari);
        //loggerInt("total",total);
        
        if(total == 0){
          exist = true;
        }
        
        if(count > K){
          break;
        }
      }
      
      if(!exist){
        count = -1;
      }
      
      // 出力
      System.out.println(count);
    }
    
    // Int型変数ロガー関数
    // String name : 変数名
    // int val : 値
    public static void loggerInt(String name, int val){
      System.out.println(name + " = " + val);
    }

}

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

typedef int64_t Int;
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << endl; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << std::endl;
}

int main() {
    Int n, k;
    cin >> n >> k;
    vector<Int> a(n, 0);
    for (Int i = 0; i < (Int)k; i++) {
        Int d;
        cin >> d;
        for (Int j = 0; j < (Int)d; j++) {
            Int x;
            cin >> x;
            a[x - 1]++;
        }
    }
    Int res = 0;
    for (Int i = 0; i < (Int)n; i++) {
        if (a[i] == 0) res++;
    }
    print(res);
    return 0;
}

Measured memory_bytes: 3632