Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <time.h>
#include <cstdio>
using namespace std;
clock_t start, end;


vector<int> v;
int dn[100]={};
int dfs(int x,int r){
	end=clock();
	if( (double)(end - start) > 0.1 * CLOCKS_PER_SEC ){
		return 0;
	}
	if( !dn[x] ) return 0;
	if( r < 0 ) return 0;
	if( r == 0 ){
		return dfs(x+1,v[x+1]);
	}
	if( x == v.size()-1 ) return r != 0;
	if( r == v[x] ){
		if( dfs(x+1,v[x+1]) ) return 1;
	}
	
	long long can[2] = {} , tmp[2] = {};
	can[0] |= 1;
	
	// branch-cutting
	for(int i = x + 1 ; i < v.size() ; i++){
		if( !dn[i] ){
			if( v[x] < 64 ){
				tmp[0] = can[0] << v[x];
				tmp[1] = (can[0] >> (64-v[x])) | (can[1] << v[x]);
			}else{
				tmp[0] = 0;
				tmp[1] = can[0] << (v[x]-64);
			}
			can[0] |= tmp[0];
			can[1] |= tmp[1];
		}
	}
	if( !(can[v[x]/64]>>(v[x]%64)&1) ){
		return 0;	
	}
	
	
	for(int i = x + 1 ; i < v.size() ; i++){
		if( dn[i] == 0 ){
			dn[i] = 1;
			if( dfs(x,r-v[i]) ) return 1;
			dn[i] = 0;
		}
	}
	return 0;
	
}
int main(){
	int n;
	while(cin >> n && n){
		v.resize(n);
		for(int i = 0 ; i < n ; i++) dn[i] = 0;
		//for(int i = 0 ; i < n ; i++) v[i] = rand() % 100 + 1;
		
		for(int i = 0 ; i < n ; i++) cin >> v[i];
		
		sort(v.rbegin(),v.rend());
	
		dn[0] = 1;
		start=clock();
		cout << (dfs(0,v[0])?"YES":"NO") << endl;
		dn[1] = 0;
	}
}

Compiler output:
a.cc: In function 'int dfs(int, int)':
a.cc:13:9: error: reference to 'end' is ambiguous
   13 |         end=clock();
      |         ^~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:                 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
In file included from /usr/include/c++/14/bits/range_access.h:36:
/usr/include/c++/14/initializer_list:99:5: note:                 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
a.cc:7:16: note:                 'clock_t end'
    7 | clock_t start, end;
      |                ^~~
a.cc:14:22: error: reference to 'end' is ambiguous
   14 |         if( (double)(end - start) > 0.1 * CLOCKS_PER_SEC ){
      |                      ^~~
/usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:                 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:                 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
a.cc:7:16: note:                 'clock_t end'
    7 | clock_t start, end;
      |                ^~~