akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;
using vi = vector<int>;

#define in(v) v; cin >> v;
void ins() {}
template<class T,class... Rest>void ins(T& v,Rest&... rest){cin>>v;ins(rest...);}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))

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

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

int main() {
  double in(A); double in(B); double in(H); double in(M);

  double a = 1.0 * (H + (M / 60)) / 12 * 360.0;
  double b = 1.0 * M / 60 * 360;

  double theta = abs(a-b);
  theta = min(theta, 360.0 - theta);
  theta = theta / 360.0 * 2.0 * M_PI;
  debug(a, b);
  debug(theta);


  cout << fixed << setprecision(15);
  cerr << fixed << setprecision(15);
  debug(theta);
  cout << sqrt(A*A + B*B - 2*A*B*cos(theta)) << endl;

  return 0;
}


Measured memory_bytes: 4224
#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>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 1e-5
#define LONG_INF 2000000000000000000LL
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144
#define REP(a,b) for(long long a = 0;a < b;++a)
int main(){
	long double a, b, x;
	cin >> a >> b >> x;
	x /= a;
	cout << fixed << setprecision(30);
	if (a * b / 2.0 >= x) {
		long double hoge = (x*2.0) / b;
			cout << 90.0 - (atan(hoge / b) * 180 / Ma_PI) << endl;
			return 0;
	}
	x /= a;
	long double hoge = (x * 2.0) - b;
	cout << 90.0 - (atan(a / (b - hoge)) * 180 / Ma_PI) << endl;
}


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

typedef uint64_t u64;
typedef int64_t i64;
typedef uint32_t u32;
typedef int32_t i32;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

using namespace std;

#define REP(idx, N) for (u64 idx = 0; idx < N; idx++)

int main() {

  u32 n, k;
  u32 d;
  u32 a;
  cin >> n >> k;

  vector<bool> o(n, false);
  REP(i, k) {
    cin >> d;
    REP(j, d) {
      cin >> a;
      o[a-1] = true;
    }
  }

  cout << count_if(o.begin(), o.end(), [](auto s){return s==false;});

  return 0;
}


Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define all(in) in.begin(), in.end()
#define FIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef pair<ll, ll> pll;

int main(){
    FIO;
    ll n;
    cin >> n;
    ll arr[n];
    for(ll i = 0 ; i < n ; i++){
        cin >> arr[i];
    }
    ll cnt = 0;
    for(ll i = 1 ; i < n-1 ; i++){
        if(arr[i] > arr[i-1] && arr[i] < arr[i+1]){
            cnt++;
        }else if(arr[i] > arr[i+1] && arr[i] < arr[i-1]){
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <math.h>
#define rep(i,a,b) for(int i=(a); i<(b); ++i)
typedef long long ll;
using namespace std;

int main() {
    ll x;
    cin >> x;
    for (ll i=-1000; i<=1000; ++i){
        for(ll j=-1000; j<=1000; ++j) {
            if (pow(i,5)-pow(j,5)==x) {
                cout << i << " " << j << endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 3560
#include "bits/stdc++.h"
using namespace std;

// コンテスト中のみ
#define int long long


#define ll long long
#define rep(i,n) for(int i = 0; i < (n); i++)
int MOD = 1000000007;
const int inf = 1001001001;
const ll INF = 1LL << 60;
template <class Abel> struct BIT {
	vector<Abel> dat[2];
	Abel UNITY_SUM = 0;                     // to be set

	/* [1, n] */
	BIT(int n) { init(n); }
	void init(int n) { for (int iter = 0; iter < 2; ++iter) dat[iter].assign(n + 1, UNITY_SUM); }

	/* a, b are 1-indexed, [a, b) */
	inline void sub_add(int p, int a, Abel x) {
		for (int i = a; i < (int)dat[p].size(); i += i & -i)
			dat[p][i] = dat[p][i] + x;
	}
	inline void add(int a, int b, Abel x) {
		sub_add(0, a, x * -(a - 1)); sub_add(1, a, x); sub_add(0, b, x * (b - 1)); sub_add(1, b, x * (-1));
	}

	/* a is 1-indexed, [a, b) */
	inline Abel sub_sum(int p, int a) {
		Abel res = UNITY_SUM;
		for (int i = a; i > 0; i -= i & -i) res = res + dat[p][i];
		return res;
	}
	inline Abel sum(int a, int b) {
		return sub_sum(0, b - 1) + sub_sum(1, b - 1) * (b - 1) - sub_sum(0, a - 1) - sub_sum(1, a - 1) * (a - 1);
	}

	/* debug */
	void print() {
		for (int i = 1; i < (int)dat[0].size(); ++i) cout << sum(i, i + 1) << ",";
		cout << endl;
	}
};
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N; cin >> N;

	int Q; cin >> Q;
	vector<int> a(N);
	for (int i = 0; i < N; ++i) cin >> a[i];

	vector<int> lefts(Q), rights(Q), ids(Q);
	for (int i = 0; i < Q; ++i) {
		cin >> lefts[i] >> rights[i];
		--lefts[i];
		ids[i] = i;
	}
	sort(ids.begin(), ids.end(), [&](int i, int j) {
		return rights[i] < rights[j]; });

	BIT<int> bit(N + 5);
	vector<int> prev(1100000, -1);
	vector<int> res(Q, 0);
	int r = 0;
	for (auto i : ids) {
		for (; r < rights[i]; ++r) {
			bit.add(prev[a[r]] + 2, r + 2, 1);
			prev[a[r]] = r;
		}
		int tmp = bit.sum(lefts[i] + 1, lefts[i] + 2);
		res[i] = max(res[i], tmp);
	}
	for (int i = 0; i < Q; ++i) cout << res[i] << endl; return 0;
}

Measured memory_bytes: 39712
#include <stdio.h>

int main(void){
  int D,T,S;
  scanf("%d%d%d",&D, &T, &S);
  
  int a = T*S;
  
  if(a >= D){
    printf("Yes");
  }
  else{
    printf("No");
  }
  return 0;
}

Measured memory_bytes: 1716
x, n = map(int, input().split())
p = [int(v) for v in input().split()]
ans = None
if x not in p:
    ans = x
else:
    diff = 101
    for i in range(0, max(p) + 2):

        if abs(x - i) < diff and i not in p:
            ans = i
            diff = abs(x - i)
print(ans)


Measured memory_bytes: 9172
#include<cstdio>
const int inf=1<<28;
int N,a[60],mn,mx,mnp,mxp,m,x[110],y[110];
void getm(){
	mn=inf,mx=-mn;
	for(int i=1;i<=N;i++)a[i]<mn?mn=a[mnp=i]:1,a[i]>mx?mx=a[mxp=i]:1;
}
void oper(int i,int j){
	a[j]+=a[i];
	if(a[j]>inf)a[j]=inf;
	x[m]=i;y[m++]=j;
}
void calc(){
	for(int i=1;i<N;i++){
		if(a[i+1]<a[i])oper(i,i+1);
	}
}
int main(){
	scanf("%d",&N);
	for(int i=1;i<=N;i++)scanf("%d",a+i),a[i]<mn?mn=a[i]:1,a[i]>mx?mx=a[i]:1;
	getm();
	if(mn<0&&mx>0){
		if(mx>-mn){
			for(int i=1;i<=N;i++)if(a[i]<0)oper(mxp,i);
		}
		else{
			for(int i=1;i<=N;i++)if(a[i]>0)oper(mnp,i);
		}
	}
	getm();
	if(mn>=0)calc();
	else{
		int k;
		for(int i=1,j=N;i<j;i++,j--)k=a[i],a[i]=a[j],a[j]=k;
		for(int i=1;i<=N;i++)a[i]*=-1;
		k=m;
		calc();
		for(int i=k;i<m;i++)x[i]=N+1-x[i],y[i]=N+1-y[i];
	}
	printf("%d\n",m);
	for(int i=0;i<m;i++)printf("%d %d\n",x[i],y[i]);
}

Measured memory_bytes: 128
#[warn(unused_imports)]
use proconio::{
   fastout, input,
   marker::{Bytes, Chars, Isize1, Usize1},
};

#[fastout]
fn main() {
   input! {
      n:usize,
      mut k:usize,
      mut a:[Usize1;n],
   }

   let mut ans = 0;
   while k != 0 {
      if k & 1 == 1 {
         ans = a[ans];
      }
      let b = a.clone();
      for j in 0..n{
         a[j] = b[a[j]];
      }
      k >>= 1;
   }

   println!("{}", ans+1);
}


Measured memory_bytes: 6420
/***
        ***Fresher***
    Md Mahfujur Rahman Khan
    Dept. of CSE
    CSE-28 Batch
    JU-48 Batch
    Jahangirnagar University

***/
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<queue>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<functional>
#include<set>
#include<map>
#include<climits>
#include<numeric>
#include<utility>
using namespace std;
#define V_ vector
#define Q_ queue
#define S_ set
#define ST_ stack
#define M_ map
#define DQ_ deque
/***PAIR***/
#define pii pair<ll,ll>
#define pci pair<char,ll>
#define psi pair<string, ll>
#define pis pair<ll,string>
#define pic pair<ll, char>
/***MAP***/
#define mii map<ll,ll>
#define msi map<string, ll>
#define mis map<ll, string>
#define mib map<ll,bool>
#define msb map<string,bool>
#define mci map<char, ll>
/***VECTOR***/
#define vi vector<ll>
#define vs vector<string>
/***ITERASTORS***/
#define ivi vector<ll> :: iterator
#define ivs vector<string> :: iterator
#define imii map<ll,ll> :: iterator
#define imsi map<string,ll> :: iterator
#define imis map<ll, string> :: iterator
#define imib map<ll, bool> :: iterator
#define imsb map<string, bool> :: iterator
#define imci map<char, ll> :: iterator
/*** FAST ***/
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
/***FUNCTIONS AND MACROS***/
#define F first
#define S second
#define M_P(x, y) make_pair(x, y)
#define PB(x) push_back(x)
#define PP(x) push(x)
#define RSZ(n) resize(n)
#define POB pop_back()
#define P_ pop()
#define CL_ clear()
#define LEN_ length()
#define SZ_ size()
#define CNT(x) count(x)
#define FF first.first
#define FS first.second
#define SF second.first
#define SS second.second
#define B_ begin()
#define E_ end()
#define F_ front()
#define t_ top()
#define IN_ insert
#define ER_  erase
#define GT(x) getline(cin , x)
#define NL_   "\n"
#define SP_ " "
#define R_0 return 0
#define R_ return

#define ul unsigned long long int
#define ll long long int
/***
//prime fact
#define most_prime_loop 10001
#define most_prime_number 20000010
#define prime_MAX_arr 20000010/2
ll PRIME[prime_MAX_arr];
void seive()
{
    PRIME[0] = 0;
    for(auto &x: PRIME )
        x = 1;
    for(ll i= 3; i <= most_prime_loop; i+=2)
    {
        for(ll j = i*i; j <= most_prime_number; j+=2*i)
            PRIME[j/2] = 0;
    }
}
***/
#define fr(i, n) for( ll i = 0; i < n; i++)
#define fe(x, n) for( ll i = x; i <= n; i++)
#define fa(x,a)    for(auto &x : a)

#define pi acos(-1)

#define SR(x) sqrt(x)
#define IC   (ll)

const ll  inf = 1000000000;
ll i=0, T=0, N=0, tc =0, t= 0;
ll n=0, k=0;

int main()
{
 ll a, b;
 cin >> a >> b;
 if(a+b >= 10LL) cout <<"error";
 else cout << a+b;
    R_0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int M = sc.nextInt();

		int[] a = new int[A];
		int[] b = new int[B];
		for ( int i = 0 ; i < A ; i++ ) {
			a[i] = sc.nextInt();
		}
		for ( int i = 0 ; i < B ; i++ ) {
			b[i] = sc.nextInt();
		}
		int[] x = new int[M];
		int[] y = new int[M];
		int[] c = new int[M];
		for ( int i = 0 ; i < M ; i++ ) {
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			c[i] = sc.nextInt();
		}
		sc.close();

		int minA = Integer.MAX_VALUE;
		for ( int i = 0 ; i < A ; i++ ) {
			minA = Math.min(minA, a[i]);
		}
		int minB = Integer.MAX_VALUE;
		for ( int i = 0 ; i < B ; i++ ) {
			minB = Math.min(minB, b[i]);
		}
		int minPrice = minA + minB;

		for ( int i = 0 ; i < M ; i++ ) {
			minPrice = Math.min(minPrice, a[x[i] - 1] + b[y[i] - 1] - c[i]);
		}
		System.out.println(minPrice);
	}
}


Measured memory_bytes: 135076
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		if (A%K==0||B%K==0) {
			System.out.println("OK");
			return ;
		}
		if (A/K==B/K) {
			System.out.println("NG");
		} else {
			System.out.println("OK");
		}
	}

}


Measured memory_bytes: 35764
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1 = sc.nextInt();
    int a2 = sc.nextInt();
    int a3 = sc.nextInt();
    int max = Math.max(a1, Math.max(a2, a3));
    int min = Math.min(a1, Math.min(a2, a3));
    int ans = max - min;
    
    System.out.println(ans);
  }
}

Measured memory_bytes: 23892
#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "Yes" << endl;
#define POK cout << "OK" << endl;
#define PNO cout << "No" << endl;
#define PNG cout << "NG" << endl;

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

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

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>
//  ba;
ll _gcd(ll a, ll b) { return b != 0 ? _gcd(b, a % b) : a; }
signed main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  vector<int> l(n + 1);
  vector<int> r(n);
  l[0] = 0;
  repz(i, 1, n + 1) l[i] = _gcd(l[i - 1], a[i - 1]);
  r[n - 1] = 0;
  for (int i = n - 2; i >= 0; i--) r[i] = _gcd(r[i + 1], a[i + 1]);
  ll maxtemp = -10;
  rep(i, n) { chmax(maxtemp, _gcd(l[i], r[i])); }
  cout << maxtemp << endl;
  return 0;
}


Measured memory_bytes: 1408
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
      Scanner stdIn=new Scanner(System.in);
		String S=stdIn.next();
		int N=S.length(),i=N;
		while(true){
			if(i==0){
				System.out.println("YES");
				System.exit(0);
			}
			if(i<5){
				System.out.println("NO");
				System.exit(0);
			}
			String a=S.substring(i-5,i);
			if(a.equals("dream")||a.equals("erase")){
				i-=5;continue;
			}
			if(i==0){
				System.out.println("YES");
				System.exit(0);
			}
			if(i<6){
				System.out.println("NO");
				System.exit(0);
			}
			a=S.substring(i-6,i);
			if(a.equals("eraser")){
				i-=6;continue;
			}
			if(i==0){
				System.out.println("YES");
				System.exit(0);
			}
			if(i<7){
				System.out.println("NO");
				System.exit(0);
			}
			a=S.substring(i-7,i);
			if(a.equals("dreamer")){
				i-=7;continue;
			}
			if(i==0){
				System.out.println("YES");
				System.exit(0);
			}
			System.out.println("NO");
			System.exit(0);
		}
	}
}


Measured memory_bytes: 26872
n, m, k = map(int, input().split())
mod = 998244353

def powerDX(n, r, mod):
  if r == 0: return 1
  if r%2 == 0:
    return powerDX(n*n % mod, r//2, mod) % mod
  if r%2 == 1:
    return n * powerDX(n, r-1, mod) % mod

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
 
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
 
for i in range(2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = 0
for i in range(0, k+1):
  ans += m*cmb(n-1, i, mod)*pow(m-1, n-i-1, mod)
  ans %= mod
print(ans)

Measured memory_bytes: 33156
#include<bits/stdc++.h>
using namespace std;
const int N = (int)1e5+5;
//long long int a[N];
bool myfunc(int a, int b)
{
    return (a>b);
}
int main()
{
    int t;
  long long  int i,j,n,sum=0,x,y,a,b,sum1=0,p=0,h ;
    string s;
    vector<pair<int,string> >bishwo;
    cin>>p;
    for(i=0;i<p;i++)
    {
       cin>>s;
       bishwo.push_back(make_pair(1,s));
    }
    sort(bishwo.begin(),bishwo.end());

    for(i=1;i<p;i++)
    {
        if(bishwo[i].second==bishwo[i-1].second)
        {
             bishwo[i].first+=bishwo[i-1].first;
        }
    }
    sort(bishwo.begin(),bishwo.end());
     for(i=0;i<p;i++)
     {
          if(bishwo[p-1].first==bishwo[i].first)
        {
            cout<<bishwo[i].second<<endl;
        }

        //cout<<bishwo[i].second<<" "<<bishwo[i].first<<endl;
     }






    return 0;

}


Measured memory_bytes: 16492
#include <bits/stdc++.h>
#define LL long long
#define FOR(i,a,b) for(int i=a; i<=b; i++)
#define FOD(i,a,b) for(int i=a; i>=b; i--)
#define pa pair<int,int>
#define fi first
#define se second
#define MOD xxx
#define getbit(n,i) ((n>>(i-1))&1)
#define offbit(n,i) ((n^(1<<(i-1))
#define onbit(n,i) (n|(1<<(i-1)))
#define cntone(x) (__builtin_popcount(x))

using namespace std;
int n;
LL x,ma(0),ans(0);
int main()
{
    cin >> n;
    FOR(i,1,n)
    {
        cin >> x;
        ans += (ma-x)*(x<ma);
        ma = max ( ma , x);
    }
    cout << ans;
	return 0;
}


Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long 
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL)
//#include "debug.cpp"


int32_t main() 
{ 
    boost;
    int a,b;
    cin>>a>>b;
    int ans=-1;
    for(int i=1;i<=1000;i++){
        if((i*8)/100 == a && i/10 == b){
            ans=i;
            break;
        }
    }
    cout<<ans<<endl;
}


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

#include <ctype.h>

using namespace std;

int main(){

  int A,B;
  char S[20];
  int corrent=1;
  
  cin >> A >> B;
  cin >> S;

  for(int i = 0; i < A + B +1; i++){
    if(i == A){
      if(S[i] != '-'){
	corrent = 0;
      }
    }
    else{
      if(!isdigit(S[i])){
	corrent = 0;
      }
    }
  }

  if(corrent){
    cout << "Yes" << "\n";
  }
  else{
    cout << "No" << "\n";
  }
  
  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
from sys import stdin

s = stdin.readline().rstrip()
s_unique = list(set(s))
counter = [0 for i in range(len(s_unique))]

for i in range(len(s)):
    for j in range(len(s_unique)):
        if s[i] == s_unique[j]:
            counter[j] += 1
            break

for i in range(len(counter)):
    if counter[i] % 2:
        print("No")
        exit()
print("Yes")

Measured memory_bytes: 3060
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

a,p = li()
print((3*a + p) // 2)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memset
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
using namespace std;
typedef pair<int,int> PII;
typedef pair<long,long> PLL;

ll n,k;

int main() {
    ios::sync_with_stdio(false);
    cin>>n>>k;
    if(n%k==0){
        printf("0\n");
    }
    else{
        printf("%lld\n",min(n%k,k-(n%k)));
    }

    return 0;
}

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

int main()
{
    int i, j, n, k=0 ;
    cin >> n ;
    map<string, int> mp;
    while(n--)
    {
        string s ;
        cin >> s ;
        mp[s]++;
        k=max(k,mp[s]);
    }
    for(auto l=mp.begin(); l!=mp.end(); l++)
    {
        if(l->second==k)
            cout << l->first << endl ;
    }

    return 0;
}


Measured memory_bytes: 19232
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,m = inpl()
f = []
t = []
for i in range(m):
    a,b = inpl()
    if a == 1:
        f.append(b)
    elif b == n:
        t.append(a)
t = set(t)
for i in f:
    if i in t:
        print('POSSIBLE')
        break
else:
    print('IMPOSSIBLE')



Measured memory_bytes: 18164
import java.io.IOException;
import java.util.*;

class Main {
	static int count;
   public static void sort(int[] A,int left,int mid,int right){
	   int i,j,k;
	   int n1=mid-left;
	   int n2=right-mid;
	   int[] L=new int[n1+1];
	   int[] R=new int[n2+1];
	  
	   for(i=0;i<n1;i++){
	   L[i]=A[left+i];
	   }
	   for(i=0;i<n2;i++){
	   R[i]=A[mid+i];
	   }
	   L[n1]=Integer.MAX_VALUE;
	   R[n2]=Integer.MAX_VALUE;
	   i=0;
	   j=0;
	   
	   for(k=left;k<right;k++){
		   if(L[i]<=R[j]){
			   A[k]=L[i++];
		   }
		   else{
			   A[k]=R[j++];
		   }
		   count++;
	   }  
   }
   
   public static void margesort(int[] A,int left,int right){
	   if(left+1 < right){
		   int mid=(left+right)/2;
		   margesort(A,left,mid);
		   margesort(A,mid,right);
		   sort(A,left,mid,right);
	   }
   }
   
   public static void main(String[] args) throws IOException{
	   int[] A;
	   Scanner scan = new Scanner(System.in);
	   int a=scan.nextInt();
	   A=new int[a];
	   for(int i=0;i<a;i++){
		   A[i]=scan.nextInt();
	   }

	   margesort(A,0,a);
	   
	   for(int i=0;i<a;i++){
		   if(i<a-1) System.out.print(A[i]+" ");
		   else System.out.println(A[i]);
	   }
	   System.out.println(count);
   }   
}

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

using namespace std;
#define sqr(x) ((x)*(x))
#define cube(x) ((x)*(x)*(x))
#define GCD(a, b) __gcd(a, b)
#define LCM(a, b) ((a)*(b)/GCD(a,b))
#define PI (3.141592653589793238462643383279502884197169399375105820974944)
#define MP make_pair
#define n1 first
#define n2 second
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDB pair<db,db>
#define SI set<int>
#define SL set<ll>
#define MS multiset
#define MSI multiset<int>
#define MSLL multiset<ll>
#define PB push_back
#define PF push_front
#define VI vector<int>
#define VPI vector<pair<int,int>>
#define VLL vector<ll>
#define VS vector<string>
#define SZ(x) ((int)x.size())

typedef long long ll;

typedef unsigned long long ull;
typedef long double ld;
typedef double db;
const int INF = 1000000007;
const ll LINF = 1000000000000000555;
const int N = 450555;
const int L = 21;
const int M = 2155;

VI g[N];
bool used[N];
int d[M][M];
int cnt[N];
void solve(){
    int n,x,y;
    cin >> n >> x >> y;

    g[x].PB(y);
    g[y].PB(x);
    for (int i = 1; i < n; i++){
        g[i].PB(i+1);
        g[i+1].PB(i);
    }

    for (int i = 1; i <= n; i++){
        for (int j = 1; j <= n; j++){
            used[j] = false;
        }
        queue <int> q;
        q.push(i);
        used[i] = true;
        d[i][i] = 0;
        while (!q.empty()){
            int k = q.front();
            q.pop();
            for (int j : g[k]){
                if (used[j]) continue;
                q.push(j);
                used[j] = true;
                d[i][j] = d[i][k] + 1;
            }
        }
    }

    for (int i = 1; i <= n; i++){
        for (int j = i+1; j <= n; j++){
            int l = d[i][j];
            cnt[l]++;
        }
    }

    for (int i = 1; i < n; i++){
        cout << cnt[i] << endl;
    }

}

int main() {
    ios_base::sync_with_stdio(false);
#ifdef dxz05
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else

#endif

    int T = 1;
    //cin >> T;

    while (T--) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 29440
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 5e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//
ll A[100005], Lim[100005];
ll D[50];

int main() {
    init();
    ll N;
    cin >> N;
    rep(i, N + 1) cin >> A[i];

    if(N==0 and A[0]==1){
        cout << 1 << endl;
        return 0;
    }
    else if(N==0){
        cout << -1 << endl;
        return 0;
    }
    else if(N>=1 and A[0]>0){
        cout << -1 << endl;
        return 0;
    }

    D[0] = 1;
    repe(i, 1, 35) D[i] = D[i - 1] * 2;
    Lim[0] = 1;
    repe(i,1,N+1){
        if(Lim[i-1]>=2e18)
            Lim[i] = Lim[i - 1] - A[i];
        else
            Lim[i] = Lim[i - 1] * 2 - A[i];
    }
    
    ll m = (A[N] + 1)/2, M = A[N], sum = A[N];
    repr(i,N){
        if(m>Lim[i]){
            cout << -1 << endl;
            return 0;
        }
        chmin(M, Lim[i]);
        m+=A[i], M += A[i];
        m = (m + 1) / 2;
        sum += M;
    }

    cout << sum << endl;

}

Measured memory_bytes: 5216
N, M = map(int,input().split())

ans = [["",0] for i in range(N)]
for i in range(M):
    p,S = map(str,input().split())
    p = int(p)-1
    if ans[p][0] != "AC":
        if S == "AC":
            ans[p][0] = "AC"
        elif S == "WA":
            ans[p][1] += 1

AC = 0
WA = 0
for i in ans:
    if i[0] == "AC":
        AC += 1
        WA += i[1]

print(AC,WA)

Measured memory_bytes: 17740
#include<stdio.h>

int YOSHI[50];

int fib(int n){
    
    if(n == 0 || n == 1) return YOSHI[n] = 1;
    
    if(YOSHI[n] != -1) return YOSHI[n];
    
    return YOSHI[n] = fib(n - 1) + fib(n - 2);
}

int main(){
    int n,i;
    
    for(i = 0;i < 50;i++) YOSHI[i] = -1;
    
    scanf("%d",&n);
    
    printf("%d\n",fib(n));
    
    return 0;
}


Measured memory_bytes: 2112
#include <stdio.h>
#include <stdlib.h>

int cmp_int(const void* v1, const void* v2)
{
  const int _v1 = *((const int*)v1);
  const int _v2 = *((const int*)v2);

  if ( _v1 > _v2 ) {
    return 1;
  } else if ( _v1 < _v2 ) {
    return -1;
  } else {
    return 0;
  }
}

int main(void)
{
  int N,i;
  int ans;
  int A[150];
  scanf("%d", &N);
  for(i = 0;i < N;i++){
      scanf("%d", &A[i]);
  }
  qsort(A, N, sizeof(int), cmp_int);
  ans = A[N-1] - A[0];
  printf("%d", ans);
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 99940000
#define mod 1000000007
#define pi 3.141592653589793238
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define in3(a,b,c) cin>>a>>b>>c
#define vll vector<ll>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define endl '\n'
#define sp ' '
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
ll power(ll x,ll y){
    ll ret=1;
    while(y>0){
        if(y&1)
            ret=(ret*x);
        y/=2;
        x=(x*x);
    }
    return ret;
}
string rot(string s){
	string ret="";
	ll i;
	for(i=1;s[i];i++){
		ret+=s[i];
	}
	ret+=s[0];
	return ret;
}
void solve(){
	ld r;
	cin>>r;
	// cout<<fixed<<setprecision()
	cout<<2*pi*r<<endl;
}	
int main(){
	gear_change;
	ll test=1;
	// in(test);/
	while(test--){
		solve();
	}
}	


Measured memory_bytes: 3864
#include<stdio.h>
int main(){
  int i,g[100000],r,a,s,n,j;
  while(scanf("%d",&n),n){
    scanf("%d",&a);
    g[0]=0;
    g[r=a]=1;
    //for(j=0;j<=r;j++)printf("%d ",g[j]);printf("\n");
    for(i=2;i<=n;i++){
      scanf("%d",&a);
      if(i%2){
	if(r%2==a)g[r]++;
	else      g[++r]=1;
      }
      else{
	if(r%2==a)g[r]++;
	else {
	  if(r){
	    g[r-1]+=g[r]+1;
	    r--;
	  }
	  else{
	    g[1]=g[0]+1;
	    g[0]=0;
	    r++;
	  }
	}
      }
      //for(j=0;j<=r;j++)printf("%d ",g[j]);printf("\n");
    }
    for(i=s=0;i<=r;i+=2)s+=g[i];
    printf("%d\n",s);
  }
  return 0;
}

Measured memory_bytes: 604
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
  int a, b, c, sum[3];
  cin>>a>>b>>c;
  sum[0]=a+b;
  sum[1]=b+c;
  sum[2]=c+a;
  cout<<min({sum[0], sum[1], sum[2]})<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main()
{
	int A, B, C;
	std::cin >> A >> B >> C;
 
	int ians;
	if (A == B) {
		ians = C;
	}else if (A==C){
		ians = B;
	}else if (B == C) {
		ians = A;
	}
	std::cout << ians << std::endl;
    return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define mp make_pair
#define pb push_back
#define FI first
#define SE second
#define FOR(i,a,b) for(int (i)=((int)a); (i)<((int)b); (i)++) // [a,b)
#define REP(i,N) FOR((i), 0, ((int)N)) // [0,N)
#define INF (1 << 30)
#define all(v) (v).begin(),(v).end()
#define vcin(v,N) REP(i,N) cin >> v[i] // 配列にも使用可能
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
#define vidx(v,it) distance((v).begin(),(it))
#define vsum(v) accumulate(all(v),0)
#define vsumr(v,a,b) accumulate((v).begin()+(a),(v).begin()+(b),0) //[a,b)
#define vfnd(v,val) find(all(v),val) // itrを返す
#define vcnt(v,val) count(all(v),val)
#define vrep(v,it) for(auto it=(v).begin(); it != (v).end(); ++it)

#ifdef LOCAL
    #define debug(...) fprintf(stderr, __VA_ARGS__)
    #define stopif(val) assert( !(val) )
#else
    #define debug(...) 1
    #define stopif(val) 1
#endif

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
int gcd(int a, int b){if(a>b) swap(a,b); return a==0 ? b : gcd(b%a,a);}

int main(){
    int N,K;
    cin >> N >> K;
    vi v(N);
    vcin(v,N);
    sort(all(v));
    vi d;
    REP(i,N-K+1) d.pb(v[i+K-1] - v[i]);
    cout << vmin(d) << endl;
    return 0;
}

Measured memory_bytes: 1276
/*Writer : Md. Shafiur Rahman Dipu  */

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

#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define pi 2*acos(0.00)
#define inf 2e12

long long poW(long long base, long long power) {
    long long result = 1;
    while(power > 0) {
        if(power & 1) {
            result = (result*base) ;
        }
        base = (base * base);
        power = power / 2;
    }
    return result;
}


#define ull unsigned long long
#define ll long long
#define ld long double

const int mx = 105;
const int mod = 1000000007;
ll w[mx];
ll v[mx];
int n;
ll k;
ll dp[mx][100005];
int tot;


ll func(int pos, int val)
{
    if(val < 0){ return inf;}
    if(pos < 0){
        if(val ==0 ){return 0;}
        return inf;
    }
    if(dp[pos][val] != -1){ return dp[pos][val];}


    ll res1 = func(pos-1, val);
    ll res2 = w[pos] + func(pos-1, val-v[pos]);

    return dp[pos][val] = min(res1,res2);

}


int main()
{
    #ifdef dipu
    //freopen("inp.txt","r",stdin);
    #endif

    cin >> n >> k;
    tot = 0;
    for(int i=0; i<n; i++){
        cin >> w[i] >> v[i];
        tot += v[i];
    }
    memset(dp, -1, sizeof dp);

    ll res = 0;
    int ans;
    for(int i=tot; i>=0; i--){
        res = func(n-1,i);
        if(res <=k){
            ans = i;
            break;
        }
    }

    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 82304
/*
  NAME : RISHABH SINGH
  INSTITUTION : DELHI TECHNOLOGICAL UNIVERSITY
*/
#include "bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define pii pair<int, int>
#define bi __builtin_inf()
#define ll long long
#define mp make_pair
#define ss second
#define pb push_back
#define ff first
#define speed_cubing ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define um unordered_map
#define us unordered_set
#define bp __builtin_popcount
#define ld long double
#define rep(n) for (int i = 0; i < n; i++)
#define pll pair<ll, ll>
#define mx = 1e18;
#define lb(v, val) (lower_bound(v.begin(), v.end(), val) - v.begin())
#define ub(v, val) (upper_bound(v.begin(), v.end(), val) - v.begin())
#define PI 3.1415926535
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> pbds;
ll powmod(ll base,ll exp,ll MOD){ll res=1;while(exp>0){if(exp%2==1) res=(res*base)%MOD;base=(base*base)%MOD;exp/=2;}return (res%MOD);}
#define sz(v) (int)v.size()
#define endl '\n'
const int mod = 1e9+7;
ll mul_inv(ll a,ll b = mod) {ll t1=a,t2=b,t3,v1=1,v2=0,v3;while(t2!=1){ll x=t1/t2;t3=t1-x*t2;v3=v1-x*v2;t1=t2,t2=t3;v1=v2,v2=v3;}return(v2+b)%b;}
const int N = 2e3+5;

int32_t main(){
   
   speed_cubing
   
     int x;
     cin>>x;

     if(x>=30)
       cout<<"Yes";
     else 
       cout<<"No";  
     
   return 0;
}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define ll long long int
#define F first
#define S second
#define pb push_back
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y);
#define sdl(x) scanf("%lld",&x)
#define sd2l(x,y) scanf("%lld%lld",&x,&y);
#define sz(x) (int)(x.size())
#define nax 200010
#define inf 1001000100
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007
#define mp make_pair
#define pc pair<char ,int>
#define pi pair<int ,int>
#define pii pair <int,pi>
#define ull unsigned long long int
using namespace std;
int mat[22][22];
int b[22];
int main() {

  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
   int n,m,c;
   cin >> n >> m >> c; 
   for(int i = 1; i <= m; i++)
   	 cin >> b[i];

   int ans = 0;
   for(int i = 1; i <= n; i++)
   {
   	int cans = 0;
   	for(int j = 1; j <= m; j++)
   	{
   		cin >> mat[i][j];
   		cans += mat[i][j] * b[j];
   	}
   	cans += c;
   	if(cans > 0)
   		++ans;
   }
   cout << ans  << '\n';
   return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#ifdef int
const ll INF = (1LL<<60);
#else
const int INF = (1LL<<30);
#endif
const double PI = 3.14159265359;
const double EPS = 1e-12;
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}

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

VI v[2];
int dp1[2][16010], dp2[2][16010];
signed main(void)
{
  string s;
  cin >> s;
  int x, y;
  cin >> x >> y;
  s += 'T';

  int idx = 0, cnt = 0, st = 0;
  bool first = true;
  REP(i, s.size()) {
    if(s[i] == 'T') {
      if(first) {
        st = cnt;
        first = false;
      } else if(cnt != 0) v[idx].PB(cnt);
      idx ^= 1;
      cnt = 0;
    } else {
      cnt++;
    }
  }

  int pre = 0, cur = 1;
  dp1[0][st+s.size()] = 1;
  FOR(i, 0, v[0].size()) {
    REP(j, s.size()*2+1) {
      if(dp1[pre][j]) {
        if(j+v[0][i] <= s.size()*2+1) dp1[cur][j+v[0][i]] = 1;
        if(j-v[0][i] >= 0) dp1[cur][j-v[0][i]] = 1;
      }
    }
    REP(j, s.size()*2+1) dp1[pre][j] = 0;
    swap(cur, pre);
  }

  if(!dp1[pre][x+s.size()]) {
    // cout << "x" << endl;
    cout << "No" << endl;
    return 0;
  }

  pre = 0, cur = 1;
  dp2[0][s.size()] = 1;
  FOR(i, 0, v[1].size()) {
    REP(j, s.size()*2+1) {
      if(dp2[pre][j]) {
        if(j+v[1][i] <= s.size()*2+1) dp2[cur][j+v[1][i]] = 1;
        if(j-v[1][i] >= 0) dp2[cur][j-v[1][i]] = 1;
      }
    }
    REP(j, s.size()*2+1) dp2[pre][j] = 0;
    swap(cur, pre);
  }

  if(!dp2[pre][y+s.size()]) {
    // cout << "y" << endl;
    cout << "No" << endl;
    return 0;
  }

  cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
#define int long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define M 1000000007
using namespace std;
signed main()
{
	fast
	int sum=0;
	string s;
	cin>>s;
	int n=s.length();
	for(int i=0;i<n;i++)
		sum+=s[i]-48;
	
	if(sum%9==0)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
}

Measured memory_bytes: 3736
# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
N,M = map(int,input().split())
ABC = [list(map(int,input().split())) for _ in range(M)]

g = [[0 for _ in range(N)] for _ in range(N)]

for a,b,c in ABC:
    g[a-1][b-1] = c

csg = csgraph_from_dense(g)
d = floyd_warshall(csg, directed=False)

ans = 0
for a,b,c in ABC:
    if c != d[a-1][b-1]:
        ans += 1

print(ans)

Measured memory_bytes: 18040
#pragma GCC optimize("Ofast","unroll-loops")
#pragma GCC push_options
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#include <xmmintrin.h>
#include <immintrin.h>
using namespace::std;
__attribute__((constructor))void init(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
template<typename T>using pbds=__gnu_pbds::tree<T,__gnu_pbds::null_type,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T>using pbds_map=__gnu_pbds::tree<T,T,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T,typename E>using hash_map=__gnu_pbds::gp_hash_table<T,E>;
template<typename T>using pqueue =__gnu_pbds::priority_queue<T, less<T>,__gnu_pbds::rc_binomial_heap_tag>;
typedef long long lint;
#define INF (1LL<<60)
#define IINF (1<<30)
#define EPS (1e-10)
#define MOD 1000000007
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
template<typename T>inline void numout(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i<INF/2?i:"INF";f=1;}cout<<endl;}
template<typename T>inline void numout2(T t){for(auto i:t)numout(i);}
template<typename T>inline void output(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}
template<typename T>inline void output2(T t){for(auto i:t)output(i);}
template<typename T>inline void _output(T t){bool f=0;for(int i=0;i<t.size();i++){cout<<f?"":" "<<t[i];f=1;}cout<<endl;}
template<typename T>inline void _output2(T t){for(int i=0;i<t.size();i++)output(t[i]);}
#define rep(i,n) for(lint i=0;i<lint(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(int)(b);++i)
#define rrep(i,n) for(int i=int(n)-1;i>=0;--i)
#define rrepi(i,a,b) for(int i=int(b)-1;i>=int(a);--i)
#define irep(i) for(int i=0;;++i)
#define all(n) begin(n),end(n)
inline lint gcd(lint A,lint B){return B?gcd(B,A%B):A;}
inline lint lcm(lint A,lint B){return A/gcd(A,B)*B;}
inline bool chmin(auto& s,const auto& t){bool res=s>t;s=min(s,t);return res;}
inline bool chmax(auto& s,const auto& t){bool res=s<t;s=max(s,t);return res;}
const vector<lint> dx={-1,1,0,0,1,1,-1,-1};
const vector<lint> dy={0,0,-1,1,1,-1,1,-1};
#define SUM(v) accumulate(all(v),0LL)
auto call=[](auto f,auto... args){return f(f,args...);};

int main(void){
    lint n;
    cin>>n;
    vector<string> s(n);
    vec a(n);
    rep(i,n)cin>>s[i]>>a[i];
    string t;
    cin>>t;
    bool b=0;
    lint ans=0;
    rep(i,n){
        if(b)ans+=a[i];
        if(s[i]==t)b=1;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
X,K,D = map(int, input().split())
#X,K,D=-10,1,2
if X==0:
    if K%2==1:
        print(D)
    else:
        print(0)
else:
    a=X%D
    aa=D-a
    aa=abs(aa)
    b=X//D
    #print(a,b)

    if X>0:
        n=K-b
        #print(n)
        if n>=0:
            if n%2==1:
                print(aa)
            else:
                print(a)
        else:
            print(X-D*K)
    if X<0:
        n=K+b        
        if n>=0:
            if n%2==1:
                print(aa)
            else:
                print(a)
        else:
            print(abs(X+D*K))       

Measured memory_bytes: 61704
N=int(input())
INL=list(map(int,input().split()))

swp = 0
for i in range(0, N-1):
    if i+1 == INL[i]:
        INL[i] = INL[i] ^ INL[i+1]
        INL[i+1] = INL[i] ^ INL[i+1]
        INL[i] = INL[i] ^ INL[i+1]
        swp += 1

if INL[N-1] == N:
    INL[N-1], INL[N-2] = INL[N-2], INL[N-1]
    swp += 1

print(swp)


Measured memory_bytes: 14008
import java.io.*;
import java.util.*;

public class Main {
  private static boolean debug = false;
  private static boolean elapsed = false;

  private static PrintWriter _err = new PrintWriter(System.err);

  private void solve(Scanner sc, PrintWriter out) {
    StringBuilder sA = new StringBuilder(sc.nextLine());
    StringBuilder sB = new StringBuilder(sc.nextLine());
    StringBuilder sC = new StringBuilder(sc.nextLine());

    Map<Character, StringBuilder> map = new HashMap<>();
    map.put('a', sA);
    map.put('b', sB);
    map.put('c', sC);

    char ch = 'a';
    while (true) {
      StringBuilder sb = map.get(ch);
      if (sb == null) {
        throw new RuntimeException(ch + ": Invalid input");
      }
      if (sb.length() == 0) {
        break;
      }
      ch = sb.charAt(0);
      sb.deleteCharAt(0);
    }
    out.println(Character.toUpperCase(ch));
  }
  private long C(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    for (long i = r; i > 1; --i) {
      res /= i;
    }
    return res;
  }
  private long P(long n, long r) {
    long res = 1;
    for (long i = n; i > n - r; --i) {
      res *= i;
    }
    return res;
  }
  /*
   * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
   * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
   */
  public static void main(String[] args) {
    long S = System.currentTimeMillis();

    Scanner sc = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    new Main().solve(sc, out);
    out.flush();

    long G = System.currentTimeMillis();
    if (elapsed) {
      _err.println((G - S) + "ms");
    }
    _err.flush();
  }
}

Measured memory_bytes: 9808
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N,K;
vector<int> P;
void input(){
    fast_io();
    cin >> N >> K;
    P = fetch_vec<int>(N);
}

int solve(){
    sort(P.begin(),P.end());
    int ans = accumulate(P.begin(),P.begin()+K,0);
    cout << ans << endl;
    return 0;
}   

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

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

using namespace std;

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

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

int main() {
  string s;
  cin >> s;
  int n = s.size();
  REP(i, n) {
    int j = (s[i] - 'A' + 26 - 3) % 26;
    cout << (char)(j + 'A');
  }
  cout << "\n";
  return 0;
}


Measured memory_bytes: 3168
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    int a, b;
    cin >> a >> b;
    if(a == 0 || b == 0){
        cout << "Zero" << endl;
        return 0;
    }
    if(a < 0 && 0 < b){
        cout << "Zero" << endl;
        return 0;
    }
    if(b < 0 && (b - a) % 2 == 0){
        cout << "Negative" << endl;
        return 0;
    }
    cout << "Positive" << endl;


        return 0;
}

Measured memory_bytes: 256