Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
#define PI 3.141592653589793238462643L
int K[100000];
long double SIN(long double b) { return sinl(b * PI / 180.0L); }
int main() {
	int N, cnt = 0; long double a, sum, V; vector<long double, int>vec;
	while (true) {
		cin >> N; V = 0.0L; sum = 0.0L; if (N == 0) { break; }
		for (int i = 0; i < N; i++) { cin >> a; sum += SIN(a); V += a; }
		sum += sin(360.0L - V); vec.push_back(make_pair(sum, cnt)); cnt++;
	}
	sort(vec.begin(), vec.end());
	for (int i = 0; i < cnt; i++) { K[vec[i].second] = i; }
	for (int i = 0; i < cnt; i++) { cout << K[i] << endl; }
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<long double, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<long double, int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:10:65:   required from here
   10 |         int N, cnt = 0; long double a, sum, V; vector<long double, int>vec;
      |                                                                        ^~~
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'int' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'int' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<long double, int>':
a.cc:10:65:   required from here
   10 |         int N, cnt = 0; long double a, sum, V; vector<long double, int>vec;
      |                                                                        ^~~
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<long double, int>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<long double, int>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<long double, int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = long double; _Alloc = int]':
a.cc:10:65:   required from here
   10 |         int N, cnt = 0; long double a, sum, V; vector<long double, int>vec;
      |                                                                        ^~~
/usr/include/c++/14/bits/stl_vector.h:136:24: error: 'int' is not a class, struct, or union type
  136 |         _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
      |                        ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:14:54: error: no matching function for call to 'std::vector<long double, int>::push_back(std::pair<long double, int>)'
   14 |                 sum += sin(360.0L - V); vec.push_back(make_pair(sum, cnt)); cnt++;
      |                                         ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long double; _Alloc = int; value_type = long double]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::pair<long double, int>' to 'const std::vector<long double, int>::value_type&' {aka 'const long double&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long double; _Alloc = int; value_type = long double]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::pair<long double, int>' to 'std::vector<long double, int>::value_type&&' {aka 'long double&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:16:18: error: 'class std::vector<long double, int>' has no member named 'begin'
   16 |         sort(vec.begin(), vec.end());
      |                  ^~~~~
a.cc:16:31: error: 'class std::vector<long double, int>' has no member named 'end'
   16 |         sort(vec.begin(), vec.end());
      |                               ^~~
a.cc:17:46: error: no match for 'operator[]' (operand types are 'std::vector<long double, int>' and 'int')
   17 |         for (int i = 0; i < cnt; i++) { K[vec[i].second] = i; }
      |                                              ^
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = long double; _Alloc = int]':
/usr/include/c++/14/bits/stl_vector.h:314:7:   required from here
  314 |       _Vector_base() = default;
      |       ^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:141:26: error: 'int' is not a class, struct, or union type
  141 |         : _Tp_alloc_type()
      |                          ^