akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>  /*入出力*/
#include <stdlib.h> /*標準ライブラリ*/
#include <string.h> /*文字列*/
#include <math.h>   /*計算*/
#include <assert.h> /*確認*/
#include <ctype.h>  /*文字操作*/

#define rep(i, n) for(int  i = 0; i < (n); i++)
#define max(a,b) ((a>b)?a:b)
#define ABS(a) (((a)>(0))?a:-(a))

#define N 3000
void swap(int *a, int *b)
{
  int temp;
  temp = *a;*a = *b;*b = temp;
}

int main(void)
{
  int n;
  char s[3];

  scanf("%s", &s);
  if(strcmp(s, "SUN") == 0)printf("7\n" );
  if(strcmp(s, "SAT") == 0)printf("1\n" );
  if(strcmp(s, "FRI") == 0)printf("2\n" );
  if(strcmp(s, "THU") == 0)printf("3\n" );
  if(strcmp(s, "WED") == 0)printf("4\n" );
  if(strcmp(s, "TUE") == 0)printf("5\n" );
  if(strcmp(s, "MON") == 0)printf("6\n" );
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
void neg() {cout << - 1 << endl;}
void unhap() {cout << ":(" << endl;}

int main() {
  ll n, a, b;
  cin >> n >> a >> b;
  if ((b - a) % 2 == 0) cout << (b - a) / 2 << endl;
  else {
    cout <<
    min(
      (a + b) / 2,
      (n - a + 1 + n - b + 1) / 2
    )
    << endl;
  }
}

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


int main(void) {
  int n;
  string s;
  cin >> n >> s;
  vector<vector<int>> a(2,vector<int>(n,0));
  rep(i,n){
    if (s.at(i) == 'W') a[0][i] = 1;
    else a[1][i] = 1;
  }
  vector<int> p(n+1,0);
  vector<int> q(n+1,0);
  rep(i,n) {
    p[i+1] = p[i]+a[0][i];
    q[i+1] = q[i]+a[1][i];
  }
  int cnt = 1000000;
  rep(i,n){
    int t = p[i]+q[n]-q[i+1];
    
      
    cnt = min(cnt,t);
    
  }
  cout << cnt << endl;
  
               
   
}


Measured memory_bytes: 5240
#include<bits/stdc++.h>
using namespace std;
const int N=2005;
int n,a[N],sum;
bitset<4000005> f;
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]),sum+=a[i];
	f[0]=1;
	for (int i=1;i<=n;i++) f|=(f<<a[i]);
	for (int i=(sum+1)/2;i<=sum;i++)
	  if (f[i]) return printf("%d\n",i),0;
	return 0;
}

Measured memory_bytes: 1664
#include <iostream>

using namespace std;
int no,total,ans;

void dfs(int sum,int depth,int last){
	if(sum>total)return;
	if(depth==no){
		if(sum==total)ans++;
		return;
	}
	for(int i=last+1;i<10;i++){
		dfs(sum+i,depth+1,i);
	}
}
int main(){
	while(1){
		ans=0;
		cin>>no>>total;
		if(no+total==0)break;
		dfs(0,0,-1);
		cout<<ans<<endl;
	}
}

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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (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 (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i];
#define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()
#define len(v) (v).length()
#define FIND(s, n) (s.find(n) != s.end())
#define SORT(a) sort(all(a))

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};


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

	int N;
	cin >> N;
	vint(A, N);
	unordered_set<int> ust;
	REP(i, N) ust.insert(A[i]);
	if(ust.size()%2 == 0) cout << ust.size()-1 << endl;
	else cout << ust.size() << endl;
}


Measured memory_bytes: 4772
n=int(input())

#0を一回も使わない
no_0 = 9**n

#9を一回も使わない
no_9 = 9**n

#0と9を一回も使わない
no_09 = 8**n

#全体-上記集合
yes_09 = 10**n - (no_0+no_9-no_09)

print(yes_09%(10**9+7))

Measured memory_bytes: 12036
#include<iostream>
using namespace std;
int mi (int a, int b){
  if (a < b) return a;
  else return b;
}
int min (int a, int b, int c) {
  int t = min(a, b);
  return min(t, c);
}
int main () {
  int N, A, B;
  cin >> N >> A >> B;
  int po[] = {0, 0, 0};
  for (int i = 0; i < N; i ++) {
    int p;
    cin >> p;
    if (p <= A) po[0] ++;
    if (p > A && p <= B) po[1] ++;
    if (p > B) po[2] ++;
  }
  int ans = min(po[0], po[1], po[2]);
  cout << ans << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(ll i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[8]={0,1,0,-1,1,1,-1,-1},mdy[8]={-1,0,1,0,1,-1,1,-1};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int a,b,c;
int main(){
	cin>>a>>b>>c;
	a=a-b;
	if(c<=a){
		cout<<0<<endl;
	}else{
		cout<<c-a<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,ans=0,temp=1;
    cin>>n;
    for(long long int i=1;i<=n;i++)
    {
        for(long long int j=1;j<=n;j++)
        {
            for(long long int k=1;k<=n;k++)
            {
                temp=__gcd(j,k);
                ans+=__gcd(i,temp);
            }
        }
    }
    cout<<ans;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    int ans;
    cin>>n;
    int num[102];
    for(int i=1;i<=n;i++)
        cin>>num[i];
    sort(num+1,num+n+1);
    int cnt1=0,cnt2=0;
    for(int i=1;i<=n;i++){
        if(i%2==0)
            cnt1=cnt1+num[i];
        else if(i%2!=0)
            cnt2=cnt2+num[i];
    }
    ans=cnt1-cnt2;
    if(ans<0)
        printf("%d",-ans);
    else
        printf("%d",ans);


    return 0;
}


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

bool f [100001];
int c [100002];
int N ,L , R ;
int main ()
{
  for (int i =2;i<=100000;i++)
    if (!f[i])
      for (int j=i+i;j<=100000;j+=i)
        f[j]= true;
  for (int i=3;i<=100000;i+=2)
    if (!f[i]&&!f[(i+1)/2])c[i]++;
  for (int i=3;i<=100000;i++)c[i]+=c[i-1];
  cin>>N;
  while (N--)
    {
      scanf("%d%d",&L,&R);
      printf ("%d\n",c [R]-c[L-1]);
 }
  return 0;
}

Measured memory_bytes: 1152
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<string, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;
int a[200100];
int b[200100];

void solve() {
    for (int i = n; i > 0; i--) {
        int sum = 0;
        int j = i + i;
        while (j <= n) {
            sum += b[j];
            j += i;
        }
        if (sum % 2 != a[i]) {
            b[i] = 1;
        }
    }
    
    vector<int> res;
    for (int i = 1; i <= n; i++) {
        if (b[i] == 1) {
            res.push_back(i);
        }
    }
    int size = (int)res.size();
    cout << size << endl;
    for (int i = 0; i < size; i++) {
        cout << res[i];
        if (i == size-1) cout << endl;
        else cout << " ";
    }
}

void input() {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    solve();
}


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

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define In insert
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second
#define mx1 10
#define mx2 110
#define mx3 1010
#define mx4 10010
#define mx5 100010
#define mx6 1000010

typedef vector<LL> Vl;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vl> VVl;
typedef pair<LL, LL> Pll;
typedef pair<DD, DD> Pdd;
typedef vector<Pll> Vpl;
typedef vector<Pdd> Vpd;
typedef queue<LL> Ql;
typedef stack<LL> Sl;
typedef deque<LL> Dl;

LL _set(LL N, LL pos) {return N = N | (1 << pos);}
LL _reset(LL N, LL pos) {return N = N & ~(1 << pos);}
bool _check(LL N, LL pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

LL dx[] = {1, -1, 0, 0, -1, -1, 1, 1};
LL dy[] = {0, 0, 1, -1, -1, 1, -1, 1};

///**************************DONE****************************///

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

    if(a + b + c >= 22)
        cout << "bust\n";
    else
        cout << "win\n";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep_lr(i,l,r) for(int i=(l);i<(r);i++)
#define all(x) (x).begin(),(x).end()
#define V vector
typedef V<int> vi;
typedef V<vi> vvi;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
constexpr int INF = INT_MAX >> 1;
constexpr ll LINF = 5000000000000000LL;
constexpr int MOD = 1000000007;

int main() {

	int n;
	cin >> n;
	vi cnt(n);
	rep(x, n)rep(y, n)rep(z, n) {
		int xx = x + 1;
		int yy = y + 1;
		int zz = z + 1;
		ll left = (ll)xx * xx + yy * yy + zz * zz + xx * yy + yy * zz + zz * xx;
		if (left > n)break;
		cnt[left - 1]++;
	}
	
	rep(i, n)cout << cnt[i] << endl;
}

Measured memory_bytes: 3548
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define mt              make_tuple
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define range(a,b)		substr(a,b-a+1)
#define w(x)            int x; cin>>x; while(x--)
#define trace(x) 		cerr<<#x<<": "<<x<<" "<<endl;
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int32_t main()
{
	FIO;
	int n; cin >> n;
	vector<pii> v(n);
	int ans = 0;

	for (int i = 0; i < n; ++i)
		cin >> v[i].ff >> v[i].ss;

	for (int a = -1; a <= 1; ++a)
		for (int b = -1; b <= 1; ++b)
		{
			if (a and b)
			{
				int mx = LLONG_MIN, mn = LLONG_MAX;
				for (int i = 0; i < n; ++i)
				{
					mx = max(mx, a * v[i].ff + b * v[i].ss);
					mn = min(mn, a * v[i].ff + b * v[i].ss);
				}

				ans = max(ans, mx - mn);
			}
		}

	cout << ans << '\n';

	return 0;
}

Measured memory_bytes: 6420
#include <bits/stdc++.h>
#define int long long
using namespace std;

vector <int> adj[55];


int m[55], xx[55], yy[55], dp[60][1LL << 21];

void dfs(int u, int p, int x, int y, int &mask) {
        mask |= (1LL << u);
        for(int v: adj[u]) {
            if((u == x && v == y) || (u == y && v == x) || v == p) continue;
            dfs(v, u, x, y, mask);
        }

}

int f(int idx, int mask) {
        if(idx < 0) return mask == 0LL;
        if(~dp[idx][mask]) return dp[idx][mask];
        int res = f(idx - 1, mask);
        int newmask = mask;
        for(int i = 0; (1LL << i) <= mask; i++) {
            if(mask & (1LL << i)) {
                if(((m[idx] >> xx[i]) & 1LL) ^ ((m[idx] >> yy[i]) & 1LL)) newmask ^= (1LL << i);
            }
        }
        res += f(idx - 1, newmask);
        return dp[idx][mask] = res;
}
int32_t main() {
        memset(dp, -1, sizeof dp);
        int n; cin >> n;
        vector <pair <int, int> > edges;
        for(int i = 1; i < n; i++) {
            int u, v; cin >> u >> v;
            adj[u].push_back(v);
            adj[v].push_back(u);
            edges.push_back({u, v});
        }

        for(int i = 0; i < n - 1; i++) dfs(1, 0, edges[i].first, edges[i].second, m[i]);


        int m; cin >> m;
        for(int i = 0; i < m; i++) {
            cin >> xx[i] >> yy[i];
        }

        cout << f(n - 2, (1LL << m) - 1) << endl;
}


Measured memory_bytes: 983424
// #includes {{{
#ifdef MY_DEBUG
#include "header/header.hpp"
#else
#include <bits/stdc++.h>
#endif

using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

typedef long long Int;
typedef unsigned long long uInt;
typedef long double rn;

template<class T>
T inf(){
	return numeric_limits<T>::has_infinity?numeric_limits<T>::infinity():(numeric_limits<T>::max()/2);
}

typedef pair<int,int> pii;

#ifdef MY_DEBUG
#include"print.hpp"
#include"debug.hpp"
#endif
// }}}

const string YES = "YES";
const string NO = "NO";
string S;

void solve(){
	int win = 0, lose = 0;
	REP(i,S.size())if(S[i]=='o')win++;else lose ++;
	win += 15 - win - lose;
	if(win>=8)cout<<YES<<endl;
	else cout<<NO<<endl;
}

//{{{ main fucnction
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin >> S;
	solve();
	return 0;
}

//}}}



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

int main() {
	long long x, k, d;
	cin >> x >> k >> d;
	x = abs(x);
	
	long long ans;
	if (x / d >= k) ans = x - k * d;
	else {
		if ((k - x / d) % 2 == 0) ans = x - x / d * d;
		else ans = d - x + x / d * d;
	}

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(std::unique(all(x)), x.end());
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
const double PI = acos(-1);
using namespace std;
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;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

int main() {
    int m;
    cin >> m;
    cout << 48 - m << endl;
}

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

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

    int maxi = 0;
    int sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> l;
        sum += l;
        maxi = max(l, maxi);
    }

    if (sum - maxi > maxi) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

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

			String in = br.readLine();
			String chr[] = in.split(" ");
			int h1 = Integer.parseInt(chr[0]);
			int w1 = Integer.parseInt(chr[1]);
			String inp = br.readLine();
			String chrp[] = inp.split(" ");
			int h = Integer.parseInt(chrp[0]);
			int w = Integer.parseInt(chrp[1]);

			 System.out.println((h1-h)*(w1-w));
		}
	}
}

Measured memory_bytes: 25236
import scala.io.StdIn.readLine

object Main {
  def main(args:Array[String]):Unit = {
    println {
      Iterator.continually(readLine).takeWhile(_.toInt!=0).map { s=>
        var n = s
        var cnt = 0
        if(n.sortWith(_>_).toInt - n.sorted.toInt == 0) "NA"
        else {
          while(n!="6174") {
            n = "%04d".format((n.sortWith(_>_).toInt - n.sorted.toInt))
            cnt += 1
          }
          cnt
        }
      }.mkString("\n")
    }
  }
}

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

namespace ConsoleApp3
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var days = int.Parse(Console.ReadLine());

            var scoreDownCoefficients = Console.ReadLine().Split(" ")
                .Select((x, i) => (score: long.Parse(x), questionNumber: (long)i + 1))
                .OrderByDescending(x => x.score)
                .ToDictionary(x => x.questionNumber, x => x.score);

            Hoge(days, scoreDownCoefficients);
        }

        private static void Hoge(int days, IReadOnlyDictionary<long, long> scoreDownCoefficients)
        {
            var lastDictionary = new Dictionary<long, long>();

            foreach (var today in Enumerable.Range(1, days))
            {
                var downScoreDictionary = GetAll(today, lastDictionary, scoreDownCoefficients);
                long overallDownScore = downScoreDictionary.Values.Sum();

                var scoreUpNumber = Console.ReadLine().Split(" ")
                    .Select((score, i) => (score: int.Parse(score), questionNumber: i + 1))
                    .OrderByDescending(x =>
                    {
                        lastDictionary.TryGetValue(x.questionNumber, out var lastHeld);

                        return x.score - overallDownScore + downScoreDictionary[x.questionNumber];
                    })
                    .First();

                lastDictionary[scoreUpNumber.questionNumber] = today;

                Console.WriteLine(scoreUpNumber.questionNumber);
            }
        }

        private static Dictionary<long, long> GetAll(long today, Dictionary<long, long> lastDictionary, IReadOnlyDictionary<long, long> scoreDownCoefficients)
        {
            return Enumerable.Range(1, 26).Select(x =>
                {
                    lastDictionary.TryGetValue(x, out var lastHeld);
                    return (QuestionNumber: (long)x, DownScore: (today - lastHeld) * scoreDownCoefficients[x]);
                })
                .ToDictionary(x => x.QuestionNumber, x => x.DownScore);
        }
    }
}


Measured memory_bytes: 30160
#include<iostream>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<unordered_map>

using namespace std;

#define rep(i,m,n) for(int (i)=(int)(m);(i)<(int)(n);(i)++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;(i)>=(int)(m);(i)--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9+7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;


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

struct Edge {
	int to, cap, rev;
	Edge(int _to, int _cap, int _rev) {
		to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, int from, int to, int cap, bool revFlag, int revCap) {
	G[from].push_back(Edge(to, cap, G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, G[from].size() - 1));
}

void solve() {
	ll n;
	cin >> n;
	if (n == 3) {
		cout << "2 5 63" << en;
		return;
	}

	cout << "2 3 4 9 ";
	n -= 4;

	ll k = 6;
	while (n >= 2 && k + 4<=30000) {
		cout << k + 2 << " " << k + 4<<" ";
		k += 6;
		n -= 2;
	}

	k = 15;
	while (n >= 2 && k+6 <= 30000) {
		cout << k << " " << k + 6 << " ";
		k += 12;
		n -= 2;
	}

	k = 6;
	while (n > 0) {
		cout << k<<" ";
		k += 6;
		n--;
	}
	cout << en;
}

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

	solve();
	//int t; cin >> t; REP(i, t) solve();

	return 0;
}


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

// THINK: INT vs LONG LONG?

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

	int n; cin >> n;
	vector<int> a(n), b(n);
	for (int i = 0; i < n; ++i)
		cin >> a[i];
	for (int i = 0; i < n; ++i)
		cin >> b[i];
	reverse(b.begin(), b.end());

	int start = -1, fin = -1;
	for (int i = 0; i < n; ++i) {
		if (a[i] == b[i]) {
			if (start == -1) start = i;
			fin = i;
		}
	}
	if (start != -1) {
		for (int i = start; i <= fin; ++i) {
			assert(b[i] == a[i]);
		}
	}
	bool bad = 0;
	if (start != -1) {
		int j = start;
		for (int i = 0; j <= fin; ++i) {
			if (i == start) i = fin + 1;
			if (i >= n) {
				bad = 1;
				break;
			}
			if (a[i] != b[j] && b[j] != b[i]) {
				swap(b[i], b[j]);
				j++;
			}
		}
	}
	for (int i = 0; i < n; ++i) {
		if (a[i] == b[i]) bad = 1;
	}
	if (bad) {
		cout << "No" << '\n';
	} 
	else {
		cout << "Yes" << '\n';
		for (int i = 0; i < n; ++i) {
			if (i) cout << " ";
			cout << b[i];
		}
		cout << '\n';
	}

	return 0;
}

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

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

#define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout<<e<<" ";}cout<<endl;
#define debugm(m) printf("L%d %s is..\n",__LINE__,#m);for(auto v:m){for(auto e:v){cout<<e<<" ";}cout<<endl;}
#define debuga(m,w) printf("L%d %s is => ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<<endl;
#define debugaa(m,w,h) printf("L%d %s is..\n",__LINE__,#m);for(int y=0;y<(h);y++){for(int x=0;x<(w);x++){cout<<(m)[x][y]<<" ";}cout<<endl;}
#define debugaar(m,w,h) printf("L%d %s is..\n",__LINE__,#m);for(int y=0;y<(h);y++){for(int x=0;x<(w);x++){cout<<(m)[y][x]<<" ";}cout<<endl;}
#define ALL(v) (v).begin(),(v).end()
#define BIGINT 0x7FFFFFFF
#define E107 1000000007ll
void printbit(int u){if(u==0)cout<<0;else{int s=0,k=0;for(;0<u;u>>=1,k++)s=(s<<1)|(u&1);for(;0<k--;s>>=1)cout<<(s&1);}}

#define TIME chrono::system_clock::now()
#define MILLISEC(t) (chrono::duration_cast<chrono::milliseconds>(t).count())

namespace{
    std::chrono::system_clock::time_point t;
    void tic(){t=TIME;}
    void toc(){fprintf(stderr,"TIME : %lldms\n",MILLISEC(TIME-t));}
}

template<typename T1,typename T2>
ostream& operator <<(ostream &o,const pair<T1,T2> p){o<<"("<<p.first<<":"<<p.second<<")";return o;}

int width,height;
int m,n;

int main(){
    int i,j,k;
    int x,y,a,b;
    
    a=b=0;
    cin >> n;
    for (i=0;i<n;++i){
        scanf("%d",&x);
        if (x&1){
            a++;
        }else{
            b++;
        }
    }
    
    if (a&1){
        cout << "NO" << endl;
    }else{
        cout << "YES" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
<?php
    while ($line = fgets(STDIN)) {
   $array[] = trim($line);
    }

    $cnt = strlen($array[0]);
    $ans = 0;
    
    for($i=0;$i<$cnt;$i++){
        if($array[0][$i] != $array[1][$i] ){
            $ans++;
        }
    }
    
    echo($ans);
?>


Measured memory_bytes: 16916
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>

using namespace std;

int main() {
  int w,a,b;
  cin >> w >> a >> b;
  
  if(a+w < b) cout << b-a-w << endl;
  else if(b+w < a) cout << a-b-w << endl;
  else cout << 0 << endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans = 0;
ll n;
void f (string s);
string s357 = "357";
int main (){
	cin >> n;
	f("0");
	cout<<ans<<endl;
	return 0;
}
void f (string s){
	ll num = atol(s.c_str());
	if(n<num)
		return;
	int check[3]={0};
	for(int i=0;i<s.size();i++){
		if(s[i]=='3')
			check[0]=1;
		if(s[i]=='5')
			check[1]=1;
		if(s[i]=='7')
			check[2]=1;
	}
	if(check[0]&&check[1]&&check[2])
		ans++;
		//cout<<s<<endl;
	for(int i=0;i<3;i++){
		f(s+s357[i]);
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iomanip>
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#define rep(i,x) for(ll i = 0;i<x;i++)
#define all(a) (a).begin(),(a).end()
#define vecin(a) rep(i,a.size())cin >> a[i]
#define vecout(a) rep(i,a.size()){cout << a[i];cout << (i == a.size() - 1 ? "\n":" ");}
#define mp make_pair
using ll = long long;
using ld = long double;
using namespace std;
using dou = double;
const ll inf = 2147483647;
const ll INF = 1LL << 60;
const dou pi = 3.14159265358;
const ll mod = 1000000007LL;
typedef pair<ll,ll> P;
using graph = vector<vector<ll>>;
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;}
template<class T> inline bool change(T a,T b){if(a > b){swap(a,b);return true;}return false;}
ll gcd(ll a,ll b){
    if(a < b)swap(a,b);
    if(a % b == 0)return b;
    else return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    return a / gcd(a,b) * b;
}

//素数判定O(sqrt(N))
bool isp(ll n){
    bool res = true;
    if(n == 1)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}
const ll cmax = 1000000;
ll fac[cmax], finv[cmax], inv[cmax];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < cmax; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}

// 二項係数計算
ll nCk(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
//nのm乗をMODで割ったあまりO(logN)
ll modpow(ll n,ll m,ll MOD){
    ll res = 1;
    while(m){
        if(m & 1)res = (res * n) % MOD;
        m >>= 1;
        n *= n;
        n %= MOD;
    }
    return res;
}

//printf("%.10f\n", N);
/*  vector<ll> vec = {1,2,5,6,8,9,10};
    cout << binary_search(all(vec),5) << endl; -> true*/
/*
    vector<ll> vec = {1,2,5,6,8,9,10};
    auto n = upper_bound(all(vec),4);
    cout << *n << endl; -> 5*/

//    cout << fixed << setprecision(15);

typedef pair<string,P> pii;
typedef pair<ll,pair<string,ll>> piii;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N;
    cin >> N;
    vector<pii> vec(N);
    string S;ll M;
    rep(i,N){
        cin >> S >> M;
        vec[i] = mp(S,P(-M,i));
    }
    sort(all(vec));
    /*rep(i,N){
        cout <<  vec[i].first << " " << vec[i].second.first << " " << vec[i].second.second << "\n";
    }*/
    rep(i,N){
        cout << vec[i].second.second + 1 << "\n";
    }
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
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;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
    int N; cin >> N;
    vecl A(N); REP(i,N) cin >> A[i];
    ll kabu = 0;
    ll cur = 1000;
    REP(i,N-1) {
        kabu = 0;
        if(A[i] < A[i+1]) {
            kabu = cur/A[i];
        }
        cur += (A[i+1]-A[i])*kabu;
    }
    cout << cur << endl;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,r ;
  cin >> a>> b;
  r = a*b % 2;
  if (r == 1) {
    cout << "Odd" << endl;
  }
  else  {
    cout << "Even" << endl;
  }
}

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

int main() {
	
	int n;
	cin >> n;
	
	int ans = n;
	for(int i = 0; i <= n; i += 6){
		int cnt = 0;
		int t = i;
		while(t > 0){
			cnt += t % 6;
			t /= 6;
		}
		t = n - i;
		while(t > 0){
			cnt += t % 9;
			t /= 9;
		}
		if(ans > cnt) ans = cnt;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
 
# define PI 3.141592653589793
 
int main(void){
    double x=0,y=0;
    double a,rad=0,deg=0;
 
    while(1){
        scanf("%lf,%lf",&a,&deg);
        if(a==0 && deg==0)break;
        x+=a*sin(rad);
        y+=a*cos(rad);
        rad+=deg*PI/180;
    }
    printf("%d\n%d\n",(int)x,(int)y);
    return 0;
}



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

int main(){
    int n,k;cin>>n>>k;
    string s;cin >>s;

vector<int> v;
v.push_back(1);
int le = s.length();
for(int i=1;i<le;i++){
    if(s[i]!=s[i-1]) v.push_back(1);
    else v[v.size()-1]+=1;
}
if(2*k<v.size()) cout << le-v.size()+2*k;
else cout << le-1;
}

Measured memory_bytes: 4088
#include<bits/stdc++.h>
using namespace std;
 
int main(){
	int a,b;
	cin>>a>>b;

	if(a+b==15)
		cout<<'+'<<endl;
	else if(a*b==15)
		cout<<'*'<<endl;
	else
		cout<<'x'<<endl;
}

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

int cnt;
#define Q(i) if(cnt>=20)return 0;query(i);if(seat[i]==V)return 0;
#define U 0
#define M 1
#define F 2
#define V 3

int seat[100000];

void query(int i){
    if(seat[i]==U){
        cout << i << endl;
        string s;
        cin >> s;
        cnt++;
        if(s=="Male") seat[i]=M;
        else if(s=="Female") seat[i]=F;
        else seat[i]=V;
    }
}

int main(){
    int N;
    cin >> N;
    for(int i=0;i<=N;i++) seat[i]==U;

    int min=0,max=N-1;

    string s;
    while(true){
        int mid=(min+max)/2;
        Q(min);
        Q(mid);
        Q(max);
        if((seat[min]==seat[mid] && (mid-min)%2==1)||(seat[min]!=seat[mid] && (mid-min)%2==0)){
            max=mid;
        }else{
            min=mid;
        }        
    }

    return 0;
}

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

int main(){
    int a, b, x;
    cin >> a >> b >> x;
    double res;
    if(2*x <= a*a*b){
        res = atan((double)(2*x)/(a*b*b));
        res = M_PI/2 - res;
    }else{
        res = atan((double)(2*b)/a - (double)(2*x)/(a*a*a));
    }
    res = (res/M_PI)*180;
    printf("%.6f\n", res);
    return 0;
}

Measured memory_bytes: 256
//的場梨沙★担当
//結城晴★副担当
//日野茜★副担当
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string.h>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <cctype>
#include <complex>
#include <regex>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <stdio.h>


using namespace std;

int main(void) {
    int N;
    cin>>N;
    int sum=0;
    int Lmax=0;
    for(int i=0;i<N;i++){
        int L;
        cin>>L;
        sum+=L;
        Lmax=max(Lmax,L);
    }
    if(Lmax<sum-Lmax){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef vector<pll> vll;
typedef vector<vl> vvl;

#define fori(i, n) for (int i = 0; i < n; i++)
#define ford(i, n) for (int i = n - 1; i >= 0; i--)
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define repd(i, a, b) for (int i = a; i >= b; i--)
#define trav(x, a) for (auto &x : a)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
#define endl '\n'
#define sz(a) (int)(a).size()
#define fi first
#define se second

clock_t time_p = clock();
void time_taken()
{
    time_p = clock() - time_p;
    cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}

const ll mod = 1e9 + 7;
const ll INF = 1e18;

int main()
{
    ios_base::sync_with_stdio(false), cin.tie(nullptr);

    int k;
    cin >> k;
    ll rem = 0;
    fori(i,k+100){
        rem = rem * 10 + 7;
        rem %= k;
        if(rem == 0){
            cout << i + 1 << endl;
            return 0;
        }
    }
    cout << -1 << endl;

    time_taken();
    return 0;
}

Measured memory_bytes: 3788
while True:
    wh = [int(i) for i in input().split()]
    if wh[0] == 0 and wh[1] == 0:
        break
    
    for i in range(wh[0]):
        for j in range(wh[1]):
            if j == wh[1] - 1:
                print("#")
                break
            print("#", end="")
    print("")


Measured memory_bytes: 7052
#include<bits/stdc++.h>
using namespace std;
#define l long long
int main()
{
  l a,b;
  cin>>a>>b;
  l ans=a*b;
  if(a==1||b==1)
    cout<<1<<endl;
  else if(ans%2==1)
  {
    cout<<ans/2+1<<endl;
  }
  else
    cout<<ans/2<<endl;
}

Measured memory_bytes: 256
#!/usr/bin/env/ python3
#S = input()
#N = int(input())
#A, B, C = input().split()
A, B, C, X, Y = map(int, input().split())

#N = int(input())
#H, W = map(int, input().split())
#S = [input() for _ in range(H)]
#print(A[0][0])

easy = A * X + B * Y
maxnum = max(X, Y) * 2
for i in range(maxnum, 1, -2):
    tmp = 0
    if (i == maxnum): tmp = C * i
    elif (X - (i / 2) > 0 and Y - (i / 2) > 0): tmp = A * (X - (i / 2)) + B * (Y - (i / 2)) + C * i
    elif (X - (i / 2) > 0): tmp = A * (X - (i / 2)) + C * i
    elif (Y - (i / 2) > 0): tmp = B * (Y - (i / 2)) + C * i
    if (tmp < easy): easy = tmp
print(int(easy))

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

class Main {

    public static void main( final String[] args ) {

		final Scanner stdin = new Scanner( System.in );

		while ( true ) {

			int n = stdin.nextInt();
			int k = stdin.nextInt();
			int m = stdin.nextInt();
			if ( n == 0 && k == 0 && m == 0 ) break;

			ArrayList<Integer> lst = new ArrayList<Integer>();
			for ( int i = 1; i <= n; i++ ) {
				lst.add( i );
			}
			int index = m - 1;
			for ( int i = 0; i < n - 1; i++ ) {
				lst.remove( lst.get( index-- ) );
				index = ( index + k ) % lst.size();
			}
			System.out.println( lst.get( 0 ) );
		}	
    }    
}

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

using namespace std;

int main() {
  long long a, c;
  float b;
  cin >> a >> b;
  b *= 100;
  b = round(b);
  c = (long long)b;
  a = a*c;
  a = a/100;
  cout << a << endl;
  return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<ll> v(n,0);
  int a[n];
  rep(i,n) {
    cin >> a[i];
    a[i]--;
    v[a[i]]++;
  }
  ll ans = 0;
  rep(i,n) ans += v[i]*(v[i]-1)/2;
  vector<ll> c(n);
  rep(i,n) {
    if(v[a[i]] >= 2) c[i] = ans - v[a[i]]*(v[a[i]]-1)/2 + (v[a[i]]-1)*(v[a[i]]-2)/2;
    else c[i] = ans;
  }
  for(auto k : c) cout << k << endl;
  return 0;
}


Measured memory_bytes: 6528
import sys

l = raw_input().split()
A = int(l[0])
B = int(l[1])

sum = 0
if A % 2 == 1:
    sum = A

if A % 2 == 1 and B % 2 == 1:
    ones = int((B - A)/2)
elif A % 2 == 1 and B % 2 == 0:
    ones = int((B - A)/2)
elif A % 2 == 0 and B % 2 == 1:
    ones = int((B - A + 1)/2)
else:
    ones = int((B - A)/2)

if B % 2 == 1:
    sum ^= (ones % 2)
else:
    sum ^= (B ^ (ones % 2))

print(sum)


Measured memory_bytes: 2568
#include <bits/stdc++.h>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
using namespace std;

typedef long long ll;

int n, a[202020], cnt;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(nullptr);
    cin >> n;
    for(int i=1; i<=n; i++){
        char c; cin >> c; a[i] = c == 'R';
        cnt += a[i];
    }
    int ans = 0;
    for(int i=1; i<=cnt; i++) ans += !a[i];
    cout << ans;
}

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

int main(int argc, char const *argv[])
{
	int n;
	cin>>n;
	set<int> a;
	int b;
	for (int i = 0; i < n; ++i)
	{
		cin>>b;
		a.insert(b);
	}
	if (n==a.size())
	{
		cout<<"YES\n";
	}
	else
	{
		cout<<"NO\n";
	}
	return 0;
}


Measured memory_bytes: 9728
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double bunsi=0;

        for (int i = 0; i < n; i++) {
            double x = sc.nextDouble();
            bunsi += 1/x;
        }

        System.out.println(1/bunsi);
    }
}

Measured memory_bytes: 22740
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF (1 << 30 - 1)
#define LLINF (1LL << 60)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> S;
    N = S.size();
    string f = S.substr(0, (N - 1) / 2);
    string e = S.substr((N + 3) / 2 - 1, N);
    string rf = f;
    string re = e;
    string rS = S;
    reverse(ALL(rf));
    reverse(ALL(re));
    reverse(ALL(rS));
    if (f == rf && e == re && S == rS) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
X, Y = map(int, input().split())
money = 0

if X == 1:
    money += 300000
elif X == 2:
    money += 200000
elif X == 3:
    money += 100000   

if Y == 1:
    money += 300000
elif Y == 2:
    money += 200000
elif Y == 3:
    money += 100000   

if X == Y == 1:
    money += 400000

print(money)

Measured memory_bytes: 3188
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iomanip>
#include <vector>
#include <cstdio>
#include <float.h>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <stack>
#include <functional>
 
using namespace std;
 
#define endl '\n'
#define MOD 1000000007
#define INF 1ll<<30
#define MAX 100010
#define eps 1e-11
#define bit_max 1ll<<32
#define _USE_MATH_DEFINES
 

 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   // freopen("./input.txt","r",stdin);
  //  freopen("./output.txt","w",stdout);
    int n;
    cin>>n;

    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    long long int ans =0;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            ans=ans+(a[i]*a[j]);
        }
    }
    cout<<ans;
}

Measured memory_bytes: 256
using namespace std;
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops")
#include<iostream>
#include<algorithm>
#include<ctime>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<cfloat>
#include<functional>
#include<tuple>
#include<math.h>
#include<bitset>
#include<stack>
#include<set>
#include<random>
#include<stdlib.h>
#define rip(i,n) for(ll i=0;i<n;i++)
#define Rip(i,n) for(ll i=1;i<n;i++)
#define all(V) V.begin(),V.end()
#define ll long long
#define ld long double
#define MOD 998244353
#define mod MOD
#define sec setprecision
constexpr double eps = 1e-9;
constexpr double PI = 3.141592653589793238462643383279;
ll gcd(ll a, ll b) {
	if (a % b == 0)	return(b);
	else return(gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
int ketasuu(ll h) {
	if (h < 0)return(-(ketasuu(-h)));
	else if (h < 10)return(1);
	else return(1 + ketasuu(h / 10));
}
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
void cominit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (ll i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}
vector<ll> soinnsuubunnkai(ll n) {
	vector<ll>a;
	while (n % 2 == 0) {
		a.push_back(2);
		n /= 2;
	}
	ll f = 3;
	while (f * f <= n) {
		if (n % f == 0) {
			a.push_back(f);
			n /= f;
		}
		else f += 2;
	}
	if (n != 1)
		a.push_back(n);
	return(a);
}
// 二項係数計算
long long com(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
ll pow(ll a, ll b) {
	a = a % mod;
	if (b == 0)return(1);
	else if (b % 2 == 0)return(pow((a * a) % mod, b / 2));
	else return(a * (pow(a, b - 1)));
}
void solve() {
	int n;
	cin >> n;
	cout << n * n * n << endl;
}
int main() {
	solve();
}

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


typedef long long ll;

using namespace std;

int main()
{ll N; cin >> N;
 ll r;
 
 ll total = 0;
 if( N >= 2){
 ll c = (ll)( sqrt((double) N + 1)  - 1);
 
for(ll r = 1; r <= c; r++){
  if( N % r == 0){ total += ( N / r ) - 1;}}
 
 cout << total;}
 else if( N == 1){cout << 0;}
 
 return 0;
}


Measured memory_bytes: 256
#include <stdio.h>  
int main(){
	int c[10][10],a,h,w,i,j,d[10]={0},k,s=0;
	scanf("%d%d",&h,&w);
	for(i=0;i<10;i++)
	for(j=0;j<10;j++){
	scanf("%d",&c[i][j]);
}
	for(i=1;i<=h;i++)for(j=1;j<=w;j++){
	scanf("%d",&a);
	if(a>=0)d[a]++;
	}
  for(k=0;k<10;k++)
  	for(i=0;i<10;i++)
  	for(j=0;j<10;j++)
  	 if(c[i][j]>c[i][k]+c[k][j])c[i][j]=c[i][k]+c[k][j];
  	 for(i=0;i<10;i++){
  	 	if(d[i])s+=d[i]*c[i][1];
	   }
	   printf("%d",s);
	   return 0;
  	 
  }

Measured memory_bytes: 128
import sys
n,k=map(int,input().split())
d=list(input().split())

for i in range(n,100000):
    f=0
    for j in d:
        if str(i).find(j) >= 0:
            break
        else:
            f+=1
    if f == k:
        print(i)
        sys.exit()



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

public class Main {

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

		Dice dice = new Dice();

		for (int i = 0; i < 6; i++) {
			dice.dc[i] = Integer.parseInt(sc.next());
		}

		for (int i = 0; i < 6; i++) {
			dice.dc2[i] = Integer.parseInt(sc.next());
		}
		dice.check();
	}

}

class Dice {
	public int[] dc = new int[6];
	public int[] dc2 = new int[6];
	private int temp = 0;

	void north() {
		temp = dc[0];
		dc[0] = dc[1];
		dc[1] = dc[5];
		dc[5] = dc[4];
		dc[4] = temp;
	}

	void south() {
		temp = dc[0];
		dc[0] = dc[4];
		dc[4] = dc[5];
		dc[5] = dc[1];
		dc[1] = temp;
	}

	void west() {
		temp = dc[0];
		dc[0] = dc[2];
		dc[2] = dc[5];
		dc[5] = dc[3];
		dc[3] = temp;
	}

	void east() {
		temp = dc[0];
		dc[0] = dc[3];
		dc[3] = dc[5];
		dc[5] = dc[2];
		dc[2] = temp;
	}

	void right() {
		temp = dc[1];
		dc[1] = dc[2];
		dc[2] = dc[4];
		dc[4] = dc[3];
		dc[3] = temp;
	}

	void check() {
		for (int i = 0; i <= 3; i++) {
			if (checkAll()) {
				break;
			}
			north();
			for (int j = 0; j <= 3; j++) {
				if (checkAll()) {
					break;
				}
				right();
			}
		}
		for (int j = 0; j <= 3; j++) {
			if (checkAll()) {
				break;
			}
			west();
			for (int i = 0; i <= 3; i++) {
				if (checkAll()) {
					break;
				}
				right();
			}
		}
		if (Arrays.equals(dc, dc2)) {
			System.out.println("Yes");
		} else
			System.out.println("No");
	}

	boolean checkAll() {
		if (dc[0] == dc2[0] && dc[1] == dc2[1] && dc[2] == dc2[2] &&
				dc[3] == dc2[3] && dc[4] == dc2[4] && dc[5] == dc2[5]) {
			return true;
		}
		return false;
	}
}


Measured memory_bytes: 26264
a,b,c=map(int,input().split())
k=int(input())
if a<b:
    if b<c:
        print('Yes')
    else:
        count=0
        while b>=c:
            c*=2
            count+=1
        if count<=k:
            print('Yes')
        else:
            print('No')
else:
    count=0
    while a>=b:
        b*=2
        count+=1
    while b>=c:
        c*=2
        count+=1
    if count<=k:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 61852
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
using ll = long long;
using V = vector<int>;
using VV = vector<vector<int>>;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    map<string, int> mp;
    rep(i, n)
    {
        string s;
        cin >> s;
        mp[s]++;
    }
    int m;
    cin >> m;
    rep(i, m)
    {
        string s;
        cin >> s;
        mp[s]--;
    }
    int ans = 0;
    for (auto p : mp)
    {
        ans = max(ans, p.second);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3608