akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"

// Begin {{{
using namespace std;
#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, b, e) for (i64 i = (b), i##_limit = (e); i <= i##_limit; ++i)
#define repr(i, b, e) for (i64 i = (b), i##_limit = (e); i >= i##_limit; --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T> using MaxHeap = priority_queue<T>;
template <class T> using MinHeap = priority_queue<T, vector<T>, greater<>>;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
inline i64 sigma(i64 n) { return n * (1 + n) >> 1; }
inline i64 updiv(i64 n, i64 d) { return (n + d - 1) / d; }
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;
#ifndef DEBUG
#define dump(...)
#endif

inline void input() {}
template <class Head, class... Tail>
inline void input(Head&& head, Tail&&... tail) {
    cin >> head;
    input(forward<Tail>(tail)...);
}

inline void outs() { cout << "\n"; }
template <class Head, class... Tail>
inline void outs(Head&& head, Tail&&... tail) {
    cout << head << (sizeof...(tail) ? " " : "");
    outs(forward<Tail>(tail)...);
}

template <class T>
inline void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e == &vec.back()]; }

template <class T>
inline void outs(vector<vector<T>> &df) { for (auto &vec : df) outs(vec); }

inline void outl() { cout << "\n"; }
template <class Head, class... Tail>
inline void outl(Head&& head, Tail&&... tail) {
    cout << head << (sizeof...(tail) ? "\n" : "");
    outl(forward<Tail>(tail)...);
}

template <class T>
inline void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

inline void outn() {}
template <class Head, class... Tail>
inline void outn(Head&& head, Tail&&... tail) {
    cout << head;
    outn(forward<Tail>(tail)...);
}

template <class T>
inline void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

template <class T>
inline vector<T> make_v(const T &initvalue, size_t sz) {
    return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initvalue, args...))>(sz, make_v<T>(initvalue, args...));
}
// }}} End

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    var(int, n, m);
    vector<i64> x1(n), y1(n);
    rep(i, n) {
        input(x1[i], y1[i]);
    }
    vector<i64> x2(m), y2(m);
    rep(i, m) {
        input(x2[i], y2[i]);
    }
    rep(i, n) {
        i64 minv = LINF;
        rep(j, m) {
            chmin(minv, abs(x1[i] - x2[j]) + abs(y1[i] - y2[j]));
        }
        rep(j, m) {
            if (abs(x1[i] - x2[j]) + abs(y1[i] - y2[j]) == minv) {
                outl(j + 1);
                break;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
mo=10**9+7
n,m=map(int,input().split())
s=[0]+[int(i) for i in input().split()]
t=[0]+[int(i) for i in input().split()]
dp=[[0]*(1+n) for i in range(1+m)]
sm=[[0]*(1+n) for i in range(1+m)]

for i in range(1,1+m):
    if t[i]==s[1]:
        dp[i][1]=1
    sm[i][1]=sm[i-1][1]+dp[i][1]%mo

for i in range(1,1+n):
    if s[i]==t[1]:
        dp[1][i]=1
    sm[1][i]=sm[1][i-1]+dp[1][i]%mo

for i in range(2,1+m):
    for j in range(2,1+n):
        dp[i][j]=1+sm[i-1][j-1] if t[i]==s[j] else 0
        sm[i][j]=dp[i][j]+sm[i-1][j]+sm[i][j-1]-sm[i-1][j-1]
        sm[i][j]%=mo

print(1+sm[m][n]%mo)

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  ll N, A, B;cin >> N >> A >> B;
  ll result = N/(A+B) * A + min(A, N%(A+B));
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
char str[1010][1010];
vector<pair<int,int> > pc[5];
int dp[6][1010];
int ABS(int a){return max(a,-a);}
int main(){
    int a,b;
    while(scanf("%d%d",&b,&a),a){
        for(int i=0;i<a;i++)scanf("%s",str[i]);
        for(int i=0;i<5;i++)pc[i].clear();
        int sr,sc,gr,gc;
        for(int i=0;i<a;i++)for(int j=0;j<b;j++){
            if(str[i][j]=='S'){sr=i;sc=j;}
            else if(str[i][j]=='G'){gr=i;gc=j;}
            else if(str[i][j]!='.'){
                pc[str[i][j]-'1'].push_back(make_pair(i,j));
            }
        }
        int ret=999999999;
        int at=0;
        for(int i=0;i<5;i++){
            for(int j=0;j<5;j++)for(int k=0;k<1010;k++)dp[j][k]=999999999;
            for(int j=0;j<pc[(i+1)%5].size();j++){
                dp[0][j]=ABS(pc[(i+1)%5][j].first-sr)+ABS(pc[(i+1)%5][j].second-sc);
            }
            for(int j=0;j<3;j++){
                for(int k=0;k<pc[(i+j+1)%5].size();k++){
                    for(int l=0;l<pc[(i+j+2)%5].size();l++){
                        dp[j+1][l]=min(dp[j+1][l],dp[j][k]+ABS(pc[(i+j+2)%5][l].first-pc[(i+j+1)%5][k].first)+ABS(pc[(i+j+2)%5][l].second-pc[(i+j+1)%5][k].second));
                    }
                }
            }
            int tmp=999999999;
            for(int j=0;j<pc[(i+4)%5].size();j++)tmp=min(tmp,dp[3][j]+ABS(pc[(i+4)%5][j].first-gr)+ABS(pc[(i+4)%5][j].second-gc));
            if(ret>tmp){ret=tmp;at=i;}
        }
        if(ret>99999999)printf("NA\n");
        else printf("%d %d\n",at+1,ret);
    }
}


Measured memory_bytes: 3656
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: String,
    }
    let mut num: i32 = 0;
    let n_number: i32 = n.parse().unwrap();
    for c in n.chars() {
        let digit = c as i32 - '0' as i32;
        num += digit;
    }
    if n_number % num == 0 {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
a, b = input().split()
lis = []
for x in range(int(a)+1):
  for y in range(int(a)+1-x):
    z = int(a) - x - y
    if 1000 * x + 5000 * y + 10000 * z == int(b) and x + y + z == int(a):
      lis.append("{} {} {}".format(z, y, x))
      print("{} {} {}".format(z, y, x))
      exit()
if len(lis) == 0:
  print("-1 -1 -1")

Measured memory_bytes: 3188
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>

#define For(i, j, k) for(int i = j; i <= k; i++)
#define Forr(i, j, k) for(int i = j; i >= k; i--)
#define pb push_back

using namespace std;

const int N = 100010;

int n, k, m;
int A[N], B[N], ret[35];

int main(){
	scanf("%d%d", &n, &k);
	For(i, 1, n) scanf("%d%d", &A[i], &B[i]);
	ret[++m] = k;
	Forr(i, 29, 0){
		if(k < (1 << i)) continue;
		if(k & (1 << i)) ret[++m] = (k ^ (1 << i)) | ((1 << i) - 1);
	}
	long long ans = 0;
	For(i, 1, m){
		long long sum = 0;
		For(j, 1, n) if((A[j] | ret[i]) == ret[i]) sum += B[j];
		if(sum > ans) ans = sum;

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

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

int main()
{
	int n, d, m = 0;
	int x[10][10];

	cin >> n >> d;

	for (int i = 0; i < n; i++)
		for (int j = 0; j < d; j++)
			cin >> x[i][j];

	for (int a = 0; a < n - 1; a++) {
		for (int b = a + 1; b < n; b++) {
			int g = 0;
			bool f = 1;

			for (int j = 0; j < d; j++)
				g += (x[a][j] - x[b][j]) * (x[a][j] - x[b][j]);

			while (f && g > 1) {
				int u = 2;

				while (f && u <= g) {
					while (g % u == 0) {
						if (g % (u * u) == 0)
							g /= u * u;
						else {
							f = 0;
							break;
						}
					}

					u++;
				}
			}

			if (f)
				m++;
		}
	}

	cout << m << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
typedef pair<int,int> pii;
queue<int>q;
int ver[3009*2],edge[5009*2],nxt[5009*2],head[3009],tot=0;
ll d[3009];int v[3009];
void add(int x,int y,int z)
{
    ver[++tot]=y;edge[tot]=z;nxt[tot]=head[x];head[x]=tot;
}
int ban[3009],cntru[3009];
int dfsv[3009];
int n,m,p;
void spfa()
{
    memset(d,0xcf, sizeof(d));
    memset(v,0, sizeof(v));
    d[1]=0;v[1]=1;
    q.push(1);
    while(q.size())
    {
        int x=q.front();q.pop();
        v[x]=0;
        for(int i=head[x];i;i=nxt[i])
        {
            int y=ver[i],z=edge[i];
            if(ban[y])continue;
            if(d[y]<d[x]+z){
                d[y]=d[x]+z;
                if(!v[y]){
                    cntru[y]=cntru[x]+1;
                    if(cntru[y]>=n){
                        puts("-1");
                        exit(0);
                    }
                    q.push(y),v[y]=1;
                }
            }
        }
    }
    cout<<max(0ll,d[n])<<endl;
}
int dfs(int x){
    if(dfsv[x])return 0;
    if(x==n)return 1;
    dfsv[x]=1;
    for(int i=head[x];i;i=nxt[i]){
        if(dfs(ver[i]))return 1;
    }
    return 0;
}
int main()
{
    scanf("%d%d%d",&n,&m,&p);
    for(int i=1;i<=m;i++){
        int u,vx,vv;scanf("%d%d%d",&u,&vx,&vv);
        add(u,vx,vv-p);
    }
    for(int i=1;i<=n;i++){
        memset(dfsv,0,sizeof(dfsv));
        if(!dfs(i))ban[i]=1;
    }
    spfa();
    return 0;
}



Measured memory_bytes: 384
from collections import deque
N = int(input())
edges=[[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    edges[a].append((b, i))
    edges[b].append((a, i))

next_set = deque([(0,0)])
colors = [0]*(N-1)
while next_set:
    p, i = next_set.popleft()
    cnt = 1 if colors[i] != 1 else 2
    for q, j in edges[p]:
        if colors[j] != 0:
            continue
        colors[j] = cnt
        cnt += 1
        if cnt == colors[i]:
            cnt += 1
        next_set.append((q, j))
print(max(colors))
print(*colors, sep="\n")


Measured memory_bytes: 96876
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int l = sc.nextInt();

        int sum = 0;
        for(int i = l; i < l + n; i++){
            sum += i;
        }
        
        if(l < 0 && (l + n - 1) <= 0){
            sum -= (l + n - 1);
        } else if(l >= 0 && (l + n - 1) > 0){
            sum -= l;
        }

        System.out.println(sum);
    }
}

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

int main(){
    char s[4];
    cin >> s;
    if(s[0]=='a'){
        if(s[1]=='b' && s[2]=='c'){
            cout << "Yes\n";
            return 0;
        }
        if(s[1]=='c' && s[2]=='b'){
            cout << "Yes\n";
            return 0;
        }
    }
    if(s[0]=='b'){
        if(s[1]=='a' && s[2]=='c'){
            cout << "Yes\n";
            return 0;
        }
        if(s[1]=='c' && s[2]=='a'){
            cout << "Yes\n";
            return 0;
        }
    }
    if(s[0]=='c'){
        if(s[1]=='b' && s[2]=='a'){
            cout << "Yes\n";
            return 0;
        }
        if(s[1]=='a' && s[2]=='b'){
            cout << "Yes\n";
            return 0;
        }
    }
    cout << "No\n";
    return 0;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n,m=LI()
  l1=[]
  l2=[]
  for i in range(m):
    a,b=LI()
    l1.append(a)
    l2.append(b)

  l1.sort()
  l2.sort()

  if l1[-1]>l2[0]:
    print(0)
  else:
    print(l2[0]-l1[-1]+1)

main()
# print(main())


Measured memory_bytes: 13872
#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 <cassert>
#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;

int32_t N;
std::string name[100000];
int64_t t[10000];

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

	in >> N;
	std::string X;
	for (size_t i = 0; i < N; i++)
	{
		in >> name[i] >> t[i];
	}
	in >> X;
	size_t i = 0;
	for (; i < N; i++)
	{
		if (name[i] == X) { ++i; break; }
	}
	int64_t resv = 0;
	for (; i < N; i++)
	{
		resv += t[i];
	}
	out << resv << endl;



	return 0;
}
#endif


Measured memory_bytes: 3192
s = input()
n = len(s)

def isKaibun(s, length):
    flag = True
    if length == 2:
        counter = 1
    else:
        counter = round((length-1)/2)
    for i in range(counter):
        # print(s[i], s[length - 1 - i])
        if s[i] != s[length-1-i]:
            flag = False
            break
    return flag



orta = int((n+1)/2)-1

if isKaibun(s, n) and isKaibun(s[:orta], orta) and isKaibun(s[orta+1:], orta):
    print("Yes")
else:
    print("No")

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

#ifdef _DEBUG
    #include "/home/v-o_o-v/deb.h"
    #define deb(x...)cerr << "[" << #x << "] = [";_print(x);
#else
    #define deb(x...)
#endif

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using ll = long long;

void a();void b();void c();void d();void e();void f();

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
   
    // a();
    // b();
    c();
    // d();
    // e();
    // f();
    return 0;
}
// Write Here

void a(){
    int n;
    cin >> n;
    int amt = 0;
    while(amt < n)amt += 1000;
    cout << amt - n << '\n';
}

void b(){
    int n;
    cin >> n;
    map<string, int> m;
    while(n--){
        string s;
        cin >> s;
        m[s]++;
    }
    string a[] = {"AC", "WA", "TLE", "RE"};
    for(int i = 0; i < 4; i++)cout << a[i] << " x " << m[a[i]] << '\n';
}

void c(){
    int h, w, k;
    cin >> h >> w >> k;
    char grid[h][w];
    for(int i = 0; i < h; i++)
        for(int j = 0; j < w; j++)cin >> grid[i][j];
    
    int ans = 0;
    
    for(int i = 0; i < (1 << h); i++){
        for(int j = 0; j < (1 << w); j++){
            char a[h][w];
            for(int x = 0; x < h; x++)
                for(int y = 0; y < w; y++)a[x][y] = grid[x][y];
            for(int x = 0; x < h; x++){
                if(i & (1 << x)){
                    for(int y = 0; y < w; y++)a[x][y] = '.';
                }
            }
            for(int y = 0; y < w; y++){
                if(j & (1 << y)){
                    for(int x = 0; x < h; x++)a[x][y] = '.';
                }
            }

            int cnt = 0;
            for(int x = 0; x < h; x++){
                for(int y = 0; y < w; y++){
                    if(a[x][y] == '#')cnt++;
                    // cerr << a[x][y];
                }
                // cerr << '\n';
            }
            if(cnt == k)ans++;
        }
    }

    cout << ans << '\n';
}

void d(){
    // int n;
    // cin >> n;
    // vector<ll> a(n);
    // for(int i = 0; i < n; i++)cin >> a[i];
    // ll ans = 0;
    // sort(all(a));
    // reverse(all(a));
    // ans += a[0];
    // for(int i = 2; i < n; i++)ans += min(a[i - 1], a[i - 2]);
    // cout << ans << '\n';
}

void e(){

}

void f(){

}

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

int max(int a,int b)
{
    if(a>b)
        return a;
    else
        return b;
}
int min(int a,int b)
{
    if(a>b)
        return b;
    else
        return a;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,l;
    cin>>n;
    int a=0,w=0,t=0,r=0;
    while(n--)
    {
        string s;
        cin>>s;
        if(s[0]=='A')
            a++;
        else if(s[0]=='W')
            w++;
        else if(s[0]=='T')
            t++;
        else
            r++;
    }
    cout<<"AC x "<<a<<"\nWA x "<<w<<"\nTLE x "<<t<<"\nRE x "<<r;

}





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

int main()
{
    ll A; cin >> A;
    long double B; cin >> B;
    ll ans = A * B * 100.0 + 0.4;
    cout << ans / 100 << endl;


}


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

int main() {
  int n;
  cin>>n;
  long long int a[n],sum1=0,sum2=0,cost1=0,cost2=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum1+=a[i];
    sum2+=a[i];
    if(i%2==0 && sum1>=0){
      cost1+=1+sum1;
      sum1=-1;
    }
    else if(i%2==1 && sum1<=0){
      cost1+=1-sum1;
      sum1=1;
    }
    if(i%2==0 && sum2<=0){
      cost2+=1-sum2;
      sum2=1;
    }
    else if(i%2==1 && sum2>=0){
      cost2+=1+sum2;
      sum2=-1;
    }
  }
  cout<<min(cost1,cost2);
    
  
  
  
  
  
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define MAXN 200010
#define INF 0x3fffffff
using namespace std;
vector <int> mp[MAXN];
int n,m,s;
int dir[100005];
int read(){
    char ch;int s=0;
    ch = getchar();
    while(ch<'0'||ch>'9') ch=getchar();
    while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
    return s;
}

void dij()
{
	for(int i=1;i<=n;i++)
	dir[i]=i;
	s=1;
	int newn=s;
	queue<int>q;
	for(int i=0;i<mp[s].size();i++)
	{
		dir[mp[s][i]]=s;
		q.push(mp[s][i]);
		//cout<<mp[s][i]<<endl;
	}
	while(!q.empty())
	{
		newn=q.front();
		//cout<<newn<<'*'<<endl;
		q.pop();
		for(int i=0;i<mp[newn].size();i++)
		{
			//cout<<mp[newn][i]<<"&"<<endl;
			if(dir[mp[newn][i]]==mp[newn][i])
			{
				dir[mp[newn][i]]=newn;
		        q.push(mp[newn][i]);
			}
		}
	}
	int flag=1;
	for(int i=2;i<=n;i++)
	{
		if(dir[i]==i)
		flag=0;
	}
	if(flag==1)
	{
		cout<<"Yes"<<endl;
		for(int i=2;i<=n;i++)
		cout<<dir[i]<<endl;
	}
	else
	cout<<"No"<<endl; 
}
int main()
{
    
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {
    	int u,v;cin>>u>>v;
		mp[u].push_back(v);
		mp[v].push_back(u); 
	}
	dij();
}

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

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

int main(void)
{
    string s,t; cin>>s>>t;
    if(t.substr(0,s.size())==s)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef long double ld;




int main(){
    ll N;
    cin >> N;
    string S = "ACL";
    rep(i,N - 1) S += "ACL";
    cout << S << endl;
}

Measured memory_bytes: 3596
#include <iostream>

using namespace std;

int findDigitsSum(int n){
    int sum = 0;
    while (n > 0){
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

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

    int min_sum = 10000;
    for (int A = 1; A < N; A++){
        int B = N - A;
        int sum_A = findDigitsSum(A);
        int sum_B = findDigitsSum(B);
        if (sum_A + sum_B < min_sum) min_sum = sum_A + sum_B;
    }
    cout << min_sum << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#define sz 10000
int main()
{
    int i,n,m, a[sz],sum=0;

    scanf("%d %d",&n,&m);

    for( i=0 ; i<m ; i++ )
        scanf("%d",&a[i]);

    for( i=0 ; i<m ; i++ )
        sum = sum + a[i];


    sum = n-sum;

    if( sum<0 )
        printf("-1\n");
    else
        printf("%d\n",sum);


    return 0;
}


Measured memory_bytes: 1768
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC098A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b,max;

            var word = Console.ReadLine().Split();

            a = int.Parse(word[0]);
            b = int.Parse(word[1]);

            max = a + b;
          
            if (max < a - b) max = a - b;
            if (max < a * b) max = a * b;

            Console.WriteLine(max);

            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 11092
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    double[] x = new double[n];
    String[] u = new String[n];
    double sum = 0.0;

    for (int i = 0; i < n; i++) {
      x[i] = sc.nextDouble();
      u[i] = sc.next();
    }

    for (int i = 0; i < n; i++) {
      if (u[i].equals("BTC")) {
        sum += x[i] * 380000.0;
      } else {
        sum += x[i];
      }
    }

    System.out.println(sum);
  }

}


Measured memory_bytes: 23380
object Main extends App {
	val Array(a, b, k) = scala.io.StdIn.readLine.split(" ").map(_.toLong)

	val a1 = a+k
	val b1 = b-k+1

	if(a1 < b1){
		for(x<-a until a1){
			println(x)
		}
		for(x<- b1 to b){
			println(x)
		}
	}else if(a1 >= b1){
		for(x <- a to b){
			println(x)
		}
	}


}


Measured memory_bytes: 27212
#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <string>
#include <iostream>
#include <iomanip>

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif

const int INF=1e9;
const ll INFF=1e17;
const double EPS=1e-9;
const ll MOD=1e9+7;
const int MAXN=1e5+10;
int n,s1[MAXN],s2[MAXN],s3[MAXN];
vector<vector<int> > g(MAXN);
bool vis[MAXN],inP[MAXN];
vector<int> path;
void dfs1(int v){
	vis[v]=1;
	s1[v]=0;
	if(inP[v] || v==n-1)return;
	for(auto u:g[v])if(!vis[u]){dfs1(u);s1[v]+=s1[u];}
	s1[v]++;
}
void dfs2(int v){
	vis[v]=1;
	s2[v]=0;
	if(inP[v] || !v)return;
	for(auto u:g[v])if(!vis[u]){dfs2(u);s2[v]+=s2[u];}
	s2[v]++;
}
void dfs3(int v){
	vis[v]=1;
	s3[v]=1;
	for(auto u:g[v])if(!vis[u] && !inP[u] && u!=0 && u!=n-1){dfs3(u);s3[v]+=s3[u];}
}
int get_path(int v,int par){
	if(v==(n-1))return 1;
	for(auto u:g[v])if(u!=par && get_path(u,v)){if(v)path.pb(v);return 1;}
	return 0;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n;
	REP(i,n-1){
		int t1,t2;
		cin >> t1 >> t2;t1--;t2--;
		g[t1].pb(t2);
		g[t2].pb(t1);
	}
	REP(i,n)inP[i]=0;
	get_path(0,-1);
	for(auto u:path)inP[u]=1;
	reverse(path.begin(),path.end());
	REP(i,n)vis[i]=0;
	dfs1(0);
	REP(i,n)vis[i]=0;
	dfs2(n-1);
	REP(i,n)vis[i]=0;
	for(auto u:path)dfs3(u);
	for(int i=0;i<(path.size()+1)/2;i++)s1[0]+=s3[path[i]];
	for(int i=(path.size()+1)/2;i<path.size();i++)s2[n-1]+=s3[path[i]];
	cout << (s1[0]>s2[n-1]?"Fennec":"Snuke") << '\n';
	return 0;
}


Measured memory_bytes: 11512
using namespace std;

typedef   long long  int ll;
#include <bits/stdc++.h>


//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val
#define fast  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
#define all(a) a.begin(),a.end()
//#define mod 998244353


#define mod   998244353

#define inf 1e18
//#define mod 3
#define flush fflush(stdout)

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<ll, ll, hash< ll > > ht;

// find_by_order()  // order_of_key
typedef tree<
    ll,
    null_type,
    less<ll>,
    rb_tree_tag,
    tree_order_statistics_node_update>
    ordered_set;






ll power1(ll a, ll b)//a raised to power b
   {  if(b<=0) return 1; if(b==1) return a;
       ll c=power1(a,b/2);
        c*=c;c%=mod;if(b%2==1) c*=a;c%=mod;
        return c;
   }
   ll mi(ll a,ll m)
   { ll c= power1(a,m-2);

     return c;
   }



 struct less_then_greater {
    template<typename T, typename U>
    bool operator()(T const& lhs, U const& rhs) const {
        if (lhs.first < rhs.first) return true;
        if (rhs.first < lhs.first) return false;
        return lhs.second > rhs.second;
    }
};

 /*std::priority_queue<std::pair<int, int>,
                    std::vector<std::pair<int, int>>,
                    less_then_greater
                    > pq;*/


int main()
{   ll n,k;cin>>n>>k;
    vector<pair<ll,ll> > v(k);
    for(auto &x:v)cin>>x.first>>x.second;
    sort(all(v));
    vector<ll> dp(n+1,0);
     dp[1]=1;dp[2]=-1;
    for(ll i=1;i<=n;i++)
    {  dp[i]+=dp[i-1];
   dp[i]%=mod;
        for(auto x:v)
        {
           if(i+x.first<=n) {dp[i+x.first]+=dp[i];dp[i+x.first]%=mod;}
            if(i+x.second+1<=n){dp[i+x.second+1]-=(dp[i]-mod);dp[i+x.second+1]%=mod;}
        }

        //if(v[0].first!=1)dp[i+1]-=dp[i];
        //for(auto x:dp)cout<<x<<" ";cout<<endl;

    }
    cout<<dp[n]<<endl;
    return 0;
}



Measured memory_bytes: 4832
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;
const int MOD = 1000000007;
const double pi = acos(-1);

int main() {
    int K; cin >> K;
    string S = "ACL";
    REP(i,K) cout << S;
    cout << endl;
}

Measured memory_bytes: 3580
#include<bits/stdc++.h>
using namespace std;
typedef int sign;
typedef long long ll;
#define For(i,a,b) for(register sign i=(sign)(a);i<=(sign)(b);++i)
#define Fordown(i,a,b) for(register sign i=(sign)(a);i>=(sign)(b);--i)
const int N=2e5+5;
template<typename T>bool cmax(T &a,T b){return (a<b)?a=b,1:0;}
template<typename T>bool cmin(T &a,T b){return (a>b)?a=b,1:0;}
template<typename T>T read()
{
	T ans=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)&&ch!='-')ch=getchar();
	if(ch=='-')f=-1,ch=getchar();
	while(isdigit(ch))ans=(ans<<3)+(ans<<1)+(ch-'0'),ch=getchar();
	return ans*f;
}
template<typename T>void write(T x,char y)
{
	if(x==0)
	{
		putchar('0'),putchar(y);
		return;
	}
	if(x<0)
	{
		putchar('-');
		x=-x;
	}
	static char wr[20];
	int top=0;
	for(;x;x/=10)wr[++top]=x%10+'0';
	while(top)putchar(wr[top--]);
	putchar(y);
}
void file()
{
#ifndef ONLINE_JUDGE
	freopen("F.in","r",stdin);
	freopen("F.out","w",stdout);
#endif
}
char s[N];
int n;
const int mo=998244353;
int dp[N][3][3][2];
void add(int &x,int y){x+=y;x-=(x>=mo?mo:0);}
void input()
{
	scanf("%s",s+1);
	n=strlen(s+1);
}
void check()
{
	int flag=1;
	For(i,2,n)if(s[i-1]!=s[i])flag=0;
	if(flag){puts("1");exit(0);}
	if(n<=3)
	{
		if(n==2)puts("2");
		else if(s[1]!=s[2]&&s[2]!=s[3]&&s[1]!=s[3])puts("3");
		else if(s[1]==s[3])puts("7");
		else puts("6");
		exit(0);
	}
}
void work()
{
	check();
	int d=0;
	For(i,1,n)d=(d+s[i]-'a')%3;
	For(i,0,2)dp[1][i][i][0]=1;
	int ans=1;
	For(i,2,n)if(s[i-1]==s[i])ans=0;
	For(i,2,n)For(j,0,2)For(a,0,2)For(l,0,1)if(dp[i-1][j][a][l])
	{
		For(b,0,2)add(dp[i][(j+b)%3][b][l|(a==b)],dp[i-1][j][a][l]);
	}
	add(ans,dp[n][d][0][1]);
	add(ans,dp[n][d][1][1]);
	add(ans,dp[n][d][2][1]);
	write(ans,'\n');
}
int main()
{

	input();
	work();
	return 0;
}



Measured memory_bytes: 14464
#include <bits/stdc++.h>
 
using namespace std;
 
using ll = long long;
 
int main(){
    ll n, m;
    cin >> n >> m;
    ll ans = 0;
    for(ll i = 0; i < m; ++i){
        ll tmp; cin >> tmp;
        ans += tmp;
    }
    if(n - ans < 0)cout << -1;
    else cout << n - ans;
    return 0;
}

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

#define M 1046527/* your task*/
#define L 14

char H[M][L]; /* Hash Table */

int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){ return key%M/* your task */; }
int h2(int key){ return 1+(key%(M-1))/* your task */; }

int h(int key,int i){ return (h1(key)+i*h2(key))%M;}

int find(char str[]){
    /* your task */
    long long key,i=0,j;
    key=getKey(str);
    while(1){
        j=h(key,i);
        if(strcmp(H[j],str)==0){
            return 1;
        }else if(strlen(H[j])==0){
            return 0;
        }
        i++;
    }
}

int insert(char str[]){
    /* your task */
    long long key,i=0,j;
    key=getKey(str);
    while(1){
        j=h(key,i);
        if(strcmp(H[j],str)==0)
            return 1;
        else if(strlen(H[j])==0){
            strcpy(H[j],str);
            return 0;
        }
        i++;
    }
}

int main(){
    int i, n, h;
    char str[L], com[9];
    for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    
    scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ){
	scanf("%s %s", com, str);
	
	if ( com[0] == 'i' ){
	    insert(str);
	} else {
	    if (find(str)){
		printf("yes\n");
	    } else {
		printf("no\n");
	    }
	}
    }

    return 0;
}

Measured memory_bytes: 16104
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    TA = [LI() for _ in range(N)]

    t, a = TA[0]
    for i in range(1, N):
        T, A = TA[i]
        # t/T>a/A
        if t * A > a * T:
            t = T * ((t - 1) // T + 1)
            a = A * ((t - 1) // T + 1)
        else:
            t = T * ((a - 1) // A + 1)
            a = A * ((a - 1) // A + 1)

    print(t + a)

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 9908
#include<bits/stdc++.h>
using namespace std;
string s;
int ans;
int main(){
	cin>>s;
	for(int i=0;i<s.size();i++){
		ans+=s[i]-'0';
		ans%=9;
	}
	if(!ans){
		cout<<"Yes";
	}
	else cout<<"No";
    return 0;
}

Measured memory_bytes: 3740
// ABC 51 C

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
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; }
const long long INF = 1LL<<60;

const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

// エラトステネスの篩でN 以下の素数判定を行う
// 素数: 1, 素数じゃない: 0
// [0, 0, 1, 1, 0, 1, ...]
vector<int> createEratos(int n)
{
  vector<int> isprime(n+1, 1);
  isprime[0] = 0;
  isprime[1] = 0;

  for (int i = 2; i * i <= n; i++) {
    if (isprime[i]) {
      int j = i + i;
      while (j <= n) {
        isprime[j] = 0;
        j = j + i;
      }
    }
  }
  return isprime;
}

// 階乗の素因数分解
// n = 10: 2^1 * 5^1 [0, 0, 1, 0, 1, 0, ...]
// n = 12: 2^2 * 3^1 [0, 0, 2, 1, 0, 0, ...]
vector<int> factfact(int n)
{
  vector<int> prime = createEratos(n);

  for (int i = 2; i <= n; i++) {
    if (prime[i]) {
      prime[i] = 0;
      for (int j = i; j <= n; j *= i) {
        prime[i] += n/j;
      }
    }
  }
  return prime;
}

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

  // 1 ~ n を素因数分解
  // 各素数の 数をカウント (2^x)(3^y)(5^z)...
  vector<int> fact = factfact(n);

  // ans = (x+1)(y+1)(z+1)...
  struct mint ans;
  ans.x = 1;
  for (auto v : fact) {
    mint val;
    val.x = v + 1;
    ans *= val;
  }

  cout << ans.x << endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &x : a)
    cin >> x;

  int ans = 1 << 28;

  for (int i = -100; i <= 100; ++i) {
    int sum = 0;
    for (int j = 0; j < n; ++j) {
      sum += (a[j] - i) * (a[j] - i);
    }
    ans = min(ans, sum);
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
    def list(self):
        l = []
        for k in self:
            l.extend([k]*self[k])
        return l
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]
def pf(x):
    C = counter()
    p = 2
    while x>1:
        k = 0
        while x%p==0:
            x //= p
            k += 1
        if k>0:
            C.add(p,k)
        p = p+2-(p==2) if p*p<x else x
    return C

N,H=mint()
A=[]
B=[]
for _ in range(N):
    a,b=mint()
    A.append(a)
    B.append(b)
a=max(A)
B.sort(reverse=True)
ans=0
for b in B:
    if b<a:
        break
    H-=b
    ans+=1
    if H<=0:
        print(ans)
        exit()
print(ans+(H-1)//a+1)

Measured memory_bytes: 82720
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstdio>
using namespace std;

int main(){
	int n,t;

	cin >> n;

	for(int i=1; i<10; i++){
		if(n%i != 0 || n/i > 9){
			t = 0;
		}else{
			t = 1;
			break;
		}
	}
	if(t==1){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] money = {500,100,50,10,5,1};
		while(scan.hasNext()){
			int ch = scan.nextInt();
			if(ch == 0){
				break;
			}
			ch = 1000 - ch;
			int count = 0;
			for(int i = 0;i < 6;i++){
				while(ch >= money[i]){
					ch -= money[i];
					count++;
				}
			}
			System.out.println(count);
		}
	}
}

Measured memory_bytes: 15328
/*
   Author : BabaYaga42,
   BITS Pilani, Hyderabad.
   Don't give up ;)
   */  
#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false);cin.tie(nullptr);
#define int long long
 
const int N = 1e5+5;
int a[N];

int32_t main()
{
	IOS;	
	int n;
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> a[i];
	int mc = 0,temp = 0;
	for(int i = 0; i < n-1; i++)
	{
	 	if(a[i] >= a[i+1])
	 		temp++;
	 	else
	 		temp = 0;
	 	mc = max(mc,temp);
	}
	cout << mc;
	return 0;
}

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

#include<cstdio>
#define r(i,n) for(int i=0;i<n;i++)


int main(void){
  int a,b;
  cin>>a>>b;
  cout<<max((a+b),max((a-1+a),(b-1+b)))<<endl;

return 0;}


Measured memory_bytes: 256
#!/usr/bin/env python3

if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

    ant = [a, b, c, d]
    f = False
    for i in ant:
        if e - i > k:
            f = True
            break
    if f:
        print(':(')
    else:
        print('Yay!')


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    ll a, b, t;
    cin >> a >> b >> t;

    ll c = a, ans = 0;
    while(c <= t){
        c += a;
        ans += b;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,x=0,y=0;
    cin>>a>>b>>c;
    int d[b];
    for(int i=0;i<b;i++){
        cin>>d[b];
        if(d[b]>c) x++;
        else y++;
    }
    cout<<min(x,y)<<endl;
}



Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N, A, B, C;
int nCr[5100][2600];

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  nCr[0][0] = 1;
  for (int i=1; i<5100; i++) {
    nCr[i][0] = 1;
    for (int j=1; j<=min(i, 2600-1); j++) {
      nCr[i][j] = nCr[i-1][j-1]+nCr[i-1][j];
      if (nCr[i][j] >= MOD) nCr[i][j] -= MOD;
    }
  }
  cin >> N >> A >> B >> C;
  if (B%2) {
    cout << 0 << "\n";
    return 0;
  }
  B /= 2;
  int s = 0;
  rep(y, A+1) {
    rep(z, N+1) {
      int rest = C-(3*z+y);
      if (rest < 0) break;
      if (B == 0 && rest != 0) continue;
      int one = y+A-y;
      int two = B*2;
      int three = (3*z+y)+rest;
      assert(one == A && two == B*2 && three == C);
      int p = (1LL*((1LL*nCr[A+z+B][z]*nCr[A+B][B])%MOD)*nCr[A][y])%MOD;
      if (B > 0) p = (1LL*p*nCr[rest+B-1][B-1]) % MOD;
      s = (s+p) % MOD;
    }
  }
  cout << s << "\n";
  return 0;
}


Measured memory_bytes: 50944
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

map<vector<int>,int> dp[111];
ll mod;

ll rec(int x, vector<int>& v){
    if(dp[x].count(v))return dp[x][v];
    int m=v.size();
    int y = v.back();
    return false;
}


int main(){
    ll a,b;
    cin>>a>>b;
    ll ans = (b+a-1)/a*a;
    ll x = ans/a;
    ll y = ans/b+ans%b;
    if(x<y)cout<<ans<<endl;
    else cout<<-1<<endl;
    return 0;
}


Measured memory_bytes: 3112
#include<iostream>
#define INF 1000000007
using namespace std;
int main(){
  long long a,b;
  cin>>a>>b;
  if((a-b)>=2||(b-a)>=2)
    cout<<0<<endl;
  else{
    long long ans=1;
    if(a==b){
      for(int i=1;i<=a;i++){

	  ans=(i*ans)%INF;

	  ans=(i*ans)%INF;
      }
      ans=(2*ans)%INF;
    }else{
      if(a>b){
	for(int i=1;i<=a;i++){
	    ans=(i*ans)%INF;
	    if(i!=a)
	      ans=(i*ans)%INF;
	}
      }else{
	for(int i=1;i<=b;i++){
	 
	    ans=(i*ans)%INF;
	    if(i!=b)
	    ans=(i*ans)%INF;
	}
 
      }
    }
  cout<<ans<<endl;
  }
  return 0;
}


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

int main(){
    ll A,B;
    cin >> A >> B;
    if(A>=13) cout << B << endl;
    else if(A>=6) cout << B/2 << endl;
    else cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define LOCAL 0
#define lli long long int
const lli mod=1e9+7;
const lli pINF=LLONG_MAX;
const lli nINF=-LLONG_MAX;
void fast() {std::ios::sync_with_stdio(false);cin.tie(NULL);}
lli power(lli a,lli b){lli ans=1;while(b!=0){ if(b%2==1){ans*=a;}b/=2;a*=a;} return ans;}
lli invmod(lli a) {return pow(a,mod-2);}
#define vi vector<int>
#define vlli vector<lli>
#define pb push_back
#define mp make_pair
#define F first
#define S second
const int INT=1000000000;
const int INF=0x3f3f3f3f;
#define Pa pair<int,int>
#define si(n) scanf("%d",&n)
#define sli(n) scanf("%lld",&n)
#define printi(n) printf("%d\n",n)
#define ld long double
#define printli(n) printf("%lld\n",n)
#define all(v) v.begin(),v.end()
#define forn(i,n) for(int i=0;i<n;i++)
void print(int a[],int n){for(int i=0;i<n;i++) cout<<a[i]<<" ";}
lli a[200005];

int main() 
{
    int n;
    si(n);
    
    for(int i=0;i<n;i++) sli(a[i]);
    
    lli now=0,l=0,r=0;
    lli ans=0;
    
    while(l<n){
        while(r<n && (now^a[r])==(now+a[r])){
            ans++;
            now^=a[r];
            r++;
        }
        now^=a[l++];
        ans+=r-l;
    }
    
    cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1792
import std.conv;
import std.string;
import std.algorithm;
import std.array;
import std.stdio;

void main() {
	readln;
	double[] ps = readln.chomp.split(' ').map!(to!double).array;
	double[][] dp = new double[][ps.length + 1];
	foreach (ref e;dp) {
		e = new double[ps.length + 1];
		e[0] = 1.0;
	}
	dp[0][1..$] = 0.0;

	foreach (i;0..ps.length) {
		dp[i + 1][0] = dp[i][0] * (1 - ps[i]);
		foreach (o;1..ps.length + 1) {
			dp[i + 1][o] = dp[i][o - 1] * ps[i] + dp[i][o] * (1 - ps[i]);
		}
	}

	auto result = dp[ps.length][ps.length / 2 + 1..$].sum;
	writefln("%.10f", result);
}


Measured memory_bytes: 75248