akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;

#define eps (1e-10)
struct Point{
    double x,y;
    Point(){}
    Point(double x,double y):x(x),y(y){}
    Point operator+(Point p) {return Point(x+p.x,y+p.y);}
    Point operator-(Point p) {return Point(x-p.x,y-p.y);}
    Point operator*(double k){return Point(x*k,y*k);}
    double norm(){return x*x+y*y;}
    double abs(){return sqrt(norm());}
    bool operator == (const Point &p) const{
    return fabs(x-p.x)<eps && fabs(y-p.y)<eps;
  }
  double dot(Point p){return x*p.x+y*p.y;}
  double det(Point p){return x*p.y-y*p.x;}
};
struct Line{
  Point p1,p2;
  Line(){}
  Line(Point p1, Point p2):p1(p1),p2(p2){}
};
int ccw(Point a,Point b,Point c){
  Point t1=b-a,t2=c-a;
  if(t1.det(t2)> eps) return 1;//counter clockwise
  if(t1.det(t2)< -eps) return -1;//clockwise
  if(t1.dot(t2)< -eps) return 2;//c-a-b online
  if(t1.norm()<t2.norm()) return -2;//a-b-c online
  return 0;//a-c-b online
}
bool intersectSS(Point a,Point b,Point c,Point d){
  return (ccw(a,b,c)*ccw(a,b,d)<=0&&ccw(c,d,a)*ccw(c,d,b)<=0);
}
bool intersectSS(Line l1,Line l2){
  return intersectSS(l1.p1,l1.p2,l2.p1,l2.p2);
}
bool isOrthogonal(Point a,Point b){
  return fabs(a.dot(b))<eps;
}
bool isOrthogonal(Point a1,Point a2,Point b1,Point b2){
  return isOrthogonal(a1-a2,b1-b2);
}
bool isParallel(Point a,Point b){
  return fabs(a.det(b))<eps;
}
bool isParallel(Point a1,Point a2,Point b1,Point b2){
  return isParallel(a1-a2,b1-b2);
}
Point CrossPoint(Line l1,Line l2){
    double a=(l1.p2-l1.p1).det(l2.p2-l2.p1);
    double b=(l1.p2-l1.p1).det(l1.p2-l2.p1);
    if(fabs(a)<eps&&fabs(b)<eps) return l2.p1;
    return l2.p1+(l2.p2-l2.p1)*(b/a);
}
Point project(Line l,Point p){
  Point base=l.p2-l.p1;
  double r=(p-l.p1).dot(base)/base.norm();
  return l.p1+base*r;
}
Point reflect(Line l,Point p){
  return p+(project(l,p)-p)*2.0;
}
int main(){
    int q;
    double xp0,yp0,xp1,yp1,xp2,yp2,xp3,yp3;
    cin>>q;
    while(q--){
        cin>>xp0>>yp0>>xp1>>yp1>>xp2>>yp2>>xp3>>yp3;
        Point p0(xp0,yp0),p1(xp1,yp1),p2(xp2,yp2),p3(xp3,yp3);
        if(isParallel(p0,p1,p2,p3)) cout<<2<<endl;
        else if(isOrthogonal(p0,p1,p2,p3)) cout<<1<<endl;
        else cout<<0<<endl;
    }
    return 0;
}


Measured memory_bytes: 3232
import collections
def main():

    N = int(input())
    graph = collections.defaultdict(list)
    for _ in range(N-1):
        a, b = map(int, input().split())
        graph[a].append(b)
        graph[b].append(a)

    cur1 = [1]
    cur2 = [N]
    visited1 = {1}
    visited2 = {N}

    while cur1 or cur2:
        temp1, temp2 = [], []
        for a in cur1:
            for b in graph[a]:
                if b not in visited1 and b not in visited2:
                    temp1.append(b)
                    visited1.add(b)
        cur1 = temp1

        for a in cur2:
            for b in graph[a]:
                if b not in visited1 and b not in visited2:
                    temp2.append(b)
                    visited2.add(b)
        cur2 = temp2

    if len(visited1) > len(visited2):
        return "Fennec"
    return "Snuke"


if __name__ == '__main__':
    print(main())

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

public class Test
{
	public static void Main()
	{
		// your code goes here
		double n = double.Parse(Console.ReadLine());
		double ans = 0;
		
		if(n%2 == 0){
			
			ans = 0.5;
			
		}else{
			
			ans = ((n+1)/2)/n;
			
		}
		
		Console.WriteLine(ans);
		
	}
}

Measured memory_bytes: 13140
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {
    static final int MOD = 1000000007;
    static final int INF = 1 << 30;
    static final int ALF = 26;

    Main() {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println(S.substring(0,3));
    }

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


Measured memory_bytes: 35680
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <numeric>
#define Rep(i, m, n) for(int i = m;i < n;i++)
#define Brep(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define INF 999999999
using namespace std;

int main(){
    int n; cin >> n;
    long long a[n], b[n], c[n];
    Rep(i, 0, n) cin >> a[i];
    Rep(i, 0, n) cin >> b[i];
    Rep(i, 0, n) cin >> c[i];

    SORT(a, n);
    SORT(b, n);
    SORT(c, n);

    long long ans = 0;
    Rep(i, 0, n){
        long long pA = lower_bound(a, a+n, b[i]) - a;
        long long pB = (c+n) - upper_bound(c, c+n, b[i]);
        //cout << ans << endl;
        ans += pA * pB;
    }

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


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
long long n,ck=2,sum;
int main()
{
    cin>>n;
    sum+=(n/500)*500;
    sum+=sum;
    if(sum) n=n%500;
    sum+=(n/5)*5;
    cout<<sum<<endl;
    return 0;
}


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

using namespace std;

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

    int price = 700;
    for(int i = 0; i < 3; i++) if(s[i] == 'o') price += 100;

    printf("%d\n", price);
    return 0;
}


Measured memory_bytes: 256
N, K = list(map(int, input().split()))
P = list(map(lambda x: int(x) - 1, input().split()))
C = list(map(int, input().split()))

ans = -10**9-1
for i in range(N):
    seen = [-1]*N
    cumsum = [0]*(N+1)
    now = i
    j = 0
    while seen[now] == -1:
        seen[now] = 1
        now = P[now]
        cumsum[j+1] = cumsum[j] + C[now]
        j += 1
    loop_size = j
    if K <= loop_size:
        ans = max([ans] + cumsum[1:K+1])
    else:
        if cumsum[loop_size] > 0:
            loop_n = K//loop_size - 1
            cumsum2 = cumsum[0:loop_size+1] + [x + cumsum[loop_size] for x in cumsum[1:loop_size+1]]
            score = cumsum[loop_size]*loop_n + max(cumsum2[0:loop_size+K%loop_size+1])
            ans = max(ans, score)
        else:
            ans = max([ans] + cumsum[1:loop_size+1])
print(ans)

Measured memory_bytes: 132104
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
typedef struct subject{
  int points;
  int number;
}P;
int main(){
  int n;
  int a,b,c,d;
  P team[101];
  P temp;
  int cnt;
  cin >> n;
  for(int i=1;i<=n;i++){
    team[i].number=i;
    team[i].points=0;
  }
  for(int i=1;i<=((n*(n-1)/2));i++){
    cin >> a >> b >> c >> d;
    if(c==d){
      team[a].points++;
      team[b].points++;
    }if(c>d){
      team[a].points+=3;
    }if(c<d){
      team[b].points+=3;
    }
  }
  for(int i=1;i<=n;i++){
    cnt=1;
    for(int j=1;j<=n;j++){
      if(team[i].points<team[j].points){
	cnt++;
      }
    }
    team[i].number=cnt;
  }
  for(int i=1;i<=n;i++){
    cout << team[i].number << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Already solver = new Already();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class Already {

		private String input;
		private String answer;
		private Scanner scanner;


		public Already() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			input = scanner.next();
		}

		public void solve() {
			answer = input.replace("2017","2018");
		}

		public void writeOutput() {
			System.out.println(answer);
		}
    }
}


Measured memory_bytes: 21844
import sys
readline = sys.stdin.buffer.readline


class SegmentTree:
    def __init__(self, N, func, I):
        self.N = N
        self.sz = 2**(N-1).bit_length()
        self.func = func
        self.I = I
        self.seg = [I] * (self.sz * 2)

    def assign(self, k, x):
        self.seg[k + self.sz] = x

    def build(self):
        for i in reversed(range(1, self.sz)):
            self.seg[i] = self.func(self.seg[2 * i], self.seg[2 * i + 1])

    def update(self, k, x):
        k += self.sz
        self.seg[k] = x
        while k > 1:
            k >>= 1
            self.seg[k] = self.func(self.seg[2 * k], self.seg[2 * k + 1])

    def query(self, a, b):
        L = self.I
        R = self.I
        a += self.sz
        b += self.sz
        while a < b:
            if a & 1:
                L = self.func(L, self.seg[a])
                a += 1
            if b & 1:
                b -= 1
                R = self.func(self.seg[b], R)
            a >>= 1
            b >>= 1
        return self.func(L, R)


def main():
    def gcd(a, b):
        while b:
            a, b = b, a % b
        return a
    N = int(readline())
    L = map(int, readline().split())
    seg = SegmentTree(N, gcd, 0)
    for i, n in enumerate(L):
        seg.assign(i, n)
    seg.build()
    ans = 1
    for i in range(N):
        ans = max(ans, gcd(seg.query(0, i), seg.query(i+1, N)))
    print(ans)


main()


Measured memory_bytes: 60528
#include<bits/stdc++.h>
using namespace std;
inline int read()
{
	int out=0,fh=1;
	char jp=getchar();
	while ((jp>'9'||jp<'0')&&jp!='-')
		jp=getchar();
	if (jp=='-')
		{
			fh=-1;
			jp=getchar();
		}
	while (jp>='0'&&jp<='9')
		{
			out=out*10+jp-'0';
			jp=getchar();
		}
	return out*fh;
}
int main()
{
  	//freopen(".in","r",stdin);
  	//freopen(".out","w",stdout);
  	int n=read();
  	int t=read();
  	t*=1000;
  	int a=read();
	a*=1000;
  	int mi=0x7fffffff,p;
  	for(int i=1;i<=n;++i)
  		{
  			int h=read();
  			int d=abs(a-(t-6*h));
  			if(d<mi)
  				mi=d,p=i;
		}
	cout<<p;
	return 0;
}


Measured memory_bytes: 256
class Dice:
    def __init__(self, dice: list):
        self.top = dice[0]
        self.bottom = dice[5]
        self.front = dice[1]
        self.behind = dice[4]
        self.right = dice[2]
        self.left = dice[3]

    def roll(self, direction: str):
        buffer = self.top
        if direction == 'E':
            self.top = self.left
            self.left = self.bottom
            self.bottom = self.right
            self.right = buffer
        elif direction == 'N':
            self.top = self.front
            self.front = self.bottom
            self.bottom = self.behind
            self.behind = buffer
        elif direction == 'S':
            self.top = self.behind
            self.behind = self.bottom
            self.bottom = self.front
            self.front = buffer
        else:
            self.top = self.right
            self.right = self.bottom
            self.bottom = self.left
            self.left = buffer


def main():
    dice1 = Dice(list(map(int, input().split())))
    for direction in input():
        dice1.roll(direction)
    print(dice1.top)


if __name__ == '__main__':
    main()



Measured memory_bytes: 5596
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	const inputLines = input.split("\n");
	const line0 = inputLines[0];
	const line0vars = line0.split(" ");
	const line1 = inputLines[1];
	const line1vars = line1.split(" ");

	const n = parseInt(line0vars[0], 10);

	var a = [];
	line1vars.forEach(v => a.push(parseInt(v, 10)));

	var sum = 0;
	for (var i = 1; i <= a.length; i++) {
		var j = a[i-1];
		// console.log({
		// 	i: i,
		// 	aim1: a[i-1],
		// 	j: j,
		// 	ajm1: a[j-1]
		// });
		
		if (i === a[j-1] && j === a[i-1]) {
			sum += 1;
		}
	}
	console.log(sum/2);
	// tmp = input[1].split(" ");
	// //文字列から10進数に変換するときはparseIntを使います
	// var a = parseInt(input[0], 10);
	// var b = parseInt(tmp[0], 10);
	// var c = parseInt(tmp[1], 10);
	// var s = input[2];

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

// node index.js
// 1
// 2 3
// test
// (Ctrl + D)


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

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

    int sum=0;
    for(int i=1;i<=n;i+=2){
        int sum2=0;
        for(int j=1;j<=i;j++){
            if(i%j==0) sum2++;
        }

        if(sum2==8) sum++;
    }
    
    cout<<sum<<endl;
    
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define int long long
int is(int m){
	int f=1;
	for(int i=2;i<sqrt(m);i++){
		if(m%i==0){
			f=0;
			break;
		}
	}
	return f;
}
signed main(){
	int n;
	cin>>n;
	for(int i=n;;i++){
		if(is(i)){
			cout<<i;return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
      int n= sc.nextInt();
      boolean judge = false;
      for(int i=0; i<=25; i++){
        for(int j=0; j<=14; j++){
          int sum = 4*i + 7*j;
          if(sum == n){
            judge = true;
          }
        }
      }
      if(judge){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
  }
}

Measured memory_bytes: 23892
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define PB push_back
#define MP make_pair
#define FST first
#define SND second
#define SZ(a) (signed)((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int MOD = 1000000007;
const char ENDL = '\n';

#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"  << " " << __FILE__ << endl;

signed main(void) {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(10);
    cin.tie(0);

    int n;
    cin >> n;
    VI a(n);
    REP(i, n) {
        cin >> a[i];
        a[i]--;
    }

    vector<bool> b(n,false);
    int ans=0;
    REP(i,n){
        if (a[a[i]]==i && b[i] ==false && b[a[i]]==false){
            b[i] =true;
            b[a[i]]=true;
            ans++;
        }
    }

    cout << ans << ENDL;

    return 0;
}

Measured memory_bytes: 1024
import java.util.stream.*;
import java.io.*;

public class Main {

  static int n, m;
  static int[] a;
  
  public static void main(String[] args) throws Exception {
    
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    String[] in = br.readLine().split(" ");
    n = Integer.parseInt(in[0]);
    m = Integer.parseInt(in[1]);

    in = br.readLine().split(" ");
    a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    br.close();

    int s = 0;

    for(int i = 0; i < m; i++){
      s += a[i];
    }
    System.out.println(n - s >= 0 ? n - s : -1);
  }
}

Measured memory_bytes: 36092
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

using namespace std;
typedef long long unsigned int ll;
typedef pair<int, int> P;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvdi(xs) sort(xs.begin(), xs.end(), std::greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)

#define rep(i,n) for(auto i=0; i<(n); i++)
#define isValidPoint(x, y, mx, my) x >= 0 && x  < mx && y >= 0 && y < my

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

const int MOD = 1000000007;

struct Pony
{
    long a, b;
 
    Pony(long a_, long b_)
    {
        a = a_;
        b = b_;
    }
 
    bool operator<(const Pony &another) const
    {
        return b < another.b;
    };
};

int fac(int k){
    int sum = 0;
    for (int i = 1; i <= k; ++i)
    {
        sum += i;
    }
    return sum;
}

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

  long s;

  cin >> s;
  long hei = (long)sqrt(s);
  bool isHei = hei*hei == s;
  if(!isHei) hei++;
  long a2 = hei;
  long b3 = hei;
  long b2 = a2*b3 - s;
  long a3 = b2 ? 1 : 0;


  cout << 0 <<endl;
  cout << 0 <<endl;
  cout << a2 <<endl;
  cout << b2 <<endl;
  cout << a3 <<endl;
  cout << b3 <<endl;
}


Measured memory_bytes: 256
#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_macros)]
#![allow(unused_variables)]
#![allow(unused_imports)]
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        ::std::cmp::max($x, max!($($y),+))
    };
}

macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        ::std::cmp::min($x, max!($($y),+))
    };
}

use std::cmp;
use std::collections::{HashSet, BinaryHeap, VecDeque};
use std::iter::FromIterator;
fn main() {
    input!{
        sx: isize,
        sy: isize,
        tx: isize,
        ty: isize,
    }
    let tx = tx - sx;
    let ty = ty - sy;

    for _ in 0..ty { print!("U") }
    for _ in 0..tx { print!("R") }
    for _ in 0..ty { print!("D") }
    for _ in 0..tx { print!("L") }
    print!("L");
    for _ in 0..ty+1 { print!("U") }
    for _ in 0..tx+1 { print!("R") }
    print!("D");
    print!("R");
    for _ in 0..ty+1 { print!("D") }
    for _ in 0..tx+1 { print!("L") }
    print!("U");
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define MAX 100000
#define pb push_back
#define mp make_pair
#define MOD 1000000007
typedef long long Int;
typedef pair<Int,Int> pii;
typedef vector<Int> vi;
typedef vector<pii> vii;
int main()
{
    string S,A,B;
    cin>>S;
    for (Int i=0;i<4;++i)
        A.pb(S[i]);
    for (Int i=4;i<S.size();++i)
        B.pb(S[i]);
    cout<<A<<" "<<B<<"\n";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
if((a==1&&b==2)||(a==2&&b==1)){
  cout<<"3"<<endl;
}

else if((a==2&&b==3)||(a==3&&b==2)){
  cout<<"1"<<endl;
}
else if((a==1&&b==3)||(a==3&&b==1)){
  cout<<"2"<<endl;
}





return 0;}


Measured memory_bytes: 3624
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int main()
{
	vector<bool> classes(8, false);
	int N; cin >> N;
	int overNum = 0;
	for (int i = 0; i < N; ++i)
	{
		int a; cin >> a;
		if (a >= 3200)
		{
			++overNum;
		}
		else
		{
			classes[a / 400] = true;
		}
	}
	int classNum = count(classes.begin(), classes.end(), true);
	cout << max(1, classNum) << ' ' << classNum + overNum << endl;
}


Measured memory_bytes: 3572
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		if(A == 1){
			A += 13;
		}
		if(B == 1){
			B += 13;
		}
		if(A == B){
			System.out.print("Draw");
		}else if (A > B){
			System.out.print("Alice");
		}else{
			System.out.print("Bob");
		}
	}
}

Measured memory_bytes: 22996
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            //ここで問題を解く。
            var a = cin.ReadInt;
            var b = cin.ReadInt;
            var c = cin.ReadInt;
          	var ans = 0;
          
          	if(( a * b ) >= c){
              ans = c;
            }else if(( a * b ) < c){
              ans = a * b;
            }
          
            Console.WriteLine(ans);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}

Measured memory_bytes: 13268
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define prique priority_queue<P,vector<P>,greater<P>>
#define ggr getchar(); getchar();return 0;
using namespace std;
typedef pair<ll, ll>P;
signed main() {
	ll a,p;
	cin>>a>>p;
	cout<<(a*3+p)/2<<endl;
}

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

using namespace std;

typedef long long ll;


void solve(ll test_num) {
  (void) test_num;
  ll H, W;
  cin >> H >> W;
  for (ll r = 1; r <= H; ++r) {
    for (ll c = 0; c < W; ++c) {
      string str;
      cin >> str;
      if (str == string("snuke")) {
        cout << char(c + 'A') << r << endl;
        return;
      }
    }
  }
}

void init() {

}

int main() {
#ifdef AZN
  freopen("/home/azneye/Documents/Stuff/input.txt", "r", stdin);
#endif
  init();
  ll tests = 1;
  //cin >> tests;
  for (ll test = 1; test <= tests; ++test) {
    solve(test);
  }
  return 0;
}

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

int main() {
  int N, K, X, Y;
  cin >> N >> K >> X >> Y;

  if (N <= K) {
    cout << N*X << endl;
  }
  else {
    cout << X*K + Y*(N-K) << endl;
  }

}


Measured memory_bytes: 256
import heapq
X, Y, Z, K = map(int, input().split())
candy = [[],[],[]]
for i in range(3):
    temp = list(map(int, input().split()))
    candy[i] = temp

for i in range(3):
    candy[i] = sorted(candy[i], reverse=True)
i, j, k = 0, 0, 0
heap = [(-(candy[0][i] + candy[1][j] + candy[2][k]), i, j, k)]
cnt = 0
visit = {(i, j, k)}
while cnt < K:
    s, ii, jj, kk = heapq.heappop(heap)
    print(-s)
    cnt += 1
    if ii < len(candy[0]) - 1 and (ii+1, jj, kk) not in visit:
        heapq.heappush(heap, (-(candy[0][ii + 1] + candy[1][jj] + candy[2][kk]), ii + 1, jj, kk))
        visit.add((ii+1, jj, kk))
    if jj < len(candy[1]) - 1 and (ii, jj+1, kk) not in visit:
        heapq.heappush(heap, (-(candy[0][ii] + candy[1][jj + 1] + candy[2][kk]), ii, jj + 1, kk))
        visit.add((ii, jj+1, kk))
    if kk < len(candy[2]) - 1 and (ii, jj, kk+1) not in visit:
        heapq.heappush(heap, (-(candy[0][ii] + candy[1][jj] + candy[2][kk + 1]), ii, jj, kk + 1))
        visit.add((ii, jj, kk+1))

Measured memory_bytes: 4960
; ABC124-B

(defun build_list(l n)
  (let ((h (read)))
	(if (<= n 1) 
	  (cons h nil)
	  (cons h (build_list l (- n 1)))
	  )
	)
  )

(defun calc(l v)
  (if (null (car l))
	0
	(+ (if (>= (car l) v) 1 0) (calc (cdr l) (if (> (car l) v) (car l) v)))
	)
  )

(let ((n (read)))
  (let ((l (build_list '() n)))
	(setq r (calc l (car l)))
	(format t "~d~%" r)
	)
  )



Measured memory_bytes: 13672
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int N,Q;cin>>N>>Q;
    string S;cin>>S;
    vector<vector<int>>vec(Q,vector<int>(2));
    for(int i=0;i<Q;i++){
        for(int k=0;k<2;k++)cin>>vec.at(i).at(k);
    }
    //入力完了
    vector<int>coun(N);
    int count=0;
    for(int i=0;i<N-1;i++){
        if(S.at(i)=='A'&&S.at(i+1)=='C'){
            count++;
        }
            coun.at(i+1)=count;
    }
    for(int i=0;i<Q;i++){
        cout<<coun.at(vec.at(i).at(1)-1)-coun.at(vec.at(i).at(0)-1)<<endl;
    }
}

Measured memory_bytes: 7808
use std::collections::*;
use std::io::*;
use std::*;
// template {{{
macro_rules! get {
    ($($t:tt),*; $n:expr) => {
        {
            let stdin = std::io::stdin();
            let ret = std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
                let line = line.unwrap();
                let mut it = line.split_whitespace();
                _get!(it; $($t),*)
            }).collect::<Vec<_>>();
            ret
        }
    };
    ($($t:tt),*) => {
        {
            let mut line = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut it = line.split_whitespace();
            _get!(it; $($t),*)
        }
    };
}
macro_rules! _get {
    ($it:ident; [char]) => {
        _get!($it; String).chars().collect::<Vec<_>>()
    };
    ($it:ident; [u8]) => {
        _get!($it; String).bytes().collect::<Vec<_>>()
    };
    ($it:ident; usize1) => {
        $it.next().unwrap().parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1
    };
    ($it:ident; [usize1]) => {
        $it.map(|s| s.parse::<usize>().unwrap_or_else(|e| panic!("{}", e)) - 1).collect::<Vec<_>>()
    };
    ($it:ident; [$t:ty]) => {
        $it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
    };
    ($it:ident; $t:ty) => {
        $it.next().unwrap().parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
    };
    ($it:ident; $($t:tt),+) => {
        ($(_get!($it; $t)),*)
    };
}
// }}}

fn main() {
    let (n, k) = get!(usize, i64);
    let a = get!([i64]);
    let mut l: i64 = 0;
    let mut r: i64 = *a.iter().max().unwrap();
    while r - l > 1 {
        let mid = (l + r) / 2;
        let mut count: i64 = 0;
        for i in 0..n {
            count += a[i] / mid;
            if a[i] % mid == 0 {
                count -= 1;
            }
        }
        if count <= k {
            r = mid;
        } else {
            l = mid;
        }
    }
    println!("{}", r);
}


Measured memory_bytes: 5604
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;
 
int main() {
  ll n;
  cin >> n;
  vl v;
  inputv(v,n);
  ll s1=0,s2=0;
  ll sum=0;
  rep(i,n){
    sum += v[i];
  }
  s1 = v[0];
  s2 = sum - v[0];
  ll mn;
  mn = abs(s1-s2);
  for(int i=1;i<n;i++){
    s1 += v[i];
    s2 -= v[i];
    mn = min(mn,abs(s1-s2));
  }
  cout << mn;
 return 0;
}


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

int main()
{
	//int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
	long a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, ans = 0;
	//cout << LONG_MAX << endl;
	int p[200001];
	int n;
	cin >> a;
	cin >> b;
	c=max(a - b, a + b);
	c=max(c, a*b);

	
	cout << c << endl;
	return 0;
}

Measured memory_bytes: 256
module WeightedGraph
  (Vertex : sig
    type t
    val compare : t -> t -> int
  end)
  (Weight : sig
    type t
    val compare : t -> t -> int
  end) :
sig
  val prim :
    (* 隣接リスト *)
    (Vertex.t -> (Vertex.t * Weight.t) list) ->
    (* 始点 *)
    Vertex.t ->
    (* 最小全域木に含まれる辺のリスト *)
    (Vertex.t * Vertex.t * Weight.t) list
end =
struct
  module VSet = Set.Make (Vertex)
  module WMap = Map.Make (Weight)

  (*
   * プリム法のメインループ
   * es : 隣接リスト
   * vs : 訪れた頂点の集合
   * q : 訪れた頂点から伸びる辺が重み順に入ったヒープ
   * acc : 最小全域木に使うのが確定した辺を入れるやつ
   *)
  let rec prim_aux es acc vs q =
    match WMap.min_binding q with
    | exception Not_found -> acc
    | (w, []) -> prim_aux es acc vs (WMap.remove w q)
    | (w, (u, v) :: rest) ->
        if VSet.mem v vs then
          (* vは既に訪れていた *)
          prim_aux es acc vs (WMap.add w rest q)
        else
          (* vはまだ訪れていなかった *)
          prim_aux es ((u, v, w) :: acc) (VSet.add v vs) @@
            (* vから伸びる辺をキューに追加 *)
            List.fold_left (fun q (u, w) ->
              WMap.add w ((v, u) :: try WMap.find w q with Not_found -> []) q) (WMap.add w rest q) (es v)

  let prim es s =
    prim_aux es [] (VSet.singleton s) @@
      (* 始点から伸びる辺をキューに入れておく *)
      List.fold_left (fun q (v, w) ->
        WMap.add w ((s, v) :: try WMap.find w q with Not_found -> []) q) WMap.empty (es s)
end

module Int = struct
  type t = int
  let compare = compare
end

module G = WeightedGraph (Int) (Int)

let () = Scanf.scanf "%d\n" (fun n ->
  let xys = Array.to_list @@ Array.init n (fun i -> Scanf.scanf "%d %d\n" (fun x y -> x, y, i)) in
  let es = Array.make n [] in
  begin match List.sort (fun (x, _, _) (x', _, _) -> compare x x') xys with
  | [] -> ()
  | (x, y, i) :: rest ->
      ignore @@ List.fold_left (fun (x, y, i) (x', y', j) ->
        es.(i) <- (j, min (abs (x - x')) (abs (y - y'))) :: es.(i);
        es.(j) <- (i, min (abs (x - x')) (abs (y - y'))) :: es.(j);
        (x', y', j)) (x, y, i) rest
  end;
  begin match List.sort (fun (_, y, _) (_, y', _) -> compare y y') xys with
  | [] -> ()
  | (x, y, i) :: rest ->
      ignore @@ List.fold_left (fun (x, y, i) (x', y', j) ->
        es.(i) <- (j, min (abs (x - x')) (abs (y - y'))) :: es.(i);
        es.(j) <- (i, min (abs (x - x')) (abs (y - y'))) :: es.(j);
        (x', y', j)) (x, y, i) rest
  end;
  G.prim (Array.get es) 0
  |> List.map (fun (_, _, w) -> w)
  |> List.fold_left ( + ) 0
  |> Printf.printf "%d\n")


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

unsigned int get(unsigned int k,char c){
	for(char i='d';i>c;i--)
		if(i!=c)k/=10;
	return k%10;
}
char* skip(char *s){
	int cnt=0;
	while(1){
		if(*s=='[')cnt++;
		if(*s==']')cnt--;
		if(cnt==0)break;
		s++;
	}
	s++;
	return s;
}
unsigned int f(char *s,unsigned int k){
	if(*s=='['){
		char *s1=s+2;
		char *s2=skip(s1);
		unsigned int l=f(s1,k),r=f(s2,k);
		if(s[1]=='+')
			return l|r;
		else if(s[1]=='*')
			return l&r;
		else return l^r;
	}else return get(k,*s);
}
int main(){
	char s[255];
	while(scanf(" %s",s),s[0]!='.'){
		unsigned int k;
		scanf("%u",&k);
		unsigned int hk=f(s,k),cnt=0;
		for(unsigned int i=0;i<=9999;i++){
			unsigned int hi=f(s,i);
			if(hk==hi)cnt++;
		}
		printf("%u %u\n",hk,cnt);
	}
	return 0;
}


Measured memory_bytes: 3144
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <array>

using namespace std;

bool l[5];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int a, b;
	cin >> a >> b;
	l[a]=1;
	l[b]=1;
	for(int i=1; i<4; i++){
		if(!l[i]){
			cout << i << '\n';
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define N 1000005
#define ll long long int 	
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("badhair.gir","r",stdin);freopen ("badhair.cik","w",stdout);
#define mod 1000000007
#define fs(x,y) for(ll i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(ll i=x;i<=y;i++)
#define INF 1000000000005
using namespace std;
 
ll n,m,ar[N],sum,t,p[N],tt[N];
 
ll tut[N];
map<ll,int> cnt;
// ll cnt[N];
 
ll fastpow(ll x,ll y)
{
	if(y==0)
		return 1;
	if(y==1)
		return x;
	if(y==2)
		return x*x;
	if(y==3)
		return x*x*x;
}
 
void sieve(ll ln)
{
	for(ll i=2;i<=ln;i++)
	{
		if(tt[i])
			continue;
		p[++m]=i;
		for(ll j=i*i;j<=ln;j+=i)
			tt[j]=1;
	}
 
}
void f(int ind)
{
	ll x=ar[ind];
	ll tutmac=1;
	ar[ind]=1;
	
	// int l=0;
	for(int i=1;i<=m;i++)
	{
		if(x%p[i]!=0)
			continue;
		int l=0;
		while(x%p[i]==0)
		{
			l++;
			x/=p[i];
		}
		// break;
		l%=3;
		// cout<<ind<<sp<<flag<<sp<<l<<endl;
		ar[ind]*=fastpow(p[i],l);
		// if(l%3!=0)
		tutmac*=fastpow(p[i],(3-l)%3);
	}
 
	
	if(x!=1)
	{
		ll y=sqrt(x);
		if(y*y==x)
			tutmac*=y;
		else
			tutmac*=x*x;
	}
	ar[ind]*=x;
 
 
 
	cnt[ar[ind]]++;
	tut[ind]=tutmac;
}
 
int main()
{
	fast;
	cin>>n;
	sieve(2155);
	// cout<<m<<endl;
	fs(ar,n);
	fo(i,1,n)
		f(i);
	// fo(i,1,n)
	// cout<<ar[i]<<sp<<tut[ar[i]]<<endl;
	for(int i=1;i<=n;i++)
	{
		if(ar[i]==1)
			continue;
		sum+=max(cnt[ar[i]],cnt[tut[i]]);
		cnt[ar[i]]=0;
		cnt[tut[i]]=0;
	}
	// if(!sum)
	// 	return cout<<0,0;
	if(cnt[1])
		sum++;
	cout<<sum;
 
}
 
 
 
/*     cd onedrive\desktop\kod
cls
 
Sinav:21-22 aralik
Aciklama: Muhtemelen 25 aralik
*/

Measured memory_bytes: 19712
import sys
import numpy as np
from math import *
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip()
    count = 0


    char_dict = {}
    for i in range(len(input_raw)):
        if input_raw[i] in char_dict:
            char_dict[input_raw[i]] += 1
        else:
            char_dict[input_raw[i]] = 1

    save_input_raw = input_raw
    min_count = sys.maxint
    for target_char in char_dict:
        input_raw = save_input_raw
        count = 0
        while 1:
            char_dict2 = {}
            for i in range(len(input_raw)):
                if input_raw[i] in char_dict2:
                    char_dict2[input_raw[i]] += 1
                else:
                    char_dict2[input_raw[i]] = 1

            if len(char_dict2) == 1:
                break;
            count += 1
            new_text = str(input_raw)

            for i in range(len(input_raw)):
                if new_text[len(input_raw) - 1 - i] != target_char:
                    new_lst = list(new_text)
                    new_lst.pop(len(input_raw) - 1 - i)
                    new_text = ''.join(new_lst)
                    break;


            for i in range(len(new_text) - 1):
                if (new_text[i] != target_char and
                    input_raw[i + 1] == target_char):
                    new_lst[i] = new_text[i + 1]
            new_text = ''.join(new_lst)
            input_raw = new_text
            #print new_text
        if count < min_count:
            min_count = count

    print min_count


if __name__ == '__main__':
    main()

Measured memory_bytes: 19308
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#define debug(x) cerr << #x << ':' << x << endl
#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()
using namespace std;
typedef long long ll;

int main(){
    int a, b, t;
    cin >> a >> b >> t;
    cout << t / a *b << endl;
    return 0;
}

Measured memory_bytes: 888
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b , a % b);
}

ll mod(ll a){
  return (a % 1000000007);
}

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



int main(){
  ll k; cin >> k; ll sum = 0;
  
  for(ll i=1; i <= k; i++){
    for(ll j=1; j <= k; j++){
      for(ll l=1; l <= k; l++){
        sum += gcd(l,gcd(i,j));
      }
    }
  }
  
  cout << sum << endl;
}

Measured memory_bytes: 3548
//コンパイラ最適化用
#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<chrono>//実行時間計測
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm,accumulate
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//順序保持しないmap
#include<unordered_set>//順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;
typedef pair<ll, ld> pld;
typedef pair<pii, int> ppiii;
typedef pair<pii, ll> ppiill;
typedef pair<pll, ll> ppllll;
typedef pair<pli, int> pplii;
typedef map<int, int> mii;
typedef deque<ll> dll;
typedef queue<ll> qll;
typedef priority_queue<ll> pqll;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqrll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<int>> vvint;
typedef vector<vector<pll>> vvpll;

//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define cin(x) cin >> x

signed main(){
    //入力の高速化用のコード
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    //入力
    vvll A(3,vll(3));
    REP(i,3){
        REP(j,3){
     cin >> A[i][j];
        }
    }

    ll N = 0;
    cin >> N;

    vll b(N);
    REP(i,N) cin >> b[i];


    //本文
    vvll a(3,vll(3,0));
    REP(i,3){
        REP(j,3){
            REP(k,N){
                if(A[i][j]==b[k]) a[i][j]=1;
            }
        }
    }
    //出力
    string ans = "No";
    REP(i,3){
    if(a[i][0]==1&&a[i][1]==1&&a[i][2]==1) ans = "Yes";
    }
    REP(i,3){
    if(a[0][i]==1&&a[1][i]==1&&a[2][i]==1) ans = "Yes";
    }
    if(a[0][0]==1&&a[1][1]==1&&a[2][2]==1) ans = "Yes";
    if(a[0][2]==1&&a[1][1]==1&&a[2][0]==1) ans = "Yes";

    cout << ans << endl;
    //REP(i,N) cout << ans.at(i) <<endl;
  return 0;
}

Measured memory_bytes: 3616
<?php
// 入力
fscanf(STDIN, "%d", $N);
//$aList = explode(" ", trim(fgets(STDIN)));

$hash = [];
for($i = 0; $i < $N; $i++) {
	fscanf(STDIN, "%s", $S);
	$hash[$S] = ($hash[$S] ?? 0) + 1;
}

// 降順ソート
arsort($hash);

$val = -1;
$ansList = [];
foreach($hash as $key => $value) {
	if($val >= 0 && $val != $value) {
		break;
	}
	$ansList[] = $key;
	$val = $value;
}

sort($ansList);

foreach($ansList as $v) {
	echo "{$v}\n";
}


Measured memory_bytes: 29176
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,op,b = input().split()
if op == '+':
    print(int(a) + int(b))
else:
    print(int(a) - int(b))


Measured memory_bytes: 10276
N = int(input())
a = list(map(int,input().split()))
total = 1
k = 10**18
for i in range(len(a)):
	if a[i] == 0:
		total = 0
		break
if total != 0:
  for i in range(len(a)):	
      total *= a[i]
      if total > k:
          total =-1
          break    
print(total)


Measured memory_bytes: 21596
#include <bits/stdc++.h>
#define Inf 0x3f3f3f3f
#define rg register
using namespace std;
typedef long long ll;
inline ll min(ll x, ll y) { return x < y ? x : y; }
inline ll max(ll x, ll y) { return x > y ? x : y; }
const int Maxn = 25;
inline ll read()
{
	rg ll res = 0, sign = 1;
	rg char ch = getchar();
	while (!isdigit(ch))
	{
		if (ch == '-')
			sign = -1;
		ch = getchar();
	}
	do
	{
		res = (res << 3) + (res << 1) + (ch ^ 48);
		ch = getchar();
	} while (isdigit(ch));
	return res * sign;
}
int n, a[Maxn], b[Maxn], c[Maxn], ans;
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++)
		a[i] = read();
	for (int i = 1; i <= n; i++)
		b[i] = read();
	for (int i = 1; i < n; i++)
		c[i] = read();
	for (int i = 1; i <= n; i++)
	{
		ans += b[a[i]];
		if (a[i + 1] == a[i] + 1)
			ans += c[a[i]];
	}
	cout << ans << endl;
	return 0;
}
//B

Measured memory_bytes: 256
/// Kazuki Hoshino


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<pi> vpi;
#define inf 1000000000
#define mod 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define f first
#define ss second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple

ll n,ans=1,temp;

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

//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);


cin >> n;

rep(i, 2, n){
    bool flag = false;
    rep(j, 2, i-1){
    if(i%j==0)flag = true;
    }
if(flag)continue;
ll x = n;
ll p = i;
temp = 0;
while(x/p>0){
    temp+= x/p;
    p*=i;
}
ans = ans*(temp+1)%mod;
}

cout << ans << endl;






return 0;}
///....


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(ll i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<ll, ll>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};


int main(){
    ll n, c;
    cin >> n >> c;
    vector<P> p(n);
    rep(i, n) cin >> p[i].first >> p[i].second;
    
    vector<ll> s(n+1);
    vector<ll> rs(n+1);
    vector<ll> maxv(n+1);
    vector<ll> rmaxv(n+1);
    rep(i, n) {
        ll walk;
        if (i==0) walk = p[i].first;
        else walk = p[i].first - p[i-1].first;
        s[i+1] = s[i] + p[i].second - walk;
        //debug(s[i+1]);
        if (s[i+1]>maxv[i]) maxv[i+1] = s[i+1];
        else maxv[i+1] = maxv[i];
        //debug(maxv[i+1]);
    }
    for (int i=n-1; i>=0; i--) {
        ll walk;
        if (i==n-1) walk = c - p[i].first;
        else walk = p[i+1].first - p[i].first;
        rs[i] = rs[i+1] + p[i].second - walk;
        if (rs[i]>rmaxv[i+1]) rmaxv[i] = rs[i];
        else rmaxv[i] = rmaxv[i+1];
        //debug(rmaxv[i]);
    }

    ll ans = 0;
    chmax(ans, maxv[n]);
    chmax(ans, rmaxv[0]);
    for (int i=1; i<=n-1; i++) {
        ll now1 = s[i] - p[i-1].first + rmaxv[i];
        chmax(ans, now1);
        ll now2 = rs[n-i] - (c - p[n-i].first) + maxv[n-i];
        chmax(ans, now2);
    }
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4992
using System;
using System.Collections.Generic;
using System.Linq;

namespace ABC125D
{
    class MainClass
    {

        static long[] a;
        static int[] n;

        public static void Main(string[] args)
        {
            int INF = int.MinValue;
            n = Array.ConvertAll(Console.ReadLine().Split().ToArray(), int.Parse);
            a = Array.ConvertAll(Console.ReadLine().Split().ToArray(), long.Parse);

            long[,] dp = new long[n[0]+1, 2];
            dp[0, 0] = 0;
            dp[0, 1] = INF;
            for (int i = 0; i < n[0]; i++)
            {
                dp[i + 1, 0] = Math.Max(dp[i, 0] + a[i ], dp[i, 1] - a[i ]);
                dp[i + 1, 1] = Math.Max(dp[i, 0] - a[i ], dp[i, 1] + a[i ]);
            }
            Console.WriteLine(dp[n[0], 0]);

        }
    }
}


Measured memory_bytes: 32220
m, d = map(int, input().split())
count = 0
for i in range(m+1):
    for j in range(d+1):
        iti = j%10
        zyu = (j -iti)/10
        if iti >=2 and zyu >=2 and iti*zyu ==i:
            count +=1
print(count)

Measured memory_bytes: 3060