akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c;
	if(a>b)
	{
		d=a;
		a=b;
		b=d;
	}
	if(b>c)
	{
		d=b;
		b=c;
		c=d;
	}
    if(a>b)
    {
    	d=a;
    	a=b;
    	b=d;
	}
	cout<<a+b<<endl;
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define rep(i, n) REP(i, 0, n)
const int INF=1e9;
const int MAX=100005;
const int MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define ALL(v) v.begin(), v.end()
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbgmap(mp) for (auto i = mp.begin(); i != mp.end(); ++i) { cout << i->first <<":"<<i->second << endl;}
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

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

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    priority_queue<int, vector<tuple<string,int,int>>, function<bool(tuple<string,int,int>, tuple<string,int,int>)>> q([](tuple<string,int,int> a, tuple<string,int,int> b)->int {
        if(get<0>(a)==get<0>(b)) {
            return get<1>(a)<get<1>(b);
        } else {
            return get<0>(a)>get<0>(b);
        }
    });
    rep(i,n){
        string s;
        int p;
        cin>>s>>p;
        q.push(make_tuple(s,p,i+1));
    }
    rep(i,n){
        tuple<string,int,int> tp = q.top();
        cout<<get<2>(tp)<<endl;
        q.pop();
    }
    return  0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
def Luka(N) :
    L = [0] * (N + 1)
    L[0] = 2
    L[1] = 1
    for i in range(2,N+1) :
        L[i] = L[i-1] + L[i-2]
    return L[N]
N = int(input())
print(Luka(N))

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <map>
#include <vector>

using namespace std;

int main(void) {
  long N;
  cin >> N;
  for (int i = floor(sqrt(N)); i >= 1; i--) {
    if (N % i == 0) {
      cout << (i - 1) + (N / i - 1) << endl;
      break;
    }
  }
  return 0;
}


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

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;


//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	if (k == 0) return 1;
	return n * COM(n - 1, k - 1) / k;
}

int main(){
  ll a,b,n;
  cin >> n >> a >> b;

  if(a > b){
    cout << 0 << endl;
  }
  else if(n == 1){
    if(a != b)cout << 0 << endl;
    else      cout << 1 << endl;
  }
  else if(a == b){
    cout << 1 << endl;
  }
  else if (n > 1 && a < b)cout << max((b-a)*(n-2LL)+1LL,0LL) << endl;
  else cout << 0 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

//配列を投げたら最頻値の値と個数を返す（2番まで）
vector<int> mode(int table[],int n){
    int count[100010]={};
    for(int i=0;i<n;++i){
        count[table[i]]++;
    }
    int max1=0,max2=0,cnt1=0,cnt2=0;
    for(int i=0;i<100010;++i){
        if(cnt1<count[i]){
            max2=max1;cnt2=cnt1;cnt1=count[i];max1=i;
            }
        else if(cnt2<count[i]){cnt2=count[i];max2=i;}
    }
    return {max1,cnt1,max2,cnt2};
}


int main()
{
//回答が整数の場合
int ans;
//整数値の入力
int n;
cin >> n;
//行列の入力
int table1[n/2]={};
int table2[n/2]={};
for (int i = 0; i < n/2; ++i) {
    cin >> table1[i];
    cin >> table2[i];
}


vector<int>vec1=mode(table1,n/2);
vector<int>vec2=mode(table2,n/2);


//最頻値同じ場合
if(vec1[0]==vec2[0]){
ans=min(n-vec1[1]-vec2[3],n-vec1[3]-vec2[1]);
}
else{
    ans=n-vec1[1]-vec2[1];
}

//回答
cout << ans << endl;
return 0;
}

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

int main() {
  int N = 0, K = 0;
  cin >> N >> K;
  int sum = 0;

  for( int i = 0; i < N; ++i ){
    int x = 0;
    cin >> x;
    int ansA = x * 2;
    int ansB = ( K - x ) * 2;
    if( ansA > ansB ){
      sum += ansB;
    }else{
      sum += ansA;
    }
  }
  cout << sum << endl;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int 	     	  long long   // [9,223,372,036,854,775,807 to -9.....808] 19 digits
#define pb                push_back
#define all(x)            (x).begin(),(x).end()
#define mp                make_pair
#define vi                vector<int>
#define vpi               vector<pair<int,int>>
#define mii               map<int,int>
#define x                 first
#define y                 second
#define mem(a,x)          memset(a,x,sizeof(a))
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define sz(x)             (int)((x).size())

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // find_by_order()  // order_of_key

//const int32_t hellhsh = 444440583533; const double pi=2*acos(0.0);
const int32_t mod = 1e9+7;
const int32_t maxn=2e5+5;
int inf=1e18;

bool go(string s){
    int res=0;
    for(char c:s){
        res+=c-'0';
        res%=9;
    }
    return res==0;
}

void solve(){
    int n;cin>>n;
    int a[n];rep(i,0,n) cin>>a[i];
    int ans=0,mx=a[0];

    rep(i,0,n){
        if(a[i]<mx) ans+=mx-a[i];
        mx=max(mx,a[i]);
    }
    cout<<ans;
}

signed main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int tc=1,k=1;
    //cin>>tc;
    while(tc--){
        //cout<<"Case #"<<k++<<": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 5176
#include<bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, k;
    cin >> n >> k;
    vector< P > cnt( 200005 );
    for( int i = 0; i < cnt.size(); ++i ) {
        cnt[i].F = 0;
        cnt[i].S = i;

    }
    
    for( int i = 0; i < n; ++i ) {
        int a;
        cin >> a;
        ++cnt[a].F;

    }
    sort( cnt.begin(), cnt.end(), greater< P >() );
    
    int pos = 0;
    while( pos < cnt.size() && cnt[pos].F ) ++pos;

    int res = 0;
    for( int i = pos - 1; i >= k; --i ) {
        res += cnt[i].F;

    }
    cout << res << endl;

    return 0;
}



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

#define ll long long
#define ull unsigned long long

using namespace std;

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

	char prev = S[0];
	int ans = 0;
	for (int ii = 1; ii < S.size(); ++ii){
		if (S[ii] == prev){
			ans++;
			if (S[ii] == '0'){
				S[ii] = '1';
			} else {
				S[ii] = '0';
			}
		}
		prev = S[ii];
	}

	cout << ans << "\n";


	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

ll R,D,X;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>R>>D>>X;
	FOR(i,10) {
		X=R*X-D;
		cout<<X<<endl;
	}
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


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

int main()
{
	long long int s, cnt = 0, m1, m2;
	cin >> s;
    m1 = s/500;
    m1 *= 1000;
    s %= 500;
    m2 = s/5;
    m2 *= 5;
	cout << m1+m2 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
  int h, w, x, y;

  cin >> h >> w >> x >> y;

  if ((h * w) % 2 && (x + y) % 2) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}



Measured memory_bytes: 3120
#include<bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)
#define ROP(i, n)       for(int i = 1 ; i <= n ; i++)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define SORT(obj) sort(ALL(obj))
#define GSORT(obj) sort(ALL(obj) , greater<int>())
#define P pair<int , int>
#define V vector<int>
#define VLL vector<long long>
#define M map<int, int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>
int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
	int num[10];
  	fill(num, num + 10,  0);
  	for(int i = 0 ; i < 4 ; i++){
		int n;  cin >> n;
      	num[n] += 1;
    }

  	if(num[1] == 1 && num[4] == 1 && num[7] == 1 && num[9])
       cout << "YES" << endl;
  	else
       cout << "NO" << endl;
  
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

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

int main() {
  ll n; cin >> n;
  ll t=1, a=1;
  REP(i, n) {
    ll ti, ai; cin >> ti >> ai;
    if (t<ti && a<ai) {t=ti, a=ai;}
    else if (t>ti && a>ai) {
      ll mal = max((t+ti-1)/ti, (a+ai-1)/ai);
      t = ti*mal, a = ai*mal;
    } else {
      ll mal = max((t+ti-1)/ti, (a+ai-1)/ai);
      t = ti*mal, a = ai*mal;
    }
  }
  cout << t + a << endl;
  return 0;
}


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

set<char> ACGT = {'A', 'C', 'G', 'T'};

int main(){
  int max_success = 0;
  int success;
  string input;
  cin >> input;
  for(int i=0; i<input.size(); i++){
    if(ACGT.find(input[i])!=ACGT.end()){
      max_success = max(++success, max_success);
    }
    else {
      success=0;
    }
  }
  cout << max_success << endl;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,N) for(ll i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll d,g;
ll p[11];
ll c[11];
ll dp[11][200001];

int main(){
    cin >> d >> g;
    g /= 100;
    rep(i,d){
        cin >> p[i] >> c[i];
        c[i] /= 100;
    }
    rep(i,11)rep(j,200001)dp[i][j] = INF;
    dp[0][0] = 0;
    rep(i,d){
        rep(j,p[i]){
            rep(k,200001){
                dp[i+1][k] = min(dp[i+1][k],dp[i][k]);
                ll nxt = k + (i+1)*(j+1);
                if(j == p[i] - 1)nxt += c[i];
                if(nxt >= 200001)continue;
                dp[i+1][nxt] = min(dp[i+1][nxt],dp[i][k] + (j+1));
            }
        }
    }
    // rep(i,d+1){
    //     rep(j,g+10){
    //         if(dp[i][j] != INF)cout << dp[i][j] << " ";
    //         else cout << -1 << " ";
    //     }
    //     cout << endl;
    // }
    ll ans = INF;
    rep(j,200001){
        if(j >= g)ans = min(ans,dp[d][j]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 17536
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>
#include <tuple>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n, 0);
  vector<int> b(n - 1);
  for (int i = 0; i < n - 1; ++i) {
    cin >> b[i];
  }
  a[0] = b[0];
  for (int i = 1; i < n - 1; ++i) {
    a[i] = min(b[i], b[i - 1]);
  }
  a[n - 1] = b.back();
  int res = 0;
  for (int i = 0; i < n; ++i) {
    res += a[i];
  }
  cout << res << '\n';
  return 0;
}



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

namespace AtCoder.Abcdef
{
    public class QuestionC
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            //Input int array
            int[] inputArray = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
            (int n, int m, long k) = (inputArray[0], inputArray[1], inputArray[2]);
            var a = (Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray());
            var b = (Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray());

            long t = b.Sum();
            var j = b.Length;

            var ans = 0;

            for (int i = 0; i < a.Length + 1; i++)
            {
                while (j > 0 && t > k)
                {
                    j--;
                    t -= b[j];
                }

                if (t > k) break;
                ans = Math.Max(ans, i + j);
                if (i == a.Length) break;
                t += a[i];
            }

            Console.WriteLine(ans);
            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 70212
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;




int main(){
    ll n,z,w;
    cin>>n>>z>>w;
    vector<ll> a(n);
    rep(i,n){
        cin>>a[i];
    }
    if(n==1){
        cout<<abs(a[0]-w)<<endl;
        return 0;
    }
    cout<<max(abs(a[n-1]-w),abs(a[n-1]-a[n-2]))<<endl;
   
    
return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(),x.end()
#define db(...) " [" << #__VA_ARGS__ << ": " << __VA_ARGS__ << "] "
using ii=long long;
const ii mod = 1e9 + 7;
const int N = 1 << 18;
ii fact[N];
ii mpow(ii x, ii y)
{
    if (y == 1) return x;
    if (y % 2) return mpow(x, y - 1) * x % mod;
    ii z = mpow(x, y / 2);
    return z * z % mod;
}
ii inv(ii x)
{
    return mpow(x % mod, mod - 2);
}
ii binom(ii x, ii y)
{
    ii z = fact[x];
    z *= inv(fact[y] * fact[x - y]);
    return z % mod;
}
ii ways(ii x, ii y)
{
    return binom(x + y - 2, y - 1);
}
int main()
{
    fact[0] = 1;
    for (int i = 1; i < N; ++i) {
        fact[i] = fact[i - 1] * i;
        fact[i] %= mod;
    }
    int n, m, k;
    cin >> n >> m >> k;
    vector<pair<int, int>> v(k);
    for (int i = 0; i < k; ++i) {
        cin >> v[i].first >> v[i].second;
    }
    v.emplace_back(n, m);
    sort(all(v));
    vector<ii> res(v.size());
    for (int i = 0; i < (int) v.size(); ++i) {
        res[i] = ways(v[i].first, v[i].second);
        for (int j = 0; j < (int) v.size(); ++j) {
            if (v[i].first < v[j].first || v[i].second < v[j].second || i == j) continue;
            int yd = v[i].first - v[j].first + 1;
            int xd = v[i].second - v[j].second + 1;
            res[i] -= (res[j] * ways(yd, xd)) % mod;
            if (res[i] < 0) res[i] += mod;
        }
    }
    cout << res.back() << "\n";
}


Measured memory_bytes: 2304
#include <bits/stdc++.h>
using namespace std;
#define dhoom ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);  
typedef long long ll;
typedef long double ld;
const ll inf = 1e18;
const int nax = 2e6 + 7;
const ll mod = 1e9 + 7;
//ll tree[4 * nax];
//9uS-22RSwk7gQqh
ll gcd(ll a , ll b){
	if(b == 0) return a;
	return gcd(b , a % b);	
}
ll lcm(ll a , ll b){
	ll g = gcd(a , b);
	ll lc = (a/g) * b;
	return lc;
}
//char a[55][55];
int dx[] = {1,0,-1,0,1,1,-1,-1};
int dy[] = {0,1,0,-1,1,-1,-1,1};
ll a[100];
int main()
{
	dhoom;
	int a , b;
	cin >> a >> b;
	cout << (a + b + 1)/2 << endl;
	return 0;
}


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

using namespace std;

#define endl "\n"
#define lln long long int
#define IOS ios::sync_with_stdio(0);cin.tie(0);

int main(){
    IOS;

    string s;
    cin >> s;
    int c = 0;
    int ma = 0;
    for(int i=0;i<3;i++){
        if(s[i] == 'R') c++;
        else c = 0;
        ma = max(c,ma);
    }
    cout << ma << endl;
    return 0;    
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;

bool cmp(pair<int, int> a, pair<int, int> b) {
	return a.second < b.second;
}

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

	vector<pair<int, int>> v(M);
	for (int i = 0; i < M; i++) {
		cin >> v.at(i).first >> v.at(i).second;
	}
	sort(v.begin(), v.end(), cmp);

	int ans = 1;
	int x = v.at(0).second;
	for (int i = 1; i < M; i++) {
		if (v.at(i).first >= x) {
			ans++;
			x = v.at(i).second;
		}
	}

	cout << ans << endl;
}

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

using namespace std;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define PB push_back
#define MP make_pair
#define ll long long

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}

int main(){
    std::ios::sync_with_stdio(false);
    int k;
    string s;
    cin >> k >> s;

    if(s.length() <= k)
    {
        cout << s << endl;
    }else{
        for(int i=0;i<k;++i)
        {
            cout << s[i];
        }
        cout << "..." << endl;
    }
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main() {
  vector<string> s = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
  string t;
  cin >> t;
  ll idx;
  REP(i, SZ(s)) {
    if (t == s[i]) {
      idx = i;
      break;
    }
  }
  cout << (7 - idx) << endl;
}

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

int main(void) {
    int s[5],ans=0,mi=124;
    cin >> s[0] >> s[1] >> s[2] >> s[3] >> s[4] ;
    for (int i = 0; i < 5; i++) {
        if (s[i] % 10 == 0) ans += s[i];
        else {
            ans += (s[i] / 10 + 1) * 10;
            mi = min(mi, s[i] % 10);
        }
    }
    if(mi!=124) ans += mi - 10;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); ++i)
#define fi first
#define se second
#define INF 1000000009
#define LLINF 1000000000000000009LL
using ll = long long;

// auto mod int
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

// combination mod prime
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
}comb(100009);

int main(){
  int n;
  cin>>n;
  n++;
  vector<int>a(n);
  rep(i,n)cin>>a[i];
  vector<int>b=a;
  sort(b.begin(),b.end());
  int x;
  rep(i,n-1){
    if(b[i]==b[i+1])x=b[i];
  }
  int sum=0,cnt=0;
  rep(i,n){
    if(cnt==2)sum++;
    if(a[i]==x){
      cnt++;
    }
    if(cnt==0)sum++;
  }
  rep(i,n){
    cout<<(comb(n,i+1)-comb(sum,i)).x<<endl;
  }
  return(0);
}


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

vector<pair<ll,ll> > to[100010];
ll le[100010];

vector<bool> seen(100010);
void dfs(ll v,ll len){
    seen[v]=1;
    for(auto nv:to[v]){
        if(seen[nv.first])continue;
        le[nv.first]=len+nv.second;
        dfs(nv.first,le[nv.first]);
    }
}

int main(){
    ll n;cin>>n;
    rep(i,0,n-1){
        ll a,b,c;
        cin>>a>>b>>c;
        a--;b--;
        to[a].push_back(make_pair(b,c));
        to[b].push_back(make_pair(a,c));
    }
    ll q,k;cin>>q>>k;
    k--;
    dfs(k,0);
    rep(i,0,q){
        ll a,b;
        cin>>a>>b;
        a--;b--;
        cout<<le[a]+le[b]<<endl;
    }
}







Measured memory_bytes: 14336
#include<iostream>
#include <bits/stdc++.h>
#include<algorithm>
using namespace std;
int main(){
	int k,x;
	cin>>k>>x;//k连续  第  x  块儿
	//向后 
	int num1=x-k;
	int num2=x+k;
	int t=2*k-1;
	int f=0;
	for(int i=num1+1;i<num2;i++){
		if(i>=-1000000||i<=1000000){
			cout<<i;
			if(f==t){
			}else{
				cout<<" ";
			}
		}
	}
	return 0;
}

Measured memory_bytes: 384
import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int yono = 0;
                for(int i = 1 ; i <= n ; i++){
                        int keta = (int)Math.log10(i);
                        keta = keta % 2;
                        if(keta == 0)yono++;
                }
                System.out.println(yono);
        }
}//0=48
 //a=97 a -> +26 = 123
//鶏になれ

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

int main() {
vector<int> vec(5);
for(int i=0;i<5;i++){
cin>>vec.at(i);
}

for(int i=0;i<5;i++){
    if(vec.at(i)==0){
        cout << i+1 << endl;
    }
}
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define mp make_pair
#define pque priority_queue
#define endl '\n'
typedef vector <int> 	vi;
typedef pair <int, int> ii;
typedef vector <vi > 	vvi;
typedef vector <ii > 	vii;

const int N = 1e5 + 5, mod = 1e9 + 7, inf = 1e18 + 7;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n, m, t;
    cin >> n >> m;
    int ans = 0;
    for (int i = 1; i <= sqrt(m); i++){
        t = m / i;
        if (i * t == m && max(t, i) >= n){
            if (t >= n && i >= n) ans = max(ans, max(t, i));
            else if (t >= n) ans = max(ans, i);
            else ans = max(ans, t);
        }
    }
    cout << ans;
}

/*
INPUT:


OUTPUT:


*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    string number;
    cin >> number;
    int count=0;
    int N;
    N=number.size();
    for(int j=0;j<N-1;j++){
        if(number.at(j)==number.at(j+1)){
            count ++;
            if(number.at(j+1)=='0'){
                number.at(j+1)='1';
            }else{
                number.at(j+1)='0';
            }
        }
    }
cout << count;
}
  

Measured memory_bytes: 512
#include <iostream>
#include<string>
#include<time.h>
#include<math.h>
#include<stdlib.h>
#include<map>
using namespace std;



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

Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Main{

	public static void main(String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter wr = new PrintWriter(System.out);
        String str = br.readLine().trim();
        StringTokenizer stk = new StringTokenizer(str);
        int n = Integer.parseInt(stk.nextToken());
        HashMap<String,Integer>hm = new HashMap<>();
        str = br.readLine().trim();
        stk = new StringTokenizer(str);
        for(int i=0;i<n;i++) {
        	String s = stk.nextToken();
        	hm.put(s, 1);
        }
        if(hm.size()==3)System.out.println("Three");
        else if(hm.size()==4)System.out.println("Four");

	}

}


Measured memory_bytes: 21204
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    int s,w;    cin >> s >> w;
    if(w >= s){
        cout << "unsafe" << endl;
    }else{
        cout << "safe" << endl;
    }
}


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

long long memo[90];

long long lucas(int i) {
    if(memo[i] > 0) return memo[i];
    if(i == 0) return 2;
    if(i == 1) return 1;
    return (memo[i] = lucas(i-1) + lucas(i-2));
}

int main() {
    int N; cin >> N;
    fill_n(memo, 90, -1);
    cout << lucas(N) << endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN
#define INF         100000000000000000
#define PI          3.1415926535897932384626433832795l



#define fi first
#define se second
#define pb push_back
#define f_s(a) sort(a.begin(), a.end())
#define b_s(a) sort(a.rbegin(), a.rend())
#define p(a) cout<<a<<"\n"


// ll mod = 1000000007;
// #define l(i, )
// #define rl(i, a, b) for(int i = a; i < b; i++)






// struct mycomp {
//     bool operator() (const pair<int,int> &a, const pair<int,int> &b) const{
//         if (a.second-a.first != b.second-b.first)
//         return (a.second-a.first > b.second-b.first);
//         return a.first < b.first;
//     }
// };



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


ll extended_gcd(ll a, ll b, ll& x, ll& y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1, y1;
	ll d = extended_gcd(b, a%b, x1, y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;
}

////////////////////SIEVE OF ERATOSTHENES//////////////////////
vector<int> sieveoferatosthenes(int n)
{
	vector<bool> prime(n+1, true);
	for(int i = 2; i <= sqrt(n); i++)
	{
		if(prime[i])
		{
			for(int j = i*i; j<=n; j+=i)
			{
				prime[j]=false;
			}
		}
	}
	vector<int> all_primes;
	for(int i = 2; i <=n; i++)
	{
		if(prime[i]) all_primes.pb(i);
	}
	return all_primes;
}

////////////////////BINARY EXPONENTIATION///////////////////////
ll bin_exp(ll a, ll b, ll mod)
{
	ll ans = 1;
	while(b)
	{
		if(b%2)
		{
			b--;
			ans = (ans%mod*a%mod)%mod;
		}
		b/=2;
		a = (a%mod*a%mod)%mod;
	}
	return ans;
}


///////////////////////////BFS//////////////////////////////////
void bfs(vector<int>& distance, vector<int> a[], vector<bool>& visited, int u, vector<int>& parent)
{
	visited[u]=true;
	parent[u]=-1;
	distance[u]=0;
	queue<int> q;

	q.push(u); 
    while (!q.empty()) { 
  
        int f = q.front(); 
        q.pop(); 
  		for(int i =0; i < a[f].size(); i++)
  		{
  			if(visited[a[f][i]]==false)
  			{
  				distance[a[f][i]]=distance[f]+1;
  				parent[a[f][i]]=f;
  				visited[a[f][i]]=true;
  				q.push(a[f][i]);
  			}
  		}
    } 

}

void solve()
{

}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	// #ifndef ONLINE_JUDGE
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	// #endif
	ll a;
	long double b;
	cin>>a>>b;
	long double ans = a*b;
	ll f_ans = floor(ans);
	p(f_ans);
	return 0;
}	

Measured memory_bytes: 3768
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>
#include <locale>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define repsg(i,s,g) for(int i = s; i <g; i++)
#define name(x) #x
using namespace std;


const int INF = 10000000;
const long long INFL = (1LL<<40);
const int MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}

template< typename T >
struct edge{
    int src, to;T cost;
    edge(int to,T cost) :src(-1),to(to),cost(cost){}
    edge(int src, int to, T cost) :src(src),to(to),cost(cost){}edge
    &operator=(const int &x){
        to =x;
        return *this;
    }
    operator int() const{ return to;}
};



int main() {
    int s;cin>>s;
    map<int,int> val;
    val[s]=1;
    int dp[10005]={0};
    dp[1]=s;
    int i=1;
    while(1){
        if(dp[i]%2==0){dp[i+1]=dp[i]/2;val[dp[i+1]]+=1;}
        if(dp[i]%2==1){dp[i+1]=3*dp[i]+1;val[dp[i+1]]+=1;}
        
        if(val[dp[i+1]]==2)break;
        i++;
    }
    cout<<i+1<<endl;
    return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

int main(){
    int a, b, c, d; cin >> a >> b >> c >> d;
    for(int i = 0; ; i++){
        if(i % 2 ==0){
            c -= b;
            if(c <= 0) {
                cout << "Yes" << endl;
                return 0;
            }
        }
        else{
            a -= d;
            if(a <= 0){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    return 0;
}

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


int main() {
    int64_t x, k, d;
    cin >> x >> k >> d;

    if (x < 0) x = -x;
    int64_t res = 0;
    if (x / d > k) {
        res =  x - k * d;
        cout << res << endl;
        return 0;
    }

    //　原点はさんでちょこまかするパタン
    int64_t restK = k - abs(x) / d;
    if (restK % 2 == 0) {
        res = abs(x - d * (k - restK));
    } else {
        res = abs(x - d * (k - restK + 1));
    }
    cout << res << endl;
    return 0;

}


Measured memory_bytes: 3616
# include <cstdio>
# include <map>
# include <cmath>

using namespace std;

const int mod = 1e9+7;

int main()
{
    int n;
    int  a[100005];
    map<int,int> m;
    scanf("%d",&n);

    for(int i = 0;i < n;i++)
    {
        scanf("%d",&a[i]);
        m[a[i]]++;
    }

    int flag = 0; 
    if(n%2) //奇数 
    {
        if(m[0] != 1)
        {
            flag = 1;
        }
        for(int i = 2;i < n;i+=2)
        {
            if(m[i] != 2)
            {
                flag = 1;
            }
        }
    }else{
        for(int i = 1;i < n;i+=2)
        {
            if(m[i] != 2)
            {
                flag = 1;
            }
        }
    }
    long long sum = 1;

    for(int i =0;i < floor(n/2);i++)
    {
        sum = ((sum % mod) * 2)% mod;
    }

    if(n%2)
    {
        if(flag)
        printf("0\n");
        else
        printf("%lld\n",sum);
    }   
    else
    {
        if(flag)
        printf("0\n");
        else
        printf("%lld\n",sum);
    }

    return 0;
 } 

Measured memory_bytes: 4480
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <iomanip>
using namespace std;
typedef long long ll;

int main(){
double A,B,H,M,h,m,z;
cin >> A >> B >> H >> M;
h = H*30+M/2;
m = M*6;
const double PI = 3.14159265358979;
z=(h-m)*PI/180.000000000;
cout << setprecision(15) << sqrt(A*A+B*B-2*A*B*cos(z)) << endl;

}


Measured memory_bytes: 4248
#include <bits/stdc++.h>
		    #include<math.h>
		    #define IO ios_base::sync_with_stdio(false);
		    #define TT cin.tie(NULL); cout.tie(NULL);
		    using namespace std;
		    #define ll long long int
		    #define f(a,c) for(a=0; a<c; a++)    
		    #define pi 3.1415926536
		    #define maxxo 1e9
		    int main(){
		    //    freopen ("input.txt","r",stdin);
		//    freopen ("output.txt","w",stdout);
		        IO TT
		        int p=1;
		     // cin>>p;
		        while(p--)
		        { long double a,b;
		        cin>>a>>b;
		        cout<<setprecision(25)<<floor(a*b);
		    }
		    }	
		    


Measured memory_bytes: 3812
import java.util.Scanner;

class Main{
    static Scanner scan=new Scanner(System.in);
    public static void main(String args[]){
        String s=scan.nextLine();
        String x="";
        int min=99999999,tmp;
        for(int i=0;i+2<s.length();i++){
            x="";
            x+=s.charAt(i);
            x+=s.charAt(i+1);
            x+=s.charAt(i+2);
            //System.out.println(">>"+x);
            tmp=Integer.parseInt(x)-753;
            tmp=Math.abs(tmp);
            if(min>tmp){
                min=tmp;
            }
        }
        System.out.println(min);
    }
}

Measured memory_bytes: 23124
fun main(args: Array<String>) {
    val (h, w, k) = readInputLine().split(" ").map{it.toInt()}
    
    val mod = 1000000007 
    
    if (w == 1 && k == 1) {
        println(1)
        return
    }
    
    // dp[高さ][縦棒番号]
    val dp = Array(h + 1,{IntArray(w)})
    
    dp[0][0] = 1
    
    for (i in 0 until h) {
        for (j in 0 until w) {
            for (bit in 0 until (1 shl (w - 1))) {
                var ok = true
                
                for (l in 0..w - 2) {
                    if (bit and (1 shl l) != 0 && bit and (1 shl l + 1) != 0) {
                        ok = false
                        break
                    }
                }
                
                if (!ok) {
                    continue
                }
                
                if (bit and (1 shl j) != 0) {
                    dp[i + 1][j + 1] += dp[i][j]
                    dp[i + 1][j + 1] %= mod
                } else if (j > 0 && bit and (1 shl (j - 1)) != 0) {
                    dp[i + 1][j - 1] += dp[i][j]
                    dp[i + 1][j - 1] %= mod
                } else {
                    dp[i + 1][j] += dp[i][j]
                    dp[i + 1][j] %= mod
                }
            }
        }
    }
    
    println(dp[h][k - 1])
}

fun readInputLine(): String {
    return readLine()!!
}


Measured memory_bytes: 36200
#include<cstdio>

int n;
int x, y, z;
int a[100005];

int main()
{
	while (~scanf("%d", &n))
	{
		x = y = z = 0;
		for (int i = 0; i < n; i++)
		{
			scanf("%d", &a[i]);
			if (a[i] % 4 == 0) x++;
			else if (a[i] % 2 == 0) y++;
			else z++;
		}

		/*printf("x = %d\n", x);
		printf("y = %d\n", y);
		printf("z = %d\n", z);*/

		if (y % 2)
		{
			if (x + 1>= 1 + z)
			{
				printf("Yes\n");
				continue;
			}
		}

		else if (y % 2 == 0)
		{
			if (x + 1>= z)
			{
				printf("Yes\n");
				continue;
			}
		}

		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 512
/*input
3 3
abc


*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
typedef long long int ll;
#define ld long double
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define sz(_a) (ll)(_a.size())
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
const ll maxn=100005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;

ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=res*a%MOD;
        a=a*a%MOD;
        b>>=1;
    }
    return res;
}
int main() {
    int n;
    cin>>n;
    int a[n],b[n],c[n-1];
    REP(i,n){
    	cin>>a[i];
    }
    REP(i,n) cin>>b[i];
    REP(i,n-1) cin>>c[i];
    int ans=0;
    REP(i,n){
    	ans+=b[a[i]-1];
    	if(i>0 and a[i]==a[i-1]+1){
    		ans+=c[a[i-1]-1];
    	}
    }
    cout<<ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
 
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("-ffloat-store")
 
#define int  long long
#define rep(i,begin,end) for(__typeof(end)i=(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
#define F first
#define S second
#define sz(x) ((int)x.size())
#define pb push_back
#define pf push_front
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
#define what_is(x) cerr << #x << " is " << x <<"\n";
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.rbegin(), v.rend())
#define PI 3.14159265358979323846
#define vout(a) for(auto x:a) cout<<x<<" ";
#define INF 2000000000000000000 //1e16
 
// #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
 
 
// using namespace __gnu_pbds;
using namespace std;
 
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;
using vii = vector<pii>;
using mi  = multiset<int>;
using mii = multiset<pii>;
 
int lcm(int a,int b) {return (a*(b/__gcd(a,b)));}



void solve()
{
    int n,m,t,i,k,r,l,u,v,w,j,pos,sum=0,flag=0,count=0;
    string S,T; 
    // int x1,y1,x2,y2,z1,z2;
    cin>>S;
    n=sz(S);
    rep(i,0,n)
    {
        sum+=(S[i]-'0')%9;
        sum%=9;
    }
    if(sum) cout<<"No";
    else cout<<"Yes";
}


signed main()
{
    #ifndef ONLINE_JUDGE 
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve();
        if(t)cout<<"\n";
    }
    return 0;
}

Measured memory_bytes: 3740
import java.util.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

// AOJ 0010
public class Main {

	static Scanner sc = new Scanner(System.in);
	static int N;
	public static void main(String[] args) {
		N = sc.nextInt();
		double[] x = new double[3], y = new double[3];
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < 3; j++) {
				x[j] = sc.nextDouble();
				y[j] = sc.nextDouble();
			}
			double 
			a = hypot(x[0] - x[1], y[0] - y[1]),
			b = hypot(x[1] - x[2], y[1] - y[2]),
			c = hypot(x[2] - x[0], y[2] - y[0]);
			double R = a * b * c / (sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c)));
			double 
			aA = acos( (b * b + c * c - a * a) / (2.0 * b * c)),
			aB = acos( (c * c + a * a - b * b) / (2.0 * c * a)),
			aC = acos( (a * a + b * b - c * c) / (2.0 * a * b));
			double
			A = sin(2.0 * aA),
			B = sin(2.0 * aB),
			C = sin(2.0 * aC);
			
			double 
			xp = ((x[2] * A + x[0] * B + x[1] * C) / (A + B + C)),
			yp = ((y[2] * A + y[0] * B + y[1] * C) / (A + B + C));
			System.out.printf("%.3f %.3f %.3f\n", xp, yp, R);
		}
	}
}

Measured memory_bytes: 12000
# -*- coding: utf-8 -*-
def judge(num):
    try:
        int(num)
        return True
    except ValueError:
        return False


chs = input().split()
st = []
id = 0

for ch in chs:
    #print(ch)
    if(judge(ch)):
        st.append(int(ch))
        id += 1
    else:
        if(ch == "+"):
            st[id-2] = st[id-2] + st[id-1]
            st.pop()
            id -= 1
        if(ch == "-"):
            st[id-2] = st[id-2] - st[id-1]
            st.pop()
            id -= 1
        if(ch == "*"):
            st[id-2] = st[id-2] * st[id-1]
            st.pop()
            id -= 1
    #print(st,id)

print(st[id-1])


Measured memory_bytes: 5608
/***

    Muhammad Imdad-Ul-Haque Rakib(Attari)
    CSE'19
    Chittagong,Bangladesh

***/


#include<bits/stdc++.h>


/**Definitions**/


#define   ld             long double
#define   ll             long long
#define   boost_         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define   pb             push_back
#define   ppb            pop_back
#define   ull            unsigned long long
#define   over           return 0
#define   scan(i,n,a)    for(i=0;i<n;i++) cin>>a[i]
#define   MP             make_pair
#define   spc            " "

using namespace std;


/** Predefined Functions **/


int gcd(int x,int y){
    if(x==0) return y;
    else return gcd(y%x,x);
}
bool sortbysec(const pair<int,int>&a, const pair<int,int>&b){ return (a.second<b.second); }
bool sortbysecinrev(const pair<int,int>&a, const pair<int,int>&b){ return (a.second>b.second); }
bool sortbysize(string &s1,string &s2){ return s1.size() < s2.size(); }
bool sortinrev(const pair<int,int> &a, const pair<int,int> &b){ return (a.first > b.first); }


/** Main Function **/


int main(){

    boost_;
    ll n;
    cin>>n;
    ll a[n],i,a1=0,a2=0,a3=0;
    vector<ll>v,q;
    map<ll,ll>mp;
    scan(i,n,a);

    sort(a,a+n,greater<int>());

    for(i=0;i<n;++i){
        mp[a[i]]++;
        if(mp[a[i]]==1) q.pb(a[i]);
    }

    for(i=0;i<q.size();++i){
        if(mp[q[i]]>=2) v.pb(q[i]);
        if(v.size()==2) break;
    }
    if(v.size()==0) cout<<0<<endl;
    else{

       if(v.size()==1){if(mp[v[0]]>=4) cout<<v[0]*v[0]<<endl; else cout<<0<<endl;}
       else{
           if(mp[v[0]]>=4) cout<<v[0]*v[0]<<endl;
           else cout<<v[0]*v[1]<<endl;
       }
    }


    over;
}


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

int main() {
   int a, b, c;
   cin >> a >> b >> c;

   if ((a == b && b != c)|| (b == c && c != a) || (c == a && a != b)) {
       cout << "Yes" << endl;
   } else {
       cout << "No" << endl;
   }
}

Measured memory_bytes: 256
import sys
readline = sys.stdin.readline

N, M = map(int, readline().split())
MOD = 10**9+7
dpscc = [[0]*(N+1) for _ in range(N+1)]
dpus = [[0]*(N+1) for _ in range(N+1)]
dpscc[1][0] = 1

for m in range(M):
    dpscc2 = [[0]*(N+1) for _ in range(N+1)]
    dpus2 = [[0]*(N+1) for _ in range(N+1)]
    for i in range(1, N+1):
        for j in range(N+1-i):
            kscc = dpscc[i][j]
            kus = dpus[i][j]
            dpscc2[i][j] = (dpscc2[i][j] + i*kscc) % MOD
            dpus2[i][j] = (dpus2[i][j] + j*(kus+kscc)) % MOD
            dpscc2[i+j][0] = (dpscc2[i+j][0] + i*kus) % MOD
            if N-i-j:
                dpus2[i][j+1] = (dpus2[i][j+1] + (N-i-j)*(kus+kscc)) % MOD
    
    dpscc = [d[:] for d in dpscc2]
    dpus = [d[:] for d in dpus2]
print(dpscc[N][0])

Measured memory_bytes: 143368