akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main()
{
    int c,z;cin >> c>>z;
    int ans = 0;
    for(int a = 0;a <= c;a++){
        for(int b = 0;b <= c;b++){
            int s = z-a-b;
            if(s<=c&&s>=0){
                ans++;
            }
            //cout<<a<<" "<<b<<" "<<s<<endl;
        }
    }
    cout<<ans<<endl;
    return 0;
}


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

int const MAXN = 15;
int const MAXS = 1<<MAXN;
int N, A[MAXN], x[MAXN][MAXN], y[MAXN][MAXN];

int is_honest(int s, int n) { return (s>>n)&1; }
int main() {
  std::cin >> N;
  for(int i = 0; i < N; ++i) {
    std::cin >> A[i];
    for(int j = 0; j < A[i]; ++j) {
       std::cin >> x[i][j] >> y[i][j];
       --x[i][j];
    }
  }
  int ans = 0;
  for(int s = (1<<N)-1; s >= 0; --s) {
    int pc = 0, tmp = s;
    while(tmp > 0) { ++pc; tmp&=tmp-1; }
    if(pc <= ans) continue;
    bool ok = true;
    for(int i = 0; i < N; ++i) {
      bool honest = true;
      for(int j = 0; j < A[i]; ++j) {
        if(is_honest(s, x[i][j])!=y[i][j]) { honest = false; break; }
      }
      if(honest!=!!is_honest(s, i)) { ok = false; break; }
    }
    if(!ok) continue;
    ans = pc;
  }
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<vector>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i = 0;i < (ll)(n);i++)
#define INF (1e9 + 1)
#define MAXN 101
#define MAXM
int main()
{
    char a[MAXN];
    int N;
    cin >> N;
    REP(i,N){
        cin >> a[i];
    }
    REP(i,N){
        //cout << a[i] << endl;
        if(a[i] == 'Y'){
            cout << "Four" << endl;
            return 0;
        }
    }
    cout << "Three" << endl;


    return 0;
}
/*
    REP(i,a){
        REP(j,b){

        }
    }
    */


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

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX

const double EPS = 1e-14;
const double PI  = acos(-1.0);


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

  int x;
  int e = 0;
  REP (i, n) {
    cin >> x;
    if (x % 2 == 0) e++;
  }

  cout << pow(3, n) - pow(2, e) << endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

N = input()
a = []
for i in range(N):
    a.append(input())

i=1
c=0

while(1):
    if i == 2:
        print c
        break
    elif c >= N:
        print -1
        break
    c+=1
    i=a[i-1]


Measured memory_bytes: 8964
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n,m) for(int (i)=(n);(i)<(m);(i)++)
#define rrep(i,n,m) for(int (i)=(n);(i)>(m);(i)--)
using ll = long long;
const ll mod = 1000000007;
const ll half = 500000004;

ll LRIH(vector<int> lis){

    vector<vector<int>> stk(0);

    ll ans = 0;
    ll one = 1;
    int N = lis.size();

    rep(i,0,N){

        if (stk.size() == 0){
            stk.push_back({lis[i],i});
        }else if (stk[stk.size()-1][0] < lis[i]){
            stk.push_back({lis[i],i});
        }else if (stk[stk.size()-1][0] > lis[i]){

            int lastpos = -1;

            while ( (stk.size()>0) && (stk[stk.size()-1][0] > lis[i])){

                int nh = stk[stk.size()-1][0];
                int np = stk[stk.size()-1][1];
                lastpos = np;
                stk.pop_back();

                ans = max(ans , (nh*one)*(i-np));
            }

            stk.push_back({lis[i] , lastpos});
        }
    }

    return ans;
}

int main(){

    int N;
    cin >> N;
    vector<int> h(N+1,0);
    rep(i,0,N){
        cin >> h[i];
    }
    cout << LRIH(h) << endl;
}


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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
//typedef pair<int,int> P;
//typedef pair<int,P> PP;

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

template< typename T >
struct SegmentTree {
	typedef function< T(T,T) > F;

	int sz;
	vector<T> node;

	const F f;
	const T INIT;

	SegmentTree(int n,const F f,const T &INIT):f(f),INIT(INIT) {
		sz=1;
		while(sz<n) sz<<=1;
		node.assign(2*sz-1,INIT);
	}

	void set(int k,const T &x) {
		node[k+sz-1]=x;
	}

	void build() {
		for(int k=sz-2;k>=0;k--) {
			node[k]=f(node[2*k+1],node[2*k+2]);
		}
	}

	void update(int k,const T &x) {
		k+=sz-1;
		node[k]+=x;
		while(k>0) {
			k=(k-1)/2;
			node[k]=f(node[k*2+1],node[k*2+2]);
		}
	}

	T query(int a,int b,int k,int l,int r) {
		if(r<=a||b<=l) return 0;
		if(a<=l&&r<=b) return node[k];
		T vl=query(a,b,k*2+1,l,(l+r)/2);
		T vr=query(a,b,k*2+2,(l+r)/2,r);
		return f(vl,vr);
	}

	T query(int a,int b) {
		return query(a,b,0,0,sz);
	}
};

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

	int n,q;cin>>n>>q;
	SegmentTree<int> tree(n,[](int a,int b){return a+b;},0);
	while(q--) {
		int type,x,y;cin>>type>>x>>y;
		if(type==0) {
			x--;
			tree.update(x,y);
		}
		else {
			x--;
			cout<<tree.query(x,y)<<endl;
		}
	}

	return 0;
}



Measured memory_bytes: 3928
n,m = map(int,input().split())
gyouretsu = []
c = [0]*n
k = []
for i in range(n):
  gyouretsu.append(list(map(int,input().split())))
for i in range(m):
  k.append(int(input()))
for i in range(n):
  for j in range(m):
    c[i] += gyouretsu[i][j]*k[j]
  print(c[i])


Measured memory_bytes: 6020
import java.util.Scanner;
 
public class Main {
    public static void main (String[] args){
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();
        long result = 0;
        result = (N / (A+B)) * A;
        long temp = 0;
        temp = N % (A+B);
        result+= Math.min(temp, A);
        System.out.println(result);
    }
}

Measured memory_bytes: 21844
#include <iostream>
using namespace std;
typedef long long ll;
ll h, w, c[10][10], a, res;
int main(void){
    // Your code here!
    cin >> h >> w;
    for (ll i = 0; i < 10; i++) {
        for (ll j = 0; j < 10; j++) {
            cin >> c[i][j];
        }
    }
    for (ll k = 0; k < 10; k++) {
        for (ll i = 0; i < 10; i++) {
            for (ll j = 0; j < 10; j++) {
                c[i][j] = min(c[i][k] + c[k][j], c[i][j]);
            }
        }
    }
    for (ll i = 0; i < h; i++) {
        for (ll j = 0; j < w; j++) {
            cin >> a;
            if (a == -1) continue;
            res += c[a][1];
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 256
n = int(raw_input())
sieve = [True for i in range(n+1)] 
for i in range(2, n+1):
    if sieve[i] == True:
        for j in range(i+i, n+1, i):
            sieve[j] = False
res = 1

for i in range(2, n+1):
    m = 1
    if sieve[i] == False:
        continue
    for j in range(i, n+1):
        j2 = j
        while j2 % i == 0:
            m += 1
            j2 /= i
    res = (res * m) % (10**9+7)
print res

Measured memory_bytes: 2692
n = int(input())
ans = -1
prev = -1
for _ in range(n):
    a = int(input())
    if prev+1 == a:
        prev = a
        ans += 1
        continue
    if prev+1 < a:
        print(-1)
        break
    ans += a
    prev = a
else:
    print(ans)


Measured memory_bytes: 9116
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  if(n%2 != 0) {
    cout << "No" << endl;
    return 0;
  }
  int h = n/2;
  string t = s.substr(0,h);
  string u = s.substr(h,s.back());
  if(t == u) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3612
#include<cstdio>
const long long p=1e9+7;
long long pow(long long n,long long c=2) {
    long long a[64];
    a[0]=c;
    for(int i=1;i<63;i++)a[i]=(a[i-1]*a[i-1])%p;

    long long ans=1;
    for(int i=0;i<63;i++)if((n&(1ll<<i))!=0)ans=(ans*a[i])%p;
    return ans;
}
//dp[i][state]=(直前の文字列を2進数でエンコードしてstateとなる場合に、0文字目からi-1文字目までにXYZがいない場合の数)
//エンコード方法：...000100101101 -> 3212 のように、何ビットおきに1が出るか数える
long long dp[41][1<<18]={};
int main(){
    int n,x,y,z;
    scanf("%d%d%d%d",&n,&x,&y,&z);
    long long ans=pow(n,10);
    int NG_state=(((((1<<x)+1)<<y)+1)<<z)+1;
    int mask=(1<<(x+y+z+1))-1;
    dp[0][1]=1;
    for(int i=0;i<n;i++){
        for(int state=0;state<=mask;state++){
            for(int j=1;j<=10;j++){
                int next_state = ((state<<j)&mask)+1;
                if((next_state&NG_state)==NG_state) continue;
                dp[i+1][next_state]+=dp[i][state];
                dp[i+1][next_state]%=p;
            }
        }
    }
    for(int state=0;state<=mask;state++){
        ans=(ans+p-dp[n][state])%p;
    }
    printf("%lld",ans);
    return 0;
}

Measured memory_bytes: 82048
///not today

#include<bits/stdc++.h>
using namespace std;

#define SZ(x) (int)(x).size()
#define pb push_back
#define ll long long
#define xmax(x, y) (x) = max((x), (y))
#define xmin(x, y) (x) = min((x), (y))
#define F first
#define S second
#define pii pair<int, int>
#define pll pair<long long, long long>
#define int long long
#define pipii pair< int, pair<int, int> >
#define plpll pair< ll, pair<ll, ll> >

using namespace std;

int32_t main(){
      int n;
      cin >>n;
      cout <<fixed <<setprecision(7) <<(double)((n + 1)/ 2)/n <<endl;
      return false;
}


Measured memory_bytes: 384
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}

#define INF 1e9+7
#define LLINF 1e18+7
#define N 110000
ll MOD=1e9+7;

main(){
    bool flag=true;
    string s;cin>>s;
    rep(i,s.size()){
        if(s[i]=='R'&&(i%2))flag=false;
        else if(s[i]=='L'&&(i%2==0))flag=false;
    }
    cout<<(flag?"Yes":"No");
}

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

#define ll long long
const int MOD = 1e9 + 7;
#define INF 2e9

#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

#define MATCH(_str, _ptn) regex_match(_str, regex(_ptn))
#define REPLACE(_str, _ptn, _replacement) regex_replace(_str, regex(_ptn), _replacement)

# define pb push_back

# define INIT() cin.tie(0); ios::sync_with_stdio(false); cout << fixed << std::setprecision(20)

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

ll n,m,r;
int main() {
    INIT();

    cin >> n;
    vector<ll> a(n);
    REP(i, n) {
        cin >> a[i];
        chmax(m, a[i]);
        r += m - a[i];
    }
    cout << r;
}

Measured memory_bytes: 4776
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string c;
  cin>>c;
  if(c=="a"||c=="e"||c=="i"||c=="o"||c=="u"){
    cout<<"vowel"<<endl;
  }else{
    cout<<"consonant"<<endl;
  }
}

Measured memory_bytes: 256
import math
temp=[]
ans=0
list=[int(input()) for _ in range(5)]
for i in range(5):
    temp.append(10*math.ceil(list[i]/10)-list[i])
    ans += 10*math.ceil(list[i]/10)
print(ans-10*math.ceil(list[temp.index(max(temp))]/10)+list[temp.index(max(temp))])

Measured memory_bytes: 3060
#include <iostream>

using namespace std;

int main() {

	int n = 0;
	int d = 0;

	cin >> n >> d;

	int ans = n / (d * 2 + 1);

	if (n % (d * 2 + 1) == 0) {

		cout << ans << endl;

	}
	else {

		cout << ans + 1 << endl;

	}

	return 0;

}

Measured memory_bytes: 256
let rec read ()=
  let t = Scanf.scanf "%d %d\n" (fun x y-> if x<y then (x,y) else (y,x))
  in
  match t with
    (0,0) -> ()
  | (x,y) -> Printf.printf "%d %d\n" x y;read ();;
let () = read ();;

Measured memory_bytes: 3752
int main(void) {

	int A[3][3],N,b[100];
	int flag[3][3],yoko;
    int i,j,k;

    for(i=0;i<3;i++)
	   {scanf("%d %d %d",&A[i][0],&A[i][1],&A[i][2]);}
    scanf("%d",&N);
    for(i=0;i<N;i++) {scanf("%d",&b[i]);}

    //yoko & set flag
    for(i=0;i<3;i++) {
    	yoko=0;
    	for(j=0;j<3;j++){
    		for(k=0;k<N;k++){
    		   if(A[i][j]==b[k])  {flag[i][j]=1; yoko++;break;}
    		   else   flag[i][j]=0;
    		}
    	}
    	if(yoko==3){printf("Yes");return(0);}
    }

    //tate
    for(i=0;i<3;i++){
    	if(flag[0][i] &&flag[1][i] && flag[2][i])
    	  {printf("Yes");return(0);}
  	}

    //naname
    if(flag[0][0]&&flag[1][1]&&flag[2][2])
       {printf("Yes");return(0);}
    if(flag[0][2]&&flag[1][1]&&flag[2][0])
       {printf("Yes");return(0);}

    //
    printf("No");
    return(0);
 }

Measured memory_bytes: 128
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;

int i, j, n, a[105], dp[105];

int main() {
  scanf("%d", &n);
  for(i = 1; i <= n; ++i) scanf("%d", a + i);
  sort(a + 1, a + n + 1);
  for(i = 1; i <= n; ++i)
    for(dp[i] = j = 1; j < i; ++j)
      if(a[i] > a[j]) dp[i] = max(dp[i], dp[j] + 1);

  printf("%d\n", *max_element(dp + 1, dp + n + 1));

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
template <typename A, typename B>
string to_string(pair<A, B> p);
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
 
string to_string(const string& s) {
  return '"' + s + '"';
}
 
string to_string(const char* s) {
  return to_string((string) s);
}
 
string to_string(bool b) {
  return (b ? "true" : "false");
}
 
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
 
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
 
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
 
void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
 
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#endif


typedef long long ll; 
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;
 
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

const int INF = (int)1e9;

void solve() {
  bool ok = false;
  int a, b, k;
  cin >> k >> a >> b;
  for (int i = a ; i <= b ; i++) {
    ok |= (i % k == 0);
  }
  if (ok) cout << "OK"; else cout << "NG";
}
 
int main() {
  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    
  int t = 1;
  // cin >> t;
  while (t--) {
    solve();
  }
 
  return 0;
}

Measured memory_bytes: 3620
using System;
using System.Collections.Generic;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            var hList = new List<int>();
            var wList = new List<int>();

            while (true)
            {
                String s = Console.ReadLine();
                String[] strInputList = s.Split();
                int h = int.Parse(strInputList[0]);
                int w = int.Parse(strInputList[1]);

                if (h == 0 && w == 0)
                {
                    break;
                }

                hList.Add(h);
                wList.Add(w);
            }

            for (int i = 0; i < hList.Count; i++)
            {
                int hLine = hList[i];
                int firstLine = 0;
                int lastLine = hLine - 1;

                for (int j = 0; j < hLine; j++)
                {
                    String symbols = null;
                    int wNumber = wList[i] - 2;

                    for (int k = 0; k < wNumber; k++)
                    {
                        if (j == firstLine || j == lastLine)
                        {
                            symbols = symbols + "#";
                        }else
                        {
                            symbols = symbols + ".";
                        }
                    }
                    Console.WriteLine("#" + symbols + "#");
                }
                Console.WriteLine("");
            }
        }
    }
}


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

int main(){
    int n;
    char c;
    string s;
    int cnt = 0;
    cin >> n;
    cin >> s;
    for(int i = 0; i < n; i++){
        c = s[i];
        if(c == 'R') cnt++;
    }
    if(cnt > (n - cnt))
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner((os.Stdin))

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	l := nextLine()
	i, e := strconv.Atoi(l)
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	A, B, C := nextInt(), nextInt(), nextInt()

	fmt.Printf("%s\n", ABC060B(A, B, C))
}

// ABC060B ...
func ABC060B(A, B, C int) string {
	for i := 0; i < B; i++ {
		if A*i%B == C {
			return "YES"
		}
	}

	return "NO"
}


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

int road[51];

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
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; }

const int MOD = 1000000007;
const int INF = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

int main(){
	int n;
	cin >> n;
	map<int, int> mp;
	rep(i,n){
		int a;
		cin >> a;
		mp[a]++;
	}
	int t = 0;
	for(auto& e: mp){
		while(e.second>=3){
			t++;
			e.second-=2;
		}
	}
	int r = 0;
	for(auto& e: mp){
		if(e.second==2) r++;
	}
	t += (r+1)/2;
	int ans = n-2*t;
	cout << ans << endl;
}


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

using namespace std;

const int N = 10000 + 5;
const int INF = 0x3f3f3f3f;
using LL = long long;
using P = pair<int, int>;
map<int, int> mp;
set<int> S;

int main(){
    string str;
    cin >> str;
    int sum = 700;
    for(int i = 0; i < (int)str.length(); i++)
        if(str[i] == 'o') sum += 100;
    cout << sum << endl;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import static java.lang.Math.*;

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

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        int N = scanner.nextInt();
        long[] arr = new long[N];
        for (int i = 0; i < N; i++) {
            arr[i] = scanner.nextLong();
        }
        System.out.println(lcm(arr));
    }

    public static long gcd(long m, long n) {
        return java.math.BigInteger.valueOf(m).gcd(java.math.BigInteger.valueOf(n)).longValue();
        //if (m < n) return gcd(n, m);
        //if (n == 0) return m;
        //return gcd(n, m % n);
    }

    public static long lcmImpl(long m, long n) {
        return java.math.BigInteger.valueOf(m).multiply(java.math.BigInteger.valueOf(n)).divide(java.math.BigInteger.valueOf(gcd(m, n))).longValue();
    }

    public static long lcm(long... arr) {
        if (arr.length == 1) return arr[0];
        if (arr.length == 2) return lcmImpl(arr[0], arr[1]);
        long[] newArr = new long[arr.length -1];
        System.arraycopy(arr, 2, newArr, 1, arr.length - 2);
        newArr[0] = lcmImpl(arr[0], arr[1]);
        return lcm(newArr);
    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";

        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() {
            try {
                if (i < s.length) return s[i++];
                String line = br.readLine();
                while (line.equals("")) {
                    line = br.readLine();
                }
                s = line.split(reg, 0);
                i = 0;
                return s[i++];
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public int nextInt() {
            try {
                return Integer.parseInt(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }

        public double nextDouble() {
            try {
                return Double.parseDouble(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }

        public long nextLong()  {
            try {
                return Long.parseLong(next());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return -1;
        }
    }
}


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

#define int long long
#define pb push_back
#define range(v) v.begin(),v.end()
#define mod (int)(2019)
#define inf (int)(1e15)
#define N (int)(2e5 + 10)

using namespace std;

void solve() {
	map<int, int> cnt;
	cnt[0]++;
	string s;
	cin >> s;
	int n = s.length();
	int val = 1;
	int cur = 0;
	int ans = 0;
	for (int i = n - 1; i >= 0; i--) {
		cur += ((s[i] - '0') * val) % mod, cur %= mod;
		ans += cnt[cur];
		cnt[cur]++;
		val *= 10, val %= mod;
	}

	cout << ans << endl;
}

// you should probably see down .. believe me it would help
int32_t main() {
	ios_base::sync_with_stdio(false), cin.tie(nullptr), cin.tie(nullptr);
	int t_c = 1;
//	cin >> t_c;
	while (t_c--)
		solve();
}

// COME ON DUDE .... GIVING UP NOT GONNA HELP
// JUST GET YOUR ASS TO WORK ALREADY ..


Measured memory_bytes: 3784
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6+7;
int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    ll ans = a*b;
    ans -= c*b;
    ans -= d*a;
    ans += c*d;
    cout<<ans<<endl;
	return 0;
}


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

using namespace std;
typedef complex<double> P;
struct C{
    P p;
    double r;
};
bool operator < (const C& c, const C& d) {
    return c.p.real() < d.p.real();
}

int main(){
    int n;
    while(cin >> n && n > 0) {
        vector<C> cs(n);
        double max_r = 0;
        double th = M_PI / 4;
        REP(i, n) {
            double r, x, y;
            cin >> r >> x >> y;

            P p(x, y);
            p *= polar(1.0, th);

            cs[i] = {p, r};

            max_r = max(max_r, r);
        }

        sort(cs.begin(), cs.end());
        double ans = 1e63;

        REP(i, n) {
            for(int j = i + 1; j < n; j++) {
                if(ans < cs[j].p.real() - cs[i].p.real() - cs[i].r - max_r) {
                    break;
                }
                ans = min(ans, abs(cs[i].p - cs[j].p) - cs[i].r - cs[j].r);
            }
        }
        printf("%.12f\n", ans);
    }
    return 0;
}

Measured memory_bytes: 3608
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
template<typename T=ll>inline T in(istream&is=cin){T ret;is>>ret;return ret;}
template<typename T>inline auto vec2(typename vector<T>::size_type h,typename vector<T>::size_type w,T v=T()){return vector<vector<T>>(h,vector<T>(w,v));}

ll gcd(ll x,ll y)
{
    return y==0?x:gcd(y,x%y);
}
int main()
{
    ll x=in(),y=in();
    cout<<x/gcd(x,y)*y<<endl;
}


Measured memory_bytes: 256
N = int(input())
S = str(input())

S10 = [0 for i in range(10)]
S100 = [list(S10) for i in range(10)]
S1000 =[list([list(S10) for i in range(10)]) for i in range(10)]

for n in S:
    for i in range(10):
        for j in range(10):
            if list(S100)[i][j] == 1:
                S1000[i][j][int(n)] = 1
        if list(S10)[i] == 1:
            S100[i][int(n)] = 1
    S10[int(n)] = 1
    


ans = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            if S1000[i][j][k] == 1:
                ans += 1

print(ans)


Measured memory_bytes: 42476
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
int coun=0,z;
int main()
{while(1){
	cin>>z;
if(!z) return 0;
cout<<"Case "<<++coun<<": "<<z<<endl;
}}

Measured memory_bytes: 1160
N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
ans = A[0]
n = N - 2
for i in range(1, n // 2 + 1):
    ans += A[i] * 2

if n % 2 == 1:
    ans += A[n // 2 + 1]

print(ans)


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

#define VARNAME(x) #x
#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using ld = long double;
template <typename T>
vector<T> Vec(int n, T v)
{
    return vector<T>(n, v);
}
template <class... Args>
auto Vec(int n, Args... args)
{
    auto val = Vec(args...);
    return vector<decltype(val)>(n, move(val));
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}


constexpr ll MOD = (ll)1e9 + 7LL;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 100;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int maxi = 0;
    int sum = 0;
    for (int i = 0; i < s.size(); i++) {
        sum += s[i] - '0';
        if (s[i] != '0') {
            maxi = max(maxi, sum - 1 + 9 * ((int)s.size() - i - 1));
        }
    }
    cout << max(sum, maxi) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

int main() {
    int n, m, k;
    bool flg = false;
    std::cin >> n >> m >> k;
    /* aM+bN-ab */
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= m; j++) {
            if (k == i * m + j * n - 2 * i * j) {
                flg = true;
                break;
            }
        }
    }

    std::cout << (flg ? "Yes" : "No") << std::endl;
}

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

int main() {
    double a, b, x;
    cin >> a >> b >> x;
    x /= a;

    double ans;
    if (x > a * b / 2)
        ans = atan2((a * b - x) * 2, a * a) * 180.0 / M_PI;
    else
        ans = atan2(b * b, x * 2) * 180.0 / M_PI;

    printf("%.10f\n", ans);
    return 0;
}


Measured memory_bytes: 4164
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if((a*b)>(c*d)) {
		cout<<(a*b);
	}
	else if((a*b)<(c*d)) {
		cout<<(c*d);
	}
	else {
		cout<<(a*b);
	}
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>

#define maxn 101
#define int long long
using namespace std;

int ans,n,cnt;

signed main()
{
    scanf("%lld",&n);
    for(int i=1;i<=n;i++)
        if(i&1) cnt++;
    printf("%lld",cnt*(n-cnt));
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		int[] c = new int[5];
		for (int i = a; i <= b; i++) {
			int j = i;
			int x = 0;
			while (j > 0) {
				c[x] = j % 10;
				j = j/10;
              	x++;
			}
			if (c[0] == c[4] && c[1] == c[3]) {
				count++;
			}
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 21972
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cctype>
#define INF 10000000
using namespace std;
bool debug=false;

int main(){
  int n,y,t;
  double b,r;
  while(1){
    pair<double,int> p[51];
    cin>>n;
    if(n==0)break;
    cin>>y;
    for(int i=0;i<n;i++){
      cin>>b>>r>>t;
      if(t==1)p[i].first=1+(y*r/100);
      else p[i].first=pow(1+r/100,y);
      p[i].second=b;
      //cout<<"num:"<<p[i].second<<"  score:"<<p[i].first<<endl;
    }
    sort(p,p+n);
    reverse(p,p+n);
    for(int i=0;i<n;i++){
     
    }
    cout<<p[0].second<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 3188
#include<bits/stdc++.h>
 
#define ll                    long long int
#define ll_MAX                LLONG_MAX
#define ll_MIN                LLONG_MIN
#define pi                    3.14159265358979323846
#define count_1(n)            __builtin_popcountll(n)
#define MOD                   1000000007
#define MAX                   1e9
#define MIN                   -1e9
#define itoc(c)               ((char)(((int)'0')+c))
#define mid(s,e)              (s+(e-s)/2)
const int MX=10010896;
const int lmt=3164;
const int N=100005;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
ll extgcd(ll a,ll b,ll& x,ll& y){if(b==0){x=1;y=0;return a;}else{int g=extgcd(b,a%b,y,x);y-=a/b*x;return g;}}
ll modpow(ll a,ll b) {ll res=1;a%=MOD;for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}
#define print_upto(a,n)        for(int i=0;i<n;i++)    cout<<a[i]<<" "; cout<<endl
#define print(a)        for (auto x : a) cout << x << " "; cout << endl

vector<int> adj[N];
vector<bool> visited(N,false);

void dfs(int u){
    visited[u]=true;
    for(int v:adj[u]){
        if(!visited[v])
            dfs(v);
    }
}

inline void solve(){
    int n,m;cin>>n>>m;
    for(int i=0;i<m;i++){
        int u,v;cin>>u>>v;u--;v--;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    int cnt=0;
    for(int i=0;i<n;i++){
        if(!visited[i]){
            cnt++;
            dfs(i);
        }
    }
    cout<<cnt-1<<"\n";
}

int main()
{
	cout<<fixed<<setprecision(12);
	fastio;ll  t=1,tc=1;
	#ifndef ONLINE_JUDGE
    	freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout);
	#endif
	//cin>>t;
	while(t--){solve();}return 0;
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    string s;
    cin>>s;
    ll r[n],g[n],b[n];
    r[n-1] = g[n-1] = b[n-1] = 0;
    if(s[n-1] == 'R') {
        r[n-1]++;
    } else if(s[n-1] == 'G') {
        g[n-1]++;
    } else {
        b[n-1]++;
    }
    for(int i=n-2; i>=0; i--) {
        r[i] = r[i+1];
        g[i] = g[i+1];
        b[i] = b[i+1];
        if(s[i] == 'R') {
            r[i]++;
        } else if(s[i] == 'G') {
            g[i]++;
        } else {
            b[i]++;
        }
    }
    ll ans = 0;
    for(int i=0; i<n; i++) {
        for(int j=i+1; j<n-1; j++) {
            if(s[i] != s[j]) {
                int delta = j-i;
                if(s[i] == 'R') {
                    if(s[j] == 'G') {
                        ans += b[j+1];
                        if(j+delta < n && s[j+delta] == 'B') {
                            ans--;
                        }
                    } else {
                        ans += g[j+1];
                        if(j+delta < n && s[j+delta] == 'G') {
                            ans--;
                        }
                    }
                } else if(s[i] == 'G') {
                    if(s[j] == 'R') {
                        ans += b[j+1];
                        if(j+delta < n && s[j+delta] == 'B') {
                            ans--;
                        }
                    } else {
                        ans += r[j+1];
                        if(j+delta < n && s[j+delta] == 'R') {
                            ans--;
                        }
                    }
                } else {
                    if(s[j] == 'R') {
                        ans += g[j+1];
                        if(j+delta < n && s[j+delta] == 'G') {
                            ans--;
                        }
                    } else {
                        ans += r[j+1];
                        if(j+delta < n && s[j+delta] == 'R') {
                            ans--;
                        }
                    }
                }

            }
        }
    }
    cout<<ans<<"\n";
    return 0;
}


Measured memory_bytes: 3712
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdio>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>

using namespace std;
typedef long long ll;
typedef double db;
#define inf 0x3f3f3f3f
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main() {
	int n, ans = 0, i, t;
	cin >> n;
	for (i = 1; i <= n; ++i) {
		cin >> t;
		if (i & 1 && t & 1)++ans;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3592
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

public static class P
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());

        var a = Enumerable.Repeat(0, n).Select(_ => Console.ReadLine()).ToArray();
        string[] h = new[] { "AC", "WA", "TLE", "RE" };

        Console.WriteLine(string.Join("\n", h.Select(x => $"{x} x {a.Count(y => y == x)}")));
    }
}


Measured memory_bytes: 32124
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<bitset>
#include<cmath>
#include<queue>
#include<map>
#include<set>

using namespace std;

int read()
{
    int ans=0,f=1;
    char c=getchar();
    while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){ans=ans*10+c-'0';c=getchar();}
    return ans*f;
}

const int N=15;
int a,b;
char s[N],t[N],u[N];

int main()
{
    scanf("%s%s",s+1,t+1);
    a=read();b=read();
    scanf("%s",u+1);
    if(strcmp(s+1,u+1)==0)
        a--;
    if(strcmp(t+1,u+1)==0)
        b--;
    printf("%d %d",a,b);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

int main(void)
{
    int N;
    cin >> N;
    int a[N];
    rep(i ,N) cin >> a[i];
    int N2 = 0, N4 = 0;
    for (int i = 0; i < N; i++){
        if (a[i] % 4 == 0) N4++;
        else if (a[i] % 2 == 0) N2++;
    }
    if( N % 2 == 1) N--;
    if ( N*2 - N4*2 - N2 <= N ) cout << "Yes";
    else cout << "No";

    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;

#if DEBUG && !ONLINE_JUDGE
    ifstream input_from_file("input.txt");
    #define cin input_from_file
#else

#endif
 
 
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); // Togliere nei problemi con query online
 
    int X;
    cin >> X;
    for (int A = 1; A < 360*360; A++) {
        int n= 0;
        if ((360* A) % X == 0) n = 360*A/X;
        if (n > 0) {
            cout << n << "\n";
            return 0;
        }
    }
}


Measured memory_bytes: 3684
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* 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 = 1000000007;
typedef pair<long long,long long> P;
//NのM乗を求める(繰り返し二乗法)
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 nCr(long long n, long long r) {
    long long A = 1, B = 1;
    //Aが分子Bが1/r!
    for (long long i = n - r + 1; i <= n; i++) {
        A = A * i % MOD;
    }
    for (long long i = 1; i <= r; i++) {
        B = B * i % MOD;
    }
    B = mod_pow(B, MOD - 2);
    B %= MOD;
    //Bは割るのではなく掛ける
    return (A * B) % 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);
}

//long long A,B;
bool ok(long long key,long long index){
    if(index > key) return true;
    else if(index <= key) return false;
}
long long binary_search(long long key,long long size){
    //left,right,midはいずれもindex
    long long left = -1,right = size;
    while(right - left > 1){
        long long mid = left + (right-left)/2;
        long long hantei = ok(key,mid);
        if(hantei) right = mid;
        else left = mid;
    }
    if(left == -1)return 0;
    return left;
}

int main() {
    int M;cin >> M;
    long long digitsum = 0;
    long long digit = 0;
    for(int i = 0;i<M;i++){
        long long d,c;cin >> d >> c;
        digitsum += d*c;
        digit += c;
    }
    cout << digit + (digitsum-1)/9 - 1 << endl;
}


Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split()]
total = []
num = 0
for i in reversed(range(N+1)):
    num += A[i]
    total.append(num)
total.reverse()
if A[0] == 1 and N == 0:
    print(1)
    exit()
if A[0] != 0:
    print(-1)
    exit()
ans = 1
num = 1
for i in range(1,N+1):
    num = min(2*num, total[i])
    ans += num
    num -= A[i]
    if num < 0:
        print(-1)
        exit()
print(ans)

Measured memory_bytes: 83436
#include <iostream>
#include <string>
#include <math.h>
using  namespace std;

int main()
{
	int N, M, C, B[20], A[20][20], i, j, Ans, Go;
	Ans = 0;
	Go = 0;
	cin >> N >> M >> C;
	for (i = 0; i < M; i++)
		cin >> B[i];
	for (i = 0; i < N; i++) {
		for (j = 0; j < M; j++)
			cin >> A[i][j];
	}

	for (i = 0; i < N; i++) {
		Ans = 0;
		for (j = 0; j < M; j++)
			Ans += A[i][j] * B[j];
		if (Ans + C > 0)
			Go += 1;
	}
	cout << Go;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){

int a,b,c;

int t=3;
cin>>a;
cin>>b;
cin>>c;

if(a==b){t--;}
if(b==c){t--;}
if(c==a){t--;}

if((a==b)&&(b==c)&&(c==a)){t=1;}

cout<<t;









    return 0;
}



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


int main(){
    int n;
    cin >> n;
    vector<int> x(n);
    rep(i,n) cin >> x[i];
    int ans = 1e9;
    for(int i=1; i<=100; i++){
        int now = 0;
        rep(j,n){
            now += (x[j]-i)*(x[j]-i);
        }
        ans = min(ans,now);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#pragma region Macros
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define all(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
#define ceil(a,b) ((a+b-1)/b)
int gcd(int a, int b) // assuming a,b >= 1
{
    if (a < b)
        swap(a, b);
    if (b == 0)
        return a;
    if (a % b == 0)
        return b;
    return gcd(b, a % b);
}
int lcm(int a, int b) // assuming a,b >= 1
{
    return  a * b / gcd(a, b);
}
using namespace std;
#pragma endregion
signed main() {
    int K;
    cin >> K;
    cout << K/2 * ceil(K,2);
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    int len;
    vector<int> a;
    long long sum = 0;
    string s;
    cin >> s;
    len = s.length();
    a.assign(len+1, 0);
    for(int i=1;i<=len;i++){
        if(s[i-1] == '<')a[i] = max(a[i], a[i-1]+1);
    }
    for(int i=len;i>=1;i--){
        if(s[i-1] == '>')a[i-1] = max(a[i-1], a[i]+1);
    }
    for(int i=0;i<=len;i++){
        sum += a[i];
        //cout << a[i] << endl;
    }
    cout << sum << endl;
}


Measured memory_bytes: 2820
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main()
{
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    if (b - a == c - b)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
    return 0;
}

Measured memory_bytes: 128
// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) std::cout << (x) << std::endl;
#define printa(x,n) for(int i = 0; i < n; i++){ std::cout << (x[i]) << " ";} std::cout << std::endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ std::cout << x[i][j] << " ";} std::cout << std::endl;}
#define printp(x,n) for(int i = 0; i < n; i++){ std::cout << "(" << x[i].first << ", " << x[i].second << ") "; } std::cout << std::endl;
#define INF (1e18)
#define ll long long
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
#define __max(a,b) (((a) > (b)) ? (a) : (b))
#define __min(a,b) (((a) < (b)) ? (a) : (b))
class Plot {
public :
	int64_t x = 0;
	int64_t y = 0;
	Plot() :Plot(0, 0) {}
	Plot(int64_t x, int64_t y) {
		this->x = x;
		this->y = y;
	}
};

double Distance(int x1, int y1, int x2, int y2) {
	return sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2));
}

//階乗 
int fact(int k) {
	int sum = 1;
	for (int i = 1; i <= k; ++i)
	{
		sum *= i;
	}
	return sum;
}

int main()
{
	std::string in, splitA, splitB;
	int len = 0;
	std::cin >> len;
	std::cin >> in;

	if (len < 2 || len % 2 != 0) {
		std::cout << "No" << std::endl;
		return 0;
	}

	int pos = 0;
	int mid = len / 2;
	bool ok = true;
	for (; pos < mid; pos++)
	{
		if (in[pos] != in[pos + mid]) {
			ok = false;
			break;
		}
	}

	std::cout << (ok ? "Yes" : "No") << std::endl;

	return 0;
}

Measured memory_bytes: 256