akhauriyash/Code-Regression huggingface dataset:
import sys
N, W = input().split()
aArr = list()
ans = 0
tmp = int(N)
MOD = 10 ** 9 + 7
aArr = set(map(int, sys.stdin))

tmp = 0
tmpB = 0
ans = 1
for i in range(int(N)):
    if (i in aArr):
        tmp = 0
    elif i < 2:
        tmp = 1
    else:
        tmp = ans
    ans = (tmp + tmpB) % MOD
    tmpB = tmp
print(ans)


Measured memory_bytes: 11884
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>

using namespace std;

int main() {
	int i, j, H, W, N;
	int a, b;
	long sum = 0;

	map<pair<int, int>, int> mp;

	cin >> H >> W >> N;

	for (i = 0; i < N; i++) {
		cin >> a >> b;

		//if (a - 1 < 1 || a + 1 > H || b - 1 < 1 || b + 1 > W) continue;
		//mp.insert(<a-1,b-1>,())

		//if (a - 1 < 1 || b - 1 < 1) continue;
		/*
		mp[pair<int,int>(a - 1, b - 1)]++;
		mp[pair<int, int>(a - 1, b )]++;
		mp[pair<int, int>(a - 1, b + 1)]++;
		mp[pair<int, int>(a , b - 1)]++;
		mp[pair<int, int>(a , b )]++;
		mp[pair<int, int>(a , b + 1)]++;
		mp[pair<int, int>(a + 1, b - 1)]++;
		mp[pair<int, int>(a + 1, b )]++;
		mp[pair<int, int>(a + 1, b + 1)]++;
		*/

		for (j = -1; j < 2; j++) {
			for (int k = -1; k < 2; k++) {

				if (a + j < 2 || a + j > H-1 || b + k < 2 || b + k > W-1) continue;
				//if (a + k < 1 || a + k > H || b + k < 1 || b + k > W) continue;
				//cout << "y->" << a + j << " x->" << b + k << endl;
				mp[pair<int, int>(a + j, b + k)]++;
				

			}
		}

	}

	vector<long long> cnt(10, 0); 
	for( auto it = mp.begin(); it != mp.end(); it++) {
		//cout << "it.second->" << it->second << endl;
		cnt[it->second]++;
		sum++;
	}

	cnt[0] = (long long)(H-2)*(W-2) - sum;

	for (i = 0; i < 10; i++) {
		//cout <<"cnt["<<i << "] "<< cnt[i] << endl;
		cout << cnt[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 56448
#pragma GCC optimize(2)
#pragma GCC optimize(3)   
#include<bits/stdc++.h>
#include<cstdlib>
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds; 
//#define ordered_set tree<pair<int,int>, null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update>
typedef long long ll;
typedef vector < ll > vl;
typedef vector < vl > vvl;
typedef pair < ll, ll > pll;
typedef long double ld;
typedef vector < pair < ll, ll > > vpll;
#define Boost() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define forn(i,n) for (ll i = 0; i < n; i++)
#define fo(i,n) for (ll i = 1; i <= n; i++)
#define fore(i,l,r) for (ll i = l; i <= r; i++)
#define rev(i,n) for(ll i=n-1;i>=0;i--)
#define all(c) c.begin(), c.end()
#define go(c,it) for(auto it=(c).begin(); it!=(c).end(); it++)
//#define back(c,it) for(auto it=(c).rbegin(); it!=(c).rend(); it++)
#define fi first
#define se second
#define MOD 998244353
#define MAX 1000000007
#define N 2000009
#define N1 100007
ll power(ll a,ll b){ll res=1;a=a%MOD;while(b>0){if(b&1){res=(res*a)%MOD;}a=(a*a)%MOD;b>>=1;}return res;}
ll fact[500009];
ll fermat_inv(ll y){return power(y,MOD-2);}
ll nCrMod(ll n, ll r){ ll p=fact[n];ll q=(fact[r]*fact[n-r])%MOD;return (p*fermat_inv(q))%MOD;} 
ll gcd(ll a, ll b){return (b==0)?a:gcd(b,a%b);}
const ld PI = acos(-1.0);
vl g[N1];

  int main(){
      #ifndef ONLINE_JUDGE
      freopen("input.cpp","r",stdin);
      freopen("output.cpp","w",stdout);
      #endif
      Boost();
      int t;
      //cin>>t;
      t=1;
      int t1=t;
      while(t--)
      {
        ll n;
        cin>>n;
        ll a[n+1];
        fo(i,n)
        cin>>a[i];
        ll ans=0;
        fo(i,n)
        {
          if(i&1&&a[i]&1)
            ans++;
        }
        cout<<ans<<endl;
      }
      
      return 0;
  }

Measured memory_bytes: 5956
import java.io.*;
import java.util.*;
class Main{
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int n = saori.saori_hayami();
		char[] c = saori.nextHayami().toCharArray();
		int a = 0;
		for(int i = 0;i < c.length;i++){
			a = (int)c[i];
			a =  a + n;
			if(a > 90){
				a = a -90 + 64;
			}
			c[i] = (char)a;
		}
		for(int i = 0;i < c.length;i++){
			System.out.print(c[i]);
		}
		System.out.println("");

		
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 24020
#include <bits/stdc++.h>
using namespace std;
#define all(V) V.begin(),V.end()

int main() {
	int N;
	cin >> N;
	vector<int> X(N);
	for (int i = 0;i < N;i++) cin >> X[i];
	sort(all(X));
	cout << X[N / 2] - X[N / 2 - 1] << endl;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 

vll dp(100100);

ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;	
  	ci(n);
  vdb A(n);
  FOR(i,0,n){
   	ci(A[i])
  }
  db ans=0;
  FOR(i,0,n){
    ans+=1/A[i];
  }
  cout<<fixed<<setprecision(10)<<1/ans<<endl;
}

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

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MIN(a,b) ((a)>(b)? (b): (a))
#define MAX(a,b) ((a)<(b)? (b): (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

int main(){
    int n, k;
    cin >> n >> k;
    vector<int> p;
    rep(i,n){
        int tmp;
        cin >> tmp;
        p.push_back(tmp);
    }
    sort(p.begin(), p.end());
    ll cnt = 0;
    rep(i,k){
        cnt += p[i];
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3600
N = int(input())
S = [input() for i in range(N)]
ac = 0
wa = 0 
tle = 0
re = 0
for n in range(N):
    if S[n] == "AC" :
        ac = ac + 1
    elif S[n] == "WA" :
        wa = wa + 1
    elif S[n] == "TLE" :
        tle = tle + 1
    elif S[n] == "RE" :
        re = re + 1

ans1 = "AC x  " + str(ac)
ans2 = "WA x  " + str(wa)
ans3 = "TLE x  " + str(tle)
ans4 = "RE x  " + str(re)

print(ans1)
print(ans2)
print(ans3)
print(ans4)

Measured memory_bytes: 16332
#include<bits/stdc++.h>
using namespace std;
char s[7];
int flag[37],z;
int main(){
	scanf("%s",s);
	for(int i=0;i<4;i++)
		flag[s[i]-'A']++;
	for(int i=0;i<26;i++)
		if(flag[i]==2)z++;
	if(z==2)puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 256
package main

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

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	t, _ := strconv.Atoi(sc.Text())
	return t
}

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	A := nextInt(sc)
	B := nextInt(sc)
	M := nextInt(sc)
	a := make([]int, A)
	b := make([]int, B)
	x := make([]int, M)
	y := make([]int, M)
	c := make([]int, M)
	mina := int(1e10)
	for i := range a {
		a[i] = nextInt(sc)
		mina = min(mina, a[i])
	}
	minb := int(1e10)
	for i := range b {
		b[i] = nextInt(sc)
		minb = min(minb, b[i])
	}
	minc0 := mina + minb
	minc1 := int(1e12)
	for i := 0; i < M; i++ {
		x[i] = nextInt(sc)
		x[i]--
		y[i] = nextInt(sc)
		y[i]--
		c[i] = nextInt(sc)
		if x[i] < A && y[i] < B {
			minc1 = min(minc1, (a[x[i]] + b[y[i]] - c[i]))
		}
	}
	fmt.Println(min(minc0, minc1))
}


Measured memory_bytes: 7552
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		String answer = "No";

		if(a < b){
			if(b < c){
				answer ="Yes";
			}
		}
		System.out.println(answer);
		scan.close();
	}
}

Measured memory_bytes: 26312
#include<bits/stdc++.h>
using namespace std;
#define int long long 
#define forn(i,_n) for(int i=0;i<=(_n);++i)
#define forab(i,_a,_b) for(int i=(_a);i<=(_b);++i)
#define forrn(i,_n) for(int i=n-1;i>=0;--i)
#define forrab(i,_a,_b) for(int i=_a;i>=b;--i) 
#define tcase int t;cin>>t;while(t--)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);

typedef vector<int>vi;
typedef pair<int,int>ii;
typedef vector<ii>vii;
typedef set<int>si;
typedef map<string,int>msi;
typedef map<int,int>mii;
int mod=pow(10,9)+7;
int n,a,b,c;
void solve(){
 	cin>>a>>b>>c;
 	int x=c-a+b;
 	if(x>0)
 	cout<<x<<endl;
 	else cout<<0<<endl;
}
int32_t main(){
	//#ifndef ONLINE_JUDGE
		//freopen("input.txt","r",stdin);
		//freopen("output.txt","w",stdout);
	//#endif
	fastio
	solve();
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
 
/* 
The read function reads a string according to each one. 
*/
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


//main function
fn main() {
    let h: usize = read();
    let _w: usize = read();
    for _i in 0..h{
	let string: String = read();
	println!("{}",string);
	println!("{}",string);
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define pii pair<int, int>
#define sz size()
#define pb push_back

using namespace std;

string s;
int n, ans;
vector <char> v;

int main() {
    cin >> n >> s;
    s += '#';
    for (int i = 1; i <= n; i ++) {
        if (s[i] != s[i - 1]) {
            v.pb(s[i - 1]);
        }
    }
    cout << v.sz;
}


Measured memory_bytes: 640
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <cassert>

using namespace std;

typedef long long int tint;

#define forsn(i,s,n) for(int i=(s); i<(int)(n); i++)
#define forn(i,n) forsn(i,0,n)

int a[128];

int main() {
	int n; cin >> n;
	forn(i,n) cin >> a[i];
	
	int sum = accumulate(a, a + n, 0);
	
	int best = 0;
	forn(i,n) if (abs(n * a[i] - sum) < abs(n * a[best] - sum)) best = i;
	
	cout << best << endl;
}


Measured memory_bytes: 256
// dd.cpp : 定义控制台应用程序的入口点。
//

//#include "stdafx.h"
#include<vector>
#include<string>
#include<unordered_set>
#include<iostream>
using namespace std;

int main()
{
	int n, e, a, b, c;
	cin >> n >> e;
	vector<vector<int>> edges(n + 1, vector<int>(n + 1, 10000));
	vector<vector<unordered_set<string>>> edges_set(n + 1, vector<unordered_set<string>>(n + 1));
	unordered_set<string> paths;
	for (int i = 1; i <= n; i++)
		edges[i][i] = 0;
	for (int i = 0; i < e; i++)
	{
		cin >> a >> b >> c;
		edges[a][b] = edges[b][a] = c;
		edges_set[a][b].insert(to_string(a) + "," + to_string(b));
		edges_set[b][a].insert(to_string(b) + "," + to_string(a));
		//paths.insert(to_string(a) + "," + to_string(b));
		//paths.insert(to_string(b) + "," + to_string(a));
	}
	for (int mid = 1; mid <= n; mid ++)
		for (int left = 1; left <= n; left++)
			for (int right = 1; right <= n; right++)
			{
				if (left == right)
					continue;
				if (edges[left][mid] + edges[mid][right] < edges[left][right])
				{
					edges[left][right] = edges[left][mid] + edges[mid][right];
					edges_set[left][right].clear();
					if (left != mid)
						for (auto t : edges_set[left][mid])
							edges_set[left][right].insert(t);
					if (right != mid)
						for (auto t : edges_set[mid][right])
							edges_set[left][right].insert(t);
					//edges_set[left][right]. = edges_set[left][mid] + edges_set[mid][right];
				}
			}

	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
		{
			if (i == j)
				continue;
			for (auto t : edges_set[i][j])
				paths.insert(t);
		}
	cout << (2 * e - paths.size()) / 2 << endl;
    return 0;
}


Measured memory_bytes: 5248
#include <bits/stdc++.h>
int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  size_t n; std::cin >> n;
  std::vector<int> a(n);
  for (size_t i = 0; i < n; i++) {
    std::cin >> a[i];
  }
  int ret = 0;
  for (size_t i = 1; i < n - 1; i++) {
    std::vector<int> b = {a[i - 1], a[i], a[i + 1]};
    std::sort(b.begin(), b.end());
    ret += (b[1] == a[i]);
  }
  std::cout << ret << std::endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <queue>
#include <stack>
#include <set>
#include <time.h>
#define _USE_MATH_DEFINES
#define LL long long
using namespace std;
const double PI = acos(-1.0);

int max_num(int ary[],int length) {
	int max = ary[0];
	for (int i = 1; i < length; i++)
		if (max < ary[i]) max = ary[i];
	return max;
}

int max_ord(int ary[], int length) {
	int max;
	max = max_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == max) return i;
	}
	return -1;
}

int min_num(int ary[], int length) {
	int min = ary[0];
	for (int i = 1; i < length; i++)
		if (min > ary[i]) min = ary[i];
	return min;
}

int min_ord(int ary[], int length) {
	int min;
	min = min_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == min) return i;
	}
	return -1;
}


int main() {
	int x, cnt = 0;
	cin >> x;
	int i = 0;
	while (i*(i + 1) / 2 < x) i++;
	cout << i << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	long long int a, b, lot;
	
	int j, k,t;
	int astr[100];
	int bstr[100];
	long long int acheck,bcheck,asum,bsum,min;


	scanf("%lld", &lot);
	min = lot;


		for (t = 1; t < lot; t++)
		{
			int m = 0, n = 0;
			asum = 0; bsum = 0;
			a = lot - t;
			b = t;
			acheck = a;
			bcheck = b;
			while (acheck) //桁数チェック
			{
				acheck = acheck / 10;
				m++;
			}


			for (j = 0; j < m; j++)  //配列に入れる
			{
				acheck = a;

				if (j == 0)
				{
					astr[j] = acheck % 10;
				}
				else if (j != 0)
				{
					for (k = 0; k < j; k++)
					{
						acheck = acheck / 10;
					}
					astr[j] = acheck % 10;

				}
			}


			while (bcheck) //桁数チェック
			{
				bcheck = bcheck / 10;
				n++;
			}


			for (j = 0; j < n; j++)  //配列に入れる
			{
				bcheck = b;

				if (j == 0)
				{
					bstr[j] = bcheck % 10;
				}
				else if (j != 0)
				{
					for (k = 0; k < j; k++)
					{
						bcheck = bcheck / 10;
					}
					bstr[j] = bcheck % 10;

				}
			}


			for (j = m - 1; j >= 0; j--)  //出力
			{
				asum += astr[j];
			}
			for (j = n - 1; j >= 0; j--)  //出力
			{
				bsum += bstr[j];
			}

			if (min > asum + bsum)
			{
				min = asum + bsum;
			}

		}
	

	printf("%lld\n", min);

	return 0;


	
}

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

int main()
{
    int n, m, i, j, ans[50];
    long long int a[50], b[50], c[50], d[50], dist[50];
    scanf("%d%d", &n, &m);
    for (i=0; i<n; i++)
    {
        scanf("%lld%lld", &a[i], &b[i]);
    }
    for (i=0; i<m; i++)
    {
        scanf("%lld%lld", &c[i], &d[i]);
    }
    for (i=0; i<n; i++)
    {
        dist[i] = 1000000000;
        for (j=0; j<m; j++)
        {
            if (llabs(a[i]-c[j]) + llabs(b[i]-d[j]) < dist[i])
            {
                dist[i] = llabs(a[i]-c[j]) + llabs(b[i]-d[j]);
                ans[i] = j;
            }
        }
    }
    for (i=0; i<n; i++)
    {
        printf("%d\n", ans[i]+1);
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <bits/stdc++.h>

using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++)
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;

int main() {

    string a,b;
    cin >> a >> b;

    ll N = stoi(a+b);

    string res = "No";

    for(ll i = 1; i*i <= 100100; ++i)
    {
        if(i*i == N)
        {
            res = "Yes";
            break;
        }
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

vector<double> A(6),B(6);
double f(double x){
	double ans = 0.0;
	for(int i=0;i<6;++i){
		ans += max(A[i]*x,B[i]*(1-x));
	}
	return ans;
}
void solve(){
	for(int i=0;i<6;++i){cin >> A[i];}
	for(int i=0;i<6;++i){cin >> B[i];}
	double L = 0.0;
	double R = 1.0;
	while( abs(R-L) > EPS){
		double midL,midR;
		double midLval,midRval;
		midL = (L*2+R)/3;
		midR = (L+R*2)/3;
		midLval = f(midL);
		midRval = f(midR);
		if( midRval < midLval ){
			L = midL;
		}else{
			R = midR;
		}
	}
	cout << f(R)/100 << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

int main()
{
    int n;
    cin >>n;
    vector<int> d(n);
    rep(i,n) cin >>d[i];

    int m;
    cin >>m;
    vector<int> t(m);
    rep(i,m) cin >>t[i];

    sort(all(d));
    sort(all(t));

    int j=0;
    rep(i,n)
    {
        if(j==m) break;

        if(d[i]==t[j]) ++j;
    }

    string ans = "NO";
    if(j==m) ans="YES";
    cout << ans << endl;
    return 0;
}


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

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

   if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) {
       cout << "Possible" << endl;
   } else {
       cout << "Impossible" << endl;
   }
}

Measured memory_bytes: 256
def main():
    n = int(input())
    indic = dict()

    s = input()
    slen = len(s)
    for i in range(slen):
        a = s[i]
        if a in indic:
            indic[a] += 1
        else:
            indic[a] = 1
    

    for _ in range(1, n):
        s = input()
        slen = len(s)
        sdic = dict()
        tmplis=list()
        for i in range(slen):
            a = s[i]
            if a in sdic:
                sdic[a] += 1
            else:
                sdic[a] = 1

        for key in indic:
            if key not in sdic:
                tmplis.append(key)
            else:
                if indic[key] > sdic[key]:
                    indic[key] = sdic[key]

        for word in tmplis:
            indic.pop(word) 

    anslis = list()
    indic = sorted(indic.items())

    for j in range(len(indic)):
        a = indic[j][0]
        num = indic[j][1]
        anslis.append(a * num)
    print(*anslis, sep="")


if __name__ == "__main__":
    main()

Measured memory_bytes: 71684
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;

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

Measured memory_bytes: 1024
#include <iostream>

using namespace std;

int N;
long long Y;
long long x, y, z, man_max, gosen_max, sen_max;

int main()
{
  cin >> N >> Y;
  man_max = Y / 10000;
  for(int i = 0; i <= man_max; i++) {
    long long man_temp = Y - 10000 * i;
    gosen_max = man_temp / 5000;
    for(int j = 0; j <= gosen_max; j++) {
      long long gosen_temp = man_temp - 5000 * j;
      int k = gosen_temp / 1000;
      long long amari = gosen_temp % 1000;
      // cout << z << " ";

      if((i + j + k == N) && amari == 0) {
        cout << i << " " << j << " " << k << endl;
        return 0;
      }
    }
  }
  if(x == 0)
    cout << "-1 -1 -1" << endl;

  return 0;
}

Measured memory_bytes: 256
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const A = arg[1].split(" ").map(n=>parseInt(n));
    
    let answer = 0;
    
    for(let i=0; i<N; i++) {
        for(let j=i+1; j<N; j++) {
            for(let k=j+1; k<N; k++) {
                if(A[i] === A[j] || A[j] === A[k] || A[i] === A[k]) {
                    continue;
                }
                
                if(A[i] + A[j] > A[k] && A[j] + A[k] > A[i] && A[k] + A[i] > A[j]) {
                    answer++;   
                    
                    // console.log("A[i]:" + A[i]);
                    // console.log("A[j]:" + A[j]);
                    // console.log("A[k]:" + A[k]);
                    // console.log("---")
                }
            }
        }
    }

    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 32532
#include<stdio.h>
 
int main(){
  char a[100];
  scanf("%[^\n]", a);
	int ctr = 0;
	
  for(int i= 0; a[i] != '\0'; i++){
    if(a[i] == ' '){
		if(a[i - 1] == a[i + 1]){
			ctr++;
		}
    }
  }
  if(ctr == 2){
  	printf("YES\n");
  }
  else{
  	printf("NO\n");
  }
  return 0;
}

Measured memory_bytes: 1588
import collections
N = int(input())
red = []
for i in range(N):
    red.append(list(map(int, input().split())))
blue = []
for i in range(N):
    blue.append(list(map(int, input().split())))

ans = 0
blue.sort()

for i in range(N):
    index = -1
    red_y_max = -1
    for j in range(len(red)):
        if blue[i][0] > red[j][0] and blue[i][1] > red[j][1]:
            if red_y_max < red[j][1]:
                index = j
                red_y_max = red[j][1]
    if index != -1:
        red.pop(index)
        ans += 1

print(ans)


Measured memory_bytes: 3316
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import fractions
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())
a = list(map(int, input().split()))

left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
    left[i + 1] = fractions.gcd(left[i], a[i])
for i in reversed(range(n)):
    right[i] = fractions.gcd(right[i + 1], a[i])
mx = 0
for i in range(n):
    l = left[i]
    r = right[i + 1]
    mx = max(mx, fractions.gcd(l, r))
print(mx)

Measured memory_bytes: 16936
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return (b);
    }
    else
    {
        return (gcd(b, a % b));
    }
}

ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

long long modpow(long long a, long long n, long long mod)
{
    long long res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


template <typename T>
T amarinasi(T a,T b){
    if(a%b==0)
{
    return a/b;
}
else if(a%b>0)
{
    return a/b+1;
}
else
{
    return a/b-1;
}
}

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

//----------------------------------------------------------------

int main(){
ll x,t;
cin>>x>>t;
cout<<seinomi(x-t)<<endl;
}










Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 };


int main(void) {
	int n, m, x, i, j, c[13], a[13][13], t, ans;

	scanf("%d%d%d", &n, &m, &x);
	for (i = 0; i < n; i++) {
		scanf("%d", &c[i]);
		for (j = 0; j < m; j++) {
			scanf("%d", &a[i][j]);
		}
	}

	ans = INF;
	for (t = 0; t < (1 << n); t++) {
		int sk[13] = {}, co = 0;
		for (i = 0; i < n; i++) {
			if ((t >> i) % 2 == 1) {
				co += c[i];
				for (j = 0; j < m; j++) {
					sk[j] += a[i][j];
				}
			}
		}
		for (j = 0; j < m; j++) {
			if (sk[j] < x) {
				break;
			}
		}
		if (j == m) {
			ans = min(ans, co);
		}
	}

	if (ans == INF) {
		printf("-1\n");
	}
	else {
		printf("%d\n", ans);
	}

	return 0;
}

Measured memory_bytes: 3828
// inputに入力データ全体が入る
function Main(input) {
  "use strict";
	const lines = input.split("\n");
  let nums = lines.map(s => parseInt(s, 10));
  nums.pop()

  const n = nums.shift();

  const smallest = nums.reduce( (acc, n) => {
    return acc > n ? n : acc
  } , 1000000000000000);

  const count = Math.ceil(n / smallest) + 4

	//出力
  console.log(count)
}
// Exec
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
N = int(input())
D = list(map(int,input().split()))
s = min(D)
if 12 in D:
    for i in range(N):
        if D[i]!=12:
            s = min(s,12-D[i])
    D.remove(12)
D = sorted(D)
E = []
for i in range(len(D)):
    if i%2==0:
        E.append(D[i])
    else:
        E.append(24-D[i])
for i in range(len(E)-1):
    for j in range(i+1,len(E)):
        a = E[i]
        b = E[j]
        d = abs(a-b)
        if d>12:
            d = 24-d
        s = min(s,d)
print(s)

Measured memory_bytes: 64576
#include<stdio.h>
 
int left(int i){
    return 2*i;
}
int right(int i){
    return 2*i+1;
}
int parent(int i){
    return i/2;
}
 
int a[500000];
int heapSize;
void buildMaxHeap(void);
int main(){
 
    int i;
 
    scanf("%d",&heapSize);
    for(i=1;i<=heapSize;i++){
        scanf("%d",&a[i]);
    }
    buildMaxHeap();
    for(i=1;i<=heapSize;i++){
        printf(" %d",a[i]);
    }
    printf("\n");
    return 0;
}
 
void maxHeapify(int i){
 
    int l=left(i);
    int r=right(i);
    int largest=0,tmp=0;
    if(l<=heapSize && a[l]>a[i]){
        largest = l;
    }else{
        largest = i;
    }
    if(r<=heapSize && a[r]>a[largest]){
        largest = r;
    }
    if(largest != i){
        tmp=a[i];
        a[i]=a[largest];
        a[largest]=tmp;
        maxHeapify(largest);
    }
 
}
void buildMaxHeap(void){
    int i;
    for(i=heapSize/2;i>=1;i--){
        maxHeapify(i);
    }
}

Measured memory_bytes: 4524
#include<bits/stdc++.h>
using namespace std;
#define INF 1000000000

int main()
{
    while (true)
    {
        int n,m;cin >> n >> m;
        if (n==0 && m==0) break;
        vector<int> code(m);
        for (int i=0;i<m;i++) cin >> code[i];
        vector<int> sound(n);
        for (int i=0;i<n;i++) cin >> sound[i];
        vector<vector<int>> dp(n+1,vector<int> (256,INF));
        dp[0][128]=0;
        for (int i=0;i<n;i++)
        {
            for (int j=0;j<256;j++)
            {
                for (int k :code)
                {
                    if (j+k<256 && j+k>=0) dp[i+1][j+k]=min(dp[i+1][j+k],dp[i][j]+(sound[i]-j-k)*(sound[i]-j-k));
                    else
                    {
                        if (j+k>=0) dp[i+1][255]=min(dp[i+1][255],dp[i][j]+(sound[i]-255)*(sound[i]-255));
                        else dp[i+1][0]=min(dp[i+1][0],dp[i][j]+(sound[i])*(sound[i]));
                    }
                    
                }
            }
        }
        int ans=INF;
        for (int i=0;i<256;i++)
        {
            ans=min(ans,dp[n][i]);
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 23680
import java.util.Scanner;

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

        int r=0,b=0;
        for (int i = 0; i < N ; i++) {
            char c = s.charAt(i);
            if(c == 'R') r++;
            if(c == 'B') b++;
        }

        if(r >b ){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 23636
function Main(input) {
  input = input.split('\n');

  var n = parseInt(input[0], 10);
  var a = [];
  for (var i = 0; i < n; i++) {
    a[i + 1] = parseInt(input[i + 1], 10);
  }

  var cur = 1;
  for (var i = 0; i < n + 100; i++) {
    if (a[cur] == 2) {
      console.log(i + 1);
      return;
    }
    cur = a[cur];
  }

  console.log(-1);
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 30936
#include<cstdio>
int main(){
	int y=0;
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		char c;
		scanf("%c",&c);
		if(c=='Y')y=1;
	}
	if(y==1)printf("Four\n");
	else printf("Three\n");
	return 0;
}

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

int main()
{
    int N;
    string S;
    cin >> N >> S;
    int count =0;
    for (int i=0; i<1000; i++)
    {
        bool possible = false;
        int pass[3] = {i/100, (i/10)%10, i%10};
        int k=0;
        for (int j=0; j<N; j++)
        {
            if (S[j]-'0'==pass[k]) k++;
            if (k==3) break;
        }
        if (k==3)
        {
            count++;
        }
    }
    cout << count << endl;

}

Measured memory_bytes: 384
fun main(args: Array<String>) {

    var n = readLine()!!.toInt()
    var input = readLine()!!.split(" ").map { it.toInt() }

    var inputSorted = input.sortedDescending()

    var a = 0
    var b = 0
    for (i in 0..(n-1)) {
        if (i%2 == 1) a += inputSorted[i] else b += inputSorted[i]
    }
    var diff = a - b

    if (diff == 0) print(diff) else print(-1 * diff)
}

Measured memory_bytes: 36104
# 余弦定理を使う
import math
a, b, C = map(float, input().split())
S = 1/2 * a * b * math.sin(math.radians(C))
L = math.sqrt((a**2 + b**2 - 2*a*b*math.cos(math.radians(C)))) + a + b
h = 2 * S / a
print(S)
print(L)
print(h)



Measured memory_bytes: 5692
#include<bits/stdc++.h>
using namespace std;
int gcd(int x,int y){
	return !y?x:gcd(y,x%y);
}
const int N=1e6+5;
int a[N];
int p[N];
bool b[N];
set<int>st;
int main(){
	b[0]=b[1]=1;
	for(int i=2;i<=N-5;i++){
		if(!b[i]) p[++p[0]]=i;
		for(int j=1;j<=p[0]&&i*p[j]<=N-5;j++){
			b[i*p[j]]=1;
			if(i%p[j]==0) break;
		}
	}
	
	int n;
	scanf("%d",&n);
	scanf("%d",&a[1]);
	int s=a[1];
	bool ok=1;
	for(int i=2;i<=n;i++){
		scanf("%d",&a[i]);
		if(b[a[i]]==0){
			if(st.count(a[i])==0) st.insert(a[i]);
			else ok=0;
		}
		s=gcd(s,a[i]);
	}
	if(s!=1){
		printf("not coprime");
		return 0; 
	}
	if(!ok&&s==1){
		printf("setwise coprime");
		return 0;
	}
	ok=1;
	for(int i=1;i<=n;i++){
		if(b[a[i]]==0) continue;
		int copya=a[i];
		int pos=1;
		while(copya!=1){
			bool flag=0;
			while(copya%p[pos]==0){
				copya/=p[pos];
				if(flag==0){
					if(st.count(p[pos])==1){
						ok=0;break;
					}
					else{
						st.insert(p[pos]);
					}
				}
				if(flag==0) flag=1;
			}
			if(!ok) break;
			pos++;
		}
		if(!ok) break;
	}
	if(ok){
		printf("pairwise coprime");
		return 0;
	}
	if(!ok&&s==1){
		printf("setwise coprime");
		return 0;
	}
	return 0;
}

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

int main() {
    int N, Q;
    cin >> N >> Q;
    dsu d(N);
    for (int i = 0; i < Q; i++) {
        int t, u, v;
        cin >> t >> u >> v;
        if (t) {
            cout << d.same(u, v) << endl;
        } else {
            d.merge(u, v);
        }
    }
}

Measured memory_bytes: 3836
import java.util.*;

import java.lang.*;

import java.math.*;



public class Main {

	Scanner sc = new Scanner(System.in);



	void run() {

		for (;;) {

			int n = sc.nextInt();

			if (n == 0)

				break;

			int m = sc.nextInt();

			int[][] cost = new int[n][n];

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

				Arrays.fill(cost[i], Integer.MAX_VALUE);

			}

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

				String buffer;

				for (buffer = sc.nextLine(); buffer.length() == 0; buffer = sc

						.nextLine())

					;

				Scanner in = new Scanner(buffer.replace(',', ' '));

				int from = in.nextInt();

				int to = in.nextInt();

				int c = in.nextInt() / 100 - 1;

				cost[from][to] = cost[to][from] = Math.min(c, cost[from][to]);

			}

			boolean[] end = new boolean[n];

			end[0] = true;

			int sum =0;

			for (;;) {

				int un = 0;

				int min = Integer.MAX_VALUE;

				int mini = 0;

				int minj = 0;

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

					if (end[i])

						continue;

					un++;

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

						if (!end[j])

							continue;

						if(min > cost[i][j]){

							mini=i;

							minj=j;

							min = cost[i][j];

						}

					}

				}

				if (un == 0)

					break;

				sum += min;

				end[mini] = true;

			}

			System.out.println(sum);

		}



	}



	public static void main(String[] args) {

		Main m = new Main();

		m.run();

	}

}

Measured memory_bytes: 13000
#include<stdio.h>

long long option(int a[],int b[],int n){
	long long sum=0;
	for(int i=0;i<n;++i)
		sum+=a[i]*b[i];
	return sum;}

int main(){
	int n,m,l;
	int L1[100][100],L2[100][100],L3[100][100];
	scanf("%d%d%d",&n,&m,&l);
	for(int i=0;i<n;++i)   //输入矩阵A
		for(int j=0;j<m;++j)
			scanf("%d",&L1[i][j]);
	for(int i=0;i<m;++i)  //输入矩阵B
		for(int j=0;j<l;++j)
			scanf("%d",&L2[i][j]);
	for(int i=0;i<m;++i)  //转置矩阵B,使交叉相乘变为向量乘
		for(int j=0;j<l;++j)
			L3[j][i]=L2[i][j];

	for(int i=0;i<n;++i)
		for(int j=0;j<l;++j)
			if(j<l-1)
				printf("%lld ",option(L1[i],L3[j],m));
			else 
				printf("%lld\n",option(L1[i],L3[j],m));

	return 0;
}


Measured memory_bytes: 2104
#include<iostream>
#define lli long long int

using namespace std;

lli max(lli a, lli b)
{
	return a>b?a:b;
}

int main(void)
{
	lli i,n,a[4],A[4],mx=0;
	cin>>n;

	cin>>a[0]>>a[1]>>a[2];

	for(i=1;i<n;i++)
	{
		cin>>A[0];
		A[0] = max((A[0] + a[1]),(A[0] + a[2]));

		cin>>A[1];
		A[1] = max((A[1] + a[2]),(A[1] + a[0]));

		cin>>A[2];
		A[2] = max((A[2] + a[0]),(A[2] + a[1]));

		a[0]=A[0]; a[1]=A[1]; a[2]=A[2];
	}

	for(i=0;i<3;i++)
		mx = max(mx, a[i]);

	cout<<mx<<endl;

	return 0;

}


Measured memory_bytes: 256
#include <stdio.h>

#define N 100

int main() {
	static int aa[N], bb[N];
	int n, i, ans;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d", &aa[i]);
	for (i = 0; i < n; i++)
		scanf("%d", &bb[i]);
	for (i = 1; i < n; i++)
		aa[i] += aa[i - 1];
	for (i = n - 2; i >= 0; i--)
		bb[i] += bb[i + 1];
	ans = 0;
	for (i = 0; i < n; i++) {
		int x = aa[i] + bb[i];

		if (ans < x)
			ans = x;
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <cstdlib>
#include <algorithm>

using namespace std;

int func(int x){
    return max(0, 1001 - abs(1000 - x));
}

int main(){
    int n;
    while(cin >> n){
        int ans = 0;
        for(int i = 0; i <= n; ++i){
            ans += func(i) * func(n - i);
        }
            cout << ans << endl;
    }
}

Measured memory_bytes: 3064
def main():
    n = int(input())
    w = list(map(int, input().split()))
    ans_list = []
    for i in range(1, n):
        s1 = sum(w[:i])
        s2 = sum(w[i:])
        ans_list.append(abs(s1 - s2))
    print(min(ans_list))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
# coding cell (SUBMIT ONLY THIS CELL)

import math

X = int(input())
temp = False

if X == 2:
    print(2)
    exit()

if X % 2 == 0:
    X += 1

while temp == False:

    for i in range(int(math.sqrt(X) // 2)):
        if X % (2 * (i + 1) + 1) != 0:
            temp = True
        else:
            temp = False
            break

    X += 2        
    
print(X - 2)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define nl '\n'
#define INF 2147483647
#define si(i) scanf("%d", &i)
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int n, ma, ans;

int main(){
    cin >> n;
    for( int i = 0 ; i < n ; i++ ){
        int ct; cin >> ct;
        ans+= ct;
        ma = max( ct, ma );
    }
    ans -= ma/2;
    cout << ans;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
   int A,B,C;
   cin>> A >> B >> C;
   int K;
   int d1,d2;
   if (A<B){
     K=A;
     A=B;
     B=K;
   }
   if (A<C){
     K=A;
     A=C;
     C=K;
   }
   d1=(A-B)%2;
   d2=(A-C)%2;
   if((d1==0)&&(d2==0)){
     cout << (A-B)/2+(A-C)/2;
   }
   if((d1==0)&&(d2==1)){
     cout << (A-B)/2+(A-C-1)/2+2;
   }
   if((d1==1)&&(d2==0)){
     cout << (A-B-1)/2+(A-C)/2+2;
   }
   if((d1==1)&&(d2==1)){
     cout << (A-B-1)/2+(A-C-1)/2+1;
   }
   return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func isEven(n int) bool { return n%2 == 0 }

func main() {
	var n int
	fmt.Scan(&n)
	as := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&as[i])
	}

	bs := [1e5 + 1]int{}
	for _, a := range as {
		bs[a]++
	}

	k := 0
	l := 0
	for _, b := range bs {
		if b != 0 {
			k++
			if isEven(b) {
				l++
			}
		}
	}

	fmt.Println(k - l%2)
}


Measured memory_bytes: 7040
sub gcd{$_[1]?gcd($_[1],$_[0]%$_[1]):$_[0]}
for(1..<>){
	($A,$B,$C,$D)=glob<>;
	if($A<$B||$D<$B){
		print"No\n";
		next
	}
	for(0,1){
		$m=($A-$C)%$B;
		if($m){
			$z[$_]=$C+$m-$B
		}else{
			$z[$_]=$C
		}
		$A=$z[$_]+$D
	}
	$e=gcd(abs($z[1]-$z[0]),$B);
	if($e){
		if($B%$e){
			print$C-($B-1)>=0?"Yes\n":"No\n"
		}else{
			print$C-$B+$e-($C-$z[0])%$e>=0?"Yes\n":"No\n"
		}
	}else{
		print$z[0]>=0?"Yes\n":"No\n"
	}
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const int inf = 2e9;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  int n, k;
  cin >> n >> k;
  vector<ld> p(n);
  rep(i, n) cin >> p[i];

  vector<ld> v(n + 1, 0);
  rep(i, n) {
    v[i + 1] = (p[i] + 1) / 2;
    v[i + 1] += v[i];
  }

  ld ans = 0;
  rep(i, n - k + 1) {
    ans = max(ans, v[i + k] - v[i]);
  }
  cout << setprecision(10) << ans << endl;
  


  
  return 0;
}

Measured memory_bytes: 6528
/*痛みを受け取れ，痛みを知れ*/
#include<bits/stdc++.h>
#define f(i,a,b) for(register int i=a;i<=b;++i)
#define ff(i,a,b) for(register int i=a;i>=b;--i)
#define debug(x) cerr << #x << " : " << x << " " << endl
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
const ll mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const double tiaohe = 0.57721566490153286060651209;
ll oula(ll x) { ll res = x;f(i, 2, x / i) { if (x % i == 0) { res = res / i * (i - 1);while (x % i == 0) x /= i; } }if (x > 1) res = res / x * (x - 1);return res; }
ll quickmod(ll a, ll n, ll m) { ll s = 1;while (n) { if (n & 1) { s = s * a % m; }a = (a*a) % m;n = n / 2; }return s; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
void ex_gcd(ll a, ll b, ll &x, ll &y, ll &d) { if (!b) { d = a, x = 1, y = 0; } else { ex_gcd(b, a % b, y, x, d);y -= x * (a / b); } }
ll inv(ll t, ll p) { ll d, x, y;ex_gcd(t, p, x, y, d);return d == 1 ? (x % p + p) % p : -1; }
bool isPrime(ll x) { if (x == 2)return true;if (x % 2 == 0)return false;for (ll i = 2;i*i <= x;i++) if (x % i == 0)return false; return true; }
//double a = log(n) +tiaohe + 1.0 / (2 * n);
double eqa = (1 + sqrt(5.0)) / 2.0;
const int N = 3e5 + 5;
inline int in()
{
	char ch = getchar();
	int x = 0, f = 1;
	while (ch<'0' || ch>'9') { if (ch == '-')f = -1;ch = getchar(); }
	while (ch >= '0'&&ch <= '9') { x = x * 10 + ch - '0';ch = getchar(); }
	return x * f;
}//快读
int r[N], c[N];
int main()
{
	//freopen("in.txt", "r", stdin);
	int h, w, m;
	while (cin >> h >> w >> m)
	{
		int x, y;
		map<pii, int> mp;
		f(i, 1, m)
		{
			x = in();
			y = in();
			r[x]++;
			c[y]++;
			mp[{x, y}]++;
		}
		int mx = 0;
		vector<int> v;
		f(i, 1, h)
		{
			if (r[i] > mx)
			{
				v.clear();
				mx = r[i];
				v.emplace_back(i);
			}
			else if(r[i]==mx)
			{
				v.emplace_back(i);
			}
		}
		int mx2 = 0;
		vector<int> v2;
		f(j, 1, w)
		{
			if (c[j] > mx2)
			{
				mx2 = c[j];
				v2.clear();
				v2.emplace_back(j);
			}
			else if (c[j] == mx2)
			{
				v2.emplace_back(j);
			}
		}
		int ans = 0,fg=1;
		for (auto i : v)
		{
			for (auto j : v2)
			{
				if (mp[{i, j}] == 0) { fg = 0;break; }
			}
		}
		cout <<mx+mx2-fg << endl;
	}
	return 0;
}

Measured memory_bytes: 45544