akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
#define F first
#define S second 
#define mp make_pair
#define pb push_back
#define pf push_front
#define speed_up ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define debug cerr << "OK\n";
#define ub upper_bound
#define lb lower_bound
#define treap_pair pair<treap*, treap*>
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef set <int> si;
typedef set <ll> sll;
typedef multiset <int> msi;
typedef multiset <ll> msll;
typedef map <int, int> mi;
typedef map <ll, int> mll;
 
const int N = 2e5 + 2;
const int M = 1e5 + 2;
const int mod = 998244353;
const int inf = 1e9;
const ll INF = 1e16;

void data() {
	#ifdef PC
		freopen("main.in", "r", stdin);
		freopen("main.out", "w", stdout);
	#endif
}

int n, m;

int main() {
	data();
	scanf("%d %d", &n, &m);
	printf("%d", n * (n - 1) / 2 + m * (m - 1) / 2);
}

/*
	Timus: 288481RF
	CodeForces: fractal
*/


Measured memory_bytes: 256
object Main {
  import java.util.Scanner

  implicit class RichScanner(sc: Scanner) {
    def readStrings(n: Int): Array[String] = Array.fill(n) { sc.next() }
    def readInts(n: Int): Array[Int] = Array.fill(n) { sc.nextInt() }
    def readLongs(n: Int): Array[Long] = Array.fill(n) { sc.nextLong() }
    def readLineStrings: Array[String] = sc.nextLine().split(' ')
    def readLineInts: Array[Int] = readLineStrings.map(_.toInt)
    def readLineLongs: Array[Long] = readLineStrings.map(_.toLong)
  }

  def main(args: Array[String]): Unit = solve(new Scanner(System.in))

  def solve(sc: Scanner): Unit = {
    val Array(n, k) = sc.readLineInts
    val rawX = sc.readLineInts
    val zero = rawX.count(_ == 0)
    val positives = rawX.filter(_ > 0)
    val negatives = rawX.filter(_ < 0).reverse.map(_ * (-1))

    val K = k - zero

    def requiredTimes(firstDirection: Array[Int], secondDirection: Array[Int]): IndexedSeq[Option[Int]] = {
      (1 to K).map(firstShiftAmount =>
        if (firstShiftAmount > firstDirection.length) None
        else {
          val firstDirectionEdgeElement = firstDirection(firstShiftAmount - 1)
          val remaining = K - firstShiftAmount
          if (remaining == 0) {
            Some(firstDirectionEdgeElement)
          } else if(remaining > secondDirection.length) {
            None
          } else {
            val secondDirectionEdgeElement = secondDirection(remaining - 1)
            Some(2 * firstDirectionEdgeElement + secondDirectionEdgeElement)
          }
        }
      )
    }

    val answer = if (K == 0) {
      0
    } else {
      val times = requiredTimes(positives, negatives) ++ requiredTimes(negatives, positives)
      times.flatten.min
    }
    println(answer)
  }
}


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

using namespace std;


using int64 = long long;
const int mod = 1e9 + 7;
// const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


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

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

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

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

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int N;
  cin >> N;
  for(int i = 1; i <= 50000; i++) {
    int j = i * 1.08 + (1e-10);
    if(j == N) {
      cout << i << endl;
      return 0;
    }
  }
  cout << ":(" << endl;
}

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

#define ll long long int
#define ld long double
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define cases int t;cin>>t;while(t--)
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define per(i,a,b)    for(ll i=a;i>b;i--)
#define test4(x,y,z,a) cout<<"x is "<<x<<"y is "<<y<<"z is "<<z<<"a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"y is "<<y<<"z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;

ll mod = 1000000007;

int main()
{

    #ifndef ONLINE_JUDGE
    freopen("inputf.in", "r", stdin);
    freopen("outputf.in", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    
    int x,y,a,b;
    cin>>x>>y;
    if(y%2!=0)
    {
    	cout<<"No";
    }
    else
    {
    	a=4*x;
    	b=2*x;
    	if(y>=b && a>=y)
    	{
    		cout<<"Yes";
    	}
    	else
    	{
    		cout<<"No";
    	}
    }
    return 0;
}

Measured memory_bytes: 3636
local mfl, mab = math.floor, math.abs
local h, w, d = io.read("*n", "*n", "*n")
local n = h * w
local map, invmap = {}, {}
local cost = {}
for i = 1, n do invmap[i] = 0 end
for i = 1, n do
  local a = io.read("*n")
  map[i] = a
  invmap[a] = i
  cost[i] = 0
end
for t_i_d = 1, d do
  local src_x, src_y = 0, 0
  local costsum = 0
  local i_d = t_i_d
  while i_d <= n do
    local i = invmap[i_d]
    local dst_x, dst_y = 1 + (i - 1) % w, 1 + mfl((i - 1) / w)
    costsum = costsum + mab(dst_x - src_x) + mab(dst_y - src_y)
    cost[i_d] = costsum
    src_x, src_y = dst_x, dst_y
    i_d = i_d + d
  end
end
local q = io.read("*n")
for i = 1, q do
  local l, r = io.read("*n", "*n")
  print(cost[r] - cost[l])
end


Measured memory_bytes: 4480
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>

#define MAXX 21

short n,m;
short i,j,k;
std::vector<bool>the;
double ans;

double mat[MAXX][MAXX];

struct node
{
    double c[3];
    double operator *(const node &a)
    {
        double sum(0);
        for(short i(0);i<3;++i)
            sum+=pow(c[i]-a.c[i],2);
        return sum;
    }
}color[MAXX];

double get(const std::vector<bool>&a)
{
    double sum(0);
    for(short i(0);i<a.size();++i)
        if(a[i])
            for(short j(i+1);j<a.size();++j)
                if(a[j])
                    sum+=mat[i][j];
    return sum;
}

int main()
{
    scanf("%hd %hd",&n,&m);
    for(i=0;i<n;++i)
    {
        for(j=0;j<3;++j)
            scanf("%lf",color[i].c+j);
        mat[i][i]=0;
    }
    for(i=0;i<n;++i)
        for(j=i+1;j<n;++j)
        {
            mat[i][j]=color[i]*color[j];
            mat[j][i]=mat[i][j];
        }
    for(i=0;i<m;++i)
        the.push_back(true);
    for(;i<n;++i)
        the.push_back(false);
    ans=get(the);
    while(std::prev_permutation(the.begin(),the.end()))
        ans=std::max(ans,get(the));
    printf("%lf\n",ans);
    return 0;
}

Measured memory_bytes: 828
for i in range(int(raw_input())):
    sides = map(int, raw_input().split())
    if sides[0]**2 == sides[1]**2 + sides[2]**2 or\
       sides[1]**2 == sides[2]**2 + sides[0]**2 or\
       sides[2]**2 == sides[0]**2 + sides[1]**2:
           print "YES"
    else:
        print "NO"

Measured memory_bytes: 4236
S = input()
N = len(S)
mod = 10**9+7
ans = pow(2, S.count("1"), mod)

a = 0
for i, s in enumerate(S, start=1):
    if s=="1":
        a += 1
        ans += pow(2, a-1, mod)*pow(3, N-i, mod)
        ans %= mod

print(ans%mod)

Measured memory_bytes: 3188
import sys


def input():
    return sys.stdin.readline()[:-1]


N, A, B = map(int, input().split())


all_set, mod_ = divmod(N, (A+B))
#print(all_set, mod_)
if mod_ == 0:
	print(all_set*A)
elif mod_ - A >= 0:
	print(all_set*A + A)
else:
	print(all_set*A + mod_)


Measured memory_bytes: 38384
#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < b ; i++ )
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x)
#define fs first
#define sc second
#define pb push_back
#define po pop_back
#define mp make_pair  
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ller ios::sync_with_stdio(false);cin.tsie(nullptr);cout.tie(nullptr)
#define watch(x) cout << (#x) << " is #" << (x) <<"#" <<endl
#define PI 3.1415926535
using namespace std;
typedef long long ll;
typedef long double ld; 
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
const ll mod = 1e9+7;
const ll MAX = 1e5+5;
const ll inf = 1e18+7;

ll n,k,h[MAX];
ll dp[MAX];

ll DP(ll caso){
  if(caso==1) return 0;
  ll &ans = dp[caso];
  if(ans!=inf) return ans;
  f(i,caso-k,caso){
    if(i<=0) continue;
    ans = min(ans,DP(i)+abs(h[caso]-h[i]));
  }
  return ans;
}


int main() {
  fastio;
  cin>>n>>k;
  f(i,0,n+5) dp[i]=inf;
  f(i,1,n+1) cin>>h[i];
  cout<<DP(n)<<"\n";
  return 0; 
}

Measured memory_bytes: 9860
import java.util.*;

public class Main {
	public static void main(String[] args){
		new Main().calc();
	}

	String[] board;
	boolean[][] dp;
	int h,w;
	int[] vx = new int[]{1,0,-1,0};
	int[] vy = new int[]{0,1,0,-1};
	int ret = 0;

	void calc(){
		Scanner cin = new Scanner(System.in);
		while(true){
			w = cin.nextInt();
			h = cin.nextInt();
			if(w==0) break;
			int i,j;
			ret = 0;
			board = new String[h];
			dp = new boolean[h][w];
			for(i=0;i<h;i++){
				board[i] = cin.next();
			}
			for(i=0;i<h;i++){
				for(j=0;j<w;j++){
					if(board[i].charAt(j)=='@'){
						ret = 1;
						dp[i][j] = true;
						dfs(i,j);
					}
				}
			}
			System.out.println(ret);
		}
	}

	void dfs(int y, int x){
		for(int i=0;i<4;i++){
			int ny = y + vy[i];
			int nx = x + vx[i];
			if(ok(ny,nx)){
				ret++;
				dp[ny][nx] = true;
				dfs(ny,nx);
			}
		}
	}

	boolean ok(int y, int x){
		return y>= 0 && x>=0 && y<h && x<w && board[y].charAt(x)=='.' && !dp[y][x];
	}
}

Measured memory_bytes: 12000
#include <algorithm>
#include <iostream>
#include <vector>
#include <set>
#include <map>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    rep(i, 0, N){
        cin >> H[i];
    }
    int pre = -999;
    rep(i, 0, N){
        if (pre <= H[i]-1) {
          pre = H[i]-1;
        } else if (pre <= H[i]) {
            pre = H[i];
        } else {
            cout << "No" << endl;
            return 0;
        }
    }
   
    cout << "Yes" << endl;
    
    return 0;
}



Measured memory_bytes: 640
n,m = map(int,input().split())
ab = [[int(i) for i in input().split()] for j in range(m)]

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.size = [1 for _ in range(n+1)]

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

bridge = 0

for i in range(m):
    ins = UnionFind(n)
    for j in range(m):
        if j == i:
            continue
        if not ins.same_check(ab[j][0],ab[j][1]):
            ins.union(ab[j][0],ab[j][1])
        
    #print(ins.size[1],ins.size[ins.find(2)])
    if ins.size[ins.find(ab[0][0])] != n:
        bridge += 1
        
print(bridge)
    

Measured memory_bytes: 3064
n = int(input())
x = list(map(int, input().split()))
x2 = sorted(x)
median_index = len(x2) // 2
median = x2[median_index]
cnt = x2.count(median_index)
for i in range(n):
    if x[i] >= median:
        print(x2[median_index - 1])
    else:
        print(x2[median_index])

Measured memory_bytes: 26772
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
    vector<string> s(3,"");
    REP(i,3)cin>>s[i];
    REP(i,3)cout<<s[i][i];
    cout<<endl;
}

Measured memory_bytes: 256
class unionFind:
    parent = []

    def __init__(self, N):
        self.parent = [i for i in range(N)]

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            return
N,M=map(int,input().split())
G=unionFind(M)
s=set()
for i in range(N):
  tmp=tuple(map(int,input().split()))
  s.add(tmp[1]-1)
  for x in tmp[2:]:
    G.unite(tmp[1],x)

parent=set()
for i in s:
  parent.add(G.root(i))

if len(parent)==1:
  print("YES")
else:
  print("NO")
      

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

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    int b[n];
    for (int i = 0; i < n; i++){
      b[i] = a[n - i - 1];
    }
      for (int i = 0; i < n; i++)
      {
        if (i > 0)
        {
          cout << " ";
        }
        cout << b[i];
      }
    cout << endl;
}


Measured memory_bytes: 3084
A, B, C = map(int, input().split())

is_odd_list = [A % 2 == 0, B % 2 == 0, C % 2 == 0]
if all(is_odd_list) or not any(is_odd_list):
    ans = 0
else:
    if sum(is_odd_list) == 1:
        is_odd_list = [not i for i in is_odd_list]
    A = A + is_odd_list[0]
    B = B + is_odd_list[1]
    C = C + is_odd_list[2]
    ans = 1

num_list = sorted([A, B, C])
ans += (num_list[2] - num_list[0]) / 2 + (num_list[2] - num_list[1]) / 2
print(int(ans))

Measured memory_bytes: 3064
#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(){
    string s;
    cin >> s;
    int mi = inf;
    int n = s.size();
    rep(id,26){
        char  c = 'a'+id;
        bool flag = 0;
        rep(i,n){
            if(s[i]==c)flag = 1;
        }
        if(!flag)continue;
        string t = s;
        int tmp = 0;
        while(1){
            int m = t.size();
            bool ff = 1;
            rep(i,m){
                if(t[i]!=c)ff = 0;
            }
            if(ff)break;
            tmp++;
            string u;
            rep(i,m-1){
                if(t[i]==c){
                    u.push_back(c);
                }else{
                    u.push_back(t[i+1]);
                }
            }
            t = u;
        }
        chmin(mi,tmp);
    }
    cout << mi << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
 
#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 998244353;
const ll N = 2e5 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int power (int a, int b = mod - 2)
{
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}

int fac[N + 1], inv[N + 1];
inline int ncr (int x, int y)
{
    return fac[x] * inv[y] % mod * inv[x - y] % mod;
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	fac[0] = inv[0] = 1;
	FOR (i, 1, N) fac[i] = fac[i - 1] *i % mod;
	inv[N] = power(fac[N]);
	FORD (i, N - 1, 1) inv[i] = inv[i + 1] * (i + 1)%mod;
	
	readc(n, m, k);
	int sum = 0;

	FOR (i, 0, k)
	{
	    sum = (sum + m * power(m - 1, n - (i+1)) % mod * ncr(n - 1, i) % mod) % mod;
	}
	
	print(sum);
}





















Measured memory_bytes: 6784
n = gets.chomp.to_i

# rows, cols = [], []
# n.times { |i| rows[i], cols[i] = gets.chomp.split.map(&:to_i) }

pAry = Array.new(n + 1)
mAry = Array.new(n + 1) { Array.new(n + 1) }

1.upto(n) do |i|
    pAry[i - 1], pAry[i] = gets.chomp.split.map(&:to_i)
end

1.upto(n) do |i|
    mAry[i][i] = 0
end

2.upto(n) do |l|
    1.upto(n - l + 1) do |i|
        j = i + l - 1
        mAry[i][j] = Float::INFINITY
        i.upto(j - 1) do |k|
            mAry[i][j] = [mAry[i][j], mAry[i][k] + mAry[k + 1][j] + pAry[i - 1] * pAry[k] * pAry[j]].min
        end
    end
end

puts mAry[1][n]



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

int main() {
    int n, m, pos[100];
    bool masu[2020]{};
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> pos[i];
        masu[pos[i]] = true;
    }
    cin >> m;
    for(int i=0;i<m;i++){
        int a;
        cin >> a;
        a--;
        if(pos[a] < 2019 && !masu[pos[a]+1]){
            masu[pos[a]] = false;
            masu[pos[a]+1] = true;
            pos[a]++;
        }
    }
    for(int i=0;i<n;i++){
        cout << pos[i] << endl;
    }
    return 0;
}



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

int main() {

    string s;

    cin >> s;

    int C_count = 0;

    for(int i=0; i<s.size(); i++){
        if(i==0){
            if(s[i] != 'A') {
                cout << "WA" << endl;
                return 0;
            }
        }
        else if(i >= 2 && i <= s.size()-2){
            if(s[i] == 'C') {
                C_count++;
            }
        }
        else{
            if('a' > s[i] || 'z' < s[i]){
                cout << "WA" << endl;
                return 0;
            }
        }
    }

    if(C_count != 1){
        cout << "WA" << endl;
        return 0;
    }

    cout << "AC" << endl;

    return 0;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()

def main():
    N,K=mi()

    if not K <= (N-1)*(N-2)//2:
        print(-1)
        exit()


    k = (N-1)*(N-2)//2
    v = set([(1,x+1) for x in range(1,N)])


    # print(v)

    for i in range(2,N+1):
        for j in range(1,N+1):
            if k <= K: continue

            if i+j <= N and not v in (i,i+j):
                v.add((i,i+j))
                # print((i,i+j))
                k -= 1
            if k <= K:
                break
        if k <= K:
            break



    if k != K:
        print(-1)
        exit()

    print(len(v))
    for x,y in v:
        print(x,y)



if __name__ == "__main__":
  main()

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};

// Problem Specific Parameter:

int main() {
  ll a, b, c; cin >> a >> b >> c;
  if(a % 2 == 0 || b % 2 == 0 || c % 2 == 0) cout << 0 << endl;
  else {
    ll minPro = min(a*b, b*c);
    cout << min(minPro, c*a) << endl;
  }

  return 0;
}

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

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

int main(int argc, char const* argv[])
{
  int n;
  cin >> n;
  vector<ll> a, b;
  for(int i = 0; i < n; i++){
    ll x;
    cin >> x;
    a.pb(x);
  }
  for(int i = 0; i < n; i++){
    ll x;
    cin >> x;
    b.pb(x);
  }
  ll res = 0;
  for(int k = 0; k < 30; k++){
    vector<ll> bc;
    for(int i = 0; i < n; i++){
      bc.pb(b[i] % ((ll)1 << (k + 1)));
    }
    sort(bc.begin(), bc.end());
    ll tmp = 0;
    for(int i = 0; i < n; i++){
      ll val = a[i] % ((ll)1 << (k + 1));
      int l_i = lower_bound(bc.begin(), bc.end(), ((ll)1 << k) - val) - bc.begin();
      int r_i = lower_bound(bc.begin(), bc.end(), ((ll)1 << (k + 1)) - val) - bc.begin();
      tmp += r_i - l_i;
      l_i = lower_bound(bc.begin(), bc.end(), 3 * ((ll)1 << k) - val) - bc.begin();
      r_i = lower_bound(bc.begin(), bc.end(), ((ll)1 << (k + 2)) - val) - bc.begin();
      tmp += r_i - l_i;
    }
    if(tmp % 2 == 1)res += ((ll)1 << k);
  }
  cout << res << endl;
	return 0;
}


Measured memory_bytes: 9452
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#define MAXN 100000
using namespace std;
vector<int> num;
char str[MAXN+5];
int cnt[2],sum[MAXN+5];
int main()
{
	scanf("%s",str+1);
	int n=strlen(str+1),cnt=0;
	for(int i=1;i<=n;i++)
	{
		if(str[i]=='g')
			sum[i]=sum[i-1]+1;
		else
			sum[i]=sum[i-1]-1;
	}
	printf("%d\n",sum[n]/2);
	return 0;
}

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

#include <atcoder/all>
#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, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<int, int>;

class Main {
    int N, Q;
    void input() { cin >> N >> Q; }
    void output() {
        dsu d(N);
        REP(q, Q) {
            int t, u, v;
            cin >> t >> u >> v;
            if (t == 0) {
                d.merge(u, v);
            } else {
                cout << d.same(u, v) << endl;
            }
        }
    }

public:
    Main() {
        input();
        output();
    }
};

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

    Main();

    return 0;
}


Measured memory_bytes: 3884
#include<stdio.h>
int main(){
  int H,W,h,w;
  scanf("%d %d %d %d",&H,&W,&h,&w);
  int Hh,Ww;
  Hh=H-h;
  Ww=W-w;
  printf("%d\n",Hh*Ww);
  return 0;
}


Measured memory_bytes: 128
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    let a = minimum . filter (>= 0) $ map (subtract n) [1000,2000..10000]
    print a

Measured memory_bytes: 3756
#include <iostream>
 
using namespace std;
int main() {
 
    int x, y;
    char op;
    while (true) {
 	   cin >> x >> op >> y;
                  if (op == '?') break;
	    if (op == '+') cout << x + y << endl;
 	   else if (op == '-') cout << x - y << endl;
	   else if (op == '*') cout << x*y << endl;
	   else if (op == '/') cout << x/y << endl;
    }
    return 0;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // 整数スキャン（複数）
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s;
    cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s;
        cin >> s;
        slist.push_back(s);
    }
    */

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


    int ma = 0;
    int mi = 99999;

    ma = min(a,b);
    mi = max(a + b - n,0);
    
    cout << ma << ' ' << mi << endl;
    return 0;
}
 
 


Measured memory_bytes: 256
import java.math.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    while (sc.hasNext()) {
      String line = sc.next();
      boolean flag = false;
      for (char c = '0'; c <= '9'; ++c) {
        String temp = line;
        temp = temp.replace('X', c);
        String[] elem = temp.split("[^0-9]");

        boolean ok = true;
        for (int i = 0; i < 3; ++i) {
          if (elem[i].length() > 1 && elem[i].charAt(0) == '0') {
            ok = false;
          }
        }
        if (!ok) continue;

        BigInteger l1 = new BigInteger(elem[0]);
        BigInteger l2 = new BigInteger(elem[1]);
        BigInteger r = new BigInteger(elem[2]);

        l1 = l1.add(l2);
        if (l1.equals(r)) {
          System.out.println(c); flag = true; break;
        }
      }
      if (!flag) {
        System.out.println("NA");
      }
    }
    
  }
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define MOD (1000000007LL)
#define LEFT(n) (2*(n))
#define RIGHT(n) (2*(n)+1)
 
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
 
ll pwr(ll base, ll p, ll mod = MOD){
ll ans = 1;while(p){if(p&1)ans=(ans*base)%mod;base=(base*base)%mod;p/=2;}return ans;
}
 
ll gcd(ll a, ll b){
    if(b == 0)  return a;
    return gcd(b, a%b);
}

typedef vector<double> VD;
typedef vector<VD> VVD;
typedef vector<ll> VI;

ll h,w;

VI areas;
int main()
{
	scanf("%lld %lld",&h,&w);
	if(h%3 == 0 || w%3 == 0)
	{
		printf("0\n");
		return 0;
	}
	ll temp = min(h,w);
	h = max(h,w);
	w = temp;

	ll rem = h-(h)/3;
		
	areas.pb(w*((h)/3));
	areas.pb(rem*(w/2));
	areas.pb(rem*(w-w/2));
	sort(areas.begin(),areas.end());
	ll ans2 = areas[2]-areas[0];
	areas.clear();
	
	rem = h-(h+2)/3;

	areas.pb(w*((h+2)/3));
	areas.pb(rem*(w/2));
	areas.pb(rem*(w-w/2));
	sort(areas.begin(),areas.end());
	ll ans4 = areas[2]-areas[0];
	areas.clear();

	temp = h;
	h = w;
	w = temp;
	rem = h-(h)/3;
		
	areas.pb(w*((h)/3));
	areas.pb(rem*(w/2));
	areas.pb(rem*(w-w/2));
	// printf("%lld %lld %lld\n",w*((h)/3),rem*(w/2),rem*(w-w/2));
	sort(areas.begin(),areas.end());
	ll ans1 = areas[2]-areas[0];
	areas.clear();
	
	rem = h-(h+2)/3;

	areas.pb(w*((h+2)/3));
	areas.pb(rem*(w/2));
	areas.pb(rem*(w-w/2));
	sort(areas.begin(),areas.end());
	ll ans3 = areas[2]-areas[0];
	// printf("%lld %lld %lld %lld\n",ans1,ans3,ans4,ans2 );
	printf("%lld\n",min(ans1,min(ans2,min(ans3,min(ans4,min(h,w))))));
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
class Main{
	public static void main(String[] args){
    Scanner sr = new Scanner(System.in);
      int A = sr.nextInt();
      int B = sr.nextInt();
      int C = sr.nextInt();
      int K = sr.nextInt();
      //System.out.print(A +""+ B +""+C+ ""+K );
      if ( K <= A)
        System.out.print(K);
      else
        if(K <= A+B)
          System.out.print(A);
        else
          System.out.print(2*A+B-K); 
    }
}

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

int min(int a, int b){
    if (a <= b){
        return a;
    }
    else {
        return b;
    }
}

int main(void){
    int N;
    int W[N - 1];
    scanf("%d", &N);
    for (int i = 0; i < N; i++){
        scanf("%d", &W[i]);
    }


    int TOTAL = 0;
    int S1, S2;
    int ans = 100 * 100 + 1;

    for (int i = 0; i < N; i++){
        TOTAL += W[i];
    }

    for (int T = 1; T < N; T++){
        S1 = 0;
        for (int i = 0; i < T; i++){
            S1 += W[i];
        }
        S2 = TOTAL - S1;
        ans = min(ans,abs(S1 - S2));
    }

    printf("%d\n", ans);

    return 0;
}


Measured memory_bytes: 128
#include<stdio.h>
#define INF 10000000

static const int N = 100;

int min(int a, int b){ return a < b ? a : b; }

int main(){

  int i, j;
  int k, l;
  int n;
  int  p[N+1], m[N+1][N+1];
  int q;

  scanf("%d", &n);

  for ( i = 1; i <= n; i++ ){

    scanf("%d %d", &p[i-1], &p[i]);

  }

  for ( i = 1; i <= n; i++ ) {
    m[i][i] = 0;
  }
  for ( l = 2; l <= n; l++ ){
    for ( i = 0; i <= n-l+1; i++ ){
      j = i + l - 1;
      m[i][j] = INF;
      for ( k = i; k <= j-1; k++ ){ 

	q = m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j];
	m[i][j] = min(m[i][j], q);

      }
    }
  }

  printf("%d\n", m[1][n]);
  
  return 0;
}

Measured memory_bytes: 636
#include <iostream>
#include <climits>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <assert.h>
#include <vector>
#include <utility>
#include <string>
#include <bits/stdc++.h>
#include <fstream>
#include <chrono>
using namespace std;

typedef long long LL;

/*
        time complexty
auto start = chrono::steady_clock::now();
    ............

auto endd = chrono::steady_clock::now();
auto dif =   endd- start;
cout << chrono::duration<double, milli>(dif).count() <<"ms"<<endl;

*/


bool prime(LL n )
{
    if ( n < 4) return true;

    if ( (n%2 == 0) || (n%3 == 0) ) return false ;

    LL c= 5;

    while (c*c <= n  ){

        if ( (n%c==0) || (n%(c+2)==0)  ) return false ;
        c+=6;
    }
   return true;
}


LL gcd(LL one,LL two)
{
    while(two!=0)
    {
        LL t=two;
        two=one%two;
        one=t;
    }
    return one;
}

LL a , b , ans ;

int main(){

cin >>a >> b;
LL g = gcd(a , b);

for (LL i = 1 ;i*i <= g ; i++)

    if ((g%i == 0) && (g%i == 0)){
        ans+=prime(i);

        if ( (g/i) != i)  ans+= prime(g/i) ;

    }


cout <<ans<<endl;

return 0 ;
}


Measured memory_bytes: 3668
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    L = input()
    n = len(L)

    res = 0
    cnt = 0
    for i in range(n):
        if L[i] == "1":
            rest = n - (i + 1)
            res += pow(2, cnt, mod) * pow(3, rest, mod) % mod
            res %= mod
            cnt += 1

    res += pow(2, cnt, mod)
    print(res % mod)


def resolve2():
    """
    桁DP
    """
    L = input().rstrip()
    n = len(L)

    # dp[i][0]:Lを上からi桁目まで見た時、Lと一致するような組み合わせ
    # dp[i][1]:Lを上からi桁目まで見た時、L未満になるような組み合わせ
    dp = [[0] * 2 for _ in range(n + 1)]
    dp[0][0] = 1
    for i in range(1, n + 1):
        if L[i - 1] == "0":
            # 今見ている桁が0でありそれ以前の数値がLと一致していれば、i桁目まで一致する条件にあてはまる組み合わせは(0,0)のみ
            dp[i][0] = dp[i - 1][0]
            # 今見ている桁が0でありそれ以前の数値がL未満であれば、どの組み合わせでもL未満になる(0,0)(0,1)(1,0)
            dp[i][1] = (dp[i - 1][1] * 3) % mod
        else:
            # 今見ている桁が1でありそれ以前の数値がLと一致していれば、i桁目まで一致する条件にあてはまる組み合わせは(0,1),(1,0)のみ
            dp[i][0] = (dp[i - 1][0] * 2) % mod
            # 今見ている桁が1でありそれ以前の数値がL未満であれば、どの組み合わせでもL未満になる(0,0)(0,1)(1,0)
            # 今見ている桁が1でありそれ以前の数値が一致していれば、L未満になる組み合わせは(0,0)のみ
            dp[i][1] = (dp[i - 1][1] * 3 + dp[i - 1][0]) % mod

    print((dp[n][0] + dp[n][1]) % mod)


if __name__ == '__main__':
    resolve2()


Measured memory_bytes: 19640
#include<iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include<bitset>
#include<list>
#include<cassert>
#include<numeric>

using namespace std;

const int N = 2e5 + 5;
int n;
int a[N];
int dp[N];
int ind[N];
set<pair<int, int>> s;

int main() 
{
	cin >> n;
	for (int i = 0 ; i < n; i++)
	{
		cin >> a[i];
		ind[a[i]] = i;
	}
	int ans = 0;
	for (int i = 1; i <= n; i++)
	{
		if (ind[i] > ind[i - 1])
		{
			dp[i] = dp[i - 1] + 1;
		}
		else
		{
			dp[i] = 1;
		}
		ans = max(ans, dp[i]);
	}
	cout << n - ans << endl;

}


Measured memory_bytes: 2560
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

int main()
{
    int x, y;
    scanf("%d %d", &x, &y);
    printf("%d", x+y/2);
   
}


Measured memory_bytes: 3836
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
static const int MAX=101;
bool Visited[MAX]; //??\?????????????¢??????????
vector<int> Adjacency[MAX];
int dTime[MAX]; int fTime[MAX]; //?¢??????°??¶??´????¢?????????¶??´
void dfs(int j,int& clock)
{

    stack<int> S;
    S.push(j);dTime[j]=++clock;
    Visited[j]=true;
    while(!S.empty())
    {
        int p=S.top(); //???????????¶??????
        if(Adjacency[p].size()==0)
        {
            S.pop();
            fTime[p]=++clock;
            continue;
        }
        int i=0;
        if(Adjacency[p].size())
          while(Visited[Adjacency[p][i]]==true)
          {
            i++;
            if(i==Adjacency[p].size()) //???????°??????????????±?????????????
            {
                S.pop();
                fTime[p]=++clock;
                break;
            }
          }
        if(i==Adjacency[p].size()) continue;
        //if founded
        S.push(Adjacency[p][i]); dTime[Adjacency[p][i]]=++clock;
        Visited[Adjacency[p][i]]=true;
    }
}
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++) Visited[i]=false;

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

        for(int j=0;j<num;j++)
        {
            int t;
            cin>>t;
            Adjacency[p].push_back(t);
        }
    }
    int clock=0;
    for(int i=1;i<=n;i++)  //???????????????????????°DFS?£?????????????
    {
        if(Visited[i]==false) dfs(i,clock);
    }
    for(int i=1;i<=n;i++)
        cout<<i<<' '<<dTime[i]<<' '<<fTime[i]<<endl;
}

Measured memory_bytes: 3160
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, ll>;
const double PI = 3.1415926535897932;


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

	int ans;
	if (N % 2 == 1) ans = N / 2 + 1;
	else ans = N / 2;

	cout << ans << endl;

	return 0;
} 

Measured memory_bytes: 3604
N=int(input())
S=input()
a=0
l=[0]*26
for i in S:
    t=1
    for j in range(26):
        if j!=ord(i)-97:
            t*=(l[j]+1)%(10**9+7)
    a=(a+t)%(10**9+7)
    l[ord(i)-97]+=1
print(a)

Measured memory_bytes: 42460
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt(), c = sc.nextInt();
		
		if(((a == b)&&(a != c))||((a == c)&&(b != c))||((c == b)&&(a != c))){
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll INF = 1e18;
/* テンプレートここまで */
void yes(){
  cout << "yes" << endl;
  exit(0);
}

void no(){
  cout << "no" << endl;
  exit(0);
}


int main() {
  string s; cin >> s;
  sort(ALL(s));
  REP(i, s.size()-1){
    if(s[i]==s[i+1]) no();
  }
  yes();
}

Measured memory_bytes: 256
H,W,A,B = map(int, input().split())

W1 = '1' * A + '0' * (W - A)
W0 = '0' * A + '1' * (W - A)

if A > (W // 2) or B > (H // 2):
    print('No')
    exit()

if H == 1:
    print(W1)
    exit()
elif W == 1:
    for _ in range(B):
        print('1')
    for _ in range(H - B):
        print('0')
    exit()


ans = []
ans.append(W1)

for _ in range(B):
    ans.append(W0)

for _ in range(H - B - 1):
    ans.append(W1)

for i in ans:
    print(i)

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

#define pb push_back
#define mk make_pair
#define lob lower_bound
#define upb upper_bound
#define fst first
#define scd second

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

inline int read(){
	int f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
inline ll readll(){
	ll f=1,x=0;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}

const int MAXN=1e5+5,MOD=1e9+7;
int n,m,a[MAXN],b[MAXN];
pii p[MAXN];
inline int mod(int x){return x<MOD?x:x-MOD;}
struct BIT{
	int c[MAXN];
	inline int lb(int x){return x&(-x);}
	void add(int p,int v){for(;p<=n;p+=lb(p))c[p]=mod(c[p]+v);}
	int ask(int p){int r=1;for(;p;p-=lb(p))r=mod(r+c[p]);return r;}
	BIT(){}
}T;
int main() {
	n=read();m=read();
	for(int i=1;i<=n;++i)a[i]=read();
	for(int i=1;i<=m;++i)b[i]=read();
	int cnt=0;vector<int>vec;
	for(int i=1;i<=n;++i){
		if(a[i]<b[1]||a[i]>b[m])continue;
		int t=lob(b+1,b+m+1,a[i])-b;
		assert(t>1&&t<=m);
		p[++cnt]=mk(a[i]-b[t-1],b[t]-a[i]);
		vec.pb(p[cnt].scd);
	}
	sort(vec.begin(),vec.end());
	vec.erase(unique(vec.begin(),vec.end()),vec.end());
	n=cnt;sort(p+1,p+n+1);
	for(int i=1,j=1;i<=n;i=j){
		int L=p[i].fst;
		while(j<=n&&p[j].fst==L)++j;
		for(int k=j-1;k>=i;--k){
			int R=lob(vec.begin(),vec.end(),p[k].scd)-vec.begin()+1;
			if(k!=j-1&&p[k].scd==p[k+1].scd)continue;
			T.add(R,T.ask(R-1));
		}
	}
	cout<<T.ask(vec.size())<<endl;
	return 0;
}

Measured memory_bytes: 2424
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,i,sum,ans,a[100000];
    scanf("%lld",&n);
    sum=0;
    for(i=0;i<n;i++)
    {
    scanf("%lld",&a[i]);
    sum=sum+a[i];
    }
    printf("%lld",sum-n);
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>

int main(void)
{
    long int a = 1000000007, ans=1;
    int n, i;
    scanf("%d", &n);
    for(i=1;i<=n;i++){
      ans = (ans * i) % a;
    }
    printf("%lld", ans);
    return 0;
}

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

int main(){
	string s;
	cin >> s;
	if(s == "Sunny") cout << "Cloudy" << endl;
	if(s == "Cloudy") cout << "Rainy" << endl;
	if(s == "Rainy") cout << "Sunny" << endl;
}

Measured memory_bytes: 3624
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        double a = input.nextDouble();
        double b = input.nextDouble();
        double h = input.nextDouble();
        double m = input.nextDouble();

        double radian = Math.PI*2*(h/12.0 + (m/60.0)/12.0 - m / 60.0);

        double rsq = (a*a+b*b) - (2*a*b)*Math.cos(radian);

        System.out.println(Math.sqrt(rsq));

    }
}

Measured memory_bytes: 37252
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793
#define all(v) v.begin(),v.end()
typedef vector<int> vi;
typedef vector<ll> vl;
ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t=rep_jijo(n,x/2);
        return t*t%mod;
    }
    return n*rep_jijo(n,x-1)%mod;
}
ll com(ll n,ll r){
    ll x=1,y=1;
    ll tmp=n;
    while(tmp>=n-r+1){
        x=x*tmp%mod;
        tmp--;
    }
    while(r>0){
        y=y*r%mod;
        r--;
    }
    return x*rep_jijo(y,mod-2)%mod;
}

int main(){
    string s;
    cin >> s;
    bool flag=true;
    reverse(all(s));
    string a="maerd";
    string b="remaerd";
    string c="esare";
    string d="resare";
    int now=0;
    int len=s.size();
    while(now<len){
        if(!flag) break;
        string x=s.substr(now,5);
        string y=s.substr(now,7);
        string z=s.substr(now,6);
        if(x==a||x==c)now+=5;
        else if(y==b)now+=7;
        else if(z==d)now+=6;
        else flag=false;
    }
    if(flag) cout << "YES" <<endl;
    else cout << "NO" << endl; 
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int n, k, a;
    cin>>n>>k;
    if(n%k==0)
    {
        cout<<"0"<<endl;
    }
    else
    {
        a = n%k;
        n = abs(k-a);
        if(a>n)
        {
            cout<<n<<endl;
        }
        else if(n>=a)
        {
            cout<<a<<endl;
        }
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <float.h>
#include <limits>
#include <vector> 
#include <string.h>

#define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define ll long long
#define asort(a) sort(a.begin(),a.end());

using namespace::std;

int jo(ll int jxo, ll int jyo){//累乗
	ll int jhogeo = 1;
	rep(jinto,0,jyo) jhogeo=jhogeo*jxo;
	return jhogeo;
}
char tobig(char toxbig){//char大文字化
  return (toxbig-0x20);
}
char tolow(char toxlow){//char小文字化
  return (toxlow+0x20);
}
int ctoi(char cctoi){//char->int
  if('0' <= cctoi && cctoi <= '9') return (cctoi-'0');
  return -1;
}
int gcd(int gcad, int gcbd) {//最大公約数
  if(gcad < gcbd) return gcd(gcbd, gcad);
  int gcrd;
  while ((gcrd=gcad%gcbd)) {
    gcad = gcbd;
    gcbd = gcrd;
  }
  return gcbd;
}
int lcm(int lcam, int lcbm){//最小公倍数
 return (lcam*lcbm)/gcd(lcam,lcbm);
}


int main(){
  int N;
  cin>>N;
  string S;
  cin>>S;
  char a=S[0];
  int count=1;
  rep(i,1,N){
    if(a!=S[i]){
      a=S[i];
      count++;
    }
  }
  cout<<count;
}
// int *p = new int[N];

//  vector<int> 変数名(要素数);
//  sort(変数名.begin(),変数名.end());//昇順ソート

// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));

//


Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
  int n;
  int lx;
  int a,b,c;
  vector<int> l;
  int x;
  int co=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin >> lx;
    l.push_back(lx);
  }
  sort(l.begin(),l.end());
  reverse(l.begin(),l.end());
  for(int i=0;i<n-2;i++){
    c=l[i];
    x=0;
    for(int j=i+1;j<n-1;j++){
      b=l[j];
      for(int k=j+1;k<n;k++){
        a=l[k];
        if(c<(a+b)){
          co+=1;
        }else{
          if(k==j+1){x=1;}
          break;
        }
      }
      if(x==1){break;}
    }
  }
  cout << co << endl;
}


Measured memory_bytes: 256