akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-

x1, y1, x2, y2 = map(int, input().split())

xs = x2 - x1
ys = y2 - y1
#print(xs)
#print(ys)

difx = abs(xs)
dify = abs(ys)

if (xs >= 0) and (ys > 0):
    case = "case1"
    x3 = x2 - dify
    y3 = y2 + difx
    x4 = x3 - difx
    y4 = y3 - dify
elif (xs < 0) and (ys >= 0):
    case = "case2"
    x3 = x2 - dify
    y3 = y2 - difx
    x4 = x3 + difx
    y4 = y3 - dify
elif (xs <= 0) and (ys < 0):
    case = "case3"
    x3 = x2 + dify
    y3 = y2 - difx
    x4 = x3 + difx
    y4 = y3 + dify
else:
    case = "case4"
    x3 = x2 + dify
    y3 = y2 + difx
    x4 = x3 - difx
    y4 = y3 + dify

#print(case)
#print(x3)
#print(y3)
#print(x4)
#print(y4)

print(str(x3)+" "+str(y3)+" "+str(x4)+" "+str(y4))


Measured memory_bytes: 3064
k,s=map(int,input().split())
ans=0
def als(n):
  if 0<=n<=k:
    return n+1
  elif k+1<=n<=2*k:
    return 2*k+1-n
  else:
    return 0
for i in range(k+1):
  ans+=als(s-i)
print(ans)


Measured memory_bytes: 2940
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  myerr("-----start-----");
  var start = new Date();
  Main();
  var end = new Date() - start;
  myerr("----- end -----");
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var s = next();
	var t = next();
	var output = 0;
	for(var i = 0; i < s.length; i++){
		if(s[i] != t[i]){
			output++;
		}
	}
	myout(output);
}

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

int main()
{
    map<ll, bool> ans;
    ll N;
    cin >> N;
    rep(i, N)
    {
        ll temp;
        cin >> temp;
        if (ans[temp])
        {
            cout << "NO" << endl;
            return 0;
        }
        ans[temp] = true;
    }
    cout << "YES" << endl;
}

Measured memory_bytes: 12800
#include<iostream>
#include<queue>
using namespace std;
int a[100000];
int b[100000];
queue<int> que2[100001];
int main() {
	priority_queue<int> que;

	int n, m;
	cin >> n >> m;

	int i;
	for (i = 0; i < n; i++) {
		cin >> a[i] >> b[i];
		que2[a[i]].push(b[i]);
	}
	int j;
	int counter = 0;
	for (i = 1; i <= m; i++) {
		while (que2[i].size()) {
			que.push(que2[i].front()); que2[i].pop();
		}
		if (que.size() > 0) {
			//cout << que.top();
			counter = counter + que.top(); que.pop();
		}//cout << 'a';
	}
	cout << counter << endl;
	return 0;

}

Measured memory_bytes: 69248
n = int(input())
arr = [int(i) for i in input().split()]
odd = []
even = []
for i in range(n):
    if i%2 == 0:
        odd.append(arr[i])
    else:
        even.append(arr[i])
even = even[::-1]
ans = even+odd if n%2 == 0 else (even+odd)[::-1]
for i in range(n):
    if i<n-1:
        print(ans[i],end=" ")
    else:
        print(ans[i])

Measured memory_bytes: 26020
using System;
using System.Linq;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var a = input[0];
            var b = input[1];

            Console.WriteLine(new string(Math.Min(a, b).ToString().ToCharArray()[0], Math.Max(a, b)));
        }
    }
}

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

using namespace std;
typedef long long int lli;
lli a[3002];
lli n;
lli dp[3002][3002];
lli solve(lli i,lli j,lli p);

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	cin>>n;
	for (int i=0;i<n;i++) cin>>a[i];
	for (int i=0;i<n;i++){
		for (int j=0;j<n;j++) dp[i][j]=-1;
	}
	solve(0,n-1,1);
	cout<<dp[0][n-1]<<endl;
}

lli solve(lli i,lli j,lli p){
	if (i>j) return 0;
	if (dp[i][j]!=-1) return dp[i][j];
	if (p==1){
		//if (a[i]>a[j]) dp[i][j]=solve(i+1,j,0)+a[i];
		dp[i][j]=max(solve(i+1,j,0)+a[i],solve(i,j-1,0)+a[j]);
		//else dp[i][j]=solve(i,j-1,0)+a[j];
	}
	else{
		//if (a[i]>a[j]) dp[i][j]=solve(i+1,j,1)-a[i];
		dp[i][j]=min(solve(i+1,j,1)-a[i],solve(i,j-1,1)-a[j]);
		//else dp[i][j]=solve(i,j-1,1)-a[j];		
	}
	return dp[i][j];
}

Measured memory_bytes: 70784
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<functional>
using namespace std;
#define LL long long
#define P pair<LL,LL>
int K, N;
int used[100010];
vector<P> V;
int main(){
    cin >> N >> K;
    for(int i = 0; i < N; i++){
        LL t, d;
        cin >> t >> d;
        V.push_back({d, t});
    }
    sort(V.rbegin(), V.rend());
    
    LL ans = 0, res = 0;
    LL kind = 0;
    priority_queue<LL, vector<LL>, greater<LL>> pq; 
    
    for(int i = 0; i < K; i++){
        res += V[i].first;
        if(used[V[i].second]){
            pq.push(V[i].first);
        }else{
            kind++;
            used[V[i].second] = true;
        }
    }
    ans = res + kind * kind;

    for(int i = K; i < N; i++){
        if(used[V[i].second]) continue;
        if(pq.empty()) break;
    
        used[V[i].second] = true;
        
        kind++;
        res -= pq.top() - V[i].first;
        pq.pop();

        ans = max(ans, res + kind * kind);
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
    string N;
    cin >> N;
    if (N[1] == N[2] && (N[0] == N[1] || N[2] == N[3])) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

using namespace std;
using ll = long long;

int main()
{
    int n, a;
    ll s = 0;
    cin >> n;
    unordered_map<int, int> umap;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        if (umap[a])
        {
            umap[a]++;
        }
        else
        {
            umap[a] = 1;
        }
        s += a;
    }
    int q;
    cin >> q;
    for (int i = 0; i < q; i++)
    {
        ll b, c, x;
        cin >> b >> c;
        if (umap[b])
        {
            x = umap[b] * b;
            s -= x;
            x = umap[b] * c;
            s += x;
            cout << s << endl;
            if (umap[c])
            {
                umap[c] += umap[b];
            }
            else
            {
                umap[c] = umap[b];
            }
            umap[b] = 0;
        }
        else
        {
            cout << s << endl;
        }
    }
}

Measured memory_bytes: 6860
//Radhe Radhe
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define mp make_pair
#define rep(i,n)    for(ll i=0; i<n; i++)
#define repVect(i,n)    for(ll i=0; i<sum.size(); i++)
#define fixed cout.setf(ios::fixed);
#define Precise cout.precision(7);
#define yes cout<<"Yes"<<'\n'
#define no cout<<"No"<<'\n'
using namespace std;

int main()
{
    ll i,j,n;
    char a[3][3];
    rep(i,3)
    {
    rep(j,3)
        cin>>a[i][j];
    }
    cout<<a[0][0]<<a[1][1]<<a[2][2]<<endl;
    return 0;
}





Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>
#include <bitset>
#include <iterator>
#include <cmath>
#include <stack>
#include <random>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

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

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

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

  int n, m, c; cin >> n >> m >> c;
  vector<int> b(m); rep(i, m) cin >> b[i];

  int cnt = 0;
  rep(i, n) {
    int now = 0;
    rep(j, m) {
      int a; cin >> a;
      now += a*b[j];
    }
    if (now + c > 0) {
      cnt++;
    }
  }
  cout << cnt << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const ll mod2 = 998244353;

int main() {
  ll n, m;
  cin >> n >> m;
  priority_queue<ll> pq;
  rep(i, n) {
    int a;
    cin >> a;
    pq.push(a);
  }
  ll c = 0;
  while (c < m) {
    int b = pq.top() / 2;
    pq.pop();
    pq.push(b);
    c++;
  }
  ll ans = 0;
  rep(i, n) {
    ans += pq.top();
    pq.pop();
  }
  cout << ans << endl;
}

Measured memory_bytes: 1400
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] array = new int[10][10];
        
        
        for (int i = 1; i <= n; i++) {
            if (i % 10 == 0) continue;
            int a = -1;
            int b = -1;
            if (i < 10) {
                a = i;
                b = i;
            } else {
                String str = String.valueOf(i);
                a = Integer.parseInt(String.valueOf(str.charAt(0)));
                b = Integer.parseInt(String.valueOf(str.charAt(str.length() - 1)));
            }
            
            array[a][b]++;
        }
        
        int count = 0;
        for (int i = 1; i < 10; i++) {
            for (int j = i; j < 10; j++) {
                count += array[i][j] * array[j][i];
                if (i != j) {
                    count += array[i][j] * array[j][i];
                }
            }
        }
        
        System.out.println(count);
    }
}


Measured memory_bytes: 39872
from collections import defaultdict
n=int(input())
A=[int(i) for i in input().split()]
d=defaultdict(int)

b=[A[i] - (i+1) for i in range(n)]
c=[A[i] + (i+1) for i in range(n)]

l=[]
ans=0
d=defaultdict(int)
for i in range(1,n)[::-1]:
    d[c[i]]+=1
    d[b[i]]+=1
    ans+= d[-c[i-1]]
print(ans)

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

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

    vector<ll> a(N);
    rep(i, N) cin >> a.at(i);

    ll a0 = a.at(0);
    ll a1;
    rep(i, N)
    {
        if (a.at(i) != a0)
        {
            a1 = a.at(i);
            break;
        }
    }

    ll a2 = a0 ^ a1;

    vector<ll> camels = {a0, a1, a2};

    bool result = true;
    for (int i = 0; i < N; i++)
    {
        auto it = find(a.begin(), a.end(), camels.at(i % 3));
        if (it != a.end())
        {
            a.erase(it);
        }
        else
        {
            result = false;
            break;
        }
    }

    cout << (result ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 4028
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    int N; cin >> N;
    vector<int> P(N);
    vector<int> Q(N);
    for (int i=0;i<N;i++) cin >> P[i];
    for (int i=0;i<N;i++) cin >> Q[i];
    vector<int> order(N);
    for (int i=0;i<N;i++) order[i] = i+1;
    int a,b;
    int cnt = 0;
    do{
        cnt++;
        bool p=true,q=true;
        for (int i=0;i<N;i++){
            if (P[i]!=order[i]) p = false;
            if (Q[i]!=order[i]) q = false;
        }
        if (p) a = cnt;
        if (q) b = cnt;
    }while(next_permutation(order.begin(),order.end()));
    cout << abs(a-b) << endl;
    return 0;
}

Measured memory_bytes: 256
#定理 : 一番長い辺が他のN−1辺の長さの合計よりも真に短い場合に限り、条件を満たすN角形が描ける。
N = int(input())
L = list(map(int, input().split()))

L = sorted(L, reverse=True)
if L[0] < sum(L)-L[0]:
    print('Yes')
else:
    print('No')

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

#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define RFOR(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX

const double EPS = 1e-14;
const double PI  = acos(-1.0);


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

  vector<int> v(n);
  REP (i, n) {
    cin >> v[i];
  }

  int dp[n];
  REP (i, n) {
    dp[i] = INF;
  }
  dp[0] = 0;
  REP (i, n) {
    FOR (j, 1, 3) {
      if (i + j < n) {
        dp[i + j] = min(dp[i + j], dp[i] + abs(v[i] - v[i + j]));
      }
    }
  }

  cout << dp[n - 1] << endl;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cstring>
#include<stdio.h>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<queue>
#include<list>
#include<stdio.h>
#include<stdlib.h>
#include<map>
#include<cstdio>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)

int main() {

	int N; cin >> N;
	vi a(N);
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}

	ll ans = 0;
	
	int i = 0;
	while (i <= N-1) {
		if (a[i] == i + 1) {
			ans++;
			i += 2;
		}
		else {
			i++;
		}
	}
		
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cmath>
#include <map>
#define ull unsigned long long
#define ll long long
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m,a,b;
    cin >> n >> m;
    vector<pair<int,int>> w;
    for(int i=0;i<m;i++){
        cin >> a >> b;
        w.push_back(make_pair(a,b));
    }
    vector<int> p(n,0);
    for(int i=0;i<m;i++){
        p[w[i].first-1]++;
        p[w[i].second-1]++;
    }
    for(int i=0;i<n;i++){
        cout << p[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>
#include <iomanip>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

const ll INF = 1LL<<60;
const ll MOD = 1000000007;

//cout << fixed << setprecision(10);

int main() {
    ll N;
    cin >> N;
    string S="";
    if(N==0)S="0";
    
    while(llabs(N)>0){
        S=char((N%2<0?N%2+2:N%2)+'0')+S;
        N=(N-(N%2<0?N%2+2:N%2))/(-2);
    }
    cout << S << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <algorithm>
using namespace std;

int dat[1024][1024];
int getLcbLen(char* x, int xe, char* y, int ye){
	if(xe <= 0 || ye <= 0) return 0;
	if(dat[xe][ye] != -1) return dat[xe][ye];
	return dat[xe][ye] = (x[xe-1] == y[ye-1] ? 1 + getLcbLen(x, xe-1, y, ye-1) : max(getLcbLen(x, xe-1, y, ye), getLcbLen(x, xe, y, ye-1)));
}

int main() {
	int set;
	scanf("%d", &set);
	
	while(set--){
		char x[1024], y[1024];
		scanf("%s %s", x, y);
		
		for(int i = 0; i < 1024; i++){
			for(int k = 0; k < 1024; k++){
				dat[i][k] = -1;
			}
		}
		printf("%d\n", getLcbLen(x, (int)strlen(x), y, (int)strlen(y)));
	}
	return 0;
}

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

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);

    long long int x, k, d;
    cin >> x >> k >> d;
    long long int ans = x;

    if(x<0) x*=-1;

    if(k>=(x/d)){
        long long int temp = (x/d);
        x-=(x/d)*d;
        k-=temp;
    }else{
        x-=(k)*d;
        k=0;
    }

    if((k&1)==1){
        ans = abs(x-d);
    }else{
        ans=abs(x);
    }
    

    cout<<ans<<'\n';

    return 0;
}


Measured memory_bytes: 3656
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
int N, M;
int S[100000], T[100000], E[100000];
int L;
int B[10000];
int ans[10000];
int main()
{
	scanf("%d%d", &N, &M);
	int cou = 0;
	while (true){
		scanf("%d%d%d", &S[cou], &T[cou], &E[cou]);
		if (S[cou] == 0 && T[cou] == 0 && E[cou] == 0)break;
		cou++;
	}
	scanf("%d", &L);
	for (int i = 0; i < L; i++){
		for (int j = 0; j < M; j++){
			scanf("%d", &B[j]);
		}
		for (int j = 0; j < cou; j++){
			ans[S[j] - 1] += B[T[j] - 1] * E[j];
		}
		printf("%d", ans[0]);
		for (int i = 1; i < N; i++){
			printf(" %d", ans[i]);
		}
		printf("\n");
		for (int j = 0; j < N; j++)ans[j] = 0;
	}

	return 0;
}

Measured memory_bytes: 1864
#include <bits/stdc++.h>
using namespace std;
struct Keiro
{
    int c;
    int t;

    void keiroPB(int ci, int ti){
        c = ci;
        t = ti;
    }
};

int main(){
    int n,t;
    cin>>n>>t;
    vector<Keiro> keiro(n);
    for(int i=0;i<n;i++){
        int ci,ti;
        cin >> ci >> ti;
        keiro[i].keiroPB(ci,ti);
    }
    int minC = 1000000;
    for(int i=0;i<n;i++){
        if(keiro[i].t <= t){
            minC = min(keiro[i].c, minC);
        }
    }
    if(minC == 1000000) cout<<"TLE"<<endl;
    else cout<<minC<<endl;
}

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

int main() {

  string str;
  while(cin >> str) {

    string ans;
    for(int i=0;i<str.size();i++){
      if(str[i] == '@') {
	i++;
	for(int j=0;j<str[i]-'0';j++)  ans += str[i+1];
	i++;
      }
      else ans += str[i];
    }

    cout << ans <<endl;

  }

  return 0;

}

Measured memory_bytes: 1184
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<map>
#include<queue>
#include<set>
#include<bitset>
#include<stdio.h>
#include<deque>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;

int main()
{
    string s, t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    reverse(t.begin(), t.end());
    for(int i = 0; i < t.size(); i++){
        if(s[i] < t[i]){
            cout << "Yes" << endl;
            return 0;
        }
        else if(s[i] > t[i]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
s = [int(x) for x in input().split()]

f5 = 0
f7 = 0
for i in s:
    if 5 == i:
        f5 += 1
    if 7 == i:
        f7 += 1
        
if f5 == 2 and f7 == 1:
    print('YES')
else:
    print('NO')



Measured memory_bytes: 9036
#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
#include <cstdio>
#include <cctype>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int, int> PII;
const ll mod = 1000000007;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
// head
const int iadd[] = {0, 1, 0, -1}, jadd[] = {1, 0, -1, 0};
const int inf = 0x3f3f3f3f;
const int maxn = 5e5 + 5;
struct edge{
	int to, next;
	ll val;
};
edge edges[maxn];
int tot, head[maxn], n;
ll dis[maxn];
short vis[maxn];

void init(){
	memset(head, -1, sizeof(head));
	memset(vis, 0, sizeof(vis));
	tot = 0;
}
void addEdge(int u, int v, ll w){
	edges[tot].to = v;
	edges[tot].val = w;
	edges[tot].next = head[u];
	head[u] = tot++;
}

void dfs(int u, ll val){
	vis[u] = 1; dis[u] = val;
	for(int i = head[u]; i != -1; i = edges[i].next){
		int v = edges[i].to;
		if(!vis[v]) dfs(v, val + edges[i].val);
	}
}

int main(){
	init();
	scanf("%d", &n);
	for(int i = 1; i < n; i++) {
		int u, v, w;
		scanf("%d %d %d", &u, &v, &w);
		addEdge(u, v, w);
		addEdge(v, u, w);
	}
	int q, k;
	scanf("%d %d", &q, &k);
	dfs(k, 0);
	while(q--){
		int x, y;
		scanf("%d %d", &x, &y);
		printf("%lld\n", dis[x] + dis[y]);
	}
}






Measured memory_bytes: 12800
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<endl;
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;
const ll inf=1e15;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  string s;
  cin>>s;
  string t;
  char now=s[0];
  rep(i,n){
    if(s[i]!=now){
      t.push_back(now);
      now=s[i];
    }
    if(i==n-1){
        t.push_back(now);
      }
  }
  //cout<<t<<endl;
  cout<<t.size()<<endl;
}

Measured memory_bytes: 592
#include<iostream>
#include<algorithm>
#include<stack>
#include<string>
#include<cmath>
#include<vector>
#include<functional>
#include<map>
#include<utility>

typedef long long ll;
#define rep(i,rept) for (ll i = 0; i < rept; i++)

int main() {
	int n = 0;
	std::cin >> n;
	if (n % 4 == 0 || n % 7 == 0) {
		std::cout << "Yes" << std::endl;
		return 0;
	}
	while (n >= 4) {
		n = n - 7;
		if (n % 4 == 0) {
			std::cout << "Yes" << std::endl;
			return 0;
		}
	}
	std::cout << "No" << std::endl;

	return 0;
}

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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int n, k, p[2000][2000], s[2001][2001];

/*
int G(int xl, int xh, int yl, int yh) {
	int c = 0;
	incID(x, xl, xh) {
	incID(y, yl, yh) {
		c += p[x][y];
	}
	}
	return c;
}
*/
char Q[2000][2000];
int H(int xl, int xh, int yl, int yh) {
	int c = 0;
	incID(x, xl, xh) {
	incID(y, yl, yh) {
		Q[x][y] = '#';
	}
	}
	return c;
}


int main() {
	cin >> n >> k;
	int l = k * 2;
	inc(i, n) {
		int x, y; string c;
		cin >> x >> y >> c;
		if(c == "B") { x += k; }
		int z = (x / k + y / k) % 2 * k;
		x %= k;
		y %= k;
		p[x + z][y]++;
	}
	
	inc1(i, l) {
	inc1(j, l) {
		s[i][j] = p[i - 1][j - 1];
	}
	}
	inc1(i, l) {
	inc1(j, l) {
		s[i][j] += s[i - 1][j];
	}
	}
	inc1(i, l) {
	inc1(j, l) {
		s[i][j] += s[i][j - 1];
	}
	}
	
	#define R(xl, xh, yl, yh) (s[xh][yh] - s[xh][yl] - s[xl][yh] + s[xl][yl])
	int ans = 0;
	incII(xx, 0, l) {
	incII(yy, 0, k) {
		int e = max(0, xx - k);
		int f = min(l, xx + k);
		setmax(ans, R(0, e, yy, k) + R(e, xx, 0, yy) + R(xx, f, yy, k) + R(f, l, 0, yy));
		//cout << xx << " " << yy << ": " << endl;
		//cout << "  " << R(0, xx, 0, yy) << " " <<  R(xx, xx + k, yy, k) << " " << R(xx + k, l, 0, yy) << endl;
		//cout << "  " << G(0, xx, 0, yy) << " " <<  G(xx, xx + k, yy, k) << " " << G(xx + k, l, 0, yy) << endl;
		/*
		incII(x, 0, l + 2) {
		incII(y, 0, l + 2) {
			Q[x][y] = '.';
		}
		}
		
		H( 0,  e, yy,  k);
		H( e, xx,  0, yy);
		H(xx,  f, yy,  k);
		H( f,  l,  0, yy);
		dec(y, k + 2) {
		inc(x, l + 2) {
			cout << Q[x][y] << " ";
		} cout << endl;
		} cout << endl;
		*/
	}
	}
	/*
	dec(y, k) {
	inc(x, l) {
		cout << p[x][y] << " ";
	} cout << endl;
	} cout << endl;
	*/
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 33408
using System;

	public class Class1
	{
		public static void Main()
		{   
		
			
				string dataSet=Console.ReadLine();
				string[] data=dataSet.Split();
				int a=int.Parse(data[0]);
				int b =int.Parse(data[1]);
				int c =int.Parse(data[2]);
				int count=0;
				for(int i=a;i<=b;i++)
				{
					if((c%i)==0)
					{
						count++;
						
					}
				}
			    
				Console.WriteLine(count);
			}
			
		}
	

Measured memory_bytes: 9068
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int[] a = new int[5];
  for(int i = 0;i < 6;i++){
    int b = sc.nextInt();
    a[b]++;
  }
  boolean n = true; 
  for(int i = 0;i < 5;i++){
    if(a[i] >= 3){
      n = false;
      break;
    }
  }
  System.out.println(n ? "YES":"NO");
}}

Measured memory_bytes: 21716
#include <iostream>
using namespace std;
typedef long long ll;
int N;
ll S[100010];

int main(){
    cin >> N;
    for(int i=0;i<N;i++) cin >> S[i];
    ll ans = 0;
    for(int C=1;C<=N-1;C++){
        ll now = 0;
        for(int k=0;k*C<=N-1;k++){
            int A = N-1-k*C,B = A-C;
            now = now+S[N-1-k*C]+S[k*C];
            if(A<=B || B<=0 || (A%C==0 && A/C<=k)) continue;
            ans = max(ans,now);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1024
from functools import reduce

words = lambda t : list(map(t, input().split()))
n = int(input())
xs = words(int)

def func(y, x):
    for i in range(60):
        if x == 0:
            continue
        y[i] += x & 1
        x = x >> 1
    return y

ys = reduce(func, xs, [0]*60)
ans = 0

for i,yi in enumerate(ys):
    ans += 2**(i) * yi * (n-yi)
    ans %= 10**9 + 7
print(ans)


Measured memory_bytes: 122808
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<n;++i)

typedef long long ll;
using namespace std;
int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> d(n);
    REP(i, n){
        int x;
        cin >> x;
        d[i] = x;
    }
    sort(d.begin(), d.end());
    d.erase(unique(d.begin(), d.end()), d.end());
    cout << d.size() << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
	int M = 0;
	int D = 0;
	std::cin >> M >> D;
	if (M < 1 || M > 100 || D < 1 || D > 99)
	{
		std::cout << "0" << std::endl;
		return 0;
	}

	int num = 0;

	for (int i = 1; i <= M; ++i)
	{
		for (int j = 1; j <= D; ++j)
		{
			int d1 = j / 10;
			int d2 = j % 10;
			if (i == d1 * d2 && d1 >= 2 && d2 >= 2)
			{
				num++;
			}
		}
	}

	std::cout << num << std::endl;

	return 0;
}

Measured memory_bytes: 256
import sys
import re
import math
import collections
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10 ** 9)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()
    c = list(input())

    w = 0
    tw = 0
    r = c.count("R")

    for i in range(n):
        if c[i] == "W":
            tw += 1
        else:
            w = tw

    lastw = 0
    tmp = 0
    for i in range(n):
        if r == 0:
            break

        if c[i] == "W":
            r -= 1
            lastw += 1
        else:
            r -= 1

    print(lastw)


if __name__ == '__main__':
    main()


Measured memory_bytes: 12852
/******************************************
* AUTHOR : kamesh_11 *
* INSTITUTION : GVPCOE *
******************************************/

#include <bits/stdc++.h>
using namespace std;

#define pi 3.141592653589793
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define bs binary_search
#define endl '\n'
#define start_clock clock_t beginn=clock()
#define end_clock clock_t endd=clock()
#define cal_exec_time double time_spent=(double)(endd-beginn)/CLOCKS_PER_SEC
#define print_exec_time cout<<endl<<time_spent<<" secs"

typedef long long int ll;

const ll MOD = 1000000007;

ll powmod(ll a,ll b) {ll res=1;a%=MOD; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

const ll mxN = 1e5+5;

vector<int>adj[mxN];
bool visited[mxN];
int dist[mxN];
int in_degree[mxN];

void dfs(int s){
	visited[s] = true;

	for(int child: adj[s]){
		dist[child] = max(dist[child], dist[s]+1);
		in_degree[child]--;
		if(in_degree[child] == 0)
			dfs(child);
	}
}

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

	int n, m, u, v;
	cin>>n>>m;

	for(int i=0;i<m;i++){
		cin>>u>>v;
		adj[u].pb(v);
		in_degree[v]++;
	}

	for(int i=1;i<=n;i++){
		if(!visited[i] && in_degree[i]==0)
			dfs(i);
	}
	int ans = INT_MIN;
	for(int i=1;i<=n;i++)
		ans = max(ans, dist[i]);
	cout<<ans;

	return 0;
}

Measured memory_bytes: 9728
def solve():
    dp = [0] * N
    for i in range(Q):
        dp[A[i]-1] += 1
    for j in range(N):
        if K - (Q - dp[j]) > 0:
            print("Yes")
        else:
            print("No")
#    print(dp)

if __name__ == "__main__":
    N,K,Q = list(map(int, input().split()))
    A = [int(input()) for _ in range(Q)]
    solve()  


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

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int n;
int k;
cin>>n>>k;
int res=0;
int r=k;
int y=2;
for(int i=1;i<=n;i++){
           if(i%r==0){
                      res++;
           }
}

long long int ans=0;
ans=res;
ans*=res;
ans*=res;

r=k;
res=0;
y=2;

for(int i=1;i<=n;i++){
           if((i%r==r/2||r%i==r/2)&&r%2==0){
                      res++;
           }
}


long long int pes=0;
pes=res;
pes*=res;
pes*=res;
cout<<ans+pes;
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define FPEN freopen("in.txt", "r", stdin);
#define debug(...) \
  { cerr << "# " << __VA_ARGS__ << "\n"; }
#else
#define debug(...)
#define FPEN
#endif
const int maxn = 200009;
typedef long long i64;
typedef pair<i64, i64> pi64;
typedef pair<int, int> pi;
const i64 MOD = 119 << 23 | 1;
class {
 public:
  void solve() {
    int n;
    cin >> n;
    vector<int> a(n), b(n + 1);
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) {
      if (a[i] == 1) {
        if (b[a[i]] == 0)
          b[a[i]] = 1;
      } else {
        if (b[a[i] - 1])
          b[a[i]] = 1;
      }
    }
    int Max = n + 1;
    for (int i = 1; i < n + 1; ++i) {
      if (b[i])
        Max = i;
    }
    cout << n - Max << '\n';
  }
} NSPACE;
int main() {
  FPEN;
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  NSPACE.solve();
}

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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

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


long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=true;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------
ll Sum(ll x){
    sum=0;
while(x!=0){
            sum+=x%10;
           x/=10;
        }
        return sum;
}

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

      
      cin>>n;
      ans=1,pos=1;
      rep(i,n){
          Cout(ans);
          while(1){
              double Q,QQ;
              Q=(double)(ans+pos)/Sum(ans+pos);
              QQ=(double)(ans+pos+pos)/Sum(ans+pos+pos);
              if(Q<=QQ)break;
              else pos*=10;
          }
          ans+=pos;
      }
     

       
return 0;
}


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

typedef long long LL;
#define SZ(a) int((a).size())
#define FOR(var,a,b) for(int var=(a);var<(b);var++)
#define STR(s) string s;cin>>s;

int main(){
  STR(s);
  map<char, vector<int>> mp;
  int a = -1, b = -1;
  FOR(i, 0, SZ(s)){
    mp[s[i]].push_back(i + 1);
  }
  for(auto kv:mp){
    vector<int> v = kv.second;
    FOR(i, 0, SZ(v) - 1){
      if (v[i + 1] - v[i] < 3){
        a = v[i], b = v[i + 1];
        break;
      }
    }
  }
  printf("%d %d\n", a, b);
  return 0;
}

Measured memory_bytes: 1148
import java.io.*; 
import java.util.*;
public class Main {
    static int arr[];
    static boolean dp[];
    public static void main(String args[]) {
        Scanner input=new Scanner(System.in);
        int n=input.nextInt();
        int k=input.nextInt();
        arr=new int[n];
        dp=new boolean[k+1];
        for(int i=0;i<n;i++) {
            arr[i]=input.nextInt();
            dp[arr[i]]=true;
        }
        if(solve(n,k)) {
            System.out.println("First");
        }
        else {
            System.out.println("Second");
        }
    }
    public static boolean solve(int n,int k) {
        int strt=arr[0];
        for(int i=strt+1;i<=k;i++) {
            for(int j=0;j<n;j++) {
                if(arr[j]>i) {
                    break;
                }
                dp[i]|=!dp[i-arr[j]];
            }
        }
        return dp[k];
    }
}


Measured memory_bytes: 23508
import java.io.*;
import java.util.*;
import static java.lang.System.out;

public class Main{
    static MyReader in = new MyReader();

    public static void main(String[] args){
        int K, N; {int[] a = in.ii(); K = a[0]; N = a[1];}
        int[] A = in.ii();
        int max = A[0] + K - A[N-1];
        for(int i = 0; i < N-1; i++){
            int tmp = A[i+1] - A[i];
            if (max < tmp) {
                max = tmp;
            }
        }
        out.println(K - max);
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        ArrayList<Integer> li(){
            String[] ss = ss();
            ArrayList<Integer> li = new ArrayList<>();
            for(int j = 0; j < ss.length; j++) li.add(Integer.parseInt(ss[j]));
            return li;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
}


Measured memory_bytes: 50004
#include <bits/stdc++.h>
using namespace std;
#define int           long long
#define pb            push_back
#define x             first
#define y             second
#define sz(v)         (int)v.size()
#define all(x)        (x).begin(),(x).end()
#define PI            3.14159265358979
#define N             200005

int solve(){
    int n; cin>>n;
    cout<<n+n*n+n*n*n;
    return 0;
}

signed main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t=1;
    // cin>>t;
    while(t--) solve();
    return 0;
}

Measured memory_bytes: 3608
#include <stdio.h>
int main()
{
    int n, i, j;
    int a[4][13];
    for(i=0; i<4; i++){
        for(j=1; j<14; j++){
            a[i][j]=0;
        }
    }
    scanf("%d", &n);
    char c;
    int d;
    for(i=0; i<n; i++){
        while(1){
            scanf("%c", &c);
            if(c!='\n'){
                break;
            }
        }
        scanf("%d", &d);
        switch(c){
            case 'S':
                a[0][d]=1;
                break;
            case 'H':
                a[1][d]=1;
                break;
            case 'C':
                a[2][d]=1;
                break;
            case 'D':
                a[3][d]=1;
                break;
        }
    }
    for(i=0; i<4; i++){
        for(j=1; j<14; j++){
            if(a[i][j]==0){
                switch(i){
                    case 0:
                        printf("S %d", j);
                        break;
                    case 1:
                        printf("H %d", j);
                        break;
                    case 2:
                        printf("C %d", j);
                        break;
                    case 3:
                        printf("D %d", j);
 
                }
                printf("\n");
            }
        }
    }
    return 0;   
}

Measured memory_bytes: 600
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void ReadFirstInput(int *snukesNumber, int *candyTypes)
{
    //printf("Enter the number of Snukes and SnackTypes: \n");
    scanf("%d %d", snukesNumber, candyTypes);
}

void CountTricks(int *snukesArray, int *snukesNumber)
{
    int counter = 0;
    
    for(int i = 0; i < *snukesNumber; i++)
    {
        if(snukesArray[i] == 0)
        {
            counter++;
        }
    }
    printf("%d \n", counter);
}

void CreateArray(int *snukesNumber, int *candyTypes)
{
    int *dArray = (int*)malloc(250 * sizeof(int));
    int *aArray =  malloc(250 * 250 * sizeof *aArray);
    int *snukesArray = malloc(250 * sizeof(int));
    
    for(int i = 0; i < *candyTypes; i++)
    {
        scanf("%d\n", &dArray[i]);
        for(int j = 0; j < dArray[i]; j++)
        {
            scanf("%d", &aArray[i + j]);
            int snukesWithSnacks = aArray[i + j];
            snukesArray[snukesWithSnacks - 1] = 1;
        }
    }
    
    CountTricks(snukesArray, snukesNumber);
}

int main(int argc, const char * argv[])
{
    int *snukesNumber = malloc(3 * sizeof(int));
    int *candyTypes = malloc(3 * sizeof(int));
    
    ReadFirstInput(snukesNumber, candyTypes);
    CreateArray(snukesNumber, candyTypes);
    
    return 0;
}


Measured memory_bytes: 1736
N, M = map(int, input().split())

ac_set = set()

penalty_total = 0
penalty_map = {}

for _ in range(M):
  p, s = input().split()
  p = int(p)
  if p in ac_set:
    continue

  if s == "AC":
    ac_set.add(p)
    penalty_total += penalty_map.get(p, 0)
  else:
    if p not in penalty_map:
      penalty_map[p] = 1
    else:
      penalty_map[p] += 1

print(len(ac_set), penalty_total)


Measured memory_bytes: 11884
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <numeric>
#include <set>
#include <list>
#include <map>
#include<queue>


const int INF = 1 << 28;
const long long MOD = 1000000007;
using namespace std;
using Graph = vector<vector<int>>;

template<class T> bool chmin(T &a, T &b) { if (a > b) { a = b; return 1; }return 0; }
template<class T> bool chmax(T &a, T &b) { if (a < b) { a = b; return 1; }return 0; }
template<class T, class U> using P = pair<T, U>;

vector<int> seen(50,-1);
int counter_for_dfs = 0;
void dfs(Graph &G, int v) {
	seen[v] = counter_for_dfs;
	counter_for_dfs++;
	for (auto v_next : G[v]) {
		if (seen[v_next]>=0)continue;

		dfs(G, v_next);
	}
}

void bfs(Graph &G) {
	vector<int> dist(G.size(), -1);
	queue<int> que;
	
	dist[0] = 0;
	que.push(0);
	while (!que.empty()) {
		int v = que.front();
		que.pop();

		for (int g : G[v]) {
			if (dist[g] != -1)continue;
			dist[g] = dist[v] + 1;
			que.push(g);
		}
	}
	for (auto i : dist) {
		cout << i << " ";
	}
}

int counter[200005] = {};
void bfs2(Graph &G,int p,int x) {
	vector<int> dist(G.size() , -1);
	queue<int> que;
	
	dist[p] = 0;
	que.push(p);
	while (!que.empty()) {
		int v = que.front();
		que.pop();

		for (int g : G[v]) {
			if (dist[g] != -1)continue;
			dist[g] = dist[v] + 1;
			que.push(g);
			counter[g] += x;
		}
	}
}
long long int gcd(long long int a, long long int b) {
	long long int c = std::min(a, b);
	a = std::max(a, b);
	b = c;
	while (true) {
		c = a % b;
		a = b;
		b = c;
		if (c == 0)break;
	}
	return a;
}
int main()
{
	long long int n;
	std::vector<long long int> v(5);

	scanf("%lld", &n);
	for (int i = 0; i < 5; i++)scanf("%lld", &v[i]);
	long long int mn = *std::min_element(v.begin(), v.end());
	printf("%lld", n%mn ? n / mn + 5 : n / mn + 4);
	


}

Measured memory_bytes: 256
#pragma warning disable

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Numerics;
using System.Collections;

static class MainClass
{
    public static void Main(string[] args)
    {
        var NT = Console.ReadLine().SplittedStringToInt32List();
        var tn = Console.ReadLine().SplittedStringToInt32List();
        var T = NT[1];
        BigInteger sum = T;

        var N = NT[0];

        var before = 0;
        for (int i = 1; i < N; i++)
        {
            var num = tn[i];
            if (num - before <= T)
            {
                sum += (num - before);
            }
            else
            {
                sum += T;
            }
            before = num;
        }

        Console.WriteLine(sum);
        Console.ReadLine();
    }
    

    #region ライブラリ
    public static long ToInt64(this string str) => long.Parse(str);
    public static int ToInt32(this string str) => int.Parse(str);
    public static BigInteger ToBigInteger(this string str) => BigInteger.Parse(str);
    public static List<string> SplittedStringToList(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
    public static List<int> SplittedStringToInt32List(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToList();
    public static List<long> SplittedStringToInt64List(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => long.Parse(x)).ToList();
    public static List<BigInteger> SplittedStringToBigInteger(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => BigInteger.Parse(x)).ToList();
    public const int INF = int.MaxValue / 2;
    public const long LONGINF = long.MaxValue / 2;

  
  

    public static void PrintArray(int[,] array)
    {
        for (int i = 0; i < array.GetLength(0); i++)
        {
            var sb = new StringBuilder();
            for (int j = 0; j < array.GetLength(1); j++)
            {
                sb.Append(array[i, j]).Append(" ");
            }
            Console.WriteLine(sb.ToString());
        }
    }

    #endregion
}



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

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

	
	double ans = R*2*M_PI;
	
	printf("%lf", ans);
}


Measured memory_bytes: 3744
#include<bits/stdc++.h>
using namespace std;
int a[100005];
int main()
{
    int n, x;
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> x;
        a[x] = i;
    }
    for(int i = 1; i <= n; i++)
        cout << a[i] << ' ';

}


Measured memory_bytes: 1152