akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll maxn = 1e6 + 7;
ll a[1002][1002], t, n, m, x;
void test()
{
    for(int i=0;i<1000;i++)
    {
        a[0][i]=1;
        a[i][0]=1;
    }
    for(int i=1;i<1000;i++)
    {
        for(int j=1;j<1000;j++)
            a[i][j]=a[i][j-1]+a[i-1][j-1];
    }

    cin >> t;
    for(int i=0; i < t; i++)
    {
        cin >> n >> m;
        for(int j=0;j<1000;j++)
        {
            m = m - a[n-1][j];
            if(m<=0)
            {
                x = j;
                break;
            }
        }
    cout << x + 1<<'\n';
    }
}
void sol()
{
    cin >> n >> m >> x;
    t = max(n, m);
    cout << (x + t - 1) / t;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    sol();
    //getch();
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define lp3(i,a,b) for(int i=a;i<b;i++)
#define lp2(i,n) for(int i=0;i<n;i++)
#define ll long long
#define W 1000000007
using namespace std;

int main(){
	int n;
	cin>>n;
	int h = n/30,m = 2 * (n%30);
	cout<<h<<" "<<m<<endl;
	return 0;
}



Measured memory_bytes: 3112
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
using namespace std;

int main(){
  string s;
  int n;
  cin>>n>>s;
  int str=s.length();
  for(int i=0;i<str;i++){
    if(s[i]+n<='Z'){
      s[i]+=n;
    }
    else s[i]=s[i]+n-26;
  }
  cout<<s<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#define div 1000000007
using namespace std;

int main(){
    long long n,k;
    cin >> n >> k;
    long long ans = 0;
    for(long long i=k;i<=n+1;i++){
        ans += i*(n-i+1)+1;
        ans %=div;
    }
    cout << ans << endl;
}

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

#define F first
#define S second
#define nl '\n'
#define gcd __gcd
#define nset __builtin_popcount
#define pb push_back
#define pf push_front
#define mp make_pair
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define rep(i, a, b)  for (int i = int(a); i <= int(b); i++)
#define nrep(i, a, b) for (int i = int(a); i >= int(b); i--)
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL)

using ll  = long long;
using ull = unsigned long long;
using vi  = vector<int>;
using vl  = vector<ll>;
using vb  = vector<bool>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvl = vector<vl>;
using ii  = pair<int, int>;
using vii = vector<ii>;
using vs  = vector<string>;
using msi = map<string, int>;
using iss = istringstream;

int main()
{
    FASTIO;
    int n, m, k;
    cin >> n >> m >> k;
    vs grid(n);
    int bcnt = 0;


    rep(i, 0, n-1) {
        cin >> grid[i];
        rep(j, 0, m-1) {
            bcnt += grid[i][j] == '#';
        }
    }

    int ans = 0;
    rep(rcombo, 0, (1 << n)-1) {
        rep(ccombo, 0, (1 << m)-1) {
            int d = 0;
            rep(i, 0, n-1) {
                rep(j, 0, m-1) {
                    if(((rcombo >> i) & 1) ||
                       ((ccombo >> j) & 1))
                        d += grid[i][j] == '#';
                }
            }
            if(bcnt - d == k) ans++;
        }
    }

    cout << ans << nl;
    return 0;
}


Measured memory_bytes: 3612
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

using namespace std;

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;

int main()
{
    int n, r;
    while (cin >> n >> r, n|r) {
        vi v[2];
        rep(i, n){
            v[0].pb(n-i);
            v[1].pb(n-1);
        }
        rep(i, r) {
            int p, c;
            cin >> p >> c;
            int j = 0;
            for (; j < c; j++){
                v[(~i)&1][j] = v[i&1][j+p-1];
            }
            for (; j < c + p-1; j++){
                v[(~i)&1][j] = v[i&1][j-c];
            }
            for (; j < n; j++){
                v[(~i)&1][j] = v[i&1][j];
            }
        }
        cout << v[r&1][0] << endl;
    }
    return 0;
}

Measured memory_bytes: 1220
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <type_traits>

using namespace std;

int main(int argc, const char * argv[]) {
  int n, k;
  cin >> n >> k;
  vector<int> h(n);
  for(int i = 0; i < n; i++){
    cin >> h[i];
  }
  sort(h.begin(), h.end());
  
  int ans = 999999999;
  for(int i = 0; i <= n-k; i++){
    ans = min(ans, h[i+k-1] - h[i]);
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

typedef int64_t int64;
typedef int64_t ll;

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

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

using namespace std;


class D {
	int k;
public:
	D()
	{
		cin >> k;
	}

	double calc(int x)
	{
		int div{ 0 };
		int tmp{ x };
		while (tmp)
		{
			div += tmp % 10;
			tmp /= 10;
		}

		return (double)x / div;
	}

	void test()
	{
		int testnum = 10000;

		for (int x{ testnum / 10 }; x < testnum; x++)
		{
			bool flag{ true };
			double x_calc{ calc(x) };

			for (int y{ x + 1 }; y < testnum; y++)
			{
				if (x_calc > calc(y))
				{
					flag = false;
					break;
				}
			}

			if (flag)
				cout << x << endl;
		}
	}

	bool checkSnuke(string a, string b)
	{
		int div_a{ 0 }, div_b{ 0 };
		REP(i, SZ(a))
		{
			div_a += a[i] - '0';
			div_b += b[i] - '0';
		}

		return (stoll(a) / div_a < stoll(b) / div_b) ? true : false;

	}

	string genNextSnuke(const int check, const string& nines)
	{
		string nextSnuke{to_string(check)};
		int n{ SZ(nextSnuke) };

		REP(i, n)
			if (nextSnuke[n - 1 - i] != '9')
			{
				nextSnuke[n - 1 - i] = '9';
				return nextSnuke + nines;
			}

		return nextSnuke + nines;

	}

	void solve()
	{

		if (k <= 9)
		{
			REP(i, k)
				cout << i + 1 << endl;
			return;
		}

		REP(i, 9)
			cout << i + 1 << endl;

		ll answered{ 9 };
		int n_digits{ 2 };
		while (answered < k)
		{
			int fixNine;
			int freeDigits;

			if (n_digits == 2)
			{
				fixNine = 1;
				freeDigits = 1;
			}
			else if (n_digits <= 4)
			{
				fixNine = 2;
				freeDigits = n_digits - 2;
			}
			else
			{
				freeDigits = 3;
				fixNine = n_digits - 3;
			}

			string nines;
			REP(i, fixNine)
				nines.PB('9');

			int limit{ pow(10, freeDigits) - 1 };
			for (int check{ pow(10, freeDigits - 1) }; check <= limit && answered < k; check++)
			{
				if (!((check - limit / 10) % (limit / 10 + 1)))
				{
					answered++;
					cout << to_string(check) + nines << endl;
					continue;
				}

				string check_str{ to_string(check) + nines };
				string nextSnuke{ genNextSnuke(check, nines) };

				if (checkSnuke(check_str, nextSnuke))
				{
					cout << check_str << endl;
					answered++;
				}

			}
			
			n_digits++;

		}


	}
};


int main()
{
	D solution;
	solution.solve();

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

int main()
{
    int i,j;
    int num[100000];
    memset(num,0,sizeof(num));
    for (i=10000;i<100000;i++)
    {
        if(i/10000==i%10&&(i/1000)%10==(i/10)%10)
            num[i]++;
        num[i]+=num[i-1];
    }

    while (scanf("%d%d",&i,&j)!=EOF)
        printf("%d\n",num[j]-num[i-1]);
    return 0;
}

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

  int N , M ;
  cin >> N >> M ;
  N -= M ;
  int count = 1 ;
  vector<int> A(N) ;
  rep(i,N) cin >> A.at(i) ;
  while( N > 0 ){
     N -= (M-1) ;
     count++;
  }
  cout << count << endl;
}

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

public class Test
{
	public static void Main()
	{
		
		int n = int.Parse(Console.ReadLine());
		int a = n%10;
		
		if(a==3){
			Console.WriteLine("bon");
		}else if(a<=1){
			Console.WriteLine("pon");
		}else if(a==6){
			Console.WriteLine("pon");
		}else if(a==8){
			Console.WriteLine("pon");
		}else{
			Console.WriteLine("hon");
		}
		
	}
}

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

using namespace std;

typedef long long          ll;
typedef unsigned long long ull;
typedef vector<int>	       vi;
typedef vector<bool>       vb;
typedef map<int, int>      mii;
typedef pair<int, int>     ii;

#define INF                0x3f3f3f3f
#define INFLL              0x3f3f3f3f3f3f3f3f
#define each(x, s)         for(auto& x : s)
#define loop(x)	           for(int i = 0;i < x;i++)
#define vloop(v, x)        for(int v = 0;v < x;v++)
#define avg(l, r)          l + (r - l) / 2
#define iter(a)            a.begin(), a.end()
#define riter(a)           a.rbegin(), a.rend()
#define endl               "\n"

const ll mod = 1000000007;

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

	int x, y;
	cin >> x >> y;
	int z = y / 2;
	cout << (y % 2 == 0 and x <= z and z <= 2 * x ? "Yes" : "No") << endl;
	return 0;
}



Measured memory_bytes: 3616
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;

// Binary Indexed Tree (BIT)
// Verified: AOJ DSL_2_B: Range Sum Query (intのみ)

template <typename T>
struct BIT{
private:
    vector<T> array;
    int n;

public:
    // 初期化
    BIT() {}
    BIT(int _n) : array(_n + 1, 0), n(_n) {}

    // 1番目から i番目までの累積和を求める
    T sum(int i) {
        T s = 0;
        while(i > 0) {
            s += array[i];
            i -= i & -i;      // LSB 減算
        }
        return s;
    }

    // [i, j] の要素の総和
    T sum(int i, int j) {
        T ret_i = sum(i-1);
        T ret_j = sum(j);
        return ret_j - ret_i;
    }

    // i 番目に 要素 x を追加
    void add(int i, T x) {
        while(i <= n) {
            array[i] += x;
            i += i & -i;      // LSB 加算
        }
    }
};

// 次の2つのクエリに対応するBIT
// ・[a, b) の要素全てに x を加えるクエリ
// ・[a, b) の和を計算するクエリ
// Verified: POJ 3468 (A Simple Problem with Integers)

template <typename U>
class BIT_sec {
public:
    int n;
    BIT<U> bit0, bit1;
    BIT_sec(int n_) {
        n = n_;
        bit0 = BIT<U>(n);
        bit1 = BIT<U>(n);
    }

    // 最初に要素を追加するときはこっち
    void add(int i, int x) {
        bit0.add(i, x);
    }

    // [l, r] の全要素に x を加える
    void add(int l, int r, U x) {
        bit0.add(l, -x * (l-1));
        bit1.add(l, x);
        bit0.add(r+1, x*r);
        bit1.add(r+1, -x);
    }

    U sum(int l, int r) {
        U res = 0;
        res += bit0.sum(r) + bit1.sum(r) * r;
        res -= bit0.sum(l-1) + bit1.sum(l-1) * (l-1);
        return res;
    }
};

void DSL_2_G() {
    int N, Q; cin >> N >> Q;

    using ll = long long int;
    BIT_sec<ll> bit(N);
    for(int i=0; i<Q; i++) {
        int query_type; cin >> query_type;
        if(query_type == 0) {
            int s, t, x; cin >> s >> t >> x;
            bit.add(s, t, x);
        }
        if(query_type == 1) {
            int s, t; cin >> s >> t;
            cout << bit.sum(s, t) << endl;
        }
    }
}

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



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

using namespace std;

int N, A[100005];

vector<int> V,W;

int main(void) {

	cin >> N;
	for (int i = 1; i <= N; i++) {
		cin >> A[i];
	}

	for (int i = 1; i <= N; i++) {
		V.push_back(A[i]);
	}

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


	long long int ans = 1;
	if (N % 2 == 0) {
		int q = 1;
		for (int i = 1; i <= N / 2; i++) {
			W.push_back(q);
			W.push_back(q);
			q += 2;
		 }
	}
	else {
		int q = 0;
		W.push_back(q); q += 2;
		for (int i = 1; i <= (N - 1) / 2; i++) {
			W.push_back(q);
			W.push_back(q);
			q += 2;
		}

	}

	if (W != V) {
		ans = 0;
	}
	else {
		if (N % 2 == 0) {
			for (int i = 1; i <= N / 2; i++) {
				ans *= 2;
				ans %= 1000000007;
			}
		}
		else {
			for (int i = 1; i <= (N - 1) / 2; i++) {
				ans *= 2;
				ans %= 1000000007;
			}
		}
	}

	cout << ans << endl;
	//system("pause");
	return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
//typedef long double ld;

typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<double,double> pdd;
typedef set<int> si;
typedef set<ll> sll;
typedef vector<int> vi;
typedef vector<pair<int, int > > vii;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef vector<vll> vvll;

constexpr ll MOD = 1e9+7;
constexpr int INF = 1<<30;
constexpr ll  LINF = 1LL<<60;

#define Sort(x) sort(x.begin(),x.end())
#define Reverse(x) reverse(x.begin(),x.end())
#define ABS(a,b) ((a)<(b)?(b)-(a):(a)-(b))
#define bit(n) (1ll<<(n))

// sort(begin(x), end(x), greater<ll>());
// lower_bound(a.begin(), a.end(), val): a[i] ≥ valである最左の位置
// upper_bound(a.begin(), a.end(), val): a[i] > valである最左の位置

// Returns minimum of a and b.
// If a is less b, a is set to b.
template<typename T>
T chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
  return a;
}

// Returns maximum of a and b.
// If a is less b, a is set to b.
template<typename T>
T chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
  return a;
}

// a = (a+b)%MOD;
void addmod(ll& a, ll b) {
  a = (a+b)%MOD;
}

template <typename T>
void dumpContents(const T& v, const string& msg)
{
  cerr << "### " << msg << " ###\n";
  for (const auto& x : v) {
    cerr << x << " ";
  }
  cerr << endl;
}

struct before_main_function {
  before_main_function() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<setprecision(20)<<fixed;
    #define endl "\n"
  }
} before_main_function;

// ========== end of template ==========

int run(int& a, int& b) {
  int ret = 0;
  if (a>=b) {
    ret = a;
    a--;
  } else {
    ret = b;
    b--;
  }

  return ret;
}

int main(int argc, char** argv) {
  int A, B;
  cin >> A >> B;

  int ret = 0;
  ret += run(A,B);
  ret += run(A,B);

  cout << ret << endl;


  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<map>
#include<set>

using namespace std;
using ll = long long;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
const double PI = 4.0 * atan(1.0);

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

int main() {
    int A; cin >> A;
    int B; cin >> B;

    int x = A + B;
    int y = A - B;
    int z = A * B;

    cout << max(x, max(y, z)) << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = iss()
    qu = []
    ret = 0

    for s in S:
        if not qu:
            qu.append(s)
        elif qu[-1] != s:
            qu.pop()
            ret += 2
        else:
            qu.append(s)
    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 4992
#include <stdio.h>
#include <stdlib.h>
int main(void){
    // Your code here!
    int a,b,c, min = 1000;
    scanf("%d %d %d",&a,&b,&c);
    if(min > abs(b-a) + abs(c-b)) min = abs(b-a) + abs(c-b);
    if(min > abs(c-a) + abs(b-c)) min = abs(c-a) + abs(b-c);
    if(min > abs(a-b) + abs(c-a)) min = abs(a-b) + abs(c-a);
    if(min > abs(c-b) + abs(a-c)) min = abs(c-b) + abs(a-c);
    if(min > abs(a-c) + abs(b-a)) min = abs(a-c) + abs(b-a);
    if(min > abs(b-c) + abs(a-b)) min = abs(b-c) + abs(a-b);
    printf("%d\n", min);
}


Measured memory_bytes: 128
#include<iostream>
#include <stdio.h>
using namespace std;
int main(){
	long long a[10001],n,i, max,min,gou=0;
	cin>>n;
	min=1000000;
	max=-1000000;
	for(i=0;i<n;i++){
		cin>>a[i];
		gou+=a[i];
		if(a[i]>max){
			max=a[i];
		}if(a[i]<min){
			min=a[i];
		}
	}
	cout<<min<<" "<<max<<" "<<gou<<endl;
	return 0;
}



Measured memory_bytes: 3152
import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main{
	public static void main (String[] args) throws java.lang.Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		for(int i=0;i<n;i++){
			String str = br.readLine();
			String[] data = str.split(" ");
			int k = Integer.parseInt(data[0]);
			int p = Integer.parseInt(data[1]);
			if(p>k){
				System.out.println(k);
				continue;
			}
			else if(k%p==0){
				System.out.println(p);
				continue;
			}
			System.out.println(k-(k/p)*p);
		}
	}
}

Measured memory_bytes: 17088
a=int(input())
K = 0
b = 0
List = [27]*13
res = ""
for i in range(12):
  K = a % 26
  if K ==0:
    K=26
  List[i] = int(K)
  b = a-K
  if b >=26:
    a = b/26
  else:
    break
for i in range(13):
  if List[12-i] ==27:
    pass
  else:
    res += chr(List[12-i]+96)
print(res)

Measured memory_bytes: 9204
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

vector<bool> solve(int n, vector<bool> const & s){
  rep(i,2){
    rep(j,2){
      vector<bool> t(n);
      t[0] = i;
      t[1] = j;

      srep(k,2,n){
        t[k]= t[k-2]^t[k-1]^s[k-1];
      }
      if(s[n-1] == (t[n-2]^t[n-1]^t[0]) && s[0] == (t[n-1]^t[0]^t[1])) return t;
    }
  }
  return vector<bool>();
}

int main() {
  int n;
  string s;
  cin>>n;
  cin>>s;
  vector<bool> b(n);
  rep(i,n) b[i] = (s[i] == 'o');
  auto res = solve(n,b);
  if(res.empty()){
    cout<<-1<<endl;
  }else{
    for(auto e: res) cout<<(e?'S':'W');
    cout<<endl;
  }
  return 0;
}

Measured memory_bytes: 512
/*
    If they say
    Who cares if one more light goes out?
    In a sky of a million stars
    It flickers, flickers
    Who cares when someone's time runs out?
    If a moment is all we are
    We're quicker, quicker
    Who cares if one more light goes out?
    Well I do
*/

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

#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) ((a) / gcd(a,b)) * (b)
#define all(x)  x.begin(),x.end()

#define ll long long
#define ull unsigned long long
#define VI vector<int>
#define VLL vector<ll>
#define VS vector<string>
#define MPII map<int, int>
#define SET set<int>
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define INF (int)1e9
#define MEM(a, b) memset(a, (b), sizeof(a))
#define fast_io   ios_base::sync_with_stdio(false);cin.tie(0),cout.tie(0);

void solve(){
    ll d,t,s;
    cin>>d>>t>>s;
    double ans = d/(s*1.0);
    //cout<<ans<<endl;
    if(ans <= (t*1.0))cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

int main(){
    fast_io;
    ll t, k=0;
    t=1;
    while(t--){
        //k++;
        //cout<<"Case "<<k<<": ";
        solve();
    }
}



Measured memory_bytes: 3652
def main():
    mod = 998244353
    N, K = map(int,input().split())

    v = []
    for _ in range(K):
        L, R = map(int,input().split())
        # for d in range(L, R+1):
        #     moves.append(d)
        v.append((L, R))
    v.sort()

    dp = [0] * N        # マスi-1に到達するまでの操作列の個数
    sdp = [0] * (N + 1) # dp[i]までの累積和 
    dp[0] = 1
    sdp[1] = 1

    for n in range(1, N):
        for p in v:
            left = max(0, n - p[1])
            right = max(0, n - p[0]+1)
            dp[n] += (sdp[right] - sdp[left]) % mod
        sdp[n+1] = (sdp[n] + dp[n]) % mod

    print(dp[-1] % mod)

if __name__ == "__main__":
    main()



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

using namespace std;

double value[45];
int size[45];

double get_value(string &pile){
    bool b_can_move = 0, w_can_move = 0;
    double b_max, w_min;
    double last_value = 0;
    for(int i=0;i<pile.length();i++){
        double value;
        if(pile[i]=='B'){
            /*if(b_can_move){
                b_max = max(b_max,last_value);
            }
            else{
                b_max = last_value;
            }*/
            b_max = last_value;
            b_can_move = 1;
            if(w_can_move){
                value = (b_max + w_min) / 2;
            }
            else{
                value = b_max + 1;
            }
        }
        if(pile[i]=='W'){
            /*if(w_can_move){
                w_min = min(w_min,last_value);
            }
            else{
                w_min = last_value;
            }*/
            w_min = last_value;
            w_can_move = 1;
            if(b_can_move){
                value = (b_max + w_min) / 2;
            }
            else{
                value = w_min - 1;
            }
        }
        last_value = value;
    }
    return last_value;
}

#define map unordered_map

void enumerate(int st, int ed,map<double,int> &table ,double value_sum = 0, int size_sum = 0){
    if(st==ed){
        if(table.count(value_sum)){
            table[value_sum] = max(table[value_sum], size_sum);
        }
        else{
            table[value_sum] = size_sum;
        }
    }
    else{
        enumerate(st+1, ed, table, value_sum, size_sum);
        enumerate(st+1, ed, table, value_sum + value[st], size_sum + size[st]);
    }
}

int find_zero_value(int st,int ed,map<double,int> &table ,double value_sum = 0, int size_sum = 0){
    if(st==ed){
        if(table.count(-value_sum)){
            return table[-value_sum] + size_sum;
        }
        else return 0;
    }
    else{
        int get1 = find_zero_value(st+1, ed, table, value_sum, size_sum);
        int get2 = find_zero_value(st+1, ed, table, value_sum + value[st], size_sum + size[st]);
        return max(get1, get2);
    }
}

map<double,int> table, table2;

int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        string pile;
        cin>>pile;
        size[i] = pile.length();
        value[i] = get_value(pile);
    }
    if(n<=20){
        enumerate(0,n,table);
        printf("%d\n",table[0]);
    }
    else{
        enumerate(0,20,table);
        printf("%d\n",find_zero_value(20,n,table));
    }

    return 0;
}

Measured memory_bytes: 43940
#include <cstdio>
#include <queue>

using namespace std;

int a[200000];
int b[200000];

int main() {
    int n, i;
    long long ans = 0;
    priority_queue <pair<int, int>> q;
    
    scanf("%d", &n);
    
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    for (i = 0; i < n; i++) scanf("%d", &b[i]);
    
    for (i = 0; i < n; i++) q.push(make_pair(b[i], i));
    
    while (!q.empty()) {
        int x = q.top().second, l, r, c;
        
        q.pop();
        
        if (b[x] < a[x]) {
            puts("-1");
            return 0;
        } else if (b[x] == a[x]) {
            continue;
        }
        
        l = (x - 1 + n) % n;
        r = (x + 1) % n;
        
        if (b[x] <= b[l] + b[r]) {
            puts("-1");
            return 0;
        }
        
        c = (b[x] - a[x]) / (b[l] + b[r]);
        
        if (c == 0) {
            puts("-1");
            return 0;
        }
        
        ans += c;
        b[x] -= (b[l] + b[r]) * c;
        
        q.push(make_pair(b[x], x));
    }
    
    printf("%lld\n", ans);
    
    return 0;
}


Measured memory_bytes: 3956
#include <stdio.h>

int main(void) {
	
	int n;
	int nn;
	
	scanf("%d",&n);
	nn = n%1000;
	if(nn == 0){
		printf("0");
	}else{
		printf("%d",1000-nn);
	}
	
	
	
	return 0;
}


Measured memory_bytes: 1724
// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;

int n, k;
vector<int> g[N];


int mod = 1e9+7;
struct modular {
    int value;
    modular(long long v = 0) { value = v % mod; if (value < 0) value += mod;}
    modular(long long a, long long b) : value(0){ *this += a; *this /= b;}
    modular& operator+=(modular const& b) {value += b.value; if (value >= mod) value -= mod; return *this;}
    modular& operator-=(modular const& b) {value -= b.value; if (value < 0) value += mod;return *this;}
    modular& operator*=(modular const& b) {value = (long long)value * b.value % mod;return *this;}
    //其他函数调用mexp(modular(10),3);
    friend modular mexp(modular a, long long e) {
        modular res = 1; while (e) { if (e&1) res *= a; a *= a; e >>= 1; }
        return res;
    }
    friend modular inverse(modular a) { return mexp(a, mod - 2); }
    modular& operator/=(modular const& b) { return *this *= inverse(b); }
    friend modular operator+(modular a, modular const b) { return a += b; }
    friend modular operator-(modular a, modular const b) { return a -= b; }
    friend modular operator-(modular const a) { return 0 - a; }
    friend modular operator*(modular a, modular const b) { return a *= b; }
    //除法只有在mod是素数可用;
    friend modular operator/(modular a, modular const b) { return a /= b; }
    friend ostream& operator<<(ostream& os, modular const& a) {return os << a.value;}
    friend istream& operator>>(istream& is, modular & a){long long value; is >> value;a.value = 0; a += value;  return is;}
    friend bool operator==(modular const& a, modular const& b) {return a.value == b.value;}
    friend bool operator!=(modular const& a, modular const& b) {return a.value != b.value;}
};


modular ans;


modular A(int n, int k){
    modular ans = 1;
    int cnt = 0;
    for (int i = 0; i < k; i++){
        ans *= n;
        n--;
    }
    return ans;
}

void dfs(int u, int p){
    int cnt_son = 0;
    for (auto v : g[u]) {
        if(v != p) cnt_son ++;
    }
    
    if(p == -1) ans *= A(k-1, cnt_son);
    else ans *= A(k-2, cnt_son);
    
    for (auto v : g[u]) {
        if(v == p)continue;
        dfs(v, u);
    }
}



int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin >> n >> k;
    
    ans = k;
    for (int i = 0; i < n-1; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    
    
    
    
    dfs(0, -1);
    
    
    cout << ans.value << "\n";
    
    
    
    
    return 0;
}


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

int main(){
  string s;
  cin >> s;
  int ans=1;
  bool ok=false,ok2=false;
  for(int i=1;i<s.size();i++){
    if(ok){
      ans++;
      ok=false;
      ok2=true;
    }else if(ok2){
      ans++;
      ok=false;
      ok2=false;
    }else if(s.at(i)!=s.at(i-1)){
      ans++;
    }else{
      ok=true;
      ok2=false;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3692
N=int(input())
count=0
m=[]
s=input()
m.append(s)
for i in range(N-1):
    l=input()
    if l not in m and m[i][-1]==l[0]:
        count+=1
    m.append(l)
if count==N-1:
    print("Yes")
else:
    print("No")



Measured memory_bytes: 3060
#include<stdio.h>
#include<string.h>

int main(void)
{
	char a[100];
	int len;
	scanf("%s",a);
	len = strlen(a);
	int i;
	for(i=0;i<len;i++)
		a[i] = 'x';
	printf("%s",a);
	return 0;
}

Measured memory_bytes: 128
n,s=int(input()),input()
maxcount=0
for i in range(1,n+1):
  count=0
  x,y=s[:i],s[i:]
  for t in set(s):
    if t in x and t in y:
      count+=1
  if maxcount<count:
    maxcount=count
print(maxcount)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n, m;
    cin >> n >> m;
    vector<int> road(n);

    for (int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        road.at(a - 1)++;
        road.at(b - 1)++;
    }

    for (int i = 0; i < n; i++){
        cout << road.at(i) << endl;
    }
}

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

using namespace std;

int main(void){
   int n;
   cin >> n;
   
   string s;
   cin >> s;
   
   int counter = 0;
   
   for(int i = 0; i <= n-3; i++){
       if(s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C') counter++;
   }
   
   cout << counter << endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
typedef array<int, 3> arr3;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 1e9+7; constexpr int MAX = 200020;
const double pi = acos(-1); constexpr double EPS = 1e-8;
constexpr ll INF = 1e18;
void y(bool cond) {
	if (cond)print("Yes");
	else print("No");
}



void no() {
	print("No");
	exit(0);
}
void solve() {
	int N, A, B, C, D; cin >> N >> A >> B >> C >> D;
	string S; cin >> S;
	S += '#';
	A--, B--, C--, D--;

	if (D > C) {
		int pos = B;
		while (pos < D) {
			if (S[pos + 1] == '#'&&S[pos + 2] == '#') {
				no();
			}
			else if (S[pos + 1] == '.')pos++;
			else pos += 2;
		}
		pos = A;
		while (pos < C) {
			if (S[pos + 1] == '#'&&S[pos + 2] == '#') {
				no();
			}
			else if (S[pos + 1] == '.')pos++;
			else pos += 2;
		}
	}
	else {
		int pos = B;
		while (S[pos - 1] == '#'||S[pos + 1] == '#') {
			if (pos > D)no();
			if (S[pos + 1] == '.')pos++;
			else if (S[pos + 2] == '.')pos += 2;
			else no();
		}
		S[pos] = '#';
		if (pos > D)no();
		pos = A;
		while (pos < C) {
			if (S[pos + 1] == '#'&&S[pos + 2] == '#') {
				no();
			}
			else if (S[pos + 1] == '.')pos++;
			else pos += 2;
		}
	}
	print("Yes");
}


signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
	solve();
}




Measured memory_bytes: 592
#include <iomanip>
#include <iostream>

char grade(int m, int f, int r) {
  if (m < 0 || f < 0)
    return 'F';
  int s = m + f;
  if (s >= 80)
    return 'A';
  if (65 <= s && s < 80)
    return 'B';
  if (50 <= s && s < 65)
    return 'C';
  if (30 <= s && s < 50) {
    if (r < 50)
      return 'D';
    else
      return 'C';
  }
  if (s < 30)
    return 'F';
  throw;
}

int main() {
  int m, f, r;
  while (std::cin >> m >> f >> r) {
    if (m == -1 && f == -1 && r == -1)
      return 0;
    std::cout << grade(m, f, r) << std::endl;
  }
}



Measured memory_bytes: 3088
import numpy as np
n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]
dp = np.zeros((n,3), dtype='int64')
l = np.array(l)
dp[0] = l[0]
for i in range(1,n):
    dp[i][0] = l[i][0] + max(dp[i-1][1], dp[i-1][2]) 
    dp[i][1] = l[i][1] + max(dp[i-1][0], dp[i-1][2]) 
    dp[i][2] = l[i][2] + max(dp[i-1][0], dp[i-1][1])
print(np.max(dp[n-1]))


Measured memory_bytes: 41884
main()
{
 int a, b, c;
 int x, y, z;

 scanf("%d%d%d", &a, &b, &c);

 if(a > b){
  x = a;
  a = b;
  b = x;
 }

 if(b > c){
  y = b;
  b = c;
  c = y;
 }

 if(a > b){
  z = a;
  a = b;
  b = z;
 }

 printf("%d %d %d\n", a, b, c);

 return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
int main() {
for (int k = 0; k < 100000; k++){
int N, X; 
cin >> N >> X;
if(N == 0 && X == 0) break; 
int count = 0; 
for (int i = 1; i < N-1; i++){
 for (int j = i+1; j < N; j++){
if(X - i - j <= N && X - i - j > j) count ++; 
}
}
cout << count << endl; 
}
}


Measured memory_bytes: 3112
#include <iostream>
#include <vector>
#include <set>
using namespace std;
vector< vector<int> > edg;
vector<int> mem, loop;
int dfs(int x, int y){
    for(int i=0;i<edg[x].size();i++){
        int z = edg[x][i];
        if(mem[z] == mem[x]){
            return z;
        }
        if(mem[z] != -1)continue;
        mem[z] = mem[x];
        loop.push_back(z);
        //cout << z+1 << " ->" << endl;
        int r = dfs(z, x);
        if(r != -1){
            return r;
        }
        //cout << z+1 << " <-" << endl;
        loop.pop_back();
        mem[z] = -1;
    }
    return -1;
}
int main(void){
    int n, m, st = -1;
    cin >> n >> m;
    edg.assign(n, vector<int>());
    mem.assign(n, -1);
    for(int i=0;i<m;i++){
        int a, b;
        cin >> a >> b;
        edg[--a].push_back(--b);
    }
    for(int i=0;i<n;i++){
        if(mem[i] == -1){
            loop.clear();
            mem[i] = i;
            loop.push_back(i);
            st = dfs(i, i);
            if(st != -1)break;
        }
    }
    if(st != -1){
        int ls = loop.size();
        set<int> use;
        for(int i=0;i<ls;i++){
            if(loop[i] == st){
                for(int j=i;j<ls;j++){
                    use.insert(loop[j]);
                }
                loop.assign(loop.begin()+i, loop.end());
                break;
            }
        }

        bool update = true;
        while(update){
            update = false;
            ls = loop.size();
            for(int i=0;i<ls;i++){
                int v = loop[i];
                for(int j=0;j<edg[v].size();j++){
                    int z = edg[v][j];
                    if(loop[(i+1)%ls] == z || use.find(z) == use.end())continue;
                    vector<int> res;
                    int flg = 0;
                    for(int k=0;k<ls;k++){
                        int u = loop[(i+k+1)%ls];
                        if(u == z)flg = 1;

                        if(flg == 0)use.erase(u);
                        if(flg == 1){
                            res.push_back(u);
                        }
                    }
                    loop.assign(res.begin(), res.end());
                    update = true;
                    break;
                }
                if(update)break;
            }
        }
        cout << ls << endl;
        for(int i=0;i<ls;i++){
            cout << loop[i]+1 << endl;
        }
    }else{
        cout << -1 << endl;
    }
}


Measured memory_bytes: 384
tree_dict = dict()

input()
l = map(int, raw_input().split())

for x in l:
    if tree_dict.has_key(x):
        tree_dict[x] += 1
    else:
        tree_dict[x] = 1

long_line = 0
short_line = 0

for k,v in tree_dict.iteritems():
    if v >= 4:
        (_,_,short_line,long_line) = sorted((k,k,short_line,long_line))
        next
    if v >= 2:
        (_,short_line,long_line) = sorted((k,short_line,long_line))


print(long_line * short_line)


Measured memory_bytes: 16088
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define MT make_tuple
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
#define rt return
using dbl = double;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;

int N;
vector<pii> G[100001];
ll di[100001];

void dfs(int u, int p, ll d) {
    di[u] = d;
    each(e, G[u])if (p != e.first) {
        dfs(e.first, u, d + e.second);
    }
}

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

    cin >> N;
    rep(i, N - 1) {
        int a, b, c;
        cin >> a >> b >> c;
        G[a].push_back({ b,c });
        G[b].push_back({ a,c });
    }

    int Q, K;
    cin >> Q >> K;
    dfs(K, -1, 0);

    while (Q--) {
        int x, y;
        cin >> x >> y;
        cout << di[x] + di[y] << endl;
    }
}


Measured memory_bytes: 12800
char*L="0 1 2 3 4 5 6 7 8 9 5 4 3 2 1 0 1 2 3 4 5 6 7 8",*S1,*D1,*S2,*D2;
s,d;
main(){
	scanf("%*d");
	for(;~scanf("%d%d",&s,&d);){
		S1=strchr(L,s+'0');
		D1=strchr(S1,d+'0');
		if((S2=strchr(S1+1,s+'0'))&&(D2=strchr(S2,d+'0'))){
			if(D2-S2<D1-S1){
				S1=S2;
				D1=D2;
			}
		}
		printf("%.*s\n",D1-S1+1,S1);
	}
}

Measured memory_bytes: 0
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>

//#include <cv.h>
//#include <highgui.h>
#include <stdlib.h>
#include <time.h>

#include <string>

const int MAX_N = 510;
int N, x[MAX_N];
int ret[MAX_N * MAX_N];

int main(int argc, char **argv) {
    std::cin >> N;
    for (int i = 1; i <= N; i++) {
        std::cin >> x[i];
    }

    std::vector<int> vec;
    for (int i = 1; i <= N; i++) {
        vec.push_back(i);
    }
    std::sort(vec.begin(), vec.end(), 
        [](const int a, const int b) { return x[a] < x[b]; }
    );

    std::queue<int> left_que, right_que;
    for (int i = 0; i < vec.size(); i++) {
        for (int j = 1; j <= vec[i] - 1; j++) {
            left_que.push(vec[i]);
        }
    }

    for (int i = vec.size() - 1; 0 <= i; i--) {
        for (int j = vec[i] + 1; j <= N; j++) {
            right_que.push(vec[i]);
        }
    }

    for (int i = 1; i <= N; i++) {
        ret[x[i]] = i;
    }

    int pos = 1;
    while (!left_que.empty()) {
        if (ret[pos] == 0) {
            int i = left_que.front(); left_que.pop();
            if (x[i] < pos) {
                std::cout << "No" << std::endl;
                return 0;
            }
            ret[pos] = i;
        }
        pos++;
    }

    pos = N * N;
    while (!right_que.empty()) {
        if (ret[pos] == 0) {
            int i = right_que.front(); right_que.pop();
            if (pos < x[i]) {
                std::cout << "No" << std::endl;
                return 0;
            }
            ret[pos] = i;
        }
        pos--;
    }

    std::cout << "Yes" << std::endl;
    for (int i = 1; i <= N*N; i++) {
        std::cout << ret[i] << " ";
    }


    return 0;
}

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

int gcd(int a, int b)
{
	return b ? gcd(b, a % b) : a;
}

int main()
{
	int a, b, g, l;
	while (cin >> a >> b)
	{
		g = gcd(a, b); l = a / g * b;
		cout << g << ' ' << l << endl;
	}
	return 0;
}


Measured memory_bytes: 3080
//include
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath> 
#include <iomanip>
#include <math.h>
#include <utility>
#include <functional>
#include <cstdlib>
//using
using namespace std;
using vl = vector <long long>;
using vs = vector <string>;
using vc = vector <char>;
using ll= long long;
using vvl = vector<vector<ll> >;
using vvc = vector<vector<char> >;
//vector<vector<char> > hyou(N, vector<char>(N));
using vd = vector <double>;
//define
//#define int long long
#define rep(i,n) for(int i=0; i<n; i++)
#define print(n) cout<<n<<endl;
#define sortp(d) sort(d.begin(),d.end()) //1234
#define sortm(d) sort(d.rbegin(),d.rend()) //4321
//素数判定　O(√A) 
bool is_prime(int x){
 if(x<=1) return false;
 for(int i=2;i*i<=x;i++)
 if(x%i==0) return false;
 return true;
 }
/*順列生成
do {
  // 順列に対する処理
} while (next_permutation(配列変数.begin(), 配列変数.end()));*/

//絶対値　abs()
//文字→数字　'0' アルファベット→数字　'a'　'A'が65番,'a'が97番だわ
//型キャスト　char('a'+1)
//reverse 回文
//if(isupper('A')){puts("Aは大文字です");}
/*各位の和　
int sum = 0;
for(int i = 0; i <= 5; i++){
   sum += n%10;
   n /= 10;  
}
*/

//グローバル変数宣言
ll p=0,q=0,r=0;

int main()
{
  string s;
  cin>>s;
  p=s.size();
  
  if(s[p-1]=='s')s+="es";else s+='s';
  print(s)
}


Measured memory_bytes: 3632
n, m, q = map(int, input().split())

x = [[0]*n for _ in range(n)]

for i in range(m):
  l, r = map(int, input().split())
  l, r = l-1, r-1
  x[l][r] += 1
  
s = [[0]*(n+1) for _ in range(n+1)]
for i in range(n):
  for j in range(n):
    s[i+1][j+1] = s[i+1][j] + s[i][j+1] - s[i][j] + x[i][j]

for _ in range(q):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  print(s[b+1][b+1] - s[b+1][a] - s[a][b+1] + s[a][a])

Measured memory_bytes: 16740
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define int long long
//#define PI 3.14159265358979

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

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

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

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(11);
	}
};
initializer _____;

int N, M, K, T, Q;
void dfs(vector< priority_queue< int, vector< int >, greater< int > > > &F, vector< vector< int > > &G, vector< int > &A, int p, int x) {
	F[F.size() - 1].push(A[x]);
	A[x] = -1;
	rep(i, G[x].size()) {
		int j = G[x][i];
		if (j == p)
			continue;
		dfs(F, G, A, x, j);
	}
}
signed main() {
	cin >> N >> M;
	vector< int > A(N);
	rep(i, N) cin >> A[i];
	vector< vector< int > > G(N);
	rep(i, M) {
		int x, y;
		cin >> x >> y;
		G[x].push_back(y);
		G[y].push_back(x);
	}
	vector< priority_queue< int, vector< int >, greater< int > > > F;
	rep(i, N) if (A[i] != -1) {
		F.push_back(priority_queue< int, vector< int >, greater< int > >());
		dfs(F, G, A, -1, i);
	}
	int ans = 0;
	if ((F.size() - 1) * 2 > N) {
		cout << "Impossible" << endl;
		return 0;
	}
	if (F.size() == 1) {
		cout << 0 << endl;
		return 0;
	}
	int K = (int)F.size() - 2;
	priority_queue< int, vector< int >, greater< int > > q;
	rep(i, F.size()) {
		ans += F[i].top();
		F[i].pop();
		while (!F[i].empty()) {
			q.push(F[i].top());
			F[i].pop();
		}
	}
	rep(i, K) {
		ans += q.top();
		q.pop();
	}
	cout << ans << endl;

	return 0;
}

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

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

#define REP(i,m,n) for(ll i = m; i < (ll)(n);++i)
#define rep(i,n) REP(i,0,n)
#define all(v) v.begin(),v.end()

int main(){
  string s;
  cin >> s;
  int cnt=0;
  rep(i,s.size()-1){
    if(s[i]!=s[i+1])cnt++;}
  cout << cnt << endl;
}
      

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
typedef long long int ll;
using namespace std;

int main(int argc, char const *argv[]) {
  string S;
  std::cin >> S;
  int N = S.size();
  int a = 0, b = 0;
  if(N%2==0) a = 1;
  if(S[0]==S[N-1]) b = 1;
  std::cout << ((a^b)==1?"Second":"First") << '\n';
  return 0;
}


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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a, b, k; cin >> k >> a >> b;
    for (int i = a; i <= b; i++) {
        if (i % k == 0) {
            cout << "OK\n";
            return 0;
        }
    }
    cout << "NG\n";
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <sstream>
#include <string>

int main()
{
    unsigned int n;
    std::stringstream ss;
    std::cin >> n;
    ss << n << ": ";
    for(unsigned int i = 2; i * i <= n; i++) {
        if(!(n % i)) {
            n /= i;
            ss << i << " ";
            i = 1;
        }
    }
    if(n != 1)
        ss << n << " ";

    std::string s = ss.str();
    std::cout << s.substr(0, s.size() - 1) << std::endl;

    return 0;
}

Measured memory_bytes: 1216