criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

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

	int keta = 0;
	int n = 0;
	{
		long long t = N;
		while (t > 0)
		{
			n += t % 10;
			t /= 10;
			keta++;
		}
	}

	if (keta == 1)
	{
		cout << N << endl;
		return 0;
	}

	int ans = N / (pow(10, (keta - 1))) - 1;
	for (int i = 1; i < keta; i++)
	{
		ans += 9;
	}

	if (n > ans)
		ans = n;

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:24: error: 'pow' was not declared in this scope
   29 |         int ans = N / (pow(10, (keta - 1))) - 1;
      |                        ^~~
Language: C++

N = long(raw_input())

if all(map(lambda x: x == '9', str(N)[1:])):
    print(sum(map(int, str(N))))
else:
    print((int(str(N)[0]) - 1) + (len(str(N))-1) * 9)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = long(raw_input())
      | ^
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
    int len,maxsum,flag,i;
    char str[20];
    while(gets(str)!=0)
    {
        flag=1;
        len = strlen(str);
        for(i=1;i<len;i++)
        {
            if(str[i]<'9')
                flag=0;
        }
        if(flag==0)
            maxsum=str[0]-'0'+9*(len-1)-1;
            else
                maxsum=str[0]-'0'+9*(len-1);
        printf("%d\n",maxsum);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     while(gets(str)!=0)
      |           ^~~~
      |           getw
Language: C++

#include <iostream>
#include <cstdio>
#include <bitset>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
#include <limits>

using namespace std;
using ll=long long;
using vint=vector<int>;
using pint=pair<int,int>;

const double EPS = 1e-9;
const int inf = numeric_limits<int>::max();

#define rep(i,n) for(int i=0;i<int(n);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,i,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl

void solve(){
	string N;
	cin >> N;
	int i = 0;
	int n[];
	for(char t : N){
		i += t - '0';
	} 
	int j = N[0] - '0' - 1 + 9 * int(N.size() - 1);
	cout << max(i, j) << endl;
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:33:13: error: storage size of 'n' isn't known
   33 |         int n[];
      |             ^
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main()
{
   	char a[100];
	int ans;
	scanf("%s",a);
	if(strlen(a)==1) ans=a[0]-'0';
	else ans=(strlen(a)-1)*9+a[0]-'0'-1;
	print("%d\n",ans);
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   12 |         print("%d\n",ans);
      |         ^~~~~
      |         printf
Language: C

#include <stdio.h>
using namespace std;
int f(int n)
{
	int sum=0;
	while(n)
	{
		sum+=n%10;
		n/=10;
	}
	return sum;
}
int main()
{
	int n,max=0;
	scanf("%d",&n);
	for(int i=0;i<=n;i++)
	{
		if(f(i)>max)
			max=f(i); 
	}
	printf("%d",max);
}

Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
int main() {
	char a[110];
	int b[110];
	scanf("%s", a + 1);
	int n = strlen(a + 1);
	cout << a[1] - '0' - 1 + (n - 1) * 9;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         cout << a[1] - '0' - 1 + (n - 1) * 9;
      |         ^~~~
      |         std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
long long int N,dig,sum1=0,sum2=0;
cin>>N;
for(i=1;i<=N;i++){
sum1=0;
while(i){
 dig=i%10;
 sum1+=dig;
 N=N/10;
}
if(sum1>sum2) sum2 = sum1;
}
cout<<sum2<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'i' was not declared in this scope
    6 | for(i=1;i<=N;i++){
      |     ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(){
string N;
cin >> N;
int i = 0;
for(char t : N)
  i+= t-'0';
int j = N[0] -'0' - 1 + 9 * int(N.size()-1);
cout << max(I,j) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'I' was not declared in this scope
   14 | cout << max(I,j) << endl;
      |             ^
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;

int main()
{
   	char a[100];
	int ans;
	scanf("%s,a);
	if(strlen(a)==1) ans=a[0]-'0';
	else ans=(strlen(a)-1)*9+a[0]-'0'-1;
	print("%d\n",ans);
   return 0;
}

Compiler output:
a.cc:9:15: warning: missing terminating " character
    9 |         scanf("%s,a);
      |               ^
a.cc:9:15: error: missing terminating " character
    9 |         scanf("%s,a);
      |               ^~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: expected primary-expression before 'if'
   10 |         if(strlen(a)==1) ans=a[0]-'0';
      |         ^~
a.cc:11:9: error: 'else' without a previous 'if'
   11 |         else ans=(strlen(a)-1)*9+a[0]-'0'-1;
      |         ^~~~
a.cc:12:9: error: 'print' was not declared in this scope; did you mean 'printf'?
   12 |         print("%d\n",ans);
      |         ^~~~~
      |         printf
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	char n[20];
	int flag=1;
	scanf("%s",n);
	for(i=1;i<strlen(n);i++)
	{
		if(n[i]!=9)
			flag=0;
	}
	printf("%d",(strlen(n)-1)*9+(flag?n[0]-'0':n[0]-'1'));
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i=1;i<strlen(n);i++)
      |             ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>

const int MAXN=20;

int n;
char s[MAXN];

bool allnine()
{
	for(int i=1;i<n;i++) if(s[i]!='9') return false;
	return true;
}

int main()
{
	int i;scanf("%s",s);
	n=strlen(s);
	if(n==1) {printf("%d",s[0]-'0');return 0;}
	if(allnine())
	{
		int ans=0;
		for(i=0;i<n;i++) ans+=s[i]-'0';
		printf("%d",ans);
	}
	printf("%d",s[0]-1-'0'+(n-1)*9);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'strlen' was not declared in this scope
   19 |         n=strlen(s);
      |           ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 |
Language: C++

#define _USE_MATH_DEFINES
#include <bits\stdc++.h>
using namespace std;

#define int long long

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

string N;

signed main() {
    cin >> N;
    int ans = 0;
    int sum = 0;
    for (int i = 0; i < N.length(); i++) {
        ans += N[i] - '0';
    }
    for (int i = 0; i < N.length(); i++) {
        if (N[i] == '0') {
            continue;
        }
        sum += N[i] - '0';
        int cur = sum + (N.length() - i - 1) * 9 - 1;
        ans = max(cur, ans);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:2:10: fatal error: bits\stdc++.h: No such file or directory
    2 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

int main(void){

	string s;

	cin >> s;


	int sum = 0;

	int num = 0;

	for (int i = 0; i < s.size(); i++){
		if (s[i] == '9')
			num++;
	}


	if (s.size() == 1){
		sum = s[i] - '0';
	}
	else if (s.size() != num)
		sum += s[0] - '1';
	else
		sum += 9;

	sum += 9*(s.size()-1);


	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: 'i' was not declared in this scope
   27 |                 sum = s[i] - '0';
      |                         ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

int main(void){

	string s;

	cin >> s;


	int sum = 0;

	int num = 0;

	for (int i = 0; i < s.size(); i++){
		if (s[i] == '9')
			num++;
	}


	if (s.size() == 1){
		num = s[i] - '0';
	}
	else if (s.size() != num)
		sum += s[0] - '1';
	else
		sum += 9;

	sum += 9*(s.size()-1);


	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: 'i' was not declared in this scope
   27 |                 num = s[i] - '0';
      |                         ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

int main(void){

	string s;

	cin >> s;


	int sum = 0;

	int num = 0;

	for (int i = 0; i < s.size(); i++){
		if (s[i] == '9')
			num++;
	}


	if (s.size() == 1){
		num = s[i] - '0';
	}

	else if (s.size() != num)
		sum += s[0] - '1';
	else
		sum += 9;

	sum += 9*(s.size()-1);


	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: 'i' was not declared in this scope
   27 |                 num = s[i] - '0';
      |                         ^
Language: C++

#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <algorithm>
using namespace std;
typedef long long LL;
LL n,cnt,a[20];
int main(){
	scanf("%lld",&n);
	cnt=0;
	while (n)
		a[++cnt]=n%10,n/=10;
	int ans=0;
	for (int i=cnt,tot=0;i>=1;i--){
		if (a[i])
			ans=max(ans,(int)(tot+a[i]-1+9*(i-1)));
		tot+=a[i];
	}
	printf("%d",max(n,ans));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: no matching function for call to 'max(LL&, int&)'
   20 |         printf("%d",max(n,ans));
      |                     ~~~^~~~~~~
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:20:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |         printf("%d",max(n,ans));
      |                     ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:20:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |         printf("%d",max(n,ans));
      |                     ~~~^~~~~~~
Language: C++

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

int main()
{
	int n;
	cin >> n;
	
	int mx = 0;
	for(int i = 1; i <= n; ++i)
	{
		int s = 0;
		int j = i;
		
		while(j)
		{
			s += j % 10;
			j /= 10;
		}
		
		mx = max(mx, s);
	}
	
	cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 's' was not declared in this scope
   24 |         cout << s << endl;
      |                 ^
Language: C

#include <iostream>
#include <string>

int main() {
	std::string n;
	std::cin >> n;
	if (n.size() == 1) {
		std::cout << n << std::endl;
		return 0;
	}

	bool isCorner = true;
	for (int i = 1; i < n.size(); ++i)
		if (n[i] != '9')
			isCorner = false;

	std::cout << (n.size() - 1) * 9 + (n[0] - '0') - (isCorner ? 0 : 1) << std::endl;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.util.StringTokenizer;

public class AGC021A {
    public static void main(String[] args) {
        new AGC021A().solve();

    }

    private void solve() {
        InputReader sc = new InputReader();
        String n = sc.next();
        int v = (n.length() - 1) * 9 + (n.charAt(0) - '0' - 1);

        System.out.println(v);
    }

    static class InputReader extends BufferedReader {
        StringTokenizer st = new StringTokenizer("");

        public InputReader() {
            super(new InputStreamReader(System.in));
        }

        public InputReader(String s) {
            super(new StringReader(s));
        }

        String next() {
            try {
                while (!st.hasMoreTokens())
                    st = new StringTokenizer(readLine());
            }
            catch (IOException e) {
                throw new RuntimeException(e);
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }
}


Compiler output:
Main.java:7: error: class AGC021A is public, should be declared in a file named AGC021A.java
public class AGC021A {
       ^
1 error
Language: C++

#include <cstdio>
#include <algorithm>


char s[200];
int a[200];

int main()
{
    scanf("%s", s);
    int n = strlen(s);
    for (int i = 0; i < n; ++ i)
        a[i] = s[n - 1 - i] - '0';
    int result = 0;
    for (int i = 0; i < n; ++ i)
        result += a[i];
    for (int i = 0; i < n; ++ i) if (a[i]) {
        int tmp = i * 9 + a[i] - 1;
        for (int j = i + 1; j < n; ++ j)
            tmp += a[j];
        if (result < tmp)
            result = tmp;
    }
    printf("%d\n", result);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'strlen' was not declared in this scope
   11 |     int n = strlen(s);
      |             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll sum(ll x) {
    ll res = 0;
    while (x) {
        res += x % 10;
        x /= 10;
    }
    return res;
}

int main() {
#ifdef MY
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin >> n;
    ll maxk = sum(n);
    vector<ll> nums;
    ll x = n;
    while (x) {
        nums.push_back(x % 10);
        x /= 10;
    }
    cout << max(nums.back() - 1 + (nums.size() - 1) * 9, maxk) << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:16: error: no matching function for call to 'max(long long unsigned int, ll&)'
   33 |     cout << max(nums.back() - 1 + (nums.size() - 1) * 9, maxk) << "\n";
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:33:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'll' {aka 'long long int'})
   33 |     cout << max(nums.back() - 1 + (nums.size() - 1) * 9, maxk) << "\n";
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:33:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   33 |     cout << max(nums.back() - 1 + (nums.size() - 1) * 9, maxk) << "\n";
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>

using namespace std;

void main() {
	long long N;
	cin >> N;
	long long ans = 0;
	while (N >= 10) {
		ans += 9;
		N /= 10;
	}
	ans += (N - 1);
	cout << ans << endl;
	system("pause");
}

Compiler output:
a.cc:9:1: error: '::main' must return 'int'
    9 | void main() {
      | ^~~~
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		final Scanner sc = new Scanner(System.in);
		long n = sc.nextInt();
		long keta = 1;
		while(n > 9) {
			n /= 10;
			keta++;
		}
		System.out.println(9*keta);
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#pragma GCC optimize("trapv");
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <random>
#include <chrono>
#include <tuple>
#include <random>

using namespace std;

typedef long long ll;
typedef long double ld;
#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

const ll SIZE = 1e5 * 2 + 10;
const ld INF = 1e9 * 1e9;

const ll A = 1e6;
const ld MOD = 1e9 * 10, C = 1e9 * 2 * 10;

vector<pair<ld, ld>> vls;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<ld> cnt;

int main()
{
	fastInp;

	ll n;
	cin >> n;

	cnt.resize(n);
	for (int i = 0; i < n; i++) {
		ld x, y;
		cin >> x >> y;
		x += MOD;
		y += MOD;
		vls.push_back({ x, y });
	}

	for (int i = 0; i < A; i++) {
		pair<ld, ll> mn = { INF, -1 };
		ll curX = rng() % ll(C), curY = rng() % ll(C);
		//if (i < 100) cout << curX << " " << curY << "\n";
		for (int j = 0; j < n; j++) {
			ld cur = sqrt(ld(curX - vls[j].first) * ld(curX - vls[j].first) + ld(curY - vls[j].second) * ld(curY - vls[j].second));
			mn = min(mn, { cur, j });
		}
		cnt[mn.second]++;
	}

	cout.precision(7);
	for (auto cur : cnt) cout << cur / ld(A) << "\n";
	return 0;
}

Compiler output:
a.cc:1:30: error: '#pragma GCC optimize' string is badly formed
    1 | #pragma GCC optimize("trapv");
      |                              ^
Language: C++

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

using ld=long double;
const ld PI=acos(-1);
void chmin(ld &a,ld b){
  if(a>b)a=b;
}
ld o;

signed main(){
  int N;cin>>N;
  vector<ld> x(N),y(N);
  for(int i=0;i<N;i++)cin>>x[i]>>y[i];
  vector<ld> kakudo(N-1);
  for(int i=0;i<N;i++){
    int cnt=0;
    for(int j=0;j<N;j++) if(i!=j) kakudo[cnt++]=atan2(y[j]-y[i],x[j]-x[i]);
    sort(kakudo.begin(),kakudo.end());
    ld the=10000;
    for(int j=0;j<N-1;j++)
      ld the2=kakudo[(j+N-2)%(N-1)]-kakudo[j];
      if(the2<0)the2+=2*PI;
      chmin(the,the2);
    }
    the=PI-the;
    cout<<fixed<<setprecision(12)<<max(o,the/(PI*2))<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: 'the2' was not declared in this scope; did you mean 'the'?
   23 |       if(the2<0)the2+=2*PI;
      |          ^~~~
      |          the
a.cc:24:17: error: 'the2' was not declared in this scope; did you mean 'the'?
   24 |       chmin(the,the2);
      |                 ^~~~
      |                 the
a.cc:26:5: error: 'the' was not declared in this scope
   26 |     the=PI-the;
      |     ^~~
a.cc: At global scope:
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<iostream>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
#include<memory>
#include<iomanip>
using namespace std;
using ll=long long;

#include "geometry.hpp"
#include<vector>
#include<algorithm>

namespace Geometry{
    vector<Point> convexFull(const vector<Point>& _ps){
        vector<Point> ps=_ps;
        int n=ps.size();
        if(n<=1) return ps;
        auto cmp=[](const Point &lhs,const Point &rhs){
            return real(lhs)==real(rhs) ? imag(lhs)<imag(rhs) : real(lhs)<real(rhs);
        };
        sort(ps.begin(),ps.end(),cmp);
        int k=0;
        vector<Point> qs(n*2);
        for(int i=0;i<n;i++){
            while(k>=2 && ccw(qs[k-2],qs[k-1],ps[i])<=0) --k;
            qs[k++]=ps[i];
        }
        int t=k;
        for(int i=n-2;i>=0;i--){
            while(k>t && ccw(qs[k-2],qs[k-1],ps[i])<=0) --k;
            qs[k++]=ps[i];
        }
        qs.resize(k-1);
        return qs;
    }
}using namespace Geometry;

const double pi=acos(-1);
int main(){
    int n;
    cin>>n;
    vector<Point> ps(n);
    for(int i=0;i<n;i++){
        int x,y;
        cin>>x>>y;
        ps[i]={x,y};
    }
    cout<<setprecision(10)<<fixed;

    
    vector<Point> cps=convexFull(ps);
    vector<double> res(n);
    if(cps.size()<=2){
        for(int j=0;j<cps.size();j++){
            for(int i=0;i<n;i++){
                if(cps[j]==ps[i]){
                    res[i]=1./cps.size();
                }
            }
        }
        for(int i=0;i<n;i++) cout<<res[i]<<endl;

        return 0;
    }
    auto divd=[&](Point lhs,Point rhs){
        return (lhs-rhs)*Point(0,1);
    };
    
    for(int i=0;i<cps.size();i++){
        auto pre=cps[(i+cps.size()-1)%cps.size()];
        auto nex=cps[(i+1)%cps.size()];
        auto t1=divd(pre,cps[i]);
        auto t2=divd(cps[i],nex);
        auto theta=arg(t2/t1);
        for(int j=0;j<n;j++){
            if(cps[i]==ps[j]){
                res[j]=theta/(2*pi);
            }
        }    
    }
    for(int i=0;i<n;i++){
        cout<<res[i]<<endl;
    }
    
    return 0;
}


Compiler output:
a.cc:28:10: fatal error: geometry.hpp: No such file or directory
   28 | #include "geometry.hpp"
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <stack>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <climits>
#include <set>
#include <cmath>
#include <numeric>
#include <iomanip>
 
using namespace std;
typedef long double ld;
 typedef double ld;
pair <long long, long long> xy[100];
long long x[100];
long long y[100];
vector <pair <long long, long long> > c_hull;
 
template <typename T,typename U>                                                   
std::pair<T,U> operator+(const std::pair<T,U> & l,const std::pair<T,U> & r) {   
    return {l.first+r.first,l.second+r.second};                                    
}
template <typename T,typename U>                                                   
std::pair<T,U> operator-(const std::pair<T,U> & l,const std::pair<T,U> & r) {   
    return {l.first-r.first,l.second-r.second};                                    
}
 
 
long long cross(pair <long long, long long> xy1, pair <long long, long long> xy2){
    return xy1.first * xy2.second - xy1.second * xy2.first;
}
 
long long dot(pair <long long, long long> xy1, pair <long long, long long> xy2){
    return xy1.first * xy2.first + xy1.second * xy2.second;
}
 
double norm(pair <long long, long long> xy){
    return sqrt((double)(xy.first * xy.first) + (double) (xy.second * xy.second));
}
 
void convex_hull(int N){
    sort(xy, xy + N);
 
    int k = 0;
    c_hull.resize(2 * N);
    for(int i = 0; i < N; i++){
        while(k > 1 && cross(c_hull[k - 1] - c_hull[k - 2], xy[i] - c_hull[k - 1]) <= 0){
            k--;
        }
        c_hull[k] = xy[i];
        k++;
    }
    int lower_half = k;
    for(int i = N - 2; i >= 0; i--){
        while(k > lower_half && cross(c_hull[k - 1] - c_hull[k - 2], xy[i] - c_hull[k - 1]) <= 0){
            k--;
        }
        c_hull[k] = xy[i];
        k++;
    }
    c_hull.resize(k - 1);
}
 
int main(){
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> xy[i].first >> xy[i].second;
        x[i] = xy[i].first;
        y[i] = xy[i].second;
    }
 
    convex_hull(N);
 
    map <pair <long long, long long>, double> ans;
    for(int i = 1; i < c_hull.size() + 1; i++){
        double cos_value = (double) dot(c_hull[i % c_hull.size()] - c_hull[i - 1], c_hull[(i + 1) % c_hull.size()] - c_hull[i % c_hull.size()]) 
            / norm(c_hull[i % c_hull.size()] - c_hull[i - 1]) / norm(c_hull[(i + 1) % c_hull.size()] - c_hull[i % c_hull.size()]);
        double prob = acos(cos_value) / (2 * M_PI);
        ans[c_hull[i % c_hull.size()]] = prob; 
    }
 
 
    for(int i = 0; i < N; i++){
        if(ans.find(make_pair(x[i], y[i])) == ans.end()){
            cout << fixed << setprecision(10) << 0.0 << endl;
        } else {
            cout << fixed << setprecision(10) << ans[make_pair(x[i], y[i])] << endl;
        }
    }
    
 
    return 0;
}

Compiler output:
a.cc:18:17: error: conflicting declaration 'typedef double ld'
   18 |  typedef double ld;
      |                 ^~
a.cc:17:21: note: previous declaration as 'typedef long double ld'
   17 | typedef long double ld;
      |                     ^~
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
 
const double EPS = 1e-8, PI = acos(-1);
const int MAXN = 105;
 
struct point {
	double x, y;
	int id;
	
	point() {}
	point(double _x, double _y, int _id = -1) : x(_x), y(_y), id(_id) {}
	bool operator<(const point &another) const;
};
 
struct ans {
	double val;
	int id;
 
	ans() {}
	bool operator<(const ans &another) const
	{
		return id < another.id;
	}
};
 
int tot, n;
point p[MAXN], s[MAXN], normal[MAXN];
ans an[MAXN];
bool visited[MAXN];
 
int sgn(double x)
{
	if (fabs(x) < EPS) return 0;
	return (x > 0 ? 1 : -1);
}
 
double det(const point &a1, const point &a2, const point &b1, const point &b2)
{
	return ((a2.x - a1.x) * (b2.y - b1.y) - (a2.y - a1.y) * (b2.x - b1.x));
}
 
double dot(const point &a1, const point &a2, const point &b1, const point &b2)
{
	return ((a2.x - a1.x) * (b2.x - b1.x) + (a2.y - a1.y) * (b2.y - b1.y));
}
 
double dist(const point &p1, const point &p2)
{
	return sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y));
}
 
bool point::operator<(const point &another) const
{
	if (sgn(det(p[0], *this, p[0], another)) == 0)
		return dist(p[0], *this) < dist(p[0], another);
	else
		return det(p[0], *this, p[0], another) > 0;
}
 
void graham()
{
	double min_y = p[0].y, min_x = p[0].x;
	int index = 0;
	for (int i = 1; i <= n - 1; i++) {
		if (p[i].y < min_y || (sgn(p[i].y - min_y) == 0 && p[i].x < min_x)) {
			min_y = p[i].y;
			min_x = p[i].x;
			index = i;
		}
	}
	swap(p[0], p[index]);
	sort(p + 1, p + n);
	s[0] = p[0]; s[1] = p[1];
	tot = 2;
	for (int i = 2; i <= n - 1; i++) {
		while (tot >= 2 && sgn(det(s[tot - 1], p[i], s[tot - 1], s[tot - 2]) < 0)) tot--;
		s[tot++] = p[i];
	}
}
 
int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lf %lf", &p[i].x, &p[i].y);
		p[i].id = i;
	}
	graham();
	for (int i = 0; i < tot; i++) {
		if (i == 0) {
			normal[i].y = -(s[i].x - s[tot - 1].x);
			normal[i].x = s[i].y - s[tot - 1].y;
			normal[i].id = s[i].id;
		}
		else {
			normal[i].y = -(s[i].x - s[i - 1].x);
			normal[i].x = s[i].y - s[i - 1].y;
			normal[i].id = s[i].id;
		}
	}
	point zero(0, 0);
	for (int i = 0; i < tot; i++) {
		if (i == tot - 1) {
			an[i].val = acos(dot(zero, normal[i], zero, normal[0]) / dist(zero, normal[i]) / dist(zero, normal[0])) / PI / 2;
			an[i].id = normal[i].id;
		}
		else {
			an[i].val = acos(dot(zero, normal[i], zero, normal[i + 1]) / dist(zero, normal[i]) / dist(zero, normal[i + 1])) / PI / 2;
			an[i].id = normal[i].id;
		}
	}
	memset(visited, false, sizeof(visited));
	for (int i = 0; i < tot; i++) visited[s[i].id] = true;
	for (int i = 0; i < n; i++)
		if (!visited[i]) {
			an[tot].val = 0.0000000;
			an[tot++].id = i;
		}
	sort(an, an + n);
	for (int i = 0; i < n; i++) printf("%.8f\n", an[i].val);
	return 0;
}

--------------------- 
作者：Shili_Xu 
来源：CSDN 
原文：https://blog.csdn.net/Shili_Xu/article/details/79691858 
版权声明：本文为博主原创文章，转载请附上博文链接！

Compiler output:
a.cc:128:1: error: expected unqualified-id before '--' token
  128 | ---------------------
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<double> x(n), y(n);
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
    }
    for (int i = 0; i < n; i++) {
        vector<double> mon;
        for (int j = 0; j < n; j++) {
            if (i != j) {
                mon.push_back(atan2(y[j] - y[i], x[j] - x[i]));
            }
        }
        sort(mon.begin(), mon.end());
        double mx = 0;
        for (int j = 0; j < n-2; j++) {
            mx = max(mx, mon[j+1] - mon[j]);
        }
        mx = max(mx, ang[0] + 2 * acos(-1.0) - mon[n-2]);
        double ans = (mx > acos(-1.0) ? (mx - acos(-1.0)) / (2 * acos(-1.0)) : 0.0);
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:22: error: 'ang' was not declared in this scope
   22 |         mx = max(mx, ang[0] + 2 * acos(-1.0) - mon[n-2]);
      |                      ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 100000000000000000ll
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
double add(double a,double b){
	if(abs(a+b)<eps*(abs(a)+abs(b)))return 0;
	return a+b;
}
struct P{
	double x,y;
	int id;
	P() {}
	P(double x,double y):x(x),y(y){}
	P operator +(P p){
		return P(add(x,p.x),add(y,p.y));
	}
	P operator -(P p){
		return P(add(x,-p.x),add(y,-p.y));
	}
	P operator *(double d){
		return P(d*x,d*y);
	}
	double dot(P p){
		return add(x*p.x,y*p.y);
	}
	double det(P p){
		return add(x*p.y,-y*p.x);
	}
	double norm(){
		return sqrt(sq(x)+sq(y));
	}
	bool operator < (const P& p) const{
		if(x!=p.x)return x<p.x;
		else return y<p.y;
	}
};
vector<P> convex_hull(P* ps,int n)
{
	sort(ps,ps+n);
	int k=0;
	vector<P> qs(2*n);
	for(int i=0;i<n;i++)
	{
		while(k>1&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)k--;
		qs[k++]=ps[i];
	}
	for(int i=n-2,t=k;i>=0;i--)
	{
		while(k>t&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)k--;
		qs[k++]=ps[i];
	}
	qs.resize(k-1);
	return qs;
}
P normal(P a){
	return P(a.y,-a.x);
}
double calc(P a,P b){
	return acos(a.dot(b)/a.norm()/b.norm())/2.0/M_PI;
}
int N;
P v[105];
double ans[105];
int main(){
	cin >> N;
	for(int i=0;i<N;i++){
		scanf("%lf %lf",&v[i].x,&v[i].y);
		v[i].id=i;
	}
	if(N==2){
		printf("0.5\n0.5\n");
		return 0;
	}
	vector<P> cv = convex_hull(v,N);
	int M = cv.size();
	for(int i=0;i<M;i++){
		int idx = cv[i].id;
		if(M==2)ans[idx]=0.5;
		else ans[idx] = calc(normal(cv[i]-cv[(i+M-1)%M]),normal(cv[(i+1)%M]-cv[i]));
	}
	for(int i=0;i<N;i++)printf("%.16f\n",ans[i]);
	return 0;
}\

Compiler output:
a.cc:99:2: error: stray '\' in program
   99 | }\
      |  ^
Language: C++

#include <bits/stdc++.h>
typedef long long i64;
using std::cout;
using std::endl;
using std::cin;

struct Point {
	i64 x, y;
	
	Point operator-(const Point r) const {
		return Point{x - r.x, y - r.y};
	}
	
	bool operator<(const Point r) const {
		if(x == r.x) return y < r.y;
		return x < r.x;
	}
};

double abs(const Point a) {
	return std::sqrt(a.x * a.x + a.y * a.y);
}

double cross(const Point a, const Point b) {
	return a.x * b.y - a.y * b.x;
}

double dot(const Point a, const Point b) {
	return a.x * b.x + a.y * b.y;
}

double angle(const Point a, const Point b) {
	return acos(-dot(a, b) / abs(a) / abs(b));
}

std::vector<Point> Convex_Hull(std::vector<Point> p){
  int n = p.size(), k = 0;
  if(n >= 3){
    sort(p.begin(), p.end());
    std::vector< Point > ch(2 * n);
    for(int i = 0; i < n; ch[k++] = p[i++]){
      while(k >= 2 && cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0) --k;
    }
    for(int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--]){
      while(k >= t && cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0) --k;
    }
    ch.resize(k - 1);
    return ch;
  } else {
    return p;
  }
}

/*
std::vector<Point> convexFull(std::vector<Point> p) {
	int n = p.size(), k = 0;
	if(2 < n) {
		sort(begin(p), end(p));
		std::vector<Point> ch(2 * n);
		for(int i = 0; i < n; ch[k++] = p[i++]) {
			while(k > 1 and cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1]) < 0) --k;
		}
		for(int i = n - 2, t = k + 1; i >= 0; ch[k++] = p[i--]) {
			if(k >= t and cross(ch[k - 1] - ch[k - 2], p[i] - ch[k - 1])  < 0) --k;
		}
		ch.resize(k - 1);
		return ch;
	} else {
		return p;
	}
}
*/

int main() {
	int n; cin >> n;
	std::vector<Point> vec(n);
	std::map<Point, int> mp;
	for(int i = 0; i < n; i++) {
		i64 a, b; cin >> a >> b;
		
		vec[i] = Point{a, b};
		mp[vec[i]] = i;
	}
	
	auto ch = convexFull(vec);
	std::vector<double> ans(n, 0);
	const double Pi = std::acos(-1);
	for(int i = 0; i < ch.size(); i++) {
		Point u = ch[(i + ch.size() - 1) % ch.size()] - ch[i];
		Point v = ch[(i + 1) % ch.size()] - ch[i];
		ans[mp[ch[i]]] = angle(u, v) / 2.0 / Pi;
	}
	
	for(auto v : ans) cout << std::fixed << std::setprecision(10) << v << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:85:19: error: 'convexFull' was not declared in this scope; did you mean 'Convex_Hull'?
   85 |         auto ch = convexFull(vec);
      |                   ^~~~~~~~~~
      |                   Convex_Hull
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

const int mnx = 3e5 + 9;
const int mod = 1e9 + 7;


int main(){

int n;
cin >> n;
double x[n + 5], y[n + 5];

double M_PI = acos(-1);

for(int i = 0; i < n; i++){
    cin >> x[i] >> y[i];
}

for(int i = 0; i < n; i++) {
vector<double> angle;
for(int j = 0; j < n; j++){
    if(j != i){
        angle.push_back(atan2(x[j] - x[i], y[j] - y[i]));
    }
}

sort(angle.begin(), angle.end());

angle.push_back(angle[0] + 2 * M_PI);

double res = 0;

for(int j = 0; j < n; j++) {
    if(angle[j + 1] - angle[j] > M_PI) res = angle[j + 1] - angle[j] - M_PI;
}

cout << fixed;
cout.precision(6);
cout << res / (2 * M_PI) << endl;

}



return 0;

}



Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114,
                 from a.cc:1:
a.cc: In function 'int main()':
a.cc:16:8: error: expected unqualified-id before numeric constant
   16 | double M_PI = acos(-1);
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

const int mnx = 3e5 + 9;
const int mod = 1e9 + 7;

ll n;
ll x[mnx], y[mnx];
double M_PI = acos(-1);

int main(){

int n;
cin >> n;
double x[n], y[n];

for(int i = 0; i < n; i++){
    cin >> x[i] >> y[i];
}

for(int i = 0; i < n; i++) {
vector<double> angle;
for(int j = 0; j < n; j++){
    if(j != i){
        angle.push_back(atan2(x[j] - x[i], y[j] - y[i]));
    }
}

sort(angle.begin(), angle.end());

angle.push_back(angle[0] + 2 * M_PI);

double res = 0;

for(int j = 0; j < n; j++) {
    if(angle[j + 1] - angle[j] > M_PI) res = angle[j + 1] - angle[j] - M_PI;
}

cout << fixed;
cout.precision(6);
cout << res / (2 * M_PI) << endl;

}



return 0;

}



Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114,
                 from a.cc:1:
a.cc:11:8: error: expected unqualified-id before numeric constant
   11 | double M_PI = acos(-1);
      |        ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <iterator>
using namespace std;
typedef unsigned long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=1005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
const ll p=880301;
const ll P=31;


double x[maxn],y[maxn];
vector<double> v;
int main(){
    IOS;
    int n;
    cin>>n;
    REP(i,n) cin>>x[i]>>y[i];
    cout << fixed << showpoint;
    cout << setprecision(12);
    REP(i,n){
        v.clear();
        REP(j,n) if(i!=j){
            double theta;
            double dx=x[j]-x[i],dy=y[j]-y[i];
	    if(dx==0) theta=PI/2;
            else theta=atan(dy/dx);
            if(dx<0) theta=PI+theta;
            
            v.pb(theta);
        }
        sort(ALL(v));
	//for(auto C:v) cout<<C<<' ';
        double mx=v[0]-v.back()+2*PI;
        REP(i,SZ(v)-1) mx=max(mx,v[i+1]-v[i]);
        cout<<max(0.0,(mx-PI)/(PI+PI))<<'\n';        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:13: error: 'setprecision' was not declared in this scope
   58 |     cout << setprecision(12);
      |             ^~~~~~~~~~~~
a.cc:9:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    8 | #include <iterator>
  +++ |+#include <iomanip>
    9 | using namespace std;
Language: C++

#include <iostream>
#include <cmath>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <iterator>
using namespace std;
typedef unsigned long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=1005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=2000000000;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
const ll p=880301;
const ll P=31;


double x[maxn],y[maxn];
vector<double> v;
int main(){
    IOS;
    int n;
    cin>>n;
    REP(i,n) cin>>x[i]>>y[i];
    cout<<fixed<<setprecision(12);
    REP(i,n){
        v.clear();
        REP(j,n) if(i!=j){
            double theta;
            double dx=x[j]-x[i],dy=y[j]-y[i];
	    if(dx==0) theta=PI/2;
            else theta=atan(dy/dx);
            if(dx<0) theta=PI+theta;
            
            v.pb(theta);
        }
        sort(ALL(v));
	//for(auto C:v) cout<<C<<' ';
        double mx=v[0]-v.back()+2*PI;
        REP(i,SZ(v)-1) mx=max(mx,v[i+1]-v[i]);
        cout<<max(0.0,(mx-PI)/(PI+PI))<<'\n';        
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:18: error: 'setprecision' was not declared in this scope
   57 |     cout<<fixed<<setprecision(12);
      |                  ^~~~~~~~~~~~
a.cc:9:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    8 | #include <iterator>
  +++ |+#include <iomanip>
    9 | using namespace std;
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;

const int MAX_N = 100 + 10;
const double pi = acos(-1.0);
const double eps = 1e-8;

int dcmp(double x) {
    if (fabs(x) < eps) return 0;
    else return x < 0 ? -1 : 1;
}

struct Point {
    int id;
    double x, y;
    Point(double x=0, double y=0):x(x), y(y) {}
    Point(int id, double x=0, double y=0):id(id), x(x), y(y) {}
    bool operator < (const Point& rhs) const {
        if (dcmp(x - rhs.x) == 0) return y < rhs.y;
        return x < rhs.x;
    }
} ps[MAX_N], ch[MAX_N];

typedef Point Vector;
typedef pair<int, int> pii;

Vector operator - (Point A, Point B) {
    return Vector(A.x - B.x, A.y - B.y);
}

double Cross(Vector A, Vector B) {
    return A.x * B.y - A.y * B.x;
}

double Dot(Vector A, Vector B) {
    return A.x * B.x + A.y * B.y;
}

double Length(Vector A) {
    return sqrt(Dot(A, A));
}

double Angle(Vector A, Vector B) {
    return acos(Dot(A, B) / Length(A) / Length(B));
}

int ConvexHull(Point* p, int n, Point* ch) {
    sort(p, p + n);
    int m = 0;
    for (int i = 0; i < n; i++) {
        while (m > 1 && dcmp(Cross(ch[m - 1] - ch[m - 2], p[i] - ch[m - 2])) <= 0) m--;
        ch[m++] = p[i];
    }
    int k = m;
    for (int i = n - 2; i >= 0; i--) {
        while (m > k && dcmp(Cross(ch[m - 1] - ch[m - 2], p[i] - ch[m - 2])) <= 0) m--;
        ch[m++] = p[i];
    }
    if (n > 1) m--;
    return m;
}

set<pii> st;
double ans[MAX_N];

int main() {
    int N, n = 0, x, y;
    scanf("%d", &N);
    for (int i = 0; i < N; i++) {
        scanf("%d%d", &x, &y);
        ans[i] = 0.0;
        if (st.find(pii(x, y)) == st.end()) {
            ps[n++] = Point(i, x, y);
            st.insert(pii(x, y));
        }
    }
    if (n == 1) {
        ans[ps[0].id] = 1;
    }
    else if (n == 2) {
        printf("fuck\n", ans[i]);
        ans[ps[0].id] = ans[ps[1].id] = 1;
    } else {
        int m = ConvexHull(ps, n, ch);
        for (int i = 0; i < m; i++) {
            int j = (i - 1 + m) % m;
            int k = (i + 1) % m;
            Vector v1 = ch[j] - ch[i];
            Vector v2 = ch[k] - ch[i];
            ans[ch[i].id] = pi - Angle(v1, v2);
        }
    }
    double sum = 0.0;
    for (int i = 0; i < N; i++) sum += ans[i];
    for (int i = 0; i < N; i++) ans[i] /= sum;
    for (int i = 0; i < N; i++) {
        printf("%.30f\n", ans[i]);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:85:30: error: 'i' was not declared in this scope
   85 |         printf("fuck\n", ans[i]);
      |                              ^
Language: C++

#include <cstdio>
#include <algorithm>

#define pii pair <int, int>
#define f first
#define s second
#define pi 3.14159265358979

using namespace std;

pii v[128];
double a[128];

int main ()
{
   // freopen ("file.in", "r", stdin);

    int n;
    scanf ("%d", &n);

    for (int i = 1; i <= n; ++i)
        scanf ("%d %d", &v[i].f, &v[i].s);

    for (int i = 1; i <= n; ++i)
    {
        int k = 0;
        for (int j = 1; j <= n; ++j)
            if (i != j)
                a[++k] = atan2 (v[j].s - v[i].s, v[j].f - v[i].f);

        sort (a + 1, a + k + 1);

        double prop = 0.0;
        for (int i = 1; i < k; ++i)
            prop = max (prop, a[i + 1] - a[i] - pi);

        double fi = 2.0 * pi + a[1];

        prop = max (prop, fi - a[k] - pi);
        prop /= 2.0 * pi;

        printf ("%.8f\n", prop);
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:26: error: 'atan2' was not declared in this scope
   29 |                 a[++k] = atan2 (v[j].s - v[i].s, v[j].f - v[i].f);
      |                          ^~~~~