akhauriyash/Code-Regression huggingface dataset:
#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>
#include <random>

#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;
struct FIO{FIO(){std::cin.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::setprecision(15);}}fIO;
template<typename T> using V = std::vector<T>;
template<typename T> void fill(V<T>&v) { for(T&e:v) std::cin >> e; }
/*-*/

int main() {
	int n;
	std::cin >> n;
	int max=0;
	int cur=0;
	rep(i,n) {
		int a,b;
		std::cin >> a >> b;
		if(a==b) cur++;
		else cur=0;
		max=std::max(max,cur);
	}
	if(max>=3) print("Yes");
	else print("No");
}


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

#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//以降 cin の入力元が 'input.txt' になる
//std::ifstream in("input.txt");
//std::cin.rdbuf(in.rdbuf());


signed main()
{
    gearup;
    unsigned a,b; cin >> a >> b;
    a -= 2;
    b -= 2;
    if(a < b)out("Bob");
    else if(a > b)out("Alice");
    else out("Draw");
}

Measured memory_bytes: 3656
#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>;

int main() {
 int n, a;
  cin >> n >> a;
  if (n%500 <= a) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
 return 0;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(int i=0;i<(int)n;i++)
ll mod=1e9+7;
#define PI acos(-1)
struct edge{int from, to;};

int main(){
    string a,b,c;
    cin>>a>>b>>c;
    char next=a[0];
    int idxa=1;
    int idxb=0,idxc=0;
    while(1){
        if(next=='a'){
            if(idxa>=a.length()){
                cout<<'A'<<endl;
                return 0;
            }
            next=a[idxa++];
        }
        else if(next=='b'){
            if(idxb>=b.length()){
                cout<<'B'<<endl;
                return 0;
            }
            next=b[idxb++];
        }
        else if(next=='c'){
            if(idxc>=c.length()){
                cout<<'C'<<endl;
                return 0;
            }
            next=c[idxc++];
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// #include <atcoder/all>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, n) for (ll i = 1; i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
// using namespace atcoder;
void Main()
{
    ll K;
    cin >> K;

    ll n = 50;
    vector<ll> a(n);

    ll c = K / n;
    ll d = K % n;

    rep(i, n) a[i] = n - 1 + c;

    rep(_i, d) {
        ll minIdx = min_element(all(a)) - a.begin();
        rep(i, n) {
            if (i != minIdx) {
                a[i]--;
            }
        }
        a[minIdx] += n;
    }
    
    put(a.size())
    rep(i, a.size()) cout << a[i] << (i == a.size() - 1 ? "" : " ");
    cout << endl;
}
signed main(){ Main();return 0;}

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

int main()
{
	int n;
	cin >> n;
	vector<int>	a;
	a.resize(n);
	int i, j, k;
	int result = 0;

	for (i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	
	for (i = 0; i < n - 1; i++)
	{
		while (true)
		{
			if (a[i] > 0)
			{
				for (j = i + 1; j < n; j++)
				{
					if (a[j] <= 0)
					{
						break;
					}
				}

				for (k = i; k < j; k++)
				{
					a[k]--;
				}

				result++;
			}
          	else
            {
            	break;
            }
		}
	}

	result += a[n - 1];

	printf("%d", result);

	return 0;

}

Measured memory_bytes: 256
n = int(input())
s = input()
def test(n,s):
    list=[]
    nn = int(n/2)
    for t in range(0, nn):
        list.append(s[t])
    T = ''.join(list)

    if s == (T + T):
        print('Yes')
    else:
        print('No')

test(n,s)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define $$ long long int
#define pb push_back
#define db pop_back
#define q2(n) (n%2)==0
#define vp vector<pair <$$,$$> >
#define vctr vector<$$>
#define in(a) scanf("%lld",&a)
#define out(a) printf("%lld ",a)
#define loop(i,m,p) for ($$ i = m; i < p; i++)
#define loopn(i,m,p) for ($$ i = p-1; i >=m; --i)

using namespace std;


int main()
{
    string s;
    cin>>s;
    $$ cn=0;
    loop(i,0,4){
    	if (s[i]=='+')
    	{
    		/* code */cn++;
    	}
    	else
    		cn--;
    }
    cout<<cn;




return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)




int main() {
    ll n;
    cin >> n;
    
    vector<ll> a(n);
    REP(i, n){
        cin >> a[i];
    }
    
    ll l = 0, r = 0, ans = 0, sum = a[0], x_sum = a[0];
    for(;;){
        while(r < n && sum == x_sum){
            r++;
            if(r < n){
                sum += a[r];
                x_sum ^= a[r];
            }
        }
        ans += r - l;
        sum -= a[l];
        x_sum ^= a[l++];
        if(r == n && r == l){
            break;
        }
        // cout << l << ' ' << r << ' ' << ans << endl;
    }
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define REP(i, N) for(int i=0, i##_len=(N); i<i##_len; i++)
#define RREP(i, N) for(int i=1, i##_len=(N); i<i##_len; i++)
#define REPP(i, N) for(int i=0, i##_len=(N); i<=i##_len; i++)
#define RREPP(i, N) for(int i=1, i##_len=(N); i<=i##_len; i++)
#define P(x) cout << (x)
#define pb push_back
using ll = long long;
using namespace std;

int a, b, c;

int main() {
    cin >> a >> b >> c;
    cout << min({b/a, c});
    return 0;
}


Measured memory_bytes: 256
a, b, c, d = map(int, input().split())

alice = [a, b]
bob = [c, d]

if a < c:
    if c < b:
        if b < d:
            print(b - c)
        else:
            print(d - c)
    else: # b < c
        print(0)
else: # a > c
    if a < d:
        if d < b:
            print(d - a)
        else:
            print(b - a)
    else:
        print(0)


Measured memory_bytes: 3060
#include<cstdio>
#include<queue>
#include<algorithm>
#include<string.h>
#include<math.h>
#include<set>
#include<stack>
#include<queue>
#include<map>
#include<iostream>
using namespace std;
int a[11000]; 
int  main(){
	char s[100];
	scanf("%s",s);
	if(s[0]==s[1]&&s[0]==s[2])
	printf("No");
	else
	printf("Yes"); 
}




Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
S = set(A)
M = max(A)
A.sort()

pre_a = 0
for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a

print(len(S))

Measured memory_bytes: 32116
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");

        StringBuilder builder = new StringBuilder();

        for (int i = 0; i <  n ; i++) {
            builder.append(s[i]);
            builder.append(t[i]);
        }

        System.out.println(builder);
    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>

using namespace std;

template< typename T >
typename std::vector<T>::iterator 
   insert_sorted( std::vector<T> & vec, T const& item )
{
    return vec.insert
        ( 
            std::upper_bound( vec.begin(), vec.end(), item ),
            item 
        );
}


int main() {
  int n;
  cin >> n;
  map<int, int> maxes;
  vector<int> roots;
//  vector< vector<int>> g;

  for(int i=0; i<n; i++) {
    int v;
    cin >> v;
    v = -1*v;
    if(roots.size() <= 0) {
      roots.push_back(v);
      // maxes[v] = v;
      continue;
    }

//    sort(roots.begin(), roots.end());
    auto index = upper_bound(roots.begin(), roots.end(), v);
    if(index != roots.end()) {
      roots.erase(index);
    }
    insert_sorted(roots,v);


    // for(auto r : roots) {
    //   cout << r << " ";
    // }
    // cout << endl;

    // bool f = true;
    // for(int r : roots) {
    //   if( maxes[r] < v ) {
    //     maxes[r] = v;
    //     f = false;
    //     break;
    //   }
    // }

    // if(f){
    //   roots.push_back(v);
    //   maxes[v] = v;
    // }
  }
  cout << roots.size() << endl;
}

Measured memory_bytes: 892
def main():
    S = input()
    if S[0] == "B":
        K = "WB"
    else:
        K = "BW"

    cnt = 0
    for i in range(len(S)-1):
        if S[i:i+2] == K:
            cnt += 1

    if S[0] == S[-1]:
        print(2 * cnt)
    else:
        print(1 + 2 * cnt)


main()


Measured memory_bytes: 3188
H,W = map(int,input().split())
snuke_list_list = []
snuke_list = []
for i in range(H) : 
    snuke_list_list.append(input().split())

for i in range(H) :
    # snuke_list = [str(i) for i in input().split()]
    snuke_list = snuke_list_list[i]

    if ("snuke" in snuke_list) :
        index = snuke_list.index("snuke")
        c = chr(ord("A") + index)
        print(c + str(i+1))
        break






Measured memory_bytes: 3060
//
//  main.c
//  AOJ_Plays
//
//  Created by ???????????? on 2016/07/03.
//  Copyright ?? 2016??´ ????????????. All rights reserved.
//

#include <stdio.h>
int main(){
    int a, b;
    scanf("%d %d", &a, &b);
    if(a < b) {
        printf("a < b\n");
    }
    else if(a == b){
        printf("a == b\n");
    }
    else{
        printf("a > b\n");
    }
    return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int n; 
  // while (cin >> n) {
    cin >> n;
    vector<string> s(n);
    int as = 0, bs = 0, both = 0;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      cin >> s[i];
      for (int j = 0; j < s[i].size() - 1; j++) {
        if (s[i][j] == 'A' && s[i][j + 1] == 'B') {
          cnt++;
        }
      }
      if (s[i][0] == 'B') {
        bs++;
      }
      if (s[i].back() == 'A') {
        as++;
      }
      if (s[i].back() == 'A' && s[i][0] == 'B') {
        both++;
      }
    }
    if (both > 0 && both == max(as, bs)) {
      both--;
      ((int&)max(as, bs))--;
    }
    cnt += min(as, bs);
    cout << cnt << '\n';
  // }
}


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

typedef long long ll;
typedef unsigned long long ull;
const int inf = 2e9;
const ll INF = 4e18;

string s, t;
pair<int,int> dp[3010][3010];

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

  cin >> s >> t;
  for (int i = 1; i <= s.size(); i++) {
    for (int j = 1; j <= t.size(); j++) {
      dp[i][j] = max(dp[i][j], make_pair(dp[i-1][j-1].first + (s[i-1] == t[j-1]), 2));
      dp[i][j] = max(dp[i][j], make_pair(dp[i-1][j].first, 3));
      dp[i][j] = max(dp[i][j], make_pair(dp[i][j-1].first, 1));
    }
  }
  
  vector<char> ans;
  
  int a = s.size(), b = t.size();
  while (a * b) {
    if (dp[a][b].second == 2) {
      ans.push_back(s[a-1]);
      a--;
      b--;
    }
    else if (dp[a][b].second == 3) {
      a--;
    }
    else {
      b--;
    }
  }
  
  for (int i = ans.size()-1; i >= 0; i--) cout << ans[i];
  cout << endl;

  return 0;
}


Measured memory_bytes: 70784
#!/usr/bin/env python
from collections import defaultdict, deque
import math
from math import factorial
import fractions
import re

BIGNUM = 10 ** 9 + 7

def numsum(x):
    return sum([int(i) for i in str(x)])

def main():
    N = int(input())

    minnum = BIGNUM
    for A in range(1, N):
        B = N - A
        n = numsum(A) + numsum(B)
        if n < minnum:
            minnum = n
    print(minnum)

if __name__ == '__main__':
    main()


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

int main() {
	int n;
	cin >>n;
	int a[n+1]={};
	for (int i=1;i<=n;i++){
		cin >> a[i];	
	}
	for (int i=n;i>=2-n%2;i=i-2){
		cout << a[i] << ' ';
	}
	for (int i=n%2+1;i<=n-1;i=i+2){
		cout << a[i] << ' ';
	}
	return 0;
}

Measured memory_bytes: 2944
#include <algorithm>
#include <bitset>
#include <boost/dynamic_bitset.hpp>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeindex>
#include <typeinfo>
#include <vector>
#include <numeric>

#define DEBUG(x) cout << #x << ": " << x << endl
#define INFILE() freopen("input.txt", "r", stdin)
#define REP(i, a, b) for (int i = a; i < b; i++)
#define ALL(s) begin(s), end(s)
#define RALL(s) rbegin(s), rend(s)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_i = pair<ll, int>;
using i_ll = pair<int, ll>;
using d_i = pair<double, int>;
using ll_ll = pair<ll, ll>;
using d_d = pair<double, double>;

static constexpr ll LL_MOD = 1000000009;
static constexpr int I_MOD = 1000000007;
static constexpr double EPS = numeric_limits<double>::epsilon();
static constexpr double PI = 3.14159265358979323846264338327950288;

template <class T> static void scan(vector<T> &v);
static void scan(vector<string> &v, bool isWord = true);
static boost::dynamic_bitset<> scan(char trueValue = 'o');

int main(int argc, char *argv[]) {
	// INFILE();
	int n, m;
	cin >> n;

	vector<int> v(n);
	scan(v);

	cin >> m;

	vector<vector<int>> drinks(m);
	for(auto &d : drinks) {
		d.resize(2);
		scan(d);
	}

	int total = accumulate(ALL(v), 0);

	REP(i, 0, m) {
		cout << total - v[drinks[i][0] - 1] + drinks[i][1] << "\n";
	}
  return 0;
}

template <class T> static void scan(vector<T> &v) {
  map<type_index, const char *const> m = {{typeid(int), "%d"},
                                          {typeid(ll), "%lld"},
                                          {typeid(double), "%lf"},
                                          {typeid(char), "%c"}};

  auto tFormat = m[typeid(T)];

  for (T &n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string> &v, bool isWord) {
  if (isWord) {
    for (auto &n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

static boost::dynamic_bitset<> scan(char trueValue) {
  string s;
  getline(cin, s);

  if (s.size() == 0) {
    getline(cin, s);
  }

  for_each(begin(s), end(s),
           [trueValue](char &c) { c = (c == trueValue) ? '1' : '0'; });
  return boost::dynamic_bitset<>(string(rbegin(s), rend(s)));
}


Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        var p = new Program();
        var N = int.Parse(Console.ReadLine());
        var input = p.ConvertIntArray(p.ReadInput());
        Array.Sort(input);
        var result = (input[0] + input[1]) / 2.0;
        for (var i = 2; i < N; i++)
        {
            result = (result + input[i]) / 2.0; 
        }
        Console.WriteLine(result);
    }


    public string[] ReadInput()
    {
        return Console.ReadLine().Split(' ');
    }

    public int[] ConvertIntArray(string[] x)
    {
        var convertedArray = new int[x.Length];
        for (var i = 0; i < x.Length; i++)
        {
            convertedArray[i] = int.Parse(x[i]);
        }

        return convertedArray;
    }

}



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

public class Main {
	final static int MOD = 1000000007;
	final static int intMax = 1000000000;
	final static int intMin = -1000000000;
	final static int[] dx = { 0, 0, -1, 1 };
	final static int[] dy = { -1, 1, 0, 0 };

	static int T;

	static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[360]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}
	
	public static void main(String[] args) throws Exception {
		Reader in = new Reader();
		int N = in.nextInt();
		int[] h = new int[N];
		for(int i = 0; i < N; ++i) {
			h[i] = in.nextInt();
		}
		int[] dp = new int[N];
		for(int i = 1; i < N; ++i) {
			dp[i] = dp[i - 1] + Math.abs(h[i] - h[i - 1]);
			if(i > 1) dp[i] = Math.min(dp[i], dp[i - 2] + Math.abs(h[i] - h[i - 2]));
		}
		System.out.println(dp[N - 1]);
		in.close();
	}
}

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

#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,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h, w;
	cin >> h >> w;

	REP(i, h) {
		REP(j, w) {
			string s;
			cin >> s;
			if (s == "snuke") {
				cout << char('A' + j) << i + 1 << endl;
				return 0;
			}
		}
	}

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a;
  a = 0;
  in(n);
  vector<ll> c(n);
  rep(i, n)
    in(c[i]);
  rep(i, n - 2){
    if(c[i] < c[i + 1] && c[i + 1] < c[i + 2])
      a++;
    if(c[i] > c[i + 1] && c[i + 1] > c[i + 2])
      a++;
  }
  out(a);
  memi;
}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int cnt = sc.nextInt();
		double[] nums = new double[cnt];
		for (int i = 0; i < cnt; i++) {
			nums[i] = sc.nextInt();
		}

		Arrays.sort(nums);

		int process = 0;
		double convert = -1;

		while (true) {
			double a = 0;
			double b = 0;
			if (convert != -1) {
				if (process == cnt - 1) {
					a = nums[process];
					b = convert;
					process = process + 1;
				} else {
					if (nums[process + 1] > convert) {
						a = nums[process];
						b = convert;
						process = process + 1;
					} else {
						a = nums[process];
						b = nums[process + 1];
						process = process + 2;
					}
				}
			} else {
				a = nums[process];
				b = nums[process + 1];
				process = process + 2;
			}
			convert = (a + b) / 2;
			if (process == cnt) {
				break;
			}
		}
		System.out.println(convert);
	}

}


Measured memory_bytes: 23764
macro_rules! get {
    (Vec<$t:ty>) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (N, x) = get!(usize, i64);
    let mut a = get!(Vec<i64>);
    a.sort();

    // aが小さい順に貪欲に配る
    let (m, s) = a.into_iter()
        .fold(
            (0, 0),
            |(res, acc), b| if x - acc >= b {
                (res + 1, acc + b)
            } else {
                (res, acc + b)
            }
        );
    let ans = if s < x {
        m - 1
    } else {
        m
    };

    println!("{}", ans);
}


Measured memory_bytes: 4352
using System;
using System.Collections.Generic;
using System.Linq;
// using System.Linq;

namespace easy_Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            // float[] ABN = Array.ConvertAll(Console.ReadLine().Split(),float.Parse);
            // int[] nx = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // long K = long.Parse(Console.ReadLine());
            int[] ABC = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // string S = Console.ReadLine();
            // int s = int.Parse(Console.ReadLine());
            // int i = int.Parse(Console.ReadLine());
            // int n = int.Parse(Console.ReadLine());
            // string A = Console.ReadLine();
            // string B = Console.ReadLine();
            // var s = (new string[] { Console.ReadLine(), Console.ReadLine(), Console.ReadLine() }).Select(int.Parse);
            // int[] abc = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            // var X = Console.ReadLine();
            // int[,] abcd = new int[NMQ[2],4];
            // int[] A = new int[NMQ[0]];
            // int[] A_num = new int[NMQ[0]];
            // for(int i = 0; i<A_num.Length;i++){
            //     A_num[i] = 0;
            // }
            if(ABC.Count(x=>x==5)==2 && ABC.Count(x=>x==7)==1){
                Console.WriteLine("YES");
            }else{
                Console.WriteLine("NO");
            }
        }
        //最小公倍数
        static long Lcm(long a, long b)
        {
            return a/Gcd(a,b)*b;
        }

        //最大公約数
        static long Gcd(long m, long n)
        {
            if(n==0)return m;
            return Gcd(n,m%n);
        }
    }
}

Measured memory_bytes: 13268
//Dragon_warrior7(IITK)
#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 lb(v, temp) lower_bound(v.begin(), v.end(), temp)
#define ub(v, temp) upper_bound(v.begin(), v.end(), temp)
#define fi first
#define se second
#define llmax 1000000000000000000
#define deb(x) cout << #x << " " << x << "\n"
#define pll pair<ll, ll> 
#define vll vector<ll> 
#define rub cout << "\n------------------------------------\n"
void read(vector<ll> &v)
{
	for (int i = 0; i < v.size(); i++)
		cin >> v[i];
}

void print(vector<ll> v)
{
	for (int i = 0; i < v.size(); i++)
		cout << v[i] << " ";
}
ll n,m,a,b,temp,x,y;
string str;
set<ll> s;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n;
	cin>>a;
	vll v(n);
	read(v);
	sort(v.begin(),v.end(),greater<>());
	for(int i=0;i<n;i++)
	{
	    if(a)
	    {
	        a--;continue;
	    }
	    else
	    {
	        b+=v[i];
	    }
	}
	cout<<b;
	
	
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

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

using ll = long long;
using ull = unsigned long long;
using namespace std;

using P = pair<int,int>;
using T = tuple<int,int,int>; // 距離　頂点　親
using Graph = vector<vector<P>>;

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

    Graph G(n);
    map<P,int> mp;
    rep(i,m){
        int a, b, c; cin >> a >> b >> c;
        a--; b--;
        G[a].push_back(P(b,c));
        G[b].push_back(P(a,c));
        mp[P(a,b)] = i;
        mp[P(b,a)] = i;
    }

    vector<bool> used(m,false);

    rep(i,n){
        vector<int> dist(n,100100100); dist[i] = 0; // 最短距離
        priority_queue<T, vector<T>, greater<T>> que; // 小さい順に取り出す
        que.push(T(0, i, -1));
        while (!que.empty()){
            T t = que.top(); que.pop();
            int d, v, p; tie(d, v, p) = t;
            if (dist[v] < d) continue; // 最短距離ではない
            if(p != -1) used[mp[P(p,v)]] = true; // 辺を使う
            for (auto e : G[v]) {
                if (dist[e.first] > dist[v] + e.second) {
                    dist[e.first] = dist[v] + e.second;
                    que.push(T(dist[e.first], e.first, v));
                }
            }
        }
    }

    int ans = m;
    rep(i,m) if(used[i]) ans--;

    cout << ans << endl;
}



Measured memory_bytes: 3656
#include<iostream>
#include<string>
using namespace std;
int main() {
	string O, E;
	int i;
	cin >> O >> E;
	for (i = 0; i < E.size(); i++)
		cout << O[i] << E[i];
	if (O.size() > E.size())
		cout << O[i] << endl;
	else
		cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,s;
    cin>>a>>b;
    if(a>=1 && a<=9 && b>=1 && b<=9)
    {
        cout<<a*b<<endl;
    }
    else
    {
        cout<<"-1"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
# GRL_7_A: Matching - Bipertite Matching


from heapq import heappush, heappop


class Edge:
    __slots__ = ('src', 'dest', 'capacity', 'flow', 'cost')

    def __init__(self, v, w, capacity, cost=0):
        self.src = v
        self.dest = w
        self.capacity = capacity
        self.cost = cost
        self.flow = 0

    def other(self, v):
        if v == self.src:
            return self.dest
        else:
            return self.src

    def residual_capacity(self, v):
        if v == self.src:
            return self.capacity - self.flow
        else:
            return self.flow

    def cost_from(self, v):
        if v == self.src:
            return self.cost
        else:
            return -self.cost

    def add_flow(self, v, f):
        if v == self.src:
            self.flow += f
        else:
            self.flow -= f

    def __str__(self):
        return "{} {} {} {} {}".format(self.src, self.dest, self.capacity,
                                       self.cost, self.flow)


class Network:
    def __init__(self, v):
        self.v = v
        self._edges = [[] for _ in range(v)]

    def add(self, edge):
        self._edges[edge.src].append(edge)
        self._edges[edge.dest].append(edge)

    def adj(self, v):
        return self._edges[v]

    def flow(self, v):
        return sum(e.flow for e in self.adj(v) if e.src == v)

    def cost(self):
        cost = 0
        for v in range(self.v):
            for e in self.adj(v):
                if e.src == v:
                    cost += e.flow * e.cost
        return cost

    def __str__(self):
        s = ''
        for v in range(self.v):
            for e in self.adj(v):
                s += "{} {}\n".format(v, e)

        return s


def max_flow(network, s, t):
    def augment_path():
        marked = [False] * network.v
        edge_to = [None] * network.v
        n = 0
        heap = [(-10**6, s, n, None)]
        while heap:
            cap, v, _, e = heappop(heap)
            edge_to[v] = e
            if v == t:
                return (-cap, edge_to)
            if not marked[v]:
                marked[v] = True
                for ne in network.adj(v):
                    n += 1
                    w = ne.other(v)
                    c = ne.residual_capacity(v)
                    if not marked[w] and c > 0:
                        heappush(heap, (max(-c, cap), w, n, ne))

        return (0, [])

    while True:
        cap, path = augment_path()
        if cap == 0:
            break
        v = t
        e = path[t]
        while e is not None:
            v = e.other(v)
            e.add_flow(v, cap)
            e = path[v]

    return network.flow(s)


def run():
    n, m, e = [int(i) for i in input().split()]
    s, t = 0, n+m+1
    net = Network(n+m+2)
    for i in range(n):
        net.add(Edge(s, i+1, 1))
    for j in range(m):
        net.add(Edge(j+1+n, t, 1))

    for _ in range(e):
        x, y = [int(i) for i in input().split()]
        edge = Edge(x+1, y+1+n, 1)
        net.add(edge)

    print(max_flow(net, s, t))


if __name__ == '__main__':
    run()



Measured memory_bytes: 7912
let split_string ?(pattern="") = Str.split @@ Str.regexp pattern
let n = read_line () |> split_string |> List.map int_of_string |> Array.of_list
let k = Scanf.sscanf (read_line ()) "%d" @@ fun k -> k

let len = Array.length n

let m_1e9 = int_of_float 1e9 + 7
let ( +^ ) x y = (x + y) mod m_1e9
let ( -^ ) x y = x - y + if x < y then m_1e9 else 0
let ( *^ ) x y = ((x mod m_1e9) * (y mod m_1e9)) mod m_1e9

let rec mod_pow x n =
  if n = 0 then 1
  else let t = mod_pow x (n / 2) in t *^ t *^ if n mod 2 = 0 then 1 else x

let nPr n r = Array.(init r ((-) n) |> fold_left ( *^ ) 1)

let nCr n r = nPr n r *^ mod_pow (nPr r r) (m_1e9 - 2)

let rec loop i k smaller =
  if i = len then
    if k = 0 then 1 else 0
  else if k = 0 then 
    1
  else if smaller then
    nCr (len - i) k * mod_pow 9 k
  else if n.(i) = 0 then
    loop (i + 1) k false
  else
    (loop (i + 1) k true) + 
    (loop (i + 1) (k - 1) true * (n.(i) - 1)) +
    (loop (i + 1) (k - 1) false)

let () = Printf.printf "%d\n" @@ loop 0 k false

Measured memory_bytes: 3848
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int ll;

int main()
{
    int a,b,n,x[40],y[40];
	for(;;){
	cin >> a >> b;
	if(a==0&&b==0)return 0;
	cin >> n;
	for(int i=0;i<n;i++)cin >> x[i] >> y[i];
	int dp[20][20];
	for(int i=0;i<20;i++){
		dp[0][i]=0;
		dp[i][0]=0;
	}
	dp[1][1]=1;
	for(int i=1;i<=a;i++){
		for(int j=1;j<=b;j++){
			if(i==1&&j==1)continue;
			for(int k=0;k<n;k++){
				if(x[k]==i&&y[k]==j){
					dp[i][j]=0;
					goto next;
				}
			}
			dp[i][j]=dp[i-1][j]+dp[i][j-1];
			next:;
		}
	}
	printf("%d\n",dp[a][b]);
	}
    return 0;
}

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

const int INF = 2.1e9;

int signum(int x) {
	return x < 0 ? -1 : (x > 0);
}

int main() {
	int x, y;
	cin >> x >> y;
	int ans = INF;
	if (x < y) ans = y-x;
	if (signum(x)*signum(y) <= 0) {
		ans = min(ans, abs(x+y)+1);
	} else {
		ans = min(ans, abs(x-y)+2);
	}
	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.Arrays;

public class Main {
    private static final BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    public static void main(String[] args) {
        exec(args);
    }

    public static void exec(String[] args) {
        String str = readLineStandardInput();
        String[] mem = str.split(" ");
        int N = Integer.parseInt(mem[0]);
        int K = Integer.parseInt(mem[1]);

        int[] An = new int[N];
        str = readLineStandardInput();
        String[] memAn = str.split(" ");
        for(int i = 0; i < memAn.length; i++){
            An[i] = Integer.parseInt(memAn[i]);
        }
        int idx = -1;
        { // get min value index
            int minValue = Integer.MAX_VALUE;
            for(int i = 0; i < An.length; i++){
                if(An[i] < minValue){
                    idx = i;
                    minValue = An[i];
                }
            }
        }
        int minCnt = Integer.MAX_VALUE;
        for(int i = 0; i < K; i++) {
            int cnt = 1;
            { // left side num
                int leftSide = idx - i;
                while(leftSide > 0){
                    leftSide -= (K - 1);
                    cnt++;
                }
            }
            { // right side num
                int rightSide = idx + (K - i - 1);
                while(rightSide < N - 1){
                    rightSide += (K - 1);
                    cnt++;
                }
            }
            if(cnt < minCnt){
                minCnt = cnt;
            }
        }
        System.out.println(minCnt);
    }

    private static String readLineStandardInput() {
        String str;
        try {
            str = input.readLine();
        } catch(IOException e){
            str = null;
            System.out.println(e);
        }
        return str;
    }
}


Measured memory_bytes: 35028
//include
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const long long INF = 1000000007;
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
// chmax chmin
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main(void){
    int N; cin >> N;
    int l[N],r[N]; REP(i,N) cin >> l[i] >> r[i];
    int ans = 0;
    REP(i,N) ans += r[i]-l[i]+1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int min;
		List<Integer> Value = new ArrayList<Integer>();
		for(int i=0;i<N;i++)
		{
			Value.add(sc.nextInt());//Listに追加
		}		
		Collections.sort(Value);//昇順に並べ替え
		Collections.reverse(Value);//逆順に並べ替え
		min = Math.abs(Value.get(0)-Value.get(K-1));
		for(int j=1;j<N-K+1;j++)
		{
			int num = Math.abs(Value.get(j)-Value.get(j+K-1));
			if(min>num)
			{
				min = num;
			}
		}
		System.out.println(min);

	}
}

Measured memory_bytes: 58516
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <valarray>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <list>
#include <limits>
#include <numeric>
#include <utility>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#include <array>
#include <bitset>
#include <complex>
#include <tuple>
#include <random>

using namespace std;
using ll = long long;
const int INF = 1e9;
const ll MOD = 1e9 + 7;

int main()
{
  ll l, r;
  cin >> l >> r;
  if (r - l >= 2019)
  {
    cout << 0 << endl;
    return 0;
  }
  ll ans = 5e18;
  for (ll i = l; i <= r; ++i)
  {
    for (ll j = i + 1; j <= r; ++j)
      ans = min(ans, (i * j) % 2019);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

signed main(){
    ll A, B;
    cin >> A >> B;
    char grid[100][100];
    REP(i, 50) REP(j, 100) grid[i][j] = '#';
    FOR(i, 50, 100) REP(j, 100) grid[i][j] = '.';
    REP(i, A - 1){
        grid[2 * (i / 50)][(2 * i) % 100] = '.';
    }
    REP(i, B - 1){
        grid[99 - 2 * (i / 50)][(2 * i) % 100] = '#';
    }
    cout << 100 << " " << 100 << endl;
    REP(i, 100){
        REP(j, 100) cout << grid[i][j];
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define pf printf
#define sc(x) scanf("%d",&x);
#define scs(x) scanf("%s",x);
#define scl(x) scanf("%lld",&x);
#define rep(i,s,e) for(int i=s; i<=e; ++i)
#define dep(i,s,e) for(int i=s; i>=e; --i)
typedef long long ll;
using namespace std;
const ll mod=998244353;
char s[4];
int main()
{
	scs(s);
	if(s[1]=='B')pf("ARC\n");
	else pf("ABC\n");
}


Measured memory_bytes: 3764
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
ans = ''

def div(a, b=-2):
    if a >= 0:
        return -(a//(-b)), a%(-b)
    else:
        if (-a)%(-b) == 0:
            return (-a)//(-b), 0
        else:
            return (-a)//(-b)+1, 1

while True:
    N, m = div(N)
    ans += str(m)
    if abs(N) < 2:
        break

if N == -1:
    ans += '11'
elif N == 1:
    ans += '1'

print(ans[::-1])

Measured memory_bytes: 9220
//Twitter@KonoLv1 2020年春からエンジニア見習いデビュー！
 
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
 
int main(void){
    int i,j;            //  ループ文に使用
    int x,y,z;
    int count1,count2,count;   //  カウント用に使用
    double k;
    double n;
    int boxa[1024] = {};
    int boxb[1024] = {};
    char s[200001] = {};        //  文字列
    char s2[200001] = {};        //  文字列
    int a,b,c,h,w;
    a = b = c = i = 0;
    int mode = 0;
    count = count1 = count2 = 0;
 
    //  入力処理
    
    scanf("%lf",&n);
    for (i = 1; i <= n; i++){
        if (i % 2 == 1){
            count++;
        }

    }
         k = count / n;
    //  計算処理
    
 
 
    //  出力処理
 
    printf("%2.10lf",k);
 
}

Measured memory_bytes: 128
import java.util.*;
import java.math.BigDecimal;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String str = sc.next();
		String[] c = str.split("");
		int left = 0;
		int right = n-1;
		int count = 0;
		while(true){
			if("R".equals(c[left])){
				left++;
			} else if("W".equals(c[right])){
				right--;
			} else if("W".equals(c[left]) && "R".equals(c[right]) && left < right) {
				count++;
				left++;
				right--;
			} else {
				break;
			}
			if(left > right || right >= n)break;
		}
		System.out.println(count);
	}
}

Measured memory_bytes: 65712
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y

n = ini()
a = ['AC x','WA x','TLE x','RE x']
result = [0,0,0,0]
for i in range(n):
        s = input()
        if s[0] == 'A':
                result[0] += 1
        elif s[0] == 'W':
                result[1] += 1
        elif s[0] == 'T':
                result[2] += 1
        else:
                result[3] += 1
for i in range(4):
        print(a[i],result[i])


Measured memory_bytes: 69608
#include <iostream>
using namespace std;
int main(){
    int n;cin>>n;
    if(65 <= n && n <= 90){
        cout << 1 << endl;
    }else if(97 <= n && n <= 122){
        cout << 2 << endl;
    }else{
        cout << 0 << endl;
    }
}


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

vector<int> p[100005];

int main(){
	int n, m;

	cin >> n >> m;

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

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

		cin >> a >> b;
		p[a-1].push_back(b-1);
		p[b-1].push_back(a-1);
	}

	int cnt = 0;
	for(int i=0; i<n; i++){
		int j;
		for(j=0; j<p[i].size(); j++){
			if(h[i] <= h[p[i][j]]){
				break;
			}
		}
		if(j == p[i].size()){
			cnt++;
		}
	}

	cout << cnt << endl;
}


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

int main() {
    cin.tie(0)->sync_with_stdio(false);

	int n, m; cin >> n >> m;
	priority_queue<ll> a;
	REP(i, n) {
		ll tmp; cin >> tmp;
		a.push(tmp);
	}

	REP(i, m) {
		ll tmp = a.top();
		a.pop();
		a.push(tmp/2);
	}

	ll sum = 0;
	while (!a.empty()) {
		sum += a.top();
		a.pop();
	}
	cout << sum << '\n';
    return 0;
}


Measured memory_bytes: 4264
import java.util.*;
    public class Main {
    	public static void main(String[] args){
    		Scanner sc = new Scanner(System.in);
    		// 整数の入力
    		char[] ca = sc.next().toCharArray();
                boolean res = false;
                for(int i=0; i<ca.length; i++){
                    for(int j=i+1; j<ca.length; j++){
                        if(ca[i] == ca[j]){
                            res = true;
                        }
                    }
                }
    		System.out.println(res?"no":"yes");
    	}
    }



Measured memory_bytes: 23636
S = input()
len_s = len(S)
a = [int(S[i]) for i in range(len(S))]
sum_list = []

def f(pos, one_sum, block):
    if pos == len_s - 1:
        one_sum += block
        sum_list.append(one_sum)

    else:
        f(pos+1, one_sum + block, a[pos+1])
        f(pos+1, one_sum, 10*block+a[pos+1])

f(0,0,a[0])
print(sum(sum_list))

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

int main(){
	int n, m;

	while ( cin >> n >> m && ( n || m ) ){
		bool* man = new bool[ n ]();
		int p = n - 1;
		for ( int i = 0; i < n - 1; ++i ){
			int cnt = 0;
			while( cnt != m ){
				p = ( p + 1 ) % n;
				if ( !man[ p ] ){
					++cnt;
				}
			}
			man[ p ] = true;
		}

		for ( int i = 0; i < n; ++i ){
			if ( !man[ i ] ){
				cout << i + 1 << endl;
				break;
			}
		}

		delete[] man;
	}
	return 0;
}

Measured memory_bytes: 908
#pragma GCC optimize("Ofast",3,"inline")
#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define m_p make_pair
#define y1 ygftgfgcdtfgxffgx
#define y2 yfdsesgvtyghftfvv
#define x1 xvyr6cf6fgcfgf676
#define x2 xcr6rfc5r66y6r6fr
#define up_bound upper_bound
#define low_bound lower_bound
#define next_per next_permutation
#define pb push_back
#define i_to_s to_string
typedef priority_queue<int> p_queue;
typedef priority_queue<int, vector<int>, greater<int> > min_p_queue;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int mon[20]={31,28,31,30,31,30,31,31,30,31,30,31};
ll gcd(ll x,ll y){return ((y==0)?x:gcd(y,x%y));}
int n,x,y;
int went_1(int a,int b){return b-a;}
int went_2(int a,int b){return max(y-b,b-y)+1+max(a,x)-min(a,x);}
set<pii >s[2024];
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	cin>>n>>x>>y;
	for(int i=1;i<=n;i++)for(int j=i+1;j<=n;j++){
		int minn=min(went_1(i,j),went_2(i,j));
		s[minn].insert(m_p(i,j));
	}
	for(int i=1;i<n;i++)cout<<s[i].size()<<'\n';
	return 0;
}


Measured memory_bytes: 95872