akhauriyash/Code-Regression huggingface dataset:
import java.util.*;

public class Main {
    final static int MOD = 1000000007;
    
    public static void main(String[] args) {
        MyScanner in = new MyScanner();
        String s = in.nextLine();
        char c = s.charAt(0);
        boolean flag = false;
        for (int i = 1; i < s.length(); i++) {
            if (c != s.charAt(i)) {
                flag = true;
            }
        }
        if (flag) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        
    }
    
    static class MyScanner {
        static Scanner sc = new Scanner(System.in);
        
        String next() {
            return sc.next();
        }
        
        String nextLine() {
            return sc.nextLine();
        }
        
        int nextInt() {
            return Integer.parseInt(sc.next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextInt();
            }
            return array;
        }
        
        double[] nextDoubleArray(int n) {
            double[] array = new double[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextDouble();
            }
            return array;
        }
        
        long[] nextLongArray(int n) {
            long[] array = new long[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextLong();
            }
            return array;
        }
        
        String[] nextLineArray(int n) {
            String[] array = new String[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextLine();
            }
            return array;
        }
        
        int[][] nextIntMatrix(int n, int m) {
            int[][] matrix = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    matrix[i][j] = nextInt();
                }
            }
            return matrix;
        }
        
        double[][] nextDoubleMatrix(int n, int m) {
            double[][] matrix = new double[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    matrix[i][j] = nextDouble();
                }
            }
            return matrix;
        }
        
        long[][] nextLongMatrix(int n, int m) {
            long[][] matrix = new long[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    matrix[i][j] = nextLong();
                }
            }
            return matrix;
        }
    }
}

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

#ifdef _DEBUG
#define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " ->  " << #x << " = " << x << endl
#else
#define debug(x)
#endif

#define all(s) begin(s), end(s)
#define rall(s) rbegin(s), rend(s)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = ((a)-1); i >= (b); i--)
#define pb push_back
#define sz(a) int((a).size())
#define put(a) ((cout) << (a) << (endl))
#define putf(a, n) ((cout) << (fixed) << (setprecision(n)) << (a) << (endl))
#define deg2rad(x) (((x)*PI) / (180.0))
#define rad2deg(x) (((x) * (180.0)) / PI)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using ll_ll = pair<ll, ll>;
using d_ll = pair<double, ll>;
using ll_d = pair<ll, double>;
using d_d = pair<double, double>;

static constexpr ll LL_INF = 1LL << 60;
static constexpr int I_INF = 1 << 28;
static constexpr double PI = static_cast<double>(3.14159265358979323846264338327950288);
static constexpr double EPS = numeric_limits<double>::epsilon();

static map<type_index, const char* const> scanType = {
    {typeid(int), "%d"}, {typeid(ll), "%lld"}, {typeid(double), "%lf"}, {typeid(char), "%c"}};

template <class T> static void scan(vector<T>& v);
[[maybe_unused]] static void scan(vector<string>& v, bool isWord = true);
template <class T> static inline bool chmax(T& a, T b);
template <class T> static inline bool chmin(T& a, T b);
template <class T> static inline T gcd(T a, T b);
template <class T> static inline T lcm(T a, T b);
template <class A, size_t N, class T> static void Fill(A (&arr)[N], const T& val);
template <class T> T mod(T a, T m);

int main(int argc, char* argv[]) {
  string s;
  ll k;
  cin >> s >> k;

  int index = 0;
  rep(i, 0, sz(s)) {
    if (s[i] == '1') continue;
    index = i;
    break;
  }

  if (k <= index) {
    put(1);
    return 0;
  }

  put(s[index]);
  return 0;
}

template <class T> static void scan(vector<T>& v) {
  auto tFormat = scanType[typeid(T)];
  for (T& n : v) {
    scanf(tFormat, &n);
  }
}

static void scan(vector<string>& v, bool isWord) {
  if (isWord) {
    for (auto& n : v) {
      cin >> n;
    }
    return;
  }

  int i = 0, size = v.size();
  string s;
  getline(cin, s);

  if (s.size() != 0) {
    i++;
    v[0] = s;
  }

  for (; i < size; ++i) {
    getline(cin, v[i]);
  }
}

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

template <class T> inline T gcd(T a, T b) { return __gcd(a, b); }

template <class T> inline T lcm(T a, T b) { return (a * b) / gcd(a, b); }

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

template <class T> T mod(T a, T m) { return (a % m + m) % m; }


Measured memory_bytes: 256
#include <iostream>
#include <functional>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <stdio.h>
using namespace std;
 
int main(){    
  int A,B;
  cin >> A >> B;

  if((A+B)%2 == 0){
	cout << (A+B)/2 << endl;
  }
  else cout << "IMPOSSIBLE" << endl;
}
 


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define REP(i,b) FOR(i,0,b)
using namespace std;

int main(void) {
	char a[101];
	char b[101];
	char c[101];
	int counta = 0, countb = 0, countc = 0;
	int flag = 1;
	cin >> a >> b >> c;
	while (1) {
		if (flag == 1) {
			if (a[counta] == 'a') {
				flag = 1;
				counta++;
			}
			else if (a[counta] == 'b') {
				flag = 2;
				counta++;
			}
			else if(a[counta]=='c'){
				flag = 3;
				counta++;
			}
			else {
				flag = 1;
				break;
			}
		}else if (flag == 2) {
			if (b[countb] == 'a') {
				flag = 1;
				countb++;
			}
			else if (b[countb] == 'b') {
				flag = 2;
				countb++;
			}
			else if(b[countb]=='c') {
				flag = 3;
				countb++;
			}
			else {
				flag = 2;
				break;
			}
		}
		else if(flag==3){
			if (c[countc] == 'a') {
				flag = 1;
				countc++;
			}
			else if (c[countc] == 'b') {
				flag = 2;
				countc++;
			}
			else if(c[countc]=='c'){
				flag = 3;
				countc++;
			}
			else {
				flag = 3;
				break;
			}
		}
	}
	if (flag==1) {
		cout << "A" << endl;
	}else if (flag==2) {
		cout << "B" << endl;
	}
	else if(flag==3){
		cout << "C" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//setprecision(15)有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int n;
vector<int> a;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    string temp;
    cin >> temp;
    map<char, int> m;
    for (int i = 0; i < temp.size(); i++)
    {
        m[temp[i]]++;
    }
    for (int i = 0; i < n - 1; i++)
    {
        string temp;
        cin >> temp;
        map<char, int> mt;
        for (int i = 0; i < temp.size(); i++)
        {
            mt[temp[i]]++;
        }
        for (char c = 'a'; c <= 'z'; c++)
        {
            m[c] = min(m[c], mt[c]);
        }
    }
    string ans = "";
    for (auto x : m)
    {
        for (int i = 0; i < x.second; i++)
        {
            ans += x.first;
        }
    }
    cout << ans << "\n";
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <limits>
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#define rep(i, s, g) for (i = s; i < g; i++)
using namespace std;
using ll = long long;
const int inf = 1000000000; //10^9

int main(){
    string N;
    cin >> N; //桁ごとに見ることができる

    if(N[0]=='7' || N[1]=='7' || N[2]=='7'){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3624
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main  implements Runnable {

    public static void main(String[] args) {
        Thread tt = new Thread(null, new Main(), "", 256 * 1024 * 1024);
        tt.start();
    }

    public void run() {
    	FastScanner sc = new FastScanner(System.in);
    	//int[] ar = new int[3];
    	//ar[0]=Integer.parseInt(sc.next());
    	//Arrays.parallelSort(ar);
		int n = Integer.parseInt(sc.next());

		//long a = Long.parseLong(sc.next());
		//String s = sc.next();
		//String str = sc.next();
		//char c[] = str.toCharArray();
		//char a[][] = new char[n];
		//ArrayList<Str_4> lists = new ArrayList<Str_4>();
		//lists = new ArrayList;
		int[] v = new int[n];
		double ans = 0; 
		PrintWriter out = new PrintWriter(System.out);
		for (int i = 0; i < n; i++) {
			v[i] = Integer.parseInt(sc.next());
		}
		Arrays.parallelSort(v);
		ans = (double)v[0];
		for (int i = 1; i < n; i++) {
			ans += (double)v[i];
			ans = ans/(double)2;
		}
			
		out.println(ans);
		out.flush();
    }
    static class FastScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;
        public FastScanner(String in) {
        	StringReader sr = new StringReader(in);
            reader = new BufferedReader(new BufferedReader(sr));
            tokenizer = null;
        }
        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public long nextInt() {
            return Integer.parseInt(next());
        }

    }
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod (ll)(1e9+7)
#define int ll

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
  int n;
  int a[100001] = {};
  cin >> n;
  rep(i, 0, n) cin >> a[i];

  int ans = 0;
  rep(i, 0, n) {
    ans += a[i] / 2;
    if(a[i] % 2 && a[i + 1]) {
      ans++;
      a[i + 1]--;
    }
  }

  cout << ans << endl;
}


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

int main() {
    int N;
    cin >> N;
    map<int,vector<int>> map;
    set<int> set;
    for (int i = 0; i < N; i++){
        int a;
        cin >> a;
        map[a].push_back(i);
        set.insert(a);
    }
    long long int sum=0;
    for (auto num:set){
        long long int m=map[num].size();
        sum+=m*(m-1)/2;
    }
    vector<long long int> ans(N,sum);
    for(auto num:set){
        for (int i = 0; i < map[num].size(); i++){
            ans[map[num][i]]-=map[num].size()-1;
        }
    }
    for (int i = 0; i < N; i++){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 26880
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>

#define mp make_pair
#define x first
#define y second
#define pb push_back
using namespace std;

int main()
{

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


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        char[][] field = new char[h][];
        int[][] orbs = new int[h + 1][w + 1];
        int[][] ingots = new int[h + 1][w + 1];
        for (int i = 0; i < h; i++) {
            field[i] = sc.next().toCharArray();
            for (int j = w - 1; j >= 0; j--) {
                orbs[i][j] = orbs[i][j + 1];
                if (field[i][j] == 'O') {
                    orbs[i][j]++;
                }
            }
        }
        for (int j = 0; j < w; j++) {
            for (int i = h - 1; i >= 0; i--) {
                ingots[i][j] = ingots[i + 1][j];
                if (field[i][j] == 'I') {
                    ingots[i][j]++;
                }
            }
        }
        long total = 0;
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                if (field[i][j] == 'J') {
                    total += orbs[i][j] * ingots[i][j];
                }
            }
        }
        System.out.println(total);
    }
}


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

int main(){
	int a, b, x;

	scanf("%d %d %d", &a, &b, &x);

	if(x >= a && x <= (a+b) ){
		printf("YES\n");
	}else{
		printf("NO\n");
	}

	return 0;
}

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

typedef long long LL;

double s(LL n)
{
    LL x = n;
    LL y = 0;
    while (x)
    {
        y += x % 10;
        x /= 10;
    }

    return (double)n / y;
}

int main()
{
    LL K;
    LL n = 1;
    LL x = 1;

    cin >> K;

    for (int i = 0; i < K; i++)
    {
        cout << n << endl;
        if (s(n + x) > s(n + x * 10))
        {
            x *= 10;
        }

        n += x;
    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

constexpr Int TEN(int n) { return n == 0 ? 1 : 10 * TEN(n-1); }

vector<int> B[20];
vector<int> P;

int main(void) {
    int N,M;
    cin>>N>>M;
    for(int i = 0;i < M;i++) {
        int k;
        cin>>k;
        for(int j = 0;j < k;j++) {
            int b;
            cin>>b;
            B[i].push_back(b);
        }
    }
    for(int i = 0;i < M;i++) {
        int p;
        cin>>p;
        P.push_back(p);
    }

    int ans = 0;
    for(int i = 0;i < (1<<N);i++) {
        bool flag = true;
        for(int m = 0;m < M;m++) {
            int count = 0;
            for(int j = 0;j < B[m].size();j++) {
                if((i & 1<<(B[m][j]-1))) {
                    count++;
                }
            }
            
            if(count % 2 != P[m])
                flag = false;
        }
        if(flag) {
            ans++;
        }
    }

    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>

#pragma GCC optimize("O3")

using namespace std;
using ll = long long;
using ull = unsigned long long;

#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define repd(i, n) for(ll i = (n) - 1; i >= 0; --i)
#define FOR(i, a, b) for(ll i = a; i <= ll(b); ++i)
#define FORD(i, a, b) for(ll i = a; i >= ll(b); --i)
#define loop while(true)
#define asort(array, size) std::sort(array, array + size)
#define cauto const auto&
#define bit(n) (1LL << (n))

int main()
{
    string S;
    cin >> S;
    if (S == "RRR") cout << 3 << endl;
    else if (S == "RRS" || S == "SRR") cout << 2 << endl;
    else if (S == "RSS" || S == "RSR" || S == "SRS" || S == "SSR") cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}


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

int main() {
  int A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  int64_t ut;//相対速度(正の時差を詰められる)
  ut = ((int64_t)V - (int64_t)W) * (int64_t)T;
  
  
  if(B > A){
    if((B - A) <= ut){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
  }
  else{
    if((A - B) <= ut){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
  }
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#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 pb push_back

typedef long long ll;
using namespace std;
int MOD = 1000000007;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  string S;
  cin >> S;
  int N = S.size();
  S = S + "0";
  FOR(i, 0, N - 1){
    int c = 0;
    if( (S[i] == S[i+1])||(S[i+1] == S[i+2])||(S[i+2] == S[i]) ){
      cout << i + 1 << " " << min(i + 3, N) << "\n";
      return 0;
    }
  }
  cout << "-1 -1" << "\n";
}


Measured memory_bytes: 512
#include<iostream>
using namespace std;
int main(){
    int n,i,j,minj,max,counter=0;
    cin>>n;
    int a[n];
    for(i=0;i<n;i++)cin>>a[i];
    for(i=0;i<n-1;i++){
        minj=i;
        for(j=i+1;j<n;j++)if(a[minj]>a[j])minj=j;
        if(a[i]>a[minj]){
            max=a[i];
            a[i]=a[minj];
            a[minj]=max;
            counter++;
        }
    }
    for(i=0;i<n;i++){
        if(i)cout<<" ";
        cout<<a[i];
    }cout<<endl<<counter<<endl;
    return 0;
}


Measured memory_bytes: 3076
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <stack> // s.top()
#include <bitset>
#include <queue> // s.front()
using namespace std;

typedef long long Int;
typedef pair<Int,Int> P;

#define INF10 10000000000
#define INF5 100000
#define EPS 1e-10
#define MOD 1000000007


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

	cout << N * (N+1) / 2 << endl;







	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdio>
#include <complex>
using namespace std;
typedef complex<double > P;

P getCircumcenter(P a,P b,P c){
	double A1 = 2 * ( b.real() - a.real() );
	double B1 = 2 * ( b.imag() - a.imag() );
	double C1 = pow(a.real(),2)-pow(b.real(),2) + pow(a.imag(),2)-pow(b.imag(),2);
	double A2 = 2 * ( c.real() - a.real() );
	double B2 = 2 * ( c.imag() - a.imag() );
	double C2 = pow(a.real(),2)-pow(c.real(),2) + pow(a.imag(),2)-pow(c.imag(),2);
	double X = (B1 * C2 - B2 * C1) / (A1 * B2 - A2 * B1);
	double Y = (C1 * A2 - C2 * A1) / (A1 * B2 - A2 * B1);
	return P(X,Y);
}
int main(){
	int n;
	cin >> n;
	P a,b,c;
	while(n--){
		cin >> a.real() >> a.imag() >> b.real() >> b.imag() >> c.real() >> c.imag();
		P ans = getCircumcenter(a,b,c);
		printf("%.3f %.3f %.3f\n",ans.real(),ans.imag(),abs(ans-a));
	}
}

Measured memory_bytes: 0
#include <cstdio>
#include <sstream>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <iostream>
#include <fstream>
#include <numeric>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <iterator>
#include <iomanip>
#include <unordered_map>

using namespace std;


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

    int board[3][3], bin[3][3]={}, n, a, sum=0;
    bool flag=false;
    for (int i = 0; i < 3; ++i)
    {
        for (int j = 0; j < 3; ++j)
        {
            cin>>board[i][j];
        }
    }
    cin>>n;
    while(n--)
    {
        cin>>a;
        for (int i = 0; i < 3; ++i)
        {
            for (int j = 0; j < 3; ++j)
            {
                if(!bin[i][j] && board[i][j]==a) bin[i][j]=1;
            }
        }
    }
    for (int i = 0; i < 3; ++i)
    {
        if(bin[i][0]+bin[i][1]+bin[i][2] == 3 || bin[0][i]+bin[1][i]+bin[2][i] == 3)
            flag=true;
    }
    if(!flag)
        if(bin[0][0]+bin[1][1]+bin[2][2] == 3 || bin[0][2]+bin[1][1]+bin[2][0] == 3)
            flag=true;
    if(flag)
        cout<<"Yes";
    else cout<<"No";

}

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


struct rev{
    string city;
    int score;
    int th;
};
int comp(rev a,rev b){
    if(a.city==b.city)
        return a.score>b.score;
    else
        return a.city<b.city;
}

int main()
{
    int N;
    rev a[100];
    scanf("%d",&N);
    for(int i=0;i<N;i++){
        cin >> a[i].city >> a[i].score;
        a[i].th=i+1;
    }
    sort(a,a+N,comp);
    for(int i=0;i<N;i++){
        cout << a[i].th << endl;
    }
return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
using ll = long long;

int main(){
    ll n; cin >> n;
    ll k; cin >> k;
    ll keta =0;
    do{
        keta++;
    }while(n>(pow(k,keta)-1));
    cout << keta << endl;
    return 0;
}

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

int main() {
  int A, B, C;
  int count = 0;
  cin >> A >> B >> C;
  for (int i = 0; i < C; i++)
  {
    B -= A;
    if (B < 0)
    {
      cout << count << endl;
      break;
    }
    else
    {
      count++;
    }
  }
  if (C == count)
  {
    cout << count << endl;
  }
}

Measured memory_bytes: 3596
n = int(input())
a = list(map(int, input().split()))

a.sort()
minus = n
for i in range(n):
  if a[i] >= 0:
    minus = i
    break

a = list(map(abs, a))
a.sort()

if minus % 2 == 0:
  print(sum(a))
else:
  print(sum(a) - 2 * a[0])


Measured memory_bytes: 19972
#include<stdio.h>
int main(void){
  int a,b,c;
  char d,e;
  scanf("%d%c%d%c%d",&a,&d,&b,&e,&c);
  if(a<=2019 && b<=04){
    printf("Heisei\n");
  }else{
    printf("TBD\n");
  }
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

static const int INTINF = (2147483647);
static const ll LLINF = (9223372036854775807);
static const int MAX = 100001;
static const ll MOD = 1000000007;

namespace Printer{
    void print(vector<int> v){
        rep(i, v.size()){
            if(i) cout << " ";
            cout<< v[i];
        }
        cout << endl;
    }

    void print(vector<vector<int> > vv){
        rep(i, vv.size()){
            rep(j, vv[i].size()){
                if(j) cout << " ";
                cout << vv[i][j];
            }
            cout << endl;
        }
    }
};

//--global--//



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

int main(int argc, const char * argv[]) {
    //提出時、消す----//
    //--------------//

    ll n;
    cin >> n;
    vector<ll> a(n), b(n), c(n);
    ll ans = 0;
    rep(i, n){
        cin >> a[i];
    }
    rep(i, n){
        cin >> b[i];
    }
    rep(i, n){
        cin >> c[i];
    }
    sort(ALL(a));
    sort(ALL(b));
    sort(ALL(c));

    vector<ll> sumb(n);
    rep(i, n){
        int u = b[i];
        int uc = upper_bound(ALL(c), u) - c.begin();
        if(uc == b.size()) continue;
        sumb[i] = n - uc;
    }
    for(int i=n-2; i>=0; i--){
        sumb[i] += sumb[i+1];
    }


    rep(i, n){
        int u = a[i];
        int ub = upper_bound(ALL(b), u) - b.begin();
        if(ub == b.size()) continue;
        ans += sumb[ub];
    }

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



Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define MS(x,y) memset(x,y,sizeof x);
#define FOR(i,x,y) for(int i = x; i <= y; ++i)
#define rFOR(i,x,y) for(int i = x; i >= y; --i)
#define pb push_back
#define ll long long
#define EPS 1e-8
using namespace std;

int A,B,C,D,E,F;
set<int> su;
set<int> wa;


int main()
{
    scanf("%d%d%d%d%d%d",&A,&B,&C,&D,&E,&F);
    su.clear();
    wa.clear();
    FOR(i,0,F) if(i * A * 100 <= F)
    {
        int p1 = i * A * 100;
        FOR(j,0,F) if(p1 + j * B * 100 <= F)
        {
            wa.insert(p1 + j * B * 100);
        }
    }

    FOR(i,0,F) if(i * C <= F)
    {
        int p1 = i * C;
        FOR(j,0,F) if(p1 + j * D <= F)
        {
            su.insert(p1 + j * D);
        }
    }
    double maxn = -1;
    int ans = 0;
    int ans1 = 0;
    for(int k1:su)
    {
        for(int k2:wa) if(k1 + k2 <= F)
        {
            if(k1 * 100 <= k2 * E)
            {
                double ck = 0.0;
                if(k1 + k2 > 0.0) ck = (double)k1 / (double)(k1 + k2);
                if(ck - maxn > -EPS)
                {
                    maxn = ck;
                    ans = k1 + k2;
                    ans1 = k1;
                }
            }
        }
    }
    printf("%d %d\n",ans,ans1);

    return 0;
}


Measured memory_bytes: 384
# coding: utf-8
N, K = map(int, input().split())
ans = 0
mod = 10**9 + 7
vmin = 0
vmax = 0
L = [i for i in range(N+1)]
for i in range(N+1):
    vmin += L[i]
    vmax += L[-1-i]
    if i < K-1:
        continue
    ans += max(0, vmax - vmin+1)
    ans %= mod
print(ans)

Measured memory_bytes: 16896
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ull unsigned long long
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb2l(x,y,i) cout<<#x<<i<<" "<<x<<" "<<#y<<i<<" "<<y<<endl;

#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void solve(){

ll n,m,k;
cin>>n>>m>>k;
ll g=min(n,k);
n-=g;
k-=g;
g=min(m,k);
m-=g;
k-=g;
cout<<n<<" "<<m;
//cout<<ans;

}

int main(){
    ll t=1;
//cin>>t;
    while(t--){
     solve();
     cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
N, Y = map(int, input().split())

p = False

for j in range(N+1):

    temp = Y - 5000 * j
    # print(j, 'j')

    if temp < 0:
        break

    I = temp // 10000
    for i in range(I+1):
        k = int((temp - 10000 * i) / 1000)
        if i + k + j == N:
            p = True
            break
        # print(i, j, k)
    if p:
        break


if p:
    print(i, j, k)
else:
    print('-1 -1 -1')

Measured memory_bytes: 3060
import fractions
a,b = map(int,input().split())
g = fractions.gcd(a,b)
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
fac = factorization(g)
ans = len(fac)
if fac[0][0] != 1: ans += 1
print(ans)


Measured memory_bytes: 5304
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
    int N;
    cin >> N;
    vector<int> B(N - 1);
    REP(i, N - 1)
    {
        cin >> B[i];
    }

    int res = B[0];
    REP(i, N - 2)
    {
        res += min(B[i], B[i + 1]);
    }
    res += B[N - 2];
    cout << res << endl;
    return 0;
}


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

 int main(){
   int n;
   double ans=0.0;
   
   cin>>n;
   vector<double>a(n);
   for(int i=0;i<n;i++){
     cin>>a[i];
     ans+= 1.0/a[i];
   } 

   ans = 1.0/ans;

   cout<<setprecision(16)<<ans<<endl;

   
 }

Measured memory_bytes: 256
function Main(input) {
  input=input.split("\n");
  var W=input[0].trim().split(" ")[0]-0;
  var H=input[0].trim().split(" ")[1]-0;
  var N=input[0].trim().split(" ")[2]-0;
  var map=new Array(W);
  for(var i=0;i<map.length;i++){
    map[i]=new Array(H);
    map[i].fill(false);
  }
  var state;
  var temp;
  for(var i=1;i<input.length;i++){
    state=input[i].split(" ");
    switch(state[2]){
      case "1":
        temp=state[0]-0;
        for(var j=0;j<temp;j++){
          for(var k=0;k<H;k++){
            map[j][k]=true;
          }
        }
        break;
      case "2":
        temp=state[0]-0;
        for(var j=temp;j<W;j++){
          for(var k=0;k<H;k++){
            map[j][k]=true;
          }
        }
        break;
      case "3":
        temp=state[1]-0;
        for(var j=0;j<W;j++){
          for(var k=0;k<temp;k++){
            map[j][k]=true;
          }
        }
        break;
      case "4":
        temp=state[1]-0;
        for(var j=0;j<W;j++){
          for(var k=temp;k<H;k++){
            map[j][k]=true;
          }
        }
        break;
    }
      //console.log(map.join("\n")+"\n");

  }
  var answer=0;
  for(var j=0;j<W;j++){
    for(var k=0;k<H;k++){
      if(!map[j][k]){
        answer++;
      }
    }
  }
  console.log(answer);
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  
  


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

using namespace std;

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

struct node{
	int a;
	int b;
}t[10101010];

bool cmp(node x,node y){
	if(x.b==y.b) return x.a<y.a;
	else return x.b<y.b;
}

int main(){
	int n=read(),m=read();
	int r=0x7ffffff;
	for(int i=1;i<=m;i++){
		t[i].a=read();
		t[i].b=read();
		t[i].b--;
		r=min(t[i].b,r);
	}
	sort(t+1,t+m+1,cmp);
	int ans=1;
	for(int i=1;i<=m;i++){
		if(t[i].a>r){
			ans++;
			r=t[i].b;
		} 
	}
	cout<<ans;
	return 0;
}


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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ll long long

struct UnionFind {
  vector<int> par, rank;

  UnionFind(int n){
    par.resize(n+1);
    fill(par.begin(), par.end(), -1);
    rank.resize(n+1);
  }

  int root(int x){
    if(par[x] < 0){
      return x;
    }

    par[x] = root(par[x]);

    return par[x];
  }

  void unite(int x, int y){
    int rx=root(x);
    int ry=root(y);

    if(rx!=ry){
      if(rank[rx] >= rank[ry]){
        par[ry]=rx;

        if(rank[rx]==rank[ry]){
          rank[rx] += 1;          
        }
      }else{
        par[rx] = ry;
      }
    }
  }

  bool same(int x, int y){
    return root(x)==root(y);
  }
};

int main(){
  int n,k,l;
  cin>>n>>k>>l;
  
  UnionFind roads(n), rails(n);
  
  rep(i, k){
    int p,q;
    cin>>p>>q;
    roads.unite(p,q);
  }
  
  rep(i, l){
    int r,s;
    cin>>r>>s;
    rails.unite(r,s);
  }
  
  map<pair<int, int>, int> m;
  
  rep(i, n){
    m[ make_pair(roads.root(i+1),rails.root(i+1)) ]++;
  }
  
  rep(i, n){  
    cout<<m[ make_pair(roads.root(i+1),rails.root(i+1)) ]<<' ';
  }

  return 0;
}

Measured memory_bytes: 15104
n = 5
A = [None] * n

for i in range(n):
    A[i] = int(input())

A.sort()
k = int(input())

b = A[0]
for i in range(n):
    for ii in range(n)[i::]:
        if A[ii] - A[i] > k:
            print(':(')
            exit()
print('Yay!')




Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<algorithm>

#define NIL -1

using namespace std;

typedef struct {int parent,left,right;} Node; //????????¨????????§???????????¨?????????

Node T[25];

int find_brother(int id){
    if (T[id].parent == NIL) {
        return NIL;
    }
    if (T[T[id].parent].left == id && T[T[id].parent].right != NIL) {
        return T[T[id].parent].right;
    }
    if (T[T[id].parent].right == id && T[T[id].parent].left != NIL) {
        return T[T[id].parent].left;
    }
    return NIL;
}

int ChildNum(int id){
    int num = 0;
    if (T[id].left != NIL) num++;
    if (T[id].right != NIL) num++;
    return num;
}

void Depth(int D[],int id,int d){
    D[id] = d;
    if (T[id].left != NIL) Depth(D,T[id].left,d+1);
    if (T[id].right != NIL) Depth(D,T[id].right,d+1);
}

int hight(int id){
    int h1=0,h2=0;
    if (T[id].left != NIL) h1 = hight(T[id].left) + 1;
    if (T[id].right != NIL) h2 = hight(T[id].right) + 1;
    return max(h1,h2);
}

int decideType(int id){
    int t;
    
    if (T[id].right == NIL && T[id].left == NIL && T[id].parent != NIL) {
        t = 2;
    }else if (T[id].parent != NIL){
        t = 1;
    }else{
        t = 0;
    }
    return t;
}

int main(){
    char type[3][16]={"root","internal node","leaf"};
    int N,D[25];
    cin >> N;
    for (int i = 0; i < N; i++) {
        T[i].parent = NIL;
        T[i].left = NIL;
        T[i].right = NIL;
    }
    for (int i = 0; i < N; i++) {
        int p,l,r;
        cin >> p >> l >> r;
        T[p].left = l;
        T[p].right = r;
        
        T[l].parent = p;
        T[r].parent = p;
    }
    int root=0;
    while (T[root].parent != NIL) {
        root = T[root].parent;
    }
    
    Depth(D,root,0);
    for (int i = 0; i < N; i++) {
        printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, %s\n",
               i,T[i].parent,find_brother(i),ChildNum(i),D[i],hight(i),type[decideType(i)]);
    }
    
    
    return 0;
}

Measured memory_bytes: 1144
#![allow(dead_code)]
use std::io;

fn main() {
    solve_a();
}

fn solve_a() {
    let mut x = String::new();

    io::stdin().read_line(&mut x).unwrap();

    let v: Vec<i32> = x.trim()
        .split(' ')
        .map(|s| s.parse::<i32>().unwrap())
        .collect();

    let a = v[0];
    let b = v[1];
    if a == b {
        println!("{}", "a == b");
    } else if a < b {
        println!("{}", "a < b");
    } else {
        println!("{}", "a > b");
    }
}



Measured memory_bytes: 5024
N,M = map(int,input().split())
a = [list(map(int,input().split())) for _ in range(N)]
c = [list(map(int,input().split())) for _ in range(M)]
for i in a:
    ans = 10**9
    num = 0
    for j in c:
        if abs(i[0]-j[0]) + abs(i[1]-j[1]) < ans:
            num = c.index(j)+1
        ans = min(ans, abs(i[0]-j[0]) + abs(i[1]-j[1]))
    print(num)

Measured memory_bytes: 9044
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int D,X;
  cin >> D >> X;
  int ene=1;
  for (int i=0;i<D;i++){
    ene*=100;
  }
  if (X!=100){
    cout << ene*X << endl;
  }
  else {
    cout << ene*(X+1) << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define Khela ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define llu long long unsigned int
#define pf printf
#define sf scanf
#define f first
#define s second
#define pb push_back
#define mk make_pair
#define pii pair<int ,int>
#define PII pair<ll ,ll>
 
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
 
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
int Set(int N,int pos){return N=N | (1<<pos);}
int reset(int N,int pos){return N= N & ~(1<<pos);}
bool check(int N,int pos){return (bool)(N & (1<<pos));}
const int max=1e9+100;
const ll  MAX=1e18+500;
const int sz=1e5+100;
vector<PII> ad[sz];
ll n;
ll ans[sz];
ll len[sz];
void DFS(ll p,ll parent,ll sum)
{
    len[p]=sum;
    for(auto xx: ad[p])
    {
        if(xx.s != parent){
            if(((sum+xx.f) & 1ll) == (len[p] &1ll) ){
                ans[xx.s]=ans[p];
            }
            else{
                ans[xx.s]=(ans[p] ^ 1ll );
            }
            DFS(xx.s,p,sum+xx.f);
        }
    }
}
int main()
{
    Khela
    ll a,b,c,i,j,k,q,p,x,y,ct,ct1,m,l,r,x1,y1,mn,h,sum1,in,z,mid,mx;
    char ch;
    double d;
    string str1,str2,str;
    bool bl,bl1;
    int t,cs=1;
    while(cin>>n)
    {
        for(i=0;i<=n;i++) ad[i].clear();
        for(i=1;i<n;i++){
            cin>>p>>q>>x;
            ad[p].pb({x,q});
            ad[q].pb({x,p});
        }

        ans[1]=0;
        DFS(1,-1,0);
        for(i=1;i<=n;i++){
            cout<<ans[i]<<endl;
        }
    }


}


Measured memory_bytes: 10880
#include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<vector>
using namespace std;
typedef long long ll;
int main() {
	int n;
	cin >> n;
	if (n < 1200)cout << "ABC" << endl;
	else if (n < 2800)cout << "ARC" << endl;
	else cout << "AGC" << endl;
	return 0;
}

Measured memory_bytes: 768
N, K = map(lambda x: int(x), input().split(" "))
As = list(map(lambda x: int(x), input().split(" ")))

visited = set()
visited_list = []
index = 0
visited.add(index)
visited_list.append(0)
count = 0
flag = False
for i in range(K):
    index = As[index] - 1
    count += 1
    if index in visited:
        flag = True
        break
    visited.add(index)
    visited_list.append(index)

temp_index = visited_list.index(index)
K -= count
count = count - temp_index

if flag:
    K %= count
    for i in range(K):
        index = As[index] - 1

print(index+1)


Measured memory_bytes: 35092
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    vector<vector<pair<int, int>>> v(N);
    for (int i = 0; i < N; i++) {
        int A;
        cin >> A;
        for (int j = 0; j < A; j++) {
            int x, y;
            cin >> x >> y;
            x--;
            v[i].push_back(make_pair(x, y));
        }
    }
    int ans = 0;
    for (int i = 0; i < (1 << N); i++) {
        vector<bool> p(N, 0);
        vector<int> t;
        for (int j = 0; j < N; j++) {
            if ((1 << j) & i) {
                p[j] = 1;
                t.push_back(j);
            }
        }
        bool f = 1;
        for (auto k: t) {
            for (auto g: v[k]) {
                if (p[g.first] != g.second) {
                    f = 0;
                }
            }
        }
        if (f) {
            ans = max(ans, (int)t.size());
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define PB(x)	push_back(x)
#define ALL(x)	(x).begin(), (x).end()
#define ALLR(x) (x).rbegin(), (x).rend()
#define MP(x)	make_pair(x);
    
#define debug(x) 		cerr << #x << '=' << x << endl;
#define debug2(x, y)	cerr << #x << '=' << x << ' ' << #y << '=' << y << endl;
#define debugn(_a)		cerr << #_a << ": "; for (const auto _x: _a) cerr << _x << ' '; cerr << endl;
#define debugm(a) 		cerr << #a << ":\n"; \
						for (auto v: a) { for(const auto x: v) cout << x << ' '; cerr << "\n"; }
 
#define FAST_IO ios::sync_with_stdio(false); cin.tie(0)

#define int long long
 
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vii;
typedef vector<string> vs;
typedef unsigned long long ull;
 
const int INF  = LONG_LONG_MAX;
const int NINF = LONG_LONG_MIN;
const int mmod = 1000000007;

int32_t main()
{
	FAST_IO;
	
	int n, x, d;
	cin >> n >> x >> d;
	
	if (d == 0) {
		if (x == 0) cout << 1 << endl;
		else cout << n+1 << endl;
		return 0;
	}
	
	if (x == 0) {
		cout << (1 + (n*(n-1))/2) << endl;
		return 0;
	}
	
	map<int, vector<pair<int, int>>> m;
	
	for (int take = 0; take <= n; ++take) {
		int b = take*x;
		int sum = take*(take-1)/2;
		int rsum = (n-take)*take + sum;
		int c = b / d;
		m[b%d].emplace_back(c + sum, c + rsum);
	}
		
	int ans = 0;
	for (auto& pr: m) {
		auto& v = pr.second;
		sort(ALL(v));
		int l, r;
		int f = 0;
		for (auto& p: v) {
			if (!f) {
				f = 1;
				l = p.first;
				r = p.second;
			} else {
				if (p.first <= r) {
					if (p.second > r) r = p.second;
				} else {
					ans += r-l+1;
					l = p.first;
					r = p.second;
				}
			}
		}
		ans += r-l+1;
	}
	cout << ans << endl;
}
// g++ -Wall -Wextra -Wshadow -fsanitize=undefined 


Measured memory_bytes: 22144
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll mod=1e9+7;
ll inf=1e18;


int main(void){
	ll n,m,x[100010],y[100010];
	cin>>n>>m>>x[0]>>y[0];
	reg(i,1,n)cin>>x[i];
	reg(i,1,m)cin>>y[i];
	sort(x,x+n+1);
	sort(y,y+m+1);
	if(x[n]<y[0]){
		cout<<"No War"<<endl;
	}else{
		cout<<"War"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
// AOJ 0022 "Maximum Sum Sequence"(最大連続部分和) (パソコン甲子園 2003 本選 問題 026)
#include <cstdio>
#include <algorithm>

using namespace std;

int main() {
    while (true) {
        int n;
        scanf("%d", &n);
        if (n == 0) {
            break;
        }
        
        int maxSum = -100000;
        int sum = 0;
        for (int i = 0; i < n; i++) {
            int an;
            scanf("%d", &an);
            sum += an;
            maxSum = max(maxSum, sum);
            if (sum < 0) {
                sum = 0;
            }
        }
        printf("%d\n", maxSum);
    }
    
    return 0;
}

Measured memory_bytes: 1028
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------

ll dp[1010][1010] = {0};

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

    vector<string> a(h);

    for(int i = 0; i < h; i++) cin >> a[i];

    dp[0][0] = 1;

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(a[i][j] == '#') continue;
            if(i > 0) dp[i][j] += dp[i - 1][j];
            if(j > 0) dp[i][j] += dp[i][j - 1];
            dp[i][j] %= MOD;
        }
    }
    cout << dp[h - 1][w - 1] << endl;
}

Measured memory_bytes: 9216
#include<bits/stdc++.h>
#include<algorithm>
#define ll long long
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
int main()
{
    fast_io
    ll t,i,j,n,a,b;
    char c;
    cin>>c;
    if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u')
        cout<<"vowel"<<endl;
     else   cout<<"consonant"<<endl;

    return 0;
}





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

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n, i = LI()
    print(n-i+1)

main()



Measured memory_bytes: 83528
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
s = input()
m = n//2
# print(s[0:m])
# print(s[m:])

if s[0:m] == s[m:]:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 5584
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
const int N=202202;
int a[N],b[N],f[N];
int m,n;
ll solve(ll x){
	if (x==1)	return 1;
	return 2ll*solve(x/2)+1;
}
int main(){
	memset(f,63,sizeof(f));
	scanf("%d%d",&m,&n);
	for (int i=1; i<=n; i++)
		scanf("%d%d",&a[i],&b[i]);
	m+=10001;
	f[0]=0;
	for (int i=1; i<=n; i++)
		for (int j=a[i]; j<=m; j++)
		f[j]=min(f[j],f[j-a[i]]+b[i]);
	int ans=1e9;
	for (int i=m-10001; i<=m; i++)
		ans=min(ans,f[i]);
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
  	int n;
  	cin >> n;
  	int a[n];
  	for(int i = 0 ; i < n ; i++)
  		cin >> a[i];
  	sort(a , a + n);
  	int pt = n/2;
  	cout << max(0 , a[pt] - a[pt - 1]);
 	return 0; 
}

Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        int X = sc.nextInt();
        
        int Y;
        int Z;
        
        if(K + X < 1000000){
            Y = X + K;
        }else{
            Y = 1000000;
        }
        
        if(K - X > -1000000){
            Z = X - K + 1;
        }else{
            Z = -1000000;
        }
        
        for(int i = Z; i < Y; i++){
            System.out.println(i);
        }
    }
}

Measured memory_bytes: 21844