akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MMOD 998244353
#define MAX 2010101
using namespace std;
using Edge=pair<ll,ll>;
using Graph=vector<vector<int>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  string S;
  cin>>S;
  int N=S.size(),ans=MAX;
  REP(i,N-1){
    if(S[i]!=S[i+1]) chmin(ans,max(i+1,N-i-1));
  }
  if(ans==MAX) ans=N;
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3732
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e8
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    int n; cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    int count = 0;
    int ans = 0;
    rep(i,n-1){
        if(v[i]>=v[i+1]){
            count++;
            ans = max(ans,count);
        }else{
            count = 0;
        }
    }
    cout << ans <<  endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define Speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;

#define st              first
#define nd              second
#define pb              push_back
#define pf              push_front
#define all(a)          (a).begin(), (a).end()
#define lwb             lower_bound
#define upb             upper_bound
#define vvll            vector<vector<ll> >
#define Mset(s, n)      memset(s, n, sizeof(s))
#define Sz(a)           int((a).size())
#define Max(a, b, c)    max(max((ll)(a), (ll)(b)), (ll)(c))
#define Min(a, b, c)    min(min((ll)(a), (ll)(b)), (ll)(c))
#define Unique(a)       sort(all(a)); (a).resize(unique(all(a)) - (a).begin())

typedef long double ld;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

const ll MOD = 1e9 + 7;
const int oo = 2e9;
const ld PI = acos((ld) -1);
int Getbit(ll x, int k){return (x >> (k - 1)) & 1;}
ll Lcm(ll a, ll b) {return a / __gcd(a, b) * b;}
bool isPrime(ll n){for(ll i = 2; i * i <= n; i++){if(n % i == 0) return 0;} return (n > 1) ? 1 : 0;}
ll Powmod(ll n, ll k, ll p = MOD) {ll r = 1; for(; k; k /= 2, n = n * n % p){if(k & 1) r = r * n % p;} return r;}

const int N = 2e5 + 5;

ll n, m, k;
ll a[11][11];

void Solve(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        int k = i;
        while(k / 10 != 0) k /= 10;
        if(i % 10 != 0) a[i % 10][k]++;
    }
    ll res = 0;
    for(int i = 1; i <= n; i++){
        int k = i;
        while(k / 10 != 0) k /= 10;
        res += a[k][i % 10];
    }
    cout << res;
}

int main(){
    Speed;
    int query = 1;
//    cin >> query;
    while(query--) Solve();
}


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

using namespace std;
using ll =long long;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
using P = pair<int,int>;
//Write From this Line

#define sz(x) int(x.size())
int main()
{
	string s, t;
	cin >> s >> t;

	int n = sz(s), m = sz(t);
	//indexのリストを作る
	vector<vector<int>> is(26);
	rep(i,n) is[s[i]-'a'].push_back(i);
	rep(i,n) is[s[i]-'a'].push_back(i+n);
	ll ans = 0;
	int p = 0;
	rep(i,m){
		int c = t[i] - 'a';
		if(sz(is[c]) == 0) {
			puts("-1");
			return 0;
		}
		p = *lower_bound(is[c].begin(), is[c].end(), p) + 1; // アスタリスクをつけると、値が帰ってくる
		if(p>=n) {
			p -= n;
			ans += n;
		}
	}
	ans += p;
	cout << ans << endl;

}


Measured memory_bytes: 1724
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef vector<int> VI;
typedef vector<ll> VLL;

int main(){
    ll s;
    cin >> s;
    VLL a;

    a.push_back(s);
    for(ll i=1; ; ++i){
        ll tmp;
        if(a[i-1]%2 == 0){
            tmp = a[i-1] /2;
        }else{
            tmp = 3*a[i-1] +1;
        }
        for(ll j=0; j<i; ++j ){
            if(tmp == a[j]){
                cout << i+1 << endl;
                return 0;
            }
        }
        a.push_back(tmp);
    }

    return -1;
}

Measured memory_bytes: 256
sx,sy,tx,ty = map(int,input().split())
# 距離 s < tより
dx = tx - sx
dy = ty - sy

res = ""
# 1回目
# いきし
for i in range(dx):
    res += "R"
for i in range(dy):
    res += "U"
# かえりし
for i in range(dx):
    res += "L"
for i in range(dy):
    res += "D"

# 2回目
# いきし 1回上に上がる dx + 1いく
res += "D"
for i in range(dx+1):
    res += "R"
for i in range(dy+1):
    res += "U"
res += "L"
# かえりし 1回下がっとく
res += "U"
for i in range(dx+1):
    res += "L"
for i in range(dy+1):
    res += "D"
res += "R"
print(res)


Measured memory_bytes: 3064
open System
let R T = stdin.ReadLine()|> T
let RS T = stdin.ReadLine().Split()|>Array.map T
let R2 T U = RS string|>fun c-> (c.[0]|>T),(c.[1]|>U)
let R3 T U V = RS string|>fun c-> (c.[0]|>T),(c.[1]|>U),(c.[2]|>V)
let R4 T U V W = RS string|>fun c-> (c.[0]|>T),(c.[1]|>U),(c.[2]|>V),(c.[3]|>W)
let R5 T U V W X = RS string|>fun c-> (c.[0]|>T),(c.[1]|>U),(c.[2]|>V),(c.[3]|>W),(c.[4]|>X)
[<EntryPoint>]
let main argv =
    R int
    |>fun c -> c+(c*c)+(c*c*c)
    |>printfn "%d"
    0

Measured memory_bytes: 30028
#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#define INT_MAX 2147483647
#define LLINT_MAX 9223372036854775807
#define mod 1000000007
#define ll long long int
using namespace std;

int main() {
	int h, w;
	string s[100];
	cin >> h >> w;
	for (int i = 0; i < h; i++)
		cin >> s[i];
	for (int i = 0; i < w + 2; i++)
		cout << '#';
	cout << endl;
	for (int i = 0; i < h; i++)
		cout << '#' << s[i] << '#' << endl;
	for (int i = 0; i < w + 2; i++)
		cout << '#';
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
n,m,l=map(int,input().split())
INF=10**10
graph=[[INF for i in range(n)] for j in range(n)]
fuel=[[INF for i in range(n)] for j in range(n)]
for i in range(n):
    graph[i][i]=0
for i in range(m):
    a,b,c=map(int,input().split())
    a-=1;b-=1
    if c>l:continue
    graph[a][b],graph[b][a]=c,c
for i in range(n):
  for j in range(n):
    for k in range(n):
      graph[j][k]=min(graph[j][k],graph[j][i]+graph[i][k])
for i in range(n):
    for j in range(n):
        if graph[i][j]<=l:
            fuel[i][j]=1
for i in range(n):
  for j in range(n):
    for k in range(n):
      fuel[j][k]=min(fuel[j][k],fuel[j][i]+fuel[i][k])
q=int(input())
for i in range(q):
    s,t=map(int,input().split())
    s-=1;t-=1
    if fuel[s][t]==INF:print(-1)
    else:print(fuel[s][t]-1)


Measured memory_bytes: 58712
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define mod 1000000007
#define inf 1e18
#define PI 3.14159265358979323846264338327950L
#define w(x) int x; cin>>x; while(x--)
using namespace std;
bool sieve[2000006];
void sieve_make() 
{
	memset(sieve,true,sizeof(sieve));
	sieve[0]=sieve[1]=false;
	for(int i=2;i*i<2000006;i++)
	{
		if(sieve[i])
		{
			for(int j=i*i;j<2000006;j+=i)
				sieve[j]=false;
		}
	}
}

int max(int a,int b)
{
	if(a>b)
		return a;
	return b;
}
int min(int a,int b)
{
	if(a<b)
		return a;
	return b;
}
int modexp(int a,int b,int c)
{
	if(a==0) return 0;
	if(b==0) return 1;

	int ans;
	if(b%2==0)
	{
		int small=modexp(a,b/2,c);
		ans=(small*small)%c;
	}
	else
	{
		int small=modexp(a,b-1,c);
		ans=(a%c);
		ans=(small*ans)%c;
	}
	return (ans+c)%c;
}
bool sign(int x)
{
	if(x>0)
		return true;
	return false;
}
int kadane(int* a,int n)
{
	int loc=a[0],glo=a[0];
	for(int i=1;i<n;i++)
	{
		loc=max(a[i],loc+a[i]);
		glo=max(glo,loc);
	}
	return glo;
}

int dp[100005];
int dfs(vector<int>* adj,int sv,bool col,bool* vis,int n)
{
	if(sv==n-1)
		return 1;
	
	int ans=0;
	for(auto i:adj[sv])
	{
		if(!vis[i])
		{
			vis[i]=1;
			if(col)
				ans+=dfs(adj,i,!col,vis,n);
			else
				ans+=dfs(adj,i,!col,vis,n)+dfs(adj,i,col,vis,n);
			vis[i]=0;
		}
	}
	return ans;
}

int32_t main()
{
	ios::sync_with_stdio(NULL);
    cin.tie(NULL);
    cout.tie(NULL);
	
	
	
	
	string s;
	cin>>s;

	if(s.back()=='s')
		s+="es";
	else
		s+='s';

	cout<<s<<endl;
	
}



Measured memory_bytes: 3660
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <chrono>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define pii pair<ll,pi >
#define ppi pair<pi,ll>
#define ppp pair<pi,pi >
#define ex(str,a,b) str.substr((int)(a),min((int)str.size()-a,(int)(b-a+1))) 
#define all(X) X.begin(),X.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   __builtin_popcount(n) : no. of set bits in n.
*/

const int M = (1<<20)+5;
const int md = 1e9+7;

priority_queue<ll,vector<ll >,greater<ll > > pq;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

map<int,bool> mp[300005];
int r[300005],c[300005];
vector<int> adj,bdj;

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

	int n,m,q,i,mxc,mxr,u,v;

	cin >> n >> m >> q;
	mxr = mxc = 0;
	for(i=1;i<=q;++i)
	{
		cin >> u >> v;
		r[u]++;
		c[v]++;
		mxr = max(mxr,r[u]);
		mxc = max(mxc,c[v]);
		mp[u][v] = 1;
	}

	for(i=1;i<=n;++i)
	{
		if(r[i] == mxr)
			adj.pb(i);
	}

	for(i=1;i<=m;++i)
	{
		if(c[i] == mxc)
			bdj.pb(i);
	}

	for(auto u:adj)
	{
		for(auto v:bdj)
		{
			if(mp[u][v] == 0)
			{
				cout << mxr+mxc << "\n";
				return 0;
			}
		}
	}

	cout << mxr+mxc-1 << "\n";
}



	

Measured memory_bytes: 37892
use std::collections::HashMap;

#[allow(unused_imports)]
use std::collections::HashSet;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

const MOD: u64 = 1_000_000_007;

fn main() {
    let nm = read_vec::<usize>();
    let n = nm[0];
    let m = nm[1];

    let mut a : Vec<usize> = Vec::with_capacity(m + 1);
    for i in 0..m {
        a.push(read::<usize>());
    }
    a.push(n + 1);


    let answer = solve(n, m, &a);
    println!("{}", answer);
}

fn solve(n: usize,m: usize, a: &[usize]) -> u64 {

    let mut amap : HashMap<usize, u32> = HashMap::new();

    let mut from = 0;
    let mut max = 0;
    for k in a {
        if *k == from {
            return 0;
        }
        let d = k - 1 - from;
        if d > 0 {
            let count = amap.entry(d).or_insert(0);
            *count += 1;

            if d > max {
                max = d;
            }
        }
        from = k + 1;
    }

    let mut f0 = 0;
    let mut f1 = 1;
    let mut s : u64 = 1;
    for i in 1..max + 1 {
        let f = (f0 + f1) % MOD;
        
        if let Some(count) = amap.get(&i) {
            for p in 0..*count {
                s = (s * f) % MOD;
            }
        }

        f0 = f1;
        f1 = f % MOD;
    }


    return s;
}


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

int main(){
    string s; cin >> s;
    int i, j;
    for (i=0; i<s.size(); i++){
        if (s.at(i)=='A') break;
    }
    for (j=s.size()-1; j>=0; j--){
        if (s.at(j)=='Z') break;
    }
    //cout << "j: " << j << " i: " << i << endl;
    cout << j-i+1 << endl;
    return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        String s=sc.next();
        if(a>=3200){
            System.out.println(s);
        }else{
            System.out.println("red");
        }
    }
}

Measured memory_bytes: 22996
#include <stdio.h>
int main(void){
    int a=0,b=0,c=0,n,t;
    while(scanf("%d",&n)>0){
        if(n>a)t=n,n=a,a=t;
        if(n>b)t=n,n=b,b=t;
        if(n>c)c=n;
    }
    printf("%d\n%d\n%d\n",a,b,c);
    return 0;
}

Measured memory_bytes: 1028
#include <stdio.h>

using namespace std;

int main(){
	int m,f,r;
	char grade;
	while(true){
		scanf("%d %d %d",&m,&f,&r);
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1){
			grade = 'F';
		}else if(m+f >= 80){
			grade = 'A';
		}else if(m+f >= 65){
			grade = 'B';
		}else if(m+f >= 50){
			grade = 'C';
		}else if(m+f >= 30){
			grade = (r >= 50)? 'C':'D';
		}else{
			grade = 'F';
		}
		printf("%c\n",grade);
	}
}



Measured memory_bytes: 2740
/*
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

#ifdef LOCAL
#include "debug.h"
#else
#include<bits/stdc++.h>
using namespace std;
#define debug(x...)
#endif
 
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> 
using ordered_set= tree<T, null_type, 
		less<T>, 
		rb_tree_tag, tree_order_statistics_node_update> ;
template<class T> 		
using ordered_mset= tree<T, null_type, 
		less_equal<T>, 
		rb_tree_tag, tree_order_statistics_node_update> ;
		
*/
 
/*
 
PBDS
-------------------------------------------------
			0 based indexing
-------------------------------------------------			 
1) insert(value)
2) erase(value)
3) order_of_key(value) // Number of items strictly smaller than value
4) *find_by_order(k) : K-th element in a set (counting from zero)
 
*/
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
//mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());	

const int mx=1e6+5;

int mark[mx],koyta[mx];

void sieve()
{
	mark[1]=1;
	
	for(int i=2;i<mx;i++)
	{
		if(!mark[i])
		{
			for(int j=2*i;j<mx;j+=i) mark[j]=i;
		}
	}	
}

void factorize(int n)
{
	if(n==1) return;
	set<int>fact;
	while(mark[n])
	{
		fact.insert(mark[n]);
		n/=mark[n];
	}
	fact.insert(n);
	
	for(int x: fact) koyta[x]++;
}

void solve()
{
	sieve();
	
	int n;
	cin>>n;
	
	int g=0;
	
	for(int i=0;i<n;i++)
	{
		int x;
		cin>>x;
		
		factorize(x);
		
		g=gcd(g,x);
	}
	
	if(*max_element(koyta+1,koyta+mx)<=1) cout<<"pairwise coprime";
	else if(g==1) cout<<"setwise coprime";
	else cout<<"not coprime";
}		

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	
	int testcase=1;
	//cin>>testcase;
	
	for(int i=1;i<=testcase;i++)
	{
		//cout<<"Case "<<i<<": ";
		solve();
	}
	
	#ifdef LOCAL
	cerr<<"\nTime elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << " ms\n";
	#endif
	
	
	return 0;
}


Measured memory_bytes: 11476
#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>

using namespace std;

#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPE(i,a,n) for(int i=a;i<=n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define SRTVG(v) sort(v.begin(),v.end(),greater<>())
#define SRTAG(a,n) sort(a,a+n,greater<>())
#define MOD 1000000007

typedef long long ll;
typedef tuple<int,int,bool> Tb;

template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}
template<class T> void YesNo(T& a) {if(a){cout << "Yes" << ENT;}else{cout << "No" << ENT;}}
template<class T> void YESNO(T& a) {if(a){cout << "YES" << ENT;}else{cout << "NO" << ENT;}}
template<class T,class U> void cinn(T& n,U a) {REP(i,0,n) cin >> a[i];}


int atcoder(){
    //入力
    string w;
    cin >> w;
    bool ans=true;
    map<char,int> mp;
    REP(i,0,w.size()){
        mp[w[i]]++;
    }
    
    for(auto x : mp) {
        if(x.second%2==1) ans=false;
    }

    YesNo(ans);
    
    return 0;
}

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


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>

using namespace std;
map<int,map<int,int> > data;
int n;
int x[100001],y[100001],w[100001];
int dx[4]={0,-1,0,-1};
int dy[4]={0,0,-1,-1};
int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d %d %d",&x[i],&y[i],&w[i]);
		data[x[i]][y[i]]+=w[i];
	}
	int res=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<4;j++){
			int cnt=0,nx=x[i]+dx[j],ny=y[i]+dy[j];
			for(int k=0;k<=1;k++){
				for(int l=0;l<=1;l++){
					cnt+=data[nx+k][ny+l];
				}
			}
			res=max(res,cnt);
		}
	}
	printf("%d / 1\n",res);
	return 0;
}

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

int main() {
    int a, b,c,d;
    cin >> a >> b>>c;
   d=0;
  for(int i =min(a,b);i>0;i--){
    
    if((a%i == 0)&&(b%i == 0)){
      d++;
      if(d == c){
        cout << i <<  endl;
        return 0;
    }
  }
  
  }
}
  

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <math.h>

using namespace std; 

int list[1000000]={2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73,
79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163,
 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251,
 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443,
 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557,
 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647,
 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757,
 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863,
 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983,
 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069};

long int a,b,loop,hasil,input,mid;
long int lo;
long int hi;

 bool Prima(unsigned long n) 
{
    for (unsigned short i = 0; list[i]*list[i] <= n; i++) 
	{
        if (n % list[i] == 0) 
		{
            return false;
        }
    }
 
    return true;
}

int main()
{
	lo=1087;
	a=180;
	while(lo<=1000003)
	{
		if(Prima(lo))
		{
			list[a]=lo;
			a++;
		}
		lo+=2;
	}
	//printf("%d",list[78498]);
	while(scanf("%ld",&input)!= EOF)
	{	
	lo=0;
	hi=78497;
	/*while(lo<=hi)
        {
            mid=(lo+hi)/2;
            if (list[mid]<input)
            {
                lo=mid+1; 
            } 
            else if(list[mid]>input)
            {
                hi=mid-1; 
            }
            else 
            {
                break; 
            } 
        }*/
	while(input>=list[lo])
	{
		lo++;
	}
	printf("%d\n",lo);
	}
	return 0; 
}

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

using namespace std;
using llong = long long;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	llong x;
	cin >> x;
	cout << x/11*2+(x%11>6?2:x%11>0?1:0) << endl;

	return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
  private static int gcd(int a, int b) {
    return a % b == 0 ? b : gcd(b, a % b);
  }
  
  private static boolean solve(int a, int b, int c) {
    return c % gcd(a, b) == 0;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int a = reader.nextInt();
    int b = reader.nextInt();
    int c = reader.nextInt();
    out.println(solve(a, b, c) ? "YES" : "NO");
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}


Measured memory_bytes: 21076
#include <bits/stdc++.h>
#define ll long long 
#define all(v) v.begin() , v.end()
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define tr(con) for(auto it = con.begin(); it!= con.end() ; it++)
#define INF 1e9+7   // 1 * 10^9+ 7
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define fo(i,n) for(ll i=0;i<n;i++)
using namespace std;

int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n , a , b;
	cin >> n >> a >> b;
	cout << min(n*a , b);
	return 0;
}


Measured memory_bytes: 256
import java.util.Arrays;
        import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long X = scan.nextLong();
        long K = scan.nextLong();
        long D = scan.nextLong();
long k=0;
long l=Math.abs(X);
long p=0;
k=(l-l%D)/D;
if(k>K){p=Math.abs(X)-D*K;}
else if (K%2==k%2){p=Math.abs(X)-D*k;}
else{p=D*(k+1)-Math.abs(X);}
        System.out.println(p);
    }

}

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

#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define pi 3.14159265358979323846

using namespace std;

int main(){
	int a, b;	cin >> a >> b;

	cout << a * b << endl;

	return 0;
}


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

int main(){
  int n,W;
  cin>>n>>W;
  vector<int> v(n),w(n);
  rep(i,n) cin>>v[i]>>w[i];
  
  vector<vector<int>> dp(n+1,vector<int>(W+1,0));
  rep(i,n){
    rep(j,W+1){
      if(j-w[i]>=0){
        dp[i+1][j] = max(dp[i][j],v[i]+dp[i][j-w[i]]);
      }else{
        dp[i+1][j] = dp[i][j];
      }
    }
  }
  cout << dp[n][W] << endl;
}


Measured memory_bytes: 6736
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n = inp()
l = inpl()
dic = {}
for i in range(0, len(l)):
    dic.setdefault(i, l[i])
ans = ''
sl = sorted(dic.items(), key=lambda x:x[1])
for d in sl:
    ans = ''.join([ans,' ', str(d[0] + 1)])
print(ans)


Measured memory_bytes: 31532
stack=list(input().split())
num_stack=[]
while len(stack) != 0:
    if stack[0] == '+':
        num=num_stack[len(num_stack)-1] + num_stack[len(num_stack)-2]
        num_stack.pop(len(num_stack)-1)
        num_stack.pop(len(num_stack)-1)        
        num_stack.append(num)
        stack.pop(0)
    elif stack[0] == '-':
        num=num_stack[len(num_stack)-2] - num_stack[len(num_stack)-1]
        num_stack.pop(len(num_stack)-1)
        num_stack.pop(len(num_stack)-1)  
        num_stack.append(num)
        stack.pop(0)
    elif stack[0] == '*':
        num=num_stack[len(num_stack)-1] * num_stack[len(num_stack)-2]
        num_stack.pop(len(num_stack)-1)
        num_stack.pop(len(num_stack)-1)  
        num_stack.append(num)
        stack.pop(0)
    else:
        num_stack.append(int(stack.pop(0)))
print(num_stack[0])


Measured memory_bytes: 5612
/*************************************************************************
	> File Name: 5.cpp
	> Author: Knowledge_llz
	> Mail: 925538513@qq.com 
	> Blog: https://blog.csdn.net/Pig_cfbsl 
	> Created Time: 2020/7/13 16:51:31
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define LL long long
using namespace std;
int read(){
	char x=getchar(); int u=0,fg=0;
	while(!isdigit(x)){ if(x=='-') fg=1; x=getchar(); }
	while(isdigit(x)){ u=(u<<3)+(u<<1)+(x^48); x=getchar(); }
	return fg?-u:u;
}
const int maxx=5e5+10;
int n,a[maxx],b[maxx],cnt=0,sum=0;
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.out", "w", stdout);
#endif
	n=read();
	For(i,1,n){
		int u=read();
		a[u]++;
		b[a[u]]++;
	}
	For(i,1,n) b[i]=b[i-1]+b[i];
	For(k,1,n){
		int l=0,r=n,mid;
		while(l<=r){
			mid=(l+r)>>1;
//printf("%d %d\n",l,r,mid);
			if((LL)k*mid<=b[mid]) l=mid+1;
			else r=mid-1;
		}
		printf("%d\n",l-1);
	}
	return 0;
}


Measured memory_bytes: 5992
#include <bits/stdc++.h>
#define EPS 1e-8
#define MAX_N 500000
#define fir first
#define sec second
using namespace std;
typedef double dnt;
typedef pair<dnt,dnt> pnt;
template <class T> inline void read(T &x) {
	x = 0; int c = getchar(), f = 1;
	for (; !isdigit(c); c = getchar()) if (c == 45) f = -1;
	for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0');
}
int n, l, r; dnt C, T, V;
pnt que[MAX_N+5], tot, mrg;
pnt operator + (const pnt &x, const pnt &y)
	{return pnt(x.fir+y.fir, x.sec+y.sec);}
pnt operator - (const pnt &x, const pnt &y)
	{return pnt(x.fir-y.fir, x.sec-y.sec);}
dnt operator * (const pnt &x, const pnt &y)
	{return x.fir*y.sec-x.sec*y.fir;}
int main() {
	read(n), read(C), read(T), read(V);
	printf("%.7lf\n", T);
	tot = que[r] = pnt(V, T*V);
	for (int i = 1; i < n; i++) {
		read(T), read(V); dnt lft = V;
		while (que[l].fir < lft-EPS)
			lft -= que[l].fir, tot = tot-que[l++];
		tot = tot-que[l];
		que[l].sec /= que[l].fir;
		que[l].fir -= lft;
		que[l].sec *= que[l].fir;
		tot = tot+que[l];
		mrg = pnt(V, T*V);
		/*
		while (l <= r && que[r]*mrg < -EPS)
			tot = tot-que[r], mrg = mrg+que[r--];
		if (mrg.fir > C+EPS)
			mrg.sec /= mrg.fir, 
			mrg.fir = C, 
			mrg.sec *= mrg.fir;
		tot = tot+mrg, que[++r] = mrg;
		*/
		while (l <= r && que[r]*mrg < -EPS)
			mrg = mrg+que[r--];
		tot = tot+pnt(V, T*V), que[++r] = mrg;
		printf("%.7lf\n", tot.sec/tot.fir);
	}
	return 0;
}


Measured memory_bytes: 16896
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<(n);i++)
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}else{return 0;}}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}else{return 0;}}
template <class T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <class T> inline T LCM(T a,T b){return a*b/GCD(a,b);}

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

Measured memory_bytes: 256
#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;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long int> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long int>> vvl;
typedef pair<int, int> pii;
typedef pair<long long int, long long int> pll;
typedef vector<pair<int, int>> vii;
typedef vector<pair<long long int, long long int>> vll;
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test() long long int t; cin >> t; cin.ignore(); while(t--) 
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define MOD 1000000007
#define SMOD 998244353
#define pq priority_queue
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sp " "
#define inp(a) ll a;cin>>a;cin.ignore()
#define inps(a,b) ll a,b;cin>>a>>b;cin.ignore()
#define out(a) cout<<SP(20)<<a<<'\n'
#define outs(a,b) cout<<SP(20)<<a<<" "<<b<<'\n'
#define ins insert
#define er erase
#define lb lower_bound
#define ub upper_bound
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define inpa(a,n) ll a[n]; for(int i=0; i<n; i++){cin>>a[i];}
#define inpv(a,n) vl a; for(int i=0; i<n; i++){inp(x);a.pb(x);}
#define outa(a,n) for(int i=0;i<n;i++){cout<<a[i]<<" ";}cout<<'\n';
#define outv(v) for(auto i:v){cout<<i<<" ";}cout<<'\n';
set<char> vow = {'a','e','i','o','u','A','E','I','O','U'};
ll xpow(ll n, ll m){if(m==0){return 1;}else{ll x = xpow(n, m/2);if(m&1){return x*x*n;}else{return x*x;}}}
ll xmod(ll a, ll m){return (((a%m)+m)%m);}
ll xmodpow(ll n, ll m, ll y){if(m==0){return 1;}else{ll x = xmodpow(n, m/2, y);if(m&1){return xmod((xmod((xmod(x,y)*xmod(x,y)),y)*xmod(n,y)),y);}else{return xmod((xmod(x,y)*xmod(x,y)),y);}}}
 
int main(){
    fast();
 
/* you get what you work for not what you wish for */
    
    string a, b;
    cin >> a >> b;
    b+=a;
    out(b);
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
using namespace std;
#include<string.h>
#include<string>
int main(){
string v,s;
int i,j=0,n,g=0;
cin>>v>>n;
for(i=0;i<n;i++){
cin>>s;
s=(s+s+s);
if(s.find(v)!=-1){
g++;
}
}
printf("%d\n",g);
return 0;
}

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

#define all(v)			((v).begin()), ((v).end())
#define sz(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define rep(i, v)		for(int i=0;i<sz(v);++i)
#define lp(i, n)		for(int i=0;i<(int)(n);++i)
#define lpi(i, j, n)	for(int i=(j);i<(int)(n);++i)
#define lpd(i, j, n)	for(int i=(j);i>=(int)(n);--i)
#define tc              int t;cin>>t
#define w               while(t--)
typedef long long ll;
typedef pair<int,int> pi;
bool vis[100009];
long long n;
int cnt=0,l=0,r=0;

int main() {
#ifndef ONLINE_JUDGE
	//freopen("test.txt", "rt", stdin);
#endif
long long n,k;
cin>>n>>k;
if(n%k==0)
    cout<<0;
else if(n<k)
{
    long long m=abs(n-k);
    if(m<n)
        cout<<m;
    else
        cout<<n;
}
else
{
    long long m= n%k;
    long long z=abs(m-k);
    if(z<m)
        cout<<z;
    else
        cout<<m;
}
}



Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		
		int n = Integer.parseInt(br.readLine());
		long res = 1;
		long[] a = new long[n];
		
		StringTokenizer st = new StringTokenizer(br.readLine());
		for(int i=0; i<n; i++) {
			a[i] = Long.parseLong(st.nextToken());
			if(a[i] == 0)
				res = 0;
		}
		
		if(res != 0) {
			for(int i=0; i<n; i++) {
				if(a[i] <= (long)Math.pow(10, 18)/res)
					res *= a[i];
				else {
					res = -1;
					break;
				}
			}
		}
		bw.write(res + "\n");
		bw.flush();
	}

}


Measured memory_bytes: 50920
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
ll gcd(ll a, ll b){ return (b == 0) ? a : gcd(b, a % b); }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;

int main(void){
    Cin(int, n);
    vector<pair<int, int>> w(n);
    For(i, n){
        cin >> w[i].second >> w[i].first;
    }
    Sort(w);
    
    bool f = true;
    ll t = 0;
    For(i, n){
        t += w[i].second;
        if(t > w[i].first){
            f = false;
            break;
        }
    }
    CoutYn(f);
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define Maxn 507
using namespace std;
int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int H,W,h,w;
int a[Maxn][Maxn];
int main()
{
	H=read(),W=read(),h=read(),w=read();
	if (H%h==0&&W%w==0) cout << "No" << endl; else
	{
		cout << "Yes" << endl;
		for (int i=1;i<=H;i++)
			for (int j=1;j<=W;j++)
				if (i%h==0&&j%w==0) a[i][j]=3006-3007*h*w;
				else a[i][j]=3007;
		for (int i=1;i<=H;i++)
		{
			for (int j=1;j<=W;j++)
				printf("%d ",a[i][j]);
			printf("\n");
		}
	}
	return 0;
}


Measured memory_bytes: 2560
var
	a, b : Integer;
	eat : Boolean;
	
function CheckProc(const x, y : Integer) : Boolean;
	begin
	Result := True;
	if x > 8 then
		Result := False;
	if y > 8 then
		Result := False;
	end;
	
begin
	read(a);
	readln(b);
	eat := CheckProc(a, b);
	if eat = True then
		WriteLn('Yay!')
	else
		WriteLn(':(');
end.

Measured memory_bytes: 128
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

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

    list<int> L;
    REP(i, N)
    {
        int b;
        scanf("%d", &b);
        L.push_back(b);
    }

    list<int> res;
    //jedz od konca i wybieraj najpozniejszy element, ktory sie zgadza
    REP(c, N)
    {
        int cnt = 1;
        bool found = 0;
        auto last = L.begin();
        for (auto it = L.begin(); it != L.end(); it++)
        {
            if (*it == cnt)
            {
                last = it;
                found = 1;
            }

            cnt++;
        }

        if (!found)
        {
            printf("-1\n");
            return 0;
        }

        res.push_front(*last);
        L.erase(last);
    }

    for (int r : res)
        printf("%d\n", r);

    return 0;
}

Measured memory_bytes: 256
# coding: utf-8
# Your code here
l="abcdefghijklmnopqrstuvwxyz"
a=[0]*26

while True:    
    try:
        n=input()
        n=n.lower()
        for i in range(len(n)):
            if n[i] in l:
                b=l.index(n[i])
                a[b] +=1
    except:
        break
for c in range(26):
    print(l[c],':',a[c])






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

// * Shortcut

#define sort(s) sort(s.begin(), s.end());
#define ll long long
#define real long double

// * Constant
const ll mod = 1E9 + 7;
const ll fftmod = 998244353;
const ll inf = LONG_LONG_MAX;
const ll n_inf = LONG_LONG_MIN;

using namespace std;

bool prime(ll x)
{
	if (x < 2)
	{
		return false;
	}
	else if (x > 2)
	{
		if (x % 2 == 0)
			return false;
		else
		{
			for (ll i = 3; i <= sqrt(x); i += 2)
			{
				if (x % i == 0)
					return false;
			}
		}
	}
	return true;
}

bool vowel(char ch)
{
	ch = tolower(ch);
	return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'y');
}

ll fact(ll n)
{
	if (n == 0 || n == 1)
		return 1;
	else
		return n * fact(n - 1);
}

ll C(ll n, ll r)
{
	if (r == 0)
		return 1;
	if (n < r)
		return 0;

	/*
     Extra computation saving for large R,
     using property:
     N choose R = N choose (N-R)
    */
	if (r > n / 2)
		return C(n, n - r);

	double res = 1;

	for (int k = 1; k <= r; ++k)
	{
		res *= n - k + 1;
		res /= k;
	}

	return (ll)(res);
}

//  Variable

// ? Problem Local Function

ll fib(int n)
{
	long long p1 = 1, p2 = 1, ans;
	if (n <= 2)
		return 1;
	else
	{
		for (int i = 3; i <= n; i++)
		{
			ans = p1 + p2;
			p1 = p2;
			p2 = ans;
		}
	}
	return ans;
}

ll calls(int n)
{
	vector<ll> c;
	c.push_back(0);
	c.push_back(0);
	c.push_back(2);
	for (int i = 3; i <= n; i++)
	{
		c.push_back(c[i - 1] + c[i - 2] + 2);
	}
	return c[n];
}

vector<ll> cnt(100007, 0);

int main()
{
	freopen("submit.err", "w+", stderr);
	ll n;
	cin >> n;
	vector<ll> a(n);
	for (ll i = 0; i < n; i++)
	{
		cin >> a[i];
		a[i]--;
	}
	for (ll i = 0; i < n - 1; i++)
	{
		if (a[i] > a[i + 1])
		{
			a[i + 1]++;
		}
	}
	for (ll i = 0; i < n - 1; i++)
	{
		if (a[i] > a[i + 1])
		{
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
	return 0;
}


Measured memory_bytes: 1792
n = gets.chomp.to_i
ans = 0

while true
  if n == 10 && ans == 0 #10^nだけ特別処理してbreak
    ans += 10
    break
  elsif n == (n%10) #一桁になったらbreak
    ans += n
    break
  elsif n%10 == 0
    n = n/10
  else
    ans+=n%10
    n = n/10
  end
end
puts ans


Measured memory_bytes: 1788
#凸包を求める

def quickhull(l,r,s,k):
    if not s:
        return
    su = []
    sd = []
    a = (r[0]-l[0],r[1]-l[1])
    for x,y in s:
        b = (x-l[0],y-l[1])
        cro = cross(a,b)
        if cro > 0:
            su.append((x,y)) #上半分
        elif cro < 0:
            sd.append((x,y)) #下半分

    if su:
        c,d = direction(l,r,su[0])
        p = su[0]
        for i in range(1,len(su)):
            c_,d_ = direction(l,r,su[i])
            if c*d_ < c_*d:
                c,d = c_,d_
                p = su[i]
        k.append(tuple(p)) #もっとも離れた点を凸包の頂点に追加
        b = (l[0]-p[0],l[1]-p[1])
        c = (p[0]-r[0],p[1]-r[1])
        s1 = []
        s2 = []
        for x,y in su:
            b_ = (x-p[0],y-p[1])
            c_ = (x-r[0],y-r[1])
            cro_b,cro_c = cross(b,b_),cross(c,c_)
            if cro_b >= 0 and cro_c >= 0: #三角形内部判定
                continue
            else:
                if cro_b < 0:
                    s1.append((x,y))
                elif cro_c < 0:
                    s2.append((x,y))
        quickhull(l,p,s1,k) #再帰
        quickhull(p,r,s2,k)

    if sd:
        c,d = direction(l,r,sd[0])
        p = sd[0]
        for i in range(1,len(sd)):
            c_,d_ = direction(l,r,sd[i])
            if c*d_ < c_*d:
                c,d = c_,d_
                p = sd[i]
        k.append(tuple(p)) #もっとも離れた点を凸包の頂点に追加
        b = (l[0]-p[0],l[1]-p[1])
        c = (p[0]-r[0],p[1]-r[1])
        s1 = []
        s2 = []
        for x,y in sd:
            b_ = (x-p[0],y-p[1])
            c_ = (x-r[0],y-r[1])
            cro_b,cro_c = cross(b,b_),cross(c,c_)
            if cro_b <= 0 and cro_c <= 0: #三角形内部判定(ベクトルの向きにより上下で判定が異なることに注意)
                continue
            else:
                if cro_b > 0:
                    s1.append((x,y))
                elif cro_c > 0:
                    s2.append((x,y))
        quickhull(l,p,s1,k) #再帰
        quickhull(p,r,s2,k)
    return k

def cross(a,b): #外積
    return a[0]*b[1]-a[1]*b[0]

def direction(l,r,p): #点と直線の距離
    a = r[1]-l[1]
    b = l[0]-r[0]
    return (a*(p[0]-l[0])+b*(p[1]-l[1]))**2, a**2+b**2 #分子の2乗,分母の2乗
while 1:
    try:
        t = [float(x) for x in input().split(",")]
        s = []
        for i in range(len(t)//2):
            s.append((t[2*i],t[2*i+1]))
        s.sort()
        l = tuple(s.pop(0))
        r = tuple(s.pop(-1))
        k = quickhull(l,r,s,[l,r])
        if len(k) < 4:
            print("NO")
        else:
            print("YES")
    except:
        quit()



Measured memory_bytes: 5736
#!/usr/bin/env python
# coding: utf-8

# In[21]:


A, B, C = map(int, input().split())


# In[22]:


flag = 0
for i in range(B+1):
    if A*i%B == C:
        print("YES")
        flag = 1
        break

if flag == 0:
    print("NO")


# In[ ]:






Measured memory_bytes: 2940
#include <stdio.h>
#define N 100000
int partition(int,int);

int A[N];
int main()
{
  int i,n,q;
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d",&A[i]);
    }
  q=partition(0,n-1);
  
  for(i=0;i<n;i++)
    {
      if(i!=0) printf(" ");
      if(i==q) printf("[");
      printf("%d",A[i]);
      if(i==q) printf("]");
    }
  printf("\n");
  
  return 0;
}

int partition(int y,int x)
{
  int i,j,n,m;
  n=A[x];
  j=y-1;
  for(i=0;i<x;i++)
    {
      if(A[i]<=n)
	{
	  j++;
	  m=A[j];
	  A[j]=A[i];
	  A[i]=m;  
	}
    }
      m=A[j+1];
      A[j+1]=A[x];
      A[x]=m;
      return j+1;
}

Measured memory_bytes: 2960
#include <bits/stdc++.h>
 
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;
ll mod=1E9+7;
 
#define REP(a,b,c) for(ll a=b;a<(c);a++)
#define PER(a,b,c) for(ll a=b;a>=(c);a--)

ll ii(){ ll x; cin >> x; return x; }
string is(){ string x; cin >> x; return x; }
ld id(){ ld x; cin >> x; return x; }
void oi(ll x){ cout << x; }
void od(ld x){ cout << fixed << setprecision(10) << x; }
void os(string x){ cout << x; }
void oe(){ cout << endl; }
void oie(ll x){ oi(x); oe(); }
void ode(ld x){ od(x); oe(); }
void ose(string x){ os(x); oe(); }

int main(){
    ll N=ii();
    ll M=ii();

    ll r=((N-1)/2);
    ll r3=r/2;
    ll r2=r-r3;

    REP(i,0,min(r2,M)){
        oi(i+1);
        os(" ");
        oie(2*r2-i);
    }

    REP(i,0,min(r3,M-r2)){
        oi(2*r2+i+1);
        os(" ");
        oie(2*(r2+r3)+1-i);
    }

    return 0;
}


Measured memory_bytes: 3640
a = int(input())
l = list(map(int,input().split()))
MOD = 998244353
dp = [0]*a
for i in l:
    dp[i]+=1
res = 1
# print(dp)
if  l[0]!=0:
    print(0)
    exit()

for i in l[1:]:
    # print(i)
    res*=dp[i-1]
    res%=MOD

print(res%MOD)

Measured memory_bytes: 53300