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

int main()
{
	int N; string line,dummy;
	while(cin >> N, N)
	{
		getline(cin,dummy);

		set<string> ans,used;
		map<string,vector<string> > group;

		for(int i=0; i<N; i++)
		{
			getline(cin,line,'.');
			getline(cin,dummy);
			stringstream sin(line);
	
			string grp,name;
			getline(sin,grp,':');
			if(ans.empty()) ans.insert(grp);

			while(getline(sin,name,','))
			{
				group[grp].push_back(name);
			}
		}

		bool end=false;
		while(!end)
		{
			end=true;
			for(set<string>::iterator it=ans.begin(); it!=ans.end(); it++)
			{
				if(group.count(*it)!=0 && used.count(*it)==0)
				{
					for(int i=0; i<group[*it].size(); i++)
					{
						ans.insert(group[*it][i]);
					}
					used.insert(*it);
					end=false;
					break;
				}
			}
		}

		int cnt=0;
		for(set<string>::iterator it=ans.begin(); it!=ans.end(); it++)
		{	
			if(group.count(*it)==0) cnt++;
		}
		cout << cnt << endl;
	}
}

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

signed main(){
    int t = 1; //cin >> t;
    while(t--){
    	int n; cin >> n;
    	vector<int> a(n);
    	int XOR = 0;
    	for(int i = 0; i < n; i++)
    	{
    		cin >> a[i];
    		XOR ^= a[i];
    	}
    	for(int i = 0; i < n; i++)
    	{
    		cout << (XOR^a[i]) << " ";
    	}
    }    
}

Measured memory_bytes: 4824
// #include <algorithm>
// #include <iostream>
// #include <vector>
// using namespace std;
// typedef long long ll;

// int main() {
//   ll n, m, k;
//   cin >> n >> m >> k;
//   vector<ll> cnt(n, 0);
//   ll a, b;
//   for(int i=0; i<m; i++){
//     cin >> a >> b;
//     cnt[a-1] += 1;
//     cnt[b-1] += 1;
//   }
//   ll c, d;
//   for(int i=0; i<k; i++){
//     cin >> c >> d;
//     cnt[c-1] += 1;
//     cnt[d-1] += 1;
//   }

//   for(int i=0; i<n; i++){
//     cout << (n-1) - cnt[i];
//     if(i == n-1){
//       cout << endl;
//     }else{
//       cout << " ";
//     }
//   }

//   return 0;
// }

#include <iostream>
#include <vector>
using namespace std;
using Graph = vector<vector<int> >;

// 深さ優先探索
vector<bool> seen;
int id = 0;
vector<int> ids;
void dfs(const Graph &G, int v) {
    seen[v] = true;
    ids[v] = id;
    for (auto next_v : G[v]) { 
        if (seen[next_v]) continue;
        dfs(G, next_v); // 再帰的に探索
    }
}

int main() {
    // 頂点数と辺数
    // int N, M; cin >> N >> M;
    int n, m, k;
    cin >> n >> m >> k;
    int N = n;
    int M = m;
    // int M = m + k;

    // グラフ入力受取
    Graph G(N);
    for (int i = 0; i < M; ++i) {
        int a, b;
        cin >> a >> b;
        G[a-1].push_back(b-1);
        G[b-1].push_back(a-1);
    }

    Graph B(N);
    for (int i = 0; i < k; ++i) {
        int a, b;
        cin >> a >> b;
        B[a-1].push_back(b-1);
        B[b-1].push_back(a-1);
    }

    // 全頂点が訪問済みになるまで探索
    int count = 0;
    seen.assign(N, false);
    ids.assign(N, -1);
    for (int v = 0; v < N; ++v) {
        if (seen[v]) continue; // v が探索済みだったらスルー
        dfs(G, v); // v が未探索なら v を始点とした DFS を行う
        ++count;
        ++id;
    }
    // cout << count << endl;

    vector<int> csize(id, 0);
    for(int i=0; i<N; i++){
        csize[ids[i]]++;
        // cout << ids[i] << ",";
    }
    // cout << endl;

    // for(int i=0; i<id; i++){
    //     cout << csize[i] << ",";
    // }
    // cout << endl;

    int ans;
    for(int i=0; i<N; i++){
        ans = csize[ids[i]] - G[i].size() - 1;
        for(int j=0; j<B[i].size(); j++){
            if(ids[B[i][j]] == ids[i]) ans--;
        }
        printf("%d%c", ans, i==N-1?'\n':' ');
        // cout << ans << (i==N-1)?"\n":" ";
    }

    // for(int i=0; i<N; i++){
    //     cout << G[i].size() << " ";
    // }
    // cout << endl;
    // for(int i=0; i<N; i++){
    //     cout << B[i].size() << " ";
    // }
    // cout << endl;

}

Measured memory_bytes: 12672
#include<stdio.h>

int main(){
  int k = 0;
  int t = 0;
  int a[100] = {};
  int peak = 0;
  int removed = -1;
  int maxi = 0;
  int max = 0;
  int ah = 0;
  
  int i = 0;
  int j = 0;
  
  scanf("%d %d",&k,&t);
  for(i=0;i<t;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<k;i++){
    maxi= -1;
    max = 0;
    for(j=0;j<t;j++){
      if(a[j] > max && j != removed){
        max = a[j];
        maxi = j;
      }
    }
    if(max != 0){
      a[maxi]--;
      removed = maxi;
      //printf("/%d/",a[maxi]);
    }else{
      a[removed]--;
      ah++;
    }
  }
  
  printf("%d",ah);
  return 0;
}
  

Measured memory_bytes: 128
#include<iostream>
#include<utility>
#include<algorithm>
using namespace std;
#define INF (1<<29)



pair<int,int> doll[200];
int dp[200];


int main(){
	int n,m;
	while(cin>>n&&n){
		for(int	i=0;i<n;i++)cin>>doll[i].first>>doll[i].second;
		cin>>m;
		for(int i=0;i<m;i++)cin>>doll[n+i].first>>doll[n+i].second;
		sort(doll,doll+n+m);
		for(int i=0;i<n+m;i++)dp[i]=1;
		for(int i=0;i<n+m;i++){
			for(int j=i+1;j<n+m;j++){
				if(doll[i].first<doll[j].first && doll[i].second<doll[j].second){
					dp[j]=max(dp[j],dp[i]+1);
				}
			}
		}
		cout<<*max_element(dp,dp+n+m)<<endl;
	}
	return 0;
}

Measured memory_bytes: 1164
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		int[] ans = new int[n];
		for(int i = 0; i < m; i++){
			int a = scan.nextInt();
			int b = scan.nextInt();
			ans[a-1]++;
			ans[b-1]++;
		}

		for(int i = 0; i < n; i++){
			System.out.println(ans[i]);
		}

	}

}

Measured memory_bytes: 21204
#include<iostream>

using namespace std;

int main(){
    int n,s;cin>>n>>s;
    if(s % 1000 != 0) {
        printf("-1 -1 -1\n");
    } else {
        s /= 1000;
        for(int i = 0;i <= 20000;i++) {
            for(int j = 0;j <= 10000;j++) {
                if(i + j*5 > s) {
                    continue;
                }
                if( ((s - (i + j*5)) % 10 == 0 ) ) {
                    if(i + j + ((s - (i + j*5))/10) == n) {
                        printf("%d %d %d\n",((s - (i + j*5))/10),j,i);
                        return 0;
                    }
                }
            }
        }
        printf("-1 -1 -1\n");
    }

    return 0;
}


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

struct node {
  struct node *right;
  int key;
  struct node *left;
};
typedef struct node * NodePointer;

void init(void);
NodePointer makenode(int);
void insert(int,NodePointer);
void preorder(NodePointer);
void inorder(NodePointer);
int find(int,NodePointer);

NodePointer head, tail;

int main(){
  char str[7];
  int n,k;

  init();
  scanf("%d" ,&n);
  while(n--){
    scanf("%s" ,str);

    if(str[0] == 'i'){
      scanf("%d" ,&k);
      insert(k, head);
    }else if(str[0] == 'p'){
      inorder(head->right);
      printf("\n");
      preorder(head->right);
      printf("\n");
    }else{
      scanf("%d" ,&k);
      if(find(k,head->right)){
	printf("yes\n");
      }else{
	printf("no\n");
      }
    }
  }

  return 0;
}

void init(void){
  head=makenode(-1);
  tail=makenode(-1);
  head->right=tail;
  head->left=tail;
}

NodePointer makenode(int k){
  NodePointer x;

  x=malloc(sizeof(struct node));
  x->key = k;
  x->left = x->right = tail;

  return x;
}

void insert(int k, NodePointer p){
  if(k < p->key){
    if(p->left == tail){
      p->left = makenode(k);
    }else{
      insert(k , p->left);
    }
  }else{
    if(p->right == tail){
      p->right = makenode(k);
    }else{
      insert(k , p->right);
    }
  }
}

void preorder(NodePointer node){
  if(node != tail){
    printf(" %d", node->key);
    preorder(node->left);
    preorder(node->right);
  }
}

void inorder(NodePointer node){
  if(node != tail){
    inorder(node->left);
    printf(" %d", node->key);
    inorder(node->right);
  }
}

int find(int k,NodePointer node){
  if(node == tail){
    return 0;
  }

  if(node->key == k){
    return 1;
  }else if(node->key < k){
    return find(k , node->right);
  }else{
    return find(k , node->left);
  }
}

Measured memory_bytes: 13116
import sys


def main():
    N = int(input())
    P = tuple(map(int, input().split()))

    Kcost = [min(row, N - 1 - row, clm, N - 1 - clm) for row in range(N) for clm in range(N)]

    Sitting = [1] * (N * N)
    Kcount = 0


    def Kcheck(qsn, cdsn):
        if Kcost[cdsn] > Kcost[qsn] + Sitting[qsn]:
            Kcost[cdsn] = Kcost[qsn] + Sitting[qsn]
            queue.append(cdsn)


    for sn in P:
        csn = sn - 1
        Kcount += Kcost[csn]
        Sitting[csn] = 0
        queue = [csn]

        while queue:
            qsn = queue.pop()
            div, mod = divmod(qsn, N)
            if mod: Kcheck(qsn, qsn - 1)
            if mod != N - 1: Kcheck(qsn, qsn + 1)
            if div: Kcheck(qsn, qsn - N)
            if div != N - 1: Kcheck(qsn, qsn + N)

    print(Kcount)

if __name__ == '__main__':
    main()

sys.exit()


Measured memory_bytes: 149212
n,x= 0,0

def dfs(l: list) -> int:
    global n
    global x
    ret = 0
    if len(l) == 3:
        if sum(l) == x:
            return 1
        else:
            return 0
    s = 0
    if len(l) == 0:
        s = 1
    else:
        s = l[-1]+1
    
    for i in range(s,n+1):
        ret += dfs(l+[i])
    return ret

def main():
    global n
    global x
    while True:
        n,x = map(int,input().split())
        if n == 0:
            break
        print(dfs([]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 5600
#include<iostream>
#include<cstdio>
#include<string>
#include<math.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<map>
#include<numeric>
#include<queue>
#include<functional>
#include<cassert>
#include<set>
#define rep(a,b) for(int a=0;a<b;++a)
#define REP(a,b,c,d) for(int a=b;a<c;a+=d)
#define yes cout<<"Yes"<<endl
#define no cout<<"No"<<endl
#define mod 1000000007
using namespace std;
using ll = long long;
using p_i = pair<int, int>;
int main() {
	int a, b; cin >> a >> b;
	string ans;
	if (a == 0 || b == 0 || (a < 0 && b>0)) ans = "Zero";
	else if (a > 0)ans = "Positive";
	else if (b < 0 && -(a + b) % 2 == 0)ans = "Negative";
	else if (b < 0 && -(a + b) % 2 == 1)ans = "Positive";
	cout << ans << endl;
	cin >> a;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include<functional>
#include <tuple>
#include <map>
#include<set>
#include <cmath>
#include <stack>
#include<cstdio>
#include<stdio.h>
using namespace std;

int main() {
	long long h, w, a;
	cin >> h >> w;
	a = h*w;
	if (h != 1 && w != 1) {
		a = (h * w + 1) / 2;
		cout << a << endl;
	}
	else cout << 1 << endl;
	
}

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

int32_t main()
{
 int n,k,x,y;
  cin>>n>>k>>x>>y;
  int amt = min(k,n);
  amt *= x;
  if(k < n)
  {
    int cur = (n-k)*y;
    amt += cur;
  }
  cout<<amt<<endl;
  return 0;
}

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

#define PI 3.1415926535897932

// from https://qiita.com/drken/items/03c7db44ccd27820ea0d

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 n;
vector<double> p;

double dp[3100][3100];

int main(){
    int n,m,ans;
    scanf("%d",&n);
    p.resize(n);
    for (auto&e:p) scanf("%lf",&e);

    dp[0][0]=1.0;

    int mod=1000000007;
    for (int i=0;i<n;i++) {
        for (int j=0;j<=i;j++) {
            dp[i+1][j+1]+=dp[i][j]*p[i];
            dp[i+1][j] += dp[i][j]*(1.0-p[i]);
        }
    }
    double res=0.0;
    for (int j=(n+1)/2;j<=n;j++) res+=dp[n][j];
    cout << fixed << setprecision(10) << res << endl;
    return 0;
}


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

using namespace std;

#define fore(i, s, e) for(int i = s; i < e; i++)

int n;
const int N = 2e5;
int h[N];
int dp[N];

int calc(int i) {
    if(i == n - 1) return 0;
    int &r = dp[i];
    if(r != -1) return r;
    int res = abs(h[i] - h[i + 1]) + calc(i + 1);
    if(i < n - 2) res = min(res, abs(h[i] - h[i + 2]) + calc(i + 2));
    return r = res;
}
int main() {
    cin >> n;
    fore(i, 0, n) cin >> h[i];
    memset(dp, -1, sizeof dp);
    cout << calc(0) << endl;
    return 0;
}

Measured memory_bytes: 4608
#include <iostream>
#include <vector>
#include <string>

int main() {
    int H, W;
    std::cin >> H >> W;

    std::vector<std::string> S(H);
    for (int i = 0; i < H; i++)
        std::cin >> S[i];

    std::vector<std::vector<int>> L(H, std::vector<int>(W));
    std::vector<std::vector<int>> U(H, std::vector<int>(W));
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (S[i][j] == '#')
                continue;
            L[i][j] = i ? L[i - 1][j] + 1 : 1;
            U[i][j] = j ? U[i][j - 1] + 1 : 1;
        }
    }

    std::vector<std::vector<int>> R(H, std::vector<int>(W));
    std::vector<std::vector<int>> D(H, std::vector<int>(W));
    for (int i = H - 1; i >= 0; i--) {
        for (int j = W - 1; j >= 0; j--) {
            if (S[i][j] == '#')
                continue;
            R[i][j] = i < H - 1 ? R[i + 1][j] + 1 : 1;
            D[i][j] = j < W - 1 ? D[i][j + 1] + 1 : 1;
        }
    }

    int ans = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (S[i][j] == '#')
                continue;
            int res = L[i][j] + U[i][j] + R[i][j] + D[i][j];
            ans = std::max(ans, res - 3);
        }
    }
    std::cout << ans << "\n";
}

Measured memory_bytes: 67200
n =int(input())
A = list(map(int, input().split()))

q = int(input())

memo = {}

for a in A:
    if a in memo:
        memo[a] += 1
    else:
        memo[a] = 1

total = sum(A)

for i in range(q):
    b, c = map(int, input().split())
    if b not in memo:
        memo[b] = 0
    if c not in memo:
        memo[c] = 0

    total += (c - b) * memo[b]

    memo[c] += memo[b]
    memo[b] = 0

    print(total)


Measured memory_bytes: 23872
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

#define INF 1000000021
#define MOD 1000000007
#define pb push_back
#define sqr(a) (a)*(a)
#define M(a, b) make_pair(a,b)
#define T(a, b, c) make_pair(a, make_pair(b, c))
#define F first
#define S second
#define all(x) (x.begin(), x.end())
#define deb(x) cerr << #x << " = " << x << '\n'
#define N 222222

using namespace std;
//using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const ld pi = 2 * acos(0.0);
template<class T> bool umin(T& a, T b){if(a>b){a=b;return 1;}return 0;}
template<class T> bool umax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T, class TT> bool pal(T a, TT n){int k=0;for(int i=0;i<=n/2;i++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}

//int month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

int main()
{
	int n;
	cin >> n;
	if(n ==1)
		cout << "Hello World";
	else
	{
		int a, b;
		cin >> a >> b;
		cout << a + b;
	}





	





	getchar();
	getchar();
	return 0;
	//ios::sync_with_stdio(false);
	//cin.tie(0);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MAX (ll)(3e3 + 7)
#define INF (ll)(1e5 + 7)
#define MOD (ll)(998244353)
#define PI (double)(3.14159265)
#define IO ios_base :: sync_with_stdio (false);
#define LOG 20

using namespace std;
using ll = long long;

ll dp[MAX][MAX];
int main () {
	ll n, s;
	cin >> n >> s;
	ll ar[n];
	ll ans = 0;
	for (ll i = 0; i < n; i++) {
		dp[i][0] = 1;
		cin >> ar[i];
	}
	for (ll i = 0; i < n; i++) {
		for (ll j = 0; j < MAX; j++) {
			dp[i][j] %= MOD;
			dp[i + 1][j] += dp[i][j];
			if (j + ar[i] == s) {
				ans += (dp[i][j] * (n - i)) % MOD;
				ans %= MOD;
			}
			if (j + ar[i] < MAX) {
				dp[i + 1][j + ar[i]] += dp[i][j];
			}
		}
	}
	cout << ans << "\n";
}
		


Measured memory_bytes: 70784
#include <bits/stdc++.h> 
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x,y,z) max((x),max((y),(z)))
#define tmin(x,y,z) min((x),min((y),(z)))
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7; ll MMM=9223372036854775807;//2^63 -1
typedef vector<ll> lvec;typedef vector<double> dvec;typedef vector<string> svec;
ll GCD(ll x, ll y) {if (y == 0) return x;else return GCD(y, x % y);}
ll LCM(ll x, ll y) { return x / GCD(x, y) * y;}
//cout << fixed << setprecision(10);

int main(){
  ll n,y;
  cin>>n>>y;
  rep(i,n+1){
    if(10000*i > y) break;
    rep(j,n+1-i){
      if(10000*i + 5000*j > y) break;
      if((y-10000*i-5000*j)/1000 + i + j == n){
        cout<<i<<' '<<j<<' '<<n-i-j<<endl;
        return 0;
      }
    }
  }
  cout<<-1<<' '<<-1<<' '<<-1<<endl;
}

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

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

  map<string, ll> a;
  string s;
  for (ll i = 0; i < n; i++) {
    cin >> s; 
    a[s]++;
  }
  
  ll maxi = 0;
  vector<string> v;
  for (auto tmp : a) {
    if (maxi < tmp.second) {
      v = vector<string>{tmp.first};
      maxi = tmp.second;
    } else if (maxi == tmp.second) {
      v.push_back(tmp.first);
    }
  }

  sort(v.begin(), v.end());
  for (auto tmp : v) {
    cout << tmp << endl;
  }
}


Measured memory_bytes: 28272
#include <stdio.h>

int main() {
	int a, b, c, d;
	scanf("%d%d%d%d", &a, &b, &c, &d);
	int n;
	if (a % d == 0)n = a / d;
	else n = (a / d) + 1;
	//printf("%d", n);
	if (b * n >= c)printf("Yes");
	else printf("No");
	return 0;
}

Measured memory_bytes: 1728
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <climits>
#include <math.h>
#include <utility>
#include <ctime>
#include <cstdlib>
using namespace std;

typedef long long ll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<long long> vll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<char>> vvc;
typedef vector<vector<bool>> vvb;
typedef vector<vector<int>> vvi;

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

int main() {
	int n; cin >> n;
	cout << 800 * n - 200 * (n / 15) << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> list = new ArrayList<String>();

		String numStr = br.readLine();
		long num = Long.valueOf(numStr);

		for (long i = 0; i < num; i++) {
			String str = br.readLine();
			list.add(str);
		}

		for (String str : list) {
			String[] split = str.split(" ");
			long a = Long.valueOf(split[0]);
			long b = Long.valueOf(split[1]);
			long c = Long.valueOf(split[2]);

			ArrayList<Long> edge = new ArrayList<Long>();
			edge.add(a);
			edge.add(b);
			edge.add(c);

			Collections.sort(edge, new Comparator<Long>() {

				@Override
				public int compare(Long o1, Long o2) {
					int ret = 0;
					if (o1 > o2) {
						ret = -1;
					} else if (o1 < 02) {
						ret = 1;
					}
					return ret;
				}
			});
			String out = "";
			long ec = edge.get(0);
			long ea = edge.get(1);
			long eb = edge.get(2);

			if ((ec * ec) == ((ea * ea) + (eb * eb))) {
				out = "YES";
			} else {
				out = "NO";
			}

			System.out.println(out);
		}

	}
}



Measured memory_bytes: 26380
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
#include<stack>
#include<list>
#include<unordered_map>
#include<unordered_set>
#include<cctype>
#include<iomanip>
#include<limits>

using namespace std;
typedef long long int ll;typedef pair<int, int> P;
const long long mod = 1e9 + 7;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(a) (a).begin(),(a).end()
#define allg(a) (a).begin(),(a).end(),greater<>()
#define SUM(a) accumulate((a).begin(),(a).end(),0)
const double PI = 3.14159265359;
ll gcd(ll a, ll b) { ll t; while (b != 0) { t = a % b; a = b; b = t; }return a; }
int gcd(int a, int b) { int t; while (b != 0) { t = a % b; a = b; b = t; }return a; }

int main(void) {
	double a, b, x; cin >> a >> b >> x;
	double sum = a * a * b;
	double emp = sum - x;
	double ans = 45;
	if (x == emp) { cout << ans << endl; }
	else if (x > emp) {
		cout <<std::setprecision(10)<< std::atan(emp*2*b/(x+emp)/a) * 180 / PI << endl;
	}
	else {
		cout <<std::setprecision(10)<< 90 - (std::atan(2 * a * x / sum / b) * 180 / PI) << endl;
	}



	return 0;
}



Measured memory_bytes: 256
//四則演算 #pragma GCC target("avx")
//並列計算 #pragma GCC optimize("O3")
//条件分岐を減らす #pragma GCC optimize("unroll-loops")
//浮動小数点演算 #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }
inline void print() { cout << "\n"; }
template<class T, class... Ts>inline void print(const T& a, const Ts&... ts) { cout << a << " "; print(ts...); }
template<class T>inline void print(const vector<T>& v) { for (int i = 0; i < v.size(); ++i)cout << v[i] << (i == v.size() - 1 ? "\n" : " "); }
template<class T>inline void print(const vector<vector<T>>& v) { for (auto& a : v)print(a); }
inline string reversed(const string& s) { string t = s; reverse(all(t)); return t; }

int main() {
    init();

    string s; cin >> s;
    int n = s.length(), ans = n;
    FOR(i, 1, n)if (s[i - 1] ^ s[i]) {
        chmin(ans, max(i, n - i));
    }
    print(ans);
}


Measured memory_bytes: 512
#include<stdio.h>
#include<algorithm>
#include<stack>
#include<string.h>
#include<iostream>
using namespace std;
stack<char>q;
char w[200010];
int main()
{
    scanf("%s",w);
    int s=strlen(w);
    q.push(w[0]);
    for(int i=1; i<s; i++)
    {
        if(!q.empty())
        {
            if(q.top()=='S'&&w[i]=='T')
                q.pop();
            else
                q.push(w[i]);
        }
        else
            q.push(w[i]);

    }
    if(q.size()==0)

    {
        printf("0\n");
    }
    else
        cout<<q.size()<<endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include <fstream>
#include <time.h>
#include <iterator>


#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
//#define int long long
#define all(x) (x).begin(), (x).end()

using namespace std;

const int MOD = (ll)1000000000 + 7;
const ll INF = 1e17;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<int, int>P;

int H, W, N;
vector<int>X[200020];
int bnd[200020];
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> H >> W >> N;
	REP(i, N) {
		int x, y; cin >> x >> y;
		x--, y--;
		X[x].pb(y);
	}
	REP(i, H) {
		VSORT(X[i]);
	}
	int mx = 0;
	bnd[0] = 0;
	int cnt = 0;
	REP(i, H - 1) {
		if (binary_search(X[i + 1].begin(), X[i + 1].end(), mx)) {
			break;
		}
		else if (mx + 1 < W) {
			if (!binary_search(X[i + 1].begin(), X[i + 1].end(), mx + 1)) {
				mx++;
			}
			bnd[i + 1] = mx;
		}
		cnt++;
	}
	/*print(cnt);
	REP(i, cnt) {
		print(bnd[i]);
	}*/
	REP(i, H-1) {
		if (X[i + 1].size() == 0)continue;
		if (bnd[i] >= X[i + 1][0]) {
			print(i + 1);
			return 0;
		}
	}
	print(H); return 0;
}

Measured memory_bytes: 12032
#include<stdio.h>

int main(void){
  int i,j;
  int n,age,ans[7];

  for(;;){
    for(j=0;j<7;j++)
      ans[j]=0;
    scanf("%d",&n);
    if(n==0) break; 

    for(j=0;j<n;j++){
      scanf("%d",&age);
      if(age<10) ans[0]++;
      else if(age<20) ans[1]++;
      else if(age<30) ans[2]++;
      else if(age<40) ans[3]++;
      else if(age<50) ans[4]++;
      else if(age<60) ans[5]++;
      else ans[6]++;
    }

    for(j=0;j<7;j++)
      printf("%d\n",ans[j]);
  }
  return 0;
}

Measured memory_bytes: 0
// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░

//PointBlank's code (⌐■_■)
 
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
#define repp(i, a, b) for(int i = a; i <= b; i++)
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rrep(i, b, a) for(int i = b; i >= a; i--)
#define pb emplace_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define mem(a, b) memset(a, b, sizeof(a));
#define mem0(a) memset(a, 0, sizeof(a));
#define quickio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define in_edges(m) repp(i, 1, m){ll a, b; cin >> a >> b; v[a].pb(b), v[b].pb(a);}
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define endl "\n"
#define bitsf(n) __builtin_popcount(n)
ll power(ll x, ll y); 

const ll MOD = 1000000007;
 
int main() //PointBlank's code ¯\_(ツ)_/¯
{
    ll n, k;
	cin >> n >> k;
	ll diff;

	while(1){
		if(k < n) diff = (n - (n/k)*k);
		else diff = abs(n - k);
		if(diff < n) n = diff;
		else break;
	}

	cout << n;
}
 
ll power(ll x, ll y)
{ 
    ll res = 1; x %= MOD;
    while(y > 0){if(y & 1) res = (res*x) % MOD; y = y>>1, x = (x*x) % MOD;} 
    return res; 
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdint>
#include <vector>

int main() {
  size_t N;
  intmax_t A, B;
  scanf("%zu %jd %jd", &N, &A, &B);

  std::vector<intmax_t> X(N);
  for (auto& xi: X) scanf("%jd", &xi);

  intmax_t res = 0;
  for (size_t i = 1; i < N; ++i)
    res += std::min(A*(X[i]-X[i-1]), B);

  printf("%jd\n", res);
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;
const int INF = 1<<30;

int main(){
  string s, t;cin>>s>>t;
  map<char, int> mp, mp2;
  bool ans=true;
  for(int i=0;i<(int)s.size();i++){
  	if(mp[s[i]]==0)mp[s[i]]=int(t[i]);
    else if(mp[s[i]]!=int(t[i])){
      ans=false;break;
    }
  	if(mp2[t[i]]==0)mp2[t[i]]=int(s[i]);
    else if(mp2[t[i]]!=int(s[i])){
      ans=false;break;
    }
  }
  cout<<(ans?"Yes":"No")<<endl;
}

Measured memory_bytes: 776
import java.util.Scanner;
public class Main {
		
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char[][] inputs = {
				{' '},
				{'\'', ',', '.' , '!', '?'},
				{'a', 'b', 'c', 'A', 'B', 'C'},
				{'d', 'e', 'f', 'D', 'E', 'F'},
				{'g', 'h', 'i', 'G', 'H', 'I'},
				{'j', 'k', 'l', 'J', 'K', 'L'},
				{'m', 'n', 'o', 'M', 'N', 'O'},
				{'p', 'q', 'r' , 's', 'P', 'Q', 'R' , 'S'},
				{'t', 'u', 'v', 'T', 'U', 'V'},
				{'w', 'x', 'y', 'z', 'W', 'X', 'Y' , 'Z'},
		};
		
		while(sc.hasNext()){
			char[] in = sc.next().toCharArray();
			
			boolean find = false;
			int cur = -1;
			int count = 0;
			for(int i = 0; i < in.length; i++){
				if(!find){
					if(in[i] == '0'){
						System.out.print(inputs[cur][(count - 1) % inputs[cur].length]);
						cur = -1;
						count = 0;
						find = true;
					}else{
						if(cur != in[i] - '0' && count > 0){
							System.out.print(inputs[cur][(count - 1) % inputs[cur].length]);
							cur = in[i] - '0';
							count=1;
						}else{
							cur = in[i] - '0';
							count++;
						}
					}
				}else{
					if(in[i] == '0'){
						//System.out.println("he");
						System.out.print(inputs[0][0]);
					}else{
						find = false;
						cur = in[i] - '0';
						count++;
					}
				}
			}
			
			if(cur != -1 && count > 0){
				System.out.print(inputs[cur][(count - 1) % inputs[cur].length]);
			}
			
			System.out.println();
			
		}
	}
}

Measured memory_bytes: 12000
#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
constexpr ll INF = 1ll << 55;

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

// multi-dimensional vector (require c++14)
template <typename T, typename U>
static inline vector<U> make_nd_vector(T &&n, U &&val) noexcept {
  static_assert(is_integral<T>::value,
                "[make_nd_vector] 1st argument must be an integer type");
  return vector<U>(forward<T>(n), forward<U>(val));
}
template <typename T, typename... Args>
static inline decltype(auto) make_nd_vector(T &&n, Args &&... args) noexcept {
  static_assert(is_integral<T>::value,
                "[make_nd_vector] 1st argument must be an integer type");
  return vector<decltype(make_nd_vector(forward<Args>(args)...))>(
      forward<T>(n), make_nd_vector(forward<Args>(args)...));
}
//
// Print from Iterator
template <typename ite>
void print_ite(ite start, ite end, char sp = ' ', char en = '\n') {
  for (auto i = start; i != end; i++)
    cout << *i << sp;
  cout << en;
}
//
inline void Yes(bool condition) { cout << (condition ? "Yes\n" : "No\n"); }

int main() {
  ll a;
  string b;
  cin >> a >> b;
  int bint = b[0] - '0';
  int bdot = (b[2] - '0') * 10 + (b[3] - '0');
  cout << a * bint + a * bdot / 100 << endl;
}


Measured memory_bytes: 3176
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <functional>

using namespace std;


int main()
{
	long K, A, B;

	cin >> K >> A >> B;

	if(A%K == 0 || B%K == 0)
		cout << "OK";
	else if (A/K != B/K)
		cout << "OK";
	else if (K == 0 && A == 0)
		cout << "OK";
	else 
		cout << "NG";

	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <math.h>
using namespace std;
long long INF = 1000000009;
int main()
{
	int n, m;
	cin >> n >> m;
	vector<int> k(n);
	int num[110] = { 0 };
	for (int i = 0; i < n; i++) {
		cin >> k[i];
		vector<int> a(k[i]);
		for (int j = 0; j < k[i]; j++) {
			cin >> a[j];
			num[a[j]]++;
		}
	}
	int counter = 0;
	for (int i = 1; i <= 30; i++) {
		if (num[i] == n) {
			counter++;
		}
	}
	cout << counter << endl;
}

Measured memory_bytes: 256
N,K=map(int,input().split())
if K>(N-1)*(N-2)//2:
  print(-1)
  exit(0)
M=N-1+(N-1)*(N-2)//2-K
print(M)
for i in range(1,N+1):
  for j in range(i+1,N+1):
    print(i,j)
    M-=1
    if M==0:
      exit(0)
      



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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define int long long

signed main(){
    int x; cin >> x;
    int ans = (x/500) * 1000;
    x %= 500;
    ans += (x/5) * 5;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main(){
	int d;
	cin >> d;

    if(d==25){
        cout << "Christmas" << endl;
    }else if(d==24){
        cout << "Christmas Eve" << endl;
    }else if(d==23){
        cout << "Christmas Eve Eve" << endl;
    }else{
        cout << "Christmas Eve Eve Eve" << endl;
    }
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    bool f = false;
    if(s[0] == s[1] && s[2] == s[3]) f = true;
    if(s[0] == s[2] && s[1] == s[3]) f = true;
    if(s[0] == s[3] && s[1] == s[2]) f = true;
    if(s[0] == s[1] && s[1] == s[2] && s[2] == s[3]) f = false;
    cout << (f ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
s = str(input())
bool =False
for i in range (len(s)):
  if i % 2 == 0 and s[i] == 'L':
    bool = True
  elif i % 2 != 0 and s[i] == 'R':
    bool = True
if bool == True:
  print("No")
else:
  print("Yes")

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

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

  int K;
  cin >> K;


  long long dp[105][4][2] = {};
  // dp[i + 1][k][1] = dp[i][k][1] + dp[i][k - 1][1] * 9 + dp[i][k - 1][0] * (N[i] - '0' - 1);
  // dp[i + 1][k][0] = dp[i][k or k - 1][0];

  dp[0][0][0] = 1;
  for(int i = 1; i <= N.length(); i++){
    for(int k = 0; k <= K; k++){
      dp[i][k][1] = dp[i - 1][k][1]; // ...0...
      if(N[i - 1] != '0'){
        dp[i][k][1] += dp[i - 1][k][0];
      }
      if(k - 1 >= 0){
        dp[i][k][1] += dp[i - 1][k - 1][1] * 9; // ...*...
        dp[i][k][1] += dp[i - 1][k - 1][0] * max(0, (N[i - 1] - '0' - 1));
      }

      if(N[i - 1] != '0'){
        if(k - 1 >= 0){
          dp[i][k][0] = dp[i - 1][k - 1][0];
        }
      }else{
        dp[i][k][0] = dp[i - 1][k][0];
      }
      //cout << "i = " << i << ", k = " << k << ' ' << dp[i][k][1] << ' ' << dp[i][k][0] << endl;
    }
  }

  cout << dp[N.length()][K][1] + dp[N.length()][K][0] << endl;
}


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

#define ll long long
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ff first
#define ss second

using namespace std;

const double pi = acos(-1);
const int N = 1e6 + 6, mod = 998244353, M = 1e7 + 7;
const ll MAX = 5e18;

int n, a[N], c;

int main()
{
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
        scanf("%d", a + i);
    for(int i = 1; i < n - 1; i++){
        if(a[i] > a[i - 1])
            c += a[i] < a[i + 1];
        else
            c += a[i] > a[i + 1];
    }
    cout << c;
    return 0;
}


Measured memory_bytes: 256
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# import numpy as np
# sys.setrecursionlimit(int(pow(10,6)))
# sys.stdout = open("out.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

try:
    sys.stdin = open("input.txt", "r")
except:
    pass



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
# @lru_cache(None)
n=L()[0]
dp=[0 for i in range(n+1)]
for i in range(1,100):
    for j in range(1,100):
        for k in range(1,100):
            val=i*i+j*j+k*k+i*j+i*k+j*k
            if val<=n:
                dp[val]+=1
for i in range(1,n+1):
    print(dp[i])


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

int main()
{
    int a[2];
    while (cin >> a[0] >> a[1])
    {
        if (a[0] == 0 && a[1] == 0){
            break;
        }
        sort(a, a + 2);
        cout << a[0] << " " << a[1] << endl;
    }
}


Measured memory_bytes: 3136
#include<bits/stdc++.h>
    using namespace std;
    int main(){
    cin.tie(NULL);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    int sum=s.size();
    for(int i=0;i<sum-8;i++){
    cout<<s[i];
    }
    cout<<'\n';
    return 0;
    }

Measured memory_bytes: 256
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from collections import deque,defaultdict
from sys import stdin



def solve():
  ## input
  N = int(input())
  An = [deque([i-1 for i in list(map(int, stdin.readline().rstrip().split()))]) for _ in range(N)]

  ## solve
  Pn = set([i for i in range(N)])
  count = 0
  while len(Pn) > 0:
    Qn = set([])
    dct = defaultdict(lambda:set([]))
    for i in Pn:
      j = An[i][0]
      if i in dct[j]:
        An[i].popleft()
        if len(An[i]) > 0:
          Qn.add(i)
          Qn.add(An[i][0])
        An[j].popleft()
        if len(An[j]) > 0:
          Qn.add(j)
          Qn.add(An[j][0])
      else:
        dct[i].add(j)
    Pn = Qn
    count += 1
  for i in range(N):
    if len(An[i]) > 0:
      return -1
  return count



print(solve())

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

string s;
vector<pair<int, int>> v;

bool solve();

int main() {
  cin >> s;
  if(solve())
    cout << -1 << endl;
  else
    for(int i = 0; i < v.size(); ++i)
      cout << v[i].first << " " << v[i].second << endl;
  return 0;
}

bool solve() {
  int cnt = 0, now = 2;
  if(s[s.size() - 1] == '1' || s[0] == '0') return 1;
  while(cnt <= s.size() - 2 - cnt) {
    if(s[cnt] != s[s.size() - 2 - cnt]) return 1;
    ++cnt;
  }
  v.push_back(make_pair(1, 2));
  cnt = 3;
  for(int i = 1; cnt <= s.size(); ++i) {
    if(i <= s.size() - 2 - i) {
      if(s[i] == '1') {
        v.push_back(make_pair(now, cnt));
        now = cnt;
        ++cnt;
      }
      else {
        v.push_back(make_pair(now, cnt));
        ++cnt;
      }
    }
    else {
      v.push_back(make_pair(now, cnt));
      ++cnt;
    }
  }
  return 0;
}


Measured memory_bytes: 2420
#include<iostream>
#include<string>
#include<vector>
#include<ctime>
#include<iomanip>
#include<fstream>
#include<stack>
#include<queue>
#include<cassert>
#include<algorithm>
#include<unordered_map>
#include<map>
#include<functional>
#include<exception>
#include<utility>
#define fori(i,z,u) for(i=z;i<u;i++)
#define forz(i,m) for(i=0;i<m;i++)
#define forinc(i,z,u,inc) for(i=z;i<u;i+=inc)
using namespace std;
#define fi first
#define se second
#define vi vector<int>
#define vill vector<long long>
#define vd vector<long double>
#define vvi vector<vector<int>>
#define vs vector<string>
#define vb vector<bool>
#define ump unordered_map
#define debug(x) cout<<#x<<" : "<<x
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define pii pair<int,int>
#define pll pair<ll,ll>
//#define Onlaptop

int main()
{
	int i{ 0 }, j{ 0 }, k{ 0 }, l{ 0 }, a{ 0 }, b{ 0 }, c{ 0 }, d{ 0 }, t{ 0 }, n{ 0 };

	#ifdef Onlaptop
		fstream cin,cout;
	
		cin.open("input.txt");
		cout.open("output.txt",ios::trunc);
	#endif
	
	cin>>a>>b>>c;
	
	cout<<max(0,(c-(a-b)))<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef pair<int, int>P;
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
typedef vector<vector<ll>> mat;
typedef vector<int> vec;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
const ll mod = 1000000007;
const ll INF = mod * mod;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
ll qp(ll a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };

void solve() {
    ll a, b,c;
    cin >> a >> b >> c;

    string ans;

    if(a==b && b==c) ans = "No";
    else if(a!=b && b!=c && c!=a) ans = "No";
    else ans = "Yes";

    cout << ans << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    //cout << fixed << setprecision(10);
    solve();
    stop
        return 0;
}

Measured memory_bytes: 256
// LNU_Algotesters
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
#include <fstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL) INF;
const int MAX = 200 * 1000 + 47;


int A[MAX];
int B[MAX];
int n;

bool ok(int x)
{
    FOR(i, 0, n + n -1)B[i] = A[i] >= x;
    FOR(i, 0, n)
    {
        if (B[n-i] == B[n-i-1])return B[n-i];
        if (B[n+i-1] == B[n+i])return  B[n+i];
    }
    
    return B[0];
}


int main()
{
    scanf("%d", &n);
    FOR(i, 0, n + n - 1)scanf("%d", A + i);
    
    int l = 1, r = 2 * n;
    while(r - l > 1)
    {
        int m = (l + r) / 2;
        if (ok(m))
            l = m;
        else r = m;
    }
    printf("%d\n", l);
}



Measured memory_bytes: 1792
using System;

namespace AOJ.Volume1
{
    public class BubbleSort
    {
        public static int Main()
        {
            while (true)
            {
                int n = int.Parse(Console.ReadLine());
                if (n == 0) { break; }

                var sort = new int[n];
                for (int i = 0; i < n; i++) { sort[i] = int.Parse(Console.ReadLine()); }

                // ソート
                int change = 0;
                int tmp = 0;
                bool end = true;
                while (true)
                {
                    end = true;
                    for (int i = 0; i < n - 1; i++)
                    {
                        if (sort[i] > sort[i + 1])
                        {
                            tmp = sort[i];
                            sort[i] = sort[i + 1];
                            sort[i + 1] = tmp;

                            change++;
                            end = false;
                        }
                    }
                    if (end) { break; }
                }
                Console.WriteLine(change);
            }
            return 0;
        }
    }
}

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

int main() {
  int N,l;
  cin >> N;
  vector<int> a(N);
  for(int i=0;i<N;i++) cin >> a[i];
  double m,s,b;
  for(int i=0;i<N;i++) s+=a[i];
  m=s/N;
  l=0;
  b=abs(a[0]-m);
  for(int i=0;i<N;i++){
    if(b>abs(a[i]-m)){b=abs(a[i]-m); l=i;}
  }
  cout << l << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
    int aa, bb, cc, dd;
    int a, b, c, d;
    int fugou = 0b000;
    string output = "";
    string input;
    cin >> input;
    aa = input.at(0) - 48;
    bb = input.at(1) - 48;
    cc = input.at(2) - 48;
    dd = input.at(3) - 48;
    for (int i = 0; i < 8; i++)
    {
        a = aa;
        b = bb;
        c = cc;
        d = dd;
        output = "";
        output += to_string(aa);
        if (fugou & 0b001)
        {
            b = a + b;
            output += "+";
        }
        else
        {
            b = a - b;
            output += "-";
        }
        output += to_string(bb);
        if (fugou & 0b010)
        {
            c = b + c;
            output += "+";
        }
        else
        {
            c = b - c;
            output += "-";
        }
        output += to_string(cc);
        if (fugou & 0b100)
        {
            d = c + d;
            output += "+";
        }
        else
        {
            d = c - d;
            output += "-";
        }
        output += to_string(dd);
        if (d == 7)
        {
            output += "=7";
            cout << output << endl;
            return 0;
        }
        fugou += 0b1;
    }
    return 0;
}

Measured memory_bytes: 256