akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;

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

    map<char, vector<int> > d;

    for(int i = 0; i < str.length(); i++) {
        d[str[i]].push_back(i);
    }

    for(auto itr = d.begin(); itr != d.end(); ++itr) {
        vector<string> s;
        for(int x : d[itr->first]) {
            for(int i = x; i < min(x + 5, (int)str.length()); i++) {
                string substr = str.substr(x, i - x + 1);
                if(find(s.begin(), s.end(), substr) == s.end()) {
                    auto it = lower_bound(s.begin(), s.end(), substr, less<string>());
                    s.insert(it, substr);
                }
            }
        }
        if(s.size() >= n) {
            cout << s[n - 1];
            return 0;
        } else {
            n -= s.size();
        }
    }
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

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 <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);
    int N,M; cin >>N>>M;
    VI AC(N),PE(N);
    int ac = 0, pe = 0;
    REP(i,M){
        int p; 
        string S;
        cin >> p >> S;
        p--;
        if(S == "AC"){
            if(AC[p] == 1){

            }else{
                ac++;
                AC[p] = 1;
            }
        }else{
            if(AC[p] == 1){

            }else{
                PE[p]++;
            }
        }
    }
    REP(i,N){
        if(AC[i] == 1){
            pe += PE[i];
        }
    }
    cout << ac << " " << pe << endl;
}


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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H,W;
 vector<string> canvus(52);
 cin >> H >> W;
 int i,j;
 for(i=1;i<=H;i++){
canvus.at(i)='.';
string k;
 cin >> k;
canvus.at(i)+=k+'.';
 }
canvus.at(0)="";
canvus.at(H+1)="";
for(i=0;i<=H+1;i+=H+1){
for(j=0;j<=W+1;j++){
canvus.at(i)+='.';
}
}

bool flag=true;
i=1;
j=1;
while(i<=H&&flag){
j=1;
while(j<=W&&flag){
   if(canvus.at(i).at(j)=='#'){
       if(canvus.at(i+1).at(j)=='.'
        &&canvus.at(i-1).at(j)=='.'
        &&canvus.at(i).at(j+1)=='.'
        &&canvus.at(i).at(j-1)=='.'){
       flag=false;
      }
   }
j++;
}
i++;
}

if(flag){
cout << "Yes" << endl; 
}else{
cout << "No" << endl; 
}


}

Measured memory_bytes: 256
/* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0502 */

import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	private static final int TOP=0, SOUTH=1, EAST=2, WEST=3, NORTH=4, BOTTOM=5;

	//North
	private static void moveNorth(int[] dice){
		int tmpTop = dice[TOP];
		dice[TOP]    = dice[SOUTH];
		dice[SOUTH]  = dice[BOTTOM];
		dice[BOTTOM] = dice[NORTH];
		dice[NORTH]  = tmpTop;
	}

	//South
	private static void moveSouth(int[] dice){
		for(int i=0;i<3;i++){ moveNorth(dice); }
	}
	
	//Right
	private static void moveRight(int[] dice){
		int tmpNorth = dice[NORTH];
		dice[NORTH] = dice[WEST];
		dice[WEST] = dice[SOUTH];
		dice[SOUTH] = dice[EAST];
		dice[EAST] = tmpNorth;
	}

	//Left
	private static void moveLeft(int[] dice){
		for(int i=0;i<3;i++){ moveRight(dice); }
	}

	//East
	private static void moveEast(int[] dice){
		moveLeft(dice);
		moveNorth(dice);
		moveRight(dice);
	}
	
	//West
	private static void moveWest(int[] dice){
		moveRight(dice);
		moveNorth(dice);
		moveLeft(dice);
	}	
	
	public static void main (String[] args){
		try{
			Scanner s = new Scanner(System.in);
			
			while(true){
				int n = s.nextInt();
				if(n==0){ break; }
				
				int[] dice = {1,2,3,4,5,6};

				int ans = 1;
				for(int i=0;i<n;i++){
					String op = s.next();
					
					if(op.equals("North")) moveNorth(dice);
					else if(op.equals("South")) moveSouth(dice);
					else if(op.equals("West")) moveWest(dice);
					else if(op.equals("East")) moveEast(dice);
					else if(op.equals("Right")) moveRight(dice);
					else if(op.equals("Left")) moveLeft(dice);
					
					ans += dice[TOP];
				}
				System.out.println(ans);
			}
		}catch(Exception e){
			e.printStackTrace(System.out);
		}
	}
}

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

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = Integer.parseInt(scan.next());
		int[] L = new int[N];
		for (int i = 0; i < N; i++) {
			L[i] = Integer.parseInt(scan.next());
		}
		Arrays.sort(L);
		int sum = 0;
		for (int i = 0; i < N - 1; i++) {
			sum += L[i];
		}
		if (sum > L[N - 1]) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 23252
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<time.h>
#include<string>
#include<stack>
#include<cmath>
#include<map>
#include<set>
#define ll long long
//#define double long double
using namespace std;
#define PI  3.1415926535898 
#define eqs 1e-6
const long long max_ = 2e5 + 7;
const int mod = 1e9 + 7;
const int inf = 1e9;
const long long INF = 1e18;
int read() {
	int s = 0, f = 1;
	char ch = getchar();
	while (ch<'0' || ch>'9') {
		if (ch == '-')
			f = -1;
		ch = getchar();
	}
	while (ch >= '0'&&ch <= '9') {
		s = s * 10 + ch - '0';
		ch = getchar();
	}
	return s * f;
}
int min(int a, int b) {
	return a < b ? a : b;
}
int max(int a, int b) {
	return a > b ? a : b;
}
map<string, int>mp;
int n,nn;
struct kk {
	string chuan;
	int num;
}node[max_];
bool cmp(const kk & t1, const kk & t2) {
	if (t1.num == t2.num) {
		return t1.chuan < t2.chuan;
	}
	return t1.num > t2.num;
}
int main() {
	std::ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> node[++nn].chuan;
		if (mp[node[nn].chuan]) {
			mp[node[nn].chuan]++;
			nn--;
		}else mp[node[nn].chuan]++;
	}
	for (int i = 1; i <= nn; i++) {
		node[i].num = mp[node[i].chuan];
	}
	sort(node + 1, node + 1 + nn, cmp);
	node[0].num = node[1].num;
	for (int i = 1; i <= nn; i++) {
		if(node[i].num==node[i-1].num)
		cout << node[i].chuan << endl;
		else break;
	}
	return 0;
}

Measured memory_bytes: 27904
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    h,w = LI()
    a = [[c == '#' for c in S()] for _ in range(h)]
    r = ['#' * w]
    for c in a[1:-1]:
        t = ''
        for i in range(w):
            ci = c[i]
            if ci or i % 2 == 0:
                t += '#'
            else:
                t += '.'
        r.append(t)
    r.append('.' * w)
    r.append('')
    r.append('.' * w)
    for c in a[1:-1]:
        t = ''
        for i in range(w):
            ci = c[i]
            if ci or i % 2 == 1:
                t += '#'
            else:
                t += '.'
        r.append(t)

    r.append('#' * w)

    return '\n'.join(r)


print(main())






Measured memory_bytes: 8752
/*      ex3_3
        Tarara  */
#include <stdio.h>

int main(void)
{
    int number; //整数
    int base;   //進数

    scanf("%d %d", &number, &base);

    int digits = 1; //出力する桁数
    while (number >= base)
    {
        number /= base;
        digits++;
    }
    printf("%d\n", digits);
}

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

int main() {
  int N;
  cin >> N;
  vector<string> vecS(N);
  for (int i=0; i<N; i++){
    cin >> vecS.at(i);
  }
  
  int M;
  cin >> M;
  vector<string> vecT(M);
  for (int i=0; i<M; i++){
    cin >> vecT.at(i);
  }
  
  int MAX=-1000;
  
  for (int i=0; i<N; i++){
    int A=0, B=0;
    
    for (int j=0; j<N; j++){
      if (vecS.at(i) == vecS.at(j)){
        A++;
      }
    }
    
    for (int j=0; j<M; j++){
      if (vecS.at(i) == vecT.at(j)){
        B++;
      }
    }
    
    if (MAX <= A-B){
      MAX = A-B;
    }
  }
  
  if (MAX > 0){
    cout << MAX << endl;
  }
  else{
    cout << 0 << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>

#define STARTUP {(cin.tie(0));\
 (ios::sync_with_stdio(false));}

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).size()
#define MAX(list) std::max(list)
#define MIN(list) std::min(list)
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())
#define VECCIN(vec) const int size = (vec).size(); REP(i,size) cin>>(vec)[i];

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
std::istream& operator>>(std::istream& is, std::pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

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

using ll = long long;
using namespace std;
ll mod = 1'000'000'007;

const int INF = 1'050'000'000;

int main() {
    STARTUP;

    int A, B;
    cin >> A >> B;
    YESNO(A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0, "Possible", "Impossible");
    return 0;
}

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

int main() {
    ll A,B,K;
    cin >> A >> B >> K;
    if(A-K >=0) {
        cout << A-K << " " << B << endl;
    }else if (B+(A-K) >=0){
        cout << 0 << " " << B+(A-K) << endl;
    }else {
        cout << 0 << " " << 0 << endl;
    }

}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF = 2e9;
#define LINF = 1e18;
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << = << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO")
#define Yes(n) cout << ((n) ? "Yes" : "No")

void input(vector<int> x, auto n){
   rep(i,n)cin >> x[i];
}

int main(){

   int x,y,z;
   cin >> x >> y >> z;

   cout << z << " " << x << " " << y << endl; 

}

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

int main(void) {
	int n, m;
	cin >> n >> m;
	int maxL = 1;
	int minR = 1e9;
	for (int i = 0; i < m; i++) {
		int L, R;
		cin >> L >> R;
		maxL = max(maxL, L);
		minR = min(minR, R);
	}
	int ans = minR - maxL + 1;
	ans = max(0, ans);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
/*
   Created by Rahul Goel.
*/
/*******************************************************************************/
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
/*******************************************************************************/
using namespace std;
using ll = long long;
using ld = long double;
ll mod = 1000000007;
const int INF = 1e9;
const ll LINF = 1e18;
/*******************************************************************************/
/*
.-.. . -. -.- .- / .. ... / .-.. --- ...- . -.-.--
 */
/* For PBDS */
/*Two new methods X.order_of_key() and X.find_by_order()*/
/*
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/

/*******************************************************************************/
ll mod_sum() { return 0LL; }
template<typename T, typename... Args>
T mod_sum(T a, Args... args) { return ((a + mod_sum(args...))%mod + mod)%mod; }

ll mod_prod() { return 1LL; }
template<typename T, typename... Args>
T mod_prod(T a, Args... args) { return (a*mod_prod(args...))%mod; }
/*******************************************************************************/
using pii = pair < ll, ll >;
using vi = vector < ll >;
using vb = vector < bool >;
using vvi = vector < vector < ll > >;
using vvb = vector < vector < bool > >;
using vpii = vector < pii >;
using vvpii = vector < vector < pii > >;
#ifdef ONLINE_JUDGE
#define endl '\n'
#endif
#define fastio          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(c)          (c).begin(), (c).end()
#define present(c,x)    ((c).find(x) != (c).end())
#define cpresent(c,x)   (find(all(c),x) != (c).end())
#define uniq(c)         (c).resize(distance((c).begin(), unique(all(c))))
#define min_pq(t)       priority_queue < t, vector < t >, greater < t > >
#define max_pq(t)       priority_queue < t >
#define pb              push_back
#define ff              first
#define ss              second
/*******************************************************************************/

/*
    Code begins after this.
*/


ll solve(){
    ll n;
    cin >> n;
    cout << n + n*n + n*n*n << endl;
    return 0;
}


signed main(){
    fastio;

    ll t = 1;
    while(t--)
        solve();

    return 0;
}

/*******************************************************************************/
// Remeber - In a custom comparator cmp(a, b) a==b must always return to false.



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

#define ALL(a) (a).begin(), (a).end()
#define ll long long

using namespace std;

signed main(){
    int a,b;
    cin >> a >> b;
    if(a+b == 15){
        cout << "+" << endl;
    }
    else if(a*b == 15){
        cout << "*" << endl;
    }
    else{
        cout << "x" << endl;
    }

    return 0;
}



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

public class Main {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int[] x = new int[3];
        for(int i = 0; i < 3; i++){
            x[i] = scn.nextInt();
        }
        Arrays.sort(x);
        System.out.println(x[0] + " "+ x[1] + " " + x[2]);
    }
}


Measured memory_bytes: 26296
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <string>
#include <vector>


static void A_Accepted();

int main()
{
	A_Accepted();

	fflush(stdout);
	return 0;
}


static void A_Accepted()
{
	const int szLen = 6;

	char szS[szLen + 1] = { 0 };
	scanf(" %s", szS);

	int acptCnt = 0;
	for (int i = 0; i < szLen; i++) {
		if (szS[i] == '1') {
			acptCnt++;
		}
	}
	printf("%d\n", acptCnt);
}


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

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

Measured memory_bytes: 256
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out


x10, N = map(int,input().split())
x2 = Base_10_to_n(x10, N)
print( len(x2) )

Measured memory_bytes: 3060
import sys
from heapq import heappush, heappop
def input(): return sys.stdin.readline().rstrip()
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(mi())

mod = 10 **9 + 7
def main():
    n = ii()
    s = []
    s.append(input())
    s.append(input())
    if s[0][0] == s[1][0]:
        ans = 3
    else:
        ans = 6

    for i in range(1,n):
        if s[0][i-1] == s[1][i-1]:
            ans  *= 2
            ans %= mod
        else:
            if s[0][i] != s[0][i-1] and s[1][i] != s[1][i-1] and s[0][i] != s[1][i]:
                ans *= 3
                ans %= mod
    print(ans)
            

            





if __name__ == '__main__':
    main()

Measured memory_bytes: 9196
function main(input) {
    const args = input.split(' ');
    const A = parseInt(args[0], 10);
    const B = parseInt(args[1], 10);
    const C = parseInt(args[2], 10);

    if(B+C <= A ){
        console.log(0);
    }else {
        console.log(B+C-A);
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


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

int main() {
  int N, K, a, x, y;
  cin >> N >> K;
  a = 1;
  for (int i = 0; i < N; i++) {
    x = a + K;
    y = a * 2;
    if (x < y)
      a = x;
    else
      a = y;
  }
  cout << a << endl;
}

Measured memory_bytes: 256
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
signed main(){
  string s;
  cin >> s;
  if(s.size()%2!=0){
    reverse(s.begin(),s.end());
  }
  cout << s<<endl;
}


Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10000000)
def main():
    N = int(readline())
    A = [int(i) for i in readline().split()]
    Ae = A[1::2]
    Ao = A[::2]
    x1 = (sum(Ao)-sum(Ae))//2
    table = [0]*(N+1)
    table[0] = x1
    for i in range(N):
        table[i+1] = A[i] - table[i]

    for i in table[:N]:
        print(i*2, end=' ')
if __name__ == '__main__':
    main()


Measured memory_bytes: 13656
import heapq

N, M = map(int, input().split())
xs = [None] * N
for i in range(N):
    xs[i] = list(map(int, input().split()))

def score(x, y, z):
    xt = []
    for a in xs:
        heapq.heappush(xt, -sum([a[0]*x, a[1]*y, a[2]*z]))
    s = 0
    for i in range(M):
        s -= heapq.heappop(xt)
    return s

ms = 0
for x in (1, -1):
    for y in (1, -1):
        for z in (1, -1):
            ms = max(ms, score(x, y, z))
print(ms)

Measured memory_bytes: 3416
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
using namespace std;
int main()
{
  string line;
  vector<pair<int,int>> v;
  int x,y;
  while (1)
  {
    getline (cin,line);
    stringstream(line) >> x >> y;
    if ( x == 0 && y == 0 ) break;
    if ( x > y )
    { v.push_back(pair<int,int>(y,x)); }
    else
    { v.push_back(pair<int,int>(x,y)); }
  }
  for ( auto a: v )
  { cout << a.first << ' ' << a.second << '\n'; }
  return 0;
}

Measured memory_bytes: 3172
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(s,i, n) for (int i = (int)s; i < (int)(n); i++)
#define pb push_back
typedef long long ll;
  
int main(){
    int a,b;
    cin>>a>>b;
    int p=1;
    int i=0;
    while(1+(a-1)*i<b){
        i++;
    }
    int ans=i;
    
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

#define sp(x) cout<<setprecision(x);
#define all(a) (a).begin(), (a).end()
#define inf 10000000
#define linf INT64_MAX*0.99
#define print(s) cout<<(s)<<endl
#define lint long long
#define FOR(i,a,b) for(lint i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define yes "Yes"
#define no "No"
#define divs 1000000007
#define dive 1000000009

typedef pair<int, int> P;
 
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s; cin>>s;
    REP(i,s.length()){
        s[i]='x';
    }
    print(s);
    return 0;
}

Measured memory_bytes: 256
n=int(input())
b=[int(i) for i in input().split()]
d=[int(i)+1 for i in range(n)]
t=n-1
ans=[]
while 1:
    f=1
    for i in range(t,-1,-1):
        if b[i]==d[i]:
            f=0
            ans.append(i+1)
            for j in range(i,n-1):
                b[j]=b[j+1]
            b[n-1]=0
            break
    if len(ans)==n:
        break
    if f:
        print(-1)
        exit()
for i in ans[::-1]:
    print(i)


Measured memory_bytes: 38768
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7


int main() {

	int A, B, T;
	scanf("%d%d%d", &A, &B, &T);

	int sum = 0;
	int ans = 0;
	for (int i = 0; i < 200; i++) {
		if ((A*i) > T) {
			sum = i-1;
			break;
		}

	}
	printf("%d", sum * B);











}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int n;
  cin >> n;
  if (n == 7 || n == 5 || n == 3) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

unsigned long gcd(const unsigned long& A, const unsigned long& B) {
  unsigned long a = (A<B)?B:A;
  unsigned long b = (A>B)?B:A;
  while (true) {
    if (a % b == 0) break;
    int t = a;
    a = b;
    b = t%b;
  }
  return A*B/b;
}
int main(int argc, char** argv) {
  unsigned long A, B;
  std::cin >> A >> B;
  std::cout << gcd(A, B) << '\n';
}


Measured memory_bytes: 256
// AOJ1054 Distorted Love

#include <iostream>
#include <vector>
#include <string>
#include <map>

using namespace std;

int main(){
	int n;
	int buf[1000000];
	string name[100];
	int b[100], x1[100][100], y1[100][100], x2[100][100], y2[100][100], ptr[100][100];
	string link[100][100];
	while(cin >> n, n){
		int x, y; cin >> x >> y;
		int cur = 0, size = 0; 
		buf[cur] = 0;
		for(int i=0;i<n;i++){
			cin >> name[i] >> b[i];
			for(int j=0;j<b[i];j++)
				cin >> x1[i][j] >> y1[i][j] >> x2[i][j] >> y2[i][j] >> link[i][j];
		}
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)
				for(int k=0;k<b[j];k++)
					if(link[j][k]==name[i]) ptr[j][k] = i;
		cin >> n;
		for(int i=0;i<n;i++){
			string s; cin >> s;
			if(s == "click"){
				cin >> x >> y;
				for(int j=0;j<b[buf[cur]];j++){
					if(x1[buf[cur]][j]<=x&&x<=x2[buf[cur]][j]&&y1[buf[cur]][j]<=y&&y<=y2[buf[cur]][j]){
						cur++;
						size = cur;
						buf[cur] = ptr[buf[cur-1]][j];
						break;
					}
				}
			}
			if(s == "forward" && cur != size) cur++;
			if(s == "back" && cur != 0) cur--;
			if(s == "show") cout << name[buf[cur]] << endl;
		}
	}
}

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

int main(){
    int H, W;
    std::cin >> H >> W;
    std::vector<std::vector<char>> pix(H, std::vector<char>(W));
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            std::cin >> pix[i][j];
        }
    }


    for(int i = 0; i < 2 * H; i++){
        for(int j = 0; j < W; j++){
            std::cout << pix[i / 2][j];
        }
        std::cout << std::endl;
    }


    return 0;
}


Measured memory_bytes: 256
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
#define dcml(n) fixed<<setprecision(n)
//CONST
//------------------------------------------
const ll INF=1010000000000000017LL;
const ll MOD=1000000007LL;
const ld EPS=1e-12;
const ld PI=3.14159265358979323846;
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define  FORS(i,m,n) for(ll (i)=(m);   (i)<=(n); (i)++)
#define  RFOR(i,m,n) for(ll (i)=(n)-1; (i)>=(n); (i)--)
#define RFORS(i,m,n) for(ll (i)=(n);   (i)>(n);  (i)--)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
#define WREPS(i,in,j,jn) REPS(i,in)REPS(j,jn)
//-----------------------------------------
//namespace
using namespace std;
//ライブラリはここに
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

//-----------------------------------------
int main(void){
    ll N,X;
    while(cin>>N>>X){
        if(N==0&&X==0)break;
        ll cnt=0;
        REPS(i,N){
            FORS(j,i+1,N){
                FORS(k,j+1,N){
                    if(i+j+k==X)cnt++;
                }
            }
        }
        cout<<cnt<<"\n";
    }
}


Measured memory_bytes: 3080
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A_1116_A
{
    class Program
    {
        class A_2019_1116_A
        {
            public void run()
            {
                //入力部
                int R = int.Parse(Console.ReadLine());


                //処理
                int squ = R * R;

                
                //出力
                Console.WriteLine(squ);


                 

            }
        }



        static void Main(string[] args)
        {
            A_2019_1116_A a_2019_1116_A = new A_2019_1116_A();
            a_2019_1116_A.run();


            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<algorithm>
using namespace std;
int N,S[1<<17],vis[1<<17];
long ans;
main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>S[i];
	for(int i=1;i<N;i++)
	{
		long now=0;
		int L=0,R=N-1;
		while(R>i+i)
		{
			L+=i;R-=i;vis[L]=i;
			if(vis[R]<i)ans=max(ans,now+=S[L]+S[R]);
			else break;
		}
	}
	cout<<ans<<endl;
}

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

ll n,m;
ll sum=0;
vector<vector<ll>> s;
vector<ll> p;
vector<bool> sw;

void check(ll pos) {
    if(pos<n) {
        sw[pos] =true;
        check(pos+1);
        sw[pos] =false;
        check(pos+1);
    }else{
        bool flag =true;
        for(ll i=0;i<m;i++) {
            ll num=0;
            for(ll j=0;j<s[i].size();j++) {
                if(sw[s[i][j]-1])num++;
            }
            if(num%2!=p[i]){
                flag=false;
                break;
            }
        }
        if(flag) {
            sum++;
        }
    }
}

int main() {
    cin>>n>>m;
    for(ll i=0;i<n;i++){
        sw.push_back(true);
    }
    for(ll i=0;i<m;i++) {
        ll k;
        cin>>k;
        vector<ll> tmp(k);
        for(ll j=0;j<k;j++) {
            cin >>tmp[j];
        }
        s.push_back(tmp);
    }
    for(ll i=0;i<m;i++) {
        ll t;
        cin>>t;
        p.push_back(t);
    }
    check(0);
    cout << sum<<endl;
}


Measured memory_bytes: 256
#define _GIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double EPS = 1e-10;


int main(void) {
  int N;
  cin >> N;
  vector<P> v(N);
  rep(i, N) {
    cin >> v[i].first >> v[i].second;
  }

  int count = 0;
  rep(i, N) {
    if (v[i].first == v[i].second) ++count;
    else count = 0;
    if (count >= 3) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  
  cout << "No" << endl;
  return 0;
}

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

int main() {
  int a,b;
  cin >> a >> b;
  string s;
  cin >> s;
  for(int i = 0;i < s.size();i++){
    if((i < a || i > a) && s.at(i) == '-'){
      cout << "No" << endl;
      return 0;
    }
    else if(i == a && s.at(i) != '-'){
      cout << "No" << endl;
      return 0;
    }
    else if(i == s.size()-1){
      cout << "Yes" << endl;
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define MOD 998244353
template<typename ty1,typename ty2>
inline int add(ty1 x, ty2 y) {
	if(y>=MOD)y%=MOD;
	if(x>=MOD)x%=MOD;
    x += y; return x < MOD ? x : x - MOD;
}
template<typename ty1,typename ty2>
inline void addto(ty1 &x, ty2 y) {
		  if(y>=MOD)y%=MOD;
		  if(x>=MOD)x%=MOD;
	      x += y; if (x >= MOD) x -= MOD;
}
template<typename ty1,typename ty2>
inline int sub(ty1 x, ty2 y) {
		if(y>=MOD)y%=MOD;
		 if(x>=MOD)x%=MOD;
        x -= y; return x < 0 ? x + MOD : x;
}
template<typename ty1,typename ty2>
inline void subto(ty1 &x, ty2 y) {
	if(y>=MOD)y%=MOD;
	if(x>=MOD)x%=MOD;
    x -= y; if (x < 0) x += MOD;
}
template<typename ty1,typename ty2>
inline int mul(ty1 x, ty2 y) {
        if(y>=MOD)y%=MOD;
		if(x>=MOD)x%=MOD;
        return 1ll * x * y % MOD;
}
template<typename ty1,typename ty2>
void multo(ty1 &x, ty2 y) {
        if(y>=MOD)y%=MOD;
		if(x>=MOD)x%=MOD;
        x=1ll * x * y % MOD;
}
  
long long int gcd(long long int a, long long int b){
	if (a > b){
		swap(a, b);
	}
	while (a){
		swap(a, b);
		a %= b;
	}
	return b;
}
long long int lcm(long long int a, long long int b){
	return a / gcd(a, b)*b;
}
long long int ppow(long long int i, long long int j){
		long long int res = 1LL;
		while (j){
			if ((j & 1LL)){
				res *= i;
				if (res >= MOD){
					res %= MOD;
				}
			}
			j >>= 1;
			i *= i;
			if (i >= MOD){
				i %= MOD;
			}
		}
		return res;
	}
class Combination{
	
public:
	vector<long long int> k;
	vector<long long int> r;
	void resize(int N){
		k.resize(N + 2);
		r.resize(N + 2);
		k[0] = 1;
		for (int i = 1; i < N+2; i++){
			k[i] = k[i - 1];
			k[i] *= i;
			if (k[i] >= MOD)k[i] %= MOD;
		}
		long long int al = k[k.size() - 1];
		long long int iv = ppow(k[k.size() - 1],MOD-2);
		r[k.size() - 1] = iv;
		for (int i = (int)(r.size()) - 2; i >= 0; i--){
			r[i] = r[i + 1] * (i + 1);
			if (r[i] >= MOD){
				r[i] %= MOD;
			}
		}
	}
	long long int C(int a, int b){
		if (a < b)return 0;
		
		long long int up = k[a];
		long long int dw = r[b] * r[a - b];
		dw %= MOD;
		up *= dw;
		up %= MOD;
		return up;
	}
	long long int H(int a, int b){
		return C(a + b - 1, b);
	}
	long long int catalan_number(int n){
		return (C(2 * n, n) + MOD - C(2 * n, n - 1)) % MOD;
	}
};
Combination C;
vector<int> v;
int im[200002];
int main(){
	int n;
	int k;
	cin>>n>>k;
	for(int i=0;i<n;i++){
		int a;
		scanf("%d",&a);
		v.push_back(a);
	}
	while(k--){
		bool upd=false;
		for(int i=0;i<v.size();i++){
			int lef=i-v[i];
			lef=max(0,lef);
			int rig=i+v[i];
			rig=min(n-1,rig);
			im[lef]++;
			im[rig+1]--;
		}
		for(int i=0;i<v.size();i++){
			if(i)im[i]+=im[i-1];
			if(v[i]==im[i])continue;
			v[i]=im[i];
			upd=true;
		}
		for(int i=0;i<v.size();i++)im[i]=0;
		if(upd==false)break;
	}
	for(int i=0;i<v.size();i++){
		if(i)printf(" ");
		printf("%d",v[i]);
	}
	puts("");
	return 0;
}


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

int main()
{
    int N, b1, b2;
    scanf("%d",&N);
    b1 = N/10;
    b2 = N%10;
    if (b1 == 9 || b2 == 9)
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    return 0;
}


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

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

  ll sum = 0;

  for (int i = 1; i <= n; i++)
  {
    if (i % 3 != 0 && i % 5 != 0)
      sum += i;
  }

  cout << sum;
}


Measured memory_bytes: 3580
from collections import deque


H, W = map(int, input().split())
Ch, Cw = map(lambda x: int(x) - 1, input().split())
Dh, Dw = map(lambda x: int(x) - 1, input().split())
maze = [input() for _ in range(H)]

INF = 10 ** 12
path = [[INF] * W for _ in range(H)]  # path: 各マスへの移動コスト

# walk:移動A, warp:移動B
walk = [(0, 1), (0, -1), (-1, 0), (1, 0)]
warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if (i, j) not in [(0, 0)] + walk]

q = deque()
path[Ch][Cw] = 0
q.append((Ch, Cw, 0))

while q:
    x, y, s = q.popleft()
    for dx, dy in walk:  # 移動A
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s:
            path[nx][ny] = s
            q.appendleft((nx, ny, s))  # 移動Aの場合はコスト0. キューの先頭に追加する.
    for dx, dy in warp:  # 移動B
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s + 1:
            path[nx][ny] = s + 1
            q.append((nx, ny, s + 1))  # 移動Bの場合はコスト1. キューの最後尾に追加する.
    
ans = path[Dh][Dw] if path[Dh][Dw] < INF else '-1'
print(ans)

Measured memory_bytes: 92056
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


int main() {
    int n, m;
    cin >> n >> m;
    vint num(n, 0);
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        --a;
        --b;
        num[a]++;
        num[b]++;
    }

    bool ans = true;
    rep(i, n) if (num[i] & 1) ans = false;

    yn(ans);
    return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
#include<string.h>
#define N 101

int main(void)
{
  char p[N], s[N], str[N * 2];

  scanf("%s", p);
  scanf("%s", s);

  strcpy(str, p);
  strcat(str, p);

  if(strstr(str, s) != NULL) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }

  return 0;
}

Measured memory_bytes: 540
import java.util.Scanner;

public class Main {
	public static Scanner sc;
	public static void main(String[] args) {
		sc= new Scanner(System.in);
		int i=0,j=0;
		int count=0;
		int m[]=new int[300];
		int h[][]=new int[10][300];
		String card[] =new String[300];
		for(;;) {
			card[i]=sc.next();
			if(card[i].equals("-")) {
				break;
			}
			m[i]=sc.nextInt();
			for(j=0;j<m[i];j++) {
				h[i][j]=sc.nextInt();
			}
			i++;
			count++;
		}
		
		
		for(i=0;i<count;i++) {
			for(j=0;j<m[i];j++) {
			String s1 = card[i].substring(0,h[i][j]);
			String s2 = card[i].substring(h[i][j]);
			card[i]=s2+s1;
			}
			System.out.println(card[i]);
		}	
	}
}



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

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int 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;
    }
}

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

int main() {
    COMinit();
    int n,m,k;
    long long x=0,y=0,z,d,nn,mm,kk;
    cin >> n >> m >> k;
    z=COM(n*m-2,k-2); nn=n; mm=m; kk=k;
    for(d=1;d<n;d++) x=(x+(((d*(nn-d)%MOD)*mm%MOD)*mm%MOD))%MOD;
    for(d=1;d<m;d++) y=(y+(((d*(mm-d)%MOD)*nn%MOD)*nn%MOD))%MOD;
    cout << ((x+y)%MOD)*z%MOD << endl;
}


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

    using namespace std;
    typedef long long ll;
    # define M_PI  3.14159265358979323846
    const int MOD=1e9+7;

    void solve(){
        int total=0;
        for(int i=0;i<5;i++){
            int k;
            cin>>k;
            total+=k;
        }
        cout<<15-total;
    }
    int main(){
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cout<<fixed;
        cout<<setprecision(10);
        int t=1;
//        cin>>t;
        for(int i=1;i<=t;i++){
            solve();
        }
        return 0;
    }


Measured memory_bytes: 3644
n = gets.chomp.to_i
$l = Array.new(n+1) { Array.new }
1.upto(n) do |i|
 arr = gets.chomp.split.map(&:to_i)
 arr.shift
 arr.shift
 $l[i] = arr
end

$d = Array.new(n+1, nil)
$f = Array.new(n+1, nil)

$i = 0

def search(t)
  return if $d[t]
  $i += 1
  $d[t] = $i
  $l[t].each do |l|
    search(l)
  end
  $i += 1
  $f[t] = $i
end

1.upto(n) do |i|
  search(i) unless $d[i]
end

1.upto(n) do |i|
  puts "#{i} #{$d[i]} #{$f[i]}"
end




Measured memory_bytes: 7008
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <iomanip>
#include <cmath>
using namespace std;
using ll = long long;
int main()
{
	ll a, b, c;
	cin >> a >> b >> c;
	ll left, right;
	if (c - a - b < 0) {
		cout << "No" << endl;
		return 0;
	}
	left = (c - a - b)*(c - a - b);
	right = 4*a*b;
	if (left > right)	cout << "Yes" << endl;
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/foreach.hpp>
using namespace std;
#define pi 2*asin(1.0)
#define MAX 10000000
#define MOD 1000000007
#define _GLIBCXX_DEBUG
 
vector<long> fac(MAX);
vector<long> finv(MAX);
vector<long> inv(MAX);
vector<long> Primelist;
//template functions
/////////////////////////
void Prinit(){
long PR=10000001;
vector<long> P(PR,0);
for(long i=2;i*i<PR;i++){
    if(P.at(i)==0){
        long j=i;
      j+=i;
        while(j<PR){
            P.at(j)=1;
             j+=i;         
        }
    }
}

for(long i=2;i*i<PR;i++){//Primelist.size()=446
    if(P.at(i)==0){
        Primelist.push_back(i);
    }
}
}

void Cominit(){
  fac.at(0)=fac.at(1)=1;
  finv.at(0)=finv.at(1)=1;
  inv.at(1)=1;
  for(long i=2;i<MAX;i++){
      fac.at(i)=(fac.at(i-1)*i)%MOD;
      inv.at(i)=MOD-inv.at(MOD%i)*(MOD/i)%MOD;
      finv.at(i)=finv.at(i-1)*inv.at(i)%MOD;
  }
}

long facComb(long N,long M){// nCm%
if(N<M) return 0;
if(N<0||M<0) return 0;
return fac.at(N)*(finv.at(M)*finv.at(N-M)%MOD)%MOD;
}

long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}

long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}

long GCM(long A,long B){
            long W,r;
    if(A<B){

        W=B;
        B=A;
        A=W;
    }
    while(A%B!=0){
        r=A%B;
        A=B;
        B=r;
    }
    return B;
}
long LCM(long A,long B){
    return (A*B)/GCM(A,B);
}

long upDiv(long a,long b){
  return (a+b-1)/b;
}

long strtolong(string str){
istringstream ss;
ss=istringstream(str);
long num;
ss>>num;
return num;
}

long chartolong(char ch){
long num;
num=ch-'0';
return num;
}

long Max2(long a,long b){
if(a>b){
    return a;
}else{
    return b;
}
}

long Min2(long a,long b){
if(a>b){
    return b;
}else{
    return a;
}
}


string longtostr(long N){
    string str;
    str=to_string(N);
    return str;
}









/////////////////////////


//Answer


int main() {

long N,M,S;
cin>>N>>M;
  S=pow(2,12);
vector<long> a(M);
vector<long> b(M);
vector<long> nList(S,MOD);
vector<vector<long>> c(M,vector<long>(N));
for(long i=0;i<M;i++){
    cin>>a.at(i)>>b.at(i);
    for(long j=0;j<b.at(i);j++){
        cin>>c.at(i).at(j);
        c.at(i).at(j)--;
    }
}
nList.at(0)=0;
	for(long i=0;i<M;i++){
        for(long j=0;j<S;j++){
            bitset<12> ss(j);
            for(long k=0;k<b.at(i);k++){
               ss.set(c.at(i).at(k));

            }
            long T=ss.to_ullong();
            if(nList.at(T)>nList.at(j)+a.at(i)){
                nList.at(T)=nList.at(j)+a.at(i);
            }
        }

    }

  if(nList.at(pow(2,N)-1)<MOD){
    cout<<nList.at(pow(2,N)-1)<<endl;
  }else{
    cout<<-1<<endl;
  }
  



}




Measured memory_bytes: 238268
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>
#include <assert.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << #x << ": " << x << endl;
#define popcnt __builtin_popcount


int main() {
    ll a[4], b[3];
    ll N;

    for (int i = 0; i < 4; i++) {
        cin>>a[i];
        a[i]*=(ll)pow(2.0, 1.0*(3-i));
        if(i!=3)b[i]=a[i]/2;
    }
    sort(a, a+4);
    sort(b, b+3);
    cin>>N;
    
    cout<<(N/2)*a[0]+(N%2)*b[0]<<endl;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using static kyoupuro.Input;
using static kyoupuro.MyMath;

namespace kyoupuro {

    class MainClass {

        public static void Main() {
            var N = NextInt();
            var list = new List<int>();

            for (int i = 0; i < N; i++) {
                list.Add(NextInt());
            }

            Console.WriteLine(list.Distinct().Count());
        }
    }

    class MyMath {
        static long Gcd(long a, long b) {
            return b == 0 ? a : Gcd(b, a % b);
        }
    }

    class Input {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line() {
            return Console.ReadLine();
        }

        public static int NextInt() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return int.Parse(enumerator.Current);
        }

        public static long NextLong() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return long.Parse(enumerator.Current);
        }

        public static string[] StrArr() {
            return Line().Split(' ');
        }

        public static List<int> IntList() {
            return StrArr().Select(int.Parse).ToList();
        }

        public static List<long> LongList() {
            return StrArr().Select(long.Parse).ToList();
        }

        public static void Skip(int line = 1) {
            enumerator.Reset();
            for (int i = 0; i < line; i++) Console.ReadLine();
        }

        public static void Reset() {
            enumerator.Reset();
        }
    }
}

Measured memory_bytes: 13396
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
       
        Integer[] list = new Integer[n];
       
        for(int i = 0; i < n; i++) {
          list[i] = sc.nextInt();
        }
        
        Arrays.sort(list, Comparator.reverseOrder());
        int alice = 0;
        int bob = 0;
        for(int i = 0; i < list.length; i++) {
          if (i % 2 == 0) {
            alice += list[i];
          } else {
            bob += list[i];
          }
        }
    
		// 出力
		System.out.println(alice - bob);
	}
}

Measured memory_bytes: 23764
import java.io.*;
public class Main{
    public static void main(String [] args) throws NumberFormatException, IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String[] st=br.readLine().split(" ");
        int a=Integer.parseInt(st[0]);
        int b=Integer.parseInt(st[1]);
        int c=Integer.parseInt(st[2]);
        System.out.println(a<b&&b<c?"Yes":"No");
    }}

Measured memory_bytes: 24212
N,M,K = map(int,input().split())
num = int(input())
while num>0:
  if K<=M or K<=N:
    K = K*2
    num -= 1
  elif M<=N:
    M = M*2
    num -= 1
  elif M>N:
    K = K*2
    num -= 1
    
if N<M and M<K:
  print('Yes')
else:
  print('No')
    

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

int main() {
	int n;
	cin >> n;
	map<ll, ll> mp;
	ll a;
	rep(i, n) {
		cin >> a;
		mp[a]++;
		if(mp[a] > 1) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}


Measured memory_bytes: 12800