akhauriyash/Code-Regression huggingface dataset:
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	static void solve(){//Here is the main function
		ArrayList<String> list = nextCharArray();
		for(int i = 1; i <= 8; i++){
			list.remove(list.size() - 1);
		}
		myout(myconv(list, 0));
	}
	//Method addition frame start



	//Method addition frame end

	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
}


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



int main(void){
	int A,B,C,D;

	cin >> A;

	cin >> B;

	cin >> C;


	D = C - (A - B);

	if (D >= 0){
		cout << D << endl;
	}
	else if (D < 0){
		cout << 0 << endl;
	}

	return 0;
}

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

int main(){
    ll n;
    cin >> n;

    vector<ll> x(n, 0);
    vector<ll> y(n, 0);
    for(ll i = 0; i < n; i++){
        cin >> x[i];
        y[i] = x[i];
    }

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

    for(ll i = 0; i < n; i++){
        if(x[i] <= y[n/2 - 1]){
            cout << y[n/2] << endl;
        }else{
            cout << y[n/2 - 1] << endl;
        }
    }

    return 0;
}

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

int main(){
  int A, B;
  cin >> A >> B;
  int ans = 0;
  for(int i=1; i<=1000; i++){
    int a = i*0.08;
    int b = i*0.1;
    if(a==A&&b==B){ans = i; break;}
  }
  if(ans==0)cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}

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

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize = read();
    let b: usize = read();
    let s = read::<String>().chars().collect::<Vec<char>>();
    let mut ans = true;
    ans &= s[a] == '-';
    for i in 0..a+b+1 {
        if i == a { continue; }
        ans &= s[i].is_digit(10);
    }
    println!("{}", if ans { "Yes" } else { "No" });
}

Measured memory_bytes: 4352
N = int(input())
B = list(map(int,input().split()))

A = []

i=0
while i<N-2:
    if B[i]>B[i+1]:
        A.append(B[i+1])
    else :
        A.append(B[i])
    i+=1

A.append(B[i])
A.append(B[0])


print(sum(A))


Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<cmath>

using namespace std;

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

typedef long long ll;

ll pow_ll(int n)
{
	ll ret = 1;
	REP(i,n)ret *= 2;
	return ret;
}

int main()
{
	int n,p,bis[60];
	bool flag =false;
	cin >> n >> p;
	REP(i,n)
	{
		cin >> bis[i];
		if(bis[i] % 2 == 1)flag = true;
	}
	
	if(!flag)
	{
		if(p == 0)
		{
			cout << pow_ll(n) << endl;
		}
		else
		{
			cout << '0' << endl;
		}
	}
	else
	{
		cout << pow_ll(n-1) << endl;
	}
	
	return 0;
	
}

Measured memory_bytes: 256
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	printyn(a <= c && c <= b);
	
	Please AC;
}


Measured memory_bytes: 888
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
using namespace std;

typedef long long ll;

int n;
int a[52];
int argmin, argmax;
vector<pair<int, int>> ans;

int main() {
	cin >> n;
	argmin = argmax = 0;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		if (a[argmin] > a[i]) argmin = i;
		if (a[argmax] < a[i]) argmax = i;
	}
	if (a[argmax] > 0 && a[argmin] < 0) {
		if (a[argmax] >= -a[argmin]) {
			for (int i = 0; i < n; ++i) {
				ans.push_back({ argmax, i });
				a[i] += a[argmax];
			}
		}
		else {
			for (int i = 0; i < n; ++i) {
				ans.push_back({ argmin, i });
				a[i] += a[argmin];
			}
		}
	}
	
	argmin = argmax = 0;
	for (int i = 0; i < n; ++i) {
		if (a[argmin] > a[i]) argmin = i;
		if (a[argmax] < a[i]) argmax = i;
	}
	if (a[argmin] >= 0) {
		for (int i = 1; i < n; ++i) {
			if (a[i - 1] > a[i]) {
				ans.push_back({ i - 1, i });
				a[i] += a[i - 1];
			}
		}
	}
	else {
		for (int i = n - 2; i >= 0; --i) {
			if (a[i] > a[i + 1]) {
				ans.push_back({ i + 1, i });
				a[i] += a[i + 1];
			}
		}
	}
	cout << ans.size() << endl;
	for (int i = 0; i < (int)ans.size(); ++i) {
		cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y)


def lcm(x,y):
    return x/gcd(x, y)*y


N = int(raw_input())
T = [int(raw_input()) for _ in xrange(N)]
 
ans = 1
 
for i in T:
    ans = lcm(ans, i)
 
print ans


Measured memory_bytes: 2568
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * for (int i = 0; i < N; i++) {}
 * System.out.println();
 * HashMap<Integer, Integer> hm = new HashMap<>();
 * int[] s = new int[M];
 * ArrayDeque<Integer> deq = new ArrayDeque<>();
 *
 */
public class Main implements Runnable { //クラス名はMain2

	public static void main(String[] args) {
		Thread.setDefaultUncaughtExceptionHandler((t, e) -> System.exit(1));
		new Thread(null, new Main(), "", 16 * 1024 * 1024).start(); //16MBスタックを確保して実行
	}

	public void run() {
		FastScannerMain2 sc = new FastScannerMain2(System.in);

		try {
			//String S = sc.nextLine().trim();
			//lomng N = sc.nextInt();
			//int[] a = new int[N];
			long H = sc.nextLong();
			long W = sc.nextLong();
			//ArrayList<Integer> arr = new ArrayList<Integer>();
			long ans = 0;
			if (H != 1 && W != 1) {
				ans = H * W / 2 + H * W % 2;
			} else {
				ans = 1;
			}

			System.out.println(ans);

		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}

//高速なScanner
class FastScannerMain2 {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScannerMain2(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

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

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

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

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

string s;
int b[3];

int main() {
	cin >> s;
	
	inc(i, s.size()) { b[s[i] - 'a']++; }
	
	bool ans = 
		abs(b[0] - b[1]) <= 1 &&
		abs(b[1] - b[2]) <= 1 &&
		abs(b[2] - b[0]) <= 1
	;
	cout << (ans ? "YES" : "NO") << endl;
	
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
const unsigned int MOD = 1000000007;
#define ll long long
#define PI 3.1416
string day[]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
int main() {
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int n,k;
    while(cin>>n>>k){
        cout<<(n*3+k)/2<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    ll n; cin >> n;
    for(ll i=1; i<10; i++){
        if(n <= 111*i){
            cout << 111*i << endl;
            break;
        }
    }
}

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

class P
{
    static void Main()
    {
        int[] NM = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int[][] abs = new int[NM[0]][].Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).ToArray();
        int[][] cds = new int[NM[1]][].Select(_ => Console.ReadLine().Split().Select(int.Parse).ToArray()).ToArray();
        
        for (int i = 0; i < NM[0]; i++)
        {
            int res = 0;
            int[] ab = abs[i];
            int mindist = int.MaxValue;
            for (int j = 0; j < NM[1]; j++)
            {
                int[] cd = cds[j];
                int manhatdist = (Math.Abs(cd[0] - ab[0]) + Math.Abs(cd[1] - ab[1]));
                if (manhatdist < mindist)
                {
                    mindist = manhatdist;
                    res = j + 1;
                }
            }
            Console.WriteLine(res);
        }
    }
}

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

int *A;

int partition(int p,int r){
  int x,y,i,j;
  
  x = A[r];
  i = p - 1;
  for(j = p;j <= r-1;j++){
    if(A[j] <= x){
      i++;
      y = A[i];
      A[i] = A[j];
      A[j] = y;
    }
  }

  A[r] = A[i+1];
  A[i+1] = x;

  return i+1;
}

int main(){
  int n,i,x;
  
  scanf("%d",&n);
  A = malloc(sizeof(int) * n + 1);
  for(i = 1;i <= n;i++)scanf("%d",&A[i]);
  
  x = partition(1,n);
  
  for(i = 1;i <= x-1;i++)printf("%d ",A[i]);
  printf("[%d] ",A[x]);
  for(i = x+1;i <= n-1;i++)printf("%d ",A[i]);
  printf("%d\n",A[n]);
  
  return 0;
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
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 namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    int n;
    cin >> n;
    vector<int> s(n);    
    REP(i, n-1) {
        int x;
        cin >> x;
        s[x-1]++;
    }
    
    REP(i, n) cout << s[i] << endl;
    
    return 0;
}

Measured memory_bytes: 4020
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok()
}

fn main() {
    let x: u64 = read().unwrap();
    let y: u64 = read().unwrap();
    let z: u64 = read().unwrap();

    let xx = x - z;

    println!("{}", xx / (y + z));
}


Measured memory_bytes: 4352
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
struct node{
  int key;
  struct node *next;
  struct node *prev;
};
 
typedef struct node *NodePointer;
NodePointer N;

void init(){
  N = malloc(sizeof(struct node));
  N->next = N;
  N->prev = N;
}

void printList(){
  NodePointer cur = N->next;
  int snl = 1;
  while(cur != N){
    if ( snl == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    snl = 0;
  }
  printf("\n");
}

void deleteFirst(){
  NodePointer t = N->next;
  N->next = t->next;
  t->next->prev = N;
}
 
void deleteLast(){
 
  NodePointer delnode = N->prev;
 
  N->prev = delnode->prev;
  delnode->prev->next = N;
  free(delnode);
}
 
void delete(int skey){
  int judge = 0;
  NodePointer t;
  NodePointer n; 

  for(n = N->next;n != N;n = n->next){
    if(n->key == skey){
      judge = 1;
    }
  }

  if(judge == 1){
    n = N->next;
    while(n != N){
      if(n->key == skey)
	break;
      n=n->next;
    }
    t = n->prev;
    t->next = n->next;
    t->next->prev = t;
    free(n);
  }
}

void insert(int skey){
  NodePointer new;
  static int count = 0;
  new = malloc(sizeof(struct node));
  new->key = skey;
 
  if(count == 0){
  new->next = N;
  N->next = new;
  new->prev = N;
  N->prev = new;
  count++;
  }
 
  else{
    new->next = N->next;
    N->next->prev = new;
    N->next = new;
    new->prev = N;
    count++;
  }
}

int main(){
  int key, n, i;
  char com[12];
   
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s",com);
    if(strcmp(com,"insert") == 0){
      scanf("%d",&key);
      insert(key);
    }
    else if(strcmp(com,"deleteFirst") == 0)
      deleteFirst();
    else if(strcmp(com,"deleteLast") == 0)
      deleteLast();
    else{
      scanf("%d",&key);
      delete(key);
    }
  }
  printList();
  return 0;
}

Measured memory_bytes: 31852
#define ll long long int
#include <bits/stdc++.h>
//#include <fstream>
using namespace std;
 
#define         ff               first
#define         ss               second
#define         mp               make_pair
#define         pb               push_back
#define         pf               push_front
#define         vi               vector<ll>
#define         pii              pair<ll,ll>
#define         qi               queue<ll>
#define         mem(a,b)         memset(a,b,sizeof(a))
#define         print(a)         cout<<a<<'\n'
#define         sorted(arr)      sort(arr.begin(),arr.end())
#define         gcd(a,b)         gcd((a),(b))
#define         lcm(a,b)         ((a)*(b))/gcd((a),(b))
#define         all(v)           v.begin(),v.end()
#define         read(a)          scanf("%d", &a)
#define         f(a,n)           for(ll i=a;i<n;i++)
#define         in2(n,m,arr)     for(ll i=0;i<n;i++){for(ll j=0;j<m;j++)cin>>arr[i][j];}
#define         debug(a)         cerr<<a<<" ";
#define         debug1(a)        cerr<<a<<'\n'
 
/*typedef tree<int, null_type, less<int>, rb_tree_tag , tree_order_statistics_node_update> Set;*/
 
 
const unsigned ll mod = 1e9 + 7 ;
const ll inf = (ll)1e18 + 2;
const ll N = (ll)1e6 + 2;
 
//template<typename... T>
//void write(T&... args)
//{
//    ((cout << args << ' '), ...);
//}
//ll power ( ll x , unsigned ll y)
//{
//    ll res = 1;
//    while (y > 0)
//    {
//        if (y & 1)
//            res = (res * x) % mod ;
//        y = y >> 1;
//        x = (x * x) % mod;
//    }
//    return res % mod ;
//}
//
//struct node{
//    ll x , y , z;
//};
//map<pair<ll, ll>,ll> c;
//vector<set<ll>> tree;
//vector<ll> ar ;
//set<ll> s;
//ll get(ll x)
//{
//    if(x == ar[x])
//        return x;
//    return ar[x] = get(ar[x]);
//}
//void merge(ll a ,ll b)
//{
//    a = get(a);
//    b = get(b);
//    if(a == b)
//    {
//        return ;
//    }
//    ar[b] = ar[a];
//    //ans[a] += ans[b];
//    //return true;
// }
//
//ll sev[275];
//vector<ll> pri;
//void seive()
//{
//    for(ll i = 2 ; i < 275 ; i ++)
//    {
//        if(!sev[i])
//        {
//            for(ll j = i ; j < 275 ; j += i)
//            {
//                if(!sev[j])
//                    sev[j] = i;
//            }
//        }
//        if(sev[i] == i)
//            pri.pb(i);
//    }
//}
void solve()
{
    ll n ;
    cin >> n;
    map< pii ,ll > a , b , c , d;
    for(ll i = 1 ; i <= n ;i ++)
    {
        if(i % 10 == 0)
            continue;
        ll r = 0;
        ll t1 = i % 10 , t2 = i;
        while(t2 / 10 != 0)
        {
            t2 /= 10;
        }
        
            a[{t2 , t1}] ++;
    }
    ll ans = 0 , ans2 = 0;
    for(auto x : a)
    {
        ans += (a[{x.ff.ss, x.ff.ff}] * x.ss);
    }
    print(max(ans , ans2));
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t ;
    t = 1;
    //cin >> t;
    //seive();
    while(t --)
    {
        solve();
    }
    //cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}
 


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        int cnt = 0;
        int jump = 1;
        while(n > 0) {
            n -= jump;
            cnt++;
            jump++;
        }

        System.out.println(cnt);
    }
}

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

ll get(ll n)
{
    return n*n*n;
}

int main()
{

   ll n, k, ans = 0;
   cin >> n >> k;

   if(k%2 == 0)
    {
       ll lim = (n/(k/2));
       ll n1 = (lim + 1)/2;
       ans += get(n1);
   }

   ll lim = n/k;
   ans += get(lim);

   cout << ans;
}


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

int main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    int ans = min(B, D) - max(A,C);

    if(ans < 0) {
        cout << 0;
    }
    else {
        cout << ans;
    }
    
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
  string s;
  cin >> s;
  int now = (s[0] - '0') * 100 + (s[1] - '0') * 10 + (s[2] - '0');
  int ans = abs(now - 753);
  for (int i = 3; i < s.size(); i++) {
    now -= (s[i - 3] - '0') * 100;
    now *= 10;
    now += (s[i] - '0');
    ans = min(ans, abs(now - 753));
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
/*
    Author : Nishant Gupta 2.0
*/
#include<bits/stdc++.h>

#define LL long long int
#define getcx getchar_unlocked
#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define MAX 100005
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL (LL(1e18))
#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl
#define rep(i, a, n) for(i=a;i<n;i++)
#define rev(i, a, n) for(i=a;i>=n;i--)
#define MSV(A,a) memset(A, a, sizeof(A))
#define rep_itr(itr, c) for(itr = (c).begin(); itr != (c).end(); itr++)

using namespace std;

inline void inp( int &n ) { 
	n=0;    int ch=getcx();int sign=1;   
	while( ch < '0' || ch > '9' ){if(ch=='-')sign=-1; ch=getcx();} 
	while(  ch >= '0' && ch <= '9' )    
	n = (n<<3)+(n<<1) + ch-'0', ch=getcx();
	n=n*sign;
}

inline void inp1( LL &n ) { 
	n=0;    LL ch=getcx();LL sign=1;   
	while( ch < '0' || ch > '9' ){if(ch=='-')sign=-1; ch=getcx();} 
	while(  ch >= '0' && ch <= '9' )    
	n = (n<<3)+(n<<1) + ch-'0', ch=getcx();
	n=n*sign;
}

typedef pair<int, int> pi; 

int dijkstra(int s, int d, vector<pi> adj[MAX]) {
	int mincost[MAX], i;
	rep(i, 0, MAX) mincost[i] = INF;
	
	priority_queue<pi, vector<pi>, greater<pi> > pq;
	pq.push(MP(0, s));
	mincost[s] = 0;
	
	while(!pq.empty()) {
		pi _top = pq.top();
		pq.pop();
		int node = _top.Y;
		
		for(i=0;i<adj[node].size();i++) {
			int ch = adj[node][i].X;
			int wt = adj[node][i].Y;
			if(mincost[node] + wt < mincost[ch]) {
				mincost[ch] = mincost[node] + wt;
				pq.push(MP(mincost[ch], ch));
			} 
		}
	}
	
	return mincost[d];
}

int main() {
	int n, m, i, j;
	cin>>n>>m;
	
	string s[n];
	
	for(i=0;i<n;i++) {
		cin>>s[i];
	}
	
	vector<pi> adj[MAX];
	for(i=0;i<n;i++) {
		for(j=0;j<m;j++) {
			int node = i*m + j;
			if(j+1 < m) {
				if(s[i][j] == '.' && s[i][j+1] == '#') adj[node].PB(MP(i*m+j+1, 1));
				else adj[node].PB(MP(i*m+j+1, 0));
			}
			
			if(i+1 < n) {
				if(s[i][j] == '.' && s[i+1][j] == '#') adj[node].PB(MP((i+1)*m+j, 1));
				else adj[node].PB(MP((i+1)*m+j, 0));
			}
		}
	}
	
	cout<<dijkstra(0, (n*m-1), adj) + (s[0][0] == '#')<<endl;
		
    return 0;
}



Measured memory_bytes: 3328
n,k = map(int,input().split())
d = []
a = []
for i in range(k):
    d.append(int(input()))
    b = list(map(int,input().split()))
    for j in range(d[i]):
        a.append(b[j])

t = 0
for i in range(1,n+1):
    if a.count(i) == 0:
        t += 1

print(t)

Measured memory_bytes: 9176
N,M,C=map(int,input().split())
List_B=list(map(int,input().split()))
List_A=[list(map(int,input().split())) for i in range(N)]
count=0

for i in range(N):
    List=[]
    for j in range (M):
        
        List.append(List_A[i][j]*List_B[j])
    if sum(List)+C>0:
        count+=1
print(count)
        
        
  

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;
typedef pair<int, int> pint;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x; cin>>x;
    if(x>=30) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <iomanip>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define ll long long

using namespace std;
using Graph = vector<vector<int> >;


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 dp[3100][3100];


string s, t;

int main() {
  cin >> s >> t;

  for (int i = 1; i <= s.size(); i++) {
    for (int j = 1; j <= t.size(); j++) {
      if (s[i - 1] == t[j - 1]) {
        chmax(dp[i][j], dp[i - 1][j - 1] + 1);
      }
      chmax(dp[i][j], dp[i][j - 1]);
      chmax(dp[i][j], dp[i - 1][j]);
    }
  }

  // cout << dp[s.size()][t.size()] << endl;

  // for (int i = 0; i <= s.size(); i++){
  //   for (int j = 0; j <= t.size(); j++) {
  //     cout << dp[i][j] << " ";
  //   }
  //   cout << endl;
  // }


  string res;
  int i = s.size(), j = t.size();

  while (i > 0 && j > 0) {
    if (dp[i][j] == dp[i - 1][j]){
      i--;
    }

    else if (dp[i][j] == dp[i][j - 1]) {
      j--;
    }

    else if (dp[i][j] == dp[i - 1][j - 1] + 1) {
      // cout << res << endl;
      res = s[i - 1] + res;
      // cout << res << endl;
      i--; j--;
    }
  }

  cout << res << endl;
}


Measured memory_bytes: 37120
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] s = br.readLine().toCharArray();
        long sum = 0;
        for(char i : s) {
            sum += (i - '0');
        }
        System.out.println(sum%9 == 0 ? "Yes" : "No");
        br.close();
    }
}

Measured memory_bytes: 29712
#include<bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin>>n;
    int f[100][10];
    int p[100][11];
    for(int i=0;i<n;i++){
        for(int j=0;j<10;j++){
            cin>>f[i][j];
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<11;j++){
            cin>>p[i][j];
        }
    }
    int ans=-(1<<30);
    for(int mask=1;mask<(1<<10);mask++){
        int sum=0;
        for(int i=0;i<n;i++){
            int c=0;
            for(int j=0;j<10;j++){
                if((mask&(1<<j))&&f[i][j])c++;
            }
            sum+=p[i][c];
        }
        ans=max(ans,sum);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int cmpfunc(const void *a,const void *b)
{
    return (*(int *)a-*(int *)b);
}
int main()
{
    int t,a,b,c,i,sum;
    int num[3];
    //scanf("%d",&t);
    t=1;
    while(t--){
        for(i=0;i<3;i++){
            scanf("%d",&num[i]);
        }
        qsort(num,3,sizeof(int),cmpfunc);
        a=num[0];
        b=num[1];
        c=num[2];
        if(a==b&&b==c){
            printf("0\n");
        }
        else{
             sum=0;
           if(b<c) {while(b<c){
                b++;
                a++;
                sum++;
            }}
            if(a<b){
                while(a<b){
                    a=a+2;
                    sum++;
                }
                if(a>b){
                    while(a>b){
                        b++;
                        c++;
                        sum++;
                    }
                }
            }

           printf("%d\n",sum);
        }
    }return 0;
}


Measured memory_bytes: 128
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG //FOR THE DEBUG! COMMENT OUT THIS WHEN SUBMITTING!
#endif
/* I REALLY HOPE MY WISH REACH YOU , ATCODER'S ONLINE JUDGE */
#define WOULD
#define YOU
#define PLEASE
#define ACCEPT
#define MY
#define SUBMISSION
/* I REALLY HOPE MY WISH REACH YOU , ATCODER'S ONLINE JUDGE */
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
//It is so troublesome that I include bits/stdc++.h !
using namespace std;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const long long INF = 100100100100;
const long long MOD = 998244353;
typedef pair<long long,long long> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a * b / gcd(a, b);
}

int main() {
    int N;cin >> N;
    string S;cin >> S;
    string ans = S;
    int left = 0,right = 0;
    for(int i = 0;i<N;i++){
        if(S.at(i) == ')') right++;
        else left++;
        if(right > left) {
            ans = "(" + ans;
            right--;
        }
    }
    for(int i = 0;i<left-right;i++) ans = ans + ")";

    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

ll gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}
signed main(){
	ll n,m; cin>>n>>m;
	ll a=gcd(n,m);
	cout<<(n*m)/a;
	
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

#define INF 10000000

int main(void) {
	int W;
	static int a[100000];
	static int hinandekiru_l[100000];
	static int hinandekiru_r[100000];
	int hinandekiru;
	int i;
	int answer;
	if(scanf("%d",&W)!=1)return 1;
	for(i=0;i<W;i++) {
		if(scanf("%d",&a[i])!=1)return 1;
	}
	hinandekiru=-1;
	for(i=0;i<W;i++) {
		if(a[i]==0) {
			hinandekiru=INF;
		} else if(a[i]<0 && hinandekiru>-a[i]) {
			hinandekiru=-a[i];
		} else {
			hinandekiru--;
		}
		hinandekiru_l[i]=hinandekiru;
	}
	hinandekiru=-1;	
	for(i=W-1;i>=0;i--) {
		if(a[i]==0) {
			hinandekiru=INF;
		} else if(a[i]<0 && hinandekiru>-a[i]) {
			hinandekiru=-a[i];
		} else {
			hinandekiru--;
		}
		hinandekiru_r[i]=hinandekiru;
	}
	answer=0;
	for(i=0;i<W;i++) {
		if(a[i]>0) {
			int delta=0;
			if(hinandekiru_l[i]>delta)delta=hinandekiru_l[i];
			if(hinandekiru_r[i]>delta)delta=hinandekiru_r[i];
			if(delta>a[i])delta=a[i];
			answer+=delta;
		}
	}
	printf("%d\n",answer);
	return 0;
}

Measured memory_bytes: 1772
n=int(input())
l=[input() for i  in range(n)]
#print(l)
s={}
for i in range(len(l[0])):
    if l[0][i] in s.keys():
        s[l[0][i]]+=1
    else:
        s[l[0][i]]=1
#print(s)
for i in l:
    d={}
    for j in range(len(i)):
        if i[j] in d.keys():
            d[i[j]]+=1
        else:
            d[i[j]]=1
    for k in s.keys():
        for l in d.keys():
            if k==l:
                s[k]=min(s[k],d[l])
                break
        else:
            s[k]=0
s=sorted(s.items())
#print(s)
a=''
for i in s:
    if i[1]!=0:
        a+=i[0]*i[1]
print(a)

Measured memory_bytes: 3064
N = int(input())
lst_A = list(map(int, input().split()))
lst_A.sort(reverse=True)
cur_a = -1
lst_ans = []


for a in lst_A:
    # 同じ長さの棒が二本あったとき
    if cur_a == a:
        lst_ans.append(a)
        cur_a = -1
        if len(lst_ans) == 2:
            break
    # 長さが変わり、その長さの一本目の処理
    else:
        cur_a = a


ans = lst_ans[0] * lst_ans[1] if len(lst_ans) else 0
print(ans)


Measured memory_bytes: 14244
//author Eterna
#define Hello the_cruel_world!
#pragma GCC optimize(2)
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<utility>
#include<cmath>
#include<climits>
#include<deque>
#include<functional>
#include<numeric>
#include<unordered_map>
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)<(y)?(x):(y))
#define ABS(x) ((x) >= 0 ? (x) : (-(x)))
#define pb(x) push_back(x)
#define lowbit(x) (x & -x)
#define FRIN freopen("C:\\Users\\Administrator.MACHENI-KA32LTP\\Desktop\\in.txt", "r", stdin)
#define FROUT freopen("C:\\Users\\Administrator.MACHENI-KA32LTP\\Desktop\\out.txt", "w", stdout)
#define FAST ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define outd(x) printf("%d\n", x)
#define outld(x) printf("%lld\n", x)
#define il inline
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
const int maxn = 1e5;
const int INF = 0x7fffffff;
const int mod = 1e9 + 7;
const double eps = 1e-7;
const double Pi = acos(-1.0);
inline int read_int() {
	char c;
	int ret = 0, sgn = 1;
	do { c = getchar(); } while ((c < '0' || c > '9') && c != '-');
	if (c == '-') sgn = -1; else ret = c - '0';
	while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
	return sgn * ret;
}
inline ll read_ll() {
	char c;
	ll ret = 0, sgn = 1;
	do { c = getchar(); } while ((c < '0' || c > '9') && c != '-');
	if (c == '-') sgn = -1; else ret = c - '0';
	while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
	return sgn * ret;
}
int n, k, arr[maxn + 5], res = 1;
int main()
{
	n = read_int(), k = read_int();
	for (int i = 1; i <= n; ++i)arr[i] = read_int();
	n -= k;
	res += ceil(1.0 * n / (k - 1));
	cout << res << endl;
	//system("pause");
	return 0;
}

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

#define ll long long
#define ld long double
#define mod 1000000007LL
#define INF 1000000011
#define INFLL 1000000000000000011LL
#define endl '\n'
#define vi vector<int>
#define vs vector<string>
#define vll vector<long long>
#define vc vector<char>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pil pair<int, long long>
#define pli pair<long long, int>
#define pcc pair<char, char>
#define pdd pair<double, double>
#define mp make_pair
#define pb(x) push_back(x)
#define fo(i, a, n) for (i = (a); i < (n); i++)
#define foe(i, a, n) for (i = (a); i <= (n); i++)
// clang-format off
#define vin(a) for (ll i = 0; i < sz(a); i++) { cin >> a[i]; } 
#define vout(a) for (auto x : a) { cout << x << " "; }
#define sws                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0)
// clang-format on
#define pd(x) cout << x
#define sd(x) cin >> x
#define nl cout << endl
#define gcd __gcd
#define all(a) (a).begin(), (a).end()
#define foreach(i, a)                                                          \
  for (__typeof((a).begin()) i = (a).begin(); i != (a).end(); ++i)
#define sz(a) (int)((a).size())
// int dw[8][2]={{0,1},{1,0},{0,-1},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};
ll maxval = pow(10LL, 6);
vector<bool> isComposite(maxval + 1);
vll primes;

void genPrime() {
  for (ll j = 4; j <= maxval; j += 2)
    isComposite[j] = true;

  for (ll j = 3; j <= maxval; j += 2) {
    for (ll k = j + j; k <= maxval; k += j) {
      isComposite[k] = true;
    }
  }

  for (ll i = 2; i <= maxval; i++) {
    if (!isComposite[i])
      primes.pb(i);
  }
}

void solve() {
  ll m, n;
  ll i, j;
  cin >> n;

  ll ans = 0;

  for (ll p : primes) {
    ll count = 0;
    while (n > 1 && n % p == 0) {
      n /= p;
      count++;
    }

    ll x = 0;

    while ((((x + 1) * (x + 2)) / 2) <= count)
      x++;

    ans += x;
  }

  if (n != 1)
    ans++;

  cout << ans << endl;
}

int main() {
  sws;
  genPrime();
  solve();
  return 0;
}

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

int main() {
  int A, B, C;
  cin >> A >> B;
  C = A*B;
  if(C%2 == 0){
    cout << "Even" << endl;
  }
  else if(C%2 == 1){
    cout << "Odd" << endl;
  }
}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            配るDP();
        }

        static void 配るDP()
        {
            var N = ReadInt();
            var h = ReadSplitInt();
            var dp = new int[N + 1];

            for (int i = 0; i < N + 1; i++)
            {
                dp[i] = int.MaxValue;
            }

            dp[0] = 0;

            for (int i = 0; i < N-1; i++)
            {
                if (i == N-2)
                {
                    dp[i + 1] = Min(Abs(h[i] - h[i + 1]) + dp[i], dp[i + 1]);
                    continue;
                }

                dp[i + 1] = Min(Abs(h[i] - h[i + 1]) + dp[i], dp[i + 1]);
                dp[i + 2] = Min(Abs(h[i] - h[i + 2]) + dp[i], dp[i + 2]);
            }
            Println(dp[N - 1]);
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int DigitsSum(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static int Gcd(int a, int b) => b == 0 ? a : Gcd(b, a % b);

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());

        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}


Measured memory_bytes: 19680
#include<iostream>
#include<cstdio>
#include<string>
#include <cctype>
#include <cassert>
using namespace std;

typedef int value;

string s;
size_t cur = 0;
value P, Q, R;
int ans = 0;

value Formula();

value Not(){
	assert(s[cur] == '-');
	cur++;
	return 2 - Formula();
}
value And(value a, value b){
	return (a<b) ? a : b;
}
value Or(value a, value b){
	return (a<b) ? b : a;
}
value Formula(){
	value a, b, f;
	char op;
	switch (s[cur]){
	case ('0') :
	case ('1') :
	case ('2') :
			   f = s[cur] - '0';
		cur++;
		break;
	case ('P') :
		f = P;
		cur++;
		break;
	case ('Q') :
		f = Q;
		cur++;
		break;
	case ('R') :
		f = R;
		cur++;
		break;
	case ('-') :
		f = Not();
		break;
	case ('(') :
		cur++;
		a = Formula();
		assert(s[cur] == '*' || s[cur] == '+');
		op = s[cur];
		cur++;
		b = Formula();
		f = (op == '*') ? And(a, b) : Or(a, b);
		assert(s[cur] == ')');
		cur++;
		break;
	default:
		assert(false);
		break;
	}
	return f;
}
int main(){
	cin >> s;
	while (s != "."){
		for (P = 0; P <= 2; P++)
			for (Q = 0; Q <= 2; Q++)
				for (R = 0; R <= 2; R++){
					if (Formula() == 2)ans++;
					cur = 0;
				}
		cout << ans << endl;
		ans = 0;
		cin >> s;
	}
	return 0;
}

Measured memory_bytes: 1192
#include<iostream>
#include<vector>
using namespace std;
int main(){
	int n,a[101010]={},x,cnt=0;
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> x;
		a[i]=x;
		if(a[x]==i)	cnt++;
	}

	cout << cnt << endl;
}

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

int main() {
  int h, w; cin >> h >> w;
  vector<string> g(h);
  vector<bool> ish(h), isw(w);
  rep(i,h) cin >> g.at(i);
  rep(i,h) {
    int cnt = 0;
    rep(j,w) {
      if (g.at(i).at(j) == '.') cnt++;
    }
    if (cnt == w) ish.at(i) = true;
  }
  rep(i,w) {
    int cnt = 0;
    rep(j,h) {
      if (g.at(j).at(i) == '.') cnt++;
    }
    if (cnt == h) isw.at(i) = true;
  }

  rep(i,h) {
    if (ish.at(i)) continue;
    rep(j,w) {
      if (isw.at(j)) continue;
      cout << g.at(i).at(j);
    }
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

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

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

#define SUM(vec) accumulate(all(vec),0LL) // 配列の中身を全部足す
template<typename T>void print(T&& x){cout<<x<<endl;}// 改行付き出力
ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
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; }
int ctoi(char c){return c - '0';}

// TODO: write
int main() { 
  ll n,k;cin>>n>>k;
  ll ans = k*power((k-1),n-1);
  print(ans);
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
static const int MAXN = 504;

int n;
bool a[MAXN][MAXN];

int main()
{
    scanf("%d", &n); getchar();
    for (int i = 0; i < n; ++i)
        for (int j = 0; j <= n; ++j) a[i][j] = (getchar() == '#');

    int has_white_col_ct = 0;
    for (int i = 0; i < n; ++i) {
        bool has_white = false;
        for (int j = 0; j < n; ++j) if (!a[j][i]) has_white = true;
        if (has_white) has_white_col_ct++;
    }
    int row_fill_steps = MAXN;
    for (int r = 0; r < n; ++r) {
        bool has_black_at_col_r = false;
        for (int i = 0; i < n; ++i)
            if (a[i][r]) has_black_at_col_r = true;
        int white_in_row_r = 0;
        for (int i = 0; i < n; ++i)
            if (!a[r][i]) white_in_row_r++;
        row_fill_steps = std::min(row_fill_steps, white_in_row_r + (has_black_at_col_r ? 0 : 1));
    }

    int ans = has_white_col_ct + row_fill_steps;
    printf("%d\n", ans > 2 * n ? -1 : ans);
    return 0;
}


Measured memory_bytes: 384