akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define pb              push_back
#define ppb             pop_back
#define endl            '\n'
#define mii             map<ll,ll>
#define pii             pair<ll,ll>
#define vi              vector<ll>
#define vs              vector<string>
#define all(a)          (a).begin(),(a).end()
#define F               first
#define S               second
#define sz(x)           ((ll)x.size())
#define hell            (998244353)
#define inf             ((ll)5e18 + 5)
#define PI              ((double)3.14159265358979323844)
#define DECIMAL(n)      cout << fixed << setprecision(n);
#define rep(i,a,b)      for (ll i=a;i<b;i++)
#define repr(i,a,b)     for (ll i=a-1;i>=b;i--)
#define bitcount(a)     (ll)__builtin_popcount(a)
#define lbnd            lower_bound
#define ubnd            upper_bound
#define mp              make_pair
#define ios             ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ordered_set     tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define trace(...)      __f(#__VA_ARGS__, __VA_ARGS__)

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

using namespace std;
using namespace __gnu_pbds;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

//primes for hashing 937,991,1013,1409,1741

ll add(ll a,ll b) {
    return ((a%hell)+(b%hell))%hell;
}
ll sub(ll a,ll b) {
    return ((a%hell)-(b%hell)+hell)%hell;
}
ll mul(ll a,ll b) {
    return ((a%hell)*(b%hell))%hell;
}
void solve() {
    ll n, k;
    cin>>n>>k;
    ll dp[n]={0};
    vector <pii> v;
    rep(i, 0, k) {
        ll x, y;
        cin>>x>>y;
        v.pb({x, y});
    }
    ll meow=0;
    rep(i, 0, k) {
        ll l=v[i].F;
        ll r=v[i].S;
        if (l<n && l>0) dp[l]=add(dp[l], 1LL);
        if (r+1<n && r+1>0) dp[r+1]=sub(dp[r+1], 1LL);
    }
    rep(i, 1, n) {
        meow=add(meow, dp[i]);
        rep(j, 0, k) {
            ll l=i+v[j].F;
            ll r=i+v[j].S;
            if (l<n && l>0) dp[l]=add(dp[l], meow);
            if (r+1<n && r+1>0) dp[r+1]=sub(dp[r+1], meow);
        }
    }
    rep(i, 1, n) {
        dp[i]=add(dp[i], dp[i-1]);
    }
    cout<<dp[n-1]<<endl;
}

signed main() {
    ios
    ll test=1;
    //cin>>test;
    while (test--) solve();
    return 0;
}

Measured memory_bytes: 5176
H, W , N = map(int,input().split())
from bisect import bisect_left
from bisect import bisect_right
matrix = []
for _ in range(N):
    x,y = map(int,input().split())
    matrix.append([x-1,y-1])
ans = [0 for _ in range(10)]
cand = {}
for l in matrix:
    for x_r in [-2, -1 , 0]:
        for y_r in [-2, -1 , 0]:
            nowx = l[0] + x_r
            nowy = l[1] + y_r
            if nowx < 0 or nowy < 0 or nowx + 2>= H or nowy+ 2 >= W:
                continue
            #ここで起点(左上)nowx, nowy として　 9マスに着目する
            name = str(nowx) + ' '  +str(nowy)
            if name in cand : cand[name] += 1
            else: cand[name] = 1
tmp = ((H - 2) * (W - 2))
for x in cand.values():
  ans[x] +=1
ans[0] =tmp - len(cand)
for x in ans:
    print(x)


Measured memory_bytes: 143416
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

int imos[31][100005];

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

    for(int i=0; i<N; i++){
        int s,t,c; cin >> s >> t >> c;
        imos[c][s]++; imos[c][t+1]--;
    }

    for(int i=1; i<=C; i++){
        for(int j=1; j<100005; j++) imos[i][j] = imos[i][j-1]+imos[i][j];
    }

    int ans = 0;
    for(int i=0; i<100005; i++){
        int tmp = 0;
        for(int c=1; c<=C; c++) if(imos[c][i]) tmp++;
        ans = max(ans, tmp);
    }

    cout << ans << endl;
}

Measured memory_bytes: 12032
// 複数選択化ナップザック http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_C&lang=jp
/* 入力例
4 8
4 2
5 2
2 1
8 3
// →出力　21
*/
#include <bits/stdc++.h>
using namespace std;
int main(void) {
    int N, W;
    cin >> N >> W;
    int v[N], w[N], dp[N][W + 1];
    for(int i = 0; i < N; i++) {
        cin >> v[i] >> w[i];
    }
    for(int i = 0; i < N; i++) {
        for(int j = 0; j <= W; j++) {
            if(i == 0) {
                if(j >= w[i])
                    dp[i][j] = dp[i][j-w[i]]+v[i];
                else
                    dp[i][j] = 0;
            } else {
                if(j >= w[i])
                    dp[i][j] = max(dp[i - 1][j], dp[i][j-w[i]]+v[i]);
                else
                    dp[i][j] = dp[i - 1][j];
            }
        }
    }
    cout << dp[N - 1][W] << endl;
    return 0;
}



Measured memory_bytes: 7004
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define rep2(i,j,n) for(int i=(j);i<=(n);i++)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define INF 1e9

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;
typedef long long i64;
typedef vector<long long int> vll;

int main() {
	int n;
	cin >> n;
	if (n % 2 == 0) cout << n << endl;
	else cout << n * 2 << endl;
}


Measured memory_bytes: 256
#include <cassert>
#include <cstdio>
#include <vector>
#include <set>

#include <map>
#include <unordered_map>
#include <deque>
#include <string>
#include <utility>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <climits>

using namespace std;

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

const int INF = 1e9;
const long long LINF = 1e18;

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

    vector<int> P(N);
    for (int i = 0; i < N; i++) {
        cin >> P[i];
    }

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

    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        a[i] = i + 1;
    }

    map<vector<int>, int> table;
    do {
        // for (vector<int>::iterator itr = a.begin(); itr != a.end(); ++itr) {
        //     cout << *itr << ' ';
        // }
        // cout << endl;
        table[a] = table.size() + 1;
    } while (next_permutation(a.begin(), a.end()));
    
    cout << abs(table[P] - table[Q]) << endl;

    return 0;
}


Measured memory_bytes: 5248
#include <bits/stdc++.h>
using namespace std;
int k, n, x;
bool s[1001];
int main(){
	cin >> k >> n;
	for (int i=1; i<=n; i++){
		cin >> x;
		s[x]=true;
	}
	int i=k, j=k;
	while (s[i]&&s[j]&&i>=1){
		i--;
		j++;
	}
	if (!s[i]){
		cout << i << endl;
		return 0;
	}
	else if (!s[j]){
		cout << j << endl;
		return 0;
	}
	else if (i==0){
		while (s[j]) j++;
		cout << j << endl;
		return 0;
	}
}

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

using namespace std;

int main()
{
  while(1){
    int n;
    cin>>n;
    if(n == 0){
      break;
    }

    vector<int> student;
    for(int i = 0;i < n;++i){
      int m,e,j;
      cin>>m>>e>>j;

      if(m == 100 || e == 100 || j == 100 || e + m >= 180 || e + m + j >= 240){
        student.push_back(0);
        continue;
      }
      if(e + m + j >= 210 || (e + m + j >= 150 && (m >= 80 || e >= 80))){
        student.push_back(1);
        continue;
      }
      student.push_back(2);
    }

    for(int e : student){
      if(e == 0){
        cout<<"A"<<endl;
      }
      else if(e == 1){
        cout<<"B"<<endl;
      }
      else{
        cout<<"C"<<endl;
      }
    }
  }

  return 0;
}


Measured memory_bytes: 3104
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <climits>
#include <cassert>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

#define INF INT_MAX/3
#define lINF LLONG_MAX/3
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define ALL(v) (v).begin(),(v).end()
#define MP make_pair
#define debug(x) cout<<#x<<":"<<x<<endl
#define debug2(x,y) cout<<#x<<":"<<#y<<"="<<x<<":"<<y<<endl

string f(int a,int l){
    string ret = to_string(a);
    int n=ret.size();
    for(int i=0;i<l-n;i++){
        ret = "0" + ret;
    }
    return ret;
}

void solve(int a0,int l){
    long long t[21];
    t[0] = a0;
    for(int i=1;i<21;i++){
        int b = t[i-1];
        string s = f(b,l);
        string rs = s;
        sort(ALL(s));
        sort(ALL(rs));
        reverse(ALL(rs));
        int big = stoi(rs);
        int small = stoi(s);
        t[i] = big-small;
    }

    for(int j=0;j<21;j++){
        for(int i=j+1;i<21;i++){
            if(t[i]==t[j]){
                cout << j << " " << t[i] << " " << i-j << endl;
                return;
            }
        }
    }

}

int main(){
    int a0,l;
    while(1){
        cin >> a0 >> l;
        if(a0==0 and l==0){
            break;
        }
        solve(a0,l);
    }
}

Measured memory_bytes: 3200
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		//BufferedReader in = new BufferedReader(new FileReader(new File("input.txt")));
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String[] line = in.readLine().split(" ");
		int r = conv(line[0]);
		int D = conv(line[1]);
		int x2000 = conv(line[2]);
		for(byte i = 0; i < 10; i++) {
			x2000 = r * x2000 - D;
			System.out.println(x2000);
		}
	}
	public static int conv(String s) {
		return Integer.valueOf(s);
	}
}


Measured memory_bytes: 20948
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>
 
using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;
constexpr ll MOD = 1000000007;

// a^-1 mod p
ll inv(ll a,ll p){
  return ( a == 1 ? 1 : (1 - p*inv(p%a,a)) / a + p );
}

ll p2(ll x) {
  if(x==0) return 1;
  if((x%2)==1) return p2(x-1)*2%MOD;
  ll h=p2(x/2);
  return h*h%MOD;
}

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin>>n;
  vecll c(n);
  for(auto&& e:c)cin>>e;
  boost::sort(c);
  ll ans = 0;
  for(auto&& i:irange(0l,n)) {
    ll rem = n - i - 1;
    ll tmp = (rem + 2) * p2(n-1) % MOD * inv(2, MOD) % MOD * c[i] % MOD;
    ans += tmp;
    ans %= MOD;
  }
  ans *= p2(n);
  ans %= MOD;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>

using namespace std;
typedef long long ll;
typedef pair<int,int> Pi;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) x.begin(), x.end()

int N, A[200020], M;
int D[2200020];
int *P = D + 1000010;

void solve(){
	scanf("%d", &N);
	for(int i=1;i<N;i++)scanf("%d", A+i);
	scanf("%d", &M);
	for(int i=0;i<=1000000;i++)P[i] = i;
	int S = 0;
	for(int i=3;i<N;i++){
		P = P - A[i];
		for(int j=0;j<A[i];j++)P[j] = P[A[i]*2 - j];
		S += A[i];
	}
	rep(i, M){
		int X; scanf("%d", &X);
		if(X > 1000000){
			printf("%d\n", X - S + A[1] - A[2]);
		}
		else{
			printf("%d\n", P[X] + A[1] - A[2]);
		}
	}
}

int main(){
	int Tc = 1; //scanf("%d\n", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		solve();
	}
	return 0;
}

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

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;

using ll  = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

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

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

void printVec(vector<int>& vec) {
    for (auto& e : vec) {
        cout << e << " ";
    }
    cout << endl;
}

const string YES = "Yes";
const string NO  = "No";

int func(long long n, std::string s) {
    // cout << fixed << setprecision(8);

    string ans = "No";
    if (n % 2 == 1) {
        cout << ans << endl;
        return 0;
    }
    if (n % 2 == 0) {
        string temp;
        temp = s.substr(n / 2, n / 2);
        if (s == temp + temp) {
            ans = "Yes";
            cout << ans << endl;
            return 0;
        }
    }

    cout << ans << endl;

    return 0;
}

int main() {
    long long N;
    scanf("%lld", &N);
    std::string S;
    std::cin >> S;

    func(N, S);

    return 0;
}


Measured memory_bytes: 256
N = int(input())
X = list(map(int, input().split()))
min_cost = 10000000
cost = 0

for i in range(min(X), max(X)+1):  # やる場所
    for k in range(N):  # 各人のコスト
        cost += (i - X[k]) ** 2
    min_cost = min(min_cost, cost)
    cost = 0

print(min_cost)


Measured memory_bytes: 2940
#include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<time.h>
#include<ctime>
#include<functional>
#define int long long
#define INT INT_MAX
#define LONG LLONG_MAX
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
typedef long long ll;
using namespace std;

char mutu(int a,int b) {
	if (a > b) return '>';
	else return '<';
}

signed main() {
	int n, a[100000], x = 1;
	cin >> n;
	f(i, n) cin >> a[i];
	char c = mutu(a[0], a[1]);
	f(i, n-2) {
		if (c == '>'&&a[i + 1] < a[i + 2]|| c == '<'&&a[i + 1] > a[i + 2]) {
			x++;
			i++;
			while (a[i + 1] == a[i + 2]) i++;
			c = mutu(a[i + 1], a[i + 2]);
		}
	}
	cout << x << endl;
	return 0;
}

Measured memory_bytes: 1024
//apc001_b.cpp
    //Sun Dec  2 16:28:51 2018
     
    #include <iostream>
    #include <string>
    #include <queue>
    #include <unordered_map>
    #include <vector>
    #include <algorithm>
    #include <math.h>
    #define INTINF 2147483647
    #define LLINF 9223372036854775807
    using namespace std;
    using ll=long long;
    typedef pair<int,int> P;
     
    int main(){
    	int n;
    	cin >> n;
     
    	ll a[n],b[n];
    	for (int i=0;i<n;i++){
    		cin >> a[i];
    	}
    	for (int i=0;i<n;i++){
    		cin >> b[i];
    	}
     
    	ll pos = 0;
    	ll neg = 0;
    	for (int i=0;i<n;i++){
    		if (a[i]>b[i]){
    			pos = pos + a[i]-b[i];
    		}else if (a[i]<b[i]){
    			ll temp = floor((b[i]-a[i])/2);
    			neg = neg + temp*2;
    		}
    	}
     
    //	cout << pos << " " << neg << endl;
     
    	if (pos*2<=neg || (pos==0 && neg==0)){
    		cout << "Yes" << endl;
    	}else {
    		cout << "No" << endl;
    	}
     
    }

Measured memory_bytes: 384
#include<cstdio>
int N ;
int F [100][14];
int P [100][15];
int main ()
{
scanf ("%d " ,& N );
for ( int i =0; i < N ; i ++)
{
for ( int j =0; j <10; j ++) scanf ("%d " ,& F [ i ][ j ]);
}
for ( int i =0; i < N ; i ++) for ( int j =0; j <11; j ++) scanf ("%d " ,& P [ i ][ j ]);
int res = -(1 << 30);
for ( int b =1; b <(1 << 10); b ++)
{
int cc =0;
for ( int i =0; i < N ; i ++)
{
int c =0;
for ( int j =0; j <10; j ++) if (( b >> j & 1)&& F [ i ][ j ]) c ++;
cc += P [ i ][ c ];
}
if ( res < cc ) res = cc ;
}
printf ("% d \n " , res );
}

Measured memory_bytes: 128
import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))
mod= 998244353
MAX=max(A)

COUNTLIST=[0]*(MAX+1)
for a in A:
    COUNTLIST[a]+=a

SUMLIST=[0]*(MAX+1)
CLIST=[0]*(MAX+1)

for i in range(1,MAX+1):
    score=0
    for j in range(i,MAX+1,i):
        score+=COUNTLIST[j]
    SUMLIST[i]=score

for i in range(1,MAX+1):
    CLIST[i]-=i-1
    ctemp=CLIST[i]
    for j in range(i*2,MAX+1,i):
        CLIST[j]-=j//i*ctemp

#print(SUMLIST)
#print(CLIST)
            
ANS=SUMLIST[1]*SUMLIST[1]

#print(ANS)

for i in range(2,MAX+1):
    ANS+=CLIST[i]*SUMLIST[i]*SUMLIST[i]*pow(i,mod-2,mod)
    #print(ANS%mod)

print((ANS%mod-SUMLIST[1])*pow(2,mod-2,mod)%mod)

Measured memory_bytes: 96716
#include <stdio.h>
int main(void){
    int N,r=0,b=0;
    char s[100];
    scanf("%d",&N);
    scanf("%s",&s);
    
    for(int i=0;i<N;i++){
        if(s[i]=='R') r++;
        else b++;
    }
    
    if(r>b) printf("Yes");
    else printf("No");
    return 0;
}


Measured memory_bytes: 128
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto & in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

std::string s;

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> s;
	int c = std::count(all_range(s), 'o');
	if ((15 - s.length()) + c >= 8) {
		out << "YES" << endl;
	}else{
		out << "NO" << endl;
	}

	return 0;
}
#endif


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for (ll i = (ll)a; i <= (ll)b; i++)
#define DEC(i, a, b) for (ll i = (ll)a; i >= (ll)b; i--)
#define f first
#define s second

ll m, k;

int main() {
	cin >> m >> k;
	if (((1<<m) - 1 < k) or (m == 0 and k == 1) or (m == 1 and k == 1)) {
		cout << -1;
		return 0;
	} else if (k == 0) FOR(i, 0, ((1<<m)-1)) cout << i << " " << i << " ";
	else {
		FOR(i, 0, ((1<<m)-1)) if (i != k) cout << i << " ";
		cout << k << " ";
		DEC(i, ((1<<m)-1), 0) if (i != k) cout << i << " ";
		cout << k;
	}
}


Measured memory_bytes: 1792
import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		int X = Integer.parseInt(in.readLine());
		if (X >= 30) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

	void calc() {
	}

	void showResult() {
	}
}

Measured memory_bytes: 25360
#include<iostream>
#include<string>
//#include<cmath>
//#include<array>
#include<algorithm>
//#include<deque>
#include<vector>
//#include<utility>
//#include<set>
//#include<map>
//#include<list>
//#include<bitset>

using namespace std;
using LLI = long long int;
LLI N;

//array<int, 8>dir_x = { 0,0,1,1,1,-1,-1,-1 };
//array<int, 8>dir_y = { 1,-1,1,0,-1,1,0,-1 };
//array<int, 4>dir_x2 = { 0,0,1,-1 };
//array<int, 4>dir_y2 = { 1,-1,0,0 };
//char alp[] = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };

//class UnionFind {
//public:
//	vector<int>data;
//	UnionFind(int size) :data(size, -1) {};
//	bool unionset(int x, int y) {
//		x = root(x), y = root(y);
//		if (x != y) {
//			if (data[y] < data[x]) {
//				swap(x, y);
//			}
//			data[x] += data[y];
//			data[y] = x;
//		}
//		return x != y;
//	}
//	bool findset(int x, int y) {
//		return root(x) == root(y);
//	}
//	int root(int x) {
//		return data[x] < 0 ? x : data[x] = root(data[x]);
//	}
//	int size(int x) {
//		return -data[root(x)];
//	}
//};

LLI gcd(LLI x, LLI y) {
	LLI  r;
	if (x < y) {
		swap(x, y);
	}
	r = x % y;
	while (r != 0) {
		x = y;
		y = r;
		r = x % y;
	}
	return y;
}
LLI lcm(LLI x, LLI y) {
	return x / gcd(x, y) * y;
}

//long nCr(int n,int r) {
//	long ans = 1;
//	for (int i = n; i > n - r;i--) {
//		ans = ans * i;
//	}
//	for (int i = 1; i < r + 1;i++) {
//		ans = ans / i;
//	}
//	return ans;
//}

//const int n_max = 8;
//array<array<bool, n_max>, n_max>graph;
//int dfs(int v,int N,array<bool,n_max>visited) {
//	int ret = 0;
//	bool all_visited = true;
//	for (int i = 0; i < N;i++) {
//		if (visited[i] == false) {
//			all_visited = false;
//		}
//	}	
//	if (all_visited) {
//		return 1;
//	}
//	for (int i = 0; i < N;i++) {
//		if (graph[v][i] == false) {
//			continue;
//		}
//		if (visited[i] == true) {
//			continue;
//		}
//		visited[i] = true;
//		ret += dfs(i,N,visited);
//		visited[i] = false;
//	}
//	return ret;
//}

//vector<vector<int>>sub;
//int dfs(int id) {
//	if (sub[id].size() == 0) {
//		return 1;
//	}
//	int minP = (int)1e9;
//	int maxP = 0;
//	for (int i : sub[id]) {
//		int P = dfs(i);
//		minP = min(minP, P);
//		maxP = max(maxP, P);
//	}
//	return minP + maxP + 1;
//}

//#define debug(x) cerr << #x << " : " << x << endl
//#define debugv(x) cerr << #x << " : "; for(auto i:x) cerr << i << ", "; cerr<<endl

int main(void) {
	LLI N;
	cin >> N;
	vector<LLI>vec(N);
	vector<LLI>vec2(N);
	vector<LLI>vec3(N);
	for (int i = 0; i < N; i++) {
		LLI a;
		cin >> a;
		vec3[i] = a;
	}
	vec[0] = vec3[0];
	vec2[N - 1] = vec3[N - 1];
	for (int i = 0; i < N - 1; i++) {
		vec[i + 1] = gcd(vec[i], vec3[i + 1]);
	}
	for (int i = N - 1; i > 0; i--) {
		vec2[i - 1] = gcd(vec2[i], vec3[i - 1]);
	}
	LLI MAX = 0;
	for (int i = 0; i < N - 2;i++) {
		MAX = max(MAX,gcd(vec[i],vec2[i + 2]));
	}
	MAX = max(MAX,vec[N - 2]);
	MAX = max(MAX,vec2[1]);
	cout << MAX << endl;
}

Measured memory_bytes: 2560
#include<iostream>
using namespace std;
int main(){
	int n;
	while(1){
plane:
		char airport[50][51]={},tag[50][51]={};
		cin>>n;
		if(n==0)break;
		for(int i=0;i<n;i++){
			cin>>airport[i];
			int x=1;
			tag[i][0]=airport[i][0];
			for(int j=0;j<49;j++)if(airport[i][j]=='a'||airport[i][j]=='i'||airport[i][j]=='u'||airport[i][j]=='e'||airport[i][j]=='o'){
				tag[i][x]=airport[i][j+1];
				x++;
			}
		}
		int max=0;
		for(int i=0;i<(n-1);i++){
			for(int j=(i+1);j<n;j++){
				for(int k=0;k<50;k++){
					if(tag[i][k]!=tag[j][k]){
						if(max<(k+1))max=(k+1);
						break;
					}
					if(k==49){
						cout<<"-1\n";
						goto plane;
					}
				}
			}
		}
		cout<<max<<"\n";
	}
	return 0;
}

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

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

	int N;
	scanf("%d", &N);

	vector<int> A(N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &A[i]);
	}

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

	int count = 0;
	long long s = 0;
	for (int i = 0; i < N; i++) {
		if (A[i] <= s * 2) {
			count++;
		} else {
			count = 1;
		}
		s += A[i];
	}

	cout << count;
	return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-9;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
int main(){
	int a,b;scanf("%d%d",&a,&b);int ret=a-1;
	if(b>=a)ret++;
	printf("%d\n",ret);
}


Measured memory_bytes: 128
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

const (
	BUFSIZE   = 10000000
	MOD       = 1000000007
	INF_INT   = math.MaxInt32
	INF_INT64 = math.MaxInt64
)

var rdr *bufio.Reader

func main() {
	rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)
	solve()
}

func solve() {
	S := readline()
	T := readline()

	ans := 0
	for i, c := range S {
		if c != rune(T[i]) {
			ans += 1
		}
	}
	fmt.Println(ans)
}

func readline() string {
	buf := make([]byte, 0, BUFSIZE)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			fmt.Println(e.Error())
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func readIntSlice(size int) []int {
	slice := make([]int, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i(v)
	}
	return slice
}

func readInt64Slice(size int) []int64 {
	slice := make([]int64, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i64(v)
	}
	return slice
}

func readint() int {
	return s2i(readline())
}

func readint64() int64 {
	return s2i64(readline())
}

// For int64
func b2i64(b bool) int64 {
	if b {
		return 1
	}
	return 0
}

func abs64(v int64) int64 {
	if v < 0 {
		return -v
	}
	return v
}

func min64(values ...int64) int64 {
	ret := int64(INF_INT64)
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max64(values ...int64) int64 {
	ret := -int64(INF_INT64)
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i64(s string) int64 {
	v, ok := strconv.ParseInt(s, 10, 64)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int64")
	}
	return v
}

// For int
func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

func abs(v int) int {
	if v < 0 {
		return -v
	}
	return v
}

func min(values ...int) int {
	ret := INF_INT
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max(values ...int) int {
	ret := -INF_INT
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i(s string) int {
	v, ok := strconv.Atoi(s)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int")
	}
	return v
}

func lcm(v1, v2 int) int {
	if v1 > v2 {
		v1, v2 = v2, v1
	}
	for v1 != 0 {
		v1, v2 = v2%v1, v1
	}
	return v2
}

func gcd(v1, v2 int) int {
	return v1 * v2 / lcm(v1, v2)
}

/* ------------------------------------------------ */
/* Data stracture                                   */
/* ------------------------------------------------ */
type IntHeap []int

func (h *IntHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }


Measured memory_bytes: 4040
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

int main(){
	string word, lword, rword;
	cin >> word;
	lword = word;
	rword = word;
	int count = 0;
	map<string, int> data;
	data[rword] = 1;

	while(cin >> word){
		if(lword.size() < word.size()) lword = word;
		data[word]++;
		if(data[word] > count){
			rword = word;
			count = data[word];
		}
	}
	cout << rword << " " << lword << endl;
	

}

Measured memory_bytes: 1196
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

def LF(): return list(map(float,sys.stdin.readline().rstrip().split()))
N,D= LI()
D = D*D
count = 0

for i in range(N):
    x,y = LF()
    kyori = x*x+y*y
    if kyori <= D:
        count += 1
    

print(count)

Measured memory_bytes: 9212
#include<stdio.h>

int main(void) {
	int a, b, c, k, max;
	scanf("%d %d %d %d", &a, &b, &c, &k);

	if (k < a) {
		max = k;
	} else if (a <= k && k <= a + b) {
		max = a;
	} else if (a + b < k) {
		max = a - (k - (a + b));
	}

	printf("%d",max);
	return 0;
}


Measured memory_bytes: 1728
#include <iostream>

using namespace std;

const int max_p = 10000000;
bool prime[max_p + 1];

void init_prime()
{
    for (int i = 0; i <= max_p; i++)
        prime[i] = true;
    prime[0] = prime[1] = false;

    for (int i = 2; i * i < max_p; i++)
        if (prime[i])
            for (int j = 2 * i; j <= max_p; j += i)
                prime[j] = false;
}

int main()
{
    int n;

    init_prime();

    while (cin >> n, n) {
        while (true) {
            if (prime[n] && prime[n - 2] && prime[n - 6] && prime[n - 8]) {
                cout << n << endl;
                break;
            }
            n--;
        }
    }

    return 0;
}

Measured memory_bytes: 10924
// う　し　た　ぷ　に　き　あ　く　ん　笑
#include <algorithm>
#include <array>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define int long long

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

    int n;
    cin >> n;

    vector<int> f(n + 1, 0);

    for (int x = 1; x <= n; x++)
        for (int y = 1; y <= n; y++)
            for (int z = 1; z <= n; z++) {
                const int val = x * x + y * y + z * z + x * y + y * z + z * x;
                if (val <= n)
                    f[val]++;
                else
                    break;
            }

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


Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
//#define  double pi 2*acos(0.0);
int main()
{
    int m,n,i,j,k=0;
    cin>>m>>n;
    while(n--)
    {
        cin>>j;
        k+=j;
    }
    if(k<=m)
        cout<<m-k<<endl;
    else
        cout<<"-1"<<endl;
}


Measured memory_bytes: 3632
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] s = new int[m];
        int[] c = new int[m];

        for (int i=0; i<m; i++){
            s[i] = sc.nextInt();
            c[i] = sc.nextInt();
        }

        for (int i=0; i<m; i++){
            if (n<s[i]){
                System.out.println("-1");
                return;
            }
            if (s[i]==1 && c[i]==0 && 2<=n){
                System.out.println("-1");
                return;
            }
        }

        Set<Integer> set1 = new HashSet<>();
        Set<Integer> set2 = new HashSet<>();
        Set<Integer> set3 = new HashSet<>();

        for (int i=0; i<m; i++){
            int tmpS = s[i];
            int tmpC = c[i];
            if (tmpS==1){
                set1.add(tmpC);
            }else if (tmpS==2){
                set2.add(tmpC);
            }else if (tmpS==3){
                set3.add(tmpC);
            }
        }

        if (2<=set1.size() || 2<=set2.size() || 2<=set3.size()){
            System.out.println("-1");
            return;
        }


        if (n==1){
            if (set1.size()==0){
                System.out.print(0);
            }else {
                Iterator it = set1.iterator();
                System.out.println(it.next());
            }
        }else if (n==2){
            if (set1.size()==0){
                System.out.print(1);
            }else {
                Iterator it = set1.iterator();
                System.out.print(it.next());
            }
            if (set2.size()==0){
                System.out.print(0);
            }else {
                Iterator its = set2.iterator();
                System.out.print(its.next());
            }
        }else if (n==3){
            if (set1.size()==0){
                System.out.print(1);
            }else {
                Iterator it = set1.iterator();
                System.out.print(it.next());
            }
            if (set2.size()==0){
                System.out.print(0);
            }else {
                Iterator its = set2.iterator();
                System.out.print(its.next());
            }
            if (set3.size()==0){
                System.out.print(0);
            }else {
                Iterator its = set3.iterator();
                System.out.print(its.next());
            }

        }

    }
}


Measured memory_bytes: 22996
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::*;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::collections::*;

fn main() {
    input! {
        n: usize, k: usize, c: usize,
        s: Chars
    };

    let mut forward_days = HashMap::new();
    let mut last_ng_day = -1;
    let mut cur_day = 1;
    for i in 0..n {
        if cur_day > k {
            break;
        }
        if s[i] == 'x' {
            continue;
        }
        if i as isize <= last_ng_day {
            continue;
        }
        forward_days.insert(cur_day, i);
        cur_day += 1;
        last_ng_day = (i + c) as isize;
    }
    let mut backward_days = HashMap::new();
    let mut last_ng_day = n as isize;
    let mut cur_day = k;
    for i in (0..n).rev() {
        if cur_day == 0 {
            break;
        }
        if s[i] == 'x' {
            continue;
        }
        if i as isize >= last_ng_day {
            continue;
        }
        backward_days.insert(cur_day, i);
        cur_day -= 1;
        last_ng_day = i as isize - c as isize;
    }
    for step in 1..k + 1 {
        let li = forward_days.get(&step).unwrap();
        let ri = backward_days.get(&step).unwrap();
        if li == ri {
            println!("{}", li + 1);
        }
    }
}


Measured memory_bytes: 16004
N = int(input())
t = list(map(int, input().split()))
v = list(map(int, input().split()))

# if N == 1: #最初の1区間だけ
#     if t[0] % 2 == 1: #奇数秒
#         if t[0]/2 < v[0]:
#             print ((t[0]/2) ** 2)
#             exit()
        

# print ('t', t)
# print ('v', v)
N_INF = - 10 ** 15
DP = [[N_INF] * (102) for _ in range(100 * 200 + 2)] #DP[T][V] := 時刻Tに速度Dで走っているときの時刻Tまでの走行距離の最大値
DP[0][0] = 0
# print (DP[0][0:5])
time = 1
for i in range(N):
    # print (i)
    # print ('time', time)
    for j in range(time, time + t[i]): #時刻
        # print (j, end = ' ')
        for k in range(0, v[i] + 1): #速度
            if k == 0: #速度0-->加速して速度0になることはない
                # print (j, k)
                # print (max(DP[j - 1][0], DP[j - 1][1] +  1/2))
                DP[j][k] = max(DP[j - 1][0] + 0.25, DP[j - 1][1] + 1/2)
            elif k != v[i]: #加速してくるときも減速してくることもある
                DP[j][k] = max(DP[j - 1][k -1] + k - 1/2, DP[j - 1][k] + k + 0.25, DP[j - 1][k + 1] + k + 1/2)
            else: #(k == v[i] and j != time) #減速してくることはない
                DP[j][k] = max(DP[j - 1][k -1] + k - 1/2, DP[j - 1][k] + k)
        # print (DP[j][0:5])
    time += t[i]
# print (time)
print (DP[time - 1][0])
# print ('T = 6, V = 6', DP[6][6])
# print ('T = 12, V = 2', DP[12][2])
# print ('T = 12, V = 3', DP[12][3])
# print ('T = 13, V = 2', DP[13][2])
# print ('T = 26 V = 2', DP[26][2])
# print ('T = 27 V = 2', DP[27][2])


Measured memory_bytes: 45940
#include <stdio.h>
int main(void)
{
	int A, B, K,count=0,j=0;
	int an[100];
	scanf("%d%d%d", &A, &B, &K);
	if (A > B) {
		while (true) {
			for (int i = B; i > 0; i--) {
				if (A % i == 0 && B % i == 0) {
					if (count == K-1) {
						printf("%d", i);
						return 0;
					}
					else {
						count++;
					}
				}
			}
		}
	}
	if (A <= B) {
		while (true) {
			for (int i = A; i > 0; i--) {
				if (A % i == 0 && B % i == 0) {
					if (count == K-1) {
						printf("%d", i);
						return 0;
					}
					else {
						count++;
					}
				}
			}
		}
	}
	return 0;
}

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

typedef long long ll;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define debug(x) cerr << #x << ": " << x << '\n'

ll div_ct(ll n)
{
    ll c = 0;
    ll k;
    for (k = 1; k <= n; k++)
    {
        if (n % k == 0)
        {
            c++;
        }
    }
    return c;
}

int main()
{
    ll N;
    cin >> N;
    ll ans = 0;
    for (int i = 1; i <= N; i += 2)
    {
        if (div_ct(i) == 8)
        {
            ++ans;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

EPS = 1e-9


class Vector:
    x = 0
    y = 0

    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y

    def __add__(self, other):
        return self.__class__(self.x+other.x, self.y+other.y)

    def __sub__(self, other):
        return self.__class__(self.x-other.x, self.y-other.y)

    def __mul__(self, other):
        return self.__class__(self.x*other, self.y*other)

    def sqrtNorm(self):
        return self.x*self.x+self.y*self.y

    def norm(self):
        return math.sqrt(self.sqrtNorm())


class Circle:
    v = Vector()
    r = 0

    def __init__(self, v, r):
        self.v = v
        self.r = r

    def get_intersections(self, c):
        v = c.v-self.v
        l = v.norm()
        # 円が重なっている
        if equal(l, 0):
            return []
        # 交点が一つ
        if equal(l+self.r+c.r, max(l, self.r, c.r)*2):
            if equal(l+self.r, c.r):
                return [self.v - v*(self.r/l)]
            else:
                return [self.v + v*(self.r/l)]
        # 遠距離で交点が存在しない
        if l+self.r+c.r < max(l, self.r, c.r)*2:
            return []

        x = (l*l + self.r*self.r - c.r*c.r) / (2*l)
        y = math.sqrt(self.r*self.r - x*x)
        mid = self.v + v * (x/l)
        rv = Vector(v.y, -v.x)
        return [mid+rv*(y/l), mid-rv*(y/l)]

    def is_inside(self, v):
        return (v-self.v).norm() < self.r+EPS


def equal(a, b):
    return abs(a-b) < EPS


def main():
    n, k = map(int, input().split())

    if k == 1:
        print(0)
        return

    cs = [None]*n
    rs = [0]*n
    for i in range(n):
        x, y, c = map(int, input().split())
        cs[i] = Circle(Vector(x, y), c)
        rs[i] = c
    l = 0
    r = 400000
    for z in range(100):
        x = (l+r)/2
        ps = [None]*n
        for i in range(n):
            ps[i] = cs[i].v

        for i in range(n):
            a = cs[i]
            a.r = x/rs[i]
            for j in range(i+1, n):
                b = cs[j]
                b.r = x/rs[j]
                ps += a.get_intersections(b)
        is_ok = False
        for p in ps:
            cnt = 0
            for i in range(n):
                nc = cs[i]
                nc.r = x/rs[i]
                if nc.is_inside(p):
                    cnt += 1
            if cnt >= k:
                is_ok = True
                break
        if is_ok:
            r = x
        else:
            l = x
    print(r)


main()


Measured memory_bytes: 71384
X, N = map(int, input().split())
ps = list(map(int, input().split()))
bgr, smr = X, X
while bgr <= 100:
	if bgr not in ps:
		break
	bgr += 1
while smr >= 1:
	if smr not in ps:
		break
	smr -= 1
print(bgr) if bgr - X < X - smr else print(smr)


Measured memory_bytes: 9060
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define pb push_back
#define MOD 1000000007
#define INF 1000000000000
#define EPS 0.00000000001
typedef long long ll;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    //---------------------------------------------
    int n;
    cin>>n;
    vector<ll> a(n);
    ll sum=0;
    rep(i,n){
        cin>>a[i];
        if(i==0){
            continue;
        }
        a[i]+=a[i-1];
    }
    ll ans=INF;
    rep(i,n-1){
        ll memo=a[n-1]-a[i];
        ans=min(ans,abs(a[i]-memo));
    }
    cout<<ans<<endl;
}



Measured memory_bytes: 1792
using System;
using System.Collections.Generic;
using System.Linq;

class Hello{
static void Main(){
    
string [] str;
str=Console.ReadLine().Split(' ');

for(int i=0;str[0]!="0"&&str[1]!="0";i++)
{
    for(int w=0;w<int.Parse(str[0]);w++)
    {
        Console.WriteLine(new string('#', int.Parse(str[1])));
    }
    Console.WriteLine();
    str=Console.ReadLine().Split(' ');
}

}
}


Measured memory_bytes: 17936
#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>

int main() {
	int n; std::cin >> n;
	std::vector<std::string> edges(n); 
	for (auto& line : edges) std::cin >> line;
	std::vector<int> state(n, -1);
	std::vector<std::vector<int>> sub_graphs;
	bool is_biparate = true;
	for (auto i = 0; i < n && is_biparate; ++i) {
		if (state[i] == -1) {
			std::stack<int> stack;
			std::vector<int> vertex;
			stack.push(i);
			vertex.push_back(i);
			state[i] = 0;
			while (!stack.empty() && is_biparate) {
				auto top = stack.top(); stack.pop();
				for (auto to = 0; to < n; ++to) if (edges[top][to] == '1') {
					if (state[top] == state[to]) {
						is_biparate = false;
						break;
					}
					else if (state[to] == -1) {
						state[to] = 1 - state[top];
						stack.push(to);
						vertex.push_back(to);
					}
				}
			}
			sub_graphs.push_back(vertex);
		}
	}
	if (!is_biparate) {
		std::cout << -1 << std::endl;
	}
	else {
		std::vector<std::vector<int>> min_distance(n, std::vector<int>(n, INT_MAX));
		for (auto i = 0; i < n; ++i) for (auto j = 0; j < n; ++j) {
			if (edges[i][j] == '1') {
				min_distance[i][j] = 1;
			}
			if (i == j) min_distance[i][j] = 0;
		}
		for (auto k = 0; k < n; ++k) {
			for (auto i = 0; i < n; ++i) if (min_distance[i][k] != INT_MAX) {
				for (auto j = 0; j < i; ++j) if (min_distance[k][j] != INT_MAX) {
					min_distance[i][j] = min_distance[j][i] = std::min(min_distance[i][j], min_distance[i][k] + min_distance[k][j]);
				}
			}
		}
		long long int result = 0;
		for (const auto& sub : sub_graphs) {
			int max_distance = 0;
			for (auto i = 0; i < sub.size(); ++i) {
				for (auto j = 0; j < i; ++j) {
					max_distance = std::max(max_distance, min_distance[sub[i]][sub[j]]);
				}
			}
			result += max_distance + 1;
		}
		std::cout << result << std::endl;
	}
}

Measured memory_bytes: 1144
#include <bits/stdc++.h>
using namespace std;
int main()   {
int n;
cin >> n;
vector<int> a(n);
for(int i = 0; i < n; i++) {
    cin >> a.at(i);
}
vector<int> data(100000, 0);
int count = 0;

for(int i = 0; i < (n - 1); i++) {
    if (a.at(i) >= a.at(i + 1)) {
        count = count + 1;
    }
    else if (a.at(i) < a.at(i + 1)) {
        data.at(i) = count;
        count = 0;
    }
}

sort(data.begin(), data.end());
cout << max(data.at(99999), count)  << endl;

}


Measured memory_bytes: 1152
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;

signed main() {
	long long n, k;
	cin >> n >> k;
	
	vector<long long> h(n);
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}
	
	sort(h.begin(), h.end());
	
	long long ans = 0;
	for (int i = 0; i < n - k; i++) {
		ans += h[i];
	}
	
	cout << ans << endl;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"
template<class T> void chmax(T &a, const T b){ a = max(a, b); }
template<class T> void chmin(T &a, const T b){ a = min(a, b); }

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    string s;
    cin >> s;
    ll ans = 0;
    string bef = "", cur = "";
    rep(i, len(s)) {
        cur += s[i];
        if (cur != bef) {
            bef = cur;
            ans++;
            cur = "";
        }
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;
long long dp[100099],a[100009];
int n;
int main()
{
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for (int i=0;i<100099;i++)dp[i]=99999999999999999;
    dp[1]=0;
    for (int i=2;i<=n;i++)
    {
        for (int j=1;i-j>=1 && j<=2;j++)
        {
            dp[i]=min(dp[i],dp[i-j]+abs(a[i-j]-a[i]));
        }
    }
    cout<<dp[n];
    return 0;
}


Measured memory_bytes: 1792
#include <deque>
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
 
using namespace std;
 
string a;
 
int t,op,f;
 
char c;
 
deque<char>de;
 
int main(void) {
	cin >> a;
	for(int i = 0; i < a.length(); i ++) {
		de.push_back(a[i]);
	}
	scanf("%d",&t);
	int ans = 1;
	while(t --) {
		scanf("%d",&op);
		if(op == 1) {
			ans ++;
		} else {
			scanf("%d",&f);
			getchar();
			scanf("%c",&c);
			if(ans % 2 == 1) {
				if(f == 1) {
					de.push_front(c);
				} else {
					de.push_back(c);
				}
			} else {
				if(f != 1) {
					de.push_front(c);
				} else {
					de.push_back(c);
				}
			}
		}
	}
//	ans = ans - 1;
	if(ans % 2 == 1)
		for(int i = 0; i < de.size(); i ++) {
			printf("%c",de[i]);
		}
	else {
		for(int i = de.size() - 1; i >= 0; i --) {
			printf("%c",de[i]);
		}
	}
	return 0;
}

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

#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(...)
#endif

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef map<int,int> mii;

#define rep(i,n)      for(int i=0; i < (n); ++i)
#define fr            first
#define sc            second
#define int           long long
#define uint          unsigned long long
#define pb            push_back
#define mp            make_pair
#define all(x)        (x).begin(),(x).end()
#define rall(x)       (x).rbegin(),(x).rend()
#define sz(x)         (x).size()

const double PI=3.1415926535897932384626433832795;
const int mod=1e9+7;
const int mod1=998244353;
int n,ans; string str;

int solve(){
    cin>>n;
    int a[n],b[n];
    for (int i = 0; i < n; ++i)
    {
        cin>>a[i];
        b[i]=a[i];
    }
    sort(b,b+n);
    int t=b[n-1],t1=b[n-2];
    for (int i = 0; i < n; ++i)
    {
        if(a[i]==t) cout<<t1<<"\n";
        else cout<<t<<"\n";
    }
}

signed main() {
    ios::sync_with_stdio(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int tests=1;
    //cin>>tests;
    while(tests--) solve();
    return 0;
}

Measured memory_bytes: 4736