akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using vi= vector<int>;
using vvi= vector<vi>;
#define rep(i,x,n) for(int i=x; i<n; i++)
#define all(x) x.begin(), x.end()

int main(){
  int n;
  bool ans=0;

  cin >> n;
  
  rep(i,1,10){
    rep(j,i,10){
      if(i*j==n){
        ans=1;
      }
    }
  }
  if(ans){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


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

using namespace std;
using vec = vector<int>;
using mat = vector<vec>;
const int SIZE = 640;

bool solve()
{
  int n,m,t,p;
  if(n==0) return false;
  cin >> n >> m >> t >> p;
  mat kami(SIZE,vec(SIZE,0));
  int Ox=0,Oy=0;
  
  for(int x=0;x<n;++x)
    for(int y=0;y<m;++y)
    	kami[y][x]=1;
  
  for(int i=0;i<t;++i)
  {
    int d,c; cin >> d >> c;
    if(d==1)
    {
      for(int y=0;y+Oy<SIZE;++y)
      {
        for(int x=0;x<c;++x)
        {
          kami[Oy+y][Ox+2*c-x-1] += kami[Oy+y][Ox+x];
        }
      }
      Ox += c;
    }
    else if(d==2)
    {
      for(int y=0;y<c;++y)
      {
        for(int x=0;x+Ox<SIZE;++x)
        {
          kami[Oy+2*c-y-1][Ox+x] += kami[Oy+y][Ox+x];
        }
      }
      Oy += c;
    }
  }
  

  
  
  int ans = 0;
  for(int i=0;i<p;++i)
  {
    int x,y;cin >> x >> y;
    cout << kami[Oy+y][Ox+x] << endl;
  }
  
  return true;
}

int main()
{
  while(solve());
  return 0;
}


Measured memory_bytes: 4412
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >>s;
  int k;//現在の日数
  k=s.size();
  int w =0;//勝ちの数
  for(int t=0;t<k;t++){
    if(s.at(t)=='o'){
      w++;
    }
  }
  if(15-k+w>=8){
    cout <<"YES"<<endl;
  }else{
    cout <<"NO"<<endl;
  }
}

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

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int main(){
    int N;
    int d[110000];
    int i, j, k;
    int ans;

    scanf("%d", &N);

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


    qsort(d, N, sizeof(int), asc);
    ans = d[N/2] - d[N/2-1];

    //printf("%d %d",  d[N/2+1], d[N/2]);

    printf("%d", ans);

    return 0;
}

Measured memory_bytes: 1020
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int w = sc.nextInt();
			int h = sc.nextInt();
			if(w==0 && h==0) break;
			
			int[][] map = new int[h][w];
			for(int i=0;i<h;i++){
				for(int j=0;j<w;j++){
					map[i][j] = sc.nextInt();
				}
			}
			
			int[][] dp = new int[h][w];
			for(int i=0;i<w;i++){
				if(map[0][i]==0) dp[0][i] = 1;
			}
			for(int i=1;i<h;i++){
				for(int j=0;j<w;j++){
					if(map[i][j]==0){
						if(j>0 && map[i-1][j-1]==0) dp[i][j] += dp[i-1][j-1];
						if(j<w-1 && map[i-1][j+1]==0) dp[i][j] += dp[i-1][j+1];
						if(map[i-1][j]==0) dp[i][j] += dp[i-1][j];
						if(i>1 && map[i-2][j]==2) dp[i][j] += dp[i-2][j];
					}else if(map[i][j]==2){
						if(map[i-1][j]==0) dp[i][j] += dp[i-1][j];
						if(i>1 && map[i-2][j]==2) dp[i][j] += dp[i-2][j];
					}
				}
			}
			
			int sum = 0;
			for(int i=0;i<w;i++){
				sum += dp[h-1][i];
				if(h>1 && map[h-2][i]==2) sum += dp[h-2][i];
			}
			System.out.println(sum);
		}	
	}	
}

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

int main() {
	int A,B,C,D;
	cin >> A >> B >> C >> D;

	if (D < A || B < C || B == C || A == D) {
		cout << "0";
	}else if (A <= C && B <= D && B >= C) {
		cout << B - C;
	}
	else if (A >= C && B >= D && A <= D) {
		cout << D - A;
	}
	else if (C <= A && B <= D) {
		cout << B - A;
	} else {
		cout << D - C;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <unordered_set>

using namespace std;
#define INF 99999
#define _GLIBCXX_DEBUG
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define fi first
#define se second
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
using namespace std;

int main() {
    int n;
    cin >> n;
    char s1[n];
    char s2[n];
    REP(i, n) cin >> s1[i];
    REP(i, n) cin >> s2[i];

    vint v;
    bool skipFlag = false;
    REP(i, n){
        if(skipFlag){
            skipFlag = false;
            continue;
        }

        if(s1[i] == s1[i+1]){
            v.push_back(2);
            skipFlag = true;
        } else{
            v.push_back(1);
        }
    }
    if(skipFlag) v.push_back(1);
    long long sum = (v[0] == 1) ? 3: 6;
    REP(i, v.size()-1){
        if(v[i] == 1 && v[i+1] == 1){
            sum *= 2;
        } else if(v[i] == 2 && v[i+1] == 2){
            sum *= 3;
        } else if(v[i] == 1 && v[i+1] == 2){
            sum *= 2;
        } else{
            sum *= 1;
        }
    }
    cout << sum % 1000000007;


    return 0;
}


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

int main () {
    string o, e;
    cin >> o >> e;
    string res;
    for (int i = 0; i < o.length() - 1; i++) {
        res.push_back(o[i]);
        res.push_back(e[i]);
    }
        res.push_back(o[o.length() - 1]);
    if (o.length() == e.length()) {
        res.push_back(e[o.length() - 1]);
    }
    cout << res << endl;
}

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

int main() {
  int n;
  cin >> n;
  vector<long long int> a(n);
  vector<int> b(n);

  for(int i=0;i<n;i++) cin >> a[n-1-i] >> b[n-1-i];
  long long int times = 0;
  for(int i=0;i<n;i++) {
    int r = (a[i] + times) % b[i];
    if(r) times += b[i] - r;
  }

  cout << times << endl;
}

Measured memory_bytes: 1408
n = int(input())
x=list(map(int,input().split()))
ans = 9999999999999999
far = 0
for j in range(1,101):
    for k in range(n):
        far += (x[k] - j) ** 2
    ans = min(far,ans)
    far = 0
print(ans)
    

Measured memory_bytes: 2940
import sys
from fractions import gcd
from functools import reduce
from itertools import combinations
from random import random

import numpy as np

sys.setrecursionlimit(200000)


class Solver:
    def __init__(self):
        pass

    def input(self):
        """
            faster input function than builtin stdin.
        """
        return sys.stdin.readline()[:-1]

    def ii(self, t: type = int):
        """
            input single value.
        """
        return t(self.input())

    def il(self, t: type = int):
        """
            input single line.
        """
        return list(map(t, self.input().split()))

    def imi(self, N: int, t: type = int):
        return [self.ii(t) for _ in range(N)]

    def iml(self, N: int, t: type = int):
        return [self.il(t) for _ in range(N)]

    def solve(self):
        N = self.ii()
        d = self.il()
        ans = 0
        for x, y in combinations(d, 2):
            ans += x * y
        return ans


if __name__ == "__main__":
    solver = Solver()
    print(solver.solve())


Measured memory_bytes: 13652
#!/usr/bin/env python3
# coding=utf-8

import sys

a, b, c, d = sys.stdin.readline().split(" ")
a = int(a)
b = int(b)
c = int(c)
d = int(d)

if a + b > c + d:
    print("Left")
elif a + b < c + d:
    print("Right")
else:
    print("Balanced")


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
const ld EPS = 1e-10;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

int main(){
    int N;
    cin >> N;
    ll A[N];
    rep(i, N) cin >> A[i];
    sort(A, A+N, greater<ll>());
    ll ans = A[0];
    rep2(i, 1, (N-2)/2) ans += 2*A[i];
    if(N%2 == 1){
        ans += A[(N-1)/2];
    }
    cout << ans << endl;
}

Measured memory_bytes: 5200
N, W = map(int, input().split())
x = []
for i in range(N):
    w, v = map(int, input().split())
    x.append((w, v))
dp = [[0] * (W+1) for _ in range(N+1)]
for i in range(1, N+1):
    w, v = x[i-1]
    for sum in range(W+1):
        if sum >= w:
            dp[i][sum] = max(dp[i-1][sum-w]+v, dp[i-1][sum])
        else:
            dp[i][sum] = dp[i-1][sum]
ans=-1
for j in range(W+1):
    ans=max(ans,dp[N][j])
print(ans)

Measured memory_bytes: 119916
#include<stdio.h>
int main()
{
    int a,b,n,ax,bx,j,x,l;
    scanf("%d%d%d",&x,&a,&b);
    if(a>x)
    ax=a-x;
    else
    ax=x-a;
    if(b>x)
    bx=b-x;
    else
    bx=x-b;
    if(ax>bx)
    printf("B");
    else
    printf("A");

}


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

// dp[i][j][k]
// i:確定している桁数（最大100桁だが少し多めに）
// j:Kより、0から3まで調べる必要がある
// k:N未満(1)か否(0)か
int dp[105][4][2];

int main() {

  string N;
  cin >> N;

  int K;
  cin >> K;

  // 桁数
  int n = N.size();

  // 初期化  
  dp[0][0][0] = 1;

  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 4; j++) {
      for (int k = 0; k < 2; k++) {

        // 1桁ずつ見ていく
        int c_ = N[i] - '0';
        
        for (int c = 0; c < 10; c++) {
          
          // 値を入れる場所を決める
          int i_ = i + 1;
          int j_ = j;
          int k_ = k;
          
          // j が 0 じゃない場合は次(j_++)を見るが
          // K を超えていたらこのループは終わり
          if (c != 0) {
            j_++;
          }
          if (j_ > K) {
            continue;
          }

          // k が N 未満か確定していないときは
          // 見ている桁の値(c_)が c 未満だと確定できないので、このループは終わり
          // 見ている桁の値(c_)が c を超えると N 未満が確定する
          if (k_ == 0) {
            if (c_ < c) {
              continue;
            } else if (c < c_) {
              k_ = 1;
            }
          }

          // 決めた場所に値を入れる
          dp[i_][j_][k_] += dp[i][j][k];

        }
      }
    }
  }

  // n 桁の値で 0 じゃない数字が K 個あって、
  // N 未満が確定している場合と確定していない場合の値を足したものが答え
  int answer = dp[n][K][0] + dp[n][K][1];

  cout << answer << endl;

  return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	string n;
	cin >> n;
	if (n[n.size() - 1] == '3') {
		cout << "bon" << endl;
	}
	else if (n[n.size() - 1] == '0' || n[n.size() - 1] == '1' || n[n.size() - 1] == '6' || n[n.size() - 1] == '8') {
		cout << "pon" << endl;
	}
	else {
		cout << "hon" << endl;
	}
	return 0;
}


Measured memory_bytes: 3624
import sys
from collections import defaultdict
import heapq

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

ABcnt = defaultdict(lambda: 0)
Acnt = defaultdict(lambda: 0)
Bcnt = defaultdict(lambda: 0)
for a, b in zip(A, B):
    ABcnt[a] += 1
    Acnt[a] += 1
    ABcnt[b] += 1
    Bcnt[b] += 1

for _, cnt in ABcnt.items():
    if cnt > N:
        print('No')
        sys.exit()

hq = [(-1 * cnt, k) for k, cnt in ABcnt.items()]
heapq.heapify(hq)
a2b = defaultdict(lambda: [])
arest = []
brest = []
while len(hq) > 1:
    cnt1, k1 = heapq.heappop(hq)
    cnt2, k2 = heapq.heappop(hq)
    if Acnt[k1] == 0:
        brest += [k1]*(-1 * cnt1)
        heapq.heappush(hq, (cnt2, k2))
        continue
    elif Bcnt[k1] == 0:
        arest += [k1]*(-1 * cnt1)
        heapq.heappush(hq, (cnt2, k2))
        continue
    elif Acnt[k2] == 0:
        brest += [k2]*(-1 * cnt2)
        heapq.heappush(hq, (cnt1, k1))
        continue
    elif Bcnt[k2] == 0:
        arest += [k2]*(-1 * cnt2)
        heapq.heappush(hq, (cnt1, k1))
        continue
    a2b[k1].append(k2)
    Acnt[k1] -= 1
    Bcnt[k2] -= 1
    if cnt1 < -1:
        heapq.heappush(hq, (cnt1 + 1, k1))
    if cnt2 < -1:
        heapq.heappush(hq, (cnt2 + 1, k2))
while len(hq) > 0:
    cnt, k = heapq.heappop(hq)
    if Acnt[k] == 0:
        brest += [k] * (-1 * cnt)
    elif Bcnt[k] == 0:
        arest += [k] * (-1 * cnt)
    else:
        a2b[k].append(brest.pop())
        Acnt[k] -= 1
        if cnt < -1:
            heapq.heappush(hq, (cnt+1, k))

ans = []
for a in A:
    if len(a2b[a]) != 0:
        ans.append(a2b[a].pop())
    else:
        ans.append(brest.pop())
print('Yes')
print(' '.join(map(str, ans)))


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

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int MOD = 1e9 + 7;
ll fact[999999];
ll ifact[999999];

ll modpow(ll a, ll b)
{
	ll r = 1;
	while(b)
	{
		if(b&1) r = (r*a)%MOD;
		a = (a*a)%MOD;
		b>>=1;
	}
	return r;
}

ll inv(ll x)
{
	return modpow(x, MOD - 2);
}

ll mult(ll a, ll b)
{
	return (a*b)%MOD;
}

ll add(ll a, ll b)
{
	return (a+b)%MOD;
}

ll subtract(ll a, ll b)
{
	return (add(a, -b)+MOD)%MOD;
}

ll calc(ll x1, ll y1, ll x2, ll y2)
{
	//if(!(x2>=x1&&y2>=y1)){exit(0);}
	if(x2<x1||y2<y1) return 0;
	ll x = x2 - x1;
	ll y = y2 - y1;
	return mult(fact[x+y], mult(ifact[x], ifact[y]));
}
ii vec[1111111];
ll dp[1000101];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	//freopen("countways.in", "r", stdin);
	fact[0] = 1; ifact[0] = 1;
	for(ll i = 1; i <= 999999; i++)
	{
		fact[i] = mult(fact[i-1], i);
		ifact[i] = mult(ifact[i-1], inv(i));
	}
	int t = 1;
	while(t--)
	{
		ll n, m, k; cin >> n >> m >> k;
		
		for(int i = 0; i < k; i++)
		{
			ll x, y;
			cin >> x >> y;
			vec[i] = ii(x, y);
		}
		vec[k] = ii(n, m);
		sort(vec, vec + k + 1);
		//dp.resize(k+1);
		for(int i = 0; i < k + 1; i++)
		{
			//if(!(vec[i].fi>=1&&vec[i].se>=1)) return 0;
			ll x = calc(1, 1, vec[i].fi, vec[i].se);
			dp[i] = x;
			//dp.pb(calc(1, 1, vec[i].fi, vec[i].se));
		}
		
		for(int j = 0; j < k + 1; j++)
		{
			for(int i = 0; i < j; i++)
			{
				if(vec[i].fi <= vec[j].fi && vec[i].se <= vec[j].se)
				{
					dp[j] = subtract(dp[j], mult(dp[i], calc(vec[i].fi, vec[i].se, vec[j].fi, vec[j].se)));
				}
			}
		}
		cout << dp[k] << '\n';
		
	}
	//cout<<"3\n1";
}


Measured memory_bytes: 18688
import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy

N = int(input())
S = input()
K = int(input())
ans = []
SK = S[K-1]
for si in S:
    ans.append(si if si == SK else '*')
print(''.join(ans))


Measured memory_bytes: 4720
use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let a: Vec<usize> = (0..n)
        .map(|_| itr.next().unwrap().parse().unwrap())
        .collect();

    const MOD: usize = 1_000_000_007;
    let mut cnt = vec![0; n + 1];

    let mut ans = 1;
    for i in 0..n {
        if a[i] == 0 {
            ans = ans * (3 - cnt[a[i]]) % MOD;
        } else {
            ans = ans * (cnt[a[i] - 1] - cnt[a[i]]) % MOD;
        }
        cnt[a[i]] += 1;
    }
    println!("{}", ans);
}


Measured memory_bytes: 4252
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <deque>
#include <set>
#include <numeric>
using namespace std;
using ll = long long;
using ld = long double;

const ll MOD = 998244353;
const ll INF = 1e+9;
const ld PI = acos((long double)(-1));

#define no "no"
#define No "No"
#define NO "NO"
#define yes "yes"
#define Yes "Yes"
#define YES "YES"
#define next '\n'
#define sp " "
#define print(x) cout << (x) << endl;
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(elem, _list) for(auto& (elem) : (_list))
#define view(_list) foreach(e, _list){ cout << e << sp; } cout << next
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define ALL(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e)
#define EPS 0.00000001

int main() {
    FAST;

    char a;
    cin >> a;

    if(a >= 'A' && a <= 'Z'){
        print('A');
    }else{
        print('a');
    }
}


Measured memory_bytes: 3608
package main

import (
	"bufio"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"strconv"
	"strings"
)

func (p *problem) solve() {
	abc := strings.Split("abcdefghijklmnopqrstuvwxyz", "")
	N := p.NextInt()
	S := p.Next()
	var max int
	for sep := 1; sep < N; sep++ {
		var cnt int
		pre, suf := S[:sep], S[sep:]
		for _, s := range abc {
			if strings.Contains(pre, s) && strings.Contains(suf, s) {
				cnt++
			}
		}
		if cnt > max {
			max = cnt
		}
	}
	p.PrintInt(max)
}

var (
	debug  bool
	output string
)

func main() {
	flag.BoolVar(&debug, "debug", false, "Print debug logs")
	flag.BoolVar(&debug, "d", false, "Print debug logs")
	flag.StringVar(&output, "output", "stdout", "Specify output target (Default: stdout)")
	flag.StringVar(&output, "o", "stdout", "Specify output target (Default: stdout)")
	flag.Parse()

	if debug {
		out := os.Stdout
		if output != "stdout" {
			logfile, err := os.OpenFile(output, os.O_CREATE|os.O_WRONLY, 0666)
			if err != nil {
				panic(err)
			}
			defer logfile.Close()
			out = logfile
		}
		log.SetOutput(out)
	} else {
		log.SetOutput(ioutil.Discard)
	}

	p := problem{
		in:  bufio.NewReader(os.Stdin),
		out: bufio.NewWriter(os.Stdout),
	}
	p.solve()

	if err := p.out.Flush(); err != nil {
		panic(err)
	}
}

type problem struct {
	in  *bufio.Reader
	out *bufio.Writer
}

func (p *problem) PrintInt(d int) {
	p.Printf("%d\n", d)
}

func (p *problem) Printf(format string, a ...interface{}) {
	if _, err := fmt.Fprintf(p.out, format, a...); err != nil {
		panic(err)
	}
}

func (p *problem) Printfln(format string, a ...interface{}) {
	if _, err := fmt.Fprintf(p.out, fmt.Sprintf("%v\n", format), a...); err != nil {
		panic(err)
	}
}

func (p *problem) NextInt() int {
	return stoi(p.Next())
}

func (p *problem) NextInts() []int {
	line := p.NextSSLine()
	ds := make([]int, len(line))
	for i, s := range line {
		ds[i] = stoi(s)
	}
	return ds
}

func (p *problem) NextSSLine() []string {
	return strings.Split(p.Next(), " ")
}

// Next reads line and return string.
func (p *problem) Next() string {
	var b []byte
	for {
		l, pre, err := p.in.ReadLine()
		if err != nil {
			panic(err)
		}
		b = append(b, l...)
		if !pre {
			break
		}
	}
	return string(b)
}

func stoi(s string) int {
	i, err := strconv.Atoi(s)
	if err != nil {
		fmt.Println(i)
		fmt.Println(err)
	}
	return i
}


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

S=[]
N_AC=0
N_WA=0
N_TLE=0
N_RE=0

for i in range(0,N,1):
  ip=input()
  S.append(ip)
  if ip=="AC":
    N_AC+=1
  elif ip=="WA":
    N_WA+=1
  elif ip=="TLE":
    N_TLE+=1
  else:
    N_RE+=1

print("AC x "+str(N_AC))
print("WA x "+str(N_WA))
print("TLE x "+str(N_TLE))
print("RE x "+str(N_RE))

Measured memory_bytes: 16328
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
        int n;
        cin >> n;
        float a[10];
        string b[10];
        float ans;
        float sum = 0;

        for(int i = 1; i <= n; i++){
                cin >> a[i-1];
                cin >> b[i-1];
                if(b[i-1] == "BTC"){
                        ans = a[i-1] * 380000;
                }else{
                        ans = a[i-1];
                }
                sum = sum + ans;
        }
        cout << sum << endl;

        return 0;
}


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

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

using namespace std;

const int INF=1<<29;

int main(){
	int n,m,W; scanf("%d%d%d",&n,&m,&W); m--;
	vector<int> floor[10000],a; // eKÉ é×¨, ×¨Ìd³
	rep(i,n){
		int k; scanf("%d",&k);
		floor[i].resize(k);
		rep(j,k){
			int w; scanf("%d",&w);
			floor[i][j]=a.size();
			a.push_back(w);
		}
	}

	static int sum[1<<15];
	rep(S,1<<a.size()) rep(i,a.size()) if(S&(1<<i)) sum[S]+=a[i];

	static int dp[1<<15];
	rep(S,1<<a.size()) dp[S]=(S==0?0:INF);
	rep(S,1<<a.size()) for(int T=S;T;T=T-1&S) {
		if(sum[T]<=W) dp[S]=min(dp[S],dp[S-T]+1);
	}

	int top=0;
	rep(i,n) if(floor[i].size()>0) top=i;

	if(top==0){ puts("0"); return 0; }

	int ans=abs(m-top),S=0;
	for(int i=top;i>0;i--){
		rep(j,floor[i].size()) S|=1<<floor[i][j];
		ans+=2*dp[S]-1;
	}
	printf("%d\n",ans);

	return 0;
}

Measured memory_bytes: 1148
#include<cstdio>
#include<vector>
#include<algorithm>

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

using namespace std;

const int V_MAX=1000;

bool augment(int u,bool *vis,int match[2][V_MAX],const vector<int> *G){
	if(u==-1) return true;

	rep(i,G[u].size()){
		int v=G[u][i];
		if(!vis[v]){
			vis[v]=true;
			if(augment(match[1][v],vis,match,G)){
				match[0][u]=v;
				match[1][v]=u;
				return true;
			}
		}
	}
	return false;
}

int bipartite_matching(int L,int R,const vector<int> *G){
	static int match[2][V_MAX];
	rep(u,L) match[0][u]=-1;
	rep(v,R) match[1][v]=-1;

	int res=0;
	static bool vis[V_MAX];
	rep(u,L){
		rep(v,R) vis[v]=false;
		if(augment(u,vis,match,G)) res++;
	}
	return res;
}

int main(){
	for(int n;scanf("%d",&n),n;){
		int m; scanf("%d",&m);
		vector<int> me(m);
		rep(i,m) scanf("%d",&me[i]);
		sort(me.begin(),me.end());
// me can be duplicate!!!!!!!!!!!!!!!!!!!! EVIL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

		// girlfriend -> date
		vector<int> G[V_MAX];
		rep(u,n){
			scanf("%d",&m);
			rep(i,m){
				int girl; scanf("%d",&girl);
// girl can be duplicate!!!!!!!!!!!!!!!!!!!! EVIL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
				if(binary_search(me.begin(),me.end(),girl)){
					int v=lower_bound(me.begin(),me.end(),girl)-me.begin();
					G[u].push_back(v);
				}
			}
		}
		printf("%d\n",bipartite_matching(n,me.size(),G));
	}

	return 0;
}

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

using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

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


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  ll N; cin >> N;
  // ll N, K; cin >> N >> K;
  // ll x, y, z; cin >> x >> y >> z;
  // ll a, b, c; cin >> a >> b >> c;
  // string s; cin >> s;
  vector<ll> a(N); rep(i, N) cin >> a[i];
  reverse(a.begin(), a.end());
  ll ans = 0;
  vector<ll> w(N + 1, 0);
  rep(i, N) {
    w[i + 1] = (w[i] + a[i]) % MOD; 
  }
  rep(i, N) {
    ans += (a[i] * w[i]) % MOD;
    ans %= MOD;
  }
  
  cout << ans << endl;
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}


Measured memory_bytes: 6488
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

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

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

signed main() {
  ll N;
  cin >> N;
  vll A(N);
  ld sum = 0;
  rep(i, N) {
    cin >> A[i];
    sum += 1 / (ld)A[i];
  }

  ld gyaku = 1.0 / sum;
  COUTF(gyaku);

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define    ll long long
#define    pb          push_back
#define    m_p(a,b)    make_pair(a,b)
#define    inp(x)      scanf("%d",&x)
#define    lnp(x)      scanf("%lld",&x)
#define    ff          first
#define    ss          second
#define    srt(v)      sort(v.begin(),v.end())

ll n;
ll arr[200000];
ll dp[200000];

ll solve(ll i)
{
    //cout << i <<" " << sum << endl;
    if(dp[i] != -1) return dp[i];
    if(i == n){
       return 0;
    }
    ll ret1 = 1000000000000;

    if(i+1 <= n ){
        ret1 = min(ret1,abs(arr[i] - arr[i+1]) + solve(i+1));
    }
    //cout << i <<" " << ret1 << endl;
    if(i+2 <= n){
        ret1 = min(ret1,abs(arr[i] - arr[i+2]) + solve(i+2));
    }
    dp[i] = ret1;
    return dp[i];
}
/*
6
30 10 60 10 60 50
*/
int main()
{
    lnp(n);
    for(ll i = 1;i <= n;i++){
        lnp(arr[i]);
    }

    ll ans = 0;
    memset(dp,-1,sizeof dp);

    ans = solve(1);
//    for(ll i = 1;i <= n;i++){
//        cout << dp[i] <<" ";
//    }
//    cout << endl;
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 5760
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
#include <map>
#include <queue>
    
#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)

using namespace std;
using ll = long long;
using P = pair<int, int>;
using TP = tuple<ll, ll, ll>;
ll MOD = 1e9+7;
const int INF = 1000*1000*1000;
const ll LINF = (ll)1e18;
int xv[4] = {-1, 1, 0, 0};
int yv[4] = {0, 0, -1, 1};

ll dp[100002][4];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string S;
    cin >> S;
    
    REP(i, 100002){
        REP(j,4){
            dp[i][j] = 0;
        }
    }
    dp[0][0] = 1;
    
    REP(i, S.size()){
        REP(j, 4){
            if(S[i] != '?'){
                dp[i+1][j] += dp[i][j]; dp[i+1][j] %= MOD;
            }
            else{
                dp[i+1][j] += dp[i][j] * 3 % MOD;
            }
        }
        if(S[i] == 'A' || S[i] == '?'){ dp[i+1][1] += dp[i][0]; dp[i+1][1] %= MOD;};
        if(S[i] == 'B' || S[i] == '?'){ dp[i+1][2] += dp[i][1]; dp[i+1][2] %= MOD;};
        if(S[i] == 'C' || S[i] == '?'){ dp[i+1][3] += dp[i][2]; dp[i+1][3] %= MOD;};
    }
    cout << dp[S.size()][3] << endl;
    
    return 0;
}


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

int main(){
	int d, n;
	cin >> d >> n;
	if(n<100) cout << n;
	else cout << 101;
	if(d==0) cout << endl;
	else if(d==1) cout << "00" << endl;
	else if(d==2) cout << "0000" << endl;
}

Measured memory_bytes: 384
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,fma,tune=native")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int  ,int > pii;
typedef pair<ll  ,ll > pll;

const ll maxn =2e6;
const ll mod = 1e9+7;
const ld PI = 4 * atan((ld) 1);

#define pb(x) push_back(x);
#define endl '\n'
#define dokme(x) cout << x ;  return(0);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_init freopen("input.txt", "r+", stdin); freopen("output.txt", "w+", stdout);
#define ms(x , y) memset(x , y , sizeof x);
ll pw(ll a, ll b) {
    return (!b ? 1 : (b & 1 ? a * pw(a * a % mod, b / 2) % mod : pw(a * a % mod, b / 2) % mod));
}

int a , b , c;

int main(){
    migmig
    cin >> a >> b >> c;
    set < int > st;
    st.insert(a);
    st.insert(b);
    st.insert(c);
    cout << ((st.size() == 2)?"Yes":"No");


    return(0);
}


//When we hit our lowest point, we are open to the greatest change.
//If I try, I fail. If I don't try, I'm NEVER GOING TO GET IT.
//Sometimes, life is like this dark tunnel. You can't always see the light at the end of the tunnel. But if you just keep moving... you will come to a better place.
//It is important to draw wisdom from diffrent places. If you take it from only one place it becomes rigid and stale.


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

const ll mod=1e9+7;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

mint dp0[2005][2005],dp1[2005][2005];
//dp0:=iを増やせる、dp1:=jを増やせる


int main(){
    int n,m;
    cin >> n >> m;
    vector<int> s(n+1),t(m+1);
    rep(i,n){
        cin >> s[i];
    }
    rep(i,m){
        cin >> t[i];
    }
    dp0[0][0]=1;
    rep(i,n+1){
        rep(j,m+1){
            dp0[i+1][j]+=dp0[i][j];
            dp1[i][j]+=dp0[i][j];
            dp1[i][j+1]+=dp1[i][j];
            if(s[i]==t[j]){
                dp0[i+1][j+1]+=dp1[i][j];
            }
        }
    }
    mint ans=dp1[n][m];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 66464
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
using ll = long long;

int main(){
    int n; cin >> n;
    vector<int> cnt(n,0);
    rep(i,n){
        int c; cin >> c;
        c--;
        if(c != 0) cnt[c] = cnt[c-1]+1;
        else cnt[c]++;
    }
    int nmax = 0;
    rep(i,n) nmax = max(nmax,cnt[i]);
    cout << n-nmax << endl;
}

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

int main(void){
  int i, n, judge, taro = 0, hanako = 0;
  char taroC[101], hanakoC[101];

  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf(" %s %s", taroC, hanakoC);
    judge = strcmp(taroC, hanakoC);
    if(judge > 0){
      taro += 3;
    }else if(judge < 0){
      hanako += 3;
    }else{
      taro++;
      hanako++;
    }
  }
  printf("%d %d\n", taro, hanako);
  return 0;
}



Measured memory_bytes: 2060
#include<cstdio>
#include<algorithm>
using namespace std;
int n,m,i,a[105],ans=0;
int main()
{
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++)scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	for(i=1;i<=n;i++)
	{
		if(m>=a[i])
		{
			ans++;
			m-=a[i];
		}
	}
	if(ans==n&&m>0)ans--;
	printf("%d\n",ans);
	return 0;
} 

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

if sum(a)<sum(b):
    print(-1)
    exit()

sa=[]
cnt=0
ans=0
for ai, bi in zip(a, b):
    sa.append(ai-bi)
    if ai<bi:
        cnt+=bi-ai
        ans+=1
sa.sort(reverse=True)

for sai in sa:
    if cnt<=0:
        break
    cnt-=sai
    ans+=1

print(ans)


Measured memory_bytes: 18356
/*
    JAI JAGANNATH!
*/
//@Author : zanj0
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int lli;
#define ff              first
#define ss              second
#define pb              push_back
#define mp              make_pair
#define pii             pair<lli,lli>
#define vi              vector<lli>
#define mii             map<lli,lli>
#define pqb             priority_queue<lli>
#define pqs             priority_queue<lli,vi,greater<lli> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            lli x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update> pbds;
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;

void zanj0()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

}
void solve() {
	lli ret = 0;
	lli n, m, x;
	cin >> n >> m >> x;
	vector <lli> v1(n);
	vector <lli> v2(m);
	lli sum = 0;
	for (lli i = 0; i < n; i++) {
		cin >> v1[i];
	}
	for (lli i = 0; i < m; i++) {
		cin >> v2[i];
	}
	lli i = 0;
	while (i < n && sum + v1[i] <= x) {
		sum += v1[i];
		ret = i + 1;
		i++;
	}
	i--;
	lli j = 0;
	while (i >= -1 && j < m) {

		while (j < m && sum + v2[j] <= x) {
			lli cnt = j + 1 + i + 1;
			ret = max(ret, cnt);
			sum += v2[j];
			j++;
		}
		if (i >= 0) {
			sum -= v1[i];

		}
		i--;
	}
	cout << ret << endl;
}
int main()
{
	zanj0();
	solve();
	return 0;
}

Measured memory_bytes: 6396
#include<iostream>
#include <string>
#include <stdio.h>
using namespace std;

int main()
{
    //　数値の定義
    int S; //人数
    int W;
    cin >> S;
    cin >> W;
    
    
    //判定
    if(S<=W){
        cout << "unsafe" << endl;
    }else{
        cout << "safe" << endl;
    }

    return 0;
}

Measured memory_bytes: 3104
class UnionFind():
    def __init__(self, N):
        #頂点0からNまでを扱う
        self.table = [-1] * (N+1)      #頂点から繋がる先のtable, -1が根を表す
        self.sizetable = [1] * (N+1) #根から繋がる要素数, 根以外は0
    def root(self, x): # 根を探す
        while self.table[x] >= 0: #繋がる先を辿っていく
            x = self.table[x]
        return x
    def unite(self, x, y): #頂点x, yをまとめる
        rx = self.root(x)
        ry = self.root(y)
        if rx != ry: #根が同じならまとめなくていい
            #多い方にまとめる
            if self.sizetable[rx] < self.sizetable[ry]:
                rx, ry = ry, rx
            self.sizetable[rx] += self.sizetable[ry] #要素数を移す
            self.sizetable[ry] = 0 #小さい方の根のフラグを消す
            self.table[ry] = rx      #小さい方の根だったものを大きい方につなぐ
        return
    def same(self, x, y): #同じ木にいるか
        return self.root(x) == self.root(y)
    def size(self, x): #頂点xが所属する木の要素数
        return self.sizetable[self.root(x)]
    
#####
N, M = map(int, input().split())
uf = UnionFind(N)
for i in range(M):
    ui, vi, wi = map(int, input().split())
    uf.unite(ui, vi)
print(sum([t > 0 for t in uf.sizetable[1:]]))

Measured memory_bytes: 7764
#include <bits/stdc++.h>
  
using namespace std;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
  
// #define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);
const int INF = 1e9 + 1;

void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}
 
void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}


bool pr(int n)
{
	for(int i = 2; i * i <= n; ++i) if(!(n % i)) return false;
	return true;
}
void solve()
{	
	int n;
	cin >> n;
	while(!pr(n)) n++;
	cout << n;
}
 
int main()
{
    Red;
  	// int T; cin >> T; while(T--)
    solve();
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int main()
{
	cin>>a>>b>>c;
	if((a==5&&b==5&&c==7)||(a==5&&b==7&&c==5)||(a==7&&b==5&&c==5)) cout<<"YES";
	else cout<<"NO";
	cout<<endl;
	return 0;
}

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

struct Patient
{
  int number;
  int length;

  bool operator<( const Patient& right ) const
  {
    return length < right.length;
  }
};

int main(void)
{
  while (true)
  {
    int n;
    cin >> n;
    if (n == 0) break;

    vector<Patient> patients;
    for (int i = 0; i < n; ++i)
    {
      int buf_num, buf_l1, buf_l2;
      cin >> buf_num >> buf_l1 >> buf_l2;
      Patient buf_patient = {buf_num, buf_l1 + buf_l2};
      patients.push_back(buf_patient);
    }

    sort(patients.begin(), patients.end() );
    cout << patients.back().number << " " << patients.back().length << endl;

  }
  return 0;
}

Measured memory_bytes: 1344
#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please



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


	int N;
	scanf("%d ", &N);
	int sL[1001] = {}, sR[1001] = {};
	pair<int, int> RR[500], LL[500];
	int rr = 0, ll = 0;
	int tot = 0;
	rep(i, N) {
		char c;
		int l = 0, r = 0;
		while((c = getchar_unlocked()) >= '(') {
			if (c == '(') r++;
			else {
				if (r > 0) r--;
				else l++;
			}
		}
		tot += r - l;
		if (l < r) {
			if (l <= 1000) sR[l] += r;
			else RR[rr++] = { l,r };
		}
		else {
			if (r <= 1000) sL[r] += l;
			else LL[ll++] = { r,l };
		}
	}

	if (tot != 0) {
		printf("No");
		return 0;
	}

	sort(RR, RR + rr);
	sort(LL, LL + ll);

	int OK = 1;
	int k = 0;
	rep(i, 1001) {
		if (sR[i]) {
			if (k < i) OK = 0;
			k += sR[i];
		}
	}
	rep(i, rr) {
		if (k < RR[i].first) OK = 0;
		k += RR[i].second - RR[i].first;
	}
	k = 0;
	rep(i, 1001) {
		if (sL[i]) {
			if (k < i) OK = 0;
			k += sL[i];
		}
	}
	rep(i, ll) {
		if (k < LL[i].first) {
			OK = 0;
		}
		k += LL[i].second - LL[i].first;
	}

	if (OK) printf("Yes");
	else printf("No");

	Would you please return 0;
}

Measured memory_bytes: 1756
#include <stdio.h> 
int main()
{
  int a, b;
  scanf("%d %d", &a, &b);
  if( a < b ) printf("a < b\n");
  if( a > b ) printf("a > b\n");
  if( a == b ) printf("a == b\n");
  return 0;
}                                

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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_N = 200005;
int N, K, C;
string S;

signed main()
{
  cin >> N >> K >> C;
  cin >> S;

  deque<int> revSIndex;
  for(int i = S.size(); 0 <= i; i--) {
    if(S[i] == 'o') {
      revSIndex.push_front(i);
      i -= C;
    }
  }

  int lastLIndex = -INF, lCnt = 0;
  REP(i,N) {
    while(revSIndex.size() && revSIndex[0] <= i) {
      revSIndex.pop_front();
    }
    if(0 <= i-1 && lastLIndex+C < i-1 && S[i-1] == 'o') {
      lastLIndex = i-1;
      lCnt++;
    }

    int k = 0;
    if(0 < revSIndex.size() && revSIndex[0] <= lastLIndex + C) {
      k = -1;
    }

    if (S[i] == 'o' && lCnt + revSIndex.size() + k == K-1) {
      cout << i+1 << endl;
    }
  }

  return 0;
}


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

const int N = 2e3;
int dis[N+10][N+10];
vector<int>g[N+10];
int vis[N+10],ans[N+10];

int main()
{
	int n,x,y;
	scanf("%d%d%d",&n,&x,&y);
	for(int i=1;i<n;i++){
		g[i].push_back(i+1);
		g[i+1].push_back(i);
	}
	g[x].push_back(y);
	g[y].push_back(x);
	for(int i=1;i<=n;i++){
		memset(vis,0,sizeof vis);
		vis[i] = 1;
		queue<int>q;
		q.push(i);
		while(!q.empty())
		{
			int v = q.front();
			q.pop();
			for(auto it:g[v])
			{
				if(!vis[it]){
					vis[it] = vis[v]+1;
					dis[i][it] = vis[it]-1;
					q.push(it);
				}
			}
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			ans[dis[i][j]]++;
		}
	}
	for(int i=1;i<n;i++){
		printf("%d\n",ans[i]);
	}
}


Measured memory_bytes: 19628
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	
	double re[n+1];
	
	string rel[n+1];
	
	for(int i=1;i<=n;i++)
	{
		cin>>re[i]>>rel[i];
	}
	
	double answer=0;
	for(int i=1;i<=n;i++)
	{
		if(rel[i]==" JPY" || rel[i]=="JPY")
		{
			answer+=re[i];
		}
		
		else
		    answer+=re[i]*380000;
	}
	
	cout<<answer;
 } 

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int digit(int n){
	int cnt = 0;
	for(int i = 0; n; n = n /10){
			cnt++;
	}
	return cnt;
}
int main() {
	int a; cin >> a;
	int ans = 0;
	for(int i = 0; i <= a; i++){
		if(digit(i) % 2)
			ans++;
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 256
import java.util.*

val sc = Scanner(System.`in`)
val A = sc.nextInt()
val B = sc.nextInt()
val C = sc.nextInt()
val D = sc.nextInt()

fun main(args: Array<String>) {
    println(Math.max(0, arrayOf(B - A, D - C, B - C, D - A).min()!!))
}


Measured memory_bytes: 35924
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll N = 2e5 + 5, mod = 1e9 + 7;
int n, u, v, ans, sz[N], p[N];
vector<int>adj[N];
ll sub(int a, int b){
    return (((a - b) % mod) + mod) % mod;
}
int add(int a, int b){
    return (a + b) % mod;
}
int mul(int a, int b){
    return (1ll * a * b) % mod;
}
ll fp(ll b, ll p){
    if(!p) return 1;
    ll res = fp(b, p / 2);
    res = mul(res, res);
    if(p & 1) res = mul(res, b);
    return res;
}
void dfs(int node, int parent){
    sz[node] = 1;
    for(auto i : adj[node]){
        if(i != parent)
            dfs(i, node);
    }
    sz[parent] += sz[node];
    ans = add(ans, sub(p[n - 1], 1));
    for(auto i: adj[node]){
        if(i == parent) continue;
        ans = sub(ans, sub(p[sz[i]], 1));
    }
    ans = sub(ans, sub(p[n - sz[node]], 1));
}
int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n;
    for(int i = 1; i < n; i++){
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    p[0] = 1;
    for(int i = 1; i <= n; i++)
        p[i] = mul(2, p[i - 1]);
    dfs(1, 0);
    cout << mul(ans, fp(p[n], mod - 2));
    return 0;
}


Measured memory_bytes: 27180
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define st string
#define ve(i) vector<i>
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define each(i, n) for(auto&& i: n)

int main() {
  int N;
  st S;
  cin >> N >>S;;
  rep(i, S.size()) {
    S.at(i) += N;
    if(S.at(i) > 'Z') {
      S.at(i) -= 26;
    }
    cout << S.at(i);
  }
  cout << endl;
}  

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

vector<int> G[110];
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    if ((N - 1) * (N - 2) / 2 < K) {
        cout << -1 << endl;
        return 0;
    }
    rep(i, N - 1) G[0].push_back(i + 1);
    int ans = (N - 1) * (N - 2) / 2;
    int edge = N - 1;
    while(ans > K) {
        REP(i, 1, N - 1) {
            REP(j, i + 1, N - 1) {
                G[i].push_back(j);
                edge++;
                ans--;
                if (ans == K) break;
            }
            if (ans == K) break;
        }
    }
    cout << edge << endl;
    rep(i, N) {
        for(auto to: G[i])
            cout << i + 1 << " " << to + 1 << endl;
    }


    return 0;
}


Measured memory_bytes: 892
#include <stdio.h>
#include <string.h>
 
 int i,j,k,l,m;
 int n,e,s,w,un,up;
 int a[7];
 int t;
 
 
 void input() {
    for(i=0;i<6;i++){
   
        scanf("%d",&a[i+1]);
   
    }
}
 
void N() {
    t = a[1];
    a[1] = a[2];
    a[2] = a[6];
    a[6] = a[5];
    a[5] = t;
}
 
void S() {
    t = a[1];
    a[1] = a[5];
    a[5] = a[6];
    a[6] = a[2];
    a[2] = t;
}
 
void E() {
    t = a[1];
    a[1] = a[4];
    a[4] = a[6];
    a[6] = a[3];
    a[3] = t;
}
 
void W() {
    t = a[1];
    a[1] = a[3];
    a[3] = a[6];
    a[6] = a[4];
    a[4] = t;
}
 
int main() {
 
    input();
    char str[110];  
    scanf("%s",str);
 
    for(i=0;i<strlen(str);i++) {
 
    if(str[i] == 'N') {
        N();
    } else if(str[i] == 'S') {
        S();
    } else if(str[i] == 'W') {
        W();
    } else if(str[i] == 'E') {
        E();
    }
}
 
printf("%d\n",a[1]);
 
return 0;
}


Measured memory_bytes: 2112