akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define loop(i,a,b) for(ll i = (ll)a ; i < (ll)b ; i++)
#define rtloop(i,a,b) for(ll i = (ll)a; i >= (ll)b; i--)
#define pb push_back
#define mp make_pair
#define yo(a) cerr <<#a <<" = " << a <<"\n";
#define COOL ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);



void solve(){
    ll n;
    cin >> n;
    string s;
    unordered_set<string> se;
    loop(i,0,n){
        cin >> s;
        se.insert(s);
    }
    cout << se.size() <<"\n";


    
}



int main() {
    // #ifndef ONLINE_JUDGE
    //     freopen("inn.txt", "r", stdin);
    //     freopen("op.txt", "w", stdout);
    // #endif
    COOL
    // ll t;
    // cin >> t;
    // while(t--)
        solve();
    
        


    return 0;
}





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

int main() {
  int n;
  cin >> n;

  vector<string> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
  }
  
  string ans;
  for (char c = 'a'; c <= 'z'; c++) {
    int small = 100;

    for (int i = 0; i < n; i++) {
      int cnt = 0;
      for (int j = 0; j < s.at(i).length(); j++) {
        if (s.at(i).at(j) == c) cnt++;
      }
      small = min(small, cnt);
    }
    for (int i = 0; i < small; i++) {
      ans += c;
    }
  }
  cout << ans << endl;

  return 0;
}

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

int main()
{
    int N, k;
    int p = 0;
    int q = 0;
    int r = 0;
    cin >> N;
    int a[N];
    for (int i = 0; i < N; i++)
    {
        cin >> a[i];

    }
    for (int j = 0; j < N; j++)
    {
        k = a[j] % 4;
        if(k == 0)
        {
            p = p + 1;
            a[j] = 2;
        }
        else if(k == 2)
        {
            q = q + 1;
            a[j] = 1;
        }
        else
        {
            r = r + 1;
            a[j] = 0;
        }
    }
    
    
    if (N % 2 == 1 && r == (N+1)/2)
    {
        if(p == (N-1)/2)
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }
    else
    {
        if(p >= r)
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }

    
    return 0;
        
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
  static String sa, sb, sc;

  public static void main(String[] args){
    Scanner scn = new Scanner(System.in);

    sa = scn.next(); sb = scn.next(); sc = scn.next();
    int[] sp = new int[3];
    char next = 'a';
    boolean con = true;
    sp[0] = sp[1] = sp[2] = -1;
    while(con){
      switch(next){
        case 'a':
          if(sp[0] + 1 < sa.length()){
            next = sa.charAt(++sp[0]);
          }
          else{
            con = false;
          }
          break;
        case 'b':
          if(sp[1] + 1 < sb.length()){
            next = sb.charAt(++sp[1]);
          }
          else{
            con = false;
          }
          break;
        case 'c':
          if(sp[2] + 1 < sc.length()){
            next = sc.charAt(++sp[2]);
          }
          else{
            con = false;
          }
          break;
      }
    }

    if(next == 'a'){
      System.out.println("A");
    }
    else if(next == 'b'){
      System.out.println("B");
    }
    else{
      System.out.println("C");
    }
  }
}


Measured memory_bytes: 9812
#include<bits/stdc++.h>
using namespace std;
#define rep(i ,a, n) for (long long int i=a;i<=n;i++)
#define pb  push_back
#define mp make_pair
#define fp first
#define sp second
#define be(v) v.begin(),v.end()
typedef long long ll;
typedef vector<ll> vi ;
typedef vector<pair<ll , ll > >  vpi ;
const int ma1=3e5+5;
string no="NO",yes="YES";
const unsigned int MOD = 1000000007;
int max_char=26;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t=1;
    while(t--)
    {

        ll n;
        cin>>n;
        int a[n+1];
        memset(a,0,sizeof(a));

        for(int x=1;x<=100;x++)
        {
            for(int y=1;y<=100;y++)
            {
                for(int z=1;z<=100;z++)
                {
                    int sum=x*x+y*y+z*z+x*y+y*z+z*x;
                    if(sum<=n)
                        a[sum]++;
                }
            }
        }
        for(int i=1;i<=n;i++)
            cout<<a[i]<<endl;
    }
    return 0;
}













Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using pii = pair<int, int>;
using vi = vector<int>;
using vii = vector<vi>;
using ll = long long;

const ll MX = 1e18;

int main() {
    int n;
    cin >> n;
    vector<long long> a(n);
    rep(i, n) cin >> a.at(i);

    long long p = pow(10, 18);
    long long ans =  1;
    bool can = false;
    rep(i, n) {
        if (i == 0) {
            ans = a.at(i);
            //cout << ans << endl;
            continue;
        }

        if (a.at(i) == 0) {
            ans = 0;
            cout << 0 << endl;
            return 0;
        }
        if (can || (MX + 1) / a.at(i) < ans || ans * a.at(i) > MX) {
            can = true;
        }
        ans *= a.at(i);
    }

    //cout << p << endl;

if (can) {
        cout << -1 << endl;
    } else {
    cout << ans << endl;
    }

    //cout << MX << endl;
}

//1000000000000000001
//2147485794483647


Measured memory_bytes: 4024
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(v) v.begin(),v.end()

using namespace std;
typedef long long ll;




int main()
{
    
    int N;
    cin >> N;
    bool ans = false;
    rep(i,N){
        int a;
        cin >> a;
        if(a%2==1) ans = true;
    }
    if(ans) cout << "first" << endl;
    else cout << "second" << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
#define LL  long long
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<int,int>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
#define rt return

int main(){
  CIN(N);
  CIN(D);
  CIN(X);
  I vec;
  REP(a,N){
      CIN(b);
      vec.push_back(b);
  }

  LL ans = X+N;
  FOR(a,2,D+1){
      REP(b,N){
          if(vec.at(b)==1){
              ans++;
          }
          else
          if((a)%vec.at(b)==1){
              ans++;
          }
      }
  }
  COUT(ans);
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>

int main()
{
	int N, X;
	std::vector<int> L;
	
	std::cin >> N >> X;
	L.resize(N);
	for(auto& l : L) {
		std::cin >> l;
	}
	
	int D = 0;
	int n = 1;
	for (int i = 0; i < N; ++i) {
		D += L[i];
		if (D <= X) {
			n++;
		} else {
			break;
		}
	}
	std::cout << n << "\n";
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

using namespace std;
using ll = long long int;

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

int main(void) {
    ll a, b; cin >> a >> b;
    cout << (a * b) / gcd(a, b) << endl;
}

Measured memory_bytes: 256
//#define DEBUG
#include<bits/stdc++.h>
using namespace std;
const int N = 100010;
const int inf = 0X3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-6;
const double pi = acos(-1.0);
const int mod = 1000000007;
typedef long long ll;

ll sum;
int n;
int a[2 * N];
int k;

int main() {
    while(~scanf("%d", &n)) {
        scanf("%d", &k);
        sum = 0;
        for (int i = 1; i <= n; i++) {
            scanf("%d", &a[i]);
            sum += a[i];
        }
        if (k >= n) {
            puts("0");
            continue;
        }
        sort(a + 1, a + n + 1);
        int cnt = 0;
        for (int i = n; i >= 1; i--) {
            if (cnt >= k) break;
            sum -= a[i];
            cnt++;
        }
        printf("%lld\n", sum);
    }
}


Measured memory_bytes: 1024
import sys
n = int(input())
tourList = {}
#順次移動できるかチェックしていく
nowX = 0
nowY = 0
nowTime = 0
for i in range(n):
  t,x,y = map(int,input().split())  
  moveX = abs(x - nowX)
  moveY = abs(y - nowY)
  moveTime = moveX+moveY
  reachTime = moveTime + nowTime
  if reachTime > t or (t-reachTime) % 2 != 0:
    print('No')
    sys.exit()
  nowTime = t
  nowX = x
  nowY = y
print('Yes')

    

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

int main()
{
	string s, t;
	int sum, minv=1001;
	getline(cin, s);
	getline(cin, t);
	for(int i=0; i<=s.size()-t.size(); ++i)
	{
		sum=0;
		for(int j=0; j<t.size(); ++j)
		{
			if(s[i+j]!=t[j])
			{
				sum++;
			}
		}
		if(minv>sum)
		{
			minv=sum;
		}
	}
	cout << minv << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()
const string YES = "Yes";
const string NO = "No";
void solve(std::string S, std::string T){
  string ans = "";
  for (int i = 0; i < S.length(); i++) {
    ans += T[i];
  }
  cout << (ans == S ? YES : NO) << endl;
}

int main(){
    std::string S;
	std::cin >> S;
	std::string T;
	std::cin >> T;
    solve(S, T);
}


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



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

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



int main(void){

	int A, B, C, D; cin >> A >> B >> C >> D;
	cout << max(A*B, C*D) << endl;


	return 0;

}


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

// template {{{
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); (i) -= 1)

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

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

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

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

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

void solver() {
    int n = input();
    vector< pair< int, int > > ps(n);
    for (auto &p: ps) cin >> p;
    
    if (n & 1) {
        i64 l, r;
        whole(sort, ps);
        l = ps[n / 2].first;
        
        whole(sort, ps, [&](auto a, auto b) { swap(a.first, a.second); swap(b.first, b.second); return a < b; });
        r = ps[n / 2].second;

        cout << r - l + 1 << endl;
    } else {
        i64 l, r;

        whole(sort, ps);
        l = ps[n / 2].first + ps[n / 2 - 1].first;

        whole(sort, ps, [&](auto a, auto b) { swap(a.first, a.second); swap(b.first, b.second); return a < b; });
        r = ps[n / 2].second + ps[n / 2 - 1].second;

        cout << r - l + 1 << endl;
    }
}

signed main(int argc, char *argv[]) {
    solver();
}


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

using namespace std;

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

const int MM = 1e9 + 7;
const double eps = 1e-8;
const int MAXN = 2e6 + 10;

int n, m;

char s[100];

void read(){
	scanf("%s", s);
	for(int i = 0; i < 4; i++)
		putchar(s[i]);
	putchar(' ');
	for(int i = 4; i < 12; i++)
		putchar(s[i]);
	puts("");
}

void solve(){
	
}

void printans(){

}
	

int main(){
	int T = 1;
//	cin>>T;
	while(T--){
		read();
		solve();
		printans();
	}
	return 0;
} 


Measured memory_bytes: 256
/* template.cpp {{{ */
#include <bits/stdc++.h>
using namespace std;
#define get_macro(a, b, c, d, name, ...) name
#define rep(...) get_macro(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep(...) get_macro(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define rep1(n) rep2(i_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, b) rep4(i, a, b, 1)
#define rep4(i, a, b, s) for (ll i = (a); i < (ll)(b); i += (ll)(s))
#define rrep1(n) rrep2(i_, n)
#define rrep2(i, n) rrep3(i, 0, n)
#define rrep3(i, a, b) rrep4(i, a, b, 1)
#define rrep4(i, a, b, s) for (ll i = (ll)(b) - 1; i >= (ll)(a); i -= (ll)(s))
#define each(x, c) for (auto &&x : c)
#define fs first
#define sc second
#define all(c) begin(c), end(c)
using ui = unsigned;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
const int inf = 1e9 + 10;
const ll inf_ll = 1e18 + 10;
const ll mod = 1e9 + 7;
const ll mod9 = 1e9 + 9;
const int dx[]{-1, 0, 1, 0, -1, 1, 1, -1};
const int dy[]{0, -1, 0, 1, -1, -1, 1, 1};
template<class T, class U> void chmin(T &x, const U &y){ x = min<T>(x, y); }
template<class T, class U> void chmax(T &x, const U &y){ x = max<T>(x, y); }
struct prepare_ { prepare_(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(12); } } prepare__;
/* }}} */

int n;
vector<int> g[100000];
int p[20][100000];
int d[100000];
vector<int> ord;

int main(){
  memset(p, -1, sizeof(p));
  cin >> n;
  rep(i, 1, n){
    int x;
    cin >> x, x--;
    g[x].push_back(i);
    p[0][i] = x;
    d[i] = d[x] + 1;
  }
  rep(i, 19) rep(j, n) p[i + 1][j] = p[i][j] != -1 ? p[i][p[i][j]] : -1;
  queue<int> q;
  ord.push_back(0);
  q.push(0);
  while (q.size()){
    int v = q.front(); q.pop();
    each(u, g[v]){
      ord.push_back(u);
      q.push(u);
    }
  }
  ll res = 0;
  int v = 0;
  each(u, ord){
    int x = v, y = u;
    if (d[x] < d[y]) swap(x, y);
    rep(i, 20) if (d[x] - d[y] >> i & 1) x = p[i][x];
    rrep(i, 20) if (p[i][x] != p[i][y]) x = p[i][x], y = p[i][y];
    if (x != y) x = p[0][x];
    res += d[u] + d[v] - d[x] * 2;
    v = u;
  }
  cout << res << endl;
}

Measured memory_bytes: 17216
#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < n; ++i)
#define for1(i, n) for (int i = 1; i <= n; ++i)
#define fore(i, l, r) for (int i = l; i <= r; ++i)
 
using namespace std;
 
int main(){
	int T, X; cin >> T >> X;
	cout << fixed << setprecision(8) << double(T) / double(X) << endl;
	return 0;
}

Measured memory_bytes: 256
object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val Array(datA, datB, datX) = readLine.split(" ").map(_.toLong)
    val ans = (datB / datX) - (datA / datX) + (if(datA % datX == 0) 1 else 0)
    println(ans)
  }
}


Measured memory_bytes: 25540
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+7;
int n,ans,s1[N],s2[N];
char c[N];
int main()
{
	scanf("%d%s",&n,c+1);
	for(int i=1;i<=n;i++)s1[i]=s1[i-1]+(c[i]=='W'),s2[i]=s2[i-1]+(c[i]=='R');
	ans=min(s1[n],s2[n]);
	for(int i=1;i<n;i++)ans=min(ans,max(s1[i],s2[n]-s2[i]));
	printf("%d",ans);
}

Measured memory_bytes: 5576
/*
  5:14:30
 */
#include<bits/stdc++.h>

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

using namespace std;

#define MAX_N 50

int n;
string s[MAX_N];

inline bool isAIUEO(char c) { return c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o'; }

string getCode(string name,int k) {
  string ret = string(1,name[0]);
  rep(i,(int)name.size()) {
    if( (int)ret.size() >= k ) return ret;
    if( i+1 < (int)name.size() && isAIUEO(name[i]) ) {
      ret += name[i+1];
    }
  }
  return ret;
}

bool check(int k) {
  set<string> used;
  rep(i,n) {
    string code = getCode(s[i],k);
    if( used.count(code) ) return false;
    used.insert(code);
  }
  return true;
}

void compute() {
  REP(k,1,51) {
    if( check(k) ) {
      printf("%d\n",k);
      return;
    }
  }
  puts("-1");
}

int main() {
  while( cin >> n, n ) {
    rep(i,n) cin >> s[i];
    compute();
  }
  return 0;
}

Measured memory_bytes: 1236
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <list>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <iomanip>
#define INF 2147483647
 
using namespace std;


int fibo(int n)
{
	int a = 0;
	int b = 1;
	int ans;
	int i;

	if (n == 0 || n == 1) return (n);
	for (i = 2; i <= n; i++) {
		ans = a + b;
		a = b;
		b = ans;
	}
	return (ans);
}


int main(void)
{
	int n;

	cin >> n;
	cout << fibo(n + 1) << endl;

	return (0);
}

Measured memory_bytes: 1160
h, w = map(int, input().split())
s = []
for i in range(h):
    s.append(input())

cnt = 0
for i in range(h):
    cnt += s[i].count('#')
if cnt == 0:
    print('Yes')
    exit()

for i in range(h):
    for j in range(w):
        if (s[i][j] == '#'):
            flg = False
            if (i - 1) >= 0:
                flg = (flg or (s[i - 1][j] == '#'))
            if (j - 1) >= 0:
                flg = (flg or (s[i][j - 1] == '#'))
            if (j + 1) < w:
                flg = (flg or (s[i][j + 1] == '#'))
            if (i + 1) < h:
                flg = (flg or (s[i + 1][j] == '#'))
            if not(flg):
                break
    if not(flg):
        break

if flg:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3064
// Believe in yourself
#include<bits/stdc++.h>

using namespace std;

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

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define Pair vector<pair<ll,ll>>
#define vec vector <ll> 
#define all(a) a.begin(),a.end()
#define mo 1000000007
#define decimal(i,n) fixed << setprecision(i) << n
#define show(a) for(auto xyz:a)cout<<xyz<<" ";cout<<endl;
#define show_nl(a) for(auto xyz:a)cout<<xyz<<endl;


void eea(ll a,ll b,ll &x,ll &y)
{
    if (a == 1)
    {
        x = 1; y = 0;
        return;
    }
    ll x1, y1;
    eea(b%a,a,x1,y1);
    x=y1-(b/a)*x1;
    y=x1;
}
ll mi(ll a,ll m)
{
    ll x,y;
    eea(a,m,x,y);
    x= (x%m+m)%m;
    return x;
}

/*
Enter the test case


Some helpful points
1.) Calm yourself
2.) check for semicolon or data type mismatch
*/

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);    
    ll t=1;
    // cin>>t;
    while(t--)
    {
       int a,b;
       cin>>a>>b;
       a=a*b;
       cout<<a<<"\n";
       }
}



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

int main() {
	string s, t; cin >> s >> t;

	for (int i = s.size() - t.size(); i >= 0; i--) {
		string tmp = s.substr(i, t.size());
		for (int j = 0; j < t.size(); j++) {
			if (tmp[j] != '?' && tmp[j] != t[j]) break;
			if (j == t.size() - 1) {
				for (int k = 0; k < s.size(); k++) {
					if (i<=k&&k<i+t.size()) cout << t[k-i];
					else cout << (s[k] == '?' ? 'a' : s[k]);
				}
				cout << endl;
				return 0;
			}
		}
	}
	cout << "UNRESTORABLE" << endl;
  
  	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  	int N, K, S;
  	cin >> N >> K >> S;
  	for (int i = 0; i < K; i++) printf("%d ", S);
  	int val = (S == 1000000000 ? 1 : S + 1);
  	for (int i = 0; i < N - K; i++) printf("%d ", val);
}

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

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define REP(i, n) for(int i=0; i<(int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

int field_cnt[100][100][4];
char field[100][100];

int dx[]={0,1,0,-1};
int dy[]={-1,0,1,0};
string ds = "NESW";

int main() {
  int h, w;
  ll n;
  int x, y, way;
  while(cin>>h>>w>>n,h|w|n){
    fill_n((int *)field_cnt, 100*100*4, -1);
    fill_n((char *)field, 100*100, '#');
    int way = 0;
    REP(iy, h){
      REP(ix, w){
        cin >> field[iy][ix];
        char c = field[iy][ix];
        switch(c){
          case 'W':
          way++;
          case 'S':
          way++;
          case 'E':
          way++;
          case 'N':
          x = ix;
          y = iy;
        }
      }
    }
    int cnt = 0;
    while(n>0){
      // LOG ("%d -- %d %d %c\n",n,y,x,ds[way]);
      if(field_cnt[y][x][way] != -1){
        if (n < cnt - field_cnt[y][x][way]){
        }else{
          n %= cnt - field_cnt[y][x][way];
          if(n==0)break;
        }
      }
      n--;
      field_cnt[y][x][way] = cnt;
      int nx = x + dx[way];
      int ny = y + dy[way];
      while(nx<0 || ny<0 || nx>=w || ny>=h || field[ny][nx] == '#'){
        way= (way+1)%4;
        nx = x + dx[way];
        ny = y + dy[way];
      }
      y = ny;
      x = nx;
      cnt++;
    }
    printf ("%d %d %c\n",y+1,x+1,ds[way]);
  }
}

Measured memory_bytes: 3428
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <bitset>
#include<vector>
#include<cstdlib>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
const ll MOD = 1e9 + 7;
#define rep(i,k) for(int i=0;i<k;i++)
ll n, m, i, j, k, o, p, l, z,x,y;
ll a[200010], ps[200010], inf = 1000000000000;
map <ll, ll> cnt;


queue<ll> q;

int main() {
	cin >> n >>  k;
	ps[0] = 0;
	rep(i, n) {
		cin >> a[i + 1];
		a[i + 1]--;
		ps[i + 1] =(ps[i] + a[i + 1])%k;
	}
	z = 0;
//	q.push(0);
//	cnt[0]++;
	for (i = 0; i <= n; i++) {
		z += cnt[ps[i]];
		cnt[ps[i]]++;
		q.push(ps[i]);
		if (q.size() >= k) {
			o = q.front();
			cnt[o]--;
			q.pop();
		}
	}

	cout << z;
	return 0;
}

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

typedef long long ll;
#define pii pair<int , int>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 1005

int a , b;

int main()
{
    _FastIO;
    cin >> a >> b;
    if(a > 9 || b > 9){
        cout << "-1" << endl;
        return 0;
    }
    cout << a * b << endl;
    return 0;
}
	

Measured memory_bytes: 256
N = gets.chomp.to_i
H = gets.chomp.split.map(&:to_i)

cnt = 1
1.upto(N-1).each do |i| # right
  res = true
  0.upto(i-1).each do |j| # left
    if H[j] > H[i]
      res = false
      break
    end
  end
  if res
    cnt += 1
  end
end

p cnt

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    vector<int> a(3);
    for (int i = 0; i < 3; i++) { cin >> a[i]; }
    sort(a.begin(), a.end(), greater<int>());
    int d = 2 * a[0] - a[1] - a[2];
    if (d % 2 == 0) {d = d / 2;}
    else d = d / 2 + 2;
    cout << d << '\n';
}


Measured memory_bytes: 256
import math

K = int(input())

ans = K * (K + 1) / 2

for i in range(K):
    for j in range(i):
        temp = math.gcd(i + 1, j + 1)
        ans += temp * 6
        for k in range(j):
            ans += math.gcd(temp, k + 1) * 6

print(int(ans))

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

const int N_MAX = 100;
int n;
int t;
int h;
int l;
int s;
int ts[N_MAX];
int hs[N_MAX];

bool run(int idx) {
    if (ts[idx] > 0) {
        ts[idx]--;
        t++;
        s += 10;
    } else if (hs[idx] > 0) {
        hs[idx]--;
        h++;
        s += 100;
    } else {
        return true;
    }
    if (l < t) {
        return true;
    }
    if (s < 90) {
        return false;
    }
    s -= 90;
    int tc = s / 10;
    if (t < tc) {
        return true;
    }
    t -= tc;
    ts[idx] += tc;
    s = 0;
    return false;
}

int main() {
    while (cin >> n >> t >> h >> l) {
        for (int i = 0; i < n; i++) {
            cin >> ts[i] >> hs[i];
        }
        int idx = 0;
        while (!run(idx)) {
            idx = (idx + 1) % n;
        }
        cout << idx + 1 << endl;
    }
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int n, d, x;
    cin >> n >> d >> x;
    vec a(n);
    rep(i, n) cin >> a[i];

    int res = x;

    rep(i, n) {
        int cur = 1;
        while (cur <= d) {
            res++;
            cur += a[i];
        }
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<ctype.h>
#include<string>
#include<cmath>
#include<string.h>
#include<sstream>
#include<limits.h>
using namespace std;

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

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

// bool isPrime(int x){
//     int i;
//     if(x<2)return 0;

// }

int X,N;
int ans;
int p;
bool flag[102]={};
int main(){
    cin>>X>>N;
    for(int i=0;i<N;++i){
        cin>>p;
        flag[p]=1;
    }
    int counter=0;
    for(int i=X;i>=0;--i){
        if(flag[i]==0){
            ans=i;
            break;
        }
        counter++;
    }
    int counter2=0;
    for(int i=X;i<=101;++i){
        if(flag[i]==0){
            if(counter>counter2){
                ans=i;
            }
            break;
        }
        counter2++;
    }
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

int main() 
{
    int n, m, i;
    scanf("%d", &n);
    
    set<int> A;
    set<int> B;
    set<int> C;
    
    for(i = 0; i < n; i++)
    {
        scanf("%d", &m);
        A.insert(m);
    }
    
    scanf("%d", &m);
    
    for(i = 0; i < m; i++)
    {
        scanf("%d", &n);
        B.insert(n);
    }
    
    set_intersection(A.begin(), A.end(), B.begin(), B.end(), inserter(C, C.begin()));
    
    for(auto x : C)
        printf("%d\n", x);
    
    return 0;
}


Measured memory_bytes: 23780
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void minAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) min(dst, src);
}

void maxAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) max(dst, src);
}

void main()
{
    long A, B;
    scan(A, B);
    if (B % A == 0)
    {
        writeln(A + B);
    }
    else
    {
        writeln(B - A);
    }
}


Measured memory_bytes: 256
//“Make it work, make it right, make it fast.” – Kent Beck
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dd;
const int siz = 1e6 + 5;
const int MOD = 1e9 + 7;
#define endl '\n'
#define deb(x) cout << #x << " = " << x << endl;
void solve(){
	int n;
	cin >> n;
	string s[n];
	int count = 0;
	map<string , int>c;
	vector<string>v;
	for(int i = 0; i< n; i++){
		cin >> s[i];
		c[s[i]]++;
		count = max(count, c[s[i]]);
	}
	for(auto x : c){
		if(x.second == count)
		v.push_back(x.first);	
	}
	sort(v.begin(), v.end());
	for(auto cc : v)
		cout << cc << endl;
}

int main(){
	#ifndef RAY
		//freopen("input.txt", "r", stdin);
	#endif
		ios::sync_with_stdio(false);
		cin.tie(nullptr);
		int t = 1;
		//cin >> t;
		while(t--){
			solve();
		}
	return 0;
}


Measured memory_bytes: 27604
#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cout << *it << " = " << a << endl;
	err(++it, args...);
}
 
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
 
#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e4 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int n = s.length();
	int cnt = 0;
	
	bool q = 1;
	FOR (i, 0, ((n-1)/2) - 1)
	{
	    if (s[i] != s[((n-1)/2) - 1 - i]) q= 0;
	}
	
	FOR (i, ((n-1)/2) + 1, n-1)
	{
	    if (s[i] != s[n- 1 - i]) q= 0;
	}
	
	if (q) cout << "Yes";
	else cout << "No";
	
}



Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
  long long n,m,ans=0;
  cin>>n>>m;
  m/=2;
  if(m>=n){
    ans+=n;
    ans+=(m-n)/2;
  }
  else
    ans+=m;
  cout<<ans;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>

typedef long long ll;

using namespace std;

int main() {
    ll n, t, prev;
    scanf("%lld%lld%lld", &n, &t, &prev);
    ll now, cnt = t;
    for (ll i = 1; i < n; ++i) {
        scanf("%lld", &now);
        if (now < prev + t) cnt += (now - prev);
        else cnt += t;
        prev = now;
    }
    printf("%lld\n", cnt);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define FI first
#define SE second
#define PB push_back
#define ll long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define co(i) cout<<(i)<<endl
#define fcout cout<<fixed<<setprecision(10)
#define uni(i) i.erase(unique(i.begin(), i.end()), i.end());
#define all(i) i.begin(),i.end()
#define pint pair<int, int>
#define vint vector<int>
using namespace std;

const int INF=1e9+7;
const ll LINF=1e18;
const int MOD=1e9+7;
//const int MOD=998244353;

int main(){
	int n,h[101];
	cin>>n;
	h[0]=0;
	FOR(i,0,n) cin>>h[i+1];
	int ans=0;
	FOR(i,0,n){
		ans+=max(h[i+1]-h[i],0);
	}
	cout<<ans<<endl;

}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
using namespace std;
 
#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
  int n;
  cin>>n;
  cout<<n*n;
return 0;}

Measured memory_bytes: 3612
#include <stdio.h>

int main()
{
    int i, j, n, x, p, q, r, s, count = 0;
    scanf("%d", &n);
    int A[n];
    for(i = 0; i < n; i++) scanf("%d", &A[i]);
    
    p = 0;
    r = n - 1;
    x = A[r];
    i = p-1;
    for (j = p; j <= r; j++){
     if (A[j] <= x){
       i = i + 1;
        s = A[i];
       A[i] = A[j];
       A[j] = s;
   //s = A[i+1];
   //A[i+1] = A[r];
   //A[r] = s;
     }
    }
    
    for(i = 0; i < n; i++){
        if(A[i] == x) count++;
    }
    
    for(i = 0; i < n - 1; i++){
        if(A[i] == x) count--;
    if(count == 0){
        if(A[i] == x) {
            printf("[%d] ", A[i]);
            continue;
    }
    }
    printf("%d ", A[i]);
    }
    printf("%d\n", A[n-1]);
    return 0;
}


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

using namespace std;

#define int long long


main(){


    int n, m; cin >> n >> m;
    
    vector <int> p(m);
    vector <string> s(m);
    
    for(int i = 0; i < m; i++){
        cin >> p[i] >> s[i];
    }
    
    set <int> solved;
    map <int, int> count;
    
    int ans = 0;
    
    for(int i = 0; i < m; i++){
        if(solved.find(p[i]) == solved.end()){
            if(s[i] == "WA"){
                count[p[i]]++;
            }else{
                ans += count[p[i]];
                solved.insert(p[i]);
            }
        }
    }
    
    cout << solved.size() << " " << ans << endl;
    
    
    
    return 0;
}


Measured memory_bytes: 17408
#include<bits/stdc++.h>
using namespace std;int a[100001];
int main(){
int n;
cin>>n;int ans=0;
  for(int i=1;i<=n-1;i++)cin>>a[i];
  for(int i=1;i<=max(n-2,0);i++) ans+=min(a[i],a[i+1]);
ans+=a[1];ans+=a[n-1];

cout<<ans;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, s, n) for (int i = (s); i < (int)(n); i++)
#define INF 100000000

using namespace std;

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

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

int main(){
  ll X;
  cin >> X;
  ll a, b;
  ll i = 2;
  int f = 0;
  for( a=-1000; a<1000; a++ ) {
    for( b=-1000; b<1000; b++ ) {
      if ( a*a*a*a*a - b*b*b*b*b == X ) {
        cout << a << " " << b << endl;
        f = 1;
        break;
      }
    }
    if ( f == 1 ) break;
  }

//  cout << ans << endl;
}


Measured memory_bytes: 3632
/***********************
*  Author: xuziyuan    * 
***********************/

#include <bits/stdc++.h>

#define rt0 return 0
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define replet(c) for(char c='a';c<='z';c++) 
#define LL long long
#define pii pair <int,int>
#define pb push_back
#define fi first
#define se second
#define mpr make_pair
#define sqr(a) ((a)*(a))

using namespace std;

const LL MOD=1e9+7;

LL n,a[30],ans=1;
string s;

int main()
{
	cin>>n>>s;
	rep(i,n) a[s[i]-'a']++;
	rep(i,26)
	{
		ans=ans*(a[i]+1)%MOD;
	}
	cout<<ans-1<<endl;
	rt0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
using ll = long long;
const ll MOD = 1000000007;
const ll MAX = 2100000;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	repl(i, 2, MAX) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
ll COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 or k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll modpow(ll a, ll n) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % MOD;
		a = a * a % MOD;
		n >>= 1;
	}
	return res;
}
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
	COMinit();

	int k;
	string s;
	cin >> k >> s;
	int n = s.size();
	ll ans = 0;
	rep(i, k + 1) {
		ll p = COM(n + k - i - 1, n - 1) * modpow(25, k - i) % MOD * modpow(26, i) % MOD;
		ans = (ans + p) % MOD;
	}
	cout << ans << endl;
	return 0;
}


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

int main() {
  long long int n,m;
  cin>>n>>m;
  vector<pair<long long int,long long int>>drinks(n);
  for(int i=0;i<n;i++){
    int a,b;
    cin>>a>>b;
    drinks[i]=make_pair(a,b);
  }
  sort(drinks.begin(),drinks.end());
  long long int ans = 0;
  long long int q = 0;
  while(m>0){
    if(drinks[q].second>m){
        ans+=m*drinks[q].first;
        q++;
        m=0;
    }else{
        ans+=drinks[q].second*drinks[q].first;
        m-=drinks[q].second;
        drinks[q].second=0;
        q++;
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <set>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
 
using namespace std;
 
#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, n) for(auto i = (n).begin(); i != (n).end(); i++)
#define in_arr(type, a, n) copy_n(istream_iterator<type>(cin), n, (a).begin());
 
using ll = long long int;
 
int main(){
    int m1, d1, m2, d2;
    cin >> m1 >> d1 >> m2 >> d2;
    if(m1 == m2) {
        cout << 0 << endl;
    } else {
        cout << 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
//const ll MOD = pow(10, 9) + 7;
const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
ll myctoi(char C) {return C - '0';}
char myitoc(ll N) {return '0' + N;}
#define FINALANS(A) {cout << (A) << endl; exit(0);}

int main()
{
  ll N;
  cin >> N;
  vector<pair<ll, ll>> AB(N);
  for (ll i = 0; i < N; i++)
  {
    ll a;
    cin >> a;
    AB.at(i) = make_pair(a, i + 1);
  }
  sort(AB.begin(), AB.end());
  for (ll i = 0; i < N; i++)
  {
    cout << AB.at(i).second;
    if (i == N - 1)
      cout << endl;
    else
      cout << " ";
  }
}

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

using namespace std;

typedef long long ll;

int max(int a, int b)
{ return (a > b) ? a : b; }
int min(int a, int b)
{ return (a > b) ? b : a; }

const int MAXN = 2031;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
	
	int n;
	cin >> n;
	
	cout << fixed << setprecision(10) << ((n + 1) / 2) * 1.0 / n;


    return 0;
}


Measured memory_bytes: 256
#include <iostream>

#include<bits/stdc++.h>

using namespace std;

long long int g[3]={0}, v;

long long int max(long long int a, long long int b) 

{

long long int f=a>b?a:b;

return f;

}

long long vac(int n, long long int d[100008][3],int t) 

{

//cout<<n<<" "<<t<<endl;

long long int k[n+1][4];

//if(n==v) cout<<v;

/*

{

g[0]=vac(n, d, 0) ;

g[1]=vac(n, d, 1) ;

g[2]=vac(n, d, 2) ;

}

*/

if(n==0||t==0) 

return 0;

/*

if(n==1) 

{int y=max (d[0][1], d[0][0]) ;

//cout<<d[0][1];

//cout<<y<<endl;

return max(y, d[0][2]) ;}

if(n==2)

{

int y=max (d[0][1]+d[1][0], d[0][1]+d[1][2]) ;

int x=max (d[0][0]+d[1][1], d[0][0]+d[1][2]);

int z=max (d[0][2]+d[1][0], d[0][2]+d[1][1]) ;

int r=max(x, y) ;

return max(r, z) ;

}

*/

if(t==1) 

return max(vac(n-1,d, t+1)+d[n-1][t-1], vac(n-1, d, t+2)+d[n-1][t-1]) ;

if(t==2) 

return  max(vac(n-1,d, t-1)+d[n-1][t-1], vac(n-1, d, t+1)+d[n-1][t-1]) ;

if(t==3) 

{//cout<<"hi";

return max(vac(n-1,d, t-2)+d[n-1][t-1], vac(n-1, d, t-1)+d[n-1][t-1]) ;

}

}

int main() {

	// your code goes here

int n;

cin>>n;

v=n;

long long int K[n][3];

for(int p=0;p<n;p++) 

{

for(int j=0;j<3;j++) 

cin>>K[p][j];

}

/*

for(int p=0;p<n;p++) 

{

for(int j=0;j<3;j++) 

cout<<K[p][j]<<" ";

cout<< endl;

}

cout<<endl<<endl;*/

long long int d[n+1][4]={0};

for(int p=0;p<=n;p++) 

{

for(int q=0;q<4;q++) 

{

if(p==0||q==0) 

d[p][q]=0;

else if(q==1) 

d[p][q]=max(K[p-1][q-1]+d[p-1][2], K[p-1][q-1]+d[p-1][3]) ;

else if(q==2) 

d[p][q]=max(K[p-1][q-1]+d[p-1][1], K[p-1][q-1]+d[p-1][3]) ;

else if(q==3) 

d[p][q]=max(K[p-1][q-1]+d[p-1][1], K[p-1][q-1]+d[p-1][2]) ;

}

}

/*

for(int p=0;p<=n;p++) 

{

for(int q=0;q<4;q++) 

{

cout<<d[p][q]<<" ";

}

cout<<endl;

}

*/

//vac(n, K, 3) ;

//sort(g, g+3) ;

//cout<<g[2];

//cout<<vac(n, K, 0)<<endl<<vac(n, K, 1)<<endl<<vac(n, K, 2)<<endl;

long long int u=max(d[n][1],d[n][2]);

//cout<<u<<endl;

cout<<max(u,d[n][3]) ;

//cout<<max(u,vac(n, K, 3)) ;

	return 0;

}

Measured memory_bytes: 5760
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
typedef long long ll;
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i = 0; i < N; i++) cin >> A[i];
  double ans = 0;
  for(int i = 0; i < N; i++){
    ans += 1.0 / A[i];
  }
  cout << 1/ans << endl;
}


Measured memory_bytes: 256
INF = 10**15
N, M = map(int, raw_input().split())
G = [map(int, raw_input().split()) for _ in range(M)]

def run():
    cost = [-INF for i in range(N+1)]
    cost[1] = 0
    for _ in range(N+1):
        for a, b, c in G:
            if cost[a] == INF:
                continue
            if cost[a] + c > cost[b]:
                cost[b] = cost[a] + c
    looped = [False for i in range(N+1)]
    for _ in range(N+1):
        for a, b, c in G:
            if cost[a] == INF:
                continue
            if cost[a] + c > cost[b]:
                looped[b] = True
            if looped[a]:
                looped[b] = True
    return "inf" if looped[N] else cost[N]
print run()

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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int k, n, s;
  cin >> n >> k >> s;
  vector<int> a(n);
  int mx = (int) 1e9;
  if (k == 0) {
    if (s < mx) {
      for (int i = 0; i < n; i++) {
        a[i] = s + 1;
      }
    } else {
      for (int i = 0; i < n; i++) {
        a[i] = mx - 1;
      }
    }
    for (int i = 0; i < n; i++) {
      if (i) {
        cout << " ";
      }
      cout << a[i];
    }
    cout << '\n';
    return 0;
  }
  if (s == 1) {
    for (int i = 0; i < k; i++) {
      a[i] = 1;
    }
    for (int i = k; i < n; i++) {
      a[i] = mx;
    }
    for (int i = 0; i < n; i++) {
      if (i) {
        cout << " ";
      }
      cout << a[i];
    }
    cout << '\n';
    return 0;
  }
  if (s == mx) {
    for (int i = 0; i < k; i++) {
      a[i] = mx;
    }
    for (int i = k; i < n; i++) {
      a[i] = mx - 1;
    }
    for (int i = 0; i < n; i++) {
      if (i) {
        cout << " ";
      }
      cout << a[i];
    }
    cout << '\n';
    return 0;
  }
  if (s == 2) {
    for (int i = 0; i < k; i++) {
      a[i] = 2;
    }
    for (int i = k; i < n; i++) {
      a[i] = mx;
    }
    for (int i = 0; i < n; i++) {
      if (i) {
        cout << " ";
      }
      cout << a[i];
    }
    cout << '\n';
    return 0;
  }
  for (int i = 0; i < k; i++) {
    a[i] = s;
  }
  for (int i = k; i < n; i++) {
    a[i] = mx;
  }
  for (int i = 0; i < n; i++) {
    if (i) {
      cout << " ";
    }
    cout << a[i];
  }
  cout << '\n';
  return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int N,ans=0,x,i;
string S;
main(){
  cin>>N>>S;
  for(i=0;i<N;++i){
    if(S[i]=='I'){
      ++x;
    }else{
      --x;
    }
    if (ans < x){
      ans = x;
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int i, j, k, l, n, result, sum = 0;
  
  scanf("%d", &n);
  
  for( i = 1; i <= n; i++ ){
    for( j = 1; j <= n; j++ ){
      for( k = 1; k <= n; k++ ){
        result = 0;   
        for( l = 1; l <= n; l++ ){
          if( i < l || j < l || k < l ){
            break;
          }
     	   if( i % l == 0 && j % l == 0 && k % l == 0 ){
          	result = l;
           }
        }
        
        sum += result;
      }
    }
  }
 
  printf("%d\n", sum);
  return 0;
}

Measured memory_bytes: 1736