QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#349534 | #8328. A Good Problem | ucup-team008# | AC ✓ | 2ms | 3976kb | C++23 | 12.1kb | 2024-03-10 02:42:41 | 2024-03-10 02:42:41 |
Judging History
answer
// {{{ y0105w49 template 22M14
// 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 sortu(v) (sort(all(v)), (v).resize(unique(all(v))-begin(v)))
#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> bool inb(const T &x,const T &l,const T &r) { return l<=x&&x<=r; }
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#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 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(...) _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)"); 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");
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;
void _main() { /* CURSOR START */
int n; ine(n,arg1);
static int a[1024]; for(int i=1;i<=n;i++) inr(a[i],0,n);
vector<int> idx0; for(int i=1;i<=n;i++) idx0.pb(i);
vector<int> ops;
fix([&](auto rec,vector<int> idx,int lx,int rx) -> void {
if(lx==rx) return;
vector<int> los,his;
int mx=(lx+rx+1)/2;
assert(lx<mx && mx<=rx);
for(int x:idx) (a[x]>=mx?his:los).pb(x);
for(int x:his) ops.pb(x);
for(int x=lx+1;x<mx;x++) ops.pb(-x);
rec(his,mx,rx);
rec(los,lx,mx-1);
})(idx0,0,n);
cout<<sz(ops)<<endl;
for(int x:ops) cout<<1+(x>0)<<' '<<abs(x)<<endl;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3552kb
input:
4 2 4 3 1
output:
8 2 1 2 2 2 3 1 1 2 2 2 3 2 2 2 4
result:
ok Correct!
Test #2:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
10 4 3 7 3 6 6 10 0 10 9
output:
32 2 3 2 5 2 6 2 7 2 9 2 10 1 1 1 2 1 3 1 4 2 7 2 9 2 10 1 6 1 7 2 7 2 9 2 10 2 7 2 9 2 3 2 5 2 6 2 3 2 1 2 2 2 4 1 1 2 1 2 2 2 4 2 1
result:
ok Correct!
Test #3:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
10 6 3 3 9 1 2 4 6 9 7
output:
29 2 1 2 4 2 8 2 9 2 10 1 1 1 2 1 3 1 4 2 4 2 9 1 6 1 7 2 4 2 9 2 1 2 8 2 10 2 10 2 2 2 3 2 6 2 7 1 1 2 2 2 3 2 7 2 7 2 5
result:
ok Correct!
Test #4:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
10 2 9 4 6 8 10 6 9 7 7
output:
33 2 2 2 4 2 5 2 6 2 7 2 8 2 9 2 10 1 1 1 2 1 3 1 4 2 2 2 5 2 6 2 8 1 6 1 7 2 2 2 6 2 8 2 6 2 4 2 7 2 9 2 10 2 9 2 10 2 1 2 3 1 1 2 3 2 3
result:
ok Correct!
Test #5:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
10 1 2 4 7 3 1 3 6 9 1
output:
26 2 4 2 8 2 9 1 1 1 2 1 3 1 4 2 9 1 6 1 7 2 9 2 4 2 8 2 4 2 2 2 3 2 5 2 7 1 1 2 3 2 5 2 7 2 3 2 1 2 6 2 10
result:
ok Correct!
Test #6:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
10 4 4 8 3 6 1 2 3 2 3
output:
26 2 3 2 5 1 1 1 2 1 3 1 4 2 3 1 6 1 7 2 5 2 1 2 2 2 4 2 7 2 8 2 9 2 10 1 1 2 1 2 2 2 4 2 8 2 10 2 1 2 2 2 6
result:
ok Correct!
Test #7:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
10 4 3 1 8 4 6 1 1 2 8
output:
25 2 4 2 6 2 10 1 1 1 2 1 3 1 4 2 4 2 10 1 6 1 7 2 6 2 1 2 2 2 5 2 9 1 1 2 1 2 2 2 5 2 1 2 5 2 3 2 7 2 8
result:
ok Correct!
Test #8:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
100 13 66 98 73 11 2 65 56 61 30 91 83 90 84 64 44 22 21 93 7 41 46 41 18 13 23 80 20 45 32 54 35 90 52 7 44 4 8 38 13 67 14 5 35 70 15 30 72 58 31 36 40 32 43 52 76 78 27 43 42 80 78 64 43 10 23 61 2 3 19 4 47 76 79 10 89 83 9 40 37 36 35 79 19 46 24 23 5 1 100 22 55 37 24 74 75 31 48 79 87
output:
582 2 2 2 3 2 4 2 7 2 8 2 9 2 11 2 12 2 13 2 14 2 15 2 19 2 27 2 31 2 33 2 34 2 41 2 45 2 48 2 49 2 55 2 56 2 57 2 61 2 62 2 63 2 67 2 73 2 74 2 76 2 77 2 83 2 90 2 92 2 95 2 96 2 99 2 100 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 ...
result:
ok Correct!
Test #9:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
100 12 84 19 6 50 64 72 49 6 11 62 23 35 54 41 68 77 16 88 11 19 52 25 7 79 27 68 42 86 74 25 40 44 5 30 95 36 18 83 23 47 86 69 18 100 52 0 21 94 2 92 68 23 44 41 6 17 50 93 13 30 25 66 59 21 63 7 82 51 20 70 29 99 76 50 88 54 5 26 28 10 100 92 79 55 57 92 21 55 59 82 60 49 22 13 14 69 62 13 12
output:
557 2 2 2 5 2 6 2 7 2 11 2 14 2 16 2 17 2 19 2 22 2 25 2 27 2 29 2 30 2 36 2 39 2 42 2 43 2 45 2 46 2 49 2 51 2 52 2 58 2 59 2 63 2 64 2 66 2 68 2 69 2 71 2 73 2 74 2 75 2 76 2 77 2 82 2 83 2 84 2 85 2 86 2 87 2 89 2 90 2 91 2 92 2 97 2 98 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14...
result:
ok Correct!
Test #10:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
100 57 58 65 22 1 8 7 53 29 91 39 85 30 88 54 11 46 12 0 85 86 80 17 59 13 86 39 89 13 48 21 45 45 61 49 60 3 31 73 94 31 44 25 87 8 35 83 38 69 73 0 51 86 68 71 70 23 12 97 70 12 28 77 42 93 55 13 85 42 42 52 94 24 0 1 6 14 37 66 41 98 49 82 46 36 10 30 98 56 98 38 73 45 17 6 99 18 90 99 39
output:
584 2 1 2 2 2 3 2 8 2 10 2 12 2 14 2 15 2 20 2 21 2 22 2 24 2 26 2 28 2 34 2 36 2 39 2 40 2 44 2 47 2 49 2 50 2 52 2 53 2 54 2 55 2 56 2 59 2 60 2 63 2 65 2 66 2 68 2 71 2 72 2 79 2 81 2 83 2 88 2 89 2 90 2 92 2 96 2 98 2 99 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17...
result:
ok Correct!
Test #11:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
100 12 22 7 50 1 15 38 89 24 39 35 2 98 7 35 40 27 8 43 35 40 51 1 13 13 57 44 5 39 69 81 77 71 28 49 9 21 51 14 22 29 33 18 3 1 86 60 27 67 64 11 22 5 28 35 36 73 52 8 30 86 79 68 53 31 51 14 28 11 3 79 77 31 16 16 48 4 46 72 49 28 17 71 12 61 32 20 27 31 64 75 57 67 21 24 15 74 30 12 12
output:
540 2 4 2 8 2 13 2 22 2 26 2 30 2 31 2 32 2 33 2 38 2 46 2 47 2 49 2 50 2 57 2 58 2 61 2 62 2 63 2 64 2 66 2 71 2 72 2 79 2 83 2 85 2 90 2 91 2 92 2 93 2 97 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 ...
result:
ok Correct!
Test #12:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
100 28 27 6 9 3 30 63 2 65 50 26 3 77 35 16 14 53 37 26 8 9 60 51 40 10 49 29 13 33 15 35 15 2 24 44 57 42 34 27 54 3 63 53 73 23 36 39 28 86 69 68 41 15 18 24 89 29 47 56 28 14 32 78 11 29 11 59 47 11 25 80 50 30 37 6 61 90 49 27 19 29 46 24 1 32 73 4 28 42 23 3 34 6 12 52 69 7 34 52 15
output:
524 2 7 2 9 2 10 2 13 2 17 2 22 2 23 2 36 2 40 2 42 2 43 2 44 2 49 2 50 2 51 2 56 2 59 2 63 2 67 2 71 2 72 2 76 2 77 2 86 2 95 2 96 2 99 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 ...
result:
ok Correct!
Test #13:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
100 25 7 7 9 34 58 34 36 49 6 10 34 22 40 24 17 9 90 54 2 38 67 59 74 31 8 34 15 12 55 12 45 4 19 4 19 28 40 92 4 4 22 21 2 39 71 65 77 11 13 9 37 72 32 21 16 23 39 23 66 16 28 13 41 12 45 66 13 49 45 43 34 16 84 6 6 81 22 4 23 35 3 69 14 15 33 8 71 26 52 9 20 9 46 68 74 50 21 23 35
output:
533 2 6 2 18 2 19 2 22 2 23 2 24 2 30 2 39 2 46 2 47 2 48 2 53 2 60 2 67 2 74 2 77 2 83 2 88 2 90 2 95 2 96 2 97 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1...
result:
ok Correct!
Test #14:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
1000 34 769 740 957 126 724 943 359 299 576 260 460 760 303 348 482 42 335 484 573 302 717 25 356 310 296 235 487 342 362 379 778 964 875 655 60 13 422 136 964 240 675 262 628 805 953 686 20 305 888 982 688 366 105 508 252 971 419 715 945 910 343 835 926 63 59 441 335 322 56 75 335 128 514 839 424 1...
output:
9033 2 2 2 3 2 4 2 6 2 7 2 10 2 13 2 20 2 22 2 32 2 33 2 34 2 35 2 40 2 42 2 44 2 45 2 46 2 47 2 50 2 51 2 52 2 55 2 57 2 59 2 60 2 61 2 63 2 64 2 74 2 75 2 78 2 80 2 84 2 87 2 88 2 96 2 99 2 100 2 102 2 103 2 104 2 105 2 106 2 107 2 111 2 113 2 114 2 115 2 116 2 117 2 118 2 119 2 123 2 125 2 126 2 ...
result:
ok Correct!
Test #15:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
1000 668 960 321 884 19 156 939 362 0 202 59 402 991 327 654 803 893 662 85 825 342 200 91 867 199 649 117 64 242 668 887 663 843 105 823 639 904 992 670 315 100 941 662 237 879 900 603 575 240 532 573 310 264 442 925 924 244 634 88 635 685 180 235 178 699 356 366 623 137 24 810 783 174 553 4 767 66...
output:
9010 2 1 2 2 2 4 2 7 2 13 2 15 2 16 2 17 2 18 2 20 2 24 2 26 2 30 2 31 2 32 2 33 2 35 2 36 2 37 2 38 2 39 2 42 2 43 2 45 2 46 2 47 2 48 2 50 2 51 2 55 2 56 2 58 2 60 2 61 2 65 2 68 2 71 2 72 2 74 2 76 2 77 2 82 2 87 2 92 2 93 2 94 2 98 2 100 2 103 2 106 2 108 2 110 2 111 2 112 2 115 2 117 2 118 2 11...
result:
ok Correct!
Test #16:
score: 0
Accepted
time: 1ms
memory: 3720kb
input:
1000 969 408 165 253 331 421 61 882 701 103 489 555 712 547 769 3 619 952 972 451 564 413 293 173 488 217 689 167 114 562 419 638 340 527 348 288 785 610 769 142 753 91 36 215 576 442 762 853 20 911 843 117 741 949 209 694 126 695 389 365 92 657 663 304 277 476 692 87 315 199 33 926 232 514 714 254 ...
output:
9021 2 1 2 8 2 9 2 12 2 13 2 14 2 15 2 17 2 18 2 19 2 21 2 27 2 30 2 32 2 34 2 37 2 38 2 39 2 41 2 45 2 47 2 48 2 50 2 51 2 53 2 54 2 56 2 58 2 62 2 63 2 67 2 72 2 74 2 75 2 77 2 79 2 82 2 88 2 90 2 91 2 92 2 94 2 97 2 98 2 100 2 101 2 104 2 105 2 106 2 107 2 108 2 112 2 113 2 117 2 120 2 122 2 123 ...
result:
ok Correct!
Test #17:
score: 0
Accepted
time: 1ms
memory: 3968kb
input:
1000 203 307 134 54 891 392 567 161 179 563 175 184 863 89 54 537 563 34 97 207 517 286 750 517 195 63 477 468 168 863 338 193 455 120 60 584 135 197 159 667 834 154 533 191 392 142 715 218 96 609 25 492 295 57 347 263 289 359 290 617 146 616 111 528 179 714 910 233 180 251 134 692 365 78 157 386 26...
output:
8474 2 5 2 7 2 10 2 13 2 16 2 17 2 21 2 23 2 24 2 30 2 36 2 40 2 41 2 43 2 47 2 50 2 60 2 62 2 64 2 66 2 67 2 72 2 79 2 80 2 81 2 87 2 90 2 94 2 96 2 97 2 98 2 99 2 102 2 103 2 122 2 124 2 129 2 136 2 141 2 142 2 147 2 149 2 151 2 158 2 159 2 160 2 170 2 173 2 179 2 182 2 183 2 185 2 188 2 193 2 196...
result:
ok Correct!
Test #18:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
1000 359 29 135 514 371 700 67 651 167 555 476 413 215 19 110 225 289 13 46 616 762 42 547 218 26 573 674 109 454 894 215 591 42 13 361 304 128 201 576 392 54 111 425 119 344 260 252 484 51 492 572 207 372 183 745 560 684 294 270 97 278 38 223 282 120 273 630 294 625 752 818 203 417 113 191 811 902 ...
output:
8464 2 4 2 6 2 8 2 10 2 20 2 21 2 23 2 26 2 27 2 30 2 32 2 39 2 51 2 55 2 56 2 57 2 67 2 69 2 70 2 71 2 76 2 77 2 79 2 80 2 92 2 107 2 113 2 116 2 117 2 125 2 127 2 128 2 129 2 131 2 132 2 138 2 142 2 144 2 145 2 147 2 148 2 151 2 157 2 158 2 165 2 172 2 177 2 182 2 187 2 188 2 191 2 193 2 196 2 210...
result:
ok Correct!
Test #19:
score: 0
Accepted
time: 1ms
memory: 3976kb
input:
1000 672 331 438 653 624 242 641 619 51 548 649 796 172 324 106 792 16 147 307 248 86 699 223 11 633 239 340 473 526 145 25 83 13 586 329 97 494 63 279 119 158 103 7 411 44 123 520 597 546 182 90 558 79 1 765 330 285 278 137 464 15 676 171 224 569 493 578 508 206 286 132 41 2 628 93 111 305 15 215 3...
output:
8511 2 1 2 4 2 5 2 7 2 8 2 10 2 11 2 12 2 16 2 22 2 25 2 29 2 34 2 47 2 48 2 49 2 52 2 55 2 62 2 65 2 67 2 68 2 74 2 84 2 88 2 94 2 99 2 102 2 107 2 110 2 121 2 123 2 124 2 129 2 130 2 132 2 135 2 140 2 142 2 143 2 144 2 145 2 146 2 150 2 154 2 155 2 160 2 170 2 173 2 175 2 176 2 177 2 178 2 180 2 1...
result:
ok Correct!
Test #20:
score: 0
Accepted
time: 1ms
memory: 3760kb
input:
1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...
output:
8987 2 500 2 501 2 502 2 503 2 504 2 505 2 506 2 507 2 508 2 509 2 510 2 511 2 512 2 513 2 514 2 515 2 516 2 517 2 518 2 519 2 520 2 521 2 522 2 523 2 524 2 525 2 526 2 527 2 528 2 529 2 530 2 531 2 532 2 533 2 534 2 535 2 536 2 537 2 538 2 539 2 540 2 541 2 542 2 543 2 544 2 545 2 546 2 547 2 548 2...
result:
ok Correct!
Test #21:
score: 0
Accepted
time: 2ms
memory: 3776kb
input:
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...
output:
13938 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 2 40 2 41 2 42 2 43 2 44 2 45 2 46 2 47 2 48 2 49 2 50 2 51 2 52 2 53 2 54 2 55 2 56 2 57 2 58 2 59 2 60 2 6...
result:
ok Correct!
Test #22:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
1000 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 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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
3938 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 1 14 1 15 1 16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 1 26 1 27 1 28 1 29 1 30 1 31 1 32 1 33 1 34 1 35 1 36 1 37 1 38 1 39 1 40 1 41 1 42 1 43 1 44 1 45 1 46 1 47 1 48 1 49 1 50 1 51 1 52 1 53 1 54 1 55 1 56 1 57 1 58 1 59 1 60 1 61...
result:
ok Correct!
Extra Test:
score: 0
Extra Test Passed