akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cassert>
 
using namespace std;
 
const int MOD = int(1e9) + 7;
 
long long gcd (long long a, long long b) {
  return b ? gcd(b, a % b) : a;
}
 
int main()
{
	int Test; scanf("%d", &Test); while (Test--){
    long long A, B, C, D; scanf("%lld%lld%lld%lld", &D, &A, &B, &C);
 
    bool ans = false;
    if(D < A || D % A > B) {
      ans = false;
    }else {
      // 처음 D, 매일 A 사먹음, <=B면 C개 사옴
      // 1. D
      // 2. D % A <= B 
      // 3. D % A + C >= A
      // 4. (D % A + C) % A <= B
      // 5. (D % A + C) % A + C >= A
      // 6. ((D % A + C) % A + C) % A <= B
      // 7. ((D % A + C) % A + C) % A + C >= A
      // 8. (((D % A + C) % A + C) % A + C) % A <= B
 
      // 짝수:
      //  (D + C + C + C) % A <= B
      //  (D + k * C) % A <= B여야 함.
 
      // 홀수:
      //  (D + k * C) % A + C >= A
      //  (D + k * C) % A >= A-C
 
      // A-C <= (D + k*C) % A <= B 가 항상 성립하는가??
      long long g = gcd(C, A);
 
      long long max_mod = (A-1 - D % A) / g * g + D % A;
      long long min_mod = min(D % A, (max_mod + g) % A);
      assert(min_mod <= max_mod);
      ans = (A-C <= min_mod && max_mod <= B);
    }
 
 
    puts(ans ? "Yes" : "No");
	}
 
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
	int a, b, d, r;	
	double a1, b1,f;
	cin >> a >> b;
	d = a / b;
	r = a%b;
	a1 = a;
	b1 = b;
	f = a1 / b1;



	cout << d << " " << r << " ";
	printf("%.8lf\n", f);
	return 0;
}


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

int main(){
    int N,T;
    cin >> N >> T;
    int c[N],t[N];
    int min = T;
    bool s=false;
    int k=10000;
    for(int i=0;i<N;i++){
        cin >> c[i] >> t[i];
        if(t[i]>T)c[i]=1001;
        else{s=true;}
    }
    sort(c,c+N);
    if(s){
        cout << c[0] << endl;
        return 0;
    }
    else{
        cout << "TLE" << endl;
        return 0;
    }
}

Measured memory_bytes: 256
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
	static Map<String,Integer>map=new TreeMap<>();
	static String ans="";
    public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       String s=sc.next();
       for(int i=0;i<s.length();i++) {
    	   map.put(s.substring(i,i+1),1);
       }
       if(map.size()==s.length())System.out.println("yes");
       else System.out.println("no");
    }
}

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

int main() {
    int n, k, ans;
    cin >> n >> k;
    set<int> st;
    rep(i, k) {
        int temp;
        cin >> temp;
        rep(j, temp) {
            int t;
            cin >> t;
            st.insert(t);
        }
    }
    ans = n - st.size();
    cout << ans << endl;
}

Measured memory_bytes: 3636
l, r = map(int, input().split())
f = 0
mod_list = []

for i in range(l, r+1):
    if i%2019 == 0:
        f = 1
        break
    mod_list.append(i%2019)

if f == 1:
    print(0)
else:
    #print(mod_list)
    ans = 2018
    for i in range(len(mod_list)):
        for j in range(i+1, len(mod_list)):
            if mod_list[i]*mod_list[j]%2019 < ans:
                ans = (mod_list[i]*mod_list[j])%2019
    print(ans)


Measured memory_bytes: 3060
a, b = [int(x) for x in input().split()]
if a > 0 and b > 0:
    print('Positive')
elif a == 0 or b == 0:
    print('Zero')
elif a < 0 and b < 0:
    if (b - a) % 2 == 0:
        print('Negative')
    else:
        print('Positive')
elif a > 0 and b < 0:
    print('Zero')
elif a < 0 and b > 0:
    print('Zero')


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

using namespace std;
#define mod 1000000007
#define mp make_pair
#define pb push_back
#define bas(x) #x << ": " << x << " "
#define prarr(x, n) cout << #x << ": "; for (int qsd = 0; qsd < n; qsd++) cout << x[qsd] << " "; cout << endl;
#define prarrv(x) cout << #x << ": "; for (int qsd = 0; qsd < (int)x.size(); qsd++) cout << x[qsd] << " "; cout << endl;
#define inside sl<=l&&r<=sr
#define outside sr<l||r<sl

typedef long long ll;

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


Measured memory_bytes: 256
/* Date: 01/04/2020
 * Author: @codingoo
 * Problem Name: Dice And Coin
 * Platform: AtCoder
 */
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define endl "\n"
#define sz(x) (int)(x).size()
using namespace std;
typedef long long int lli;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
    ll n, k;
    cin >> n >> k;
    double win_probability = 0;
    rep(i, 1, n+1) {
        double p_of_dice = 1.0 / n;
        int current_score = i;
        while (current_score < k) {
            current_score *= 2;
            p_of_dice /= 2;
        }
        win_probability += p_of_dice;
    }
    cout << fixed << setprecision(12) << win_probability << endl;
    return 0;
}

Measured memory_bytes: 256
s = input()
n = len(s)

for bit in range(1 << (n-1)):
    f = s[0]

    for i in range(n - 1):
        if bit & (1 << i):
            f += "+"
        else:
            f += "-"
        f += s[i + 1]

    ans = eval(f)
    if ans == 7:
        res = f + "=7"
        break

print(res)

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

#define pb push_back

using namespace std;

int data[20][20],n;
long long dp[1<<16];
vector<int> rem[17];

void generate(int bitmask,int lv)
{
  if (lv==n)
  {
    rem[__builtin_popcount(bitmask)].pb(bitmask);
    for(int c=0;c<n;c++)
    {
      if (bitmask&(1<<c))
      for(int c2=c+1;c2<n;c2++)
      {
        if (bitmask&(1<<c2))
        dp[bitmask]+=data[c][c2];
      }
    }
  }
  else
  {
    generate(bitmask,lv+1);
    generate(bitmask|(1<<lv),lv+1);
  }
}

void updateValue(int bitmask,vector<int> &bit1pos,int lv,int rem)
{
  if (lv==bit1pos.size())
  {
    dp[bitmask]=max(dp[bitmask],dp[rem]+dp[bitmask^rem]);
  }
  else if (__builtin_popcount(rem)<=bit1pos.size()/2)
  {
    updateValue(bitmask,bit1pos,lv+1,rem);
    updateValue(bitmask,bit1pos,lv+1,rem|(1<<bit1pos[lv]));
  }
}

int main()
{
  scanf("%d",&n);
  for(int c=0;c<n;c++)
  for(int c2=0;c2<n;c2++)
  scanf("%d",&data[c][c2]);
  generate(0,0);
  // for(int c=0;c<1<<n;c++)
  // {
  //   char tmp[100];
  //
  //   itoa(c,tmp,2);
  //   printf("%0*s %lld\n",n,tmp,dp[c]);
  // }

  // for(int c=1;c<=n;c++)
  // {
  //   for(int c2=0;c2<rem[c].size();c2++)
  //   {
  //     for(int c3=ceil((double)c/2);c3<c;c3++)
  //     {
  //       for(int c4=0;c4<rem[c3].size();c4++)
  //       {
  //         if ((rem[c][c2]|rem[c3][c4])==rem[c][c2])
  //         dp[rem[c][c2]]=max(dp[rem[c][c2]],dp[rem[c3][c4]]+dp[rem[c][c2]^rem[c3][c4]]);
  //       }
  //     }
  //   }
  // }
  for(int c=0;c<1<<n;c++)
  {
    vector<int> tmp;

    for(int c2=0;c2<n;c2++)
    if (c&(1<<c2))tmp.pb(c2);
    updateValue(c,tmp,0,0);
  }
  printf("%lld\n",dp[(1<<n)-1]);
}
/*
generate 2^16 score if they in same group
for 1->16 (1 bit of 1 -> 16 bit of 1)
foreach find minimum of sub 2 group
eg 1 bit -> not do anything
   2 bit -> get from some 1 bit + 1 bit that not intercept
   3 bit -> get from some 1 bit + 2 bit that not intercept

000 001 010 100  011 101 110 111
  0   0   0   0 -100  20  10 -90

0000 1000 0100 0010 0001 1100 1010 1001 0110 0101 0011 1110 1101 1011 0111 1111
   0    0    0    0    0   1M   1M   1M   1M   1M   -1   3M   3M 2M-1 2M-1 1M+2M+2M-1
*/


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

struct node
{
	int key;
	node* lc, * rc, * p;
};

node* root = 0;

void insert(int x)
{
	node* pre = root;        //设当前节点为根，以根为起点
	node* temp = pre;        //用来保存当前节点的临时指针

	node* in = (node*)malloc(sizeof(node));
	in->key = x;
	in->lc = 0;
	in->rc = 0;
	in->p = 0;

	while (pre != 0)        //找到将要插入的节点的父节点(当前节点)
	{
		temp = pre;
		if (in->key < pre->key)
			pre = pre->lc;
		else
			pre = pre->rc;
	}
	pre = temp;

	if (pre == 0)           //插入
		root = in;
	else
	{
		if (in->key < pre->key)
			pre->lc = in;
		else
			pre->rc = in;
		in->p = pre;
	}
}

node* Findlater(node* f)
{
	if (f->rc != 0)
	{
		f = f->rc;
		while (f->lc != 0)
			f = f->lc;

		return f;
	}
	
}

void Delete(int de)
{
	node* find = root;             
	node* De;              //将要删除的节点
	node* c;               //De的子节点  

	while (find != 0)
	{
		if (de < find->key)
			find = find->lc;
		else if (de > find->key)
			find = find->rc;
		else
		{
			if (find->lc == 0 || find->rc == 0)           //确认将要删除的节点
				De = find;
			else
				De = Findlater(find);
//-------------------------------------------------------------//
			if (De != find)
				find->key = De->key;

			if (De->lc != 0)                      //确认De的子节点
				c = De->lc;
			else
				c = De->rc;

			if (c != 0)
				c->p = De->p;

			if (De->p == 0)
				root = c;
			else
			{
				if (De == De->p->lc)
					De->p->lc = c;
				else
					De->p->rc = c;
			}
			
			break;
		}
	}
}

bool Find(int f)
{
	bool fin = false;

	node* pre = root;
	while (pre != 0)
	{
		if (f < pre->key)
			pre = pre->lc;
		else if (f > pre->key)
			pre = pre->rc;
		else
		{
			fin = true;
			break;
		}

	}

	return fin;
}

void Inorder(node* r)
{
	if (r->lc != 0)
		Inorder(r->lc);

	cout << " " << r->key;
	
	if (r->rc != 0)
		Inorder(r->rc);
}

void Preorder(node * r)
{
	cout << " " << r->key;

	if (r->lc != 0)
		Preorder(r->lc);
	if (r->rc != 0)
		Preorder(r->rc);
}

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

	int n, x;
	string p;

	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> p;

		if (p == "insert")
		{
			cin >> x;
			insert(x);
		}
		else if (p == "find")
		{
			cin >> x;
			if (Find(x))
				cout << "yes\n";
			else
				cout << "no\n";
		}
		else if (p == "delete")
		{
			cin >> x;
			Delete(x);
		}
		else
		{
			Inorder(root);
			cout << endl;
			Preorder(root);
			cout << endl;
		}
	}

	return 0;
}


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




int main(){
  vector<int> S(5); 
  for(int i=0;i<5;i++){
    cin >> S.at(i);
  }
  int k;
  cin >> k;
  string f = "Yay!";

  for(int i=0;i<4;i++){
    for(int j=i+1;j<5;j++){
      if((S.at(j)-S.at(i))>k)
        f = ":(";
    }
  }
  cout << f << endl;
}

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

namespace AtCoderMake.ABC166
{
    class ABC166B
    {
        static void Main(string[] args)
        {
            var nk = Console.ReadLine().Split().Select((x) => int.Parse(x)).ToArray();
            int[] sunuke = new int[nk[0]];
            for (int i=0;i<nk[1];i++)
            {
                Console.ReadLine();
                var d = Console.ReadLine().Split().Select((x) => int.Parse(x));
                foreach(int a in d)
                {
                    sunuke[a - 1]++;
                }
            }
            Console.WriteLine(sunuke.Count((x)=>x==0));
        }
    }
}


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

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

fn main() {
    let n: i32 = read();
    let m: i32 = read();
    let mut vec: Vec<i32> = vec![];
    let mut before = -1;
    for _ in 0..m {
        let v = read();
        if v == before + 1 {
            println!("0");
            return;
        }
        before = v;
        vec.push(v);
    }
    vec.push(n + 1);
    let mut before = 0;
    let mut ans = 1;
    for i in vec.iter() {
        let i = *i;
        let mut a1 = 0;
        let mut a2 = 1;
        let mut a3 = 1;
        for _ in before..(i - 1) {
            a3 = (a1 + a2) % 1_000_000_007;
            a1 = a2;
            a2 = a3;
        }
        ans = ((ans * a3 as u64) % 1_000_000_007) as u64;
        before = i + 1;
    }
    println!("{}", ans);
}


Measured memory_bytes: 4476
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <iomanip>


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

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

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

#define rep(i, a, b) for (int i=a; i<(b); i++)
#define rp(i, a) for (int i=0; i<(a); i++)
#define repd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define rpd(i,a) for (int i = (a)-1; i >= 0; i--)

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

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


int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cout << std::setprecision(9);
    cout << std::fixed;

    string a,b,c;
    cin >> a >> b >>c;
    if(a[a.length()-1] == b[0] && b[b.length()-1] == c[0])
        cout << "YES"<<endl;
    else cout << "NO"<<endl;

    return 0;
}

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


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

//const long double PIL = 3.141592653589793238462643383279502884L;
//const double PI = 3.14159265358979323846;

#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()
#define debug(v) {for (auto x : v) cerr << x << ' '; cerr << endl;}

using ll = long long;
using ii = pair<int,int>;
using vi = vector<int>;
using vll = vector<long long>;
using vii = vector<pair<int,int>>;

int main() {
	//~ ios::sync_with_stdio(0);
	//~ cin.tie(0);
	string s, t;
	cin >> s >> t;
	cout << (t + s) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string.h>
#include <queue>
#include <cstdio>
#define rep(i,k,n) for(int i = k ; i < n ; i++ )
#define INF 10000000

using namespace std;

int main(){
  int n,K;
  int a[7],m[7];
  int dp[8][1001];
  while( cin >> n,n){
    for(int i = 0 ; i < n ; i++ )cin >> a[i] >> m[i];
    fill(dp[0],dp[8],0);
    dp[0][0] = 1;

    for(int i = 0 ; i < n ; i++ ){
      for(int j = 0 ; j < 1000 ; j++ ){
	for(int k = 0 ; k <= m[i] ; k++ ){
	  if(j + a[i]*k > 1000)continue;
	  dp[i+1][j+a[i]*k] += dp[i][j]; 
	}
      }
    }
    int g;
    cin >> g; 
    rep(i,0,g){
      cin >> K;
      cout << dp[n][K] << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1188
def checkCanHalf(ary):
  for item in ary:
    if(item % 2 != 0):
      return False
  return True

n = range(int(input()))
ary = list(map(int, input().split()))
cnt = 0

while checkCanHalf(ary) == True:
  for i in range(len(ary)):
    ary[i] = ary[i]/2
  cnt += 1

print(cnt)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        sc.close();
        int ans = 0;
        
        // 500
        ans += 1000 * (x / 500);
        x %= 500;
        //5
        ans += 5 * (x / 5);
        System.out.println(ans);
    }
}

Measured memory_bytes: 35720
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define mp make_pair
#define pb push_back
#define eb emplace_back
using namespace std;
int main(){
	int n;
	string str;
	cin>>n>>str;
	if(str.size()<= n)
		cout<<str<<endl;
	else{
		str = str.substr(0, n);
		cout<<str<<"..."<<endl;
	}
	return 0;
}

Measured memory_bytes: 3584
#include <stdio.h>
#include <stdlib.h>
int compare(const void *a,const void *b){
    return *(int*)b-*(int*)a;
}

int main(){
    int n;
    scanf("%d",&n);
    int arr[100];
    for (int i=0; i<n; i++) scanf("%d",&arr[i]);
    qsort(arr,n,4,compare);
    int ans =1;
    for (int i=0; i<n-1; i++) {
        if (arr[i] != arr[i+1]){
            ans++;
        }
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 2144
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using stkll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
using mint = Fp<MOD>;

mint dp[3100][3100], sdp[3100][3100];

int main() {
    ll N; cin >> N;
    string s; cin >> s;

    dp[0][0] = 1;
    for(ll i = 1; i < N; i++) {
        for(ll j = 0; j <= i-1; j++) {
            sdp[i-1][j] = dp[i-1][j];
            if(j-1 >= 0) sdp[i-1][j] += sdp[i-1][j-1];
        }
        for(ll j = 0; j <= i; j++) {
            if(s[i-1] == '>') {
                if(j-1 >= 0) dp[i][j] += sdp[i-1][j-1];
            }
            else {
                dp[i][j] += sdp[i-1][i-1];
                if(j-1 >= 0) dp[i][j] -= sdp[i-1][j-1];
            }
        }
    }
    mint ans = 0;
    rep(i, N) ans += dp[N-1][i];
    cout << ans << endl;
}


Measured memory_bytes: 148096
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,b=0;
    cin >> N;
    vector<int> Height(N);
    for(int i=0; i<N; i++){
        cin >>Height.at(i);
    }
    for(int j = 0; j < N;j++){
        bool is_candidate = true;
        for(int k = 0; k < j; k++){
            if(Height.at(k) >Height.at(j)){
                is_candidate= false;
                break;
            }
        
        }
        if(is_candidate) {
            b++;
        }
    }

    cout << b << endl;
}

Measured memory_bytes: 256
ai = lambda: list(map(int, input().split()))

sx, sy, tx, ty = ai()
dx,dy = tx-sx, ty-sy

ans = ''
ans += 'R'*dx; ans += 'U'*dy
ans += 'L'*dx; ans += 'D'*(dy+1)

ans += 'R'*(dx+1); ans += 'U'*(dy+1); ans += 'L'
ans += 'U'
ans += 'L'*(dx+1); ans += 'D'*(dy+1); ans += 'R'
print(ans)


Measured memory_bytes: 3064
#include<iostream>
#include<queue>

using namespace std;

typedef struct{
  int sum;
  int max;
  int rev;
}Point;

int sum,n,s;

void bfs(){
  Point fir;
  fir.sum = fir.rev = 0;
  fir.max = -1;
  queue<Point> Q;
  Q.push(fir);
  while(1){
    Point now = Q.front();
    if(now.rev == n){
      while(!Q.empty()){
	now = Q.front();
	Q.pop();
	if(now.sum == s) sum++;
      }
      break;
    }
    Q.pop();
    for(int i = now.max+1; i < 10; i++){
      Point next = now;
      next.sum += i;
      next.max = i;
      next.rev++;
      Q.push(next);
    }
  }
}

int main(){
  while(cin >> n >> s && n+s){
    sum = 0;
    bfs();
    cout << sum << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define ANS cout << ans << endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))
#define int long long
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define VIin(a) for(int i=0; i<a.size(); i++) cin >> a[i]
#define OUT(a) cout << a << endl
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1e9+7;
const long long INF = 1LL << 60;
/*最大公約数*/int gcd(int x, int y) { return y ? gcd(y,x%y) : x;}
/*最小公倍数*/int LCM(int a, int b) { int g = gcd(a, b); return a / g * b; }
//----------------------------------------------
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n; cin >> n;
    VI a(n); VIin(a);
    VI zyun(n,0);
    rep(i,n){
        zyun[a[i] - 1] = i+1;
    } 
    rep(i,n) cout << zyun[i] << endl;

    return 0;
}

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


import sys
import math

#1整数
n = int(input())


#空白区切り2整数
#n ,m = list(map(int, input().split()))

#空白区切りリスト
#a=list(map(int, input().split()))

#s = input().split('/')
list=[]
sum = 0.0
for i in range(n):
    s = input().split()
    if s[1] == 'JPY':
        sum += int(s[0])
    else:
        sum += float(s[0])*380000.0

print(sum)





Measured memory_bytes: 2940
#include<stdio.h>
main(){
  int n,i,j,t,a[10][10],b[10];
  while(1){
    scanf("%d",&n);
    if(n==0){
      break;
    }
    for(i=0;i<n;i++){
      for(j=0;j<n;j++){
	scanf("%d",&a[i][j]);
      }
    }
    for(i=0;i<n;i++){
      t=0;
      for(j=0;j<n;j++){
	printf("%5d",a[i][j]);
	t=t+a[i][j];
      }
      printf("%5d\n",t);
    }
    t=0;
    for(j=0;j<n;j++){
      b[j]=0;
      for(i=0;i<n;i++){
	b[j]=b[j]+a[i][j];
      }
      t=t+b[j];
      printf("%5d",b[j]);
    }
    printf("%5d\n",t);
  }
  return 0;
}

Measured memory_bytes: 612
#include<stdio.h>
#include<math.h>
int main()
{
	long long int n;
	scanf("%lld",&n);
	int i;
	long long int a,b,c,s,x;
	scanf("%lld %lld",&a,&b);
	c=a+b;
	s=(n/c)*a;
	n=n%c;
	if(n>a)
	s+=a;
	else
	s+=n;
	printf("%lld",s);
	return 0;
}


Measured memory_bytes: 128
import sys
input = sys.stdin.readline
from collections import defaultdict

def DD(arg): return defaultdict(arg)
INF = float('inf')

N,M = list(map(int,input().split()))
graph = {i:[] for i in range(N)}
for _ in range(M):
  a,b = list(map(int,input().split()))
  graph[a-1].append(b-1)
  
Q = [i for i in range(N)]
p = [None for i in range(N)]
heiro = []
while Q:
  state = [-1 for i in range(N)]
  Flag = 0
  s = Q.pop()
  if p[s] != None: continue
  p[s] = -1
  q = [s]
  while q:
    flag = 0
    x = q.pop()
    if x < 0:
      state[~x] = 0
      continue
    q.append(~x)
    for y in graph[x]:
      state[x] = 1
      if state[y] == -1:
        p[y] = x
        q.append(y)
      elif state[y] == 0:
        continue
      else:
        p[y] = x
        now = x
        while now != y:
          heiro.append(now)
          now = p[now]
        heiro.append(y)
        flag = 1
        break
    if flag:
      Flag = 1
      break
  if Flag:
    break

def graph_size(g):
  ret = 0
  for k in g:
    ret += len(g[k])
  return ret
def squeeze(l):
  global graph
  edges = []
  subgraph = {k:[] for k in l}
  data = DD(lambda:DD(int))
  i = 0
  for k in l:
    for y in graph[k]:
      if y in l:
        subgraph[k].append(y)
        edges.append([0,k,y])
        data[k][y] = i
        i += 1
  graph = subgraph
  s = l[0]
  i = data[p[s]][s]
  edges[i][0] = 1
  now = p[s]
  heiro = [s]
  while now != s:
    heiro.append(now)
    i = data[p[now]][now]
    edges[i][0] = 1
    now = p[now]
  if len(heiro)==len(edges):
    print(len(heiro))
    for x in heiro:
      print(x+1)
    exit()
  else:
    for b,k,y in edges:
      if not b:
        p[y] = k
        now = p[y]
        heiro = [y]
        while now != y:
          heiro.append(now)
          now = p[now]
        squeeze(heiro)

if not heiro:
  print(-1)
else:
  squeeze(heiro)


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

int main() {
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	int takahashi = (C + B - 1) / B;
	int aoki = (A + D - 1) / D;
	cout << (takahashi <= aoki ? "Yes" : "No") << endl;
}

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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

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

template<typename T>
ostream& operator << (ostream& os, vector<T> v)
{
  os << "(";
  each (i, v) os << i << ",";
  os << ")";
  return os;
}

const int N = 2 * 1e5 + 5;
const int M = 'z' + 5;
int g[N][M];

const int inf = 1 << 28;
int memo[N];
int path[N];
int rec(int curr)
{
  int& ret = memo[curr];
  if (ret != -1) return ret;

  int mn = inf;
  for (char c = 'a'; c <= 'z'; ++c) {
    if (!g[curr][c]) {
      path[curr] = -1 * int(c);
      return ret = 0;
    }
    int len = rec(g[curr][c]) + 1;
    if (len < mn) {
      mn = len;
      path[curr] = g[curr][c];
    }
  }
  return ret = mn;
}

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  string s;
  while (cin >> s) {
    s = "@" + s;

    fill(&g[0][0], &g[N - 1][M - 1] + 1, 0);
    for (int i = s.size() - 2; 0 <= i; --i) {
      for (char c = 'a'; c <= 'z'; ++c) {
        g[i][c] = g[i + 1][c];
      }
      g[i][s[i + 1]] = i + 1;
    }

    fill(memo, memo + N, -1);
    fill(path, path + N, -1);
    rec(0);
    string t;
    for (int i = 0; ; i = path[i]) {
      if (i < 0) {
        t += abs(i);
        break;
      }
      t += s[i];
    }
    cout << t.substr(1) << endl;
  }

  return 0;
}


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

int main(){
  char s;
  for(int i=0; i<4; i++){
    cin >>s;
    cout << s;
  }
  cout << ' ';
  for(int i=0; i<8; i++){
    cin >> s;
    cout << s;
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 760
#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

struct edge {
    ll to, cost;
};

using P = pair<ll, ll>;
// data = ((補給回数, 現在使った燃料), 今いる頂点)
using data = pair<P, ll>;

ll n, m, l;
vector<vector<edge>> g;

void dijkstra(ll s, vector<vector<P>> &d) {
    d[s][s] = P(0, 0);
    priority_queue<data, vector<data>, greater<data>> que;
    que.push(data(P(0, 0), s));
    while(que.size()) {
        auto now = que.top();
        que.pop();
        ll c = now.first.first;
        ll gas = now.first.second;
        ll v = now.second;
        if(now.first > d[s][v]) {
            continue;
        }
        for(auto next : g[v]) {
            if(next.cost > l) {
                continue;
            }
            ll nc = c;
            ll ngas = gas + next.cost;
            if(ngas > l) {
                ngas = next.cost;
                nc++;
            }
            if(P(nc, ngas) < d[s][next.to]) {
                d[s][next.to] = P(nc, ngas);
                que.push(data(d[s][next.to], next.to));
            }
        }
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >> m >> l;
    g.resize(n);
    for(ll i = 0; i < m; i++) {
        ll a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].emplace_back(edge{b, c});
        g[b].emplace_back(edge{a, c});
    }
    vector<vector<P>> d(n, vector<P>(n, P(LLINF, LLINF)));
    for(ll i = 0; i < n; i++) {
        dijkstra(i, d);
    }
    ll q;
    cin >> q;
    while(q--) {
        ll s, t;
        cin >> s >> t;
        s--;
        t--;
        ll ans = d[s][t].first;
        cout << (ans == LLINF ? -1 : ans) << endl;
    }
}

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

int main() {
  int x, y;
  cin >> x >> y;
  int a_cnt = 0;
  int b_cnt = 0;
  vector<int> a = {1, 3, 5, 7, 8, 10, 12};
  vector<int> b = {4, 6, 9, 11};
  rep(i, a.size()-1) {
    if(x == a[i]) a_cnt++;
    if(y == a[i]) a_cnt++;
  }
  rep(i, b.size()-1) {
    if(x == b[i]) b_cnt++;
    if(y == b[i]) b_cnt++;
  }
  
  if(a_cnt == 2 || b_cnt == 2) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3576
n,k = map(int,input().split())

min = 0
max = 0
ans = 0
num = 1

while True:
    if 2 ** min >= k / n:
        break
    min += 1

while True:
    if 2 ** max >= k:
        break
    max += 1


#print(min,max)

for i in range(max,min-1,-1):
    #print(i)
    count = 0
    while num * 2 ** (i-1) < k or i == 0:
        count += 1
        #print("i = {},num = {}, count = {}".format(i,num,count))
        num += 1
        if num > n:
            break
    ans += count / (n * 2 ** i)

print(ans)


Measured memory_bytes: 3060
W, H, N = list(map(int, input().split()))
W = [0, W]
H = [0, H]
pt = []
for i in range(N):
  x, y, n = list(map(int, input().split()))
  #for x, y, n in pt:
  if n == 1:
    if W[0] < x:
      W[0] = x
  elif n == 2:
    if x < W[1]:
      W[1] = x
  elif n == 3:
    if H[0] < y:
      H[0] = y
  else:
    if y < H[1]:
      H[1] = y
  #print("W", W, "H", H)
if W[0] < W[1] and H[0] < H[1]:
  print((W[1]-W[0])*(H[1]-H[0]))
else:
  print("0")

Measured memory_bytes: 3064
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cstring>
#include <cmath>
#include <climits>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define io() ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define fi first
#define se second
#define IN(i,l,r) (l<i&&i<r)
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define v(T) vector<T>
#define p(T, N) pair<T, N>
#define tp(A, B, C) tuple<A, B, C>
#define ii p(int, int)
#define vi v(int)
#define vii v(p(int, int))
#define vvi v(v(int))
#define vl v(long long)
#define vll v(p(long long, long long))
#define si set<int>
#define msi map<string, int>
#define rsz(a) resize(a)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define qsort(a) sort(all(a))
#define qsortd(a) sort(all(a), greater<>())
#define qsortf(a, f) sort(all(a), f)
#define qsortsi(v) sort(v.begin(), v.end(), [](pair<int, int> a, pair<int, int> b){return a.se < b.se;})
#define pb(n) push_back(n)
#define eb(n) emplace_back(n)
#define pp(a, b) emplace_back(make_pair(a, b))
#define pt(a, b, c) emplace_back(make_tuple(a, b, c))
#define elif else if
#define fori(i, n) for(ll i = 0; i < n; ++i)
#define foris(i, a, b) for(ll i = a; i < b; ++i)
#define forise(i, a, b) for(ll i = a; i <= b; ++i)
#define ford(i, n) for(ll i = n; i >= 0; --i)
#define fords(i, a, b) for(ll i = a; i >= b; --i)
#define fordse(i, a, b) for(ll i = a; i > b; --i)
#define fora(i, a) for (auto &i: a)
#define rev(a) reverse(a.begin(), a.end())
#define revf(a, b, c) (reverse(a.begin() + b, a.begin() + c))
#define umap unordered_map
#define uset unordered_set
#define pq(T) priority_queue<T>
#define rpq(T) priority_queue<T, vector<T>, greater<T> >
#define nl '\n'
#define fileio(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
const int mod = 1000000007;
int digits(int n) {
  n = abs(n);
  if(n < 10) return 1;
  elif(n < 100) return 2;
  elif(n < 1000) return 3;
  elif(n < 10000) return 4;
  elif(n < 100000) return 5;
  elif(n < 1000000) return 6;
  elif(n < 10000000) return 7;
  elif(n < 100000000) return 8;
  elif(n < 1000000000) return 9;
  else return 10;
}


int main() {
  io();
  
  string s;
  cin >> s;
  string ret = "";
  fori(i, s.size()) {
    ret += "x";
  }
  
  cout << ret;
  
  return 0;
}

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

int f[100][5][2];
int p[100][11];

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 5; j++) {
      for (int k = 0; k < 2; k++) cin >> f[i][j][k];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= 10; j++) cin >> p[i][j];
  }
  int result = ~0x7fffffff;
  for (int i = 1; i < 1024; i++) {
    int pp = 0;
    for (int j = 0; j < n; j++) {
      int cc = 0;
      for (int t = 0; t < 10; t++) {
        if (f[j][t / 2][t % 2] && (i & (1 << t))) cc++;
      }
      pp += p[j][cc];
    }
    result = max(result, pp);
  }
  cout << result << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;
const int N = 1500;

int a[N][N];
int dp[N][N];
int GetMaxSqure(int h, int w)
{
	int maxl = 0;
	for (int i= 0; i < h; ++i)
		for (int j = 0; j < w; ++j)
		{
			dp[i][j] = (a[i][j] + 1) % 2;	// 如果是空白 该处宽度就是1
			if (a[i][j] == 0) maxl = 1;		// 0|1 为1 存在一块空白maxl就是1
		}
	
	for (int i = 1; i < h; ++i)
	{
		for (int j = 1; j < w; ++j)
		{
			if (a[i][j] == 0)
			{
				dp[i][j] = min(dp[i-1][j-1], min(dp[i][j-1], dp[i-1][j])) + 1;
				maxl = max(maxl, dp[i][j]);
			}
			else dp[i][j] = 0;			
		}
	}
	return maxl * maxl;
}

int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < m; ++j)
			scanf("%d", &a[i][j]);
		
	printf("%d\n", GetMaxSqure(n, m));
	
	return 0;
}


Measured memory_bytes: 19008
#include <stdio.h>
#include <string.h>

int main(){
  int k;char s[128];
  scanf("%d", &k);
  if(k<1||k>100)
    return 0;
  scanf("%s", s);
  if(strlen(s)<1||strlen(s)>100)
    return 0;
  if(strlen(s)<=k){
    printf("%s",s);
  return 0;
}
  char c[k+1];
  for(int i=0;i<k;i++){
    c[i]=s[i];
  }
  c[k]='\0';
  printf("%s",strcat(c,"..."));
  return 0;

}


Measured memory_bytes: 1732
#include <bits/stdc++.h>
#define FOR0(i,n) for (int i = 0; i < n; i++)
#define FOR(i,j, n) for (int i = j; i < n; i++)
// #define ll long long
// bool isEven(ll n) {return (n%2!=0)?false:true;}

using namespace std;

//atcoder - dp
//h

const int SIZE = 1005;
const int MOD  = 1e9 + 7;

int a[SIZE][SIZE];
char grid[SIZE][SIZE];
int h, w;

int main()
{
    cin>>h>>w;

    FOR0(i, h) FOR0(j, w) cin>>grid[i][j];

    memset(a, 0, sizeof(a));

    bool block = false;

    for (int i = 1; i < w; i++)
    {
        if(grid[0][i]=='#')
            block=true;

        if(!block)
            a[0][i] = 1;
        else
            a[0][i] = 0;
    }

    block = false;

    for (int i = 1; i < h; ++i)
    {
        if(grid[i][0]=='#')
            block = true;

        if(!block)
            a[i][0] = 1;
        else
            a[i][0] = 0;
    }

    for (int i = 1; i < h; ++i)
    {
        for (int j = 1; j < w; ++j)
        {
            if(grid[i][j]=='#')
            {
                a[i][j] = 0;
                continue;
            }

            a[i][j] = (a[i-1][j]%MOD + a[i][j-1]%MOD)%MOD;
        }
    }

    cout<<a[h-1][w-1]<<endl;
}

Measured memory_bytes: 5120
/*
 * ID: ITP1_2_C
 * Problem: Sorting three numbers
 */

#include <stdio.h>

int main(void)
{
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);

    if (a > b) {
        int t;
        t = a;
        a = b;
        b = t;
    }

    if (b > c) {
        int t;
        t = b;
        b = c;
        c = t;
    }

    if (a > b) {
        int t;
        t = a;
        a = b;
        b = t;
    }

    printf("%d %d %d\n", a, b, c);

    return 0;
}



Measured memory_bytes: 2036
ab=[[float('inf') for j in range(401)] for i in range(401)]
n,ma,mb=map(int,input().split())
a,b,c=map(int,input().split())
ab[a][b]=c
ab[0][0]=0
for i in range(n-1):
    a,b,c=map(int,input().split())
    for j in range(400,-1,-1):
        for k in range(400,-1,-1):
            if ab[j][k]!=float('inf'):
                ab[j+a][k+b]=min(ab[j][k]+c,ab[j+a][k+b])
ans=float('inf')
a,b=ma,mb
while a<401 and b<401:
    ans=min(ans,ab[a][b])
    a+=ma
    b+=mb
if ans==float('inf'):
    ans=-1
print(ans)

Measured memory_bytes: 50908
#include <iostream>
#include <regex>
#include <string>

using namespace std;

int main()
{
    int n;
    string _;
    cin >> n;
    getline(cin, _);
    for (int i = 0; i < n; ++i) {
        string s;
        getline(cin, s);
        regex re("Hoshino");
        auto r = regex_replace(s, re, "Hoshina");
        cout << r << endl;
    }
}

Measured memory_bytes: 3164
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>
#include <set>

using ll = long long;
using namespace std;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

const ll MOD = 1000000007;
const ll INF = 1 << 30;
const ll INF2 = 9000000000000000000LL;
const double INF3 = 900000000000000;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 };
#define ALL(x) (x).begin(),(x).end()



int main() {
	int n, a[100010], ans;
	cin >> n;
	for (int i = 0;i < n;i++)cin >> a[i];
	sort(a, a + n);
	ll sa = INF;
	for (int i = 0;i < n - 1;i++) {
		if (sa > abs(((a[n - 1] + 1) / 2 - a[i]))) {
			ans = a[i];
			sa = abs(((a[n - 1] + 1) / 2 - a[i]));
		}
	}
	cout << a[n - 1] << ' ' << ans << endl;
}

Measured memory_bytes: 640
n = gets.to_i
h = gets.chomp.split(" ").map(&:to_i)

left = nil
h.each do |i|
  if left.nil?
    left = i
    next
  end
  if i > left
    i -= 1
  end
  if i < left
    puts "No"
    exit
  end
  left = i
end

puts "Yes"

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

int main() {
  int N, A, B;
  cin >> N;
  
  for (int i = 0; i < N; i++){
    int l, r;
    cin >> l >> r;
    A = r - l + 1;
    B += A;
  }
  cout << B << endl;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n, x int
	fmt.Scan(&n, &x)

	if x == 1 || x == 2*n-1 {
		fmt.Println("No")
		return
	}

	ans := make([]int, 2*n)
	c := 2 * n / 2
	ans[c-1], ans[c], ans[c+1] = x-1, x, x+1

	as := make([]int, 0)
	for i := 1; i <= 2*n-1; i++ {
		if x-1 <= i && i <= x+1 {
			continue
		}
		as = append(as, i)
	}

	for i := 1; i <= 2*n-1; i++ {
		if ans[i] == 0 {
			a := as[0]
			as = as[1:]
			ans[i] = a
		}
	}

	fmt.Println("Yes")
	for i := 1; i < 2*n; i++ {
		fmt.Println(ans[i])
	}
}


Measured memory_bytes: 9672
import java.util.Scanner;

public class Main {

    static int mod = 1_000_000_007;

    public static long modPow(long a, long b) {
        if (b == 0) {
            return 1;
        }

        if (b % 2 == 0) {
            return modPow(a * a % mod, b / 2);
        } else {
            return modPow(a * a % mod, (b - 1) / 2) * a % mod;
        }
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        scan.close();

        if (n == 1) {
            System.out.println(0);
            return;
        }

        long ans = modPow(10, n);
        ans -= modPow(9, n);
        if (ans < 0) {
            ans += mod;
        }
        ans -= modPow(9, n);
        if (ans < 0) {
            ans += mod;
        }
        ans += modPow(8, n);
        ans %= mod;

        System.out.println(ans);
    }
}


Measured memory_bytes: 35696
# 同じ数字が連続していないこと
passward = input()


def detector(passward):
    passward_list = list(passward)
    for i in range(len(passward)-1):
        if passward_list[i] == passward_list[i+1]:
            print('Bad', end='')
            break
        else :
            if i == len(passward)-2:
                print('Good', end='')
            continue
        

detector(passward)


Measured memory_bytes: 2940
#include "bits/stdc++.h"
using namespace std;
#ifdef LOCAL
#define debug(x)   cerr<<#x<<" = "<<x<<endl
#else
#define debug(x) 
#endif
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define input_from_file freopen("input.txt","r",stdin)
#define output_to_file freopen("output.txt" , "w",stdout)
#define pii pair<int,int>
#define endl '\n'
#define pb push_back
#define fi first
#define se second 
#define mp make_pair
#define int long long
const int inf = 1e18 + 5;
signed main()
{
  #ifdef LOCAL
      input_from_file;
      output_to_file;
    #endif 
    IOS
    int a1,a2,a3; cin>>a1>>a2>>a3;
    if(a1+a2+a3 >= 22) cout<<"bust";
    else cout<<"win";
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<iostream>
#include<numeric>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	cout << (n - 1) * (m - 1) << endl;
}

Measured memory_bytes: 256
def main():
    N, X, Y = map(int, input().split())
    ans = [0] * (N - 1)
 
    dist = 0
    
    for i in range(1, N):
        for j in range(i + 1, N + 1):
            dist = min(j - i, abs(i - X) + abs(j - Y) + 1)
            ans[dist - 1] += 1
    
    for i in range(N - 1):
        print(ans[i])

if __name__ == '__main__':
    main()

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


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

  int num = n;
  int a = 0;

  while(num > 0)
  {
    a += num % 10;
    num /= 10;
  }
  cout << (n % a == 0 ? "Yes" : "No");
    
}

Measured memory_bytes: 3544
#include <iostream>

using namespace std;

int main()
{
	char S[5];
	cin>>S;
	if (S[0] == S[1] && S[2] == S[3] && S[0] != S[2] || S[0] == S[2] && S[1] == S[3] && S[0] != S[1] || S[0] == S[3] && S[0] != S[1] && S[1] == S[2]) cout<<"Yes"; else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20);
#define int long long
#define gcd __gcd
#define all(x) (x).begin(), (x).end()
template<class T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<class T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) _overload(__VA_ARGS__, repi, _rep)(__VA_ARGS__)
#define _rev(i, n) revi(i, n, 0)
#define revi(i, a, b) for(int i = (int)(a - 1); i >= (int)(b); i--)
#define rev(...) _overload(__VA_ARGS__, revi, _rev)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
const int INF = 1e18, MOD = 1e9 + 7;
signed main() {
    INCANT;
    int n, res = 0;
    cin>>n;
    int a[n];
    rep(i, n) {
        a[i] = i + 1;
    }
    int b[10], c[10];
    rep(i, n) {
        cin>>b[i];
    }
    rep(i, n) {
        cin>>c[i];
    }
    int l, r, cnt = 1;
    do {
        bool bflag = true, cflag = true;
        rep(i, n) {
            if(a[i] != b[i]) bflag = false;
            if(a[i] != c[i]) cflag = false;
        }
        if(bflag) l = cnt;
        if(cflag) r = cnt;
        cnt++;
    } while(next_permutation(a, a + n));
    cout<<abs(r - l)<<endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sS = Console.ReadLine().Trim().Split(' ');
            int iN = int.Parse(sS[0]);
            List<List<int>> lstInp = new List<List<int>>();
            List<int> oneUsr = new List<int>();
            sS = Console.ReadLine().Trim().Split(' ');
            for (int i = 0; i < sS.Length; i++) {  oneUsr.Add(int.Parse(sS[i])); }
            lstInp.Add(oneUsr);
            oneUsr = new List<int>();                                                       // newしないで使い回すと最初にセットした値も連動して変わってしまう
            sS = Console.ReadLine().Trim().Split(' ');
            for (int i = 0; i < sS.Length; i++) { oneUsr.Add(int.Parse(sS[i])); }
            lstInp.Add(oneUsr);
            // debug (newしないとバグの元)
            //sS = Console.ReadLine().Trim().Split(' ');
            //for (int i = 0; i < sS.Length; i++) { oneUsr[i] = int.Parse(sS[i]); }
            //lstInp.Add(oneUsr);

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            List<int> lstOut = new List<int>();
            for (int i = 0; i < iN; i++)
            {
                int iCnt = 0;
                for (int j = 0; j <= i; j++)
                {
                    iCnt += lstInp[0][j];
                }
                for (int j = i; j < iN; j++)
                {
                    iCnt += lstInp[1][j];
                }
                lstOut.Add(iCnt);
            }
            lstOut.Sort(delegate (int mca1, int mca2) { return (int)(mca2 - mca1); });              // 降順

            // 出力
            Console.WriteLine("{0}", lstOut[0].ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }
}


Measured memory_bytes: 13396