akhauriyash/Code-Regression huggingface dataset:
#include <ext/pb_ds/assoc_container.hpp>
#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_pbds;
template <class c, class cmp = less<c> > using ordered_set = tree<c, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;

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

#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define in insert
#define ld long double


#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::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...);
}
#else
#define trace(...) 1
#endif
template<class T> ostream& operator<<(ostream &os, vector<T> V) {os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {return os << "(" << P.first << "," << P.second << ")";}
template <typename T,typename U>pair<T,U> operator+(const pair<T,U> & l,const std::pair<T,U> & r) { return {l.first+r.first,l.second+r.second};}
typedef long long int ll;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define int ll
const ll mod =1e9+7;
const ll MAX_NODES =200001;
const ll MAX_LOG =50;
const ll maxn = 400000+10;


int32_t main()
{

   IOS
   int n,m;
   cin>>n>>m;
   int a[n+1];
   int sum = 0;
   for(int  i = 1;i<=n;i++){
     cin>>a[i];
     sum+=a[i];
   }
   sort(a+1,a+n+1);
   reverse(a+1,a+n+1);
  if(a[m]*4*m<sum){
    cout<<"No"<<endl;
  }
  else{
    cout<<"Yes"<<endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ; //何もしない文
#endif

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換
#define pb push_back

typedef long long LL; 
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

LL X,Y,Z,K;
LL A[1005],B[1005],C[1005];

bool isOK(LL P)
{
    LL cnt = 0;

    REP(i,X)
    {
        REP(j,Y)
        {
            REP(k,Z)
            {
                if(A[i]+B[j]+C[k] < P) break;
                cnt++;
                if(cnt >= K) return true;
            }
        }
    }

    return false;
}

LL binary_search() {
    LL ok = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
    LL ng = 1e10 * 4; // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()

    /* どんな二分探索でもここの書き方を変えずにできる！ */
    while (abs(ng - ok) > 1) {
        LL mid = (ok + ng) / 2;

        if (isOK(mid)) ok = mid;
        else ng = mid;
    }

    /* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
    return ok;
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);	

    cin>>X>>Y>>Z>>K;
    REP(i,X) cin >> A[i];
    REP(i,Y) cin >> B[i];
    REP(i,Z) cin >> C[i];

    sort(A,A+X,greater<LL>());
    sort(B,B+Y,greater<LL>());
    sort(C,C+Z,greater<LL>());
    LL mink = binary_search();


    vector<LL> ans;
    int cnt = 0;
    REP(i,X)
    {
        REP(j,Y)
        {
            REP(k,Z)
            {
                if(A[i]+B[j]+C[k] < mink) break;
                ans.pb(A[i]+B[j]+C[k]);
                cnt++;
            }
        }
    }

    sort(ans.begin(), ans.begin()+cnt, greater<LL>());
    REP(i,K)
    {
        cout << ans[i] << endl;
    }







}


Measured memory_bytes: 133468
#include<bits/stdc++.h>
using namespace std;
//#define Fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
typedef vector<int>Vl;
typedef pair<int,int>pii;
typedef vector<pii>Vll;
#define S second
#define F first
#define mp make_pair
#define ms(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define sl(n) scanf("%lld",&n)
#define pl(n) printf("%lld",n)
#define sz(a) (int)(a).size()
const int mod=2e19;
int dp[105][100005];
int recur(int w[],int val[],int i,int n,int W){
	if(W<0)return -mod;
	if(i==n)return 0;
    if(dp[i][W]!=0)return dp[i][W];
    int take=val[i]+recur(w,val,i+1,n,W-w[i]);
    int leav=recur(w,val,i+1,n,W);
    return dp[i][W]=max(take,leav);
}


signed main(){
	ms(dp,0);
  int n,W;
  sl(n);sl(W);
  int w[n],val[n];
  for(int i=0;i<n;i++){
	  sl(w[i]);sl(val[i]);
  }
  cout<<recur(w,val,0,n,W)<<endl;
  return 0;
}




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

using namespace std;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, -1, 1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os; }
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

ll dfs(ll now, int bit, ll N) {
    if (now > N) return 0;
    ll ret = 0;
    if (bit == 7) ret++;
    ret += dfs(now * 10 + 3, bit | (1 << 0), N);
    ret += dfs(now * 10 + 5, bit | (1 << 1), N);
    ret += dfs(now * 10 + 7, bit | (1 << 2), N);
    return ret;
}

void solve() {
    int N;
    cin >> N;
    cout << dfs(0, 0, N) << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll INF=1000000099;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define fs first
#define sc second
vector<int> dx={0,0,-1,1};
vector<int> dy={-1,1,0,0};

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
   int g,r,n;cin>>r>>g>>n;
   vector<vector<int>> v(g,vector<int>(r,-INF));
   map<pair<int,int>,int> ma;

   rep(i,0,n){
      int x,y,c;cin>>x>>y>>c;
      x--;y--;
      ma[{y,x}]=c;
   }
   
   for(auto itr=ma.begin();itr!=ma.end();itr++){
      vector<vector<bool>> used(g,vector<bool>(r,false));
      queue<int> q;
      q.push((*itr).fs.fs);
      q.push((*itr).fs.sc);
      q.push((*itr).sc); 
      used[(*itr).fs.fs][(*itr).fs.sc]=true;

      while(!q.empty()){
         int nowg,nowr,sco;
         nowg=q.front();q.pop();
         nowr=q.front();q.pop();
         sco=q.front();q.pop();
         if(ma.count({nowg,nowr}) && ma[{nowg,nowr}]<sco){
            cout<<"No"<<endl;
            return 0;
         }
         v[nowg][nowr]=max(v[nowg][nowr],sco);
         sco--;
         rep(i,0,4){
            int nextg=nowg+dx[i];
            int nextr=nowr+dy[i];
            //cerr<<nextg<<" "<<nextr<<endl;
            if(nextg<0 || nextr<0 || nextg>=g || nextr>=r || used[nextg][nextr])continue;
            q.push(nextg);
            q.push(nextr);
            q.push(sco);
            used[nextg][nextr]=true;
         }
      }
   }

   int ans=0;
   rep(i,0,g)rep(j,0,r){
      ans+=v[i][j];
   }
   cout<<ans<<endl;
}


Measured memory_bytes: 3220
//============================================================================
// Name        : AOJ.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cctype>
#include <string>
#include<algorithm>

using namespace std;
typedef long long ll;
int main(){


	int n=0;
	string s;

	cin>>s;

	for(int i=0; i<4; i++){
		if(s[i]=='+'){
			n+=1;
		}else{
			n=n-1;
		}
	}

	cout<<n<<endl;
	return 0;
}


Measured memory_bytes: 256
import queue
INF = float("inf")

h,w = map(int, input().split())
s = [input() for _ in range(h)]

def A(i, j):
    saicho = 0
    q = queue.Queue()
    q.put([i,j])
    d = [[INF] * w for _ in range(h)]
    d[i][j] = 0
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]
    while not q.empty():
        r = q.get()
        for k in range(4):
            x = r[0] + dx[k]
            y = r[1] + dy[k]
            if x>=0 and x<h and y>=0 and y<w and s[x][y]=="." and d[x][y]==INF:
                saicho = d[r[0]][r[1]] + 1
                d[x][y] = saicho
                q.put([x, y])
    return saicho

ans = 0

for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            ans = max(ans, A(i,j))

print(ans)

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

typedef long long ll;


int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    #ifdef acm
    freopen("a.in","r",stdin);
    #endif // acm

    ll X;
    cin >> X;

    ll a = X/500;
    X%=500;
    ll b = X/5;

    cout << a*1000 + 5*b << "\n";

    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long int
#define int ll
// #define double long double
//#define slld(t) scanf("%lld",&t)
//#define sd(t) scanf("%d",&t)
//#define pd(t) printf("%d\n",t)
//#define plld(t) printf("%lld\n",t)
#define vec vector < int >
#define vecp vector < pair < int , int > >
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define debug(x)   cerr<<#x<<": "<<x<<endl
#define pii pair < int , int >
#define pll pair < ll , ll > 
#define debug(x)   cerr<<#x<<": "<<x<<endl
#define mod  1000000007
#define N   100
#define MAX 300005
#define mod1 1000000007
#define mod2 998244353
#define bitcnt __builtin_popcountll
#define PI acos(-1)
//#define endl "\n"
#define inf 1e+15
int a[N];
multiset<int> s;
signed main(){
  fast;
  int n,k,tot=0 , ans=0;
  cin>>n>>k;
  for(int i=1;i<=n;i++)
  	cin>>a[i];

  for(int i=0;i<=n;i++){
  	  for(int j=0;i+j<=n ;j++){
  	  	 if(i+j>k) continue;
  	  	 s.clear();
  	  	 tot = 0;
  	  	 for(int t=1;t<=i;t++){
  	  	 	tot+=a[t];
  	  	 	if(a[t]<0) s.insert(a[t]);
  	  	 }
  	  	 for(int t=n;t>(n-j);t--){
  	  	 	tot+=a[t];
  	  	 	if(a[t]<0) s.insert(a[t]);
  	  	 }

  	  	 int diff = k - i-j;
  	  	 while(diff>0 && s.size()>0){
               tot -= *s.begin();
               s.erase(s.begin());
               diff--;
  	  	 }
  	  	 ans = max(ans , tot);

 
  	  }
  }

  cout<<ans<<endl;
}
  


Measured memory_bytes: 256
#include<algorithm>
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvld;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,s,e) for(int i=s;i<e;i++)
#define reple(i,s,e) for(int i=s;i<=e;i++)
#define revrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()

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; }

class R
{
public:
    string s;
    int p;
    int num;

    R(string s, int p, int num)
    {
        this->s = s;
        this->p = p;
        this->num = num;
    }

    bool operator <(R& r)
    {
        if (this->s != r.s)
        {
            return this->s < r.s;
        }
        else
        {
            return this->p > r.p;
        }
    }
};
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int N;
    cin >> N;

    vector<R> v;
    rep(i, N)
    {
        string s;
        int p;
        cin >> s >> p;
        v.emplace_back(s, p, i + 1);
    }

    sort(all(v));

    for (auto r : v)
    {
        cout << r.num << endl;
    }

    return 0;
}

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

using namespace std;
int dp[3001][3001];

int main()
{
	string s1,s2;
	cin>>s1>>s2;
	for (int i = 0; i < 3001; ++i)
	{
		dp[i][0]=0;
		dp[0][i]=0;
	}
	for (int i = 0; i < s1.length(); ++i)
	{
		for (int j = 0; j < s2.length(); ++j)
		{
			if(s1[i]==s2[j])
			{
				dp[i+1][j+1]=dp[i][j]+1;
			}
			else
			{
				dp[i+1][j+1]=max(dp[i][j+1],dp[i+1][j]);
			}
		}
	}
	string s3;
	// cout<<dp[s1.length()][s2.length()]<<'\n';
	int i=s2.length(),j=s1.length();
	while(i!=0 || j!=0)
	{
		// cout<<i<<" "<<j<<'\n';
		if(s2[i-1]==s1[j-1])
		{
			s3.push_back(s2[i-1]);
			i--;
			j--;
		}
		else
		{
			if(i==0)
			{
				j--;
			}
			else if(j==0)
			{
				i--;
			}
			else if(dp[j][i-1]>=dp[j-1][i])
			{
				i--;
			}
			else
			{
				j--;
			}
		}
	}
	for (int i = s3.length()-1;i>=0; --i)
	{
		cout<<s3[i];
	}
	cout<<'\n';
}

Measured memory_bytes: 35456
/*
sonu_verma1
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb(a) push_back(a)
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)
int main()
{
	int f=0;
	string s;
	cin>>s;
	if(s.size()==6&&s[2]==s[3]&&s[4]==s[5])
		cout<<"Yes";
	else
		cout<<"No";


	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define lp(i, n) for (int i = 0; i < (n) ; ++i)
#define sz(v) (ll)(v).size()
#define int long long
#define mod 1000000007

int A[200001];

int maxProductSubarrayOfSizeK(int n, int k)
{
    // sorting given input array
    sort(A, A + n);

    // variable to store final product of all element
    // of sub-sequence of size k
    int product = (int)1;

    // CASE I
    // If max element is 0 and
    // k is odd then max product will be 0
    if (A[n - 1] == 0 && (k & 1))
        return 0;

    // CASE II
    // If all elements are negative and
    // k is odd then max product will be
    // product of rightmost-subarray of size k
    if (A[n - 1] <= 0 && (k & 1)) {
        for (int i = n - 1; i >= n - k; i--) {
            product= ((product% mod) * (A[i]% mod))% mod;
        }
        return product;
    }

    // else
    // i is current left pointer index
    int i = 0;

    // j is current right pointer index
    int j = n - 1;

    // CASE III
    // if k is odd and rightmost element in
    // sorted array is positive then it
    // must come in subsequence
    // Multiplying A[j] with product and
    // correspondingly changing j
    if (k & 1) {
        product= ((product% mod) * (A[j]% mod))% mod;
        j--;
        k--;
    }

    // CASE IV
    // Now k is even
    // Now we deal with pairs
    // Each time a pair is multiplied to product
    // ie.. two elements are added to subsequence each time
    // Effectively k becomes half
    // Hence, k >>= 1 means k /= 2
    k >>= 1;

    // Now finding k corresponding pairs
    // to get maximum possible value of product
    for (int itr = 0; itr < k; itr++) {

        // product from left pointers
        int left_product = (A[i] * A[i + 1]);
        left_product= ((left_product));
        // product from right pointers
        int right_product = (A[j] * A[j - 1]);
        right_product= ((right_product));
        // Taking the max product from two choices
        // Correspondingly changing the pointer's position
        if (left_product > right_product) {
            product= ((product% mod) * (left_product% mod))% mod;
            i += 2;
        }
        else {
            product= ((product% mod) * (right_product% mod))% mod;
            j -= 2;
        }
    }

    // Finally return product
    return product;
}

void solve() {
        int n, k; cin >> n>> k;
        lp(i, n) cin >> A[i];
        cout << ((maxProductSubarrayOfSizeK(n, k) + mod)% mod);
}

int32_t main(){
ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
        int t = 1;
        //cin >> t;
        while ( t-- ) {
                solve();
        }
return 0;
}


Measured memory_bytes: 5160
n = int(input())
factors = []
while n%2 == 0:
    factors.append(2)
    n //=2

for f in range(3, int(n**0.5)+ 1, 2):
    while n%f == 0:
        factors.append(f)
        n //= f
if n != 1:
    factors.append(n)

nf = len(factors)

fab = 11
sset = set()
als = 2**nf
for i in range(als):
    if als^i in sset:
        continue
    sset.add(i)
    a = 1
    b = 1
    for j in range(nf):
        if (i>>j)&1:
            a *= factors[j]
        else:
            b *= factors[j]

    fab = min(fab, max(len(str(a)), len(str(b))))
print(fab)


Measured memory_bytes: 169532
#include <bits/stdc++.h>
using namespace std;
//make_tuple emplace_back next_permutation push_back make_pair second first setprecision

#if MYDEBUG
#include "lib/cp_debug.h"
#else
#define DBG(...) ;
#endif

using LL = long long;
constexpr LL LINF=334ll<<53;
constexpr int INF=15<<26;
constexpr LL  MOD=1E9+7;

struct Problem{
    int n;
    vector<string> s;
    Problem(LL n):n(n),s(n){};

    void solve(){
        cin >> s[0];
        for(int i=0; i<n; ++i){
            cin >> s[i];
        }
        sort(s.begin(),s.end());
        for(int i=0; i<n; ++i){
            cout << s[i];
        }
        cout << "\n";
    }
};

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    long long n=0;
    cin >> n;
    Problem p(n);
    p.solve();
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7, N = 5005;

int n;

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

bool ok(int row, int col) {
	return !(row < 0 || row >= n || col < 0 || col >= n);
}

void update(int row, int col) {
	for(int i = 0; i < 4; i++) {
		int new_row = row + dx[i], new_col = col + dy[i];
		if(ok(new_row, new_col) && d[new_row][new_col] > d[row][col] + has[row][col]) {
			d[new_row][new_col] = d[row][col] + has[row][col];
			update(new_row, new_col);
		}
	}
}

signed main()
{
	IO_OP;
	
	cin >> n;
	int ans = 0;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++) {
			d[i][j] = min({i, j, n - i - 1, n - j - 1});
			has[i][j] = 1;
		}
	for(int i = 0; i < n * n; i++) {
		int t;
		cin >> t;
		int row = (t - 1) / n, col = (t - 1) % n;
		ans += d[row][col];
		has[row][col] = 0;
		update(row, col);
	}
	cout << ans << endl;
	
}





Measured memory_bytes: 24620
/*   ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂
                   
                   ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ            
 
 */ 
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template <typename T, typename cmp=less<T>> using oset =tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long 
#define mod 1000000007
#define inf 100000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define _it iterator
#define all(_x) _x.begin(),_x.end()
#define f first
#define s second
#define pb push_back
void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
int main(){
	//mahakal(),fast;
	ll n ;
	cin>> n ;
	string str[n];
	map<string , ll > mp;
	for(ll i=0;i<n ;i++){
		cin>>str[i];
		sort(str[i].begin(),str[i].end());
		mp[str[i]]++;
	}
	ll ans=0;
	for(auto x: mp){
		ans+=(x.s)*(x.s-1)/2;
	}
	cout<<ans<<endl;



	return 0;
}


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

int main(){
	int in;
	stack<int> st;
	while (cin >> in, !cin.eof()){
		if (in != 0)	st.push(in);
		else{
			cout << st.top() << endl;
			st.pop();
		}
	}
}

Measured memory_bytes: 1196
#include <iostream>
#include <vector>
#include <cstring>
#include <cassert>

int N;
int a[100002], b[100002], c[100002];

// ボトムアップに解く
int solveBottomUp() {
  // DP
  int dp[100002][3]; // dp[i][j] := i日目にjを選んだ時の幸福度最大値
  memset(dp, 0, sizeof(dp)); // 0で初期化しておく
  
  // 1日目は先に埋めておく
  dp[1][0] = a[1];
  dp[1][1] = b[1];
  dp[1][2] = c[1];

  // DP更新
  for (int i = 2; i <= N; i++) {
    // i日目に0(A)を選んだ時の幸福度最大値
    //  = 前日にB,Cを選んだ時の最大値のmax + i日目にAを選ぶ最大値
    dp[i][0] = std::max(dp[i - 1][1], dp[i - 1][2]) + a[i];

    // i日目に1(B)を選んだ時の幸福度最大値
    dp[i][1] = std::max(dp[i - 1][0], dp[i - 1][2]) + b[i];

    // i日目に2(C)を選んだ時の幸福度最大値
    dp[i][2] = std::max(dp[i - 1][0], dp[i - 1][1]) + c[i];
  }

  // N日目にA,B,Cを選んだ時の最大値の最大値を取る
  int result = std::max(dp[N][0], std::max(dp[N][1], dp[N][2]));

  return result;
}


// トップダウンに解く
int memo[100002][3]; // memo[i][j] := i日目にjを選んだ時の幸福度最大値
int solveRecursive(int n, int action) {
  int &cache = memo[n][action];
  if (cache != -1) return cache;
  if (n == 0) return 0;
  if (action == 0) {
    return cache = std::max(solveRecursive(n-1, 1), solveRecursive(n-1, 2)) + a[n];
  }
  if (action == 1) {
    return cache = std::max(solveRecursive(n-1, 0), solveRecursive(n-1, 2)) + b[n];
  }
  if (action == 2) {
    return cache = std::max(solveRecursive(n-1, 0), solveRecursive(n-1, 1)) + c[n];
  }
  assert(0);
  return -1;
}
int solveTopDown() {
  memset(memo, -1, sizeof(memo)); // -1で初期化しておく
  int result_a = solveRecursive(N, 0);
  int result_b = solveRecursive(N, 1);
  int result_c = solveRecursive(N, 2);
  return std::max(result_a, std::max(result_b, result_c));
}

int main(void) {
  std::cin >> N;
  // 入力の受け取り
  for (int i = 1; i <= N; i++) { // 1-indexで入れる
    std::cin >> a[i] >> b[i] >> c[i];
  }
  
  std::cout << solveBottomUp() << std::endl;
  // std::cout << solveTopDown() << std::endl;

  return 0;
}

Measured memory_bytes: 5968
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
Int m[90];
Int lu(Int i){
  if(~m[i]) return m[i];
  if(i>=2) return m[i]=lu(i-1)+lu(i-2);
  if(i==0) return m[i]=2;
  if(i==1) return m[i]=1;
}
signed main(){
  memset(m,-1,sizeof(m));
  Int n;
  cin>>n;
  cout<<lu(n)<<endl;
  
  return 0;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
int n;
long long f[400];
int main(){
    cin >> n;
    f[0] = 2;
    for(int i = 0;i<=n;i++)f[i]=f[i-1]*2+2;
    cout << f[n] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int64_t INF = 1LL << 60;

int main() {
  int N,Q;
  string S;
  cin>>N>>Q>>S;
  vector<int64_t>no(N);
  int64_t sum=0;
  for(int i=0;i<N;i++){
    if(i>0&&S.substr(i-1,2)=="AC"){sum++;}
    no[i]=sum;
  }
  while(Q--){
    int l,r;
    cin>>l>>r;
    l--;r--;
    cout<<no[r]-no[l]<<endl;
  }

  return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
#include <utility>
#include <algorithm>
#include <vector>
#include <ios>     // std::left, std::right
#include <iomanip> 


using namespace std;

int main() {
	int n,m;
	cin>>n>>m;
	int y[m],p[m];
	struct a{
		int id;
		int year;
		int pp;
	};
	int jk[n]={};
	vector<a> aa(m);
	for(int i=0;i<m;i++){
		cin>>p[i]>>y[i];
		
		aa[i].id=i;
		aa[i].year=y[i];
		aa[i].pp=p[i];
		
	}
	sort(aa.begin(),aa.end(),[](const a& xx,const a& yy){return xx.year<yy.year;});
	
	for(int i=0;i<m;i++){
		jk[aa[i].pp-1]++;
		aa[i].year=jk[aa[i].pp-1];
		
	}
	
	sort(aa.begin(),aa.end(),[](const a& xx,const a& yy){return xx.id<yy.id;});
	for(int i=0;i<m;i++){
		cout<<setfill('0')<<right<<setw(6)<<aa[i].pp;
		cout<<setfill('0')<<right<<setw(6)<<aa[i].year<<endl;
	}
	return 0;
}

Measured memory_bytes: 3840
#include <iostream>

using namespace std;

int main() {
  int target[3];
  int countF = 0;
  int countS = 0;
  scanf("%d %d %d", &target[0], &target[1], &target[2]);
  for (int i = 0; i < 3; i++) {
    if (target[i] == 5) {
      countF++;
    } else if (target[i] == 7) {
      countS++;
    }
  }
  if (countF == 2 && countS == 1) printf("YES\n");
  else printf("NO\n");

  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

double a, b;

int main()
{
	in >> a >> b;
	out << (int)((a + b) / 2. + 0.5) << std::endl;
	return 0;
}

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

#define int long long int
#define fi first
#define so second
#define ps push_back
#define ld long double
#define mod 1000000007

signed main()
{
    int n,i,j;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++) cin>>a[i];
    int sum = 0;
    for(i=0;i<n;i++) sum+=(i%2==0?a[i]:(-1*(a[i])));
    vector<int> ans;
    ans.ps(sum/2);
    cout<<2*ans[0]<<" ";
    for(i=1;i<n;i++) {ans.ps(a[i-1]-ans[i-1]);cout<<2*ans[i]<<" ";}
}


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){   
    string s;
    cin>>s;
    for(int i=0;s[i]!='\0';i++){
        if(s[i]=='A'&&s[i+1]=='C'){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <limits>
#include <vector>

using namespace std;

//BEGIN
template <typename T>
struct edge {
	int from, to;
	T cost;

	edge(int from, int to, T cost) :from(from), to(to), cost(cost) {}
};

template<typename T>
vector<T> bellman_ford(int s, int V, vector<edge<T> > G) {
	const T INF = numeric_limits<T>::max();
	vector<T> cost(V, INF);
	vector<int> prevr(V, -1); //経路復元用
	cost[s] = 0;
	for (int i = 0; i < V; ++i) {
		for (edge<T> e : G) {
			if (cost[e.from] == INF) continue;
			if (cost[e.to] > cost[e.from] + e.cost) {
				cost[e.to] = cost[e.from] + e.cost;
				prevr[e.to] = e.from;
				if (i == V - 1) return vector<T>();
			}
		}
	}
	return cost;
}
//END

int main() {
	int V, E, r; cin >> V >> E >> r;
	vector<edge<int> > G;
	for (int i = 0; i < E; ++i) {
		int s, t, d; cin >> s >> t >> d;
		G.push_back(edge<int>(s, t, d));
	}
	vector<int> ans = bellman_ford(r, V, G);
	if (ans.empty()) cout << "NEGATIVE CYCLE" << endl;
	else {
		for (int i = 0; i < V; ++i) {
			if (ans[i] == numeric_limits<int>::max()) cout << "INF" << endl;
			else cout << ans[i] << endl;
		}
	}
	
	return 0;
}


/*
	created: 2019-08-27
	https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/1/GRL_1_B
*/


Measured memory_bytes: 3124
//解説あり
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <string>

#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define mp make_pair
#define bg begin()
#define en end()
#define all(v) (v).begin(), (v).end()


using namespace std;

typedef long long ll;

static const long long MOD = 1000000007;

int a[3005], b[3005], t, n;
int dp1[3005][3005], dp2[3005][3005];

int main(void) {
  cin >> n >> t;
  rep(i, 1, n+1) scanf("%d %d", &a[i], &b[i]);

  //両側DP

// 1〜iまでの料理を食べた時の最大値
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=t-1; j++) {
      if (j-a[i]<0) dp1[i][j] = dp1[i-1][j];
      else dp1[i][j] = max(dp1[i-1][j], dp1[i-1][j-a[i]]+b[i]);
    }
  }

  // i〜nまでの料理を食べた時の最大値
  for (int i=n; i>=1; i--) {
    for (int j=1; j<=t-1; j++) {
      if (j-a[i]<0) dp2[i][j] = dp2[i+1][j];
      else dp2[i][j] = max(dp2[i+1][j], dp2[i+1][j-a[i]]+b[i]);
    }
  }

  int ans = -1;
  for (int i=1; i<=n; i++) {
    for (int j=0; j<=t-1; j++) {
      ans = max(ans, dp1[i-1][j] + b[i] + dp2[i+1][t-1-j]);
    }
  }
    

    cout << ans << endl;

	return 0;
}


Measured memory_bytes: 70784
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

#define MAX 100000

struct TRAMP{
    char mark;
    int number,inputed_order;
};

TRAMP cards[MAX];

int n;

int Partition(int left,int right){
    int i = left-1,pivot = cards[right].number;
    for(int start = left; start < right; start++){
        if(cards[start].number <= pivot){
                i++;
                std::swap(cards[i],cards[start]);
        }
    }

    std::swap(cards[i+1],cards[right]);

    return i+1;
}

void quickSort(int left,int right){
    if(left < right){
        int q = Partition(left,right);
        quickSort(left,q-1);
        quickSort(q+1,right);
    }
}


int main(){

    bool stableFLG = true;
    scanf("%d",&n);

    for(int i = 0; i < n; i++){
        scanf("%s %d",&cards[i].mark,&cards[i].number);
        cards[i].inputed_order = i;
    }

    quickSort(0,n-1);

    for(int i = 1; i < n; i++){
        if(cards[i].number == cards[i-1].number && cards[i].inputed_order < cards[i-1].inputed_order){
        	stableFLG = false;
        	break;
        }
    }

    if(stableFLG){
        printf("Stable\n");
    }else{
        printf("Not stable\n");
    }

    for(int i = 0; i < n; i++)   printf("%c %d\n",cards[i].mark,cards[i].number);
}

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

int main() {
  int N, M, A, mod = 1e9+7;
  cin >> N >> M;
  vector<long> DP(N + 1);
  while (cin >> A) DP.at(--A) = -1;
  if (DP.at(0) != -1) DP.at(0) = 1;
  if (DP.at(1) != -1) DP.at(1) = 1;
  for (int i = 0; i + 2 < N + 1; i++) {
    if (DP.at(i) == -1) continue;
    if (DP.at(i + 1) != -1) (DP.at(i + 1) += DP.at(i)) %= mod;
    if (DP.at(i + 2) != -1) (DP.at(i + 2) += DP.at(i)) %= mod;
  }
  cout << DP.at(N - 1) << "\n";
}

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

using namespace std;
#define ll long long
struct pp{
    int id,w;
}peo[100005];
bool cmp(pp a,pp b){return a.w<b.w;}
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        int t;
        scanf("%d",&t);
        peo[i]={i+1,t};
    }
    sort(peo,peo+n,cmp);
    for(int i=0;i<n;i++)
        printf("%d ",peo[i].id);
    return 0;
}


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

using namespace std;

const int N = 22;

int a[N], b[N], c[N];

int main()
{
    ios_base::sync_with_stdio(NULL);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    for (int i = 0; i < n; ++i)
        cin >> b[i];
    for (int i = 0; i < n - 1; ++i)
        cin >> c[i];
    int ans(0);
    for (int i = 0; i < n; ++i) {
        ans += b[a[i] - 1];
        if (i && a[i] - 1 == a[i - 1])
            ans += c[a[i - 1] - 1];
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
local h, w, k = io.read("*n", "*n", "*n", "*l")
local map = {}
for i = 1, h do
  local s = io.read()
  for j = 1, w do
    map[(i - 1) * w + j] = s:sub(j, j) == "#"
  end
end
local hfound = false
local id = {}
local curid = 0
for i = 1, h * w do id[i] = 0 end
for i = 1, h do
  local wfound = false
  for j = 1, w do
    if map[(i - 1) * w + j] then
      curid = curid + 1
      if wfound then
        id[(i - 1) * w + j] = curid
      else
        for k = 1, j do
          id[(i - 1) * w + k] = curid
        end
        wfound = true
      end
    else
      id[(i - 1) * w + j] = curid
    end
  end
  if not wfound then
    if hfound then
      for j = 1, w do
        id[(i - 1) * w + j] = id[(i - 2) * w + j]
      end
    end
  else
    if not hfound then
      for k = 1, i - 1 do
        for j = 1, w do
          id[(k - 1) * w + j] = id[(i - 1) * w + j]
        end
      end
    end
    hfound = true
  end
end
for i = 1, h do
  for j = 1, w do
    io.write(id[(i - 1) * w + j])
    io.write(j == w and "\n" or " ")
  end
end


Measured memory_bytes: 5112
n = gets.to_i
h = gets.split.map(&:to_i)
ans = true
h[0] -= 1
(1...n).each do |i|
  if h[i] > h[i-1]
    h[i] -= 1
  elsif h[i] < h[i-1]
    ans = false
    break
  end
end
puts (ans ? 'Yes' : 'No')

Measured memory_bytes: 8580
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

int gcd(int x, int y) {
	if (y > x) return gcd(y, x);
	if (y == 0) return x;
	return gcd(y, x % y);
}

bool special(vector<int> v) {
	int sum = 0;
	rep(i, v.size()) {
		sum += v[i];
	}
	rep(i, v.size()) {
		if (gcd(v[i], sum - v[i]) == 1) return false;
	}
	int g = gcd(v[0], v[1]);
	rep(i, (int)v.size() - 2) {
		g = gcd(g, v[i + 2]);
	}
	return g == 1;

}


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int N; cin >> N;
	if (N == 3) {
		cout << "2 5 63" << endl;
		return 0;
	}
	else if (N == 4) {
		cout << "2 5 20 63" << endl;
		return 0;
	}
	else if (N < 1000) {
		vector<int> v = { 2, 3, 4, 9 ,12 };
		rep(i, N - 5) {
			v.push_back(v[v.size() - 1] + 6);
		}
		//cout << special(v) << endl;
		rep(i, N) {
			if (i != 0) cout << " ";
			cout << v[i];
		}
		cout << endl;
		return 0;
	}
	vector<int> v;
	int tmp = 2;
	rep(i, N + (8 - N % 8) % 8) {
		v.push_back(tmp);
		if (i % 4 == 2 || i % 4 == 3) tmp++;
		tmp++;
	}	auto itr = v.begin();
	while (v.size() > N) {
		if (*itr % 3 == 0 && *itr % 2 == 0) {
			v.erase(itr);
		}
		else {
			itr++;
		}
		//cout << *itr << endl;
	}
	//cout << special(v) << endl;
	rep(i, N) {
		if (i != 0) cout << " ";
		cout << v[i];
	}
	cout << endl;


    return 0;
}


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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

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

Measured memory_bytes: 3568
import std.stdio,std.string,std.conv;

int main()
{
	string s;
	while((s = readln.chomp).length != 0)
	{
		auto _s = s.split(" ");
		int a = _s[0].to!int;
		int b = _s[1].to!int;
		int c = _s[2].to!int;

		int n = a * 10000 + b * 100 + c;
		if(n < 18680908)
		{
			writeln("pre-meiji");
		}
		else if(18680908 <= n && n < 19120730)
		{
			writeln("meiji ",a - 1867," ",b," ",c);
		}
		else if(19120730 <= n && n < 19261225)
		{
			writeln("taisho ",a - 1911," ",b," ",c);
		}
		else if(19261225 <= n && n < 19890108)
		{
			writeln("showa ",a - 1925," ",b," ",c);
		}
		else if(19890108 <= n)
		{
			writeln("heisei ",a - 1988," ",b," ",c);
		}
	}
	return 0;
}

Measured memory_bytes: 1092
#include <iostream>

using namespace std;

int main(void)
{
    int ans = 0;
    for(int i = 0; i < 4; ++i)
    {
        char c;
        cin >> c;
        if('+' == c) ans++;
        else ans--;
    }

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

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

int main() {
  string a,b,c;
  cin >> a >> b >> c;
  if(a.back() == b.front() && b.back() == c.front()){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
////////////////////////////////////////BatTle rOweL ///////////////////////////////////////
#include <bits/stdc++.h>
#include <deque>
#include <vector>
using namespace std;
#define smackie ios_base::sync_with_stdio(0); cin.tie(0);
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
typedef long long ll;
#define mset(a,k) memset(a,k,sizeof(a));
#define rep(i,l,h) for(ll i=l;i<h;i++)
#define ds1(i,x) for(int  i=0;i<x.size();i++)
#define ds2(i,x) for(auto i:x)
typedef vector<ll>  vit;
typedef pair<int,int> pii;
#define pb push_back
#define pf push_front
#define pof pop_front()
#define pob pop_back()
#define mp make_pair
typedef map<ll,ll >   mps;
//-------------------------------------------<dec>-------------------------------
 bool isPrime(int n) 
{ 
    if (n <= 1) return false; 
    rep(i,2,n)  if (n % i == 0) return false;  
    return true; 
}
 
 
 
//------------------------------------------<Assumes>----------------------------
int main()
{
    smackie
    double d;
    cin>>d;
    cout<<setprecision(30)<<pow((d/3),3);
}

Measured memory_bytes: 256
from sys import stdin
from math import sin, cos, pi, sqrt

a, b, C = [float(x) for x in stdin.readline().rstrip().split()]
S = a*b*sin(C*pi/180)/2
c = sqrt(a**2 + b**2 - 2*a*b*cos(C*pi/180))
L = a+b+c
h = 2*S/a
print(*[S, L, h], sep = "\n")


Measured memory_bytes: 5708
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int[] nums = new int['Z' - 'A' + 1];
        char[] string = sc.next().toCharArray();
        for (char c : string) {
            nums[c - 'a']++;
        }

        for (int a : nums) {
            if (a % 2 == 1) {
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    }
}

Measured memory_bytes: 25172
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF mugen
#define dump(x) cerr<<#x<<"="<<x<<endl
#define ALL(a) (a).begin(),(a).end()
#define EACH(e,v) for(auto& e:v)
#define SORT(v) sort(ALL(v))
#define PERM(v) SORT(v);for(bool c##p=1;c##p;c##p=next_permutation(ALL(v)))
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef pair<int,int> P;
template <class T> void chmin(T & a, T const & b) { if (b < a) a = b; }
template <class T> void chmax(T & a, T const & b) { if (b > a) a = b; }
template <typename T>
string to_string(const T &n){ostringstream stm;stm << n;return stm.str();}
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
using ll = long long;
const ll mod = 1000'000'007;
 
signed main(){
    string s;
    cin>>s;
    rep(i,(int)s.size()){
        cout<<'x';
    }
    cout<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _USE_MATH_DEFINES
using namespace std;
    
#define ll long long int
#define pb push_back
#define rep(i , j , n) for(ll i = j ; i < n ; i++)
#define pre(i , j , n) for(ll i = j ; i >= n ; i--)
#define all(x) x.begin(), x.end()
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vll;
typedef vector<char>	vc;
typedef vector<bool>	vb;
typedef pair<ll,ll> 	pll;
#define br "\n"
#define ff first
#define ss second
#define MAX 1000003

ll mod = (ll)998244353;

void solve(){ 
    ll n,k;
    cin >> n >> k;
    vll dp(n + 2,0);
    vector<pll> p;
    rep(i,0,k){
        ll a,b;
        cin >> a >> b;
        p.pb({a,b});
    }
    dp[1] = 1;
    dp[2] = (-1 + mod) % mod;
    rep(i,1,n + 2){
        dp[i] = (dp[i - 1] + dp[i] + mod) % mod;
        rep(j,0,k){
            ll a = p[j].ff;
            ll b = p[j].ss;
            // cout << min(i + a,n + 1) << " " << min(i + b + 1,n + 1) << br;
            if(i + a <= n) dp[i + a] = (dp[i] + dp[i + a] + mod) % mod;
            if(i + b + 1 <= n) dp[i + b + 1] = (dp[i + b + 1] - dp[i] + mod) % mod;   
            
        }
    }
    // for(auto x:dp) cout << x << " ";
    cout << dp[n] << br;
}
	

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 t = 1;
	// cin >> t;
	rep(i,0,t){
		solve();
	}
 
}	

Measured memory_bytes: 4760
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch Colon | diff Colon.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address Colon.cpp && ./a.out

/*

 5/17/2020

 5:04-5:11

 */

int A,B,H,M;
double deg2rad(double deg) { return deg*M_PI/180.0; }
void solve() {
  dump(A,B,H,M);
  double a=(60.0*H+M)/720,b=(double)M/60;
  double ang=abs(a-b)*360;
  ang=min(ang,360-ang);
  double rad=deg2rad(ang);
  dump(a,b,ang);
  double res=sqrt(1.0*A*A+1.0*B*B-2.0*A*B*cos(rad));
  cout<<res<<endl;
}

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

  cin>>A>>B>>H>>M;
  solve();

  return 0;
}


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

int main(){
    string s;
    int ans=0;
    cin>>s;
    for(int i=0;i<s.size();i++){
        for(int j=1;j<=s.size()-i;j++){
            bool is_actg=1;
            string sub=s.substr(i,j);
            for(int h=0;h<sub.size();h++){
                if(sub[h]!='A'&&sub[h]!='C'&&sub[h]!='G'&&sub[h]!='T'){
                    is_actg=0;
                }
            }
            if(is_actg){
                ans=max(ans,j);
            }
        }
    }
    cout<<ans<<endl;
}

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

using ll = long long;
#define pq priority_queue
#define debug(x) cerr << #x << ": " << x << endl;
#define line() cerr << "---------------" << endl;

int main() {
   int a, b, c, n;
   while (cin >> a >> b >> c, a) {
      cin >> n;
      vector<int> A(a, 2), B(b, 2), C(c, 2);
      vector<int> I, J, K;
      for (int l = 0; l < n; l++) {
         int i, j, k, r;
         cin >> i >> j >> k >> r;
         int x = i-1, y = j-a-1, z = k-a-b-1;
         if (r == 1) {
            A[x] = 1, B[y] = 1, C[z] = 1;
         } else {
            I.push_back(x), J.push_back(y), K.push_back(z);
         }
      }

      for (int i = 0; i < I.size(); i++) {
         if (A[I[i]] == 1 && B[J[i]] == 1) {
            C[K[i]] = 0;
         } else if (A[I[i]] == 1 && C[K[i]] == 1) {
            B[J[i]] = 0;
         } if (B[J[i]] == 1 && C[K[i]] == 1) {
            A[I[i]] = 0;
         } 
      }

      for (int x : A) cout << x << endl;
      for (int x : B) cout << x << endl;
      for (int x : C) cout << x << endl;
   }

   return 0;
}


Measured memory_bytes: 3168
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vl;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> void cmax(T& a, U b) { if (a<b) a = b; }
template<class T, class U> void cmin(T& a, U b) { if (a>b) a = b; }

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

  int a, b, c;
  cin >> a >> b >> c;
  if (a == b && b == c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>

int main(int argc, const char * argv[]) {
    // insert code here...
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int a, b;
    std::cin >> a >> b;
    std::cout << (a + b < 24 ? a + b : a + b - 24);
    return 0;
}

Measured memory_bytes: 256
n = int(input())

result = False
count = 0
for i in range(n):
  a, b = map(int,input().split())
  if a == b:
    count += 1
    if count >= 3:
      result = True
      break
  else:
    count = 0
  
if result :
  print("Yes")
else :
  print("No")

Measured memory_bytes: 9176
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n,m;
    cin >> n >> m;
    vb f1(n,false),fn(n,false);
    rep(i,m) {
        int a,b;
        cin >> a >> b;
        a--; b--;
        if(a > b) swap(a,b);
        if(a == 0) f1[b] = true;
        if(b == n-1) fn[a] = true;
    }
    rep2(i,1,n-1) if(f1[i] && fn[i]) {
        cout << "POSSIBLE" << endl;
        return 0;
    }
    cout << "IMPOSSIBLE" << endl;
}


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

int main() {
int n, k, q;
cin >> n >> k >> q;
vector<int> p(n,k-q);
for(int i = 0; i < q; ++i)
{
	int a;
	cin >> a;
	--a;
	p[a]++;
}
for(int i =0; i < n; ++i)
{
	if(p[i] <= 0) puts("No");
	else puts("Yes");
}
return 0;
}


Measured memory_bytes: 1024