QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#493535#9142. Uniting Amoebasucup-team008#AC ✓35ms3972kbC++2313.7kb2024-07-27 10:13:032024-07-27 10:13:04

Judging History

你现在查看的是最新测评结果

  • [2024-07-27 10:13:04]
  • 评测
  • 测评结果:AC
  • 用时:35ms
  • 内存:3972kb
  • [2024-07-27 10:13:03]
  • 提交

answer

// {{{ y0105w49 template 24K21
// hi mom
#ifndef NULL
#ifdef __GNUC__
#ifndef __clang__
// #include <bits/stdc++.h>
#include <bits/extc++.h>
#include <tr2/dynamic_bitset>
#define EXTS
#else
#ifdef ARST
#include <bits/clang++.h>
#else
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
// #include <cuchar>
#endif
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
#if __cplusplus >= 201402L
#include <shared_mutex>
#endif
#if __cplusplus >= 201703L
#include <any>
#include <charconv>
// #include <execution>
#include <filesystem>
#include <optional>
// #include <memory_resource>
#include <string_view>
#include <variant>
#endif
#if __cplusplus >= 202002L
#include <barrier>
#include <bit>
#include <compare>
#include <concepts>
#if __cpp_impl_coroutine
# include <coroutine>
#endif
#include <latch>
#include <numbers>
#include <ranges>
#include <span>
// #include <stop_token>
#include <semaphore>
// #include <source_location>
// #include <syncstream>
#include <version>
#endif
#if __cplusplus > 202002L
// #include <expected>
// #include <spanstream>
#if __has_include(<stacktrace>)
# include <stacktrace>
#endif
#include <stdatomic.h>
#endif
#endif
#endif
#else
#error "unsupported"
#endif
#endif
using namespace std;
#ifdef ARST
#define JO 1
#define OJ 0
#else
#define JO 0
#define OJ 1
#endif
#define STR(x) #x
#define GCCDIAG(s) _Pragma(STR(GCC diagnostic s)) static_assert(true)
#define Wsave GCCDIAG(push)
#define Wpop GCCDIAG(pop)
#define Wsupp(w) GCCDIAG(ignored "-W" w)
#define Wpush(w) Wsave; Wsupp(w)
#define typeof __typeof__
namespace gbd_ns {
	template<typename C> struct is_iterable {
		template<class T> static long check(...);
		template<class T> static char check(int,typename T::const_iterator = C().end());
		enum {
			value = sizeof(check<C>(0)) == sizeof(char),
			neg_value = sizeof(check<C>(0)) != sizeof(char)
		};
	};
	template<class T> struct _gbd3C;
	template<class T> ostream &_gbd3(ostream &os,const T &x) { return _gbd3C<T>::call(os,x); }
	template<> ostream &_gbd3(ostream &os,const string &x) { return os<<'"'<<x<<'"'; }
	template<> ostream &_gbd3(ostream &os,char *const &x) { return os<<'"'<<x<<'"'; }
	template<class T> ostream &_gbd3_5(ostream &os,const T &x) { return _gbd3(os,x); }
	template<class A,class B> ostream &_gbd4(ostream &os,const pair<A,B> &p) {
		_gbd3(os<<'(',p.first);
		_gbd3(os<<',',p.second);
		return os<<')';
	}
	template<class T,size_t N> struct _gbd4_tupleC {
		static void call(ostream &os,const T &t) {
			_gbd4_tupleC<T,N-1>::call(os,t);
			os<<','<<get<N-1>(t);
		}
	};
	template<class T> struct _gbd4_tupleC<T,1> {
		static void call(ostream &os,const T &t) { os<<get<0>(t); }
	};
	template<typename... Types> ostream &_gbd4(ostream &os,const tuple<Types...> &t) {
		os<<'(';
		_gbd4_tupleC<tuple<Types...>,sizeof...(Types)>::call(os,t);
		return os<<')';
	}
	template<> ostream &_gbd4(ostream &os,const tuple<> &t) { (void)t; return os<<"()"; }
	template<class T> ostream &_gbd4(ostream &os,const T &x) {
		return os<<x;
	}
	template<class T> struct _gbd3C {
		template<class U=T> static ostream &call(ostream &os,enable_if_t<is_iterable<U>::value,const T> &V) {
			os<<"{";
			bool ff=0;
			for(const auto &E:V) _gbd3_5<decltype(E)>(ff?os<<",":os,E), ff=1;
			return os<<"}";
		}
		template<class U=T> static ostream &call(ostream &os,enable_if_t<is_iterable<U>::neg_value,const T> &x) {
			return _gbd4(os,x);
		}
	};
	template<class T,typename... Args> ostream &_gbd2(ostream &os,bool,vector<string>::iterator nm,const T &x,Args&&... args);
	ostream &_gbd2(ostream &os,bool,vector<string>::iterator) { return os; }
	template<typename... Args> ostream &_gbd2(ostream &os,bool fi,vector<string>::iterator nm,const char *x,Args&&... args) {
		return _gbd2(os<<(fi?"":"  ")<<x,0,nm+1,args...);
	}
	template<class T,typename... Args> ostream &_gbd2(ostream &os,bool fi,vector<string>::iterator nm,const T &x,Args&&... args) {
		return _gbd2(_gbd3<T>(os<<(fi?"":"  ")<<*nm<<"=",x),0,nm+1,args...);
	}
	vector<string> split(string s) {
		vector<string> Z;
		string z="";
		s+=',';
		int dep=0;
		for(char c:s) {
			if(c==',' && !dep) Z.push_back(z),z="";
			else z+=c;
			if(c=='(' || c=='{' || c=='[') ++dep;
			if(c==')' || c=='}' || c==']') --dep;
		}
		return Z;
	}
	template<typename... Args> ostream &_gbd1(ostream &os,const string &nm,Args&&... args) {
		return _gbd2(os,1,split(nm).begin(),args...);
	}
	template<typename... Args> string _gbd1(const string &nm,Args&&... args) {
		ostringstream oss;
		_gbd2(oss,1,split(nm).begin(),args...);
		return oss.str();
	}
}
bool DBG=1,EMACS=0;
#define dbg(...) (JO&&DBG?gbd_ns::_gbd1(cerr<<"\033[38;5;5m"<<__FILE__<<":"<<__LINE__<<(EMACS?":note: ":": "),#__VA_ARGS__,__VA_ARGS__)<<"\033[0m"<<endl:cerr)
#define dbgt(...) dbg(fmt_time(),__VA_ARGS__)
#define fmt(...) gbd_ns::_gbd1(#__VA_ARGS__,__VA_ARGS__)
template<class Fun> struct _y_combinator_result {
	Fun _fun;
	template<class T> explicit _y_combinator_result(T &&fun) : _fun(forward<T>(fun)) {}
	template<typename... Args> decltype(auto) operator()(Args&&... args) {
		return _fun(ref(*this),forward<Args>(args)...);
	}
};
template<class Fun> [[nodiscard]] decltype(auto) fix(Fun &&fun) {
	return _y_combinator_result<decay_t<Fun>>(forward<Fun>(fun));
}
#define nop void()
#define sz(x) (int((x).size()))
#define all(v) (v).begin(),(v).end()
#define forenum(i,...) for(int i:{-1}) for(__VA_ARGS__) if(++i,0) assert(0); else
#define forenumll(i,...) for(long long i:{-1}) for(__VA_ARGS__) if(++i,0) assert(0); else
#define forbs(k,i,bs) for(ptrdiff_t k=0,i=(bs)._Find_first();i<(ptrdiff_t)(bs).size();i=(bs)._Find_next(i),++k)
#define fordbs(k,i,bs) for(ptrdiff_t k=0,i=(bs).find_first();i<(ptrdiff_t)(bs).size();i=(bs).find_next(i),++k)
#define get(x,i) get<i>(x)
template<class T> T &smin(T &x,const T &y) { return y<x?x=y:x; }
template<class T> T &smax(T &x,const T &y) { return y>x?x=y:x; }
template<class T> bool inb(const T &x,const T &l,const T &r) { return l<=x&&x<=r; }
template<class T> bool cinb(const T &x,const T &l,const T &r) { return l<=r?l<=x&&x<=r:l<=x||x<=r; }
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
template<template<class> class C,class T> T popv(C<T> &v) { T z=v.back(); v.pop_back(); return z; }
template<template<class> class C,class T> T popq(C<T> &v) { T z=v.front(); v.pop(); return z; }
template<template<class> class C,class T> T pops(C<T> &v) { T z=*v.begin(); v.erase(v.begin()); return z; }
template<template<class,class> class C,class K,class V> pair<K,V> popm(C<K,V> &v) { pair<K,V> z=*v.begin(); v.erase(v.begin()); return z; }
template<template<class> class C,class T> void erase1(C<T> &v,const T &x) { v.erase(v.find(x)); }
template<template<class> class C,class T> int lbi(C<T> &v,const T &x) { return int(lower_bound(all(v),x)-v.begin()); }
template<template<class> class C,class T> int findi(C<T> &v,const T &x) { auto it=lower_bound(all(v),x); return it!=v.end()&&*it==x?int(it-v.begin()):-1; }
template<class V> int sortu(V &v) { sort(all(v)); int z=int(unique(all(v))-v.begin()); v.resize(z); return z; }
template<typename T,typename... Args> T tee(T (*f)(Args... args),Args&&... args) { T z=f(forward<Args>(args)...); cout<<z<<endl; return z; }
template<typename... Args> void tee(void (*f)(Args... args),Args&&... args) { f(forward<Args>(args)...); }
#ifdef EXTS
template<class S,class T> using omap=__gnu_pbds::tree<S,T,less<S>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<class T> using oset=omap<T,__gnu_pbds::null_type>;
template<class T> using rope=__gnu_cxx::rope<T>;
using dbitset=tr2::dynamic_bitset<>;
#endif
constexpr int e0=1, e1=10, e2=100, e3=1000;
constexpr int e4=10*e3, e5=100*e3, e6=1000*e3;
constexpr int e7=10*e6, e8=100*e6, e9=1000*e6;
constexpr long long e10=10LL*e9, e11=100LL*e9, e12=1000LL*e9;
constexpr long long e13=10*e12, e14=100*e12, e15=1000*e12;
constexpr long long e16=10*e15, e17=100*e15, e18=1000*e15;
constexpr __int128_t e21=__int128_t(e3)*e18, e24=__int128_t(e6)*e18, e27=__int128_t(e9)*e18;
constexpr __int128_t e30=e3*e27, e33=e6*e27, e36=e9*e27;
using ulll=__uint128_t;
using lll=__int128_t;
using ull=unsigned long long;
using ll=long long;
using uint=unsigned int;
using ushort=unsigned short;
using uchar=char;
using ld=long double;
#ifdef EXTS
using lld=__float128;
#endif
long long START_TIME=chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now().time_since_epoch()).count();
inline long long now_U_03BC_s() { return chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now().time_since_epoch()).count()-START_TIME; }
const char *fmt_time(long long U_03BC_s=now_U_03BC_s()) { static char dur[20]; sprintf(dur,"%llu.%03llus",U_03BC_s/e6,(U_03BC_s%e6)/e3); return dur; }
#define timed(cb) do { dbg("timed "#cb" ..."); unsigned long long start=now_U_03BC_s(); cb; dbg("timed "#cb" took",fmt_time(now_U_03BC_s()-start)); } while(0)
int arg1; bool inp; vector<string> args;
unsigned seed=unsigned(JO&&getenv("sd")?atoi(getenv("sd")):OJ?START_TIME:START_TIME%e5);
mt19937 igen(seed<<1),gen(seed<<1|1);
#define irand(...) (assert(!inp),_rand(igen,__VA_ARGS__))
#define rand(...) _rand(gen,__VA_ARGS__)
template<class T> enable_if_t<numeric_limits<T>::is_integer,T> _rand(mt19937 &g,T l,T r) { return uniform_int_distribution<T>(l,r)(g); }
template<class T> enable_if_t<numeric_limits<T>::is_integer,T> _rand(mt19937 &g,T n) { return _rand(g,T(1),n); }
[[deprecated]] int _rand(mt19937 &g) { return _rand(g,0,numeric_limits<int>::max()); }
template<class T> enable_if_t<numeric_limits<T>::is_iec559,T> _rand(mt19937 &g,T l,T r) { return uniform_real_distribution<T>(l,r)(g); }
bool _rand(mt19937 &g,double p) { return bernoulli_distribution(p)(g); }
template<class T> T _rand(mt19937 &g,initializer_list<T> il) { return *(il.begin()+_rand(g,0,(int)il.size()-1)); }
template<class T> T _rand(mt19937 &g,double p,T a,T b) { return _rand(g,p)?a:b; }
template<class T> T _rand(mt19937 &g,initializer_list<T> il,initializer_list<double> wt) { assert(il.size()==wt.size()); return *(il.begin()+discrete_distribution<int>(wt)(g)); }
#define random_shuffle(...) static_assert(false,"random_shuffle deprecated, use shuffle")
#define ine(x,e) (inp?cin>>(x),nop:((x)=(e),nop))
#define inr(x,...) ine(x,irand(__VA_ARGS__))
#define endl '\n'
string garb;
void exit0() { DBG=1; dbgt("gg (early)",seed); exit(0); }
#ifndef MAIN
#define MAIN _main
#endif
void MAIN();
int32_t main([[maybe_unused]]int argc,[[maybe_unused]]char *argv[]) {
	ios_base::sync_with_stdio(0); cin.tie(0); cin.exceptions(ios_base::failbit | ios_base::badbit);
	arg1=0,args={argv,argv+argc};
	if(sz(args)>1) {
		if(args[1][0]=='i') freopen((string(__FILE__).substr(0,string(__FILE__).find('.'))+"."+args[1].substr(1)+".in").c_str(),"r",stdin);
		else if(args[1][0]=='I') freopen(args[1].substr(1).c_str(),"r",stdin);
		else arg1=stoi(args[1]);
	}
	inp=!arg1;
	if(JO && getenv("EMACS")) EMACS=1;
	dbgt(arg1,seed,args);
	#ifdef QUIET
	DBG=0;
	#endif
	MAIN();
	DBG=1;
	dbgt("gg;wp",seed);
	return 0;
}
constexpr int inf=e9+99;
constexpr ll linf=1LL*e9*e9+99;
#if __cplusplus >= 202002L
constexpr long double U_03C4__ld=2*numbers::pi_v<long double>;
#else
const long double U_03C4__ld=2*acosl(-1);
#endif
#define U_03C4_ ((flt)U_03C4__ld)
constexpr long double U_03B5__ld=1e-8l;
#define U_03B5_ ((flt)U_03B5__ld)
// }}}
using flt=double; //CARE
constexpr int P=e9+7;//998'244'353;





auto solve() { /* CURSOR START */
	int n; ine(n,arg1);
	vector<int> a(n); for(int &x:a) inr(x,e9);
	return accumulate(all(a),0LL)-*max_element(all(a));
	// int i=int(min_element(all(a))-a.begin());
	// rotate(a.begin(),a.begin()+i,a.end());
	// assert(a[0]==*min_element(all(a)));

	// const int N=200<<10;
	// static int val[N],lef[N],rig[N];
	// for(int i=1;i<=n;i++) lef[i]=i-1, rig[i]=i+1, val[i]=a[i-1];
	// lef[n+1]=n, rig[0]=1;
	// val[0]=val[n+1]=-1;
	// priority_queue<pair<int,int>> pq;
	// for(int i=1;i<=n;i++) if(val[i-1]>=val[i] || val[i+1]>=val[i])

}



void _main() { int NTC=1;
	ine(NTC,5);
	for(int TC=1;TC<=NTC;TC++) {
		// cout<<"Case #"<<TC<<": ";
		tee(solve);
	}
	if(JO&&inp) assert((cin>>ws).eof());
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3676kb

input:

3
3
1 1 1
4
0 1 0 2
2
100 42

output:

2
1
42

result:

ok 3 number(s): "2 1 42"

Test #2:

score: 0
Accepted
time: 35ms
memory: 3564kb

input:

100000
2
653035426 456936267
2
409660907 250295986
2
347384960 200356123
2
283557883 840123319
2
17610671 987402881
2
136895857 909667348
2
248911778 780375903
2
275329617 285342631
2
561813712 698064200
2
400903421 742043963
2
345893112 519641162
2
14593307 406479738
2
616391850 347632216
2
1973087...

output:

456936267
250295986
200356123
283557883
17610671
136895857
248911778
275329617
561813712
400903421
345893112
14593307
347632216
19730879
421626272
56181583
370600905
308183211
258362299
586922640
40159075
198139063
142754581
51756812
119730671
81065481
143568225
273158312
49357396
14434997
396080587...

result:

ok 100000 numbers

Test #3:

score: 0
Accepted
time: 14ms
memory: 3508kb

input:

10000
17
682602980 427465994 308629394 109001734 104676154 428796022 186854021 449599165 926341494 518520271 848737248 161898549 472666174 717817465 55045664 497142577 155911030
17
175921543 574867131 81827354 668974927 924162354 915237015 544633396 979579177 69438027 7405300 106382140 464417239 180...

output:

6125364442
7499870623
3115696241
360702696
21213945702
2447605019
6043546842
34589205923
15819223559
3846736957
2676196925
3744192362
10544141369
6978880491
4574033786
15737609122
2653256904
4696483951
7460955812
2337802634
14804713017
6411748108
9889389887
1223994887
1111024273
3211437397
622504480...

result:

ok 10000 numbers

Test #4:

score: 0
Accepted
time: 14ms
memory: 3644kb

input:

10000
8
999697508 999065456 997614902 999625812 998097053 999829841 999647194 998180642
8
998003812 999598950 999592477 999015503 998934323 999987892 999397009 996325542
10
999309363 999500062 999656836 999639800 997731293 999490616 999994110 999942501 999341914 998414208
5
998354884 997391538 99942...

output:

6991928567
6990867616
8993026593
3992054913
6986375344
35960829987
7993644779
8991647831
34965241460
44954329502
9994576327
4995647305
4989986540
999379555
3994432068
1992200272
6993740135
14987859574
5993534542
10984149561
10991561821
8991490456
38968515877
16979845628
998363474
4992780787
69902563...

result:

ok 10000 numbers

Test #5:

score: 0
Accepted
time: 12ms
memory: 3544kb

input:

10000
14
1360354 847111 1342936 1758307 2968024 3304040 776037 1053054 12563 1378302 555284 170383 184958 4022755
12
1478646 1076412 1160758 931852 753287 2329398 489340 722082 385753 730711 37095 26281
20
7874 1179745 506093 981152 426040 826776 509792 1006702 598411 4301859 216450 1020715 9799 335...

output:

15711353
7792217
11384554
7559213
30173558
6387190
20720442
3286177
50738772
17566912
23643513
18790877
24388937
3469603
2391180
2641300
982687
1842069
3942015
226186
24438135
14041434
224628
18133864
15371387
10146596
3475595
6805392
1973640
8305203
12352695
281352
41788579
10784395
2305734
3364005...

result:

ok 10000 numbers

Test #6:

score: 0
Accepted
time: 14ms
memory: 3600kb

input:

1000
279
650594214 144646562 505775864 565713728 616392880 98801379 364002518 713984927 890931105 817477929 157423381 825244825 345010474 192710387 848824743 312810415 349473878 781628414 416589548 437618484 699489274 552554377 332237945 72589420 333389091 275627711 214315270 200822686 39470670 4936...

output:

139672489543
10084298880
27136710937
77975398092
16222865044
236391890110
13912598438
56613815409
378004396060
119864497771
13392529161
19451232998
78328786844
5325928884
49731804754
61372313312
21731087729
133743247724
36092331356
47623914129
1515546635
38015283894
115979292359
114190562063
6542442...

result:

ok 1000 numbers

Test #7:

score: 0
Accepted
time: 12ms
memory: 3684kb

input:

100
334
427369873 534408754 781641864 694059058 266304124 877842612 861444817 4336375 175936650 960970966 615069177 90966387 96760927 85607912 808913853 682897716 545238546 479330505 9087767 68105890 955364792 490924704 705712104 112457094 898144182 446389316 227245938 821426488 564881311 591066556 ...

output:

168826427302
767049227584
281967728296
2057275808428
984023177080
517374384084
211515151119
64332591321
1928201439106
905172662035
27494067837
1268409398558
506122807148
1249169833571
2279518092003
290642536238
1440062463458
198237680178
196741934524
205729646382
1860354389204
3632307338025
79574219...

result:

ok 100 numbers

Test #8:

score: 0
Accepted
time: 12ms
memory: 3964kb

input:

10
46906
69330308 876645284 203392520 753771853 236187991 664882066 231189246 832870374 402601545 872220279 65967339 316599857 741230035 394968471 261448158 456885344 211225593 463835574 571614661 489676569 303363391 861611471 633242104 135468374 824326103 970929699 830140897 754084885 596254139 965...

output:

23410069441408
6367131984727
9470203877172
2323242999254
911809882828
9233956651435
19691790092716
2142004121058
1304182268228
24993048109113

result:

ok 10 numbers

Test #9:

score: 0
Accepted
time: 12ms
memory: 3868kb

input:

1
200000
276829231 455552541 367752203 954191705 43604622 936020576 187649145 590427485 117123842 298201262 823213686 997937440 370246219 605753397 718851300 947479670 242150994 278537812 761057734 878148087 444378275 823201591 38848631 298605944 258707072 406328684 30762268 477562733 385184656 3525...

output:

99956381847019

result:

ok 1 number(s): "99956381847019"

Test #10:

score: 0
Accepted
time: 13ms
memory: 3884kb

input:

1
200000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 999999999 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 999999999 1000000000 1000000...

output:

199998999968310

result:

ok 1 number(s): "199998999968310"

Test #11:

score: 0
Accepted
time: 14ms
memory: 3876kb

input:

1
200000
1000000000 999999998 999999998 1000000000 1000000000 1000000000 999999998 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 999999997 999999999 1000000000 999999999 1000000000 1000000000 999999999 1000000000 1000000000 999999999 999999998 1000000000 1000000000 999999999 9999...

output:

199998999883583

result:

ok 1 number(s): "199998999883583"

Test #12:

score: 0
Accepted
time: 4ms
memory: 3960kb

input:

1
200000
0 2 0 0 1 0 0 2 0 0 2 0 2 1 0 0 3 3 0 3 0 0 0 0 0 1 4 0 0 0 0 0 1 0 1 0 0 0 3 0 0 0 0 0 0 0 3 0 0 0 1 0 0 0 0 0 0 0 0 0 2 0 1 0 0 0 1 0 1 3 0 1 2 0 1 0 0 0 0 0 0 1 2 2 1 0 0 0 1 2 0 0 0 3 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 2 0 0 2 0 1 0 0 2 0 0 0 0 0 0 2 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 2 0 0 1 0 0...

output:

115784

result:

ok 1 number(s): "115784"

Test #13:

score: 0
Accepted
time: 7ms
memory: 3972kb

input:

1
200000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

31019

result:

ok 1 number(s): "31019"

Test #14:

score: 0
Accepted
time: 12ms
memory: 3912kb

input:

1
200000
951541568 984307482 984795175 999787214 997745877 997899186 966821874 994335610 971316869 993931876 970667191 997654737 996523599 975401358 994623759 995396210 989957482 995738820 985266166 996711242 984727810 980692487 997958491 996708388 988950281 988064789 994639159 976828759 998208302 9...

output:

198031441414346

result:

ok 1 number(s): "198031441414346"

Test #15:

score: 0
Accepted
time: 9ms
memory: 3900kb

input:

1
200000
20428365 14839833 7267504 45491892 859602 4825471 3693574 13289447 5972350 23880405 3702419 1143069 31754315 10973793 6959326 5288477 6941255 8273066 17050666 8932524 26098882 16753055 10257419 7623412 19714519 22075086 7053831 4810150 4517672 25425342 2741748 14468694 1114723 22708134 5172...

output:

1964561716971

result:

ok 1 number(s): "1964561716971"

Extra Test:

score: 0
Extra Test Passed