답안 #3590

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
3590 2013-08-31T06:45:55 Z sjw0687 King of penalty (kriii1_K) C++
컴파일 오류
0 ms 0 KB
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
using namespace std;

typedef long long llong;

int p, n;
int time[100001];
llong sumT[100001];
int numSolve;

int main(void)
{
	cin >> p >> n;
	for(int i=1; i<=n; i++) {
		cin >> time[i];
	}
	sort(time+1, time+(n+1));
	for(int i=1; i<=n; i++) {
		sumT[i] = sumT[i-1] + time[i];
		if( sumT[i] < p )
			numSolve = i;
	}

	llong timeAnswer = 0;
	for(int i=1; i <= n - numSolve + 1; i++) {
		int first = i;
		int last = i+numSolve-1;
		llong totalT = sumT[last] - sumT[first-1];
		llong preT = p - totalT - 1;

		if( totalT >= p ) break;
		llong t = 0;
		t += preT * numSolve;
		for(int j=last; j>=first; j--) {
			int cnt = j - first + 1;
			t += cnt * time[j];
		}
		if( t > timeAnswer )
			timeAnswer = t;
	}
	
	cout << numSolve << ' ' << timeAnswer << endl;

	return 0;
}

Compilation message

K.cpp:23:16: error: 'int time [100001]' redeclared as different kind of symbol
/usr/include/time.h:186:15: error: previous declaration of 'time_t time(time_t*)'
K.cpp: In function 'int main()':
K.cpp:31:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
K.cpp:31:16: error: ambiguous overload for 'operator>>' in 'std::cin >> *(time + ((long unsigned int)((long unsigned int)i)))'
K.cpp:31:16: note: candidates are:
/usr/include/c++/4.6/istream:122:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__istream_type& (*)(std::basic_istream<_CharT, _Traits>::__istream_type&)) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>] <near match>
/usr/include/c++/4.6/istream:122:7: note:   no known conversion for argument 1 from 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&) {aka std::basic_istream<char>& (*)(std::basic_istream<char>&)}'
/usr/include/c++/4.6/istream:126:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__ios_type& (*)(std::basic_istream<_CharT, _Traits>::__ios_type&)) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>, std::basic_istream<_CharT, _Traits>::__ios_type = std::basic_ios<char>] <near match>
/usr/include/c++/4.6/istream:126:7: note:   no known conversion for argument 1 from 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}'
/usr/include/c++/4.6/istream:133:7: note: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>] <near match>
/usr/include/c++/4.6/istream:133:7: note:   no known conversion for argument 1 from 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' to 'std::ios_base& (*)(std::ios_base&)'
K.cpp:33:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
K.cpp:33:24: warning: pointer to a function used in arithmetic [-Wpointer-arith]
K.cpp:33:24: warning: pointer to a function used in arithmetic [-Wpointer-arith]
K.cpp:35:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
K.cpp:35:31: warning: pointer to a function used in arithmetic [-Wpointer-arith]
K.cpp:35:31: error: invalid conversion from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'llong {aka long long int}' [-fpermissive]
K.cpp:52:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
K.cpp:52:21: error: invalid operands of types 'int' and 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' to binary 'operator*'
In file included from /usr/include/c++/4.6/algorithm:63:0,
                 from K.cpp:7:
/usr/include/c++/4.6/bits/stl_algo.h: In function 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]':
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:5407:4: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h: In function 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Size = long int]':
/usr/include/c++/4.6/bits/stl_algo.h:5407:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:2275:7: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h: In function 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:5409:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:2179:7: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h: In function '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:2284:54:   instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Size = long int]'
/usr/include/c++/4.6/bits/stl_algo.h:5407:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:2251:68: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h: In function 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:2181:4:   instantiated from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:5409:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:2105:50: error: ISO C++ forbids incrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h:2110:3: error: variable '__val' has function type
/usr/include/c++/4.6/bits/stl_algo.h:2181:4:   instantiated from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:5409:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:2110:3: error: variable '__val' has function type
/usr/include/c++/4.6/bits/stl_algo.h: In function 'void std::__unguarded_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:2182:4:   instantiated from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:5409:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:2150:40: error: ISO C++ forbids incrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h: In function 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:5254:7:   instantiated from 'void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2279:8:   instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Size = long int]'
/usr/include/c++/4.6/bits/stl_algo.h:5407:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:1904:40: error: ISO C++ forbids incrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
In file included from /usr/include/c++/4.6/bits/stl_algo.h:63:0,
                 from /usr/include/c++/4.6/algorithm:63,
                 from K.cpp:7:
/usr/include/c++/4.6/bits/stl_heap.h: In function 'void std::sort_heap(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:5255:7:   instantiated from 'void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2279:8:   instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Size = long int]'
/usr/include/c++/4.6/bits/stl_algo.h:5407:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_heap.h:464:7: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_heap.h:466:4: error: ISO C++ forbids decrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
In file included from /usr/include/c++/4.6/algorithm:63:0,
                 from K.cpp:7:
/usr/include/c++/4.6/bits/stl_algo.h: In function '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Tp = long int(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:2253:70:   instantiated from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2284:54:   instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Size = long int]'
/usr/include/c++/4.6/bits/stl_algo.h:5407:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:2213:6: error: ISO C++ forbids incrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h:2214:4: error: ISO C++ forbids decrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h:2216:6: error: ISO C++ forbids decrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h:2220:4: error: ISO C++ forbids incrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h: In function 'void std::__unguarded_linear_insert(_RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:2115:6:   instantiated from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2181:4:   instantiated from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:5409:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algo.h:2065:2: error: variable '__val' has function type
/usr/include/c++/4.6/bits/stl_algo.h:2067:7: error: ISO C++ forbids decrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h:2065:2: error: variable '__val' has function type
/usr/include/c++/4.6/bits/stl_algo.h:2070:4: error: assignment of read-only location '* __last'
/usr/include/c++/4.6/bits/stl_algo.h:2070:4: error: cannot convert 'long int(long int*)throw ()' to 'long int(long int*)throw ()' in assignment
/usr/include/c++/4.6/bits/stl_algo.h:2072:4: error: ISO C++ forbids decrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algo.h:2065:2: error: variable '__val' has function type
In file included from /usr/include/c++/4.6/bits/stl_algo.h:63:0,
                 from /usr/include/c++/4.6/algorithm:63,
                 from K.cpp:7:
/usr/include/c++/4.6/bits/stl_heap.h: In function 'void std::make_heap(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:1903:7:   instantiated from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:5254:7:   instantiated from 'void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2279:8:   instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Size = long int]'
/usr/include/c++/4.6/bits/stl_algo.h:5407:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_heap.h:388:7: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_heap.h:391:44: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_heap.h:395:15: error: variable '__value' has function type
/usr/include/c++/4.6/bits/stl_heap.h:395:15: error: variable '__value' has function type
/usr/include/c++/4.6/bits/stl_heap.h: In function 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algo.h:1906:4:   instantiated from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:5254:7:   instantiated from 'void std::partial_sort(_RAIter, _RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2279:8:   instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Size = long int]'
/usr/include/c++/4.6/bits/stl_algo.h:5407:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_heap.h:260:18: error: variable '__value' has function type
/usr/include/c++/4.6/bits/stl_heap.h:261:7: error: assignment of read-only location '* __result'
/usr/include/c++/4.6/bits/stl_heap.h:261:7: error: cannot convert 'long int(long int*)throw ()' to 'long int(long int*)throw ()' in assignment
/usr/include/c++/4.6/bits/stl_heap.h:262:7: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_heap.h:260:18: error: variable '__value' has function type
In file included from /usr/include/c++/4.6/bits/stl_pair.h:60:0,
                 from /usr/include/c++/4.6/bits/stl_algobase.h:65,
                 from /usr/include/c++/4.6/bits/char_traits.h:41,
                 from /usr/include/c++/4.6/ios:41,
                 from /usr/include/c++/4.6/ostream:40,
                 from /usr/include/c++/4.6/iostream:40,
                 from K.cpp:2:
/usr/include/c++/4.6/bits/move.h: In function 'void std::swap(_Tp&, _Tp&) [with _Tp = long int(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algobase.h:102:11:   instantiated from 'static void std::__iter_swap<true>::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = long int (*)(long int*)throw (), _ForwardIterator2 = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algobase.h:139:7:   instantiated from 'void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = long int (*)(long int*)throw (), _ForwardIterator2 = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:89:6:   instantiated from 'void std::__move_median_first(_Iterator, _Iterator, _Iterator) [with _Iterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2252:7:   instantiated from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2284:54:   instantiated from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = long int (*)(long int*)throw (), _Size = long int]'
/usr/include/c++/4.6/bits/stl_algo.h:5407:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/move.h:127:11: error: variable '__tmp' has function type
/usr/include/c++/4.6/bits/move.h:128:7: error: assignment of read-only reference '__a'
/usr/include/c++/4.6/bits/move.h:128:7: error: cannot convert 'long int(long int*)throw ()' to 'long int(long int*)throw ()' in assignment
/usr/include/c++/4.6/bits/move.h:127:11: error: variable '__tmp' has function type
In file included from /usr/include/c++/4.6/bits/char_traits.h:41:0,
                 from /usr/include/c++/4.6/ios:41,
                 from /usr/include/c++/4.6/ostream:40,
                 from /usr/include/c++/4.6/iostream:40,
                 from K.cpp:2:
/usr/include/c++/4.6/bits/stl_algobase.h: In static member function 'static _BI2 std::__copy_move_backward<false, false, std::random_access_iterator_tag>::__copy_move_b(_BI1, _BI1, _BI2) [with _BI1 = long int (*)(long int*)throw (), _BI2 = long int (*)(long int*)throw ()]':
/usr/include/c++/4.6/bits/stl_algobase.h:581:18:   instantiated from '_BI2 std::__copy_move_backward_a(_BI1, _BI1, _BI2) [with bool _IsMove = false, _BI1 = long int (*)(long int*)throw (), _BI2 = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algobase.h:590:34:   instantiated from '_BI2 std::__copy_move_backward_a2(_BI1, _BI1, _BI2) [with bool _IsMove = false, _BI1 = long int (*)(long int*)throw (), _BI2 = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algobase.h:625:18:   instantiated from '_BI2 std::copy_backward(_BI1, _BI1, _BI2) [with _BI1 = long int (*)(long int*)throw (), _BI2 = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2111:8:   instantiated from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:2181:4:   instantiated from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = long int (*)(long int*)throw ()]'
/usr/include/c++/4.6/bits/stl_algo.h:5409:4:   instantiated from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*)throw ()]'
K.cpp:33:25:   instantiated from here
/usr/include/c++/4.6/bits/stl_algobase.h:530:31: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
/usr/include/c++/4.6/bits/stl_algobase.h:531:6: error: ISO C++ forbids decrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algobase.h:531:6: error: ISO C++ forbids decrementing a pointer of type 'long int (*)(long int*)throw ()' [-fpermissive]
/usr/include/c++/4.6/bits/stl_algobase.h:531:6: error: assignment of read-only location '* -- __result'
/usr/include/c++/4.6/bits/stl_algobase.h:531:6: error: cannot convert 'long int(long int*)throw ()' to 'long int(long int*)throw ()' in assignment