akhauriyash/Code-Regression huggingface dataset:
#![allow(unused_imports)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use proconio::{input, marker::*};
use superslice::*;
fn main() {
    input! {
        n: usize,
        s: Chars,
    }

    let mut rs = Vec::new();
    let mut gs = Vec::new();
    let mut bs = Vec::new();

    for i in 0..n {
        match s[i] {
            'R' => rs.push(i as i64),
            'G' => gs.push(i as i64),
            'B' => bs.push(i as i64),
            _ => panic!(),
        }
    }

    let mut sum = 0;
    for &r in &rs {
        for &g in &gs {
            let mut totalb = bs.len();
            let mut dist = (r - g).abs();
            let mut idxs = vec![r-dist, r+dist, g-dist, g+dist];
            if dist %2 == 0 {
                dist /= 2;
                if r < g {
                    idxs.push(r+dist);
                } else {
                    idxs.push(g+dist);
                }
            }
            for &i in &idxs {
                let res = bs.binary_search(&i);
                if res.is_ok() {
                    totalb -= 1;
                }
            }
            sum += totalb;
        }
    }
    println!("{}", sum);
}


Measured memory_bytes: 2236
#include<stdio.h>
int main(void){
    int A,B,Apoi=0,Bpoi=0,n,i;
    while(1){
        scanf("%d",&n);
        if(n == 0) return 0;

        for(i=0;i<n;i++){
            scanf("%d%d",&A,&B);
            if(A > B){
                Apoi += A+B;
            }else if(A < B){
                Bpoi += A+B;
            }else{
                Apoi += A;
                Bpoi += B;
            }

        }
    printf("%d %d\n",Apoi,Bpoi);
    Apoi = 0;
    Bpoi = 0;

    }
}

Measured memory_bytes: 0
#include <stdio.h>
int main(void)


{
	int i, x, date;
	i = 1;
	scanf("%d", &x);
	while(x!=0)
	{
		printf("Case %d: %d\n",i,x);
		scanf("%d", &x);
		i++;
	}

	return 0;
}

Measured memory_bytes: 600
# -*- coding: utf-8 -*-

li = [int(input()) for i in range(5)]

li2 = list()

for i in li:
    if i % 10 != 0:
        i = (i // 10 + 1) * 10
    li2.append(i)

# li3 = [i for i in li if i % 10 != 0]

li4 = [int(str(i)[-1]) for i in li if i % 10 != 0]

# print(li3, li4)

if not li4:
    print(sum(li))
else:
    print(sum(li2) - 10 + min(li4))

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
VI a;
VI sk;
void fl(){
  cout<<"No"<<endl;
  exit(0);
}
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  in n;
  cin>>n;
  VI x(n+1);
  forn(i,n){
    cin>>x[i+1];
  }
  a.resize(n*n);
  forn(i,n)
    a[x[i+1]-1]=i+1;
  in nxtf=0;
  forv(i,a){
    if(a[i]){
      in cnt=a[i]-1;
      sk.PB(i);
      while(cnt){
	if(nxtf>=i)
	  fl();
	if(a[nxtf]){
	  ++nxtf;
	  continue;
	}
	a[nxtf]=a[i];
	++nxtf;
	--cnt;
      }
    }
  }
  nxtf=n*n-1;
  for(in i=n-1;i>=0;--i){
    in cc=sk[i];
    in cnt=n-a[cc];
    while(cnt){
      if(nxtf<=cc)
	fl();
      if(a[nxtf]){
	--nxtf;
	continue;
      }
      a[nxtf]=a[cc];
      --nxtf;
      --cnt;
    }
  }
  cout<<"Yes"<<endl;
  forv(i,a)
    cout<<a[i]<<" ";
  cout<<endl;
  return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#define reset(x, y) memset(x, y, sizeof(x))
#define uni(x) (x).erase(unique(all(x)), (x).end());
#define BUG(x) cerr << #x << " = " << (x) << endl
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define _1 first
#define _2 second
#define chkmin(a, b) a = min(a, b)
#define chkmax(a, b) a = max(a, b)

ll n, ans;

int main() {
  cin >> n;
  int upp = sqrt(n) + 0.5;
  FOR(i, 1, upp) if (n / i == n % i) ans += i;
  FOR(i, 1, upp - 1) if ((n - i) % i == 0 && (n - i) / i > upp) {
    ans += (n - i) / i;
  }
  printf("%lld", ans);
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4") // wonderful

#include <bits/stdc++.h>
using namespace std;






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

    
    string s; cin >> s;

    for (int i = 0; i < s.size(); i++)
    	s[i] = 'x';

    cout << s;

    return 0;
}


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

int main (void){

  double a,b,c,d;
  scanf("%lf",&a);
  if(0<a<10000){
    b=3.1415926535897923;
  c=2.0*b*a;
  d=a*a*b;
  printf("%lf %lf\n",d,c);

  }
  
  return(0);
}



Measured memory_bytes: 2116
#include <bits/stdc++.h>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>
#include<unordered_map>

using namespace std;

int main(){
    string str;
    cin>>str;
    unordered_map<char,int> freq;
    for_each(begin(str),end(str),[&freq](const char& c){ freq[c]++;});
    string beauty="Yes";
    for(auto& pair:freq){
        if(pair.second %2!=0){
            beauty="No";
            break;
        }
    }
    cout<<beauty;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
const long long INF = 1LL << 60;

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

	int dist = 1000, id = 0;
	int ans = 0;
	REP(i, N) {
		ans += L + i;
		if (abs(L + i) < dist) {
			dist = abs(L + i);
			id = L + i;
		}
	}

	cout << ans - id << endl;



	return 0;
}

Measured memory_bytes: 256
# 隣り合うというか差が１の数字の排他的論理和は１を利用
A,B = map(int, input().split())

if A == 0:
    print(B)
    exit()

ans = 0
if A % 2 == 1:
    if B % 2 == 1:
        if A==B:
            ans = B
        elif ((B-A)//2) % 2 == 0:
            ans = A ^ 0
        else:
            ans = A ^ 1
    else:
        if B-A == 1:
            ans = 1
        elif (((B-1) - A)//2) % 2 == 0:
            ans = A ^ B
        else:
            ans = A ^ 1 ^ B
else:
    if B % 2 == 1:
        if B-A == 1:
            ans == 1
        elif ((B-A+1)//2) % 2 == 0:
            ans = 0
        else:
            ans = 1
    else:
        if B==A:
            ans = B
        elif ((B - A)//2) % 2 == 0:
            ans = B
        else:
            ans = 1 ^ B

print(ans)



Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class AOJ0186
{
    AOJ0186() { }

    public static void Main()
    {
        new AOJ0186().run();
    }

    public void run()
    {
        while (true)
        {
            int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            if (input.Length == 1) return;

            int b = input[1];
            int q1 = input[0], q2 = input[4];
            int c1 = input[2], c2 = input[3];

            int a1, a2;
            if (c1 <= c2)
            {
                a1 = Math.Min(b / c1, q2);
                a2 = (b - (a1 * c1)) / c2;
                if ((a1 + a2) < q1)
                {
                    a1 = -1;
                }
            }
            else
            {
                int[] t = { q2, b / c1, (b - c2 * q1) / (c1 - c2) };
                a1 = t.Min();
                a2 = (b - a1 * c1) / c2;
            }

            if(a1 > 0)
            {
                Console.WriteLine("{0} {1}", a1, a2);
            }
            else
            {
                Console.WriteLine("NA");
            }
        }
    }
}

Measured memory_bytes: 5980
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;
using namespace std;

int main(){
	int n,k;cin>>n>>k;
	k/=1000;
	bool ok=false;
	for(int i=0;i*10<=k;i++){
		for(int j=0;j*5+i*10<=k;j++){
			if(ok)continue;
			if(n-i-j<0)continue;
			if(i*10+j*5+(n-i-j)==k){
				ok=true;
				cout<<i<<" "<<j<<" "<<n-i-j<<endl;
			}
		}
	}
	if(!ok)cout<<"-1 -1 -1"<<endl;
	return 0;
}


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

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

long long MOD = 1000000000 + 7;

map<int,ll> m,f;
// m: num of (p and b)
// f: num of p
int N;
ll X;

ll solve(int n, ll x){
  if(x == 1){
    if(n == 0){
      return 1;
    } else {
      return 0;
    }
  }
  if(x <= 1 + m[n-1]){
    return solve(n-1, x-1);
  }
  if(x == 2 + m[n-1]){
    return f[n-1] + 1;
  }

  if(x <= 2 + m[n-1] + m[n-1]){
    return f[n-1] + 1 + solve(n-1, x-2-m[n-1]);
  }

  if(x == 2 * m[n-1] + 3){
    return f[n-1]*2 + 1;
  }
}

int main(){
  cout << setprecision(10);
  cin >> N >> X;

  for(int i = 0; i <= N; i++){
    if(i == 0){
      m[i] = 1;
      f[i] = 1;
    } else { 
      m[i] = m[i-1] * 2 + 3;
      f[i] = f[i-1] * 2 + 1;
    }
  }
  cerr << solve(N,X) << endl;
  cout << solve(N,X) << endl;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {
	// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();//???????????°
		int diff;//???????????°
		int c = 2;//?????????????????¨?????????????????????????????????????????´??????????????????????????????????????????
		int a = 2;//??????????????\???????????´??????????????°???????????????
		int sum = 0;//????????????????????°
		char answer[] = sc.next().toCharArray();//???????????????
		char names[][] = new char[n][];//????????????????´?????????????
		
		for(int i = 0; i < n; i++){//?????????????????????????????\???????????????
			names[i] = sc.next().toCharArray();
		}
		for(int i = 0; i < n; i++){//???????????°???(N???)?????????
			c = 2;
			a = 2;
			search:for(int k = 0; k < names[i].length; k++){//1?????????
				if(names[i][k] == answer[0]){
//					System.out.println(k +"??????????????????0???????????¨?????´?????????");
					for(int j = k+1; j < names[i].length; j ++){//????????????
						if(names[i][j] == answer[1]){
//							System.out.println(j +"??????????????????1???????????¨?????´?????????");
							diff = j - k;
							for(int h = j+diff; h < names[i].length; h += diff){
								if(a == answer.length){
//									System.out.println("?????????"+i+"????????????????????§?????????");
									sum++;
									break search;
								}else if(names[i][h] == answer[c]){
//									System.out.println(h +"??????????????????" + c + "???????????¨?????´?????????");
									c++;
									a++;
								}else{
//									System.out.println(h +"??????????????????" + c + "???????????¨?????´????????????");
									c = 2;
									a = 2;
									break;
								}
							}
							if(a == answer.length){
//								System.out.println("?????????"+i+"????????????????????§?????????");
								sum++;
								break search;
							}
						}else{
//							System.out.println(j +"??????????????????1???????????¨?????´????????????");
						}
					}
				}else{
//					System.out.println(k +"??????????????????0???????????¨?????´????????????");
				}
			}
		}
		System.out.println(sum);
	}
}

Measured memory_bytes: 27612
#define _USE_MATH_DEFINES
#include<iomanip>
#include<cmath>
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
	double a, b, c, d, h, S, L, C;
	cin >> a >> b >> C;

	h = b * sin(C * M_PI / 180);
	d = b * cos(C * M_PI / 180);
	c = sqrt(pow(a - d, 2) + pow(h, 2));
	S = a*h / 2;
	L = a + b + c;
	printf("%.6f\n%.6f\n%.6f\n", S, L, h);

}

Measured memory_bytes: 1240
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(ll i##_len=(n) ,i=i##_len-1;i>=0;--i)
#define repi(i,a,b) for(ll i=ll(a);i<=ll(b);++i)
#define ALL(f,x,...) ([&](decltype((x)) xxxx) { return (f)(begin(xxxx), end(xxxx), ## __VA_ARGS__); })(x)
#define lim 1000000007ll
#include<bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = std::pair<ll,ll>;
using namespace std;
template<class T>T 
chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>T 
chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template <class T> T 
gcd(T a, T b){if (a < b) {a ^= b;b ^= a;a ^= b;} return b ? gcd(b, a % b) : a;}
template <class T> T 
lcm(T a, T b){return a * b / gcd(a, b);}
vector<char> 
string_to_vector_char(const string& input){vector<char> out(input.length());rep(i,input.length()){out[i]=input[i];}return out;}
map<char,int> 
count_same_elements(const vector<char>& v){map<char,int>cmap; for_each(v.begin(),v.end(),[&cmap](int x){cmap[x]++;}); return cmap; }
template<class A,class B> vector<B> 
mapf(const vector<A>& v,const function<B(A)>& func){vector<B> v_(v.size());rep(i,v.size()){ v_[i]=func(v[i]); }return v_;}
template<class A,class B> vector<B> 
adjacent_map(const vector<A>& v,const function<B(A,A)>& func){vector<B> v_(v.size()-1);rep(i,v.size()-1){ v_[i]=func(v[i+1],v[i]); }return v_;}
template<class A> bool
all_of(const vector<A>& v){bool flag=true;rep(i,v.size()){ if(v[i]<1){flag=false;}; }return flag;}
template<class A> bool
any_of(const vector<A>& v){bool flag=false;rep(i,v.size()){ if(v[i]>0){flag=true; break;}; }return flag;}
template<class A> bool
none_of(const vector<A>& v){bool flag=true;rep(i,v.size()){ if(v[i]>0){flag=false;}; }return flag;}
template<class T,class U>
void msg_with_compare(T A,T B,U A_greater_B,U A_eq_B,U A_less_B){
    if(A==B){cout<<A_eq_B<<"\n";}else if(A>B){cout<<A_greater_B<<"\n";}else{cout<<A_less_B<<"\n";}}
template<class B,class T>
void msg_with_boolean(B A,T true_msg,T false_msg){cout<< ( A? true_msg:false_msg);}
template<class B,class T>
void msg_with_boolean(B A1,B A2,T both_true_msg,T true_false_msg,T false_true_msg,T both_false_msg){
    if(A1){if(A2){cout<<both_true_msg;}else{cout<<true_false_msg;}
    }else{if(A2){cout<<false_true_msg;}else{cout<<both_false_msg;}}
}
template<class T>
void scan_vector(long long size,vector<T>& vector){
    vector.resize(size);
    for(long long i=0;i<size;++i){
        cin>>vector[i];
    }
}

ll n,x;
vector<ll> a;
void input(){
    cin>>n;
    scan_vector(n,a);
}
void src(){
    ll max=0;
    rep(i,n){
        rep(j,n){
            if(i==j) continue;
            chmax(max,abs(a[i]-a[j]));
        }
    }
    cout<<max;
}   

int main(int argc,char* argv[]){
    ios::sync_with_stdio(false);
 //   ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
    input();
    src();    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <utility> // pair
#include <string>
#include <vector>
#define MAX_N 100001
#define rep(i, a, b) for(ll i=a; i<b; i++)
#define rer(i, a, b) for(ll i=a-1; i>=b; i--)
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll n;

signed main(){
    int a, b;
    cin >> a >> b;
    if(b%a==0) cout << a + b;
    else cout << b - a;
    return 0;
}

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

int main(){
  int n,m;
  cin>>n>>m;
  int k[m],s[m][20];
  for(int i=0;i<m;i++){
    cin>>k[i];
    for(int j=0;j<k[i];j++){
      cin>>s[i][j];
    s[i][j]--;
    }
  }
  int p[m];
  for(int i=0;i<m;i++) cin>>p[i];
  	int ans=0;
 	 for(int bit=0;bit<(1<<n);bit++){
    	int a=0;
    
    	for(int i=0;i<m;i++){
      	  int count=0;	
          for(int j=0;j<k[i];j++){
        		if(bit&(1<<s[i][j])) count++;
            }
            if(count%2==0&&p[i]==0) a++;
          if(count%2==1&&p[i]==1) a++;
          
        }
	    if(a==m) ans++;
     }

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

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (int i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,v) for (int i = 0; i < v.size(); i++)
#define RREPALL(i,v) for (int i = v.size()-1; i >= 0; i--)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(v.begin(), v.end())
#define MIN_ELEMENT(v) min_element(v.begin(), v.end())
#define MAX_ELEMENT(v) max_element(v.begin(), v.end())
#define COUNT(v,n) count(v.begin(), v.end(), n)
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
typedef long long ll;
typedef unsigned long long ull;
const int INF = 1e7;
const ll MOD = 1e9 + 7;

//cnt, parent
vector<pair<ll, int>> node(2019 * 100, {0ll, 0});
vector<ll> dp(2019 * 100, -1);

ll cnt(int n)
{
    if (dp[n] == -1) {
        dp[n] = node[n].first + cnt(node[n].second);
    }
    return dp[n];
}

int main()
{
    dp[0] = 0;
    int n, q;
    cin>>n>>q;
    REP(i,n-1) {
        int a, b;
        cin>>a>>b;
        node[b].second = a;
    }
    REP(i,q) {
        int p, x;
        cin>>p>>x;
        node[p].first += x;
    }
    FOR(i,1,n+1) {
        cout<<cnt(i)<<(i == n ? '\n' : ' ');
    }

    return 0;
}


Measured memory_bytes: 7168
package main

import (
	"fmt"
)

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

	for i := 0; i < n; i++ {
		ans += n - i
	}
	ans -= n

	for i := 0; i < m; i++ {
		ans += m - i
	}
	ans -= m
	fmt.Print(ans)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
void debug() {cout<<endl;}
template<typename T,typename... Args>
void debug(T x,Args... args) {cout<<x<<" ";debug(args...);}
#define forn(i,a,b) for(int i=a;i<b;++i)
#define pb push_back
#define F first
#define S second
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;


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

	int n;
	cin >> n;
	set<char> st;
	char c;
	forn(i, 0, n){
		cin >> c;
		st.insert(c);
	}
	if(st.size() == 3)cout << "Three" << endl;
	else cout << "Four" << endl;

}




Measured memory_bytes: 3600
function Main(input){
  inputs=input.split("\n");
  var num=1;
  inputs[1].split("").reduce((pre,value,index)=>{
    if(index<inputs[0]&&pre!=value){num++}
    return value;
  })
  console.log(num);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


Measured memory_bytes: 8396
#include<bits/stdc++.h>
using namespace std;
int main()
{
	
	int b;
	cin>>b;
	char a[100];
	cin>>a;
	int s=strlen(a);
	if(b<s)
	{
		a[b]='\0';
		cout<<a<<"...";
	}
	else
	{
		cout<<a;
	}
}

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

/**
 * 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;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}

	static class Task {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			int X = in.nextInt();
			int ans = 1;
			for(int i = 1; i < X / 2; i++) {
				for(int j = 2; j < X / 2; j++) {
					if(Math.pow(i, j) <= X) {
						ans = (int)Math.max(ans, Math.pow(i, j));
					}
				}	
			}
			out.println(ans);
		}
	}
		
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

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

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

Measured memory_bytes: 19796
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n; cin>>n;
	ll x[101], y[101];
	ll sx=0, sy=0;
	for(int i=0; i<n; i++){
		cin>>x[i]>>y[i];
		sx+=x[i], sy+=y[i];
	}
	ll mx=0;
	for(int i=0; i<n; i++){
		if(x[i]==0 && y[i]==0) continue;
		ll ax=0, ay=0;
		for(int j=0; j<n; j++){
			if(x[i]*y[j]-x[j]*y[i]>=0){
				if(x[i]*y[j]-x[j]*y[i]==0 && (x[i]*x[j]<0 || y[i]*y[j]<0)) continue;
				ax+=x[j], ay+=y[j];
			}
		}
		mx=max({mx, ax*ax+ay*ay, (sx-ax)*(sx-ax)+(sy-ay)*(sy-ay)});
	}
	double ans=sqrt((double)mx);
	printf("%.11lf\n", ans);
	return 0;
}

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

using namespace std;

#define ll long long
#define ini(arr, val) memset(arr, (val), sizeof(arr))
#define loop(i,n)  for(ll i=0; i<n; i++)
#define loop1(i,n)  for(ll i=1; i<=n; i++)

#define all(a)      (a).begin(),(a).end()
#define dupli(a)     unique(all(a)),(a).end()
#define exist(s,e)  (s.find(e)!=s.end())
#define dbg(x)  cout << #x << " is " << x << endl;
#define pt(x) cout<<x<<"\n"
#define pts(x) cout<<x<<" "

#define mp make_pair
#define pb push_back
#define F first
#define S second


#define inf (int)1e9
#define eps 1e-9
#define PI 3.1415926535897932384626433832795
#define mod 1000000007


#define fast    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define test   int t; cin>>t; while(t--)

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef map<int,int> mii;
typedef set<int> si;

typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<pll> vpll;
typedef vector<vl> vvl;
typedef map<ll,ll> mll;
typedef set<ll> sl;


//////////////////////////////////////////////////////////////////////////////////////////
//                      main starts
//////////////////////////////////////////////////////////////////////////////////////////
int const lmt=1e5+5;


int main(){

 //    #ifndef ONLINE_JUDGE
 //    freopen("../input.txt", "r", stdin);
 //    freopen("../output.txt", "w", stdout);
	// #endif
 //    fast

    ll n;
    cin>>n;
  	ll sum=0;
  	loop1(i,n){
  		if(i%3!=0 && i%5!=0) sum+=i; 
  	}
  	pt(sum);
}


/*

// 

*/

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define ff(p,a,b) for(int p=a;p<=b;p++)
#define fo(p,a,b) for(int p=a;p>=b;p--)
#define LL long long
using namespace std;
char temp;
int ans;
int main() {
	while(cin>>temp){
		if(temp=='C'){
			ans=1;
		}
		if(ans==1&&temp=='F'){
			cout<<"Yes\n";
			return 0;
		}
	}
	cout<<"No\n";
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.Math;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//ques No
        int m = sc.nextInt();//ans No

        int p;//ques No
        String s;//kekka

        // Set<Integer> OK = new HashSet<Integer>(); //AC count
        // List<Integer> PENA = new ArrayList<>();//wrong
        // List<Integer> list = new ArrayList<>();

        int[] ok_ar = new int[n];//in first oK
        int[] wa = new int[n];
        int ans1 = 0;

        for(int i = 0;i<n;i++){
            ok_ar[i] = 0;
            wa[i] = 0; 
        }

        for(int i = 0 ; i < m ; i++){
            p = sc.nextInt()-1;
            s = sc.next();

            if(s.equals("WA")){
                wa[p]++;
            }else if(s.equals("AC")){
                if(ok_ar[p] == 0){
                    ans1 = ans1 + wa[p];
                }
                ok_ar[p] = 1;
            }
        }
        int ans2 = 0;
        for(int i= 0;i<n;i++){
            ans2 = ans2 + ok_ar[i];
        }
        System.out.print(ans2 + " "+ ans1);

    }
}

Measured memory_bytes: 63204
h,w=map(int,input().split())
s=[list(input())for i in range(h)]
dx=[0,1,1,1,0,-1,-1,-1]
dy=[1,1,0,-1,-1,-1,0,1]
for i in range(h):
    for j in range(w):
        if s[i][j]==".":
            cnt=0
            for k in range(8):
                x=i+dx[k]
                y=j+dy[k]
                if 0<=x and x<h and 0<=y and y<w and s[x][y]=="#":
                    cnt+=1
            s[i][j]=str(cnt)
for i in s:
    print(*i,sep="")
    

Measured memory_bytes: 3572
#include <algorithm>
#include <cctype>
#include <iostream>
#include <string>

using namespace std;

int main() {
  string str;
  int cs[26] = {};
  while (getline(cin, str)) {
    for (int i = 0; i < str.size(); i++) {
      if (str[i] >= 'a' && str[i] <= 'z') {
        cs[str[i] - 'a']++;
      } else if (str[i] >= 'A' && str[i] <= 'Z') {
        cs[str[i] - 'A']++;
      }
    }
  }
  for (int i = 0; i < 26; i++) {
    cout << (char)('a' + i) << " : " << cs[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 3180
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, n) for(int i = 1; i < n; i++)
#define P pair<int, int>
typedef long long ll;
const int mod = 1e9+7;

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;}

//繰り返し自乗法による累乗計算
//a**n
int pow(int a, int n){
  if(n == 0) return 1;
  if(n%2 == 0){
    int res = pow(a, n/2);
    return res * res;
  }
  return a * pow(a, n-1);
}
//繰り返し自乗法によるmod累乗計算
//a**n (mod)
int modpow(int a, int n){
  if(n == 0) return 1;
  if(n%2 == 0){
    int res = modpow(a, n/2);
    return res * res % mod;
  }
  return a * modpow(a, n-1) % mod;
}
//組み合わせ
//nCa
int com(int n, int a){
  int x = 1, y = 1;
  rep(i,a){
    x *= n-i;
    y *= i+1;
  }
  int res = x / y;
  return res;
}
//組み合わせ(mod)
//nCa (mod)
int modcom(int n, int a){
  int x = 1, y = 1;
  rep(i, a){
    x = x * (n-i) % mod;
    y = y * (i+1) % mod;
  }
  int ans = x * modpow(y, mod-2) % mod;
  return ans;
}
//gcd 最大公約数
int gcd(int x, int y){
  if(x % y == 0) return y;
  return gcd(y, x%y);
}
//lcm 最小公倍数
int lcm(int x, int y){
  return x * y / gcd(x, y);
}
//ngcd n個の最大公約数
int ngcd(vector<int> a){
  int res;
  res = a[0];
  for(int i = 1; i < a.size() && res != 1; i++) {
    res = gcd(a[i], res);
  }
  return res;
}
//nlcm n個の最小公倍数
int nlcm(vector<int> a) {
  int res;
  res = a[0];
  for (int i = 1; i < a.size(); i++) {
    res = lcm(res, a[i]);
  }
  return res;
}
// 素数判定
bool isprime(int x){
  int i;
  if(x < 2) return false;
  else if(x == 2) return true;
  if(x % 2 == 0) return false;
  for(i = 3; i*i <= x; i += 2){
    if(x % i == 0) return false;
  }
  return true;
}
// 桁和
int digsum(int x){
  int res = 0;
  while(x > 0){
    res += x % 10;
    x /= 10;
  }
  return res;
}


int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) cin >> v[i];
  bool ok = false;
  int cnt = 0;

  rep(i,n){
    if(ok){
      ok = false;
    }
    else{
      if(v[i] == i+1){
        ok = true;
        cnt++;
      }
    }
  }
  cout << cnt << endl;
}






Measured memory_bytes: 640
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ull unsigned long long
#define ld long double

#define mod 1000000007
#define EULER 2.7182818284
#define INF 1000000000

#define pb push_back
#define ins insert
#define IT iterator
#define PQ priority_queue
#define    nl           "\n"
#define fi first
#define se second
#define maxe max_element
#define mine min_element
#define er erase
#define lb lower_bound
#define ub upper_bound

#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pi pair<int,int>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define mpi map<int,int>
#define mpl map<ll,ll>
#define umpi unordered_map<int,int>
#define umpl unordered_map<ll,ll>
#define si set<int>
#define sl set<ll>
#define msi multi_set<int>
#define msl multi_set<ll>

#define mem(v,i) memset(v,i,sizeof(v)) // v is array. To set all elements to 0 or -1 only. mem(arr,0);


#define repab(i,a,b) for(int i=(a);i<=(b);i++)
#define reprab(i,a,b) for(int i=(a);i>=(b);i--)
#define repll(i,a,b) for(ll i=(a);i<=(b);i++)
#define rep(i,n) for(int i=(0);i<(n);i++)
#define repr(i,n) for(int i=(n);i>=0;i--)
#define bs bitset
#define bpc(a) __builtin_popcount(a)
#define tc int t;cin>>t;while(t--)
template<typename T> void TIME(T start, T end)
{
#ifndef ONLINE_JUDGE
    double time_taken =  chrono::duration_cast<chrono::nanoseconds>(end - start).count();
    time_taken *= 1e-9;
    cout << "\nExecuted in: " << fixed
         << time_taken << setprecision(9);
    cout << " sec";
#endif
}

int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};

ll max(ll a,ll b)
{
    if(a>b)return a;return b;
}
ll min(ll a,ll b)
{
    if(a<b)return a;return b;
}

ll mypow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll gcd(ll a,ll b)
{
    if(b==0)
    return a;
    return gcd(b,a%b);
}
//..............................!!!!!!Get ready to fight!!!!!!............................


int main()
{   
     auto start = chrono::high_resolution_clock::now();
    fast
    ll x;
    cin>>x;
    ll a,b;
    ll i,j;
    for(i=0;i<1e3;i++){
        for(j=-i;j<=i;j++){
            if(mypow(i,5)==mypow(j,5)+x)
            {
                cout<<i<<" "<<j;
                return 0;
            }
        }
    }
    auto end = chrono::high_resolution_clock::now();
    TIME(start, end);
    return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o<<endl;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>F,R;void setF(int n,int mod){F=R=V<ll>(++n);F[0]=1;FOR(i,1,n)F[i]=F[i-1]*i%mod;R[n-1]=modInv(F[n-1],mod);FORR(i,n-1,1)R[i-1]=R[i]*i%mod;}
//ll comb(int a,int b,int m){return a<b||b<0?0:F[a]*R[b]%m*R[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7; //998244353;
const int N = 1e5+1;
typedef P<int, int> pii;
int n, m, c[N];
ll e[N];
bool z[N];
queue<int> q;
struct UnionFind{
  vector<int> p;
  int g;
  void init(int n){
    p.assign(n, -1);
    g = n;
  }
  int find(int a){
    return p[a] < 0 ? a : p[a] = find(p[a]);
  }
  bool merge(int a, int b){
    a = find(a);
    b = find(b);
    if(a==b) return 0;
    g--;
    if(p[a]>p[b]) swap(a, b);
    p[a] += p[b];
    p[b] = a;
    return 1;
  }
} uf;

void draw(int a, int b){
  e[a] = e[a] * modInv(b, MOD) % MOD; if(--c[a] == 1) q.push(a);
  e[b] = e[b] * modInv(a, MOD) % MOD; if(--c[b] == 1) q.push(b);
  printf("%d %d\n", a, b);
  z[a] ^= true;
}
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  scanf("%d %d", &n, &m);
  if(m%2){
    printf("-1\n");
    return 0;
  }
  uf.init(n+1);
  fill(e, e+n+1, 1ll);
  FOR(i, 0, m){
    int a, b;
    scanf("%d %d", &a, &b);
    if(uf.merge(a, b)){
      e[a] = e[a]*b%MOD; c[a]++;
      e[b] = e[b]*a%MOD; c[b]++;
    }else{
      printf("%d %d\n", a, b);
      z[a] ^= true;
    }
  }
  FOR(i, 1, n+1) if(c[i]==1) q.push(i);
  while(!q.empty()){
    int t = q.front(); q.pop();
    if(c[t] != 1) continue;
    z[t] ? draw(t, e[t]) : draw(e[t], t);
  }
}

Measured memory_bytes: 3200
import java.util.*;

public class Main {


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

        for (int i = 0; i < n; i++) {

            a[i] = in.nextInt();

        }


        for (int i = n - 2; i >= 0; i--) {

            if (a[i] > a[i+1]) {
                if (Math.abs(a[i] - a[i + 1]) > 1) {
                    System.out.println("No");
                    return;
                } else {
                    a[i]--;
                }
            }

        }

        System.out.println("Yes");

    }


}


Measured memory_bytes: 48344
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;




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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define print(A,n) for(ll i=0;i<n;++i)cout<<A[i]<<' ';cout<<endl;
#define take(A,n) for(ll i=0;i<n;++i)cin>>A[i];
//    for(auto& it : m)
void fastio(){ios_base::sync_with_stdio(false);cin.tie(NULL);}
//  priority_queue<ll int> pq;
//  priority_queue <ll int, vector<ll int>, greater<ll int> > pq;
//  vector<ll int> v;
//  vector< pair<ll int,ll int> > v;
//  set<ll int>::iterator it=s.begin();
//  unordered_map<  pair<ll int,ll int>, ll int> mp;

 

ll int power(ll int x, ll int y, ll int p)  
{  
    ll int res = 1;     // Initialize result  
  
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  

void computeLPSArray(string pat, int M, int* lps) 
{ 
    // length of the previous longest prefix suffix 
    int len = 0; 
  
    lps[0] = 0; // lps[0] is always 0 
  
    // the loop calculates lps[i] for i = 1 to M-1 
    int i = 1; 
    while (i < M) { 
        if (pat[i] == pat[len]) { 
            len++; 
            lps[i] = len; 
            i++; 
        } 
        else // (pat[i] != pat[len]) 
        { 
            // This is tricky. Consider the example. 
            // AAACAAAA and i = 7. The idea is similar 
            // to search step. 
            if (len != 0) { 
                len = lps[len - 1]; 
  
                // Also, note that we do not increment 
                // i here 
            } 
            else // if (len == 0) 
            { 
                lps[i] = 0; 
                i++; 
            } 
        } 
    } 
}
bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
  
    // This is checked so that we can skip  
    // middle five numbers in below loop 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
} 
  

int main()
{
  fastio();

 
ll int T;
T=1;

while(T--)
{ 
ll int a,v,b,w,t;
cin>>a>>v>>b>>w>>t;
if(v<=w)
{
cout<<"NO"<<endl;
}
else
{
  if(abs(v-w)*t<abs(a-b))
    cout<<"NO"<<endl;
  else
    cout<<"YES"<<endl;
}

}



    
  



    return 0;
}


Measured memory_bytes: 3616
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using ull = unsigned long long;
using ll = long long;
using namespace std;

int main(void) {

    vector<vector<char>> a(3, vector<char>(3));
    for(int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> a[i][j];
        }
    }

    int out;
    cout << a[0][0] << a[1][1] << a[2][2] << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){    
int m, f, r;    
while(1){        
scanf("%d %d %d ", &m, &f, &r);        
if(m==-1&&f==-1&&r==-1)break;        
if(m==-1||f==-1){            
printf("F\n");        }
else if(m+f>=80){            
printf("A\n");        }
else if(m+f>=65){            
printf("B\n");        }
else if(m+f>=50){            
printf("C\n");        }
else if(m+f>=30){            
if(r>=50){                
printf("C\n");            }
else{                
printf("D\n");            }        
}
else{            
printf("F\n");        
}    
}    
return 0;
}


Measured memory_bytes: 2036
a=input().split()
A=[]
A.append(int(a[0]))
A.append(int(a[1]))
A.append(int(a[2]))
A.append(int(a[3]))
A.sort()
if ( (A[0]==1)and(A[1]==4)and(A[2]==7)and(A[3]==9)):
 print("YES")
else:
 print("NO")

Measured memory_bytes: 3064
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <functional>
#include <map>
#include <set>
#include <tuple>
#include <cassert>
#include <bitset>
using namespace std;
int main(){
    int a,b,i,N;
    cin >> N;
    int h[N];
    int A[N];
    for(i = 0;i < N;i++) cin >> h[i];
    A[0] = 0;
    A[1] = abs(h[0] - h[1]);
    for(i = 2;i < N;i++){
        a = A[i - 2] + abs(h[i - 2] - h[i]);
        b = A[i - 1] + abs(h[i - 1] - h[i]);
        if(a < b){
            A[i] = a;
        }
        else{
            A[i] = b;
        }
    }
    cout << A[N - 1] << endl;
}

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

int main()
{
    int n;
    cin>>n;
    int arr[n+5];
    for(int i=0;i<n;i++)cin>>arr[i];
    long long sum=0;
    for(int i=0;i<n;i++)sum+=arr[i];
    long long counter=1e9,flag=0;

    for(int i=0;i<n-1;i++)
    {
         flag += arr[i];
      //  long long p = sum-k;
        counter=min(counter,abs(flag-(sum-flag)));
    }
    cout<<counter<<endl;
}


Measured memory_bytes: 256
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        long c = scanner.nextLong();
        long k = scanner.nextLong();
        long ans = k;
        if(k <= a){System.out.println(ans);return;}
        else if(k <= a+b){System.out.println(ans-(k-a));return;}
        else{System.out.println(ans-b-(k-a-b)*2);return;}
    }
}



Measured memory_bytes: 35784
import java.util.*;

public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        String[] A = new String[H];
        char[][] a = new char[H][W];
        boolean[][] h = new boolean[H][W];
        boolean[][] w = new boolean[H][W];
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                h[i][j] = false;
                w[i][j] = false;
            }
        }
        for (int i = 0; i < H; i++) {
            A[i] = sc.next();
        }
        for (int i = 0; i < H; i++) {
            a[i] = A[i].toCharArray();
        }
        lavel:
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                if (a[i][j] == '#') {
                    for (int k = 0; k < W; k++) {
                        h[i][k] = true;
                    }
                    continue lavel;
                }
            }
        }
        lavel:
        for (int i = 0; i < W; i++) {
            for (int j = 0; j < H; j++) {
                if (a[j][i] == '#') {
                    for (int k = 0; k < H; k++) {
                        w[k][i] = true;
                    }
                    continue lavel;
                }
            }
        }
        for (int i = 0; i < H; i++) {
            int c = 0;
            for (int j = 0; j < W; j++) {
                if (h[i][j] && w[i][j]) {
                    System.out.print(a[i][j]);
                } else {
                    c++;
                }
            }
            if (c != W) {                
                System.out.println();
            }
            c = 0;
        }
    }
}


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

int main(){
  int N;
  cin >> N;
  
  long long sum = 0;
  
  for(int i=1;i<=N;i++){
    if(i%3!=0 && i%5!=0){
      sum += i;
    }
  }
  
  cout << sum << endl;
}


Measured memory_bytes: 3636
// C++(Clang 10.0.0)

//GCC用 ナゾです
//#pragma GCC target("avx")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")

#include <iostream>
#include <stdio.h>
#include <stdlib.h> //rand() 0~RAND_MAX2147483647
#include <math.h>
#include <time.h>   //srand((unsigned int)time(NULL));
#include <unistd.h> //sleep
#include <algorithm>
#include <cmath>
#include <vector>
#include <regex> //正規表現
#include <map>
#include <unordered_map>
#include <set>
#include <cassert> //assart(x>=0) -> x<0の時異常終了
#include <numeric>
#include <iterator>
#include <list>
#include <tuple>
#include <queue>

using namespace std;
#define ll long long int
#define FOR(i,min,max) for(ll i=(min);i<(max);i++)
#define FOReq(i,min,max) for(ll i=(min);i<=(max);i++)
#define FORREV(i,max,min) for(ll i=(max)-1;i>=(min);i--)
#define FORREVeq(i,max,min) for(ll i=(max);i>=(min);i--)

#define all(vec) (vec).begin(),(vec).end()

const int MOD=1e9+7;
const int MOD2=998244353;
const int not0=1;
const int INF=2000000001;
const ll INFll=2e18;
//const int MAX_V=10000;
const double  Micro=1e-5;

int UnUsedVariable(){
    if(INF || Micro || MOD || INFll || MOD2 || not0){;}
    return 0;
}

#define inarray(array,min,max) FOR(i,min,max){cin>>array[i];}
#define inarrayW(arrayA,arrayB,min,max) FOR(i,min,max){cin>>arrayA[i]>>arrayB[i];}
#define br printf("\n");
#define OutputAndReturn0(x) {cout<<(x)<<endl;return 0;}
#define elif else if

#define issame(a,b,c,d) ((a)==(b) and (b)==(c) and (c)==(d))
#define isdiff3(a,b,c) ((a)!=(b) and (b)!=(c) and (c)!=(a))
#define isdiff4(a,b,c,d) ((a)!=(b) and (b)!=(c) and (c)!=(a) and (d)!=(a) and (d)!=(b) and (d)!=(c))
#define isdiff5(a,b,c,d,e) ((a)!=(b) and (b)!=(c) and (c)!=(a) and (d)!=(a) and (d)!=(b) and (d)!=(c) and (e)!=(a) and (e)!=(b) and (e)!=(c) and (e)!=(d))
#define Func3(f,a,b,c) (f)((f)((a),(b)),(c))
#define Func4(f,a,b,c,d) (f)((f)((f)((a),(b)),(c)),(d))

inline int isEven(int x){return x%2==0;}
inline int isOdd (int x){return x%2==1;}
inline ll samepair(ll x){return x*(x-1)/2;}
inline ll  gcd(ll a,ll b){ if(b==0)return a;else return gcd(b,a%b);}//最大公約数 なお一方が0なら答えは他方になるので番兵は０で良い また、負の数もOK -4%3=-1となるため
inline ll  lcm(ll a,ll b){return a*b/gcd(a,b);}//MODやオーバーフローには注意！
//inline ll  ceil(double a){return (ll)a+1;}
//ans = accumulate(A, A+N, 0, [](int a, int b) {return gcd(a,b);});
//auto count = std::count_if(v.begin(), v.end(), [](int x) { return x == 1 || x == 3; } );

ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};

//累積和　しゃくとり法　木構造　DP キュー　乱択アルゴリズム　嘘解法　ハッシュ　next_permulation

//課題：DP 木構造　Xor

ll probNow(){
    ll ans;ans=0;
    ll K,N;
    cin>>K>>N;
    ll A[N];
    ll B[N];
    
    inarray(A, 0, N);
    FOR(i, 0, N-1){
        B[i]=A[i+1]-A[i];
    }
    B[N-1]=K+A[0]-A[N-1];
    sort(B, B+N);
    
    
    OutputAndReturn0(K-B[N-1]);
    return 0;
}

signed main(){
    cin.tie(0);    //cinとcoutの結び付き解除（cout時にcinの内容を吐き出さなくなる）
    ios::sync_with_stdio(false);  //coutとprintfの結び付き解除（coutとprintfを同時に使うな！）
    probNow();
    return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <cstring>
char str[10];
using namespace std;
int main()
{
	cin >> str;

	if( strcmp(str,"SUN")==0) cout << 7;
	if( strcmp(str,"MON")==0) cout << 6;	
	if( strcmp(str,"TUE")==0) cout << 5;	
	if( strcmp(str,"WED")==0) cout << 4;
	if( strcmp(str,"THU")==0) cout << 3;	
	if( strcmp(str,"FRI")==0) cout << 2;	
	if( strcmp(str,"SAT")==0) cout << 1;
		
	return 0;
}

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

using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  // 入力
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  // 解答
  cout << min(a, b) + min(c, d) << endl;

  return 0;
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

#[allow(unused_macros)]
macro_rules! scan {
  ($e:expr; $t:ty) => {
    $e.get::<$t>()
  };
  ($e:expr; $($t:ty), *) => {
    ($($e.get::<$t>(),)*)
  }
}

struct Scanner<R: BufRead> {
  reader: R,
  iter: std::vec::IntoIter<String>
}

#[allow(dead_code)]
impl<R: BufRead> Scanner<R> {
  fn new(reader: R) -> Scanner<R> {
    Scanner { reader, iter: vec![String::new()].into_iter() }
  }
  fn new_line(&mut self) {
    let mut line = String::new();
    self.reader.read_line(&mut line).ok();
    self.iter = line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>().into_iter();
  }
  fn get<T: FromStr>(&mut self) -> T {
    self.iter.next().unwrap().parse().ok().unwrap()
  }
  fn get_line(&mut self) -> String {
    let mut line = String::new();
    self.reader.read_line(&mut line).ok();
    line.trim().to_string()
  }
}

fn main() {
  let cin = stdin();
  let cin = cin.lock();
  let mut scanner = Scanner::new(cin);
  let w = scanner.get_line();
  let mut ans = 0;
  loop {
    let t = scanner.get_line();
    if t == "END_OF_TEXT" {
      break;
    }
    for w_ in t.split_whitespace() {
      let w_: String = w_.to_string().chars().map(|c| {
        if c.is_uppercase() {
          c.to_lowercase().to_string()
        }
        else {
          c.to_string()
        }
      })
      .collect();
      if w == w_ {
        ans += 1;
      }
    }
  }
  println!("{}", ans);
}



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

int main() {
  string S, T;
  cin >> S >> T;
  int ans = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] != T[i]) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3812
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

class DEqualCut {
public:
    void solve(istream& in, ostream& out) {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        int n,x,z;
        ll ans=LLONG_MAX,b,c,d,e;
        in>>n;
        vector<ll> a(n),s(n+1);
        fr(i,n) in>>a[i],s[i+1]=s[i]+a[i];
        for(int y=2;y<n-1;++y){
            x=lower_bound(s.begin()+1,s.begin()+y,s[y]/2)-s.begin();
            if(x==y||(x>1&&abs(s[y]-2*s[x])>abs(s[y]-2*s[x-1]))) --x;
            z=lower_bound(s.begin()+y+1,s.end(),(s[n]-s[y])/2+s[y])-s.begin();
            if(z==n||(z>y+1&&abs(s[n]+s[y]-2*s[z])>abs(s[n]+s[y]-2*s[z-1]))) --z;
            ans=min(ans,max({s[x],s[y]-s[x],s[z]-s[y],s[n]-s[z]})-min({s[x],s[y]-s[x],s[z]-s[y],s[n]-s[z]}));
            //cout<<max({s[x],s[y]-s[x],s[z]-s[y],s[n]-s[z]})-min({s[x],s[y]-s[x],s[z]-s[y],s[n]-s[z]})<<endl;
            //cout<<0<<" "<<x<<" "<<y<<" "<<z<<" "<<n<<endl;
        }
        out<<ans<<endl;
    }
};

int main() {
    DEqualCut solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3456