akhauriyash/Code-Regression huggingface dataset:
#include <math.h>
#include <assert.h>
#include <algorithm>
#include <set>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <string>
#include <cstring>
#include <functional>
#include <stack>
#include <array>
#include <random>
#include <chrono>
#include <climits>
#include <bitset>
using namespace std ;
#define ld long double
#define int long long
#define ii pair<int,int>
#define FAST_IO ios_base::sync_with_stdio(false) ;cin.tie(NULL);cout.tie(NULL); clock_t beg = clock()
#define dbg(x) cerr << #x << " is " << x << endl;
#define ms(x,a) memset(x,(int)(a),sizeof(x))
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define vi vector<int >
#define pb push_back
#define endl '\n'
#define ff first
#define ss second
//const int N = 3e5+7 ;
//const int INF = 1e18 ;
//const int MOD = 1e9 + 7 ;


void solve(){
	int a , b , c , k ;
	cin >> a >> b >> c >> k ;
	int sm = 0 ;
	if(k){
		sm += min(a,k) ;
		k -= a ;
	}
	if(k){
		k -= min(b,k) ;
	}
	if(k){
		sm -= min(c,k) ;
	}
	cout << sm << endl ;
}

int32_t main(){
	FAST_IO ;
	int t = 1 ;
//	cin >> t ;
	while(t--){
		solve() ;
	}
    cerr << "\nExecution time: " << (clock() - beg) / 1000 << '\n';
}


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

using namespace std;

struct Persimmon {
	int x;
	int y;

	void plant(int _x, int _y) {
		x = _x;
		y = _y;
	}

	bool _inRange(int val, int s, int e) {
		if (val < s) {
			return false;
		}
		if (e < val) {
			return false;
		}
		return true;
	}

	bool inRange(int start_x, int end_x, int start_y, int end_y) {
		return _inRange(x, start_x, end_x) and _inRange(y, start_y, end_y);
	}
};

vector<Persimmon> plantPersimmon(int num) {
	vector<Persimmon> place(num);
	for(int i = 0; i < num; i++) {
		int x, y;
		cin >> x >> y;
		Persimmon tmp;
		tmp.plant(x, y);
		place[i] = tmp;
	}
	return place;
}

int countUp(int w, int h, int ew, int eh, vector<Persimmon>& pers) {
	int count = 0;
	for(auto p : pers) {
		if(p.inRange(w, w + ew - 1, h, h + eh - 1)) {
			count++;
		}
	}
	return count;
}

int Search(int num, int fw, int fh, int ew, int eh, vector<Persimmon>& pers) {
	int max = 0;

	for(int w = 1; w <= fw - ew + 1; w++) {
		for(int h = 1; h <= fh - eh + 1; h++) {
			int count = countUp(w, h, ew, eh, pers);
			if(count > max) {
				max = count;
			}
		}
	}

	return max;
}


int main(void) {
	int num;

	while(1) {
		cin >> num;
		if(num == 0) {
			break;
		}

		int f_width, f_heigh;
		cin >> f_width >> f_heigh;

		vector<Persimmon> persimmon = plantPersimmon(num);

		int e_width, e_heigh;
		cin >> e_width >> e_heigh;

		int max_num = Search(num, f_width, f_heigh, e_width, e_heigh, persimmon);

		cout << max_num << endl;
	}
	return 0;
}

Measured memory_bytes: 3112
A,B,K = gets.split(' ').map(&:to_i)

# もし高橋君がクッキーを 1枚以上持っているなら、高橋君のクッキーを1枚食べる。
# そうでなく、もし青木君がクッキーを1枚以上持っているなら、青木君のクッキーを 
# 1枚食べる。
# 高橋君も青木君もクッキーを持っていないなら、何もしない。
=begin
k.times do
  if a>=1
    a -= 1
  elsif b >=1
    b -= 1
  end
end

puts a.to_s + ' ' + b.to_s
=end

a = [A-K,0].max
b = [0,B + [A-K,0].min].max

print a
print ' '
print b

Measured memory_bytes: 1788
#include <stdio.h>

int main() {
	int m_1, d_1, m_2, d_2;
	
	scanf("%d %d", &m_1, &d_1);
	scanf("%d %d", &m_2, &d_2);
	
	if(m_1 != m_2) printf("1");
	else printf("0");
	
	return 0;
}

Measured memory_bytes: 128
#-swank
(unless (member :child-sbcl *features*)
  (quit
	:unix-status
	(process-exit-code
	  (run-program *runtime-pathname*
				   `("--control-stack-size" "128MB"
					 "--noinform" "--disable-ldb" "--lose-on-corruption" "--end-runtime-options"
					 "--eval" "(push :child-sbcl *features*)"
					 "--script" ,(namestring *load-pathname*))
				   :output t :error t :input t))))


(defparameter h (read))
(defparameter w (read))
(defparameter m (concatenate 'vector (loop repeat h collect (read-line))))
(defparameter wall #\#)



(defun walkable (y x)
  (remove-if (lambda (p)
			   (let ((y (car p))
					 (x (cdr p)))
				 (char= (aref (aref m y) x) wall)))
			 (neighbors y x)))

(defun walkable-not (y x)
  (remove-if (lambda (p)
			   (let ((y (car p))
					 (x (cdr p)))
				 (not (char= (aref (aref m y) x) wall))))
			   (neighbors y x)))


(defun neighbors (y x)
  (remove-if #'null
			 (mapcan (lambda (line)
					   (mapcar (lambda (p)
								 (let ((ny (car p))
									   (nx (cdr p)))
								   (when (and (<= 0 ny) (<= 0 nx) (< ny h) (< nx w) (not (equal (cons y x) (cons ny nx))))
									 p)))
							   line))
					 (loop for i from (- y 1) to (+ y 1) collect
						   (loop for j from (- x 1) to (+ x 1) collect
								 (cons i j))))))

(loop for i below h do
	  (progn
		(loop for j below w do
			  (princ (if (char= (aref (aref m i) j) wall)
					   wall
					   (length (walkable-not i j)))))
		(fresh-line)))


Measured memory_bytes: 20280
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #define int long long
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPS(i, r, n) for (int i = (r); i < (n); ++i)
#define REPR(i, n) for(int i = (n); i >= 0; --i) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); --i) // from n to r
#define REPOBJ(itr, obj) for(auto itr = (obj).begin(); itr != (obj).end() ; ++itr)
#define REPROBJ(itr, obj) for(auto itr = (obj).end()-1; itr != (obj).begin()-1 ; --itr)
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define SORT(obj) sort((obj).begin(), (obj).end())
#define SORTR(obj) sort((obj).begin(), (obj).end(), greater<>())
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))

int lcm(int, int);
map<int,int> GetPrimeFactors(int);
bool IsPrime(int);
int Factorial(int);
int npr (int, int);
int ncr (int, int);

int getsecond(pair<string, int> a) {
  return a.second;
}
/***** MAIN *****/
void Main() {
  int n;
  cin >> n;
  string s;
  map<string, int> mp;
  int max = 0;
  REP(i,n) {
    cin >> s;
    ++mp[s];
    if(max < mp[s]) max = mp[s];
  }
  REPOBJ(itr, mp) {
    if(itr->second == max) cout << itr->first << endl;
  }
  

  // cout << "\n";
}
/***** MAIN *****/

signed main() {
  cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
  Main();
  return 0;
}

int lcm(int a, int b) { return a / __gcd(a,b) * b;}

map<int,int> GetPrimeFactors(int n) {
  map<int,int> mp;
  // dived by 2, 3, 5, ...
  for(int i=2; i*i<=n; i+=2) {
    if(i==4) i = 3;
    while(n%i == 0) {
      ++mp[i];
      n /= i;
    }
  }
  if(n!=1) ++mp[n];

  return mp;
}

bool IsPrime(int a) {
  if(a <= 1) return false;
  if(a == 2) return true;
  if(a%2 == 0) return false;
  for(int i = 3; i*i <= a; i+=2) {
    if(a%i==0) return false;
  }
  return true;
}

int Factorial(int n){
  int ans = 1;
  while(n > 1){
    ans *= n;
    --n;
  }
  return ans;
}

int npr(int n, int r) {
  return Factorial(n)/Factorial(n-r);
}

int ncr (int n, int r){
  return npr(n,r)/Factorial(r);
}


Measured memory_bytes: 24832
#include <bits/stdc++.h>
#define dbg(x) cerr << #x << " = " << x << "\n"
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie()
using namespace std;
using ll = long long;
using ld = long double;

int main() {
    fast_io;

    int n, ans = 0;
    ld d;
    cin >> n >> d;
    for (int i = 0; i < n; ++i) {
        ld x, y;

        cin >> x >> y;

        if (!(sqrt(x * x + y * y) > d))
            ++ans;
    }

    cout << ans << "\n";
}


Measured memory_bytes: 3824
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>


using std::cout;
using std::cin;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;


ll gcd(ll a, ll b) {
    while (b != 0) {
        auto tmp = a;
        a = b;
        b = tmp % a;
    }
    return a;
}

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

int isPrime(int a) {
    for (int i = 2; i * i <= a; ++i) {
        if (a % i == 0) {
            return 0;
        }
    }
    return 1;
}





void oneCase () {
    int n;
    cin >> n;
    vector<int> nums(n);
    int s = 0;
    for (auto& el : nums) {
        cin >> el;
        s += el;
    }
    if (s % 10 != 0) {
        cout << s << "\n";
        return;
    }
    int del  = s;
    for (auto el : nums) {
        if (el % 10 != 0) {
            del = min(del, el);
        }
    }
    cout << s - del << "\n";
}




int main() {
    int t = 1;
//    cin >> t;
    while (t > 0) {
        oneCase();
        --t;
    }

    return 0;
}

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

int main() {
  string A_str,B_str;
  cin >> A_str >> B_str;
  int A = atoi(A_str.c_str());
  int B = atoi(B_str.c_str());
  int count = 0;
      
  char str[200];
  
  for(int i=0;i<=(B-A);i++){

    sprintf(str,"%d",i+A); 

    if( str[0]==str[4] && str[1]==str[3] ){
      count++;
    }
  }
  
  cout << count << endl;
    
}


Measured memory_bytes: 256
# 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 ll = 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;
    string s;
    cin >> s;

    vector<ll> a(n);

    rep(i,n){
        if(s[i] == 'R') a[i] = 0;
        if(s[i] == 'G') a[i] = 1;
        if(s[i] == 'B') a[i] = 2;
    }

    vector<ll> cnt(3);
    rep(i,n) cnt[a[i]]++;
    ll ans  = 1;

    rep(i,3) ans*=cnt[i];
    rep(j,n)rep(i,j){
        int k = 2*j - i;
        if(k<n){
            if(a[i] == a[j] || a[j] == a[k] || a[k] == a[i]) continue;
            ans--;
        }
    }

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

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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
// const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int64 H, W;
  cin >> H >> W;
  // H=1 || W=1 をゆるしません
  if(H == 1 || W == 1) {
    cout << 1 << endl;
    return 0;
  }
  int64 add = 0;
  add += ((W + 1) / 2) * ((H + 1) / 2);
  add += (W / 2) * (H / 2);
  cout << add << endl;
}







Measured memory_bytes: 256
//Zory-2020
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define db double
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
	#define debug(A,args...) fprintf(stderr,A,##args)
#else
	#define debug(A,args...) printf("")
#endif
#define deb debug("line %d\n",__LINE__)
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void GG(){puts("No");exit(0);}
	
	const db eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=1e9+7;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int M=1e6+10;
	ll fac[M],facinv[M],Inv[M];ll C(int n,int m){return n<0 or n<m?0:fac[n]*facinv[m]%MOD*facinv[n-m]%MOD;}
	void PRE()
	{
		fac[0]=1;fo(i,1,M-1) fac[i]=fac[i-1]*i%MOD;
		facinv[M-1]=invm(fac[M-1]);fd(i,M-1,1) facinv[i-1]=facinv[i]*i%MOD;
		Inv[1]=1;fo(i,2,M-1) Inv[i]=(MOD-MOD/i)*Inv[MOD%i]%MOD;
	}
	const int N=1e6+10;
	//------------------FIXED------------------
	int a[N],b[N];
	void main()
	{
		int A=qread(),B=qread(),m=qread();
		int mi1=INF;fo(i,1,A) a[i]=qread(),chmin(mi1,a[i]);
		int mi2=INF;fo(i,1,B) b[i]=qread(),chmin(mi2,b[i]);
		int ans=mi1+mi2;while(m--){int x=qread(),y=qread(),c=qread();chmin(ans,a[x]+b[y]-c); }write(ans);
	}
};//����������
signed main()
{
	#ifdef DEBUG
	//freopen("a.in","r",stdin);
	freopen("z.txt","r",stdin);
	//freopen("a.out","w",stdout);
	#endif
	srand(time(0));
	mine::PRE();//����Ԥ����ģ����
	mine::main();
	debug("\n---------------------Zory---------------------\nTime: %.2lf s",1.0*clock()/CLOCKS_PER_SEC);
}

Measured memory_bytes: 29824
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

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

    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    Integer.parseInt(input.readLine());
    while (input.ready()) {
      char[] data1 = input.readLine().toCharArray();
      char[] data2 = input.readLine().toCharArray();
      String ans = sumCharArrayNumber(data1, data2);
      if (ans.length() > 80) {
        System.out.println("overflow");
      } else {
        System.out.println(ans.toString());
      }
    }
  }

  public static String sumCharArrayNumber(char[] num1, char[] num2) {
    List<Integer> num1Array = new ArrayList<>();
    List<Integer> num2Array = new ArrayList<>();
    for (char each : num1) {
      num1Array.add(Character.getNumericValue(each));
    }
    for (char each : num2) {
      num2Array.add(Character.getNumericValue(each));
    }
    Collections.reverse(num1Array);
    Collections.reverse(num2Array);

    int sizeDigitDiff = num1Array.size() - num2Array.size();
    if (sizeDigitDiff > 0) {
      for (int i = 0; i < sizeDigitDiff; i++) {
        num2Array.add(0);
      }
    } else if (sizeDigitDiff < 0) {
      for (int i = 0; i < (0 - sizeDigitDiff); i++) {
        num1Array.add(0);
      }
    }
    List<Integer> ansArray = new ArrayList<>();
    ansArray.add(0);
    for (int i = 0; i < num1Array.size(); i++) {
      int tmp = num1Array.get(i) + num2Array.get(i) + ansArray.get(i);
      ansArray.set(i, tmp % 10);
      int upCount = tmp / 10;
      if (i == num1Array.size() - 1 && upCount == 0) {
        break;
      }
      ansArray.add(i + 1, tmp / 10);
    }
    Collections.reverse(ansArray);
    String ans = "";
    for (int each : ansArray) {
      ans += Integer.toString(each);
    }
    return ans;
  }
}

Measured memory_bytes: 24560
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n, k;
  string s;
  cin >> n >> s >> k;
  char key = s[k - 1];
  rep(i, 0, n) {
    if (s[i] == key)
      cout << s[i];
    else
      cout << "*";
  }
  cout << endl;
}


Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
double dot(complex<double> a, complex<double> b) {
	return a.real() * b.real() + a.imag() * b.imag();
}
double gyaku_dot(complex<double> a, complex<double> b) {
	return a.real() * b.imag() - a.imag() * b.real();
}
double leng(complex<double> a) {
	return sqrt(a.real() * a.real() + a.imag() * a.imag());
}
double angles(complex<double> a, complex<double> b) {
	double cosine = dot(a, b) / (leng(a) * leng(b));
	double sine = gyaku_dot(a, b) / (leng(a) * leng(b));
	double kaku = acos(cosine);
	if (sine <= 0) {
		kaku = 2 * Ma_PI - kaku;
	}
	return kaku;
}
vector<int> convex_hull(vector<complex<double>> a) {
	vector<int> ans;
	double now_minnest = a[0].real();
	int now_itr = 0;
	REP(i, a.size()) {
		if (now_minnest > a[i].real()) {
			now_minnest = a[i].real();
			now_itr = i;
		}
	}
	ans.push_back(now_itr);
	complex<double> ba(0, 1);
	while (true) {
		int now_go = 0;
		double now_min = 0;
		int starter = ans[ans.size() - 1];
		for (int i = 0; i < a.size(); ++i) {
			if (i != starter) {
				double goa = angles(ba, a[i] - a[starter]);
				if (goa > now_min) {
					now_min = goa;
					now_go = i;
				}
			}
		}
		if (now_go == ans[0]) break;
		ans.push_back(now_go);
		ba = complex<double>(a[now_go] - a[starter]);
	}
	return ans;
}
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int main() {
	string s;
	cin >> s;
	sort(s.begin(), s.end());
	REP(i, s.length() - 1) {
		if (s[i] == s[i + 1]) {
			cout << "no";
			return 0;
		}
	}
	cout << "yes";
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <utility>
#include <string.h>
#include <map>
#include <stack>
#include <iomanip>
#include <chrono>
#include <random>
#include <bitset>
#include <math.h>
#include <time.h>
#include <assert.h>
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define pb push_back 
#define mp make_pair
#define ff first
#define ss second
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define all(x) x.begin(),x.end() 
#define PII pair <int,int>
#define N 500005
#define MOD 1000000007
#define INF 1000000000000000000
using namespace std;

int main()
{
	double n, k;
	double ans = 0;
	cin >> n >> k;
	int tmp, cnt;
	for (int i = 1; i <= n; ++i)
	{
		tmp = i;
		cnt = 0;
		float t = 1;
		while(tmp < k)
		{
			tmp = tmp * 2;
			cnt++;
			t = t * 2;
		}
		ans += (1 / t) * (1 / n);
	}
	printf("%.10lf\n", ans);
}	

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

namespace AtCoder0913
{
    class Program
    {
        static void Main(string[] args)
        {
            int Na = int.Parse(Console.ReadLine());
            //int[] N = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray() ;

            if (Na == 0)
            {
                Console.WriteLine(1);
            }
            else
            {
                Console.WriteLine(0);
            }
        }
    }
}


Measured memory_bytes: 27476
#pragma region Macros
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;
#pragma endregion

void solve() {
    int n;
    cin >> n;
    vector<int> cnt(n+1);
    for (int i=0; i<n-1; ++i) {
        int tmp;
        cin >> tmp;
        cnt.at(tmp)++;
    }
    for (int i=1; i<n+1; ++i) {
        cout << cnt.at(i) << '\n';
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}


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

int mm[500][500];

int is_cat(string &cry, int l, int r) {
    if (l == r) return 1;
    if ((r - l) % 3 || cry[l] != 'm' || cry[r-1] != 'w') return 0;
    if (~mm[l][r]) return mm[l][r];
    for (int i=l+1; i<r-1; ++i) {
        if (cry[i] == 'e' && is_cat(cry, l+1, i) && is_cat(cry, i+1, r-1)) {
            return mm[l][r] = 1;
        }
    }
    return mm[l][r] = 0;
}

int main() {
    string S;
    cin >> S;
    for (int i=0; i<500; ++i) {
        for (int j=0; j<500; ++j) {
            mm[i][j] = -1;
        }
    }
    cout << (is_cat(S, 0, (int)S.size()) ? "Cat" : "Rabbit") << endl;
    return 0;
}


Measured memory_bytes: 4188
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
signed main(){
  string S,T; cin>>S>>T;
  map<string,int> M;
  cin>>M[S]>>M[T];
  string U; cin>>U;
  M[U]--;
  cout<<M[S]<<" "<<M[T]<<endl;
  }



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=16,mod=1e9+7;
int qpow(int a,int b)
{
	int ans=1;
	while(b)
	{
		if(b&1)ans=(ll)ans*a%mod;
		a=(ll)a*a%mod;
		b>>=1;
	}
	return ans;
}
int add(int a,int b)
{
	a+=b;return a>=mod?a-mod:a;
}
int p2[maxn*maxn]={1},dp[1<<maxn|10];
int n,m,yc[maxn+1][1<<maxn|10];
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++)p2[i]=add(p2[i-1],p2[i-1]);
    for(int i=1;i<=m;i++)
    {
    	int u,v;
    	scanf("%d%d",&u,&v);
    	for(int s=0;s<(1<<n);s++)
    	{
    		if((s>>v-1)&1)
    		{
    			yc[u][s]++;
			}
		}
	}
	for(int s=0;s<(1<<n);s++)
	{
		dp[s]=1;
		if(((s>>0)&1)==((s>>1)&1))
		{
		    for(int u=s;u;u=(u-1)&s)
		    {
		    	if(u!=s&&u!=0)
		    	if(((u>>0)&1)==((u>>1)&1))
		    	{
		    		int v=s-u;
		    		int s1=0,s2=1;
		    		for(int i=1;i<=n;i++)
		    		{
		    			if((v>>i-1)&1)
		    			{
		    				s1=add(s1,yc[i][u]);
						}
						if((u>>i-1)&1)
						{
							s2=(ll)s2*(p2[yc[i][v]]-1)%mod;
						}
					}
					dp[s]=add(dp[s],(ll)dp[u]*s2%mod*p2[s1]%mod);
				}
			}
		}
	}
	cout<<add(p2[m],mod-dp[(1<<n)-1]);
	return 0;
} 

Measured memory_bytes: 5588
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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

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

    string ans="APPROVED";
    rep(i,N){
        if(A[i]%2==0 && A[i]%3!=0 && A[i]%5!=0) ans="DENIED";
    }
    cout << ans << endl;



}


Measured memory_bytes: 256
using System;

class Between
{
	static public void Main(string[] args)
	{
		long a,b,x;
		string[] vals = Console.ReadLine().Split(' ');

		a = long.Parse(vals[0]);
		b = long.Parse(vals[1]);
		x = long.Parse(vals[2]);

		long c;

		if(a % x == 0)
			c = a;
		else
			c = (a/x) * x + x;

		if(c > b)
			Console.WriteLine(0);
		else
			Console.WriteLine((b-c) / x + 1);
	}
}


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

vector<int> forintinput(int n) {
	vector<int> x(100000);
	for(int i = 0;i < n;i++) cin >> x[i];
	return x;
}
int main(){
	string s;
	cin >> s;
	if(s[0] == 'S'){
		if(s[1] == 'U'){
			cout << 7 << endl;
		}else{
			cout << 1 << endl;
		}
	}else if(s[0] == 'T'){
		if(s[1] == 'U'){
			cout << 5 << endl;
		}else{
			cout << 3 << endl;
		}
	}else if(s[0] == 'M'){
		cout << 6 << endl;
	}else if(s[0] == 'W'){
		cout << 4 << endl;
	}else{
		cout << 2 << endl;
	}
}

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1000000;
#include <map>
#include <math.h>
 
using ll = long long;
using namespace std;

ll n, k;
const ll mod = 1000000007;

int main(){
    int n;
    cin >> n;
    cout << "ABC" << n << endl;

}


Measured memory_bytes: 256
def ina;gets.split(' ').map(&:to_i);end
def ini;gets.to_i;end
n=ini
a=ina
h={}
a.each do |ai|
  if h.key? ai
    h[ai]+=1
  else
    h[ai]=1
  end
end
s=a.sum
q=ini
q.times do
  b,c=ina
  if h.key? b
    h[c]=0 unless h.key? c
    s+=h[b]*(c-b)
    h[c]+=h[b]
    h[b]=0
  end
  p s
end

Measured memory_bytes: 26756
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  int n;
  cin>>n;
  ll a[n+1]={},b[n+1]={};
  ll suma=0,sumb=0;
  vector<pair<ll,int>> v;
  for(int i=0;i<n;i++){
      cin>>a[i]>>b[i];
      suma+=a[i];
      sumb+=b[i];
      v.push_back(make_pair(a[i],i));
      v.push_back(make_pair(b[i],i));
  }
  sort(v.begin(),v.end());

  int num[n+1]={};
  ll sum=0;
  bool flag=false;
  for(int i=0;i<n;i++){
      num[v[i].second]++;
      if(num[v[i].second]==2) flag=true;
      sum+=v[i].first;
  }

  if(!flag){
      ll res=1e18;
      for(int i=0;i<n;i++){
          ll mi=min(a[i],b[i]);
          if(v[n].second==i){
              res=min(res,sum-mi+v[n+1].first);
          }else{
              res=min(res,sum-mi+v[n].first);
          }
      }
      sum=res;
  }

  cout<<min(sum,min(suma,sumb))<<endl;

  return 0;
}


Measured memory_bytes: 7920
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

N, M = map(int, input().split())
Network = UnionFind(N)

for i in range(M):
    a,b = list(map(int,input().split()))
    Network.union(a-1,b-1)
print(Network.group_count() -1)

Measured memory_bytes: 75208
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;

int main()
{
	int H, W;
	cin >> H >> W;
	vector<vector<int>> c(10);
	vector<vector<int>> A(H);
	for (auto i = 0; i < 10; i++){
		for (auto j = 0; j < 10; j++){
			int buf;
			cin >> buf;
			c[i].push_back(buf);
		}
	}

	for (auto k = 0; k < 10; k++){
		for (auto i = 0; i < 10; i++){
			for (auto j = 0; j < 10; j++){
				if (c[i][j] > c[i][k] + c[k][j]){
					c[i][j] = c[i][k] + c[k][j];
				}
			}
		}
	}

	int cost = 0;
	for (auto i = 0; i < H;i++){
		for (auto j = 0; j < W; j++){
			int A;
			cin >> A;
			if (A >= 0){
				cost += c[A][1];
			}
		}
	}
	cout << cost;
	return 0;
}


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

using namespace std;

int main(){
    int N,K,one;
    cin >> N >> K;
    vector<int> A(N);
    for(int i=0;i<N;i++){
        cin >> A[i];
        if(A[i]==1){
            one=i;
        }
    }

    if(N==K){
        cout << "1" << endl;
    }else if(one%(K-1)==0 && (N-one-1)%(K-1)==0){
        cout << one/(K-1) + (N-one-1)/(K-1) << endl;  
    }else if(one%(K-1)==0 || (N-one-1)%(K-1)==0){
        cout << one/(K-1) + (N-one-1)/(K-1) + 1 << endl;
    }else if(one%(K-1) + (N-one-1)%(K-1) <= K-1){
        cout << one/(K-1) + (N-one-1)/(K-1) + 1 << endl;
    }else{
        cout << one/(K-1) + (N-one-1)/(K-1) + 2 << endl;
    }

}

Measured memory_bytes: 640
#include <bits/stdc++.h>
 
using namespace std;
 
#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;

int n, f, m;
string s;

int main () {
	//ios_base::sync_with_stdio(0); cin.tie(0);
 
    cin >> n;

    cout << 0 << endl << flush;
    cin >> s;

    if (s[0] == 'V')
        return 0;
    if (s[0] == 'M')
        m = 0, f = 1;
    if (s[0] == 'F')
        m = 1, f = 0;

    int i = 0, j = n, mit = (i+j)/2, rep = 18;
    while (rep--) {
        mit = (i+j)/2;

        cout << mit << endl << flush;
        cin >> s;

        if (s[0] == 'V')
            return 0;

        if (s[0] == 'M')
            if (mit % 2 == m)
                i = mit;
            else
                j = mit;

        if (s[0] == 'F')
            if (mit % 2 == f)
                i = mit;
            else
                j = mit;
    }

    cout << i-1 << endl << flush;
    cin >> s;

    if (s[0] != 'V')
        return -1;

	return 0;
}


Measured memory_bytes: 852
#include<bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define ll long long
#define maxn 300005
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define ms(i) memset(i,0,sizeof(i));
#define ms1(i) memset(i,-1,sizeof(i));
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 998244353;
ll n, k, v[51];
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> k;
    n = 50;
    for (int i = 0 ; i < 50 ; i++) {
        v[i] = 49 + k / 50;
    }
    k %= 50;
    for (int i = 0 ; i < k ; i++) {
        v[i] += n + 1;
        for (int j = 0 ; j < n ; j++) {
            v[j]--;
        }
    }
    cout << n << '\n';
    f (n) {
        cout << v[i] << ' ' ;
    }
    cout << '\n';
}

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

using namespace std;

int main()
{
  string l1, l2;
  cin >> l1 >> l2;
  bool y = l1.c_str()[0] == l2.c_str()[2] && l1.c_str()[1] == l2.c_str()[1] && l1.c_str()[2] == l2.c_str()[0];
  cout << (y ? "YES" : "NO") << endl;
}

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

int main() {
  int N;
  int pointA = 0;
  int pointB = 0;
  
  cin >> N;
  vector<int> cards(N);
    
  for(int i = 0; i < N; i++){
    cin >> cards.at(i);
  }
  //ここで、cardsに配られたカードを入れる//
  
  sort(cards.begin(), cards.end());
  reverse(cards.begin(), cards.end());
    
  
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      pointA += cards.at(i);
    }
    else{
      pointB += cards.at(i);
    }
  }
  
 cout << pointA - pointB << endl;
      
  
}



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

using namespace std;
typedef long long ll;
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
typedef pair<int, int> pii;

const int mn = 2e5 + 5;
const int mod = 1e9 + 7;

int n, k;
vector<int> g[mn];
ll ans = 1;

void dfs(int x, int fa, int dep) {
    if (dep == 0) {
        ans = ans * k % mod;
        for (int i = 0; i < sz(g[x]); i++) {
            ans = ans * (k - 1 - i) % mod;
        }
    } else {
        for (int i = 0; i < sz(g[x]) - 1; i++) {
            ans = ans * (k - 2 - i) % mod;
        }
    }
    for (auto &i:g[x]) {
        if (i != fa) {
            dfs(i, x, dep + 1);
        }
    }
}

int main() {
#ifdef trote
    freopen("../1.txt", "r", stdin);
#endif
    scanf("%d%d", &n, &k);
    for (int i = 1; i < n; i++) {
        int u, v;
        scanf("%d%d", &u, &v);
        g[u].pb(v);
        g[v].pb(u);
    }
    dfs(1, 0, 0);
    printf("%lld\n", ans);

    return 0;
}

Measured memory_bytes: 11520
#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define shalaby ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);cerr.tie(0);
#define mod 100000000
using namespace std;

inline int D()
{
    int t;
    scanf("%d",&t);
    return t;
}
inline ll llD()
{
    ll t;
    scanf("%lld",&t);
    return t;
}
 ll Max=1e18+8;
const int OO=-1e6;
int xt[4]= {1,0,0,-1};
int yt[4]= {0,1,-1,0};
////////////////////////////////////////////////////////////////////////////////////

ll mem[100][100005],a[105],b[105],n,m,k;
bool valid(int x,int y)
{
    return x>-1 && y>-1 && x<n && y<m;
}
void init()
{
    memset(mem,-1,sizeof mem);
}
/////////////////////////////////////////////////////////////////////
ll solve(int i=0,int m=k)
{

        if(i==n)
            return 0;
ll &ret=mem[i][m];
if(~ret) return ret;

ll leave=solve(i+1,m);
ll take=0;
if(a[i]<=m)
{
    take=solve(i+1,m-a[i])+b[i];
}
return ret=max(leave,take);

}

int main()
{
    init();
    int T=1;
///   T=D();
    while(T-->0)
    {
        cin >> n >>k;
        for(int i=0; i<n; i++)
        {
            cin >> a[i]>>b[i];
        }
        cout << solve();
    }
}


Measured memory_bytes: 81744
/**
 * Title: B - String Palindrome
 * Url: https://atcoder.jp/contests/abc159/tasks/abc159_b
 */
#include<bits/stdc++.h>

using namespace std;

#define ll long long

bool is_kaibun(string s) {
    string rev_s = s;
    std::reverse(rev_s.begin(), rev_s.end());
    return s == rev_s;
}

int main() {

    string s; cin >> s;
    string rev_s = s;
    reverse(rev_s.begin(), rev_s.end());
    bool flag = true;
    if(!is_kaibun(s)) flag = false;
    if(!is_kaibun(s.substr(0, (s.length()-1)/2))) flag = false;
    if(!is_kaibun(s.substr((s.length()+3)/2-1))) flag = false;
    if(flag) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

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

using ll = long long;
using Pi = pair < int, int >;

constexpr int INF = (1 << 30) - 1;
constexpr int dy[] = { 1, 0, -1, 0, 1, -1, -1, 1 };
constexpr int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };

template < typename T > T gcd(T a, T b) { return ( b ? gcd(b, a % b) : a ); }
template < typename T > T lcm(T a, T b) { return ( a / gcd(a, b) * b ); }

int main()
{
    bool dp[111111] = {};
    int X;

    cin >> X;

    dp[0] = true;
    for ( int i = 100; i <= 105; i++ ) {
        for ( int j = 0; j <= X; j++ ) {
            dp[j + i] |= dp[j];
        }
    }

    if ( dp[X] ) {
        cout << 1 << endl;
    } else {
        cout << 0 << endl;
    }

    return ( 0 );
}


Measured memory_bytes: 384
//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
//use 1LL<<i to for 64 bit shifting , (ll)2 because by default 2 is ll
//take care of precedence rule of operators 
//do not forget to change the sizes of arrays and value of contants and other things after debugging  
 
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 ll_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 ll_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<ll>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define ld long double
#define pi acos(-1.0)
 
#define SZ(x)  (ll)(x.size())
 
//comment the below if not required
 
/*
 
#define ss second.second
#define ff first.first
#define f first
#define s second
#define sf second.first
#define fs first.second
*/
 
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

//cout<<"Case #"<<c<<": "<<ans<<"\n" ;

int main()
{

    ll n,i,ans=0,s;

    cin>>n;

    ll a[n+1];

    rep(i,1,n+1)
        cin>>a[i];


    s = a[1];

    rep(i,2,n+1)
    {
        ans  = (ans + ((s*a[i])%mod))%mod;
        s = (s + a[i])%mod;
    }


    cout<<ans<<"\n";

    return 0;

}

Measured memory_bytes: 5156
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    string S; cin >> S;
    map<char,int> mp;
    REP(i,S.size()) mp[S[i]]++;
    bool ans = true;
    if (((mp['S'] == 0) ^ (mp['N'] == 0)) == true) ans = false;
    if (((mp['E'] == 0) ^ (mp['W'] == 0)) == true) ans = false;

    ATYN(ans)

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	
	static int mod = (int)1e9+7;
	static int memo[] = new int[9];
	public static void main(String[] args) {		
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt();
		int W = sc.nextInt();
		int K = sc.nextInt();
		sc.close();

		makeMemo();
		
		long dp[][] = new long[H+1][W];
		dp[0][0]=1;
		for(int h=0;h<H;h++) {
			for(int w=0;w<W;w++) {
				//右
				if(w+1<W) {
					dp[h+1][w+1]+=dp[h][w]*memo[w]%mod*memo[(W-1)-(w+1)]%mod;
					dp[h+1][w+1]%=mod;
				}
				//左
				if(w-1>=0) {
					dp[h+1][w-1]+=dp[h][w]*memo[w-1]%mod*memo[(W-1)-w]%mod;
					dp[h+1][w-1]%=mod;
				}
				//下
				dp[h+1][w] += dp[h][w]*memo[w]%mod*memo[(W-1)-w]%mod;
				dp[h+1][w]%=mod;
				
			}
		}
		long ans = dp[H][K-1];
		System.out.println(ans);
	}
	//縦棒の数を引数にする
	static void makeMemo(){	
		memo[0]=1;
		memo[1]=1;
		for(int i=2;i<9;i++) {
			for(int bit = 0;bit<2<<(i-2);bit++) {
				int before = 0;
				for(int j=0;j<9;j++) {
					int now = (bit>>j&1);
					if(before==1&&now==1) break;
					before = now;
					if(j==8)memo[i]++;
				}
			}
		}
		
		
	}
}

Measured memory_bytes: 22868
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int A,B;
    cin >> A >> B;
    string S;
    cin >> S;
    bool flag = true;
    for(int i=0; i<S.size(); i++)
    {
    	if(i==A&&S[i]!='-') flag = false;
    	else if(i!=A&&S[i]=='-') flag = false;
    }
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string>
#include<utility>
#include<iostream>
#include<queue>
#include<math.h>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<bitset>

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

int main()
{
    //printf("hoge\n");
    int dx[4]={1,0,-1,0};
    int dy[4]={0,-1,0,1};
    queue<pair<int,int> > keep,que;
    char ban[1005][1005];
    int h,w;
    scanf("%d%d\n",&h,&w);
    //printf("%d %d",h,w);
    
    REP(i,h){
        REP(j,w){
            scanf("%c",&ban[i][j]);
            if(ban[i][j]=='#'){
                keep.push(make_pair(i,j));
                //printf("###%d %d###\n",i,j);
            }
        }
        scanf("\n");
    }
    //REP(i,h)REP(j,w)printf("%c",ban[i][j]);
    
    int num=0;
    while(!keep.empty()){
        num+=1;
        //printf("###################\n");
        que=keep;
        while(!keep.empty())keep.pop();
        while(!que.empty()){
            pair<int,int> p=que.front();
            que.pop();
            REP(i,4){
                if(ban[p.first+dy[i]][p.second+dx[i]]=='.'){
                    ban[p.first+dy[i]][p.second+dx[i]]='#';
                    keep.push(make_pair(p.first+dy[i],p.second+dx[i]));
                    //printf("###%d %d###\n",p.first+dy[i],p.second+dx[i]);
                }
            }
        }
    }
    printf("%d\n",num-1);
    return 0;
}

Measured memory_bytes: 17552
//created by pyoxiao on 2020/04/19
#include<bits/stdc++.h>
#define LL long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define CL(a, b) memset(a, b, sizeof(a))
using namespace std;
const int mod = 1e9 + 7;
LL fpow(LL a, LL b, LL p = mod){LL ans = 1; a %= p; while(b) {if(b & 1) ans = ans * a % p; b >>= 1; a = a * a % p;} return ans;}
LL gcd(LL a, LL b){return b == 0 ? a : gcd(b, a % b);}
const double PI = acos(-1.0);
void solve() {
    double r;
    scanf("%lf", &r);
    printf("%.2f\n", 2 * PI * r);
}
int main() {
    int T = 1;
    // scanf("%d", &T);
    while(T --) 
        solve();
    return 0;
}

Measured memory_bytes: 3816
#include <stdio.h>
int main(void){
	int x1,x2,l,p,o;
	scanf("%d %d",&x1,&x2);
	if(x1>x2 ){
		l=x1-x2;
		printf("%d\n",l);
	}
	else if(x2>x1){
		p=x2-x1;
		printf("%d\n",p);
	}
	else if(x1==x2){
		o=x1-x2;
		printf("%d\n",o);
	}
	return 0;
}


Measured memory_bytes: 2064
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    x,y = LI()
    f = [0,1,3,1,2,1,2,1,1,2,1,2,1]
    if f[x] == f[y]:
        print("Yes")
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()


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

int main() {
  int N;
  cin >> N;
  int ac = 0;
  int wa = 0;
  int tle = 0;
  int re = 0;
  rep(i,N) {
    string S;
    cin >> S;
    if (S[0] == 'A') ac++;
    if (S[0] == 'W') wa++;
    if (S[0] == 'T') tle++;
    if (S[0] == 'R') re++;
  }
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  return 0;
}

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

using namespace std;

typedef long long ll;
#define int ll
typedef long double ld;

typedef pair<int,int> pii;
#define x first
#define y second

const int N=5e5+100,Q=5e5+100;

struct query
{
    int l,r,ind;
};

bool operator<(query x,query y)
{
    return x.r<y.r;
}

int n;
int c[N];
int last[N];
query qs[Q];
int ans[Q];
int t[N];

int sum (int r)
{
//    cout<<"sum("<<r<<")=";
	int result = 0;
	for (; r >= 0; r = (r & (r+1)) - 1)
		result += t[r];
//    cout<<result<<"\n";
	return result;
}

void inc (int i, int delta)
{
//    cout<<"inc("<<i<<","<<delta<<")\n";
	for (; i <= n; i = (i | (i+1)))
		t[i] += delta;
}

int sum (int l, int r)
{
    int result=sum (r) - sum (l-1);
//    cout<<"sum("<<l<<","<<r<<")="<<result<<"\n";
	return result;
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int q;
    cin>>n>>q;
    for(int i=1;i<=n;i++)
        cin>>c[i];
    for(int i=1;i<=q;i++)
        cin>>qs[i].l>>qs[i].r,
        qs[i].ind=i;
    sort(qs+1,qs+q+1);
    int cur_r=0;
    for(int i=1;i<=q;i++)
    {
        while(cur_r<qs[i].r)
        {
            cur_r++;
            if(last[c[cur_r]])
                inc(last[c[cur_r]],-1);
            inc(cur_r,1);
            last[c[cur_r]]=cur_r;
        }
        ans[qs[i].ind]=sum(qs[i].l,qs[i].r);
    }
    for(int i=1;i<=q;i++)
        cout<<ans[i]<<"\n";
}


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

using namespace std;
typedef long long ll;

int main(){

  int n,x;
  cin >> n >> x;
  ll cnt = 0;

  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }

  for (int i = 0; i < n - 1; i++) {
    if (a.at(i)+a.at(i+1) > x) {
      cnt += (a.at(i)+a.at(i+1))-x;
      //cout << cnt <<endl;
      a.at(i+1) = x-a.at(i);
      if (a.at(i+1) < 0) {
        int t = a.at(i+1);
        a.at(i+1) = 0;
        a.at(i) += t;
      }
    }
  }

  /*for (int i = 0; i < n; i++) {
    cout<<"\n" << a.at(i) << endl;
  }*/

  cout << cnt << endl;
}


Measured memory_bytes: 640
def counting_sort(A, k):
    B = [0] * len(A)
    C = [0] * k

    for a in A:
        C[a] += 1

    for i in range(1, k):
        C[i] += C[i - 1]

    for a in A:
        B[C[a] - 1] = a
        C[a] -= 1

    return B


def main():
    n = int(input())
    A = [int(x) for x in input().split()]
    print(*counting_sort(A, 10001))


main()


Measured memory_bytes: 224248
from collections import deque
X = input()
n = len(X)

q = deque()
for x in X:
    if x == 'S':
        q.append(x)
    else:
        if len(q) == 0 or q[-1] == 'T':
            q.append(x)
        else:
            q.pop()

ans = len(q)
print(ans)


Measured memory_bytes: 5092
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>
#include<set>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)

int main(){
    string s;
    cin >> s;
    int ans = 0;
    rep(i, s.size()){
        if (i % 2 == 0){
            if(s[i] == 'p') ans--;
        }else{
            if(s[i] == 'g') ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 512