akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <cstring>
#include <ctype.h>
#include<stdlib.h>

#define flin            freopen("input.txt", "r", stdin); 
#define flout           freopen("output.txt", "w", stdout);
#define ll              long long
#define ull             unsigned long long
#define fastio          ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define nl              '\n'
#define nll             '\0'
#define pb              push_back
#define bdyptb          return 0;
#define sorted(x)       sort(x.begin(), x.end())
#define reversed(x)     reverse(x.begin(), x.end())
#define all(x)          x.begin(), x.end()
#define mset(a, b)      memset(a, b, sizeof(a));
#define testcase        ll t,tt; cin>>tt; for(t=1;t<=tt;t++)

#define pi acos(-1.00)   
#define mx 1000007

using namespace std;

int main()
{
    fastio;
    int n;
    cin>>n;
    int p[n+1];
    for(int i=1; i<=n; i++)
    cin>>p[i];

    int a[n+1],b[n+1];
    for(int i=1; i<=n; i++)
    {
        a[i]=(i*(n+2));
        b[i]=((n-i+1)*(n+2));
    }

    for(int i=1; i<=n; i++)
    b[p[i]]+=i;


    for(int i=1; i<=n; i++)
    cout<<a[i]<<' ';
    cout<<nl;
    
    for(int i=1; i<=n; i++)
    cout<<b[i]<<' ';
    cout<<nl;

    bdyptb;
}

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

int main()
{
    int n = 0;
    scanf("%d", &n);
    n %= 10;
    if(n == 3){
        printf("bon\n");
    }
    else if(n == 0 || n == 1 || n == 6 || n == 8){
        printf("pon\n");
    }
    else{
        printf("hon\n");
    }

    return 0;
}



Measured memory_bytes: 3764
s = input()
ls =[False] * 4
for i in range(len(s)):
    if s[i] == "N":
        ls[0] = True
    elif s[i] == "W":
        ls[1] = True
    elif s[i] == "S":
        ls[2] = True
    elif s[i] == "E":
        ls[3] = True
print("Yes" if not(ls[0] ^ ls[2]) and not(ls[1] ^ ls[3]) else "No")


Measured memory_bytes: 3060
fun main(args:Array<String>?): Unit {
    while(true){
        val m = readLine()!!.trim().toInt()
        val n = readLine()!!.trim().toInt()
        if (m == 0 && n == 0) return
        val state = Array(n){ readLine()!!.trim().split(' ').map{it == "0"}.toBooleanArray() }
        println(
                solve(state)
        )
    }
}

fun solve(state: Array<BooleanArray>): Int {
    fun sub(x: Int, y: Int): Int {
        return if (y !in state.indices || x !in state[y].indices || state[y][x]) 0
        else {
            state[y][x] = true
            val max = listOf(sub(x + 1, y), sub(x - 1, y), sub(x, y + 1), sub(x, y - 1)).max()!!
            state[y][x] = false
            return max + 1
        }
    }
    return state.indices.mapNotNull{y -> state[y].indices.filterNot{x -> state[y][x]}.map{x -> sub(x, y)}.max()}.max() ?: 0
}


Measured memory_bytes: 62964
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
typedef long long lint;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	string s;
	cin >> s;

	//vector<int> alphabet(26);
	//for (const auto &elem : s) alphabet[elem - 'a']++;

	int cnt = 0;
	if (*s.begin() == *s.rbegin()) cnt = s.length() - 3;
	else cnt = s.length() - 2;

	if (cnt % 2 == 0) cout << "Second";
	else cout << "First";

	return 0;
}

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

using namespace std;

int toTimeSecond(const string& s) {
    int ret = atoi(s.substr(0, 2).c_str()) * 3600;
    ret += atoi(s.substr(3, 2).c_str()) * 60;
    ret += atoi(s.substr(6, 2).c_str());
    return ret;
}

void Main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) {
            break;
        }

        vector<int> imos(86410 * 2, 0);
        for (int i = 0; i < n; ++i) {
            string depS, arrS;
            cin >> depS >> arrS;
            int dep = 2 * toTimeSecond(depS);
            int arr = 2 * toTimeSecond(arrS);
            imos[dep] += 1;
            imos[arr - 1] -= 1;
        }
        for (int i = 1; i < imos.size(); ++i) {
            imos[i] += imos[i - 1];
        }
        int ans = *max_element(imos.begin(), imos.end());
        cout << ans << endl;
    }
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}



Measured memory_bytes: 3720
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
     
using namespace std;
     
typedef long long ll;
typedef pair<ll, int> pii;
     
#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
     
mt19937 rnd(chrono::steady_clock().now().time_since_epoch().count());


int main(){
    fastIO;
    ll n, m;
    cin >> n >> m;
    ll lcm = (n * m) / __gcd(n,m);
    ll f1 = lcm/n;
    ll f2 = lcm/m;
    set<pii> ff;
    ll z;
    for(ll i = 0 ; i < n; i ++ ){
        z = i * f1 + 1;
        ff.insert(mp(z, i));
    }
    vector<pii> zi;
    for(ll i = 0 ; i<  m ; i ++ ){
        z = i * f2 + 1;
        auto it = ff.lower_bound(mp(z, -1));
        if(it != ff.end()){
            if(it -> fi == z){
                zi.push_back(mp(it -> se, i));
            }
        }
    }
    string s, t;
    cin >> s >> t;
    ll v1, v2;
    for(ll i = 0 ; i < zi.size(); i ++ ){
        v1 = zi[i].fi;
        v2 = zi[i].se;
        if(s[v1] != t[v2]){
            cout << "-1\n";
            return 0;
        }
    }
    cout << lcm;
    return 0;
}

Measured memory_bytes: 6652
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.nextInt();
            int T = in.nextInt();
            int min = Integer.MAX_VALUE;
            for (int i = 0; i < N; i++) {
                int c = in.nextInt();
                int t = in.nextInt();
                if (t <= T) {
                    min = Math.min(c, min);
                }
            }
            out.println(min == Integer.MAX_VALUE ? "TLE" : min);
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 23124
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
class Main {
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			int q = sc.nextInt();
			Set<Integer> s = new HashSet<>();
			for(int i = 0; i < q; i++) {
				int query = sc.nextInt();
				switch(query) {
				case 0:
					s.add(sc.nextInt());
					System.out.println(s.size());
					break;
				case 1:
					System.out.println(s.contains(sc.nextInt())?"1":"0");
					break;
				case 2:
					s.remove(sc.nextInt());
				}
			}
		}
	}
}


Measured memory_bytes: 142388
import java.util.Scanner;
public class Main {
	  public static void main(String args[]){
	 Scanner scanner = new Scanner(System.in);

int a=scanner.nextInt();
int b=scanner.nextInt();
int c=a-b;
	if(c>0) {
		System.out.println("safe");
	}
	else{
		System.out.println("unsafe");
	}
}
	  }

Measured memory_bytes: 35728
package main

import "fmt"

func main() {
	var n, sum int
	fmt.Scan(&n)

	a := make([]int, n)
	for i := range a {
		fmt.Scan(&a[i])
	}

	b := make([]int, n)
	for i := range b {
		fmt.Scan(&b[i])
	}

	c := make([]int, n-1)
	for i := range c {
		fmt.Scan(&c[i])
	}

	y := len(a) + 1
	for _, v := range a {
		v = v - 1
		sum += b[v]
		if y == v-1 {
			sum += c[y]
		}
		y = v
	}
	fmt.Println(sum)
}


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

#define             ll                      long long
#define             si(a)                   scanf("%d",&a)
#define             sii(a,b)                scanf("%d%d",&a,&b)
#define             siii(a,b,c)             scanf("%d%d%d",&a,&b,&c)
#define             s(a)                    scanf("%s",a)
#define             ss(a,b)                 scanf("%s%s",a,b)
#define             pii                     pair<int,int>
#define             pb(a)                   push_back(a)
#define             fr(i,n)                 for(int i=0;i<n;i++)
#define             pri(a)                  printf("%d ",a)
#define             bl                      printf("\n")
#define             PI                      2*acos(0.0)
#define             inf                     1000000
#define             sz                      100
#define             MOD                     1000000007
#define             base                    2147483647
#define             vsort(a)                sort(a.begin(),a.end())
#define             EPS                     10E-10
#define             gcd(a, b)               __gcd(a, b)
#define             lcm(a, b)               ((a)*((b)/gcd(a,b))
#define             finput                  freopen("input.txt","r",stdin)
#define             foutput                 freopen("output.txt","w",stdout)
#define             debug(a,b)              printf("%s %d ",a,b)


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


using namespace std;


int main()
{

    string s;
    int n;

    cin>>s>>n;

    int l = s.length();

    for(int i=0;i<l;i+=n){
        printf("%c",s[i]);
    }
    printf("\n");

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N, M; cin >> N >> M;
    vector<int> A(M); for (auto& a : A) cin >> a;
    vector<int> B = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};
    vector<string> S(N+1);
    for (int i = 1; i < N + 1; i++) {
        for (int a : A) {
            string newstr;
            if (i - B[a] == 0) {
                newstr += (char)('0' + a);
            } else if (i - B[a] > 0 && !S[i - B[a]].empty()) {
                newstr = S[i - B[a]] + (char)('0' + a);
            }
            if (newstr.size() > S[i].size()
                || (newstr.size() == S[i].size() && newstr > S[i])) {
                S[i] = newstr;
            }
        }
    }
    cout << S[N] << endl;
    return 0;
}


Measured memory_bytes: 41600
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    vector<char> vc;
    char c;
    while(1)
    {
        cin.get(c);
        if(c == '\n')
        {
            break;
        }
        vc.push_back(c);
    }
    vector<char> vt;
    while(1)
    {
        cin.get(c);
        if(c == '\n')
        {
            break;
        }
        vt.push_back(c);
    }
    bool chk = false;
    for(int i = 0;i < vc.size();i++)
    {
        if(vc.at(i) == vt.at(0))
        {
            vector<char> vp;
            for(int j = 0;j < vt.size();j++)
            {
                if((i + j) < vc.size())
                {
                    vp.push_back(vc.at(i + j));
                }
                else
                {
                    vp.push_back(vc.at(i + j - vc.size()));
                }
            }
            bool chkt = true;
            for(int j = 0;j < vt.size();j++)
            {
                if(vt.at(j) != vp.at(j))
                {
                    chkt = false;
                }
            }
            if(chkt != false)
            {
                chk = true;
            }
        }
    }
    if(chk != false)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 1184
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            int n = Integer.parseInt(br.readLine());
            int arr[] = new int[n];
            int sum = 0;
            for (int i = 0; i < n; i++) {
                int tmp = Integer.parseInt(br.readLine());
                arr[i] = tmp;
                sum += tmp;
            }
            if (sum % 10 == 0) {
                Arrays.sort(arr);
                boolean flag = false;
                for (int i = 0; i < n; i++) {
                    int tmp = arr[i];
                    if (tmp % 10 != 0) {
                        sum -= tmp;
                        flag = true;
                        break;
                    }
                }
                if (!flag) {
                    sum = 0;
                }
            }
            System.out.println(sum);
       } catch (IOException e) {
            e.printStackTrace();
       }
    }
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef char chr;
typedef double  dbl;
typedef long long int lld;
#define FastIO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
double getComb (double n, double x){
    if (x > n){
        return 0;
    }
    else{
        double r = 1.0;
        for(double i = 1.0; i<=x;i+=1){
            double a = n-i+1;
            double b = a / i;
            r*=b;
        }
        return r;
    }
}
int main () {
    FastIO
    lld n, i;
    dbl m;
    cin >> n;
    cin >> m;
    dbl A[n];
    lld c, t;
    t = 0;
    c = 0;
    dbl x = (1 / (4 * m));
    for(i = 0; i<n; i+=1){
        cin >>A[i];
        t +=  A[i];
    }
    for(i = 0; i<n; i+=1){
        if (A[i] >=(t*x)){
            c += 1;
        }
    }
    if (c >= m)
        cout  <<  "Yes\n";
    else
        cout  <<   "No\n";
    return 0;
}

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

int main(){
    string S;
    cin >> S;
    if(S == "AAA" || S == "BBB"){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
    }
    system("pause");
    return 0;
}

Measured memory_bytes: 504
#include<bits/stdc++.h>
#define F(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++)
#define RF(i,a,b) for(long long i = (long long)(a); i >= (long long)(b); i--)
#define MIN3(a,b,c) (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c))
#define MAX(a,b) (a)>(b)?(a):(b)
#define MIN2(a,b) (a)<(b)?(a):(b)
using namespace std;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef long long ll;
#define ull unsigned long long
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll,ll> lll;
#define deb(x )     cerr << #x << " here "<< x << endl;
#define endl    "\n"
#define printCase() "Case #" << caseNum << ": "
inline bool is_palindrome(const string& s){ return std::equal(s.begin(), s.end(), s.rbegin()); }
const ll MOD = 1000000007;
const ll INF = 1e12+5;
const double eps = 1e-7;
const double PI = acos(-1.0);
#define coud(a,d) cout << fixed << showpoint << setprecision(d) << a;
/*----------------------------------------------------------------------*/

int n,m;
const int N = 105;
ll dp[N][100005],w[N],v[N];

ll solve(int curr, ll rem) {
	if(rem < 0) return -INF;
	if(rem == 0) return 0;
	if(curr == n) return 0;
	if(dp[curr][rem] != -1) return dp[curr][rem];

	ll ret = solve(curr+1, rem);
	if(rem >= w[curr]) {
		ret = max(ret, v[curr]+solve(curr+1, rem-w[curr]));
	}

	return dp[curr][rem]=ret;
}

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

    cin>>n>>m;

    F(i, 0, n) {
    	cin>>w[i]>>v[i];
    }

    memset(dp, -1, sizeof(dp));
    cout<<solve(0, m);

    return 0;
}/*

*/

Measured memory_bytes: 82304
#include <iostream>

using namespace std;

int main()
{
    int i, ans, a, b, c;
    
    cin >> a >> b >> c;
    ans = 0;
    for(i=a; i<=b; i++)
    {
        if( c % i == 0 )
        ans++;
           
    }
    cout << ans << endl;
}



Measured memory_bytes: 3100
#include <cstdio>
#include <iostream>
#include <cstring>
#include <map>
#include <set>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <queue>
#include <cmath>
#include <stack>
#include <ctime>
#include <string>
#include <vector>
#include <sstream>
#include <functional>
#include <algorithm>
using namespace std;

#define mem(a,n) memset(a,n,sizeof(a))
#define memc(a,b) memcpy(a,b,sizeof(b))
#define rep(i,a,n) for(int i=a;i<n;i++) ///[a,n)
#define dec(i,n,a) for(int i=n;i>=a;i--)///[n,a]
#define pb push_back
#define fi first
#define se second
#define IO ios::sync_with_stdio(false)
#define fre freopen("in.txt","r",stdin)
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
typedef long long ll;
typedef unsigned long long ull;
const double PI=acos(-1.0);
const double E=2.718281828459045;
const double eps=1e-3;
const int INF=0x3f3f3f3f;
const int MOD=258280327;
const int N=1e6+5;
const ll maxn=1e6+5;
const int dir[4][2]= {-1,0,1,0,0,-1,0,1};
int main()
{
    IO;
    string s;
    while(cin>>s)
    {
        int sz=s.size(),tmp=0;
        while(sz)
        {
            tmp+=(s[--sz]-'0');
        }
        int ans=(s.size()-1)*9+s[0]-'1';
        ans=max(ans,tmp);
        cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<utility>

int main(){
	int n, m;
	std::cin >> n >> m;

	std::vector<std::pair<int, int> > pos(n), cp(m);
	
	for(int i = 0; i < n; i++){
		std::cin >> pos[i].first >> pos[i].second;
	}
	for(int i = 0; i < m; i++){
		std::cin >> cp[i].first >> cp[i].second;
	}

	int x, y;
	int dist;
	std::pair<int, long long> p;

	for(int i = 0; i < n; i++){
		p = std::make_pair(0, 1e18);
		for(int j = 0; j < m; j++){
			dist = std::abs(pos[i].first - cp[j].first) + std::abs(pos[i].second - cp[j].second);
			if(p.second > dist)p = std::make_pair(j + 1, dist);
		}
		std::cout << p.first << std::endl;
	}
}


Measured memory_bytes: 256
/*Coded by::
    **Avinash Tiwary**
    **BE/10298/2015**
    **Production Engineer**
    **Producing <code>**
*/
#include<bits/stdc++.h>
#define bf ios_base::sync_with_stdio (0), cin.tie (0)
typedef long long ll;
typedef double d;
#define MAX 1000009
#define MIN -1
#define M 1000000007
#define INF 5e17
using namespace std;
typedef vector<ll> Vector;
typedef queue<ll > Queue;
typedef stack<ll> Stack;
typedef pair<ll,ll> Pair;
#define mp make_pair
#define pb push_back
bool desc(ll i, ll j) { return i > j; }
ll gcd(ll a, ll b)
{   if (a == 0) return b;
    return gcd(b%a, a);
}
ll power(ll x,ll n)
{   if(n==0) return 1;
    else if(n%2 == 0) return power((x*x)%M,n/2);
    else return (x*power((x*x)%M,(n-1)/2))%M;
}
ll ar[MAX],not_prime[MAX]; 
void sieve(){
    not_prime[1]=1; not_prime[0]=1;
    for(ll p=2;p*p<=MAX;p++){
        if(!not_prime[p]){
            for(ll i=p*2;i<=MAX;i+=p) not_prime[i]=1;
        }
    }
}
int main(){
    bf; 
    //sieve();
    ll x=1,n,t,i=1,j,m,p,c,flag,t1,a,b,ta1,ta2,t2,ans=0,k; string s;
    cin>>a>>b>>c;
    if(a-b==b-c){
        cout<<"YES";
    }
    else cout<<"NO";
    
    
    
    return 0;
} 

Measured memory_bytes: 256
#include<cstdio>
const int N=150001;
int i,j,t,n,d[N],fa[N],en[N+N],nxt[N+N];
double f[N],g[N];
void dfs1(int u,int p)
{
	for(int i=fa[u];i;i=nxt[i])if(en[i]^p)
		++d[u],dfs1(en[i],u),f[u]+=f[en[i]];
	if(d[u])f[u]=f[u]/d[u]+1;
}
void dfs2(int u,int p)
{
	for(int i=fa[u],v;i;i=nxt[i])if((v=en[i])^p)
	{
		if(p)g[v]=(f[u]*d[u]-f[v]-1+g[u])/d[u];else
		if(d[u]>1)g[v]=(f[u]*d[u]-f[v]-1)/(d[u]-1);
		++g[v],dfs2(v,u);
	}
}
int main()
{
	scanf("%d",&n);
	for(;++t<n+n-1;)
	{
		scanf("%d%d",&i,&j);
		en[t]=j,nxt[t]=fa[i],fa[i]=t;
		en[++t]=i,nxt[t]=fa[j],fa[j]=t;
	}
	for(dfs1(1,0),dfs2(1,i=0);i++<n;)
		printf("%.6lf\n",g[i]?(f[i]*d[i]+g[i])/(d[i]+1):f[i]);
}

Measured memory_bytes: 12032
#include<stdio.h>

int main(){

  int sum=0,i,a;
  
  scanf("%d",&sum);

  while(sum!=0){

    for(i=0;i<9;i++){
      scanf("%d",&a);
      sum-=a;
    }
    printf("%d\n",sum);

    scanf("%d",&sum);
    
  }

  return 0;
}

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


def main(n):
    if n < 105:
        print(0)
        return
    so_list = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
    chi_list = [0 for _ in range(len(so_list))]
    retval = 0
    for a in range(105,n + 1):
        t = a
        # 偶数を弾く
        if 0 == t%2:
            continue
        t_count = 0
        for s in range(len(so_list)):
            so = so_list[s]
            ## 最初だけ通る
            if 0 == t%so:
                #print(9)
                t_count += 1
            
            while 0 == t%so:
                #print(10)
                t /= so
                # chi_list[s] += 1
                t_count += 1
            if t == 1:
                if t_count == (8 - 2):
                    retval += 1
                break
    print(int(retval))
            
    
if __name__ == '__main__':
    try:
        n = int(input().strip())
        main(n)
    except EOFError:
        pass


Measured memory_bytes: 3064
N = int(input())
a_list = list(map(int, input().split(' ')))
count_all = 0
continue_flag = True

while continue_flag:
    count = 0
    for i, a in enumerate(a_list):
        if a % 2 == 0:
            count += 1
            a_list[i] //= 2

    if count == N:
        count_all += 1
    else:
        continue_flag = False

print(count_all)

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

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define rep(i,n) for(int i=0; i<n; i++)
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> P;
typedef map<int,int> mp;

const int MOD = 1e9 + 7;


int main() {
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    int n, q;
    cin >> n >> q;
    string s;
    cin >> s;

    int cnt[100005] = {0};
    int tmp = 0;
    rep(i, n-1){
        if(s[i] == 'A' && s[i+1] == 'C'){
            tmp ++;
        }
        cnt[i+1] += tmp;
    }    

    rep(i, q){
        int l, r;
        cin >> l >> r;
        cout << cnt[r-1] - cnt[l-1] << endl;
    }

    return 0;
}


Measured memory_bytes: 1488
#include <stdio.h>

int main(){
    int data[5];
    int score = 0,i,average;
    
    for(i = 0; i < 5; i++){
        scanf("%d", &data[i]);
    }
    
    for(i = 0; i < 5; i++){
        if(data[i] >= 40){
            score += data[i];
            //printf("%d\n", score);
        }
        else if(data[i] < 40){
            score += 40;
            //printf("%d\n", score);
        }

    }
        average = score/5;
    printf("%d\n", average);
    return 0;
}

Measured memory_bytes: 600
import java.math.BigDecimal;
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner scan=new Scanner(System.in);
		int[] c=new int[6];
		double x,y;
		BigDecimal outX,outY;
		while(scan.hasNext()){
			for(int i=0;i<c.length;i++){
				c[i]=scan.nextInt();
			}
			if(c[0]==0){
				y=c[2]/(double)c[1];
				x=(c[5]-c[4]*y)==0?0.000:(c[5]-c[4]*y)/(double)c[3];
			}else if(c[1]==0){
				x=c[2]/(double)c[0];
				y=(c[5]-c[3]*x)==0?0.000:(c[5]-c[3]*x)/(double)c[4];
			}else if(c[3]==0){
				y=c[5]/(double)c[4];
				x=(c[2]-c[1]*y)==0?0.000:(c[2]-c[1]*y)/(double)c[0];
			}else if(c[4]==0){
				x=c[5]/(double)c[3];
				y=(c[2]-c[0]*x)==0?0.000:(c[2]-c[0]*x)/(double)c[1];
			}else{
				x=(c[4]*c[2]-c[1]*c[5])==0?0.000:(c[4]*c[2]-c[1]*c[5])/(double)(c[4]*c[0]-c[1]*c[3]);
				y=(c[2]*c[3]-c[0]*c[5])==0?0.000:(c[2]*c[3]-c[0]*c[5])/(double)(c[1]*c[3]-c[0]*c[4]);
			}
			outX=new BigDecimal(String.valueOf(x)).setScale(3,BigDecimal.ROUND_HALF_UP);;
			outY=new BigDecimal(String.valueOf(y)).setScale(3,BigDecimal.ROUND_HALF_UP);;
			System.out.printf("%.3f %.3f\n",outX.doubleValue(),outY.doubleValue());
		}
		scan.close();
	}
}

Measured memory_bytes: 26604
n=int(input())
l=[]
s=0
f=1
for i in range(2,n+1):
    f*=i
for _ in range(n):
    l.append(list(map(int,input().split())))
for i in range(n-1):
    for j in range(i+1,n):
        s+=((l[i][0]-l[j][0])**2+(l[i][1]-l[j][1])**2)**.5
s=s*f/n*2
s=s/f
print(s)

Measured memory_bytes: 3188
#include <bits/stdc++.h>
 
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
typedef long long ll;
//const ll mod =  1000000007;
//const ll maxn = 1000000000;

//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // intの1次元の型に vi という別名をつける
using vvll = vector<vll>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll = pair<ll, ll>; // これ以降 pii という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------

int main(){
  int n;
  cin>>n;
  vi a(n);
  rep(i,n)cin>>a.at(i);
  sort(ALL(a));
  cout<<a.at(n/2)-a.at(n/2-1)<<endl;
}

   
    

   


    

   



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

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
// using namespace __gnu_pbds;
typedef long double ld;
typedef long long ll;
#define int ll
#define endl "\n"
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define vi vector<int>
#define pii pair<int,int>
#define For(i,s,e) for (ll i=(s); i<(e); i++)
#define MAX 100005
#define initialize(arr,elem) memset(arr,elem,sizeof(arr))
#define sz size
const int MOD = 1e9+7;

int n, dp[MAX][2], visited[MAX];
vi graph[MAX];

// typedef tree< int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
void solve(int u, int par){
	if (visited[u]!=-1) return ;
	if (graph[u].sz()==1 && u!=1){
		visited[u] = 1;
		dp[u][0] = 1, dp[u][1] = 1;
		return ;
	}
	int white =1,black=1;
	visited[u] = 0;
	for(auto v:graph[u]){
		if (v==par) continue;
		solve(v,u);
		white = (white * (dp[v][0]+dp[v][1]))%MOD;
		black = (black * dp[v][0])%MOD;
	}
	dp[u][1] = black;
	dp[u][0] = white;
	visited[u] = 1; 
	return;
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
		
	

	cin>>n;
	For(i,0,n-1){
		int x,y;
		cin>>x>>y;
		graph[x].pb(y);
		graph[y].pb(x);
	}
	initialize(dp,0);
	initialize(visited,-1);
	if (n==1){
		cout<<2;
		return 0;
	}
	solve(1,-1);
	cout<<(dp[1][0]+dp[1][1])%MOD<<endl;
/*	For(i,1,n+1){
		cout<<dp[i][0]<<" "<<dp[i][1]<<endl;
	}	
*/	return 0;
}


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

int main() {
    char cm;
    cin >> cm;

    if (cm + '0' > 112 && cm + '0' < 139) {
        cout << 'A' << endl;
    } else {
        cout << 'a' << endl;
    }


    return 0;
}

Measured memory_bytes: 3560
#include <iostream>

using namespace std;


int main() {

	int n, m, l;
	cin >> n >> m >> l;

	int mat1[100][100] = { 0 };
	int mat2[100][100] = { 0 };
	long long res[100][100] = { 0 };
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			cin >> mat1[i][j];
		}
	}

	for (int i = 0; i < m; i++)
	{
		for (int j = 0; j < l; j++)
		{
			cin >> mat2[i][j];
		}
	}

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < l; j++)
		{
			long long temp = 0;
			
			for (int k = 0; k < m; k++)
			{
				temp += mat1[i][k] * mat2[k][j];
			}

			res[i][j] = temp;
		}
	}

	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < l; j++)
		{
			if (j == 0) cout << res[i][j];
			else cout << " " << res[i][j];
		}
		cout << endl;
	}

	return 0;
}



Measured memory_bytes: 3240
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int main() {
	string N;
	cin >> N;
	bool ok = false;
	REP(i, N.size()) ok |= N[i] == '7';
	puts([&] {
		return ok;
	}() ? "Yes": "No");
	return 0;
}


Measured memory_bytes: 3620
n = int(input())

def dig(num):
    ans = 0
    while num>0:
        ans += num%10
        num//=10
    return ans

mi = float('inf')
for i in range(1,n//2+1):
    a = dig(i)+dig(n-i)
    mi = min(a,mi)
print(mi)


Measured memory_bytes: 2940
n, m = map(int, input().split())
ab = {}
for i in range(n):
  a, b = map(int, input().split())
  if a in ab.keys():
  	ab[a] += b
  else:
    ab[a] = b

ab = sorted(ab.items(), key=lambda x: x[0])
res = 0
count = 0
for k, v in ab:
  if m - count >= v:
    count += v
    res += v * k
  else:
    res += k * (m - count)
    count += m - count
  
  if count == m:
    break
print(res)

Measured memory_bytes: 24148
#include <bits/stdc++.h>
 
using namespace std;
 
int idx,size;
string s;
 
string parse(){
    string res;
    if(idx >= size || s[idx] == ']') return res;
    if(isupper(s[idx])){
	while(idx < size && isupper(s[idx])){
	    res += s[idx++];
	}
    }else if(s[idx] == '['){
	idx++;
	string str = parse();
	idx++;
	reverse(str.begin(),str.end());
	res += str;
    }else if(s[idx] == '?'){
	res += 'A'; idx++;
    }else if(s[idx] == '+' || s[idx] == '-'){
	int p[85] = {0}, N = 0;
	while(idx < size && (s[idx] == '+' || s[idx] == '-')){
	    if(s[idx] == '+'){
		p[N++] = 1;
	    }else{
		p[N++] = -1;
	    }
	    idx++;
	}
	if(isupper(s[idx])){
	    int x = s[idx];
	    for(int i = 0 ; i < N ; i++){
		x += p[i];
		if(x > 'Z'){ x = 'A'; }
		else if(x < 'A'){ x = 'Z'; }
	    }
	    res += (char)x;
	}else if(s[idx] == '?'){
	    res += 'A';
	}
	idx++;
    }
    return res + parse();
}
 
int main(){
    while(cin >> s, s != "."){
	idx = 0; size = s.size();
	cout << parse() << endl;
    }
    return 0;
}

Measured memory_bytes: 3112
#include <iostream>
//#include <vector>
#include <string>
//#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

//typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 100100
//#define NIL -1

int main(){
    string n;
    int sn=0;
    int n_num=0;
    cin >> n;
    for(int i=0; i<n.size(); i++){
        int tmp=n[i]-'0';
        n_num*=10;
        n_num+=tmp;
        sn+=tmp;
    }

    //cout << n_num << " " << sn << endl;

    if(n_num%sn==0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
var re = new RegExp(Arr[0]);
Arr.shift();
var cnt=0;
for(var i=0;i<Arr.length;i++){
var str=Arr[i]+Arr[i];
if(str.match(re))cnt++;
}
console.log(cnt);

Measured memory_bytes: 7644
#include <stdio.h>

int main(){
  int T[500],S[10000],i,j,count=0,n,q;



  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&S[i]);
  scanf("%d",&q);
  for(j=0;j<q;j++)scanf("%d",&T[j]);

  for(i=0;i<q;i++){
    for(j=0;j<n;j++){
      if(T[i]==S[j]){
        count++;
        break;
      }
    }
  }

  printf("%d\n",count);
  return 0;
}

Measured memory_bytes: 2684
x,y=map(int,input().split())

g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]

if x in g1 and y in g1:
    print('Yes')
elif x in g2 and y in g2:
    print('Yes')
elif x==2 and y==2:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3060
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int t = sc.nextInt();
        int ans = 0;
        int max = 0;
        for(int i = 0; i < t; i++){
            max = Math.max(max, sc.nextInt());
        }
        System.out.println(Math.max(0,max*2-1-k));
    }
}

Measured memory_bytes: 21716
//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <bitset>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000000000//10^18
#define INFINT 2000000001//2*10^9+1
#define MOD 1000000007
#define MODANOTHER 998244353
#define PI acos(-1)

//#define int ll

using namespace std;


signed main(void)
{
	//変数の宣言
	int n,m;
	int h,w;
	char a[60][60];
	char b[60][60];

	//よく使う変数
	int i,j,k,l;
	int flag=0;
	int ans=0;
	int count=0;
	int temp=0;
	int temp1=0;
	int temp2=0;
	int temp3=0;
	static int vec[100010];
	int max=0;
	int min=INFINT;
	int len=0;
	int sum=0;
	int ok=0;
	int ng=0;
	char dummy;
	static char stemp[100010];
	
	//データの読み込み


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


//	scanf("%s",&s);
//	scanf_s("%s",&s,1000010);


	for(i=0;i<n;i++){
		scanf("%s",&a[i]);
//		scanf_s("%s",&a[i],60);
	}

	for(i=0;i<m;i++){
		scanf("%s",&b[i]);
//		scanf_s("%s",&b[i],60);
	}

/*	//scanf("%c",&dummy);
	scanf_s("%c",&dummy);
	for(i=0;i<n;i++){
//		scanf("%c",&s[i]);
		scanf_s("%c",&s[i]);
	}*/


/*	for(i=0;i<3;i++){
//		scanf("%s",&s);
		scanf_s("%s",&s[i],100010);
	}*/


	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理

//	clock_t start=clock();

	flag=0;
	for(i=0;i<=n-m;i++){
		for(j=0;j<=n-m;j++){
			temp=1;
			for(k=0;k<m;k++){
				for(l=0;l<m;l++){
					if(a[i+k][j+l]!=b[k][l]){
						temp=0;
					}
				}
			}
			if(temp==1) flag=1;
		}
	}

	if(flag==0){
		printf("No");
	}else{
		printf("Yes");
	}

//	clock_t end=clock();

	//	printf("計算部分終了\n");

	//出力
	
	//printf("%d",(d[i-1][j-1]+1)/2);

//	printf("time=%lf",(double)(end-start)/CLOCKS_PER_SEC);
	//	printf("結果の出力終了\n");

	return 0;
}



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

int main() {
  int n;
  std::cin >> n;
  long k;
  std::cin >> k;
  std::vector<long> a(n);
  long sum = 0;
  for (long i = 0; i < n; ++i) {
    std::cin >> a[i];
    sum += a[i];
  }

  std::vector<long> primeVec;
  for (long i = 1; i <= (long)std::pow(sum, 0.5); ++i) {
    if (sum % i == 0) {
      primeVec.push_back(i);
      primeVec.push_back(sum / i);
    }
  }

  std::sort(primeVec.rbegin(), primeVec.rend());

  for (long i = 0; i < (long)primeVec.size(); ++i) {
    auto ans = primeVec[i];
    std::vector<long> modVec(n);
    std::for_each(a.begin(), a.end(), [&](auto& x) {
      modVec[&x - &a[0]] = x % ans;
    });
    std::sort(modVec.begin(), modVec.end());

    long lp = 0;
    long rp = n - 1;
    long plus = 0;
    long minus = 0;
    while (lp <= rp) {
      if (plus < minus) {
        plus += modVec[lp];
        ++lp;
      } else {
        minus += ans - modVec[rp];
        --rp;
      }
    }

    if (plus <= k) {
      std::cout << ans << std::endl;
      break;
    }
  }

  return 0;
}

Measured memory_bytes: 384
n, m = map(int, input().split())
min = 0
max = 1000000
for i in range(m):
    l, r = map(int, input().split())
    if min < l:
        min = l
    if max > r:
        max = r
print(max - min + 1 if max - min + 1 > 0 else 0)

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

void koch(double, double, double, double, int cnt);

int n;

int main(){
	cin >> n;
	printf("%.8f %.8f\n", 0, 0);
	koch(0, 0, 100, 0, 0);
	printf("%.8f %.8f\n", 100.0, 0);
	return 0;
}

void koch(double x1, double y1, double x2, double y2, int cnt){
	if(cnt == n){
		return;
	}
	double sx = (2 * x1 + x2)/3;
	double sy = (2 * y1 + y2)/3;
	double tx = (x1 + x2 * 2)/3;
	double ty = (y1 + y2 * 2)/3;
	
	double vertex_x = sx + (tx - sx)/2 - (ty - sy) * sin(M_PI/3);
	double vertex_y = sy + (tx - sx) * sin(M_PI/3) + (ty - sy)/2;
    
  koch(x1, y1, sx, sy, cnt + 1);
  printf("%.8f %.8f\n", sx, sy); 
  koch(sx, sy, vertex_x, vertex_y, cnt + 1);
  printf("%.8f %.8f\n",vertex_x, vertex_y);
  koch(vertex_x, vertex_y, tx, ty, cnt + 1);
  printf("%.8f %.8f\n", tx, ty);   
  koch(tx, ty, x2, y2, cnt + 1);
}   

Measured memory_bytes: 1196
#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define mk make_pair
#define all(a) a.begin(), a.end()
#define len(a) (int)a.size()

using namespace std;

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

int main(){
	int n;
	cin >> n;
	
	vector <int> ans(n+1);
	
	for(int i1 = 1; i1 * i1 <= n; i1++)
		for(int i2 = 1; i2 * i2 + i1 * i1 <= n; i2++)
			for(int i3 = 1; i3 * i3 + i1 * i1 + i2 * i2 <= n; i3++)
				if(i1 * i1 + i2 * i2 + i3 * i3 + i1 * i2 + i2*i3 + i1 * i3 <= n)
					ans[i1 * i1 + i2 * i2 + i3 * i3 + i1 * i2 + i2*i3 + i1 * i3]++;
	
	for(int i = 1; i <= n; i++)
		cout << ans[i] << endl;
	return 0;
}


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

using namespace std;
string a[103];
int n,w;
int main()
{
	cin>>n>>w;
	for(int i=1; i<=n; i++)
	{
		cin>>a[i];
	}
	for(int i=2; i<=n*2+1; i++)
	{
		cout<<a[i/2]<<endl;
	}
	
    return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<int> a(n+1), b(n+1), c(n+1);
  for(int i=1; i<= n;i++){
    cin >> a[i] >> b[i] >> c[i];
 }
 int dp[n+1][3];
 for(int i =0; i<=n; i++){
   dp[i][0]=0;
   dp[i][1]=0;
   dp[i][2]=0;
}
for(int i =1; i<=n; i++){
   dp[i][0] = max(dp[i-1][1] + a[i], dp[i-1][2] + a[i]);
   dp[i][1] = max(dp[i-1][2] + b[i], dp[i-1][0] + b[i]);
   dp[i][2] = max(dp[i-1][0] + c[i], dp[i-1][1] + c[i]);
}
ll ans = max( dp[n][0], max(dp[n][1], dp[n][2]));
cout << ans << endl;
return 0;
}

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

int main(){
    int N,M,C;
    cin >> N >> M  >> C;
    int count = 0;
    int B[30];
    for (int i = 0; i < M; i++) cin >> B[i];

    for (int j = 0; j < N; j++){
        int ans = C;
        for (int i = 0; i < M; i++){
            int A;
            cin >> A;
            ans += A*B[i];
        }
        if (ans > 0) count++;
    }
    cout << count << endl;
}

Measured memory_bytes: 256
import math
x1,y1,x2,y2=input().split()
x1=float(x1)
y1=float(y1)
x2=float(x2)
y2=float(y2)
r=math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
print(r)

Measured memory_bytes: 7532
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
#include<deque>
#include<cassert>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
const int mod = 1000000007;
const int MAXH = 100;
const int MAXW = 100;

int main() {
  
  int a, b;
  cin >> a >> b;
  vector<string> s(MAXH);
  rep(i, MAXH / 2) {
    s[i] = string(MAXW, '#');
  }
  for (int i = MAXH / 2; i < MAXH; ++i) {
    s[i] = string(MAXW, '.');
  }
  a--; b--;

  int cur = 0;
  rep(i, a) {
    if(cur % 200 == 100) cur += 100;
    s[cur / MAXW][cur % MAXW] = '.';
    cur += 2;
    
  }
  cur = 50 * 100 + 100;
  rep(i, b) {
    if(cur % 200 == 100) cur += 100;
    s[cur / MAXW][cur % MAXW] = '#';
    cur += 2;
    
  }
  cout << MAXH << " " << MAXW << endl;
  rep(i, MAXH) cout << s[i] << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int S, T, j1, j2, s1, s2, r1, r2, e1, e2;
	scanf("%d %d %d %d", &j1, &s1, &r1, &e1);
	scanf("%d %d %d %d", &j2, &s2, &r2, &e2);
	S = j1 + s1 + r1 + e1;
	T = j2 + s2 + r2 + e2;
	if (S >= T)
		printf("%d\n", S);
	else
		printf("%d\n", T);
	return 0;
}

Measured memory_bytes: 592
//============================================================================
// Name        : hoba.cpp
// Author      : omar  osama
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <bits/stdc++.h>
#define ll long long
#define rw freopen("input.txt","r",stdin),freopen("output.txt","w",stdout);
#define pb push_back
#define F first
#define S second
#define pf push_front
#define lp(i,a,b) for (int i=a;i<=(int)b;++i)
#define lp2(i,a,b) for (int i=a;i>=b;--i)
#define f(x) return cout<<x<<"\n",0
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
#define p(x) cout<<#x<<" = { "<<x<<" } \n"
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define EPS 1e-6
// to convert string to number use int a = stoi(string);
// to convert number to string use string s = to_string(int);
#define FAST ios::sync_with_stdio(0),ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define clr(c,x) memset(c,x,sizeof(c));
using namespace std;
const int N = 1e2 + 5, mod = (int) 1e9 + 7;
vii v[N];
int m, SP[N][N] = { }, e[N] = { }, n;
void dijkstra(int src) {
	priority_queue<pii> pq;
	pq.push( { 0, src });
	lp(i,1,n)
		e[i] = 2e9;
	e[src] = 0;
	while (!pq.empty()) {
		int a = pq.top().S;
		pq.pop();
		for (auto u : v[a]) {
			if (e[a] + u.S >= e[u.F])
				continue;
			e[u.F] = e[a] + u.S;
			pq.push( { -e[u.F], u.F });
		}
	}
	lp(i,1,n)
		SP[src][i] = e[i];
}
vector<pair<pii, int>> edages;
int main() {
#ifdef ONLINE_JUDGE
    FAST;
#endif
	cin >> n >> m;
	while (m--) {
		int x, y, c;
		cin >> x >> y >> c;
		v[x].pb( { y, c });
		v[y].pb( { x, c });
		edages.pb( { { x, y }, c });
	}
	lp(i,1,n)
		dijkstra(i);
	int ans = 0;
	for (auto u : edages) {
		bool is = true;
		lp(i,1,n)
			lp(j,1,n)
				if (SP[i][j] == u.S + SP[u.F.F][i] + SP[u.F.S][j])
					is = false;
		ans += is;
	}
	f(ans);
	return 0;
}

Measured memory_bytes: 384
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string t;
    cin >> t;
    ll a[4];
    rep(i,0,4) a[i] = t[i] - '0';
    rep(bit,0,(1LL<<3)){
        ll res = a[0];
        rep(i,0,3){
            if((bit>>i)&1){
                res += a[i+1];
            }else{
                res -= a[i+1];
            }
        }
        if(res == 7){
            cout << a[0];
            rep(i,0,3){
                if((bit>>i)&1){
                    cout << "+" << a[i+1];
                }else{
                    cout << "-" << a[i+1];
                }
            }
            cout << "=7" << endl;
            return 0;
        }


    }
    

}

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

#define ll long long int
#define endl '\n'
#define inf 1e18

void testCase()
{
    
    //ll t; cin>>t; while(t--)
    {
        ll n,x,t;
        cin>>n>>x>>t;
        ll ans=(n+x-1)/x;
        cout<<ans*t;
    }       
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    testCase();
    return 0;
}

Measured memory_bytes: 3636
#include<iostream>
#include<cstdio>
#include<map>
#include<algorithm>
#define LL long long

using namespace std;
const int N = 1e5+7;
int a[N];
int main()
{
	ios :: sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	
	int n,k,q;
	cin>>n>>k>>q;
	int x;
	map<int,int> mp;
	
	for(int i=1;i<=n;i++) a[i]=k,a[i]-=q;
	
	for(int i=1;i<=q;i++){
		cin>>x;
		mp[x]++;
	}
	for(int i=1;i<=n;i++){
		a[i]+=mp[i];
		if(a[i]<=0) cout<<"No\n";
		else cout<<"Yes\n";
	}
	return 0;
 } 

Measured memory_bytes: 5760
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<bitset>
using namespace std;
#define INF 2147483647
#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long int ll;



int main(){
	
	int n,a;
	cin>>n;
	int max=0,min=INF;
	for(int i=0;i<n;i++){
		cin>>a;
		max=std::max(max,a);
		min=std::min(min,a);
	}
	cout<<max-min<<endl;
		
	
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <stdint.h>
#include <string.h>

#define _USE_MATH_DEFINES
#include <math.h>

#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <string>

#include <algorithm>
#include <functional>
#include <bitset>
#include <functional>
#include <chrono>
#include <random>

#define sqr(x) (x) * (x)

typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;

using namespace std;
using namespace std::chrono;

const i64 mod = 1'000'000'000ll + 7;
//const i64 smod = 998244353ll;
//const i64 inf = 1'000'000'000'000'000'000ll + 7;
const i64 inf = 1'000'000'007;

const long double eps = 1e-8;

const i64 MAXN = 200'000 + 5;

i64 n, k;

int main(int argc, char* argv[]) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(15); cout.setf(ios::fixed); cerr.precision(15); cerr.setf(ios::fixed);

    cin >> n >> k;

    vector<i64> a(n);
    for (i64 i = 0; i < n; i++) {
        cin >> a[i];
    }

    stringstream ss;
    for (i64 i = 0; i < n - k; i++) {
        if (a[i] < a[i + k]) {
            ss << "Yes" << endl;
        }
        else {
            ss << "No" << endl;
        }
    }

    cout << ss.str();

    return 0;
}

Measured memory_bytes: 6260