akhauriyash/Code-Regression huggingface dataset:
#import <Foundation/Foundation.h>
#import <stdarg.h>

@interface StdIO : NSObject
+(NSMutableString*)stringFromStdIn; // 標準入力から NSString を得る
+(void)printf:(NSString*)format, ...; // 標準出力へ出力
@end

@implementation StdIO
+(NSMutableString*)stringFromStdIn
{
    NSFileHandle *handle = [NSFileHandle fileHandleWithStandardInput];
    NSMutableString *result = [NSMutableString string];
    NSData *data = [handle availableData];
    while ([data length] > 0) {
        [result appendString:[[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]];
        data = [handle availableData];
    }
    NSUInteger length = [result length];
    if (length >= 1 && [result characterAtIndex:length-1] == '\n') { // 入力末尾に改行文字があれば削除
        [result deleteCharactersInRange:NSMakeRange(length-1,1)];
    }
    return result;
}
+(void)printf:(NSString*)format, ...
{
    va_list arguments;
    va_start(arguments, format);
    NSString *string = [[[NSString alloc] initWithFormat:format arguments:arguments] autorelease];
    NSFileHandle *fileHandle = [NSFileHandle fileHandleWithStandardOutput];
    [fileHandle writeData:[string dataUsingEncoding:NSUTF8StringEncoding]];
    va_end(arguments);
}
@end

@interface NSArray (Extension)
-(NSArray*)integerValues;
@end

@implementation NSArray (Extension)
-(NSArray*)integerValues
{
    NSMutableArray *result = [NSMutableArray array];
    for (id obj in self) {
        [result addObject:@([obj integerValue])];
    }
    return result;
}
@end

  
int main() {
    @autoreleasepool {
        NSArray *numbers = [[[StdIO stringFromStdIn] componentsSeparatedByString:@" "] integerValues];
        NSInteger N = [[numbers objectAtIndex:0] integerValue];
        NSInteger Y = [[numbers objectAtIndex:1] integerValue] / 1000;
        
        for (NSInteger x=0; x <= MIN(N,Y/10); x++) {
            NSInteger y = Y-N-9*x;
            NSInteger z = 5*N-Y+5*x;
            if (y>=0 && z>=0 && y%4==0 && z%4==0) {
                [StdIO printf:@"%ld %ld %ld", x, y/4, z/4];
                return 0;
            }
        }
        [StdIO printf:@"-1 -1 -1"];
    }
    return 0;
}


Measured memory_bytes: 2404
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<limits>
#include<iomanip>
#include<cmath>
#include<climits>

using namespace std;

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

const int mod=1e9+7;

int main(){
    ll x,y,z,K;
    cin >> x >> y >> z >> K;
    vector<ll> a(x),b(y),c(z);
    for(int i=0;i<x;i++){
        cin >> a[i];
    }
    for(int i=0;i<y;i++){
        cin >> b[i];
    }
    for(int i=0;i<z;i++){
        cin >> c[i];
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    sort(c.begin(),c.end());
    reverse(a.begin(),a.end());
    reverse(b.begin(),b.end());
    reverse(c.begin(),c.end());
    vector<ll> ans;
    for(int i=0;i<x;i++){
        for(int j=0;j<y;j++){
            for(int k=0;k<z;k++){
                if((i+1)*(j+1)*(k+1)>K) break;
                else ans.push_back(a[i]+b[j]+c[k]);
            }
        }
    }
    sort(ans.begin(),ans.end());
    reverse(ans.begin(),ans.end());
    for(int i=0;i<K;i++)    cout << ans[i] << endl;
    return 0;
}


Measured memory_bytes: 1404
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int a[] = new int[N];
		int count=0;
		for (int i = 0; i < N; i++) {
			int ai = sc.nextInt();
			if (i == 0) {
				a[i] = ai;
			} else if ((a[i - 1]) == ai) {
				a[i] = 10001;
				count++;
			}else{
				a[i]=ai;
			}
		}
		System.out.println(count);

	}
}


Measured memory_bytes: 21204
#include<iostream>
#include<algorithm>
#include<functional>
#include <string>
#include<iomanip>
#include<cstdio>
#include<math.h>
#include<set>
#include<stack>
#include<map>
#include<queue>
#include<cstring>
#include<vector>
#include <type_traits>
typedef long long int ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define EREP(i,n) for(int i=(n-1);i>=0;--i)
#define D(n,retu) REP(i,n){cin>>retu[i];}
#define mod 1000000007
#define MIN -93193111451418101
#define INF 931931114518101
using namespace std;
typedef pair<ll, ll>P;
template<typename T, typename U>
std::enable_if_t<std::rank<T>::value == 0> fill_all(T& arr, const U& v) {
	arr = v;
}
template<typename ARR, typename U>
std::enable_if_t<std::rank<ARR>::value != 0> fill_all(ARR& arr, const U& v) {
	for (auto& i : arr) {
		fill_all(i, v);
	}
}
#define MAX_NUM 50
long long comb[MAX_NUM + 1][MAX_NUM + 1];

ll par[100000], depth[100000];
static void calc_comb()
{
	for (uint32_t i = 0; i <= MAX_NUM; i++) {
		for (uint32_t j = 0; j <= i; j++) {
			if ((j == 0) || (i == j)) {
				comb[i][j] = 1;
			}
			else {
				comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
			}
		}
	}
}
#define yo 100001
typedef pair<double, double> dop;
//------------------変数-----------------------//
ll n, k,a[10000];
ll dp[5001];
//-------------------関数----------------------//
int main() {
	cin >> n >> k;
	ll bwam = 0;
	REP(i, n) { cin >> a[i]; bwam += a[i]; }
	if (bwam < k) { cout << n << endl; return 0; }
	sort(a, a + n);
	fill_all(dp, INF);
	dp[0] = 0;
	ll mini = INF;
	for (ll i = n-1; i >=0; i--)
	{
		for (ll j = 5000; j >=0; j--)
		{
			if (dp[j] < INF) {
				if (j + a[i] >= k) {
					mini = min(mini, a[i]);
				}
				else {
					dp[j + a[i]] = 0;
				}
			}
		}
	}
	//cout << mini << endl;
	ll cnt = 0;
	REP(i, n) {
		if (a[i] < mini) { cnt++; }
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 384
N = int(input())
a = 1
ans = ''
abc = [chr(ord('a') + i) for i in range(26)]
while N>26**a:
  N -= 26**a
  a += 1
ans += abc[N%26-1]
if a >= 2:
  N = (N-1)//26
for i in range(a-1):
  ans += abc[N%26]
  N = N//26
print(ans[::-1])

Measured memory_bytes: 9224
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 bytes") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: u128 = read();
    let mut b: String = read();
    let b:u128 = b.replace(".", "").parse().unwrap();
    println!("{}", a * b / 100);
}


Measured memory_bytes: 2168
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
  int hw[3][3];
  rep(i,3)
    rep(j,3)
      cin >> hw[i][j];
  if (hw[0][0] - hw[0][1] == hw[1][0] - hw[1][1]
      && hw[0][0] - hw[0][1] == hw[2][0] - hw[2][1]
      && hw[0][0] - hw[0][2] == hw[1][0] - hw[1][2]
      && hw[0][0] - hw[0][2] == hw[2][0] - hw[2][2]
      && hw[0][1] - hw[0][2] == hw[1][1] - hw[1][2]
      && hw[0][1] - hw[0][2] == hw[2][1] - hw[2][2]) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}


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

R = []
for _ in range(N):
    a, b = map(int, input().split())
    R.append((a, b))

B = []
for _ in range(N):
    c, d = map(int, input().split())
    B.append((c, d))

R.sort(key=lambda x: (-x[0], -x[1]))
B.sort(key=lambda x: (x[1], x[0]))

ans = 0
for a, b in R:
    for i in range(len(B)):
        if B[i][0] > a and B[i][1] > b:
            ans += 1
            B.pop(i)
            break
print(ans)


Measured memory_bytes: 80052
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include<stack>
#include<string>
#include<algorithm> 
#include <set>
#include<list>
using namespace std;
#define F first
#define S second
#define li long long int 
#define ld long double
#define pb push_back
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };


int main()
{
	li N; li i, j = 1; li c = 0; cin >> N;
	for (i = 1; i <= N; i++)
	{
		cin >> j;
		if (i % 2 == 1 && j % 2 == 1)
			c++;
	}
	cout << c;
	return 0;
}

Measured memory_bytes: 3600
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (int64_t)(n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

template <int64_t MOD>
class Modint {
  using Self = Modint<MOD>;

  int64_t m_value;

 public:
  Modint(int64_t value) : m_value((value % MOD + MOD) % MOD) {}
  Self pow(int64_t e) const {
    if (e == 0) {
      return (Self)1;
    } else if (e % 2 == 0) {
      return ((*this) * (*this)).pow(e / 2);
    } else {
      return (*this).pow(e - 1) * (*this);
    }
  }
  Self inv() const { return pow(MOD - 2); }
  Self& operator=(const Self& rh) {
    m_value = rh.m_value;
    return *this;
  }
  Self operator-() const { return Self(-m_value); }
  Self operator+(const Self& other) const {
    return Self(m_value + other.m_value);
  }
  Self operator-(const Self& other) const {
    return Self(m_value - other.m_value);
  }
  Self operator*(const Self& other) const {
    return Self(m_value * other.m_value);
  }
  Self operator/(const Self& other) const { return (*this) * other.inv(); }
  Self& operator+=(const Self& rh) { return (*this) = (*this) + rh; }
  Self& operator-=(const Self& rh) { return (*this) = (*this) - rh; }
  Self& operator*=(const Self& rh) { return (*this) = (*this) * rh; }
  int64_t value() const { return m_value; }
};

int main() {
  int64_t L, R;
  cin >> L >> R;

  using Mint = Modint<1'000'000'007>;
  vector<vector<Mint>> dp(64 + 1, vector<Mint>(8, 0));

  const int X = 0x1, Y = 0x2, Z = 0x4;
  dp[0][0] = 1;
  rep(i, 64) rep(flags, 8) {
    int l = (L >> (63 - i)) & 1;
    int r = (R >> (63 - i)) & 1;
    // 0,0
    if ((flags & X) != 0 || l == 0) {
      dp[i + 1][flags | (r * Y)] += dp[i][flags];
    }

    // 0,1
    if (((flags & X) != 0 || l == 0) && ((flags & Y) != 0 || r == 1) &&
        (flags & Z) != 0) {
      dp[i + 1][flags] += dp[i][flags];
    }

    // 1,1
    if ((flags & Y) != 0 || r == 1) {
      dp[i + 1][flags | ((1 - l) * X) | Z] += dp[i][flags];
    }
  }

  /*const int n = 8;
  rep(i, n) {
    rep(flags, 8) { cerr << dp[64 - n + i][flags].value() << " "; }
    cerr << "\n";
  }*/

  Mint result = 0;
  for (Mint v : dp.back()) {
    result += v;
  }
  cout << result.value() << endl;

  return 0;
}

Measured memory_bytes: 3604
import sys
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print('-1')
  sys.exit()
s = 7
c = 1
while True:
  if s % k == 0:
    break
  s = (10 * s + 7) % k
  c += 1
print(c)

Measured memory_bytes: 9168
#include <bits/stdc++.h>
#define N 200010
#define pb push_back
#define fi first
#define se second
#define si size()
#define ll long long
#define mp make_pair
#define iter ::iterator
#define all(v) v.begin(), v.end()
#define pp pop_back
#define mapiter map<int, int>::iterator
#define forn(i, n) for(int i = 0; i < n; ++i)
#define forn1(i, n) for(int i = 1; i <= n; ++i)
#define forr(i, n)	for(int i = n - 1; i >= 0; --i)
#define forr1(i, n)	for(int i = n; i >= 1; --i)
#define form(l, r, i)	for(int i = l; i <= r; ++i)
#define forv(r, l, i)	for(int i = r; i >= l; --i)
#define r0 return 0
#define barnarnar ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define lld long double
#define elif else if
 
const int inf = 1e9 + 7;
const lld EPS = 0.00000001;
const ll modwdop = 998244353ll;
 
ll pp = 13337ll;
ll modw = 1e9 + 7;
 
using namespace std;
 
ll a[N], b[N];
 
ll get(ll x)
{
    return x * (x - 1) / 2;
}
 
int main()
{
    int n;
    cin >> n;
    forn(i, n) 
	{
        cin >> a[i];   
        b[a[i]]++;
    }
    ll ans = 0;
    forn(i, n + 1)	ans += get(b[i]);
    forn(i, n)	cout << ans - b[a[i]] + 1 << endl;
	r0;
}

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

int main(){
    int H, W, D;
    cin >> H >> W >> D;

    vector<pair<int,int>> B(H*W+1);
    rep(h, H)rep(w, W) {
        int A; cin >> A;
        B[A] = {h+1, w+1};
    }

    int Q;
    cin >> Q;

    vector<i64> ans(H*W+1, 0);
    for(int i = 1; i <= D; i++){
        int k = i;
        while(k+D <= H*W) {
            ans[k+D] = ans[k] + abs(B[k].first - B[k+D].first) + abs(B[k].second - B[k+D].second);
            k += D; 
        }
    }
    
    rep(i, Q){
        int L, R;
        cin >> L >> R;
        cout << ans[R] - ans[L] << endl;
    }
}


Measured memory_bytes: 2560
X, K, D = map(int, input().split())

if int(abs(X) / D) < K:
    if abs(X) < abs(X) % D:
        if K % 2 == 0:
            print(abs(X))
        else:
            print(min(abs(X - D), abs(X + D)))
    else:
        if int(K - int(abs(X) / D)) % 2 == 0:
            print(abs(X) % D)
        else:
            print(min(abs(abs(X) % D - D), abs(abs(X) % D + D)))
else:
    print(abs(X) - D * K)

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

int main() {
	int n, A[1000+1];
	cin >> n;

	bool approve = true;
	for (int i = 0; i < n; i++) {
		cin >> A[i];
		if (A[i] % 2 == 0)
			if (A[i] % 3 != 0 && A[i] % 5 != 0)
				approve = false;
	}

	if (approve)
		cout << "APPROVED" << endl;
	else
		cout << "DENIED" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int partition(int *,int,int);

int main()
{
  int n,A[100000],i,q;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  q = partition(A,0,n-1);

  for(i=0;i<n;i++){
    if(i>0)printf(" ");
    if(i==q)printf("[");
    printf("%d",A[i]);
    if(i==q)printf("]");
  }
  printf("\n");

  return 0;

}

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

    return i+1;
  }

    
    
  



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

int solve() {
    ll H, W, K;
    cin >> H >> W >> K;
    vector<vector<int>> S(H, vector<int>(W));
    string s;
    for ( int h = 0; h < H; h++ ) {
        cin >> s;
        for ( int i = 0; i < s.size(); i++ ) {
            S[h][i] = s[i] - '0';
        }
    }
    vector<vector<int>> ss(H+1, vector<int>(W+1));
    for ( int h = 1; h <= H; h++ ) {
        for ( int w = 1; w <= W; w++ ) {
            ss[h][w] = S[h-1][w-1];
        }
    }
    for ( int h = 0; h <= H; h++ ) {
        for ( int w = 1; w <= W; w++ ) {
            ss[h][w] += ss[h][w-1];
        }
    }
    for ( int h = 1; h <= H; h++ ) {
        for ( int w = 0; w <= W; w++ ) {
            ss[h][w] += ss[h-1][w];
        }
    }

    int ans = 1000000;
    int bw = H-1;
    for ( int b = 0; b < 1<<bw; b++ ) {
        vector<int> bs;
        bs.push_back(0);
        for ( int ii = 0; ii < bw; ii++ ) {
            if ( (b >> ii) & 1 ) {
                bs.push_back(ii+1);
            }
        }
        bs.push_back(H);
        int a = bs.size() - 2;
        int p1 = 0, p2 = 1;
        bool ng = false;
        while ( p2 <= W ) {
            int n_max = 0;
            for ( int j = 1; j < bs.size(); j++ ) {
                int h2 = bs[j], h1 = bs[j-1];
                int n = ss[h2][p2] - ss[h2][p1] - ss[h1][p2] + ss[h1][p1];
                n_max = max(n_max, n);
            }
            if ( n_max > K ) {
                if ( p2 - p1 <= 1 ) {
                    ng = true;
                    break;
                }
                a++;
                p1 = p2 - 1;
            } else {
                p2++;
            }
        }
        if ( ng ) {
            continue;
        }
        ans = min(ans, a);
    }
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 384
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
 
template<class T> inline bool chmax(T &a, T b){
    if(a<b){
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmin(T &a, T b){
    if(a>b){
        a = b;
        return true;
    }
    return false;
}

int main(){
    int n,k,m;
    cin >> n >> k >> m;
    
    vector<int>a(n);
    rep(i,n)cin >> a[i];
    vector<int>b(k);
    rep(i,k)cin >> b[i];
    int mi = *min_element(a.begin(),a.end()) + *min_element(b.begin(),b.end());
    // cerr << mi << endl;
    rep(i,m){
        int s,t,c;
        cin >> s >> t >> c;
        s--;t--;
        chmin(mi,a[s]+b[t]-c);
    }
    cout << mi << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

int main()
{
    const int Size = 10;
    std::vector<int> List(Size);
    for(int i = 0; i < Size; ++i){
        std::cin >> List[i];
    }
    std::sort(List.begin(), List.end(), std::greater<int>());
    
    std::cout << List[0] << std::endl;
    std::cout << List[1] << std::endl;
    std::cout << List[2] << std::endl;

    return 0;
}

Measured memory_bytes: 3120
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

ll _gcd(ll x, ll y){
    while(1){
        if(x%y == 0)return y;
        else{
            ll z = x%y;
            x = y;
            y = z;
        }
    }
}

ll ngcd(vector<ll> a){
    ll res;
    res = a[0];
    for(ll i = 1; i < a.size() && res != 1; i++) {
        res = _gcd(a[i], res);
    }
    return res;
}

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n,0);
    rep(i,n)cin >> a.at(i);
    cout << ngcd(a) << endl;
    return 0;
}
/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    char c;
    cin>>c;
    cout << ++c<<endl;
    return 0;
}

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

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef priority_queue<int> PQ;
typedef priority_queue<int, V, greater<int>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

ll N, M;
map<ll, ll> v;

int main() {
    cin >> N >> M;
    REP(i, 2 * M) v[IN()]++;
    FOREACH(x, v) if(x.second % 2) {
        cout << "NO"
             << "\n";
        return 0;
    }
    cout << "YES"
         << "\n";
    return 0;
}


Measured memory_bytes: 5632
/*
"Won't stop untill I'm Phenomenal"
- Phenomenal, EMINEM
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define ff first
#define Shazam ios_base::sync_with_stdio(false);   cin.tie(NULL); cout.tie(NULL);
#define ss second
#define all(c) c.begin(),c.end()
#define endl "\n"
#define test() int t; cin>>t; while(t--)
#define fl(i,a,b) for(int i = a ; i <b ;i++)
#define get(a) fl(i,0,a.size())  cin>>a[i];
#define pra(a) fl(i,0,a.size()) cout<<a[i]<<" ";	cout<<endl;
#define pr(a,n) fl(i,0,n) cout<<a[i]<<" ";	cout<<endl;
const ll INF = 2e18;
const int inf = 2e9;
const int mod = 1e9 + 7;

vector<ll> fac;
vector<ll> ifac;

ll binmodulo(ll x, ll y){
    x%=mod;
    if(!x) return 0;
    ll res = 1;
    while(y){
        if(y&1){
            res = res*x%mod;
        }
        y/=2;
        x = x*x%mod;
    }
    return res;
}
void precompute(int n){
    fac.resize(n+1,1);
    ifac.resize(n+1);
    for(int i =2; i <=n; i++){
        fac[i] = i*fac[i-1]%mod;
    }
    ifac[n] = binmodulo(fac[n], mod-2);
    for(int i = n-1; i>=0; i--){
        ifac[i] = (i+1)*ifac[i+1]%mod;
    }
}
ll ncr(ll n, ll r){
    return fac[n]*ifac[n-r]%mod*ifac[r]%mod;
}
int main(){
    Shazam;
    int n; cin>>n;
    int k; cin>>k;
    precompute(n+1);
    ll ans = 1;
    vector<ll> psum(n+1);
    iota(all(psum),0);
    for(int i = 1; i <= n; i++){
        psum[i]+=psum[i-1];
    }
    for(ll i = k; i <=n; i++){
        ans = (ans + (psum[n]-psum[n-i] - psum[i-1] + 1))%mod;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 7900
#import string,itertools,fractions,heapq,re,array,bisect
#from math import *
#from collections import Counter
def rl(s): return xrange(len(s))

INF = 2147483647


import sys
stdin = sys.stdin

D =        int( stdin.readline().strip() )

n = D // 11
r = D % 11
n *= 2
if r != 0:
    if r <= 6:
        n += 1
    else:
        n += 2

print n


Measured memory_bytes: 2568
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, k, m;
    while(1){
        cin >> n >> k >> m;
        if(n + m + k == 0) break;
        vector<int> a(n);
        rep(i, 0, n) a[i] = i;
        int now = m - 1;
        rep(i, 0, n - 1){
            // cout << now << ' ' << a[now] << endl;
            a.erase(a.begin() + now);
            now = (now + k - 1) % (int)(a.size());
        }
        cout << a[0] + 1 << endl;
    }
}


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

int main()
{
	int k, n;
  	cin >> k >> n;
  
  	int a[n], d[n];
  	int i;
  
  	for (i = 0; i < n; i++)
      cin >> a[i];
  
  	for (i = 0; i < n-1; i++) {
      	d[i] = a[i+1] - a[i];
      	if (d[i] > k / 2)
          d[i] = k - d[i];
    }
  	d[n-1] = k + a[0] - a[n-1];
  	if (d[n-1] > k / 2)
          d[n-1] = k - d[n-1];
  
  	int max = d[0];
  	for (i = 1; i < n; i++) {
      if (d[i] > max)
        max = d[i];
    }
  
  	cout << k - max << endl;
}

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

const ll INF = 1LL << 62;
const double PI = acos(-1);
const double eps = 1e-10;

int main() {
  ll h, w, ch, cw, dh, dw;
  cin >> h >> w >> ch >> cw >> dh >> dw;
  ch--, cw--, dh--, dw--;
  vector<string> s(h);
  rep(i, h) cin >> s[i];
  vector<vector<ll>> d(h, vector<ll>(w, INF));

  auto is_range = [&](ll x, ll y) {
    return 0 <= x && x < h && 0 <= y && y < w;
  };

  queue<P> q, r;
  q.push(P(ch, cw));
  d[ch][cw] = 0;
  while (!q.empty() || !r.empty()) {
    while (!q.empty()) {
      ll x = q.front().first, y = q.front().second;
      q.pop();
      for (ll i = -2; i <= 2; i++) {
        for (ll j = -2; j <= 2; j++) {
          ll nx = x + i, ny = y + j;
          if (!is_range(nx, ny)) continue;
          if (nx == x && ny == y) continue;
          if (s[nx][ny] == '#') continue;
          if (d[nx][ny] <= d[x][y]) continue;

          if (abs(i) + abs(j) <= 1) {
            d[nx][ny] = d[x][y];
            q.push(P(nx, ny));
          } else if (d[nx][ny] == INF) {
            d[nx][ny] = d[x][y] + 1;
            r.push(P(nx, ny));
          }
        }
      }
    }
    swap(q, r);
  }

  if (d[dh][dw] == INF) {
    cout << -1 << endl;
  } else {
    cout << d[dh][dw] << endl;
  }

  return 0;
}


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

using namespace std;

bool bad[10];

int main(){
  int n; cin >> n;
  int k; cin >> k;
  for(int i=0;i<k;i++){
    int t; cin >> t;
    bad[t] = true;
  }
  for(int e = n; ; e++){
    bool ok = true;
    int u = e;
    while(u != 0){
      int d = u % 10;
      if(bad[d]){ ok = false; break; }
      u /= 10;
    }
    if(ok){
      cout << e << "\n";
      return 0;
    }
  }
}


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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            String s;

            // キーボードから文字列を読み込む
            s = Console.ReadLine();

            if (s[0]=='9' || s[1]=='9')
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");

            // キー入力待ち
            Console.ReadKey();

        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long,long>> vpll;
typedef vector<pair<int,int>> vpii;
int main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	inl(n);
	inl(x);
	inl(x1);
	if(x>=n){out(n);}
	else{
		if(x+x1>=n){out(x);}
		else{
			ll tmp = n/(x+x1);
			ll tmp1 = n%(x+x1);
			if(tmp1<=x){
				out(tmp*x+tmp1);
			}
			else{
				out(tmp*x+x);
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int sw[16];
int n, m;
int s[16][16];
int k[16];
int p[16];

int dfs(int pos);

int main()
{
    scanf("%d %d", &n, &m);
    for (int i = 0; i < m; i++) {
        scanf("%d", &k[i]);

        for (int j = 0; j < k[i]; j++) {
            scanf("%d", &s[i][j]);
            s[i][j]--;
        }
    }
    for (int i = 0; i < m; i++) {
        scanf("%d", &p[i]);
    }

    printf("%d\n", dfs(0));

    return 0;
}

int dfs(int pos)
{
    if (pos == n) {
        for (int i = 0; i < m; i++) {
            int sum = 0;
            for (int j = 0; j < k[i]; j++) {
                sum += sw[s[i][j]];
            }

            if (sum % 2 != p[i]) {
                return 0;
            }
        }

        return 1;
    }
    
    int res = 0;

    sw[pos] = 1;
    res += dfs(pos + 1);
    sw[pos] = 0;
    res += dfs(pos + 1);

    return res;
}


Measured memory_bytes: 128
import sys
sys.setrecursionlimit(10**6)

n,g,s = map(int,input().split())
G = [[] for _ in range(n)]
for i in range(n-1):
  a,b = map(int,input().split())
  G[a-1].append(b-1)
  G[b-1].append(a-1)
  
def dfs(V,v,d):
  if V[v] != -1:
    return
  V[v] = d
  for nv in G[v]:
    dfs(V,nv,d+1)
  
if len(G[g-1])==1 and G[g-1][0]==s-1:
  print(0)
else:
  vs = [-1]*n
  vg = [-1]*n
  dfs(vs,s-1,0)
  dfs(vg,g-1,0)
  
  ans = 0
  for i in range(n):
    if vs[i]>vg[i]:
      ans = max(ans,vs[i])
      
  print(ans-1)

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

using namespace std;

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

    int sum = 0;
    int tmp;
    vector<int> v;
    v.resize(n);
    for (int i = 0;i < n;i++) {
        cin >> tmp;
        v[i] = tmp;
        sum += tmp;
    }
    int count = 0;
    for (int i = 0;i < n;i++) {
        if (v[i] >= (float)sum / (4 * m)) {
            count += 1;
        }
    }
    if (count >= m) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define f first
#define s second
#define pb push_back
ll mod;
long long binpow(long long a, long long b, long long m=mod) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
ll modinv(ll n)
{
  return binpow(n,mod-2,mod);
}
vector<ll> ar[100001];
ll dp[100001]={0};
ll dfs(ll u,ll p)
{ 
  dp[u]=1ll;
  for(auto it: ar[u])
  {
    if(it!=p)
    {  dfs(it,u);
      dp[u]*=(dp[it]+1ll);
      dp[u]%=mod;
    }
  }
}
ll ans[100001];
ll dfs2(ll u,ll p)
{
      vector<ll> g;
      ll f=1ll;
      vector<ll> k;
      for(auto it=ar[u].begin();it!=ar[u].end();++it)
      {
             if(*it!=p)
             {  k.push_back(*it);
                f*=(dp[(*it)]+1ll);
                f%=mod;
                g.push_back(f);  
             }
      }
      deque<ll> r;
      f=1ll;
      for(auto it=ar[u].rbegin();it!=ar[u].rend();++it)
      {
             if(*it!=p)
             {
                f*=(dp[(*it)]+1ll);
                f%=mod;
                r.push_front(f);  
             }
      }
      for(int x=0;x<k.size();x++)
      {   
        ll t=1;
          if(x>0)
            t*=g[x-1];
          t%=mod;
          if(x<k.size()-1ll)
            t*=r[x+1];
          t%=mod;
        ans[k[x]]*=(ans[u]*t+1ll)%mod;
        ans[k[x]]%=mod;
        dfs2(k[x],u);
      }
    ans[u]*=dp[u];
      ans[u]%=mod;
}
void solve()
{
    ll n;
    cin>>n>>mod;
    ll u,v;
    for(int x=1;x<=n;x++)
      ans[x]=1;
    for(int x=0;x<n-1;x++){cin>>u>>v;
    ar[u].pb(v);
    ar[v].pb(u);
    }
   dfs(1,-1);
   dfs2(1,-1);
   for(int x=1;x<=n;x++)
   {
      cout<<ans[x]<<"\n";
   }
}
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll i=1;
  //cin>>i;
  ll k=0;
  while(k<i)
  {
       solve();
       ++k;
  }   
}
    

Measured memory_bytes: 111744
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<lint>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int n, m;
    cin >> n >> m;
    vec x(n), y(n), z(n);
    rep(i, n) cin >> x[i] >> y[i] >> z[i];

    lint res = 0;

    rep(f, 1 << 3) {
        vec s(n);
        rep(i, n) {
            if (f & 1) s[i] += -x[i];
            else s[i] += x[i];

            if ((f >> 1) & 1) s[i] += -y[i];
            else s[i] += y[i];

            if ((f >> 2) & 1) s[i] += -z[i];
            else s[i] += z[i];
        }

        vec ord(n);
        rep(i, n) ord[i] = i;

        sort(all(ord), [&](const int& i, const int& j) { return s[i] > s[j]; });

        lint tmp = 0;
        lint x_s = 0, y_s = 0, z_s = 0;

        rep(i, m) {
            x_s += x[ord[i]];
            y_s += y[ord[i]];
            z_s += z[ord[i]];
        }

        tmp = abs(x_s) + abs(y_s) + abs(z_s);

        res = max(res, tmp);
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    cin >> n;
    ll a[n], b[n];
    rep(i, 0, n) {
        cin >> a[i] >> b[i];
    }
    ll ans = 0;
    for (int i = n - 1; i >= 0; i--) {
        if ((ans + a[i]) % b[i] != 0) {
            ans += b[i] - (ans + a[i]) % b[i];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
a =input()
b=input()
c=input()

d=dict()
d['a']=list(reversed(a))
d['b']=list(reversed(b))
d['c']=list(reversed(c))
turn = 'a'
while True:
    if not d[turn]:
        print(turn.upper())
        break
    turn = d[turn].pop()


Measured memory_bytes: 3064
grid = []
8.times do
  grid << gets.chomp.split('')
end

puts 90
0.upto(7) do |j|
  row = []
  7.downto(0) do |i|
    row << grid[i][j]
  end
  puts row.join
end

puts 180
7.downto(0) do |i|
  row = []
  7.downto(0) do |j|
    row << grid[i][j]
  end
  puts row.join
end

puts 270
7.downto(0) do |j|
  row = []
  0.upto(7) do |i|
    row << grid[i][j]
  end
  puts row.join
end

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

// 
int main() {
    int X, Y;
    cin >> X >> Y;

    for (int i = 0; i <= X; i++) {
        if ((i * 2) + ((X - i) * 4) == Y) {
            // cout << i << ", " << (X - i);
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
}

Measured memory_bytes: 3676
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;

signed main(){
    int a, b, c;
    cin >> a >> b >> c;
    if(b - a == c - b) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256
import java.util.Scanner; 
import java.util.stream.Stream;

public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        String[] astr = str.split("");
        Boolean flag  = true;
        int[] in_data = Stream.of(astr).mapToInt(x->{
            try{
                return Integer.parseInt(x);
            }
            catch(Exception e){
                e.printStackTrace();
            }
            return 0;
        }).toArray();
        sc.close();

        for(int i=1;i<in_data.length;i++){
            flag = check(in_data[i-1], in_data[i]);
            if(flag == false){
                System.out.println("Bad");
                System.exit(0);
            }
        }
        if(flag == true){
            System.out.println("Good");
        }
    }

    public static Boolean check(Integer a, Integer b){
        if(a == b){
            return false;
        }
        else{
            return true;
        }
    }
}


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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    int mn = *min_element(a.begin(), a.end());
    int mx = *max_element(a.begin(), a.end());
    int ans = 1001001001;
    for (int i = mn; i <= mx; ++i) {
        int cnt = 0;
        for (int j : a) cnt += (i - j) * (i - j);
        ans = min(ans, cnt);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
def resolve():
	n, k, = map(int, input().split())
	ok = [str(i) for i in range(10)]
	for i in input().split():
		if i in ok:
			ok.remove(i)

	while True:
		again = False
		for i in str(n):
			if not i in ok:
				again = True
				n += 1
				break
		if not again:
			break
	print(n)
resolve()

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

r, c = list(map(int, input().split()))
A = [[0 for _ in range(c + 1)] for _ in range(r + 1)]

total = 0
for row in range(r):
    Arow = list(map(int, input().split()))
    for col in range(c):
        total += Arow[col]
        A[row][col] = Arow[col]
        A[r][col] += Arow[col]
        A[row][c] += Arow[col]
A[r][c] = total

for row in range(r + 1):
    for col in range(c + 1):
        if col < c:
            print("{} ".format(A[row][col]), end="")
        else:
            print(A[row][col], end="")
    print()


Measured memory_bytes: 6220
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main(void){
  string s;
  cin >> s;
  int begin, end;
  for(int i = 0;i < s.size(); i++){
    if(s.at(i) == 'A'){
      begin = i;
      break;
    }
  }
  for(int i = s.size() - 1;i >= 0; i--){
    if(s.at(i) == 'Z'){
      end = i;
      break;
    }
  }
  cout << end - begin + 1 << endl;
  return 0;
}


Measured memory_bytes: 640
#include <cstring>
#include <algorithm>
#include <cstdio>

using namespace std;
const int MAXN = 100010;
int _w;

int n, a[MAXN], l[MAXN], r[MAXN], x[MAXN];

int lowb( int x ) {
	for( int i = 0; i <= 30; ++i )
		if( x & (1<<i) ) return i;
	return -1;
}
int highb( int x ) {
	for( int i = 30; i >= 0; --i )
		if( x & (1<<i) ) return i;
	return -1;
}

int fl[MAXN], fr[MAXN];
int solve() {
	for( int i = 1; i < n; ++i ) {
		fl[i] = max( fl[i-1] + min(r[i-1], l[i]), fr[i-1] + min(l[i-1], l[i]) );
		fr[i] = max( fl[i-1] + min(r[i-1], r[i]), fr[i-1] + min(l[i-1], r[i]) );
	}
	return max(fl[n-1], fr[n-1]);
}

int main() {
	_w = scanf( "%d", &n );
	int ans = 0;
	for( int i = 0; i < n; ++i ) {
		_w = scanf( "%d", a+i );
		if( lowb(a[i]) == highb(a[i]) )
			l[i] = r[i] = x[i] = highb(a[i]);
		else
			l[i] = x[i] = highb(a[i])+1, r[i] = l[i]-1;
		ans += x[i];
	}
	printf( "%d\n", ans - solve() );
	return 0;
}


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

int main(){
  int A, B;
  cin >> A >> B;
  int ans;
  if(A >= 13){
    ans = B;
  }else if(6 <= A && A <= 12){
    ans = B / 2;
  }else{
    ans = 0;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <stack>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
 
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int, nuint_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set; 
#define int long long
#define MOD 1000000007
#define what_is(x) cerr << #x << " is " << x << endl;
#define loop(i,a,n) for(int i=a;i<n;i++)
 
#define pb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, szof(x))
#define sortall(x) sort(aint(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef pair<int, int> pt;

//const int mod= 998244353; 

signed main() {
 
	fastio();
//	#define LOCAL_DEFINE
	#ifdef LOCAL_DEFINE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif	
	int a,b;
	cin>>a>>b;
	if(a>b)
		swap(a,b);
	if((b-a)%2)
	{
		cout<<"IMPOSSIBLE";
	}else{
		cout<<(b+a)/2;
	}
	return 0;
}

Measured memory_bytes: 256
def examA():
    C1 = SI()
    C2 = SI()
    ans = "YES"
    if C1[0]!=C2[2] or C1[1]!=C2[1] or C1[2]!=C2[0]:
        ans = "NO"
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 5840
//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<list>
using namespace std;

typedef long long ll;

#define MOD 1000000007
ll fac[1000000];
ll finv[1000000];
ll inv[1000000];

void comb_init(){
  fac[0] = 1;
  for(int i=1;i<1000000;i++){
    fac[i] = i*fac[i-1];
    fac[i] %= MOD;
  }
  inv[1] = 1;
  for(int i=2;i<1000000;i++){
    inv[i] = MOD-inv[MOD%i]*(MOD/i)%MOD;
  }
  finv[0] = 1;
  for(int i=1;i<1000000;i++){
    finv[i] = inv[i]*finv[i-1];
    finv[i] %= MOD;
  }
}

ll comb(ll n,ll k){
  ll c = fac[n];
  c *= finv[k];c %= MOD;
  c *= finv[n-k];c %= MOD;
  return c;
}
int main(){
  int n;
  cin >> n;
  int x[n],y[n];
  for(int i=0;i<n;i++){
    cin >> x[i] >> y[i];
  }
  double ans = 0;
  double count = 0;
  int indexes[n];
  for(int i=0;i<n;i++){
    indexes[i] = i;
  }

  do{
    count += 1;
    for(int i=0;i<n-1;i++){
      int s,t;
      s = indexes[i];
      t = indexes[i+1];
      ans += sqrt(pow(x[s]-x[t],2.0)+pow(y[s]-y[t],2.0));
    }
  }
  while(next_permutation(indexes,indexes+n));
  ans /= count;
  cout << setprecision(12) << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;

#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define mod 1000000007
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(ll x=j;x<n;x++)
#define repr(x,j,n)for(ll x=j;x>n;x--)
typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;

ll modexp(ll a,ll b,ll m)
{
ll r=1;
a=a%m;
while(b>0)
{
if(b&1)
r=(r*a)%m;
b=b/2;
a=(a*a)%m;
}
return r%m;
}

vi bit;//1-based indexing

void bit_update(ll x,ll n,ll val)
{
    while(x<n)
    {
        bit[x]+=val;
        x+=(x&(~x+1));
    }
}

ll bit_sum(ll x)
{
    ll sum=0;
    while(x>0)
    {
        sum+=bit[x];
        x-=(x&(~x+1));
    }
    return sum;
}
bool pos(ll x,ll n,ll m)
{
    double nn=n;
    double xx=x;
    ll c=ceil(nn/xx);
    c--;
    ll y=n/(x);
    y=y*1LL*(x-1);
    ll t=n%(x);
    if(t>0)t--;
    ll z;
    if(x==1)
    {
        z=1;
    }
   else if(x==2)z=n+1;
    else if(x==3)z=2*n;
    else z=2*n+((x-3)*n)/2;

    if(y+t+c<=m&&z>=m)return true;
    return false;
}


int main(){
    IOS

     int n;
     cin>>n;
     cout<<n*n*n;
}



Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
//#pragma warning(disable : 4996)

#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif

#include <limits.h>
#include <math.h>
#include <time.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m - 1; i >= n; --i)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v, n) reverse(v, v + n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout << (x) << '\n'
#define pe(x) cout << (x) << " "
#define DEBUG(x) cout << #x << ": " << x << endl
#define lb(v, n) lower_bound(v.begin(), v.end(), (n))
#define ub(v, n) upper_bound(v.begin(), v.end(), (n))
#define int long long
#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i, v.size()) cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
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; }
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 1e9 + 7;
constexpr int MAX = 500050;
const double pi = acos(-1);
constexpr double EPS = 1e-8;
constexpr ll LINF = 1e18 + 1;
constexpr int INF = 1e9 + 1;



int p[5050];
int dp[5050][5050];
void solve() {
	int N, A, B; cin >> N >> A >> B;
	REP(i, N)cin >> p[i];
	REP(i, N + 1)REP(j, N + 1)dp[i][j] = LINF;
	dp[0][0] = 0;
	REP(i, N+1) {
		REP(j, N+1) {
			chmin(dp[i][j + 1], dp[i][j]);
			if (p[i] == j + 1)chmin(dp[i + 1][j + 1], dp[i][j]);
			if (p[i] > j + 1)chmin(dp[i + 1][j], dp[i][j]+A);
			if (p[i] < j + 1)chmin(dp[i + 1][j], dp[i][j]+B);
		}
	}
	print(dp[N][N]);
}



signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q;
	//cin >> q;
	//while (q--)
	solve();
}


Measured memory_bytes: 200924