akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <climits>
#include <bitset>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

#define MAX 100000

int main(){
	int n, ch;
	cin >> n >> ch;
	vector<pair<int, int>> rc[ch], record[ch];
	for(int i=0; i<n; i++){
		int s, t, c;
		cin >> s >> t >> c;
		rc[c-1].push_back(make_pair(s, t));
	}
	for(int i=0; i<ch; i++) sort(rc[i].begin(), rc[i].end());

	for(int i=0; i<ch; i++){
		if(rc[i].size()==0) continue;
		int l=rc[i][0].first, r=rc[i][0].second;
		for(int j=1; j<rc[i].size(); j++){
			if(rc[i][j].first==r) r=rc[i][j].second;
			else{
				record[i].push_back(make_pair(l, r));
				l=rc[i][j].first;
				r=rc[i][j].second;
			}
		}
		record[i].push_back(make_pair(l, r));
	}

	vector<int> v(2*MAX+1, 0);
	for(int i=0; i<ch; i++){
		for(int j=0; j<record[i].size(); j++){
			v[2*record[i][j].first-1]++;
			v[2*record[i][j].second]--;
		}
	}
	int ans=0, sum=0;
	for(int i=0; i<2*MAX+1; i++){
		sum+=v[i];
		ans=max(ans, sum);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3072
import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created 2017/06/01.
 */
public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> ary = new ArrayList<>();
    while (sc.hasNextInt()) {
        int input = sc.nextInt();
        ary.add(input);
    }

    int a = ary.get(0);
    int b = ary.get(1);

    int s = a * b;
    int m = (a * 2) + (b * 2);

    System.out.println(s + " " + m);

  }
}

Measured memory_bytes: 26264
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
constexpr lnt INF = 2e18;
/*-*/

template <typename T>
std::vector<int> sort_indexes(const std::vector<T> &v) {
  std::vector<int> idx(v.size());
  std::iota(idx.begin(), idx.end(), 0);
  std::sort(idx.begin(), idx.end(), [&v](int i1, int i2) {return v[i1] < v[i2];});
  return idx;
}


int main() {
	lnt n;
	std::cin >> n;
	std::vector<lnt> a(n);
	rep(i,n) std::cin >> a[i];
	rep(i,n) a[i]--;
	std::vector<lnt> ans(n*n,-1);
	auto idx = sort_indexes(a);
	rep(i,n) {
		if(ans[a[i]]!=-1) {
			print("No");
			return 0;
		}
		ans[a[i]]=i;
	}
	{
		lnt j=0;
		for(lnt i:idx) {
			lnt cnt = i;
			for(;cnt>0&&j<a[i];j++) {
				if(ans[j]!=-1) continue;
				ans[j]=i;
				cnt--;
			}
			if(cnt>0) {
				print("No");
				return 0;
			}
		}
		for(lnt i:idx) {
			lnt cnt = n-i-1;
			while(j<n*n&&ans[j]!=-1) j++;
			if(j<a[i]) {
				print("No");
				return 0;
			}
			for(;cnt>0&&j<n*n;j++) {
				if(ans[j]!=-1) continue;
				ans[j]=i;
				cnt--;
			}
			if(cnt>0) {
				print("No");
				return 0;
			}
		}
	}
	print("Yes");
	rep(i,n*n) std::cout << ans[i]+1 << ' ';
	std::cout << EL;
}


Measured memory_bytes: 3072
#include<bits/stdc++.h>
#define For(i, a, b)  for(int i = a, _b = b; i <= _b; ++i)
#define Ford(i, a, b) for(int i = a, _b = b; i >= _b; --i)
#define FileName      "test"
#define ll            long long
#define ld            long double
#define ull           unsigned long long
#define Print(x)      cerr << #x << "is " << x << '\n';
#define pb            push_back
#define X             first
#define Y             second
//#define Karma

using namespace std;

template<typename T> inline void Cin(T &x)
{
    char c;
    T sign = 1;
    x = 0;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        if (c == '-') sign = -1;
    for (; c >= '0' && c <= '9'; c = getchar())
        x = x * 10 + c - '0';
    x *= sign;
}
template <typename T> inline void Out(T x) {if(x > 9) Out(x / 10); putchar(x % 10 + '0');}
template <typename T> inline void Cout(T x, char c) {if(x < 0) putchar('-'); x = abs(x); Out(x); putchar(c);}
template <typename T, typename... Args> inline void Cin(T& a, Args&... args) {Cin(a);Cin(args...);}
template <typename T, typename... Args> inline void Cout(T a, char c, Args... args) {Cout(a, c);Cout(args...);}

typedef pair<int, int> pii;
typedef pair<ll, int> plli;
const int N = 1e5 + 7;

ll f[N][5], n, a, b, c;

void Enter()
{
     Cin(n);
     For(i, 1, n)
     {
         Cin(a, b, c);
         f[i][1] = max(f[i - 1][2], f[i - 1][3]) + a;
         f[i][2] = max(f[i - 1][1], f[i - 1][3]) + b;
         f[i][3] = max(f[i - 1][1], f[i - 1][2]) + c;
     }
     cout << max({f[n][1], f[n][2], f[n][3]});
}

void Solve()
{

}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#ifdef Karma
    freopen(FileName".inp", "r", stdin);
    freopen(FileName".out", "w", stdout);
#endif // Karma

    Enter();
    Solve();

    return 0;
}


Measured memory_bytes: 4224
#include <stdio.h>

int main(void)
{
  int n;
  int A[4][3][10];
  int i,j,k,l;
  int a,b,c,d;

  for(i=0; i<4; i++){ //???????????°????????????????????????
    for(j=0; j<3; j++){
      for(k=0; k<10; k++)
	A[i][j][k]=0;
    }
  }

  scanf("%d",&n); //?????±?????°

  for(l=0; l<n; l++){
    scanf("%d%d%d%d",&a,&b,&c,&d); //?????±?????\??? 
    A[a-1][b-1][c-1] = A[a-1][b-1][c-1] + d; //?????°?????????????¨????
  }
  
  //??¨?±??????¶????????¨???
  for(i=0; i<4; i++){
    for(j=0; j<3; j++){
      for(k=0; k<10; k++){
	printf(" %d",A[i][j][k]); //??°????????????
      }
      puts(""); //???????????´
    }
    if(i<3){
      for(l=0; l<20; l++) //?£?????????´
	putchar('#');
      puts("");
    }
  }
  
  
  return 0;
}

Measured memory_bytes: 1040
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;

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

    map<string, string> mp{
        {"Sunny", "Cloudy"},
        {"Cloudy", "Rainy"},
        {"Rainy", "Sunny"},
    };
    string input;
    cin >> input;
    cout << mp[input] << endl;
}

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

int main() {
  int c[9];
  bool f=true;
  for(int i=0;i<9;i++) cin>>c[i];
  
  if(c[0]-c[1]!=c[3]-c[4]||c[0]-c[1]!=c[6]-c[7]) f=false;
  if(c[1]-c[2]!=c[4]-c[5]||c[1]-c[2]!=c[7]-c[8]) f=false;
  if(c[0]-c[2]!=c[3]-c[5]||c[0]-c[2]!=c[6]-c[8]) f=false;

  if(c[0]-c[3]!=c[1]-c[4]||c[0]-c[3]!=c[2]-c[5]) f=false;
  if(c[0]-c[6]!=c[1]-c[7]||c[0]-c[6]!=c[2]-c[8]) f=false;
  if(c[3]-c[6]!=c[4]-c[7]||c[3]-c[6]!=c[5]-c[8]) f=false;

  if(f) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}	


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a<=0&&b>=0){printf("Zero");}
else if(a>=0&&b>=0){printf("Positive");}
else if((a-b+1)%2==0){printf("Positive");}
else{printf("Negative");}
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
int main() {
    string s;
    cin >> s;
    int cnt = 0;
    for (int i = 1; i < s.size(); ++i) {
        if (s[i] != s[i - 1]) {
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 1020
from itertools import accumulate
from bisect import bisect
def main():
    n, m, k = map(int, input().split())
    a = tuple(map(int, input().split()))
    b = tuple(map(int, input().split()))

    aa = tuple(accumulate(a))
    ba = tuple(accumulate(b))
    r = 0
    for i1 in range(n):
        if aa[i1] > k:
            break
        else:
            t = bisect(ba, k - aa[i1])
            r = max(r, i1 + 1 + t)
    for j1 in range(m):
        if ba[j1] > k:
            break
        else:
            t = bisect(aa, k - ba[j1])
            r = max(r, j1 + 1 + t)
    print(r)
if __name__ == '__main__':
    main()


Measured memory_bytes: 135292
dic = {"A":0, "B":1, "C":2}
lst = [1, 0, 0]

while True:
  try:
    x, y = input().split(",")
    xi, yi = dic[x], dic[y]
    lst[xi], lst[yi] = lst[yi], lst[xi]

  except EOFError:
    break

for s in ("A", "B", "C"):
  if lst[dic[s]]:
    print(s)
    break


Measured memory_bytes: 5560
import java.util.*;
import static java.lang.Integer.*;
import static java.lang.Long.parseLong;
//import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		Integer[] a = new Integer[n];
		for (i = 0; i < n; i++) {
			a[i] = parseInt(sc.next());
		}
		sc.close();
		Arrays.sort(a, Collections.reverseOrder());
		int[] ab = new int[2];
		for (i = 0; i < n; i++) {
			ab[i%2] += a[i];
		}
		out.println(ab[0]-ab[1]);
	}
}


Measured memory_bytes: 21588
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,j,n) for(int i = j; i < n; i++)
#define rrep(i,j,n) for(int i = j-1; i >= n; i--)
#define prec(n) fixed << setprecision(n)
#define print_array(v) rep(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define fi first
#define se second
using namespace std;

int inf = 2147483647;
int64_t inf64 = 9223372036854775807;
int mod = 1e+7;

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

  string s;
  cin >> s;
  if(s == "Sunny")  cout << "Cloudy" << endl;
  if(s == "Cloudy") cout << "Rainy"  << endl;
  if(s == "Rainy")  cout << "Sunny"  << endl;
  return 0;
}

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

int H, W;
vector<string> fi;
int Left[2100][2100], Right[2100][2100], Up[2100][2100], Down[2100][2100];

int main() {
    cin >> H >> W;
    fi.resize(H);
    for (int i = 0; i < H; ++i) cin >> fi[i];

    for (int i = 0; i < H; ++i) {
        int cur = 0;
        for (int j = 0; j < W; ++j) {
            if (fi[i][j] == '#') cur = 0;
            else ++cur;
            Left[i][j] = cur;
        }
    }
    for (int i = 0; i < H; ++i) {
        int cur = 0;
        for (int j = W-1; j >= 0; --j) {
            if (fi[i][j] == '#') cur = 0;
            else ++cur;
            Right[i][j] = cur;
        }
    }
    for (int j = 0; j < W; ++j) {
        int cur = 0;
        for (int i = 0; i < H; ++i) {
            if (fi[i][j] == '#') cur = 0;
            else ++cur;
            Up[i][j] = cur;
        }
    }
    for (int j = 0; j < W; ++j) {
        int cur = 0;
        for (int i = H-1; i >= 0; --i) {
            if (fi[i][j] == '#') cur = 0;
            else ++cur;
            Down[i][j] = cur;
        }
    }

    int res = 0;
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            if (fi[i][j] == '#') continue;
            res = max(res, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3);
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 72448
#include <stdio.h>

#define MOD 1000000007LL

int main(void) {
    int i, j, k, l, m, N, dp[110][5][5][5] = {0}, T;
    scanf("%d", &N);

    // 0:A, 1:G, 2:C, 3:T
    // not accepted: 012, 021, 102, 0?12, 01?2 
    // dp[length][n-1 th][n-2 th][n-3th]
    dp[0][3][3][3] = 1;
    for (l=0;l<=N;l++) {
        for (i=0;i<=3;i++) 
        for (j=0;j<=3;j++)
        for (k=0;k<=3;k++) {
            if (!dp[l][i][j][k])  continue;
            for (m=0;m<=3;m++) {
                if      (j==0 && i==1 && m==2) continue;
                else if (j==0 && i==2 && m==1) continue;
                else if (j==1 && i==0 && m==2) continue;
                else if (k==0 && i==1 && m==2) continue;
                else if (k==0 && j==1 && m==2) continue;
                else {
                    dp[l+1][m][i][j] += dp[l][i][j][k];
                    dp[l+1][m][i][j] %= MOD;
                }
            }
        }
    }
    T = 0;
    for (i=0;i<=3;i++) 
    for (j=0;j<=3;j++)
    for (k=0;k<=3;k++) {
        T += dp[N][i][j][k];
        T %= MOD;
    }
    printf("%d\n", T);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include<queue>
#include<set>
#include<climits>
using namespace std;

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

  int result = 0;

  if (a > b)
    result += b;
  else
    result += a;

  if (c > d)
    result += d;
  else
    result += c;

  cout << result << endl;

}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES // for C++  
#include "bits/stdc++.h"
using LL = long long;
using ULL = unsigned long long;
#define NUM 1000000007

using namespace std;

int main()
{
    int n, ans = 0;
    cin >> n;
    vector<int> v;
    for (size_t i = 0; i < n; i++)
    {
        int tmp;
        cin >> tmp;
        if (find(v.begin(), v.end(), tmp) != v.end())
        {
            continue;
        }
        v.emplace_back(tmp);
    }
    sort(v.begin(), v.end());
    for (size_t i = 0; i < v.size() - 1; i++)
    {
        ans += v[i + 1] - v[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
def solve(a):
    a = [x for x in a if x%2==0]
    if all(map(lambda x: x%5==0 or x%3==0, a)):
        return "APPROVED"
    else:
        return "DENIED"

def main():
    input()
    A = sorted([int(x) for x in input().split()])
    print(solve(A))


if __name__ == '__main__':
    main()

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

struct Query{
    int l, cnt;
};

const int MAXN = 305, MOD=1e9+7;
vector<Query> qs[MAXN];
int n, m, dp[MAXN][MAXN][MAXN];
bool valid[MAXN][MAXN][MAXN];
int other_idxs[3][2] = {{1, 2}, {0, 2}, {0, 1}};

int add(int a, int b){
    a += b;
    if(a >= MOD)
        a -= MOD;
    return a;
}

int f(int i, int j, int k){
    int mxpos = max({i,j,k});
    if(mxpos==n)return 1;

    int &r=dp[i][j][k]; 
    if(r!=-1)return r;

    r=0;
    if(valid[mxpos+1][j][k])
        r=add(r, f(mxpos+1,j,k));
    if(valid[i][mxpos+1][k])
        r=add(r, f(i,mxpos+1,k));
    if(valid[i][j][mxpos+1])
        r=add(r, f(i,j,mxpos+1));
    return r;
}

int main(){
    memset(dp, -1, sizeof(dp));
    cin >> n >> m;
    for(int i=0; i<m; i++){
        int l, r, x;
        cin >> l >> r >> x;
        qs[r].push_back(Query{l, x});
    }
    for(int mxpos=1; mxpos<=n; mxpos++){
        int idxs[3];
        for(int mx_idx=0; mx_idx<3; mx_idx++){
            for(int i=0; i<mxpos; i++)
                for(int j=0; j<mxpos; j++){
                    idxs[mx_idx]=mxpos;
                    idxs[other_idxs[mx_idx][0]]=i;
                    idxs[other_idxs[mx_idx][1]]=j;
                    int can = 1;
                    for(auto q : qs[mxpos]){
                        int cnt = q.l <= i && i <= mxpos;
                        cnt += q.l <= j && j <= mxpos;
                        cnt++;
                        can &= cnt == q.cnt;
                    }
                    valid[idxs[0]][idxs[1]][idxs[2]] = can;
                }
        }
    }
    cout << f(0, 0, 0) << "\n";
}


Measured memory_bytes: 138880
//============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <vector>
using namespace std;
typedef long long ll;
int N;
int T[100001];
int P,X;
int M;
int main(){
	cin>>N;
	for(int i=1;i<N+1;i++){
		cin>>T[i];
	}
	cin>>M;
	for(int i=1;i<M+1;i++){
		cin>>P>>X;
		int A=T[P];
		T[P]=X;
		int ans=0;
		for(int j=1;j<N+1;j++){
			ans+=T[j];
		}
		cout<<ans<<endl;
		T[P]=A;
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;

using namespace std;

int main(){

int a,b;
cin>>b;
if(b>=13)
{
	cin>>a;
}
else if(b>5&&b<13)
{
	cin>>a;
	a=a/2;
	
}
else if(b<6)
{
	a=0;
}
cout<<a;
return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
class Program
{
static string[] input = Console.ReadLine().Split(' ');//Splitで区切り文字を指定して複数個受け取る。
static int n = int.Parse(input[0]);
static int k = int.Parse(input[1]);
static int[] nums = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
static int[] bitsOne = new int[100000+1];
static int[] bits = new int[100000+1];

	static void Main()
	{
    int answer = int.MaxValue/2;
    int leftCount = 0;
  
    for(int i = 1; i <= n; i++)
    {
      BitAdd(nums[i-1],1);
      if(BitSumOne(nums[i-1]) - BitSumOne(nums[i-1]-1) == 0) BitAddOne(nums[i-1],1);

      while(BitSumOne(k) == k)
      {
        answer = Math.Min(answer, i-leftCount);
        BitAdd(nums[leftCount], -1);
          if(BitSum(nums[leftCount]) - BitSum(nums[leftCount]-1) == 0)
          {
            BitAddOne(nums[leftCount], -1);
          }
        //Console.WriteLine(answer);
        leftCount++;
      }
    }

    if(answer == int.MaxValue/2) answer = 0;
		Console.WriteLine(answer);
	}

  static void BitAdd(int i, int x)//BITでiだけにx加算
  {
    while(i <= 100000)
    {
      bits[i] += x;
      i += i&-i;
    }
  }

  static int BitSum(int i)//BITでi以下の総和を計算
  {
    int sum = 0;
    while(i > 0)
    {
      sum += bits[i];
      i -= i&-i;
    }
    return sum;
  }

  static void BitAddOne(int i, int x)//BITでiだけにx加算
  {
    while(i <= 100000)
    {
      bitsOne[i] += x;
      i += i&-i;
    }
  }

  static int BitSumOne(int i)//BITでi以下の総和を計算
  {
    int sum = 0;
    while(i > 0)
    {
      sum += bitsOne[i];
      i -= i&-i;
    }
    return sum;
  }
  
}


Measured memory_bytes: 23396
#include <bits/stdc++.h>
#define lb long double
using namespace std;
lb n,a;
int main()
{
    cin >> n;
  	a = n / 3;
    cout << fixed << setprecision(12) << (n / 3) * (n / 3) * (n / 3);
    return 0;
}

Measured memory_bytes: 256
tmp = input()

out_1 = 0
tmp_s = []
for c in tmp:
        if c == "A" or c == "G" or c == "T" or c == "C":
                tmp_s.append(c)
        else:
                if out_1 < len(tmp_s):
                        out_1 = len(tmp_s)
                tmp_s = []
if out_1 < len(tmp_s):
        out_1 = len(tmp_s)
print(out_1)

Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <string>

#define debug(x) cout << #x << "==" << x << endl;

const int INF = 1e+9 + 7;

using namespace std;

//入力
#define MAX_H 100
#define MAX_W 100
int H, W;
// char C[MAX_H][MAX_W];

int main() {
  ios::sync_with_stdio(false);

  cin >> H >> W;

  string s;


  for(int i = 0; i < H; i++) {
    cin >> s;
    cout << s << endl;
    cout << s << endl;
  }




  return 0;
}


Measured memory_bytes: 256
/**********************
 * AGC001 -A
*********************************/
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;


int main() {
int skewer_num = 0, ans = 0,temp;
    std::cin >> skewer_num;
    skewer_num *= 2;
    vector<int> skewer_array;

    for (int i = 0; i < skewer_num; ++i) {
        cin >> temp;
        skewer_array.push_back(temp);
    }
    sort(skewer_array.begin(),skewer_array.end());

    for (int i = 0; i < skewer_num / 2; ++i) {
        ans += skewer_array[2*i];
    }
    printf("%d\n",ans);
}

Measured memory_bytes: 256
#include<iostream> 
#include<iomanip> 
#include<vector> 
#include<map> 
#include<set> 
#include<algorithm> 
#include<numeric> 
#include<limits> 
#include<bitset> 
#include<functional> 
#include<type_traits> 
#include<queue> 
#include<stack> 
#include<array> 
#include<random> 
#include<utility> 
#include<cstdlib> 
#include<ctime>
#define _LIBCPP_DEBUG 0
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (n); ++i)	
using namespace std;

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


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

	int M = max(a, max(b, c));


	if ((3 * M) % 2 != (a + b + c) % 2) {
		M = M + 1;
	}

	cout << (3 * M - (a + b + c) )/ 2 << endl;

}


Measured memory_bytes: 256
n = int(input())
m = {}
for i in range(n):
	s = input()
	l = list(map(str, s))
	s = "".join(sorted(l))
	if s in m:
		m[s] += 1
	else:
		m[s] = 1
res = 0
for i in m.keys():
	if m[i] > 1:
		res += m[i] * (m[i] - 1) // 2
print(res)

Measured memory_bytes: 61144
N,M=map(int, input().split())
SC=[tuple(map(int, input().split())) for _ in range(M)]
for i in range(1000):
    x=str(i)
    if len(x)!=N: continue
    for s,c in SC:
        if s-1>=len(x) or int(x[s-1])!=c:
            break
    else:
        print(i)
        break
else:
    print(-1)

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

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

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

    string s; cin >>s;

    int f = 0;
    rep(i, s.size()) {
        if (s[i] == 'N') {
            f |= 8;
        } else if (s[i] == 'S') {
            f |= 4;
        } else if (s[i] == 'W') {
            f |= 2;
        } else if (s[i] == 'E') {
            f |= 1;
        }
    }
    cout << (f == 3 || f == 12 || f == 15 ? "Yes" : "No") << endl;
}


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


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

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final Integer[] n = Arrays.stream(scanner.nextLine().split(""))
                .map(Integer::parseInt)
                .toArray(Integer[]::new);

        int tmp = 0;
        for (final Integer value : n) {
            tmp += value;
        }

        System.out.println(Math.max(tmp, (n.length - 1) * 9 + n[0] - 1));
    }
}


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

int main(void){

    long long n;
    long long x;

    cin >> n;
    cin >> x;

    long long sum = n;
    long long temp1;

    long long lg = x;
    long long sm = n - x;

    if(sm > lg){
        temp1 = sm;
        sm = lg;
        lg = temp1;
    }

    while(true){
        if(lg == sm) {
            sum = sum + sm;
            break;
        }
        if(lg%sm == 0) {
            sum += ((2 * (lg/sm))-1) * sm;
            break;
        }
        else {
            sum += 2 * (lg/sm) * sm;
            temp1 = lg%sm;
            lg = sm;
            sm = temp1;
        }
    }

    cout << sum << endl;

    return 0;
}

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

int main(){
	string w, s;
	int c=0;
	cin >> w;
	while(1){
		cin >> s;
		if(s == "END_OF_TEXT") break;
		for(int i = 0; i < s.size(); i++){
			if(s[i] >= 'A' && s[i] <= 'Z'){
				s[i] += 32;
			}
		}
		if(s == w) c++;
	}
	cout << c << 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 REPR(i,n) for(int i =n; i >=0; --i)

#define REP_(i,m,n) for(int i =m; i <n; ++i)

#define INF 2e9

#define ll long long

//const ll MOD = 1000000007;

//const  long double PI=(acos(-1));

//const  long double EPS=0.0000000001;

int main(){
    int n;cin >> n;
    map<int,int> odd;
    map<int,int> even;

    REP(i,n){
        int a; cin >> a;
        if(i%2)even[a]++;
        else odd[a]++;
    }

    int odd1 = 0, odd2 = 0, even1 = 0, even2 = 0;
    int odd_value , even_value;

    for(auto itr = odd.begin(); itr != odd.end(); ++itr){
        if(itr->second > odd2)odd2 = itr->second;
        if(odd2 > odd1){
            swap(odd1,odd2);
            odd_value = itr->first;
        }
    }

    for(auto itr = even.begin(); itr != even.end(); ++itr){
        if(itr-> second > even2)even2 = itr->second;
        if(even2 > even1){
            swap(even1,even2);
            even_value = itr->first;
        }
    }

    if(odd_value == even_value)
        cout << min(n - odd1 - even2, n - odd2 - even1) << endl;

    else cout << n - odd1 - even1 << endl;


    return 0;
}

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

int main() {
    int n, m;
    cin >> n >> m;
    int a[m], b[m];
    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i];
    }
    for (int i = 1; i <= n; i++) {
        int count = 0;
        for (int j = 0; j < m; j++) {
            if (a[j] == i || b[j] == i) {
                count++;
            }
        }
        cout << count << endl;
    }
    return 0;
}


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

typedef long long ll;
 
using tpl = tuple<int, int, int>;
typedef pair<int,int> pii;

void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}


#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;

// 外積
double cross(const P &a, const P &b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}
// 点cが直線ab上にあるかないか
int is_point_on_line(const P &a, const P &b, const P &c) {
  return EQ( cross(b-a, c-a), 0.0 );
}


const int mod = 998244353;

int N;
int X[210];
int Y[210];
ll powtwo[210];

int main(){

    powtwo[0] = 1;
    for(int i = 1; i < 210; i++){
        powtwo[i] = (powtwo[i-1] * 2) % mod;
    }

    fastStream();
    cin >> N;
    for(int i = 0; i < N; i++)
        cin >> X[i] >> Y[i];

    set<pair<pii, pii> > used;

    ll tot = 0;
    for(int i = 0; i < N; i++){
        for(int j = i + 1; j < N; j++){
            pii min_p = pii(X[i], Y[i]);
            pii max_p = pii(X[i], Y[i]);
            int cnt = 0;
            for(int k = 0; k < N; k++){
                if(is_point_on_line(P(X[i], Y[i]), P(X[j], Y[j]), P(X[k], Y[k]))){
                    cnt++;
                    min_p = min(min_p, pii(X[k], Y[k]));
                    max_p = max(max_p, pii(X[k], Y[k]));
                }
            }
            if(!used.count(make_pair(min_p, max_p))){
                used.insert(make_pair(min_p, max_p));
                tot += powtwo[cnt] - cnt - 1;
            }
        }
    }
    
    tot = (powtwo[N] - tot + mod) % mod;
    tot = (tot - N - 1 + mod) % mod;
    cout << tot << endl;


    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define nl cout<<'\n'
#define sor(x) sort(x.begin(),x.end())
#define rev(v) reverse(v.begin(),v.end())
#define llmax 100000000000000000
#define deb(x) cout<<"value here is "<<x<<"\n"
#define pll pair<ll,ll>
#define vll vector <ll>
#define rub cout<<"ohlala"<<'\n';
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll count=0;
    ll n;
    cin>>n;
    string s;
    cin>>s;
    s.pb('@');
    for(int i=0;i<n-1;i++)
    {
        if(s[i]==s[i+1]);
        else
        count++;
    }
    if(s[n-1]!=s[n])
    count++;
    cout<<count;
}

Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <random>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef complex<ld> compd;
#define rep(i,n)	for(int i=0;i<n;i++)
#define srep(i,a,n)	for(int i=a;i<n;i++)
#define REP(i,n)	for(int i=0;i<=n;i++)
#define SREP(i,a,n)	for(int i=a;i<=n;i++)
#define rrep(i,n)	for(int i=n-1;i>=0;i--)
#define RREP(i,n)	for(int i=n;i>=0;i--)
#define all(a)	(a).begin(),(a).end()
#define mp(a,b)	make_pair(a,b)
#define mt	make_tuple
#define pb	push_back
#define fst	first
#define scn second
#define bicnt(x)	__buildin__popcount(x)
#define debug(x)	cout<<"debug: "<<x<<endl
#define DEBUG 0

const ll inf = (ll)1e8;
const ll mod = (ll)1e9 + 7;
const ld eps = 1e-9;
const int dx[] = { 0,1,0,-1 };
const int dy[] = { 1,0,-1,0 };

int main() {
	int n;	cin >> n;
	vint p(n);
	rep(i, n)	cin >> p[i];
	int ret = 0;
	if (p[0] == 1) {
		swap(p[0], p[1]);
		ret++;
	}
	srep(i, 1, n) {
		if (p[i] == i + 1 && p[i - 1] == i) {
			swap(p[i], p[i - 1]);
			ret++;
		}
	}
	srep(i, 1, n) {
		if (p[i] == i + 1) {
			swap(p[i], p[i - 1]);
			ret++;
		}
	}
	cout << ret << endl;
	return 0;
	return 0;
}

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

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

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

int main(){
    string L;
    cin >> L;
    int n; n = L.size();
    vector<vector<mint>> dp(n+1, vector<mint>(2));
    dp[0][0] = 1;
    rep(i, n){
        if(L[i] == '0'){
            dp[i+1][0] = dp[i][0];
            dp[i+1][1] = dp[i][1] * 3;
        }else{
            dp[i+1][0] = dp[i][0] * 2;
            dp[i+1][1] = dp[i][1] * 3 + dp[i][0];
        }
    }
    cout << (dp[n][0] + dp[n][1]).x << endl;
    return 0;
}


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

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

    if(n < 10){
        cout << r+(10-n)*100;
    }
    else{
        cout << r;
    }
}

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

namespace ConsoleApplication49
{
    class Program
    {
        static void Main()
        {
            int a = int.Parse(Console.ReadLine());
            for(int b = 0; b < a; b++)
            {
                string c = Console.ReadLine();
                if (c.Length < 7) { Console.WriteLine(c); continue; }
                for (int d = 0; d < c.Length; d++)
                {
                    try
                    {
                        if (c[d] == 'H' && c[d + 1] == 'o' && c[d + 2] == 's' && c[d + 3] == 'h' && c[d + 4] == 'i' && c[d + 5] == 'n' && c[d + 6] == 'o') { Console.Write("Hoshina"); d += 6; }
                        else Console.Write(c[d]);
                    }
                    catch { Console.Write(c[d]); }
                }
                Console.WriteLine();
            }
        }
    }
}

Measured memory_bytes: 8796
#include <iostream>

#include <vector>
#include <utility>

using BingoCardElementType = std::pair<int, bool>;
using BingoCardType = std::vector<std::vector<BingoCardElementType>>;

void CheckCard(BingoCardType &card, int number)
{
    for (auto& row : card)
    {
        for (auto& column : row)
        {
            if (column.first == number)
            {
                column.second = true;
            }
        }
    }
}

bool CheckRowBingo(const BingoCardType& card)
{
    for (const auto& row : card)
    {
        bool isRowBingo = true;
        for (const auto& column : row)
        {
            if (!column.second)
            {
                isRowBingo = false;
                break;
            }
        }

        if (isRowBingo)
        {
            return true;
        }
    }
    return false;
}

bool CheckColumnBingo(const BingoCardType& card)
{
    for (auto column = 0; column < card[0].size(); ++column)
    {
        bool isColumnBingo = true;
        for (auto row = 0; row < card.size(); ++row)
        {
            if (!card[row][column].second)
            {
                isColumnBingo = false;
                break;
            }
        }
        if (isColumnBingo)
        {
            return true;
        }
    }
    return false;
}

bool CheckDiagonalBingo(const BingoCardType& card)
{   
    // 3x3固定なので横着します
    if (!card[1][1].second)
    {
        return false;
    }

    if (card[0][0].second && card[2][2].second)
    {
        return true;
    }

    if (card[0][2].second && card[2][0].second)
    {
        return true;
    }
    return false;
}

bool CheckBingo(const BingoCardType& card)
{
    if (CheckRowBingo(card))
    {
        return true;
    }

    if (CheckColumnBingo(card))
    {
        return true;
    }

    if (CheckDiagonalBingo(card))
    {
        return true;
    }

    return false;
}

int main()
{
    BingoCardType card;
    card.resize(3);
    for (auto& row : card)
    {
        row.resize(3);
    }

    for (auto & row : card)
    {
        for (auto& column : row)
        {
            int val = 0;
            std::cin >> val;
            column = std::make_pair(val, false);
        }
    }

    int n = 0;
    std::cin >> n;
    for (auto count = 0; count < n; ++count)
    {
        int current = 0;
        std::cin >> current;
        CheckCard(card, current);
        if (CheckBingo(card))
        {
            std::cout << "Yes";
            return 0;
        }
    }

    std::cout << "No";
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;
  string taro, hanako;
  int point_t = 0, point_h = 0;
  rep(i, n) {
    cin >> taro >> hanako;
    if (taro == hanako) {
      point_t++;
      point_h++;
      continue;
    }
    int j = 0;
    int m = min(taro.size(), hanako.size());
    while (j < m) {
      if (taro[j] > hanako[j]) {
        point_t += 3;
        break;
      } else if (taro[j] < hanako[j]) {
        point_h += 3;
        break;
      }
      ++j;
      if (j == m) {
        if (taro.size() > hanako.size())
          point_t += 3;
        else
          point_h += 3;
      }
    }
  }

  cout << point_t << " " << point_h << endl;

  return 0;
}


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

typedef long long int lli;
const int MOD = 1000000007;
#define rep(i,n) for (int i = 0; i < n; i++)

using namespace std;

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

	int W, H, x, y; cin >> W >> H >> x >> y;
	double res = (double)W*H / 2;
	int sum = (W == x * 2 && H == y * 2) ? 1 : 0;
	cout << res << " " << sum << endl;
}

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

bool Input(int& n) {
    cin >> n;
    return n != 0;
}

int main () {
    int count;
    int n;
    vector<int> array;
    
    for (count = 0; Input(n); ++count) {
        array.push_back(n);
    }
    
    for (int i = 0, size = array.size(); i < size; ++i) {
        cout << "Case " << i + 1 << ": " << array[i] << endl;
    }

}

Measured memory_bytes: 3164
#include <stdio.h>

int N[101][101];

int main(){
   int n, a, b, i, j, k;

   scanf("%d",&n);

   for(i=0;i<n;i++){
      for(j=0;j<n;j++){
      N[i][j] = 0;
      }
   }

   for(i=0; i<n; i++){
      scanf("%d%d",&a, &b);
      for(j=0; j<b; j++){
         scanf("%d",&k);
         N[i][k-1] = 1;
      }
   }

   for(i=0; i<n; i++){
       for(j=0; j<n-1; j++){
         printf("%d ",N[i][j]);
       }
         printf("%d\n",N[i][j]);
   }
   return 0;
}

Measured memory_bytes: 1820
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}


int main(){
    ll n;
    cin >> n;
    ll lb = 0;
    ll ub = n;
    while(ub-lb>1){
        ll mid = (lb+ub)/2;
        if(mid*(mid+1)/2<n){
            lb = mid;
        }else{
            ub = mid;
        }
    }
    int ex = ub*(ub+1)/2-n;
    FOR(i,1,ub+1){
        if(ex!=i){
            put(i);
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int N,M,tmp=1000000007,ans;
int main(){
  cin >> N >> M;
  pair<long,int> a[55];
  pair<int,int> c[55];
  for(int i=0;i<N;i++){
    cin >> a[i].first >> a[i].second;
  }
  for(int i=1;i<=M;i++){
    cin >> c[i].first >> c[i].second;
  }
  for(int i=0;i<N;i++){
    ans=0;
    tmp=1000000007;
    for(int j=1;j<=M;j++){
      int dis = abs(c[j].first-a[i].first)+abs(c[j].second-a[i].second);
      if(tmp>dis){
        ans=j;
      }
      tmp=min(tmp,dis);
    }
    cout << ans << endl;
  }
  return 0;
}


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

int ConvStrToInt(char c)
{
	if ('0' <= c && c <= '9') return (c - '0');
	return -1;
}
struct INFO
{
public:
	int belong;		// 0か1か
	int value;
	INFO()
	{
		belong = 0;
		value = 0;
	}
};


int checkStr(int startIndex, int changeValueNum, vector<INFO>& vInfo, vector<int>& vSum)
{
	int resultValue = 0;

	int counter = 0;
	for (int i = startIndex;i < vInfo.size(); ++i)
	{
		if (counter >= changeValueNum)
		{
			resultValue += vInfo[i].value;
			break;
		}

		if (vInfo[i].belong == 0)
		{
			++counter;
		}
		resultValue += vInfo[i].value;
	}

	return resultValue;
}


int main() {
	int N, K;
	string S;
	cin >> N >> K;
	cin >> S;

	// 先頭は1にしたい
	vector<INFO> vInfo;
	if (ConvStrToInt(S[0]) == 0)
	{
		INFO info;
		info.belong = 1;
		info.value = 0;
		vInfo.push_back(info);
	}

	for (int i = 0; i < N;)
	{
		INFO info;
		info.belong = ConvStrToInt(S[i]);
		for (int j = i;; ++j)
		{
			if (ConvStrToInt(S[j]) == info.belong)
			{
				++info.value;
			}
			else
			{
				i = j;
				break;
			}
		}
		vInfo.push_back(info);
	}

	// 最後は1にしたい
	if (vInfo.size() % 2 == 0)
	{
		INFO info;
		info.belong = 0;
		info.value = 0;
		vInfo.push_back(info);
	}

	int Add = 2 * K + 1;


	// 累積和
	vector<int> vSum(vInfo.size() + 1, 0);
	for (int i = 1; i < vSum.size(); ++i)
	{
		vSum[i] = vSum[i - 1] + vInfo[i - 1].value;
	}

	int ans = 0;
	//1-0-1...の1から始めるので、偶数番目だけ見る
	for (int i = 0; i < vInfo.size(); i += 2)
	{
		//次のleft, rightを計算する [left, right)
		int left = i;
		int right = min(i + Add, (int)vInfo.size());
		int tmp = vSum[right] - vSum[left];

		ans = max(tmp, ans);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1652
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		Set<Integer> set = new HashSet<>();
		for (int i = 0; i < n; i++) {
			int temp = Integer.parseInt(br.readLine());
			if (set.contains(temp)) {
				set.remove(temp);
			} else {
				set.add(temp);
			}
		}
		System.out.println(set.size());
	}
}

Measured memory_bytes: 38696
#include<iostream>
using namespace std;
int main() {
    int n, m;
    int s = 0;
    cin >> n >> m;
    int x[100][100];
    int y[100];
    int z[100];
    for (int yoko = 0; yoko < n; yoko++) {
        for (int tate = 0; tate < m; tate++) {
            cin >> x[yoko][tate];
        }
    }
    for (int kakeru = 0; kakeru < m; kakeru++) {
        cin >> y[kakeru];
    }
    for (int keisanA = 0; keisanA < n; keisanA++) {
        for (int keisanB = 0; keisanB < m; keisanB++) {
            s += x[keisanA][keisanB] * y[keisanB];
        }
        z[keisanA] = s;
        s = 0;
    }
    for (int naiseki = 0; naiseki < n; naiseki++) {
        cout << z[naiseki] << endl;
    }
    return 0;
}


Measured memory_bytes: 3116
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const ll mod=1e9+7;

int main(){
  int r;
  cin >> r;
  printf("%d\n", 3*r*r);
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<iomanip>
#include<cfloat>
#include<algorithm>
using namespace std;

int n, i;

double minkdis(double x[], double y[], double p);

int main() {
	double x[100], y[100];
	cin >> n;
	for (i = 0; i < n; i++)cin >> x[i];
	for (i = 0; i < n; i++)cin >> y[i];
	cout << setprecision(10) << minkdis(x, y, 1) << endl << minkdis(x, y, 2) << endl 
		<< minkdis(x, y, 3) << endl << minkdis(x, y, DBL_MAX) << endl;
	return 0;
}

double minkdis(double x[], double y[], double p) {
	double dis = 0;
	if (p == DBL_MAX) {
		double maxd = fabs(x[0] - y[0]);
		for (i = 1; i < n; i++) {
			maxd = max(maxd, fabs(x[i] - y[i]));
		}
		return maxd;
	}
	for (i = 0; i < n; i++) {
		dis += pow(fabs(x[i] - y[i]), p);
	}
	return pow(dis, 1 / p);
}

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

int main(){
	int x, i;
	
	i = 1;
	while(1){
		cin >> x;
		if(x == 0){
			break;
		}
		cout << "Case " << i << ": " << x << endl;
		i++;
	}
    return 0;
}

Measured memory_bytes: 3072
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
// #include<assert.h>
#include<random>
using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }



void solve(void)
{ 
  int N,K;cin>>N>>K;
  int res = 0;
  for (int i = K+1; i <= N; i++)
  {
    int Q = N/i;
    int R = N%i;
    if(K == 0) R--;
    res += Q*(i - K) + max(0LL,R - K + 1);
    // DEBUG(res);
  }
  cout<<res<<endl;
  
  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 3620
#include<iostream>
using namespace std;
int i,j,k,n,p[105],d[80]={0,1};
int main(){
	cin>>n;
	for(i=2;i<=n;i++)for(j=2,k=i;k>1;j++)while(k%j==0)p[j]++,k/=j;
	for(i=2;i<=n;i++)for(j=75;j;j--)for(k=p[i];k;k--)if(j*(k+1)<=75)d[j*(k+1)]+=d[j];
	cout<<d[75];
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#define MN 1010000

int n;
char s[MN], t[MN];
int q[MN], hh = 0, tt = -1;

int main()
{
	scanf("%d", &n);
	scanf("%s%s", s + 1, t + 1);
	bool ok = 1;
	for(int i = 1; i <= n; i++) if(s[i] != t[i]) ok = 0;
	if(ok) return 0 * puts("0");
	int j = n, tag = 0, ans = 0;
	for(int i = n; i >= 1; i--)
	{
		while(i > 1 && t[i] == t[i - 1]) i--, hh++;
		if(j > i) {j = i; hh = 0; tt = -1;}
		while(j >= 1 && s[j] != t[i]) j--, q[++tt] = -tag;
		if(j == 0) return 0 * puts("-1");
		++tag; if(hh <= tt) ans = std::max(ans, q[hh] + tag);
		j--;
	}
	printf("%d\n", ans + 1);
}

Measured memory_bytes: 7552
from sys import stdin

n,m = map(int,input().split())
cities = [list(map(int,stdin.readline().split())) + [i] for i in range(m)]
for i in range(m):
    cities[i][0] -= 1
state = [[] for i in range(n)]
for i in cities:
    state[i[0]].append([i[1],i[2]])
for i in range(n):
    state[i].sort()
ans = []
for i in range(n):
    temp = "0"*(6-len(str(i+1))) + str(i+1)
    for j in range(len(state[i])):
        s = temp + "0"*(6-len(str(j+1))) + str(j+1)
        ans.append([state[i][j][1],s])
ans.sort()
for i in ans:
    print(i[1])

Measured memory_bytes: 62320
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(int argc, char const *argv[]) {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ans;
  if (b<c || d<a) ans = 0;
  else{
    if (a<c) {
      if (b<d) ans = b-c;
      else ans = d-c;
    }
    else {
      if (b<d) ans = b-a;
      else ans = d-a;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256