akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = 1000003;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = (int)1e6 + 10;

int power(int a, int b, int m = mod){if(b < 0)b += m-1; int r = 1; while(b){if(b&1)r=(r*a)%m; a = (a*a)%m; b>>=1;}return r;}

int fact[N+10], ifact[N+10];
void pre(int N){
   fact[0] = 1;
   for (int i = 1; i <= N; ++i)
   {
      fact[i] = (i*fact[i-1])%mod;
   }
   ifact[N] = power(fact[N], -1);
   tr(fact[N-1], fact[N], ifact[N]);
   for (int i = N-1; i >= 0; --i)
   {
      ifact[i] = ((i+1)*ifact[i+1])%mod;
   }
}

int32_t main(){_

   pre(mod-1);

   int q;
   cin>>q;
   while(q--){
      int x, d, n;
      cin>>x>>d>>n;

      int ans = 0;
      if (d == 0){
         ans = power(x, n);
         cout<<ans<<endl;
         continue;
      }
      int p = power(d, n);
      int a = (x*power(d, -1) -1 + mod) % mod;
      int t = n + a;
      if (t >= mod){
         cout<<0<<endl;
         continue;
      }
      int vals = (fact[t] * ifact[a]) % mod;
      p *= vals;
      p %= mod;
      cout<<p<<endl;
   }

   return 0;
}

// Common sense: do smth instead of nothing
// Even a single second counts...
// If other's can do it, even I can do it. It wouldn't be that tough. Let me give it a try.
// Mistakes made in past
// -Ques. ask for max-min => think binary_search, DP, greedy
// -not reading question properly / skipping to read & understand all samples properly & wasting time in wrong direction.
// -Using wrong indexing in nested loops something like a[i], when it is supposed to be a[j](WA)
// -value of const int N is not correct (WA/RTE).
// -Did you memset dp to -1 ?
// -check for small edges cases and work on small test cases manually if WA
// -not deallocating memory to pointers can lead to MLE. Use delete :))
// -not reading problem statements of harder problems E,..., thinking it couldn't be solved, but it isn't the case.
// -Avoid using #define int long long as much as possible when it's dp problem and requires high memory say, O(N^2, N=5000) (MLE)
// -Check Bitwise Operator Precedence 
// -Use pragmas to optimize (by constant factor) when necessary..
// -Think before coding & starting to debug. Have patience to look inside code and actually see how it works

Measured memory_bytes: 16512
using System;
using System.Linq;
class aoj
{
    static void Main()
    {
        string[] a = Console.ReadLine().Split(' ');
        int b = a.Length;
        string []c = new string[b];
        int d = 0;
        int []g = new int[2];
        for(int i = 0; i < b; i++)
        {
            for(int j = 0; j < d; j++)
            {
                if (a[i] == c[j])
                {
                    goto stop;
                }
            }
            c[d]= a[i];
            d++;
            stop:;
            if (a[i].Length > g[1])
            {
                g[0] = i;
                g[1] = a[i].Length;
            }
        }
        int[] e = new int[d];
        for(int i = 0; i < d; i++)
        {
            for(int j = 0; j < b; j++)
            {
                if (c[i] == a[j])
                {
                    e[i]++;
                }
            }
        }
        int f = (int)e.Max();
        for(int i = 0; i < d; i++)
        {
            if (e[i] == f)
            {
                Console.WriteLine(c[i]+" "+a[g[0]]);
            }
        }
    }
}

Measured memory_bytes: 9136
N = int(input())

XYH = []
for _ in range(N):
    x, y, h = map(int, input().split())
    XYH.append((x, y, h))
XYH.sort(key=lambda x: -x[2])

for Cx in range(0, 101):
    for Cy in range(0, 101):
        flg = True

        if XYH[0][2] == 0:
            Ch = 1
        else:
            Ch = XYH[0][2]+abs(XYH[0][0]-Cx)+abs(XYH[0][1]-Cy)

        for x, y, h in XYH:
            if h != max(Ch - abs(x-Cx) - abs(y-Cy), 0):
                flg = False

        if flg:
            print(Cx, Cy, Ch)
            exit()


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <stdio.h>
using namespace std;

int main()
{
    string s;
    
    char c;
    int num;
    getline(cin,s);
    int Count[26]={};
    while(s.length()!=0){
        for (int i = 0; i<s.size(); i++){
            if(('a' <= s[i])and(  s[i] <= 'z')){
                c=int(s[i])-32;
                s[i]=char(c);
            }
            if (('A' <= s[i])and(  s[i] <= 'Z'))
            {
                num=int(s[i])-'A';
                ++Count[num];
            }
        }
        getline(cin,s);
    }
    for(int i = 0; i < 26; i++){
        c = 'a' + i; 
        cout << c << " : " << Count[i]<< "\n";
    }
    return 0;
}


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

main()
{
    ll x;
    cin>>x;
    for(ll i=-120;i<=120;i++){
        for(ll j=-120;j<120;j++)
            if(i*i*i*i*i-j*j*j*j*j==x){
                cout<<i<<" "<<j;
                return 0;
            }
    }
    return 0;
}


Measured memory_bytes: 3608
using System;
class Program
{
	static void Main(string[] args)
	{
		// 整数の入力
      int a = int.Parse(Console.ReadLine());
      
      var amari = a % 2;
      var ans = 0;
      if(amari == 1){
        ans = a / 2 + 1;
      }
      else{
        ans = a/ 2;
      }
      Console.WriteLine(ans);
      
	}
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
typedef int64_t int64;
typedef uint32_t uint;
typedef uint64_t uint64;

uint countPrime2(uint rhs){
    if(rhs==0){ return 0; }
    uint sum=0;
    while(!(rhs&1)){
        ++sum;
        rhs >>= 1;
    }
    return sum;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    uint64 sum=0ull;
    uint N; cin >> N;
    for(uint i=0; i<N; ++i){
        uint a; cin >> a;
        sum += countPrime2(a);
    }
    cout << sum << endl;
    
    return 0;
}

Measured memory_bytes: 256
from heapq import heapify, heappop, heappush, heappushpop
INF = 10**6 + 1

class PriorityQueue:
    def __init__(self, heap):
        self.heap = heap
        heapify(self.heap)

    def push(self, item):
        heappush(self.heap, item)

    def pop(self):
        return heappop(self.heap)

    def pushpop(self, item):
        return heappushpop(self.heap, item)

    def __call__(self):
        return self.heap

    def __len__(self):
        return len(self.heap)


def dijkstra(adj: list, s: int):
    Color = [0] * N
    D = [INF] * N
    P = [None] * N

    D[s] = 0
    P[s] = None
    PQ = PriorityQueue([(0, s)])

    while PQ:
        min_cost, u = PQ.pop()

        Color[u] = 2

        if D[u] < min_cost:
            continue

        for idx_adj_u, w_adj_u in adj[u]:
            if Color[idx_adj_u] != 2:
                if D[u] + w_adj_u < D[idx_adj_u]:
                    D[idx_adj_u] = D[u] + w_adj_u
                    P[idx_adj_u] = u
                    PQ.push((D[idx_adj_u], idx_adj_u))
                    Color[idx_adj_u] = 1
    return D, P

N = int(input())
adj = [[] for _ in range(N)]
for _ in range(N):
    tmp = list(map(int, input().split()))
    if tmp[1] != 0:
        node = tmp[0]
        for i in range(2, 2 + tmp[1] * 2, 2):
            adj[node].append((tmp[i], tmp[i + 1]))

D, P = dijkstra(adj, 0)

for i in range(N):
    print(i, D[i])



Measured memory_bytes: 69016
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

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

	final long MOD = (long) (1e9 + 7);

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		int[][] x = new int[N][];
		int[][] y = new int[N][];
		for (int i = 0; i < N; ++i) {
			A[i] = sc.nextInt();
			x[i] = new int[A[i]];
			y[i] = new int[A[i]];
			for (int j = 0; j < A[i]; ++j) {
				x[i][j] = sc.nextInt();
				y[i][j] = sc.nextInt();
				--x[i][j];
			}
		}
		int ans = 0;
		out: for (int s = 0; s < 1 << N; ++s) {
			for (int shift = 0; shift < N; ++shift) {
				if ((s >> shift) % 2 != 1)
					continue;
				for (int j = 0; j < A[shift]; ++j) {
					if ((s >> x[shift][j]) % 2 != y[shift][j])
						continue out;
				}
			}
			ans = Math.max(ans, Integer.bitCount(s));
		}
		System.out.println(ans);
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


Measured memory_bytes: 23764
def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1


import sys
input = sys.stdin.readline().rstrip
X = int(input())

if X%2 == 0:
    if X == 2:
        print(2)
    else:
        X += 1
        for num in range(X, 10**6, 2):
            if is_prime(num):
                print(num)
                break
else:
    for num in range(X, 10**6, 2):
        if is_prime(num):
            print(num)
            break

Measured memory_bytes: 38384
#include<cstdio>

using namespace std;

int main(){
    char c1[4];
    char c2[4];
    scanf("%s", c1);
    scanf("%s", c2);
    bool flag = true; 
    for(int i = 0; i < 3; i++){
        if (c1[i] != c2[2-i]) {
            flag = false;
            break;
        }
    }
    if (flag) puts("YES");
    else puts("NO");
}


Measured memory_bytes: 256
#pragma comment (linker, "/STACK:526000000")
#define  _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()
unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x^(x << 11));
    x = y; y = z; z = w;
    return (w = (w^(w >> 19))^(t^(t >> 8)));
}
void solve() {
    int h, a;
    cin >> h >> a;
    cout << (h + a - 1) / a << endl;
}
int main() {
    solve();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb emplace_back
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<ii> vii;
 
const int MX = 200005;
string s;
int mem[MX][3];

int dp (int i, int f) {
	if (i == s.size()) return 0;
	int &res = mem[i][f];
	if (res != -1) return res;
	res = -1e9;
	if (f != 1 || s[i] != s[i-1]) res = dp(i+1, 1) + 1;
	if (i + 1 < s.size() && (f != 2 || s[i] != s[i-2] || s[i+1] != s[i-1])) res = max(res, dp(i+2, 2) + 1);
	return res;
}

int main () {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	cin >> s;
	memset(mem, -1, sizeof(mem));
	cout << max(dp(1, 1), dp(2, 2)) + 1 << endl;

	return 0;
}

Measured memory_bytes: 14996
import std.stdio, std.string, std.conv, std.range, std.array, std.algorithm;
import std.uni, std.math, std.container, std.typecons, std.typetuple;
import core.bitop, std.datetime;

immutable int mod = 10^^9 + 7;

void main()
{
    int a, b;
    readVars(a, b);

    if (a + b < 10) {
        writeln(a + b);
    }
    else {
        writeln("error");
    }
}

void readVars(T...)(auto ref T args)
{
    auto line = readln.split;
    foreach(ref arg ; args){
        arg = line.front.to!(typeof(arg));
        line.popFront;
    }
    if(!line.empty){
        writeln(line);
        throw new Exception("args num < input num");
    }
}

Measured memory_bytes: 256
package main

import (
	"fmt"
	"strings"
)

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

	m := make([]int, n)
	b := make([]int, 0)
	for i := n; i > 0; i-- {
		sum := 0
		for j := i; j <= n; j += i {
			if m[j-1] == 1 {
				sum++
			}
		}
		if sum%2 != a[i-1] {
			m[i-1] = 1
			b = append(b, i)
		}
	}

	fmt.Println(len(b))
	if len(b) > 0 {
		fmt.Println(strings.Trim(fmt.Sprint(b), "[]"))
	}
}


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

int main() {
  int n;
  cin >> n;
  int sum = 0;
  vector<int> score(n);
  rep(i,n) cin >> score[i], sum += score[i];
  if (sum % 10 != 0) cout << sum << endl;
  else {
    sort(score.begin(), score.end());
    rep(i,n) {
      if (score[i] % 10 != 0) {
        cout << sum - score[i] << endl;
        return 0;
      }
    }
    cout << 0 << endl;
  }
  return 0;
}

Measured memory_bytes: 3596
#include<stdio.h>
int main(void)
{
    int a, b, c, x;
    scanf("%d %d %d", &a, &b, &c);
    if(a>b){
        x=a; 
        a=b;
        b=x;
    }
    if(a>c){
        x=a;
        a=c;
        c=x;
    }
    if(b>c){
        x=b;
        b=c;
        c=x;
    }
     
    printf("%d %d %d\n", a, b, c);
     
    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n);(i)>0;(i)--)
#define INF (1ll<<60)
typedef long long lint;
const lint MOD =1000000007;



int main(){
       lint N;
       lint ans=1;
       lint k=0;
       cin >>N; lint M[N];
       vector <lint> x;
       x.resize(N+10);
       rep(i,N){cin >> M[i];
        x[M[i]]++;
          if(i!=0&&M[i]==0){
          cout<<0;
          return 0;
      }
       }
      if(M[0]!=0){
          cout<<0;
          return 0;
      }
      lint g;
        repm(i,N){
            if(x[i]!=0){g=i;
            break;
        }
        }
        
    repp(i,1,g+1){
        if(i==1)continue;
        rep(j,x[i]){
             ans*=x[i-1];
        ans%=998244353;
        }
    }
  cout<<ans;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define F(a,b,c) for(int a=b;a<c;++a) 
int main(){
	int n,an=0;cin>>n;char a,b='1';
	F(u,0,n){cin>>a;if(a!=b)an++;b=a;}
	cout<<an;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define int int64_t
#define pcnt __builtin_popcount
#define pb push_back
#define ALL(x) (x).begin(),(x).end()
#define vec vector<int>
#define mat vector<vector<int>> //mat データ名(縦,vec(横));
#define F first
#define S second
int INF = 1000000000000000001; //10^18+1
int MOD = 1000000007; //10^9+7
//cout << fixed << setprecision(15); (小数点以下表示)

signed main () {
  int N,A,ans=0,mic=0,mi=INF;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> A;
    if(A<0)mic++;
    mi=min(mi,abs(A));
    ans+=abs(A);
  }
  if(mic%2==1)ans-=mi*2;
  cout << ans << endl;
}

Measured memory_bytes: 256
import std.stdio;
import std.string;
import std.algorithm;
import std.range;
import std.array;
import std.conv;


void main()
{
    while(1){
        auto N = readln().chomp().to!uint;

        if(N == 0)
            break;

        auto seq = readln().chomp().split();
        uint state;
        uint cnt;
        uint lastState = 0;
        foreach(e; seq){
            bool bUpdate;

            if(((state & 1) == 0 || (state & 2) == 0) && (e == "lu" || e == "ru")){
                bUpdate = true;
                state += e == "lu" ? 1 : 2;
            }
            else if((state & 1) == 1 && e == "ld"){
                bUpdate = true;
                state -= 1;
            }else if((state & 2) == 2 && e == "rd"){
                bUpdate = true;
                state -= 2;
            }

            if(bUpdate && (state == 3 || state == 0) && lastState != state){
                lastState = state;
                ++cnt;
            }
        }

        writeln(cnt);
    }
}

Measured memory_bytes: 1496
import java.util.Scanner;

class Main {

	public static void main(String args[]) {
		 Scanner sc = new Scanner(System.in);
	        int n = sc.nextInt();
	        int[] as = new int[n];
	        int answer = 0;
	        for (int i = 0; i < n; i++) {
	            as[i] = sc.nextInt();
	            if(i==0)
	            	answer = as[0];
	            else
	            	answer += Math.max(0, as[i] - as[i-1]);
	        }
	        
	        System.out.print(answer);
	}
}

Measured memory_bytes: 23764
import java.util.Scanner;

public class Main {

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] H = new int[N];
        for (int i = 0; i < N; i++) {
            H[i] = sc.nextInt();
        }
        for (int i = N - 1; i > 0; i--) {
            if (H[i - 1] > H[i]) {
                H[i - 1]--;
                if (H[i - 1] > H[i]) {
                    System.out.print("No");
                    return;
                }
            }
        }
        System.out.print("Yes");
    }

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



Measured memory_bytes: 50548
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <cstring>

int main(void)
{
  int n;
  std::cin >> n;
  std::vector<int> vs;
  std::vector<int> cs;
  for (int i = 0; i < n; i++) {
    int v;
    std::cin >> v;
    vs.push_back(v);
  }
  for (int i = 0; i < n; i++) {
    int c;
    std::cin >> c;
    cs.push_back(c);
  }
  int sum = 0;
  for (int i = 0; i < n; i++) {
    int dis = vs.at(i) - cs.at(i);
    if (dis > 0) sum += dis;
  }
  std::cout << sum << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
signed main(){
  string a;
  int b=0;
  cin>>a;
  if(a[0]=='2') b++;
  if(a[1]=='2') b++;
  if(a[2]=='2') b++;
  if(a[3]=='2') b++;
  cout<<b<<"\n";
}

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

using namespace std;

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

	vector<int> A(N);
	vector<int> rev(N);

	for(int i =0; i < N; i++){
		cin >> A[i];
	}


	for (int i = 0; i < N; i++){
		rev[A[i] -1] = i + 1;
	}

	for(int i = 0; i < N; i++){
		cout << rev[i] << " ";
	}

	cout << endl;
	

}

Measured memory_bytes: 1664
n = int(input())
f = 10**12

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

for i in make_divisors(n):
    z = i + n//i - 2
    # print('i:',i,' make_divisors(n):', make_divisors(n),' z:',z,' f:',f)
    if z < f:
        f = z

print(f)


Measured memory_bytes: 3280
// #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<complex>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3100000;
const int UF_SIZE = 3100000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
	int UF[UF_SIZE];
	void init_UF(int n){
		for(int i=0;i<n;i++)UF[i]=-1;
	}
	int FIND(int a){
		if(UF[a]<0)return a;
		return UF[a]=FIND(UF[a]);
	}
	void UNION(int a,int b){
		a=FIND(a);b=FIND(b);if(a==b)return;
		if(UF[a]>UF[b])swap(a,b);
		UF[a]+=UF[b];UF[b]=a;
	}
}
// ここから編集しろ
char in[210];
int main(){
	scanf("%s",in);
	int n=strlen(in);
	int ret=0;
	for(int i=0;i<n/2;i++){
		if(in[i]!=in[n-1-i])ret++;
	}
	printf("%d\n",ret);
}

Measured memory_bytes: 128
use proconio::{input, fastout};

#[fastout]
fn main() {
    input!{
        n: usize
    }
    //n c 2 == n * (n-1) / 2
    // 10 ^ (n - 2)

    let ans = ModInt::from_usize(10).pow(n) + ModInt::from_usize(8).pow(n) - ModInt::from_usize(9).pow(n) * ModInt::from_usize(2);
    println!("{}", ans.val());
}

use std::ops::*;

const MOD: usize = 1000000007;
#[derive(Copy, Clone)]
struct ModInt {
    n: usize,
}

impl ModInt {
    fn val(self)->usize {
        self.n
    }
    fn from_usize(n: usize) -> ModInt {
        ModInt { n: n % MOD }
    }
    fn pow(self, power: usize) -> ModInt {
        if power == 0 {
            return ModInt::from_usize(1);
        }
        if power % 2 == 0 {
            let t = self.pow(power/2);
            return t * t;
        }
        self * self.pow(power-1)
    }
    fn inv(self) -> ModInt {
        self.pow(MOD - 2)
    }
}

impl Add for ModInt {
    type Output = ModInt;

    fn add(self, rhs: ModInt) -> ModInt {
        let mut tmp = self;
        tmp.n += rhs.n;
        if tmp.n >= MOD {
            tmp.n -= MOD;
        }
        tmp
    }
}

impl AddAssign for ModInt {
    fn add_assign(&mut self, rhs: ModInt) {
        *self = *self + rhs;
    }
}

impl Sub for ModInt {
    type Output = ModInt;

    fn sub(self, rhs: ModInt) -> ModInt {
        let mut tmp = self;
        if tmp.n < rhs.n {
            tmp.n += MOD;
        }
        tmp.n -= rhs.n;
        tmp
    }
}

impl SubAssign for ModInt {
    fn sub_assign(&mut self, rhs: ModInt) {
        *self = *self - rhs;
    }
}

impl Mul for ModInt {
    type Output = ModInt;

    fn mul(self, rhs: ModInt) -> ModInt {
        let mut tmp = self;
        tmp.n *= rhs.n;
        tmp.n %= MOD;
        tmp
    }
}

impl MulAssign for ModInt {
    fn mul_assign(&mut self, rhs: ModInt) {
        *self = *self * rhs;
    }
}

impl Div for ModInt {
    type Output = ModInt;

    fn div(self, rhs: ModInt) -> ModInt {
        let mut tmp = self;
        tmp.n *= rhs.inv().n;
        tmp.n %= MOD;
        tmp
    }
}

impl DivAssign for ModInt {
    fn div_assign(&mut self, rhs: ModInt) {
        *self = *self / rhs;
    }
}

Measured memory_bytes: 2184
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int r = Integer.parseInt(sc.next());
        //System.out.println((int) (((Math.PI * Math.pow(r, 2)) / Math.PI) * Math.pow(1, 2)));
        System.out.println((int) Math.pow(r, 2));
        sc.close();
    }
}


Measured memory_bytes: 35656
#include <stdio.h>
int main(){
  int n,r,p,c,i,j,k,l,nh[51],s[51];
  while(1){
    scanf("%d%d",&n,&r);
    if(n==0&&r==0) break;

    for(i=n;i>=1;i--){
      nh[n-i+1]=i;
    }
 
    for(i=0;i<r;i++){
      scanf("%d%d",&p,&c);
      for(j=p;j<=p+c-1;j++){
        s[j]=nh[j];
      }
	l=0;
      for(j=1;j<=c;j++){
	for(k=p-1+l;k>=1+l;k--){
          nh[k+1]=nh[k];
	}
        l++;
      }
    
      for(j=p;j<=p+c-1;j++){
        nh[j-p+1]=s[j];
      }
    }

    printf("%d\n",nh[1]);
  }
    return 0;
}

Measured memory_bytes: 600
// 解説前
#include <algorithm>
#include <iostream>
#include <set>
#include <vector>

int main() {
  size_t N = 0;
  std::cin >> N;

  std::multiset<uint64_t> s;
  for (size_t i = 0; i < size_t(1) << N; ++i) {
    uint64_t S = 0;
    std::cin >> S;
    s.insert(S);
  }

  std::vector<uint64_t> healths;
  healths.reserve(1 << N);
  healths.push_back(*--s.end());
  s.erase(--s.end());
  for (size_t i = 0; i < N; ++i) {
    const size_t size = healths.size();
    healths.resize(size * 2);
    for (size_t j = 0; j < size; ++j) {
      auto iter = s.lower_bound(healths[j]);
      if (iter == s.begin()) {
        std::cout << "No";
        return 0;
      }
      healths[size + j] = *--iter;
      s.erase(iter);
    }
  }

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


Measured memory_bytes: 14592
//----------------------------------------------------------------------
#include <bits/stdc++.h>
#include <numeric>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
//----------------------------------------------------------------------

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

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

    if(n >= m ) {
        cout << 0;
        return 0;
    }

    sort(x.begin(), x.end());

    vector<int> l;

    rep(i,m-1) {
        int tmp = x[i+1] - x[i];
        l.push_back(tmp);
    }

    sort(l.begin(), l.end());
    ll ans = accumulate(l.begin(), l.begin()+l.size()-(n-1),0);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1276
#include <bits/stdc++.h>
#define REP(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v,T) sort(v.begin(), v.end(),greater<T>());
#define CINARY(a, n) \
    REP(i, n) { cin >> a[i]; }
#define COUTARY(a, n) \
    REP(i, n) { cout << a[i] << endl; }
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    CINARY(a, n)
    VSORTR(a,int)
    // COUTARY(a,n)
    int ap = 0, bp = 0;
    REP(i, n)
    {
        if (i % 2 == 0)
        {
            ap += a[i];
        }
        else
        {
            bp += a[i];
        }
    }
    cout << ap - bp << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;

namespace CP
{
    class Atria
    {
        static bool[] seen;
        static int n;
        static List<MyClass> ls;
        static List<double> ans;
        static void Main(string[] args)
        {
            
            n = int.Parse(ReadLine());
            ls = new List<MyClass>();
            for (int i = 0; i < n; i++)
            {
                int[] s = ReadLine().Split(' ').Select(int.Parse).ToArray();
                ls.Add(new MyClass(s[0], s[1]));
            }
            ans = new List<double>();

            for (int i = 0; i < n; i++)
            {
                seen = new bool[n];
                dfs(i, 0);
            }
            WriteLine(ans.Average());
        }
        static void dfs(int v,double cnt)
        {
            seen[v] = true;
            if (seen.Count(x => x == true) == n)
            {
                ans.Add(cnt);
                seen[v] = false;
                return;
            }

            for (int i = 0; i < n; i++)
            {
                if (seen[i] == false)
                {
                    var distance = Sqrt(
                        Pow(ls[v].x-ls[i].x,2) + Pow(ls[v].y - ls[i].y, 2)
                        );
                    dfs(i,cnt+distance);
                    seen[i] = false;
                }
            }
        }
    }

    struct MyClass
    {
        public MyClass(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        public int x { get; set; }
        public int y { get; set; }
    }
}


Measured memory_bytes: 16352
#include<bits/stdc++.h>
#define pb           push_back
#define pii          pair<int,int>
#define vi           vector<int>
#define vpii         vector<pair<int,int>>
#define gph          map<int, vector<int>>
#define mp           make_pair
#define FOR(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD0(i, n) for (int i = (int)n; i >= 0; i--)
#define FORD1(i, n) for (int i = (int)n; i >= 1; i--)
#define FORS(i, n) for(; i < (int)(n); i++)
#define debug(X) { cout << #X << " = " << (X) << endl; }
#define printArr(A,n) { cout << #A << " = "; FOR(i,n) cout << A[i] << ' '; cout << endl; }
using namespace std;
#define int long long int
signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    
    int h, w;cin >> h >> w;
    vector<string> in(h);
    FOR(i, h){
        cin >> in[i];
    }
    int prev = 0;
    int ans = 0;
    vector<vi> mv(400, vi(400));
    vector<vi> cost(400, vi(400));
    FOR(col, w-1){
        int minCost= 1e9;
        // doing rom col and col+1
        FOR(i, h+1){
           //col is i E [0, h] shifts lower than col+1 
           int one = h;
           int other = h -i;
           int cs= 0;
           int cs2 = 0;
           while(other >= 0 && one >= 0){
             mv[one][other] = cs; 
             mv[other][one] = cs2;
             one--, other--;
             if(other < 0)break;
             if(in[h - one - 1][col] == in[h - other - 1][col+1])cs++;
             if(in[h - one - 1][col + 1] == in[h - other - 1][col])cs2++;
           }
        }
/*        FOR(i, h+1){
            FOR(j, h+1){
                cout << mv[i][j] << " ";
            }
            cout << endl;
        }*/
        //cout << endl;
        FOR(i, h+1){
            FOR(j, h+1){
                // from i E [0, h] shifts down
                // from i E [0, h] shifts down
                if(i == 0 && j == 0)continue;
                else if(i == 0){
                    cost[i][j] = cost[i][j-1] + mv[i][j-1]; 
                }else if(j == 0){
                    cost[i][j] = cost[i-1][j] + mv[i-1][j]; 
                }else{
                    cost[i][j] = cost[i-1][j] + mv[i-1][j]; 
                    cost[i][j] = min(cost[i][j], cost[i][j-1] + mv[i][j-1]); 
                }
            }
        }
        FOR(i, h+1){
            minCost = min(minCost, cost[i][h]);
            minCost = min(minCost, cost[h][i]);
        }
        ans += minCost;
    }
    cout << ans;

}




Measured memory_bytes: 2944
// Counting Roads
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int N, M;
    cin >> N >> M;
    int roads[N] = {0};
    for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        roads[a-1]++;
        roads[b-1]++;
    }
    for (int i = 0; i < N; ++i) cout << roads[i] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printInt(a) printf("%d\n", a)
#define printll(a) printf("%lld\n", a)
#define printdbl(a) printf("%lf\n", a)
#define printYes() printf("Yes\n")
#define printNo() printf("No\n")
#define scanll(a) scanf("%lld", &a)
#define scanInt(a) scanf("%d", &a)
#define scan2Int(a, b) scanf("%d %d", &a, &b)
#define scan3Int(a, b, c) scanf("%d %d %d", &a, &b, &c)
#define scan4Int(a, b, c, d) scanf("%d %d %d %d", &a, &b, &c, &d)
typedef long long ll;
const int INF = 1001001001;
using namespace std;
void swap(int *a, int *b) {
    int tmp = *a;
    *a = *b;
    *b = tmp;
    return;
}
int gdc(int a, int b) {
    int r;
    if (a < b)
        swap(&a, &b);
    r = a % b;
    while (r != 0) {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

int main() {
    int n;
    scanInt(n);
    double odds = n % 2 ? (n - n % 2) / 2 + 1 : (n - n % 2) / 2;
    double ans = odds / (double) n;
    printdbl(ans);
    return 0;
}

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

int main()
{
    int A, B, ans;
    cin >> A >> B;
    ans = A * B;
    
    if (A > 9 || B > 9)
    {
        cout << "-1" << endl;
        return 0;
    }
    else
    {
        cout << ans;
        return 0;
    }
    return 0;
}


Measured memory_bytes: 256
<>=~$";@a=glob`dd`;$a[$_-1]%2&&($%=$_%$'?$_:$_<$`*$'&&$_-1+$')&&++$a[$%]+push@_,$_-1,$%for 1..$`*$';print@_/2,$/,map{$_/$'+1|0,$",$_%$'+1,--$|?$":$/}@_

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

using namespace std;
int main()
{
    int n,m,c=0,j=0;
    vector<int> v;
    cin>>n;
int     mi=n+1;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
        v.push_back(a[i]);
    }
    for(int i=0;i<n;i++){
        mi=min(v[i],mi);
        if(v[i]>mi){
            c++;
        }
    }
    cout<<n-c<<endl;
    return 0;
}


Measured memory_bytes: 1912
#include<iostream>

using namespace std;

int main() {
	int n,ans=0;
	int d[51];
	cin >> n;
	for (int i = 0;i < n;i++) cin >> d[i];
	for (int i = 0;i < n;i++) {
		for (int j = i + 1;j < n;j++) {
			ans += d[i] * d[j];
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.12f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e18;
const ll MAX_N = 1010101;

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

// mod.m での a の逆元 a^ { -1 } を計算する
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x /gcd(x, y) * y );
}

//union-find木について
ll par[101010];
ll rank2[101010];

void init(ll n) {
	rep(i, n) {
		par[i] = i;
		rank2[i] = 0;
	}
}

ll find(ll x) {
	if (par[x] == x) {
		return x;
	}
	else {
		return par[x] = find(par[x]);
	}
}

void unite(ll x, ll y) {
	x = find(x);
	y = find(y);
	if (x == y)return;
	if (rank2[x] < rank2[y]) {
		par[x] = y;
	}
	else {
		par[y] = x;
		if (rank2[x] == rank2[y]) {
			rank2[x]++;
		}
	}
}


ll dx[8] = { 1,-1,0,0,1,1,-1,-1 };
ll dy[8] = { 0,0,1,-1,1,-1,1,-1 };
char c[2010][2010];

//long longしか使わない
//素数は1より大きい
//lower_boundは指定したkey以上の要素の一番左のイテレータをかえす
//upper_boundは指定したkeyより大きい要素の一番左のイテレータをかえす
int main() {
	ll n;
	cin >> n;
	vector<ll>a(n+1), b(n);
	ll ans = 0;
	rep(i, n+1) {
		cin >> a[i];
	}
	ll target = 0;
	rep(i, n) {
		cin >> b[i];
		ans += min(a[i], b[i]);
		b[i] -= min(a[i], b[i]);
		ans += min(a[i + 1], b[i]);
		a[i + 1] -= min(a[i + 1], b[i]);
	}
	cout << ans << endl;
	return 0;
}


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

int main(){
  string s1, s2;
  cin >> s1 >> s2;
  if ( s1[0] == s2[2] && s1[1] == s2[1] && s1[2] == s2[0] )
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n) ; i++)
#define rrep(i,n) for(int i = n-1; i >= 0 ; i--)
typedef long long ll;
constexpr auto INFI = 2147483647;
const ll INFL = 9223372036854775807;

int main(){
    string s;
    cin >> s;
    int s_length = s.size();
    int ans = 0;
    vector<int> count(2020, 0);
    reverse(s.begin(), s.end());
    int x = 1;
    int modSum = 0;
    rep(i, s_length) {
        count[modSum]++;
        modSum = (modSum + (s[i] - '0') * x) % 2019;
        ans += count[modSum];
        x = (x*10) % 2019;
    }

    cout << ans << endl;

    return 0;
}

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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

    string s, t;
    cin >> s >> t;
    int len = s.size();
    string x;
    x = t.substr(0, len);
    if(s == x) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3632
/*
        _            _                  _            _       _     _         _   _          _          _             _        
       / /\         / /\               / /\         / /\    / /\  /\ \      /\_\/\_\ _     /\ \       /\ \     _    /\ \      
      / /  \       / /  \             / /  \       / / /   / / /  \ \ \    / / / / //\_\   \ \ \     /  \ \   /\_\ /  \ \     
     / / /\ \__   / / /\ \           / / /\ \__   / /_/   / / /   /\ \_\  /\ \/ \ \/ / /   /\ \_\   / /\ \ \_/ / // /\ \_\    
    / / /\ \___\ / / /\ \ \         / / /\ \___\ / /\ \__/ / /   / /\/_/ /  \____\__/ /   / /\/_/  / / /\ \___/ // / /\/_/    
    \ \ \ \/___// / /  \ \ \        \ \ \ \/___// /\ \___\/ /   / / /   / /\/________/   / / /    / / /  \/____// / / ______  
     \ \ \     / / /___/ /\ \        \ \ \     / / /\/___/ /   / / /   / / /\/_// / /   / / /    / / /    / / // / / /\_____\ 
 _    \ \ \   / / /_____/ /\ \   _    \ \ \   / / /   / / /   / / /   / / /    / / /   / / /    / / /    / / // / /  \/____ / 
/_/\__/ / /  / /_________/\ \ \ /_/\__/ / /  / / /   / / /___/ / /__ / / /    / / /___/ / /__  / / /    / / // / /_____/ / /  
\ \/___/ /  / / /_       __\ \_\\ \/___/ /  / / /   / / //\__\/_/___\\/_/    / / //\__\/_/___\/ / /    / / // / /______\/ /   
 \_____\/   \_\___\     /____/_/ \_____\/   \/_/    \/_/ \/_________/        \/_/ \/_________/\/_/     \/_/ \/___________/    
                                                                                                                              
*/
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for(int i = 0;i < (n);++i)

#define endl '\n'
#define pb emplace_back
#define mkp make_pair
#define p_q priority_queue
#define INF 2000000000
#define PI 3.1415926
#define coutdb cout << fixed << setprecision(10)

const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long

template <typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}

int r[90];

void ryuka(){
  r[0] = 2;
  r[1] = 1;
  for(int i = 2; i <= 89; i++){
    r[i] = r[i-2] + r[i-1];
  }
}

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

  int n; cin >> n;
  ryuka();
  cout << r[n] << endl;

  return 0;
}

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

long long int f(int a){
	return (long long int)a*a;
}

int main(){
	int d , od , num;
	long long int s=0;
	while(cin>>d){
		num=600/d;
		od=d;
		d=0;
		for(int i=0 ; i<num ; i++){
			s+=od*f(d);
			d+=od;
		}
		cout << s << endl;
		s=0;
	}
	return 0;
}

Measured memory_bytes: 1156
using System;
using System.Linq;
using static System.Console;
using static MyUtil;

class MyUtil
{
    public static int[] ReadIntArray()
    {
        return ReadLine().Split().Select(x => int.Parse(x)).ToArray();
    }
}

class Program
{
    public static void Main()
    {
        int n = int.Parse(ReadLine());
        var l = ReadIntArray();
        Array.Sort(l);
        if (l.Sum() > 2*l[n-1]){ WriteLine("Yes"); }
        else                 { WriteLine("No"); }
    }
}


Measured memory_bytes: 13652
#include<iostream>

using namespace std;
long long f[60][2],a[60];
int main()
{
    int n,p,i,j;
    cin>>n>>p;
    for (i=1;i<=n;i++)
        cin>>a[i];
    f[1][0]=1;
    if (a[1]%2) f[1][1]=1;
    else f[1][0]=2;
    for (i=2;i<=n;i++)
    {
        if (a[i]%2)
        {
            f[i][1]=f[i-1][0]+f[i-1][1];
            f[i][0]=f[i-1][0]+f[i-1][1];
        }
        else 
        {
            f[i][0]=f[i-1][0]*2;
            f[i][1]=f[i-1][1]*2;
        }
    }
    cout<<f[n][p]<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

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

  repI(i, a, b+1) {
    if (i < a + k || i > b - k) cout << i << endl;
  }

  return 0;
}


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

using namespace std;


int main()
{
    long long r,D;
    vector<long long> x(11);
	cin >> r >> D >> x[0];


    for(int i= 1; i <= 10; i++)
    {
        x[i] = r * x[i -1] - D;
        cout << x[i] << endl;
    }

    return 0;

}

Measured memory_bytes: 256
from collections import deque
S = input()
d = deque([S[i] for i in range(len(S))])
Q = int(input())
bol = 0
for i in range(Q):
    a = input().split()
    if a[0] == "1":
        bol = 0 if bol else 1
    elif a[1] == "1":
        if not bol:
            d.appendleft(a[2])
        else:
            d.append(a[2])
    else:
        if not bol:
            d.append(a[2])
        else:
            d.appendleft(a[2])
print("".join(d) if not bol else "".join(reversed(d)))

Measured memory_bytes: 14384
package main

import "fmt"

func main() {
	var (
		a, b int
	)
	fmt.Scan(&a)
	fmt.Scan(&b)
	if a < b {
		fmt.Println("0")
		return
	} else if a < b*2 {
		fmt.Println("0")
		return
	}
	fmt.Println(a - b*2)

}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100010; //check the limits, dummy

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

    int N; cin >> N;
    int X[N], Y[N];
    vector<vi> atX, atY;
    F0R(i, MX) {
        vi blank; atX.pb(blank);
        atY.pb(blank);
    }
    F0R(i, N) {
        cin >> X[i] >> Y[i];
        X[i]--; Y[i]--;
        atX[X[i]].pb(i); atY[Y[i]].pb(i);
    }


    bool* visX = new bool[MX];
    bool* visY = new bool[MX];
    bool found[N];
    F0R(i, MX) {
        visX[i] = false;
        visY[i] = false;
    }
    F0R(i, N) found[i] = false;

    ll ans = N*-1;

    F0R(root, N) {
        if (found[root]) continue;
        set<int> usedX, usedY;

        queue<int> q;
        usedX.insert(X[root]); usedY.insert(Y[root]);
        q.push(root);
        found[root] = true;
        while (!q.empty()) {
            int cur = q.front();
            q.pop();
            vi toVisit;
            if (!visX[X[cur]]) {
                visX[X[cur]] = true;
                F0R(i, sz(atX[X[cur]])) {
                    toVisit.pb(atX[X[cur]][i]);
                }
            }

            if (!visY[Y[cur]]) {
                visY[Y[cur]] = true;
                F0R(i, sz(atY[Y[cur]])) {
                    toVisit.pb(atY[Y[cur]][i]);
                }
            }

            F0R(i, sz(toVisit)) {
                int nxt = toVisit[i];
                if (found[nxt]) continue;
                found[nxt] = true;
                usedX.insert(X[nxt]); usedY.insert(Y[nxt]);
                q.push(nxt);
            }
        }

        ans += (ll) sz(usedX) * (ll) sz(usedY);

    }

    cout << ans << endl;


    return 0;
}

// read the question correctly (ll vs int)
// template by bqi343

Measured memory_bytes: 14628
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 2147483647;
const ll LINF = 9223372036854775807;
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
	double r; cin >> r;
	double pi=3.14159265358;
	cout << setprecision(10) << 2*r*pi << endl;
	return 0;
}


Measured memory_bytes: 3784
#include<iostream>
#include<algorithm>
#include<vector>
#include<math.h>
using namespace std;
#define ll long long int

ll eu(ll a,ll b){
    if(a<b){
        swap(a,b);
    }
    ll r=a%b;
    while(r>0){
        a=b;
        b=r;
        r=a%b;
        //cout<<"r : "<<r<<endl;
    }
    //cout<<"eu_return : "<<b<<endl;
    return b;
}


int main(){
    ll a,b,c,d,gcm,lcm,division_c,division_d,division_lcm;
    cin>>a>>b>>c>>d;

    gcm=eu(c,d);
    lcm=c*d/gcm;

    division_c=b/c; //cout<<division_c<<endl;
    division_d=b/d; //cout<<division_d<<endl;
    division_lcm=b/lcm; //cout<<division_lcm<<endl;

    division_c-=(a-1)/c; //cout<<(a-1)/c<<endl;
    division_d-=(a-1)/d; //cout<<(a-1)/d<<endl;
    division_lcm-=(a-1)/lcm; //cout<<(a-1)/lcm<<endl;

    cout<<(b-a+1)-(division_c+division_d-division_lcm)<<endl;
    return 0;
}

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

int main() {
  
  int H=0, N=0, A[1000000];
  
  cin >> H >> N;
  
  for(int i=0; i<N; i++) {
    
    cin >> A[i];
    
  }
  
  int sum=0;
  
  for(int i=0; i<N; i++) {
  
    
    sum = sum+A[i];
  
  }
  
  if(H-sum <= 0) {
    
    cout << "Yes" << endl;
    
  } else {
    
    cout << "No" << endl;
    
  }
  
  return 0;
  
}

Measured memory_bytes: 2304