akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repr(i,N) for(int i = (N) - 1; i >= 0; i--)
#define rep1(i,N) for(int i = 1; i <= (N) ; i++)
#define repr1(i,N) for(int i = (N) ; i > 0 ; i--)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
using namespace std; void solve();
using ll = long long; using vl = vector<ll>;
using vi = vector<int>; using vvi = vector< vector<int> >;
constexpr int inf = 1001001001;
constexpr ll infLL = (1LL << 61) - 1;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(7);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cerr << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,N) do { cerr << #v << " = "; array_out(v , N);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
  int main(){solve();}
#endif
using P = pair<int,int>; using vp = vector<P>;
constexpr int MOD = /** 1000000007; //*/ 998244353;
//////////

void solve(){
  ini(a,b,c,d);
  out((a != c) ? 1 : 0);
}

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

#define ll unsigned long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

int main()
{
    string s;
    ll k;
    cin >> s >> k;
    ll now = 0;
    ll length = 0;
    //cout << k << endl;
    rep(i,s.size())
    {
        now = int(s[i]) - 48;
        if(now == 1) length++;
        else
        {
            cout << s[i] << endl;
            return 0;
        }
        if(length > k - 1)
        {
            cout << 1 << endl;
            return 0;
        }
    }
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);
    vector<ll> x(5);

    cin >> x[0] >> x[1] >> x[2] >> x[3] >> x[4] >> x[5];

    REP(i, 5){
        if(x[i] == 0){
            cout << i+1 << endl;
            return 0;
        }
    }
    return 0;
}

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

#define ran 201102

int n;
int v[ran];
long long s[ran];

int main() {
	scanf("%d", &n);
	s[0] = 0LL;
	for(int i=1;i<=n;i++) {
		scanf("%d", &v[i]);
		s[i] = s[i-1] +v[i];
	}
	long long ans = s[n];
	for(int i=2;i<=n-2;i++) {
		long long sl = s[i], sr = s[n]-s[i];
		int pl = lower_bound(s, s+i+1, sl/2) - s;
		int pr = lower_bound(s+i+1, s+n+1, s[i] +sr/2) - s;
		//cout<<i<<' '<<pl<<' '<<pr<<endl;
		for(int x = max(1, pl-3); x <= min(i-1, pl+3); x++)
		for(int y = max(i+1, pr-3); y<=min(n-1, pr+3); y++) {
			long long sa = s[x], sb = s[i] - sa;
			long long sc = s[y] - s[i], sd = s[n] - sc - s[i];
			//cout<<x<<' '<<y<<' '<<sa<<' '<<sb<<' '<<sc<<' '<<sd<<endl;
			long long mi = min(min(sa, sb), min(sc, sd));
			long long ma = max(max(sa, sb), max(sc, sd));
			ans = min(ans, ma-mi);
		}
	}
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 2560
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline

def main():
    n = int(input())
    aa = list(map(int, input().split()))
    s0 = 0
    s = 0
    i0 = []
    ii = []
    for i, a in enumerate(aa):
        if a < 0: continue
        if i % 2:
            s += a
            ii += [i]
        else:
            s0 += a
            i0 += [i]
    # 正の数がなかった場合
    if not ii + i0:
        s = max(aa)
        print(s)
        print(n - 1)
        for i in range(n - 1, -1, -1):
            if aa[i] == s:
                break
            print(i + 1)
        for _ in range(i):
            print(1)
        exit()
    if s0 > s:
        s = s0
        ii = i0
    # print(s, ii)
    # 右削除
    ans = list(range(n - 1, ii[-1], -1))
    # 中心部連結
    for j in range(len(ii) - 2, -1, -1):
        l, r = ii[j], ii[j + 1]
        ans += list(range((l + r) // 2, l, -1))
    # 左削除
    ans += [0] * ii[0]
    # print(ans)
    print(s)
    print(len(ans))
    for a in ans:
        print(a + 1)

main()


Measured memory_bytes: 3316
#include <iostream>
#include <string>

using namespace std;

int main(){
    string s; cin >> s;
    int cntA = 0;
    long long res = 0;
    for(int i=0;i<s.size();i++){
        if(s[i] == 'A'){
            ++cntA;
        } else if(s[i] == 'B'){
            if(i+1 < s.size() && s[i+1] == 'C'){
                res += cntA;
                ++i;
            } else {
                cntA = 0;
            }
        } else {
            cntA = 0;
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 640
#define _USE_MATH_DEFINES // for C++  
#include "bits/stdc++.h"
#define NUM ((long long)1000000007)
#define int long long

using namespace std;

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

    int a, b;
    cin >> a >> b;
    if (a <= 8 && b <= 8)
    {
        cout << "Yay!" << endl;
    }
    else
    {
        cout << ":(" << endl;
    }
}

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

int main(){
  int n;
  cin>>n;
  if(n/10==9){
    cout<<"Yes"<<endl;
  }
  else if(n%10==9){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
vector<set<int> >ed;
vector<int> V;
vector<int> X;
vector<int> lc;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	ed.resize(N);
	V.resize(N, 0);
	X.resize(N, 0);
	lc.resize(N, 0);
	int res = 0;
	int a, b;
	for (int i = 0; i < N - 1; i++) {
		cin >> a >> b;
		ed[a].insert(b);
		ed[b].insert(a);
	}
	queue<int> qu;
	for (int i = 0; i < N; i++) {
		if ((int)ed[i].size() == 1) {
			qu.push(i);
			lc[*(ed[i].begin())]++;
		}
	}
	int nc;
	int k;
	while ((int)qu.size() > 0) {
		a = qu.front(); qu.pop();
		if (X[a] == 1)continue;
		//cerr << "a = " << a << endl;
		if ((int)ed[a].size() == 0)break;
		if ((int)ed[a].size() != 1)cerr << "ERROR" << endl;
		b = *(ed[a].begin());
		if ((int)ed[b].size() == 2) {
			//cerr << "E " << a << endl;
			X[a] = 1;
			ed[b].erase(a);
			qu.push(b);
			lc[*(ed[b].begin())]++;
			lc[b]--;
			V[b] = V[a];
		}
		else {
			nc = 0;
			if (lc[b] == (int)ed[b].size() - 1) {
				//cerr << b << endl;
				nc = lc[b] - 1;
				for (auto c : ed[b]) {
					if (ed[c].size() == 1) {
						X[c] = 1;
						if (V[c] == 1) {
							nc--;
						}
					}
					else {
						k = c;
					}
				}
				if (nc > 0) {
					res += nc;
				}
				ed[b].clear();
				ed[b].insert(k);
				qu.push(b);
				lc[*(ed[b].begin())]++;
				lc[b] = 0;
				V[b] = 1;
				//cerr << "res" << res << endl;
			}
			else if (lc[b] == (int)ed[b].size()) {
				//cerr << lc[b] << endl;
				if (lc[b] == 1) {
					//cerr << b << endl;
					if (V[b] == 0 || V[*(ed[b].begin())] == 0) {
						res++;
					}
				}
				else {
					nc = lc[b] - 1;
					for (auto c : ed[b]) {
						if ((int)ed[c].size() == 1) {

							X[c] = 1;
							if (V[c] == 1) {
								//		cerr << c << " ";
								nc--;
							}
						}
					}
					//cerr << endl;
					if (nc > 0) {
						res += nc;
					}
				}
				break;
			}
		}

	}
	cout << res << endl;
}

Measured memory_bytes: 17536
#import heapq
n,t = map(int,input().split())
ai = [int(i) for i in input().split()]


#rev_ai = [ai[n-1]*(-1)]

ans = [0,0]

max_ai = ai[n-1]

#heapq.heapify(rev_ai)
#print(rev_ai)
for i in range(1,n):
    #print(ai[n-1-i])
    dif = max_ai - ai[n-1-i]
    if dif > ans[0]:
        ans = [dif,1]
    elif dif == ans[0]:
        ans[1] += 1
    #print(rev_ai[0])
    #heapq.heappush(rev_ai,ai[n-1-i]*(-1))
    max_ai = max(max_ai,ai[n-1-i])

print(ans[1])

Measured memory_bytes: 62832
#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for(int i = (l)    ; i <  (r); ++i)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); --i)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); ++i)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define dec(i, n)  decID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define FR front()
#define BA back()
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
auto setmin   = [](auto & a, auto b) { return (b <  a ? a = b, true : false); };
auto setmax   = [](auto & a, auto b) { return (b >  a ? a = b, true : false); };
auto setmineq = [](auto & a, auto b) { return (b <= a ? a = b, true : false); };
auto setmaxeq = [](auto & a, auto b) { return (b >= a ? a = b, true : false); };
#define SI(v) static_cast<int>(v.size())
#define RF(e, v) for(auto & e: v)
#define until(e) while(! (e))
#define if_not(e) if(! (e))
#define ef else if
#define UR assert(false)
#define IN(T, ...) T __VA_ARGS__; IN_(__VA_ARGS__);
void IN_() { };
template<typename T, typename ... U> void IN_(T & a, U & ... b) { cin >> a; IN_(b ...); };
template<typename T> void OUT(T && a) { cout << a << endl; }
template<typename T, typename ... U> void OUT(T && a, U && ... b) { cout << a << " "; OUT(b ...); }

// ---- ----

int main() {
	IN(string, s);
	OUT(string(SI(s), 'x'));
}


Measured memory_bytes: 256
#include<stdio.h>
 int main(){
 	int a,b,c,j,h,y;
 	 scanf("%d %d %d",&a,&b,&c);
 	 if(a > b){
 	 	j = b;
 	 	b = a;
 	 	a = j;
 	 }
 	 if(a > c){
 	 	h = c;
 	 	c = a;
 	 	a = h;
 	 }
 	 if(c<b){
 	 	y = c;
 	 	c = b;
 	 	b = y;
 	 }
 	 printf("%d %d %d\n",a,b,c);
 	}

Measured memory_bytes: 1808
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define sim template < class c
#define int long long
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << '\n'; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef tree< pair<int,int>, null_type, less<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long ll;
const ll MOD = 1e9 + 7 ;
const ll N = 2e5 + 10 ;
const ll INF = 1e18 + 10 ;
signed main(){
    fastio
    int n , m ; 
    cin >> n >> m ;
    vector<pair<int,int> > edge(m) ;
    vector<int> cost(m) ;
    for(int i = 0; i < m; i++){
        cin >> edge[i].first >> edge[i].second ;
        edge[i].first--;
        edge[i].second--;
        cin >> cost[i] ;
    }
    vector<vector<int> > dist(n, vector<int>(n, INF));
    vector<vector<int> > next(n, vector<int>(n, -1));
    for(int i = 0; i < m; i++){
        int u = edge[i].first ;
        int v = edge[i].second ;
        dist[u][v] = cost[i] ;
        dist[v][u] = cost[i] ;
        next[u][v] = v ;
        next[v][u] = u ; 
    }
    for(int i = 0; i < n; i++){
        dist[i][i] = 0 ;
        next[i][i] = i ; 
    }
    for(int k = 0; k < n; k++){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if ( dist[i][j] > dist[i][k] + dist[k][j] ){
                    dist[i][j] = dist[i][k] + dist[k][j] ;
                    next[i][j] = next[i][k] ;
                }
            }
        }
    }
    set<pair<int,int> > s ;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if ( i == j ) continue ;
            int start = i ; 
            int end = j ;
            while(start != end){
                s.insert(make_pair(start, next[start][end])) ;
                s.insert(make_pair(next[start][end], start)) ;
                start = next[start][end] ;
            }
        }
    }
    int ans = 0 ;
    for(int e = 0; e < m; e++){
        if ( s.count(edge[e]) == 0 ) ans++ ;
    }
    cout << ans << endl;
    return 0; 
}

Measured memory_bytes: 3824
n,m,x=map(int,input().split())
a=[list(map(int,input().split())) for _ in range(n)]
ans=1e15
for f in range(1<<n):
  p,c=[0]*m,0
  for i in range(n):
    if f%2:
      p=list(map(lambda x,y:x+y,p,a[i][1:]))
      c+=a[i][0]
    f//=2
  if all(p[i]>=x for i in range(m)):
    ans=min(ans,c)
print(-1 if ans>=1e15 else ans)

Measured memory_bytes: 9224
import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n,k = map(int, input().split())
s = input()

ans = 0
cnt = 0
right = 1
for left in range(0, n):
    if left == 0 and s[left] == '0':
        cnt += 1

    if left > 0 and s[left] == '1' and s[left-1] == '0':
        cnt -= 1

    while right <= n - 1:
        if s[right] == '0' and s[right-1] == '1':
            if cnt < k:
                cnt += 1
            else:
                break
        right += 1

    ans = max(ans, right - left)

print(ans)


Measured memory_bytes: 9264
#include<iostream>
using namespace std;long long p[1<<17],N,Q,A,R,sum,cnt,i;main(){cin>>N>>Q;for(i=0;i<N;i++)cin>>p[i];while(Q--){sum=0,R=0;cin>>A;cnt=0;for(i=0;i<N;i++){while(R<N&&sum+p[R]<=A)sum+=p[R++];if(sum>0)sum-=p[i];cnt+=R-i;if(R<i+1)R=i+1;}cout<<cnt<<endl;}}

Measured memory_bytes: 1936
// In the name of god
#include <bits/stdc++.h>
#pragma GCC optimze("02")
using namespace std;
using ll =long long;
const ll  maxn=4e5+5;
ll  n,m,a[maxn],k;
bool b;
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin>>n>>m>>k;
	ll x=n;
	while(x<100009){
		if(x>=m&&x<=k){
			b=1;
		}
		x+=n;
	}
	if(b)cout<<"OK";
	else cout<<"NG";
}


Measured memory_bytes: 3612
using System;

namespace ITP1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();

            //Char?????????????????????
            char[] cs = s.ToCharArray();
            for (int i = 0; i < cs.Length; i++)
            {
                //??§??????????????????
                if (char.IsUpper(cs[i]))
                {
                    //?°????????????????
                    cs[i] = char.ToLower(cs[i]);
                }
                //?°???????????????????
                else if (char.IsLower(cs[i]))
                {
                    //??§???????????????
                    cs[i] = char.ToUpper(cs[i]);
                }
            }
            //String????????????
            string s2 = new string(cs);

            //???????????¨???
            Console.WriteLine(s2);
            

        }
    }
}

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

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

const ll INF = 1LL << 60;

int main(){
  ll n;
  cin >> n;
  ll a[1000000];
  FOR(i,n){
    cin >> a[i];
    a[i]-=i+1;
  }

  sort(a,a+n);

  ll b=a[n/2];
  ll ans=0;
  FOR(i,n){
    ans+=abs(a[i]-b);
  }

  cout << ans << endl;

}


Measured memory_bytes: 3840
#Stable Sort


#Swap???????????????????????????
def Swap(a, b)
    return b, a
end

#BubbleSort????????????
def BubbleSort(chars, numbers, length)
    for i in 0..length-1
        for j in i+1..length-1
            k = (i + 1) + (length - 1) - j
            if numbers[k] < numbers[k-1] then
                chars[k], chars[k-1] = Swap(chars[k], chars[k-1])
                numbers[k], numbers[k-1] = Swap(numbers[k], numbers[k-1])
            end
        end
    end
    #??????????????????????????????main?????????
    return chars, numbers
end

#SelectionSort????????????
def SelectionSort(chars, numbers, length)
    for i in 0..length-1
        mini = i
        for j in i..length-1
            if numbers[j] < numbers[mini] then
                mini = j
            end
        end
        chars[i], chars[mini] = Swap(chars[i], chars[mini])
        numbers[i], numbers[mini] = Swap(numbers[i], numbers[mini])
    end
    return chars, numbers
end

#????????????????????????????????¨?????????????????????
def PrintBubbleSort(chars, numbers, length)
    i = -1
    for i in 0..length-2
        print chars[i], numbers[i], " "
    end
    print chars[i+1], numbers[i+1], "\n"
    print "Stable\n"
end

#?????????????????????????????¨?????????????????????
def PrintSelectionSort(chars, numbers, bchars, bnumbers, length)
    i = -1
    flag = 0
    for i in 0..length-2
        print chars[i], numbers[i], " "
    end
    print chars[i+1], numbers[i+1], "\n"

    #????????????????????¨????????????????????????????????????????????§????????°Stable????????°?????£???????????°Not Stable?????¨????????????
    for i in 1..length-1
        #???????????°???????????????????????§?????°?????£????????????????????°???????????????????´¢??????????????????
        if numbers[i] != bnumbers[i-1] && chars[i] != bchars[i] then
            flag = 1
            break
        end
    end

    #????????°????????£????????£?????????????????°???Stable?????¨????????????
    if flag == 0 then
        print "Stable\n"
    else
        print "Not stable\n"
    end
end

#?????????????????°
chars = []
numbers = []
chars2 = []
numbers2 = []

length = readline.to_i

#??\?????????????????????????????????????´??????????
pair = gets.chomp.split(" ")

#??\????????????????????????????????¨??°???????????¢??????????????????????????????????´??????????
for i in 0..length-1
    #?????????????????±???(?????????)??¨??°???(?????????)????????¢??????
    chars[i], numChar = pair[i].split("")
    chars2[i], numChar2 = pair[i].split("")

    #??°???(?????????)?????°????????????
    numbers[i] = numChar.to_i
    numbers2[i] = numChar2.to_i
end

bchars, bnumbers = BubbleSort(chars, numbers, length)
PrintBubbleSort(bchars, bnumbers, length)

# ??????????????????????????¨?????????????????????????????????????????????????????????????????°??????????????????????????????????????????
schars, snumbers = SelectionSort(chars2, numbers2, length)
PrintSelectionSort(schars, snumbers, bchars, bnumbers, length)

Measured memory_bytes: 8756
#include<iostream>
#include<vector>
#include<algorithm>
int main()
{
	long long n, x;
	std::cin >> n >> x;
	std::vector<int>a(n);
	std::vector<std::vector<int>>minimum_time(n + 1, std::vector<int>(n));
	for (int i = 0; i < n; i++)
	{
		std::cin >> a[i];
		minimum_time[0][i] = a[i];
	}
	long long ans = 10000000000000000;
	for (int i = 0; i < n; i++)
	{
		long long sum = i * x;
		for (int j = 0; j < n; j++)
		{
			sum += minimum_time[i][j];
			minimum_time[i + 1][j] = std::min(minimum_time[i][j], minimum_time[i][(j - 1 + n) % n]);
		}
		if (ans > sum)
		{
			ans = sum;
		}
	}
	std::cout << ans << std::endl;
	return 0;
}

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

int a, b;

int main(void){
  // Here your code !
  scanf("%d %d", &a, &b);

  if (a + b == 15) {
    printf("+\n");
  }
  else if (a * b == 15) {
    printf("*\n");
  }
  else {
    printf("x\n");
  }

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a[3],temp;
    scanf("%d %d %d",&a[0],&a[1],&a[2]);
   int i,j;
   for(i=0;i<=1;i++)
   {
       for(j=0;j<=1;j++)
       {
           if(a[j+1]>a[j])
           {
               temp=a[j];
               a[j]=a[j+1];
               a[j+1]=temp;
           }
       }
   }
   int r;
   r=a[0]*10+a[1]+a[2];
  printf("%d\n",r);



    return 0;
}


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

int main()
{
    //while(1){
    int n,x,sum=0,cnt=0;
    cin>>n>>x;
    int m[n];
    for(int i=0; i<n; i++)
        cin>>m[i];
    sort(m,m+n);
    //int i=n;
    for(int i=0; i<n; i++)
    {
        sum+=m[i] ;
        if(sum<=x)
            cnt+=1;
        else
        {
            sum-=m[i];

            break;
        }
    }
    //cout<<sum<<"\t"<<cnt<<endl;
    while(sum<=x)
    {
        sum+=m[0];
        cnt+=1;
    }
    cout<<cnt-1<<endl;
    
    return 0;
}



Measured memory_bytes: 256
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>

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

using namespace std;

typedef long long ll;

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

int main(){
	for(int n;scanf("%d",&n),n;){
		static ll b[32000];
		int m=n*(n+1)/2;
		rep(i,m) scanf("%lld",b+i);

		int n_ev=0,n_od=0;
		static ll b_ev[250],b_od[32000];
		rep(i,m){
			if(b[i]%2==0) b_ev[n_ev++]=b[i];
			else          b_od[n_od++]=b[i];
		}

		sort(b_ev,b_ev+n_ev);
		sort(b_od,b_od+n_od);

		vector<ll> a0_cand;
		rep(j,n_ev) rep(i,j) {
			ll x=b_ev[i],y=b_ev[j],z=b_od[0],g;
			g=gcd(x,z); x/=g; z/=g;
			g=gcd(y,z); y/=g; z/=g;
			if(z==1){
				ll a0=(ll)(sqrt(x)*sqrt(y)+0.5);
				for(ll t=max(a0-1,2LL);t<=a0+1;t++){
					if(t%2==0 && t*t==x*y) a0_cand.push_back(t);
				}
			}
		}

		ll a0;
		static ll a_od[250];
		rep(i,a0_cand.size()){
			a0=a0_cand[i];

			rep(j,n) a_od[j]=b_ev[j]/a0;

			int n_od2=0;
			static ll b_od2[32000];
			rep(k,n_ev) rep(j,k) b_od2[n_od2++]=a_od[j]*a_od[k];
			sort(b_od2,b_od2+n_od2);

			bool ok=true;
			rep(j,n_od) if(b_od[j]!=b_od2[j]) { ok=false; break; }
			if(ok) break;
		}

		printf("%lld\n",a0);
		rep(i,n_ev) printf("%lld%c",a_od[i],i<n_ev-1?' ':'\n');
	}

	return 0;
}

Measured memory_bytes: 1704
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
#define ll          long long int
#define pb          push_back
#define pll         pair<ll,ll>
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mod         1000000007
#define inf         1000000000000000000LL
#define vl          vector<ll>
#define F           first
#define S           second
#define ld          long double
#define sz(x)       (ll)x.size()
#define fix(n)      cout<<fixed<<setprecision(n)
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define all(x)      x.begin(),x.end()
#define pi          3.14159265358979323

ll n, a, b, c, d;
string s;

bool ok(ll x, ll y)
{
       for(ll i=x; i<y; i++)
       {
              if(s[i]=='#' && s[i+1]=='#') return 0;
       }
       return 1;
}

bool good(ll x, ll y)
{
  for(ll i=x; i<=y; i++)
  {
    if(s[i-1]=='.' && s[i]=='.' && s[i+1]=='.')
      return 1;
  }
  return 0;
}


void solve()
{
       cin>>n>>a>>b>>c>>d>>s;
       a--, b--, c--, d--;
       if(ok(a,c)&&ok(b,d))
       {
         if(d>c||good(b,d))
         {
           cout<<"Yes\n";
           return;
         }
       }
  		cout<<"No\n";
}

int main()
{
       speed_up;
       //pre();
       ll T=1;
       //cin>>T;
       while(T--) solve();
	return 0;
}


Measured memory_bytes: 592
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a;
    cin>>a;
    for(int i=1;i<=9;i++){
            if(a%i==0 && a/i<=9 && a/i>=1){
                    cout << "Yes" <<endl;
                    return 0;
            }
    }
     cout << "No" <<endl;
            return 0;
}


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


#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)

 
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define rrep(i,r,l) for(ll i=r;i>=l;i--)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-12;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"  //インタラクティブで消す！！！！！！！！！！！！！！！！！！！！！
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

void mod_print(ll k){
    ll P=50000;
    rep(y,1,P){
        ll x=mod(y*k);
        
        if(abs(x)<=P||x+P>=i_7){
            if(x+P>=i_7){
                x-=i_7;
            }
            cout<<x<<"/"<<y<<endl;
            //cout<<setprecision(5)<<(dd)x/(dd)y;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
typedef vector<ll> vl;
//////////////////////////

LL x,k,d;
LL cal(LL n){
    LL m=k-n;
    if(n<0||n>k)return inf;
    if(m<0||m>k)return inf;
    return abs(x-n*d+m*d);
}

int main(){fastio
    inf=2e18;
    cin>>x>>k>>d;
    LL lb=0,rb=k;
    while(lb+2<rb){
        LL l=(lb*2+rb)/3;
        LL r=(lb+rb*2)/3;
        if(cal(l)>cal(r)){
            lb=l;
        }else{
            rb=r;
        }
    }
    LL ans=inf;
    rep(z,(ll)lb-2,(ll)rb+2){
        chmin(ans,cal(z));
    }
    cout<<ans<<endl;
    
    return 0;
}



Measured memory_bytes: 3752
#include <stdio.h>

int main() {
    int n, m;
    
    scanf("%d %d", &n, &m);
    
    int par = 0, imp = 0;
    
    for (int i = 1; i < n; ++i)
        par += i;
    for (int i = 1; i < m; ++i)
        imp += i;
        
    printf("%d\n", par+imp);

    return 0;
}


Measured memory_bytes: 128
#include<cmath>
#include<cstdlib>
#include<string>
#include<sstream>
#include<vector>
#include<iostream>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<algorithm>
using namespace std;

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

    if(D == 0){
        if(N == 100) cout << 101 << endl;
        else cout << N << endl;
    }
    else if(D == 1){
        if(N == 100) cout << 10100 << endl;
        else cout << N * 100 << endl;
    }
    else if(D == 2){
        if(N == 100) cout << 1010000 << endl;
        else cout << N * 10000 << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll,ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout<<endl;
void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); }
const long long INFll=1ll*INF*INF;
const long double PI=3.141592653589793238462643383279502884197169399375105820974944;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define debug(x) cout << x << endl;
#define sz(a) int((a).size())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
 
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
long long genrand(long long L,long long R)
{
	return uniform_int_distribution<long long>(L, R)(rng);
}
//use brackets before operations if taking MOD
//use map only when necessary
//give long long to arrays and variables properly
int mul(int a, int b,int mod = MOD) {
	return int(a * 1ll * b % mod);
}
int norm(int a,int mod = MOD) {
	while(a >= mod) a -= mod;
	while(a < 0) a += mod;
	//a = (a%mod+mod)%mod;
	return a;
}
int powmod(int x,int y,int mod = MOD){
	int res = 1;
	while(y>0)
	{
		if(y&1)
			res = mul(res,x,mod);
		x = mul(x,x,mod);
		y=y>>1;
	}
	return res;
}
int inv(int a,int mod = MOD) {
	return powmod(a, mod - 2);
}
int main() {
	fast();

	long long n,k; cin>>n>>k;
	long long q = n/k, ans = n;
	for(long long i = q+1; i>=q-1;i--){
		long long now = abs(n - i*k);
		ans = min(ans, now);
	}
	cout<<ans<<endl;

	return 0;
}

Measured memory_bytes: 256
package main

import (
    "fmt"
    "os"
    "bufio"
)

func main() {
    var fp *os.File = os.Stdin
    reader := bufio.NewReaderSize(fp, 1024)

    S := readLine(reader)
    m := map[string]int{}
    retval := "yes"

    for _, v := range S {
        if _, isset := m[string(v)]; isset == false {
            m[string(v)] = 1
        } else {
            retval = "no"
            break
        }
    }

    fmt.Println(retval)
}

func readLine(reader *bufio.Reader) string {
    buf := make([]byte, 0, 1024)

    for {
        l, p, _ := reader.ReadLine()

        buf = append(buf, l...)

        if !p {
            break
        }
    }

    return string(buf)
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define pr(a) cout << (a) << endl
typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000000;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int main() {
  int p[8];
  while(cin >> p[0]) {
    for(int i=1; i<8; i++) cin >> p[i];
    int mi=MAX;
    string ans="";
    int c[8]={1,4,1,4,1,2,1,2};
    for(int i=0; i<8; i++) {
      int sum=0;
      string a="";
      for(int j=0; j<8; j++) {
	a+=(char)(c[(i+j)%8]+'0');
	sum+=max(0,c[(i+j)%8]-p[j]);
      }
      if(mi>=sum) {
	if(mi==sum) ans=min(ans,a);
	else ans=a;
	mi=sum;
      }
    }
    rep(i,8) {
      if(i) cout << " ";
      cout << ans[i];
    }
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 1208
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

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

string ntos(int n)
{
    int t;
    string ans, p = "0";
    while(1)
    {
        t = n % 10;
        p[0] = '0'+t;
        ans = p + ans;
        n /= 10;
        if(n == 0) break;
    }
    return ans;
}

string s, next;
int n, l, cnt;
char now;
int main()
{
    while(cin >> n && n)
    {
        string ans;
        cin >> s;

        REP(n)
        {
            ans ="";
            cnt = 1;
            l = s.size();
            now = s[0];
            for(int j = 1;j<l;j++)
            {
                if(now == s[j]){ cnt++; continue;}
                
                ans = ans + ntos(cnt) + ntos((int)(now - '0'));
                cnt = 1;
                now = s[j];
            }
            if(cnt>0)ans = ans + ntos(cnt) + ntos((int)(now - '0'));
            s = ans;
        }
        cout << s << endl;
    }

    return 0;
}

Measured memory_bytes: 1132
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#define endl '\n'
#define pb push_back
#define int long long 
#define all(a) (a).begin(),(a).end()
#define F first
#define S second
typedef long long ll; 
typedef long double ld; 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
#define fast_cin ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); 
const int mod = 1000000007; 
const ll inf = 2e18;
#define rep(i,a,b)  for(int i=a;i<b;i++) 
int hcf(int a, int b) {if (b == 0)return a;return hcf(b, a % b);}
#define bc(n) __builtin_popcountll(n)
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << endl;}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}
#else
#define trace(...)
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int modp(int base,int exponent,int mod) { 
	int ans=1;
	while(exponent!=0) {
		if(exponent&1) ans=(1LL*ans*base)%mod;
		base=(1LL*base*base)%mod;
		exponent>>=1;
	}
	return ans%mod;
}
// transform(all(s),s.begin(),::tolower);
// memset(prime,true,sizeof(prime)); 
// reverse(str.begin(),str.end());
// size_t found = str.find(c);  if (found != string::npos){ #present } else {  } 
// set<int> st; st.count(a);
// if (std::count(v.begin(),v.end(),key))
// (*max_element(a,a+n)) (*max_element(all(vec)))
// if(m[a[i]]==0) {m.erase(a[i]);}
// to_string(integervalue);
// map,set,vector,deque,queue,stack
// bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) { return (a.second < b.second); } 
// (lower_bound(all(v),x)-v.begin())
// (upper_bound(all(v),x)-v.begin())
const int N = 200005; 
void solve() {
	int n ; 
	cin>>n;
	if(n&1) {
		cout<<((n-1)/2);
	}
	else {
		cout<<((n-2)/2);
	}
}
int32_t main() {
	fast_cin;
	srand(chrono::steady_clock::now().time_since_epoch().count());
	#ifndef ONLINE_JUDGE
        // freopen("input.txt","r",stdin);
        // freopen("output.txt","w",stdout);
    	#endif
	cout<<fixed<<setprecision(10); 
	int t=1;
	//cin>>t;
	while(t--) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 256
n = gets.strip.split.map(&:to_i)
k = gets.to_i

k.times do |i|
  if n[0] >= n[1]
    x = n[1]
    x = x*2
    n[1] = x
  elsif n[1] >= n[2]
    x = n[2]
    x = x*2
    n[2] = x
  end
  if n[0] < n[1] && n[1] < n[2]
    puts "Yes"
    exit
  end
end

puts "No"
  

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

int main(){
	int input;
	char num[10];
	while(cin >> input, input){
		sprintf(num, "%o", input);

		for(int i=0; i < 10; i++){
			if(num[i] == '4') num[i] = '5';
			else if(num[i] < '4') continue;
			else num[i] += 2;
		}
		cout << num << endl;
	}
}

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

int N;
std::string S;
int main() {
    std::cin >> N;
    std::cin >> S;

    int left = 0, depth = 0;
    for(int i=0; i<N; ++i) {
        char c = S[i];
        if(c == '(') {
            ++depth;
        }
        if(c == ')') {
            if(depth <= 0) {
                ++left;
            } else {
                --depth;
            }
        }
    }
    for(int i=0; i<left; ++i) {
        std::cout << "(";
    }
    std::cout << S;
    for(int i=0; i<depth; ++i) {
        std::cout << ")";
    }
    std::cout << std::endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

const int MOD_TYPE = 1;
const ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
const int INF = (int)1e9;
const ll LINF = (ll)4e18;
const ld PI = acos(-1.0);
const ld EPS = 1e-11;

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#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 Yay(n) cout << ((n) ? "Yay!" : ":(") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << endl;

vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(30) << setiosflags(ios::fixed);

  int n, m;
  cin >> n >> m;
  int d[30][30];
  rep(i, m) rep(j, m) cin >> d[i][j];
  int cnt[3][30] = {};
  rep(i, n) rep(j, n)
  {
    int c;
    cin >> c;
    c--;
    cnt[(i + j) % 3][c]++;
  }
  vector<int> p;
  rep(i, m - 3) p.push_back(0);
  p.push_back(1);
  p.push_back(2);
  p.push_back(3);
  ll Min = LINF;
  do
  {
    int index[3];
    rep(i, m)
    {
      if (p[i] != 0)
      {
        index[p[i] - 1] = i;
      }
    }
    ll sum = 0;
    rep(i, 3)
    {
      rep(j, m)
      {
        sum += cnt[i][j] * d[j][index[i]];
      }
    }
    Min = min(Min, sum);
  } while (NP(p));
  cout << Min << endl;
  return 0;
}


Measured memory_bytes: 256
n, a, b, c, d = map(int, input().split())
s = "#"+input()
#print(s)

if ("##" in s[a:c+1]) or ("##" in s[b:d+1]):
    print("No")
elif not("##" in s[a:c+1]) and not("##" in s[b:d+1]) and c < d:
    print("Yes")
else:
    if s[b-1] == "." and s[b+1] == ".":
        print("Yes")
    elif "..." in s[b:d+1] or (s[d-1] == "." and s[d+1] == "."):
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 3636
N, M, C = map(int, input().split())
b = list(map(int, input().split()))
codes = [list(map(int, input().split())) for _ in range(N)]

res = 0
for code in codes:
    s = C
    
    for i in range(M):
        s += (code[i] * b[i])

    if s > 0:
        res += 1

print(res)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
typedef long long ll;

vector<ll> v(303030);
ll n,k,m,x,y;
string s,t;

int main() {
  cin >> s;
  int ans=s[0]-'0'; bool ok=true;
  rep(i,(int)s.size()-1){
    if(s[i+1]!='9') ok=false; 
    ans+=9;
  }
  if(!ok) ans--;
  cout <<  ans << endl;
}

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

int main(){
    int x; cin >> x;
    int max_res=0;
    for(int i=0; i<=1000; i++){
        for(int j=2; j<=1000; j++){
            int tmp = pow(i, j);
            if(tmp <= x && tmp > max_res)
                max_res = tmp;
            if(tmp > x) break;
        }
    }
    cout << max_res << endl;
    return 0;
}

Measured memory_bytes: 4028
package main

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

const mod = int(1e9 + 7)

func main() {
	var n int
	fmt.Scan(&n)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	var sum int
	as := make([]int, n)
	for i := range as {
		sc.Scan()
		as[i], _ = strconv.Atoi(sc.Text())
		sum += as[i]
		sum %= mod
	}

	var ans int
	for i := 0; i < n-1; i++ {
		sum -= as[i]
		if sum < 0 {
			sum += mod
		}
		ans += as[i] * sum
		ans %= mod
	}

	fmt.Println(ans)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

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


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

void connect(ll n, vector<pair<ll, ll>> &edges, ll total) {
  ll cnt = 0;
  for (ll i = 1; i < n - 1; i++) {
    for (ll j = i + 1; j < n; j++) {
      if (cnt == total) return;
      edges.push_back(make_pair(i, j));
      cnt++;
    }
  }
}

int main() {
  ll n, k;
  cin >> n >> k;

  ll kmax = (n - 1) * (n - 2) / 2;
  if (k > kmax) {
    cout << -1 << endl;
    return 0;
  }

  vector<pair<ll, ll>> edges;
  for (ll i = 1; i < n; i++) {
    edges.push_back(make_pair(0, i));
  }

  connect(n, edges, kmax - k);

  cout << edges.size() << endl;
  for (auto edge : edges) {
    cout << edge.first + 1 << " " << edge.second + 1 << endl;
  }
}

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

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000000000000007LL
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int n,a[200005],dp[200005][4][2];
bool vis[200005][4][2];
int go(int pos,int cnt,int last){
	if(cnt<-1) return -hell;
	if(pos==n) return 0;
	if(vis[pos][cnt+2][last]) return dp[pos][cnt+2][last];
	vis[pos][cnt+2][last]=1;
	int &ans=dp[pos][cnt+2][last];
	ans=go(pos+1,cnt-1,0);
	if(last==0) ans=max(ans,go(pos+1,cnt+1,1)+a[pos]);
	return ans;
}
void solve(){
    cin>>n;
    rep(i,0,n) cin>>a[i];
    cout<<go(0,n%2,0)<<endl;
}

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

Measured memory_bytes: 34900
#include "bits/stdc++.h"

using namespace std;
using LL = long long;

int main() {
    int n;
    scanf("%d", &n);

    vector< int> v(n);

    bool allZero = true;
    for (int &i : v) {
        scanf("%d", &i);
        if (i > 0) allZero = false;
    }

    if (allZero) return 0 * puts("Yes");
    if (n % 3) return 0 * puts("No");

    set< int> st;
    int cnt0 = 0;
    for (const int &x : v) {
        if (x > 0) st.insert(x);
        else cnt0 ++;
    }

    if (cnt0 == n / 3 and st.size() == 1) return 0 * puts("Yes");
    if (st.size() == 3) {
        int s = 0;
        int cnt = 0;
        for (const int& x : st) {
            cnt = 0;
            s ^= x;
            for (const int &a : v) if (x == a) cnt ++;
            if (cnt != n / 3) return 0*puts("No");
        }

        if (s == 0) puts("Yes");
        else puts("No");
    }
    else
        puts("No");
}

Measured memory_bytes: 4224
object Main extends App {
  solve2

  private def solve2: Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    sc.nextLine
    var s = sc.nextLine.toCharArray


    var wCount = 0
    var eCount = s.tail.count(_ == 'E')
    var ans = eCount
    for (i <- 1 until n) {
      if (s(i - 1) == 'W') {
        wCount += 1
      }
      if (s(i) == 'E') {
        eCount -= 1
      }
      ans = math.min(ans, wCount + eCount)
    }
    println(ans)

  }


  private def solve1: Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    sc.nextLine
    var s = sc.nextLine.toCharArray

    var ans = 1001001001
    for (i <- 0 until n) {
      val sum = s.slice(0, i).count(_ == 'W') + s.slice(i + 1, n).count(_ == 'E')
      ans = math.min(ans, sum)
    }
    println(ans)

  }
}


Measured memory_bytes: 35852
import sys
N = int(input())
if N == 1:
    print(0)
    sys.exit()

C = {}
for i in range(2, max(10, int(N**(0.5))+1)):
    while(N % i == 0):
        N = N//i
        if i not in C:
            C[i] = 1
        else:
            C[i] += 1

if len(C) == 0:
    print(1)
    sys.exit()

ans = 0
for i in C.values():
    s = 1
    while(True):
        i -= s
        if i < 0:
            break
        ans += 1
        s += 1
if N == 1:
    print(ans)
else:
    print(ans+1)

Measured memory_bytes: 63680
#include <iostream>

using namespace std;

int main(){
	int r, D, x_2000;

	cin >> r >> D >> x_2000;

	int current = x_2000;
	for(int i = 0; i < 10; ++i){
		current *= r;
		current -= D;
		cout << current << endl;
	}
}

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

void _150() {
    string s;
    cin >> s;

    if ((s == "AAA") || (s == "BBB"))
        cout << "No" << endl;
    else
        cout << "Yes" << endl;
}

void _156() {
    int n, r;
    cin >> n >> r;

    if (n >= 10)
        cout << r << endl;
    else
        cout << r + 100 * (10 - n) << endl;
}

void _155() {
    int a, b, c;
    cin >> a >> b >> c;

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

void _154() {
    string s, t, u;
    int a, b;
    cin >> s >> t;
    cin >> a >> b;
    cin >> u;

    if (s ==u)
        cout << a - 1 << " " << b << endl;
    else
        cout << a << " " << b - 1 << endl;
}

void _153() {
    int h, a;
    cin >> h >> a;

    // int times = h / a;
    // if (times % a == 0)
    //     cout << times << endl;
    // else
    //     cout << times + 1 << endl;
    cout << (h + a - 1) / a << endl;
}

void _152() {
    int n, m;
    cin >> n >> m;

    if (m == n)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

void _151() {
    char c;
    cin >> c;
    cout << (char)(c + 1) << endl;
}

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



Measured memory_bytes: 256