QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#860736 | #9964. Frogs | IllusionaryDominance | WA | 32ms | 5248kb | C++20 | 2.7kb | 2025-01-18 14:44:17 | 2025-01-18 14:49:06 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
using ui=unsigned; using db=long double; using ll=long long; using ull=unsigned long long; using lll=__int128;
using pii=pair<int,int>; using pll=pair<ll,ll>;
template<class T1, class T2> istream &operator>>(istream &cin, pair<T1, T2> &a) { return cin>>a.first>>a.second; }
template <std::size_t Index=0, typename... Ts> typename std::enable_if<Index==sizeof...(Ts), void>::type tuple_read(std::istream &is, std::tuple<Ts...> &t) { }
template <std::size_t Index=0, typename... Ts> typename std::enable_if<Index < sizeof...(Ts), void>::type tuple_read(std::istream &is, std::tuple<Ts...> &t) { is>>std::get<Index>(t); tuple_read<Index+1>(is, t); }
template <typename... Ts>std::istream &operator>>(std::istream &is, std::tuple<Ts...> &t) { tuple_read(is, t); return is; }
template<class T1> istream &operator>>(istream &cin, vector<T1> &a) { for (auto &x:a) cin>>x; return cin; }
template<class T1> istream &operator>>(istream &cin, valarray<T1> &a) { for (auto &x:a) cin>>x; return cin; }
template<class T1, class T2> bool cmin(T1 &x, const T2 &y) { if (y<x) { x=y; return 1; } return 0; }
template<class T1, class T2> bool cmax(T1 &x, const T2 &y) { if (x<y) { x=y; return 1; } return 0; }
istream &operator>>(istream &cin, lll &x) { x=0; static string s; cin>>s; for (char c:s) x=x*10+(c-'0'); return cin; }
ostream &operator<<(ostream &cout, lll x) { static char s[60]; int tp=1; s[0]='0'+(x%10); while (x/=10) s[tp++]='0'+(x%10); while (tp--) cout<<s[tp]; return cout; }
#if !defined(ONLINE_JUDGE)
#include "my_header/IO.h"
#include "my_header/defs.h"
#else
#define dbg(...) ;
#define dbgx(...) ;
#define dbg1(x) ;
#define dbg2(x) ;
#define dbg3(x) ;
#define DEBUG(msg) ;
#define REGISTER_OUTPUT_NAME(Type, ...) ;
#define REGISTER_OUTPUT(Type, ...) ;
#endif
#define all(x) (x).begin(),(x).end()
#define print(...) cout<<format(__VA_ARGS__)
#define err(...) cerr<<format(__VA_ARGS__)
const int mod1 = 998244353, mod2 = 1e9+7;
#define MOD1
#ifdef MOD1
const int p = mod1; int fpow(int x,ll y,int m=mod1){int r=1;for(;y;y>>=1,x=(ll)x*x%m)if(y&1)r=(ll)r*x%m;return r;}
# else
const int p = mod2; int fpow(int x,ll y,int m=mod2){int r=1;for(;y;y>>=1,x=(ll)x*x%m)if(y&1)r=(ll)r*x%m;return r;}
# endif
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
cout<<fixed<<setprecision(15);
int T=1;
// cin>>T;
while (T--)
{
int n, k; cin >> n >> k; k <<= 1;
vector<int> a(n); cin >> a;
for (int &x : a) x = (x % k + k) % k;
int tmp = 0;
for (int j = 1; j < n; ++j)
{
tmp += a[j] >= a[j-1] ? 1 : -1;
int val = tmp + (a[0] >= a[j] ? 1 : -1);
cout << "10"[val == 0];
}
cout << "\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
6 2 4 3 -3 5 100 100
output:
01011
result:
ok single line: '01011'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
2 10 -9 -18
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
2 3 10 7
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
2 3 10 4
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
2 1000000000 0 0
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
2 1000000000 999999999 1000000000
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
3 1 -6 -2 0
output:
11
result:
ok single line: '11'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
4 7 -142973635 -432776724 -308791196 375008845
output:
011
result:
ok single line: '011'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
5 8 0 -7 1 -11 15
output:
0101
result:
ok single line: '0101'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
6 50 18 36 2 -14 -12 40
output:
01010
result:
ok single line: '01010'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
7 1 -60 -41 24 -15 97 -31 51
output:
010111
result:
ok single line: '010111'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
8 10 18 -5 13 12 13 18 -20 16
output:
0111010
result:
ok single line: '0111010'
Test #13:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
9 1 -275578606 585822469 -874391139 911748496 -310899945 814103287 -328176057 -86710768 -230544218
output:
01111111
result:
ok single line: '01111111'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
10 17 -358 849 -896 767 695 580 967 -115 972 -524
output:
011111111
result:
ok single line: '011111111'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
11 10 10 -4 -8 2 9 12 -11 -7 7 8 -4
output:
0101010111
result:
ok single line: '0101010111'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
12 2 -1 -1 11 -7 -13 -3 8 -3 -4 -5 -12 -8
output:
11111111111
result:
ok single line: '11111111111'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
2 9 -1 0
output:
0
result:
ok single line: '0'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
14 1000000000 93 55 28 -18 63 -63 -32 42 -50 -31 -8 -76 -5 -79
output:
0111110101010
result:
ok single line: '0111110101010'
Test #19:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
15 1000 718252927 -242175151 140890214 -793046497 -245681400 -312665625 -151470855 -976952510 455601930 -280598450 -729863748 756653606 65356121 -337929513 -124365044
output:
01111111111101
result:
ok single line: '01111111111101'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
20 2 10 -1 10 1 -6 4 -9 10 5 -6 -7 8 6 -2 8 -6 6 0 5 1
output:
0101010101110101011
result:
ok single line: '0101010101110101011'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
20 4 -3 6 -10 14 -1 1 -11 13 6 1 -11 -6 -6 -7 -7 9 8 -1 -10 -6
output:
0111111111111111111
result:
ok single line: '0111111111111111111'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
30 1 67 -607 299 -1181 712 431 -479 -1125 1002 459 -825 -110 -578 -850 -262 400 -136 805 1225 -1016 -749 -569 1220 -709 260 1172 627 -74 42 605
output:
11111111111111111111111111111
result:
ok single line: '11111111111111111111111111111'
Test #23:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
35 20 -1 1 0 0 1 -1 -1 -1 0 -1 0 1 0 -1 1 -1 1 0 1 0 -1 0 -1 1 1 0 -1 1 1 1 1 0 1 0 1
output:
0101111111111111111111111111111111
result:
ok single line: '0101111111111111111111111111111111'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
20 9 72 -59 -4 66 10 59 -49 -29 27 50 -53 -65 58 -16 -68 80 -11 25 74 -50
output:
0101110111110111111
result:
ok single line: '0101110111110111111'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
50 50 -202103538 911914731 -822373019 -855176316 843133723 -684577896 992441840 -807239457 -755295972 443495247 585584331 39009879 -397730743 271812533 -470614588 927914204 743929379 808362604 -29755391 130016084 345486609 -702491799 -340971281 -123459168 705361652 -483163877 928557032 801146039 -29...
output:
0101011111010111111111010111111101111111111111111
result:
ok single line: '0101011111010111111111010111111101111111111111111'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
75 12 -3 5 -30 -1 2 17 18 3 24 -16 11 -11 -15 -3 -2 -13 -30 -30 -28 24 -23 -8 28 -20 -20 9 12 -25 -22 25 3 -12 -24 -8 12 -26 3 -2 -20 -24 -10 -9 16 18 28 -9 4 21 -16 6 30 29 22 11 2 22 -12 -19 -26 28 2 30 21 -5 -11 -16 25 -12 27 17 28 20 -12 18 0
output:
01011111111111111111111111111111111111111111111111111111111111111111111111
result:
ok single line: '010111111111111111111111111111...1111111111111111111111111111111'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
100 2 458520845 -340742379 733766455 -404234478 -594491406 435383052 565405657 -247543969 318600319 -682231386 58414609 152405798 -222476728 911110845 -416874932 -422952333 66691682 158908945 689810723 224969550 592569223 689260558 94218013 119600841 412569240 669604688 746404859 10852030 -628371901...
output:
110111111111111111010111110111111111111111111111111111111111111111111111111111111111111111111111111
result:
ok single line: '110111111111111111010111110111...1111111111111111111111111111111'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
234 4 4809984 4908664 -34734887 -31743484 23271180 48021606 4975204 -41642723 -45283775 36901242 -48370073 19956432 4461045 8640333 34371856 19681815 -11975641 -984388 -14125522 -23043195 -45780317 -43989590 49931316 -36931455 -10728147 -47192431 -5468849 -6908343 -21434264 -39899439 -1294000 -33363...
output:
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
result:
ok single line: '111111111111111111111111111111...1111111111111111111111111111111'
Test #29:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
500 1 -751051099 569611766 -236972066 845171443 -990610479 196630920 -57323118 314659194 342213510 762069981 968923098 -361164711 -523376533 669210525 -414045737 -3654181 565772040 -830497537 -291893034 -310341830 -127893260 582950653 -467425492 329698438 -523031662 799020625 474346970 -40457536 -11...
output:
011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok single line: '011111111111111111111111111111...1111111111111111111111111111111'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
1000 5391 -8712 17926 16428 1763 -32964 15784 2889 3245 -31383 29966 -3275 -28237 -33009 35346 -29920 34726 1901 -31880 19080 38310 11504 -9553 6553 -28757 -39680 25102 -10453 -2151 -32829 19510 -13311 -29016 27300 -39573 10241 -38223 17818 -8199 -2303 19219 2202 -32106 1215 -16305 -24136 -228 -2097...
output:
010111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101111111111111111111...
result:
ok single line: '010111111111111111111111111111...1111111111111111111111111111111'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
2000 1 1 2 2 0 -2 -2 1 -1 -2 -2 2 2 2 -2 0 1 2 -2 -1 -2 -1 1 -1 1 2 -1 1 0 -2 1 0 0 1 -2 0 2 1 -2 2 1 -1 1 1 2 0 -2 -2 -2 0 0 -1 1 0 1 0 0 0 1 -1 2 1 2 2 2 -2 -1 2 -1 -2 2 -2 1 1 2 -2 2 0 0 -2 2 -1 -1 1 1 1 1 2 0 2 2 0 0 -1 -1 2 0 -1 -2 -2 2 2 -1 -2 0 0 1 2 -2 -2 -2 2 -2 -1 0 2 1 1 1 -1 -1 0 2 2 1 2...
output:
011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok single line: '011111111111111111111111111111...1111111111111111111111111111111'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
5000 17 644937734 -347099899 -353495297 927636282 249501796 563285815 -528307859 765926953 -280833689 437306062 -420573101 635269326 -159567983 176039439 145942895 -726237850 -759857269 -792959187 944529891 -740162137 927837089 319252027 -833093462 840837985 307960811 -726638959 -506114117 -41186463...
output:
010111010101111111111101010101010101010101010111011101010101110101110101010101111111110101010101010101011101010101111101011111111111111111110111110101111111111111010101010101011101010101010111111111111101011101110101011111010101111111110101010101010101110101010101010101010101011111110101110111110111...
result:
ok single line: '010111010101111111111101010101...1111111111111111111111111111111'
Test #33:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
7579 576 -324184351 -120649550 752538842 647680238 -339753305 618042032 -122316124 181862431 176680832 -716313152 294494868 -684634684 750930893 630210073 -103275343 -441029062 -690758931 -628374952 -477251615 314156267 753816563 -668482349 242664831 -849365801 771868688 123174863 -730779190 2024268...
output:
010101111111111111111111111111010101011101011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101111111111111110101010101010111010101010101011111111111011111011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok single line: '010101111111111111111111111111...1111111111111111111111111111111'
Test #34:
score: 0
Accepted
time: 2ms
memory: 3712kb
input:
20000 9 442897174 -378167080 434226626 712085822 615872088 -952762772 -39131505 -554861539 984780177 -548046911 637906488 -933746228 516257839 -1909470 -557817191 708685891 166796579 -87418670 842725556 -191261379 228891633 -688687734 173812279 596791384 -338435183 367420871 -249513448 -42733822 -77...
output:
011101010101010101011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok single line: '011101010101010101011111111111...1111111111111111111111111111111'
Test #35:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
16771 935 334942825 127427277 219032958 -307848374 154278746 100673413 -334122129 -220572022 151708607 -16067628 447631793 253632093 -356591079 189260193 -388422245 139083648 77256787 257701880 303889259 170767493 413347538 185244782 -180747668 379461059 271578543 494709137 461412126 428558033 31655...
output:
010101011101110101011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101011101010101010101010101010101010101010101010101110101011111110101010101011111111111010101...
result:
ok single line: '010101011101110101011111111111...1111111111111111111111111111111'
Test #36:
score: 0
Accepted
time: 6ms
memory: 3640kb
input:
100000 1358 47631954 -19148736 10349231 -24867634 -46749185 -28057678 -9839839 3689442 -6619235 -20169642 17547362 12723461 16571768 -7175626 8158611 -17984600 -35815817 7346318 -2812738 49606599 -19337314 24883567 2949558 -1880368 -23678307 37956752 -44715882 42892351 -21708745 6320330 543514 -3788...
output:
010101011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok single line: '010101011111111111111111111111...1111111111111111111111111111111'
Test #37:
score: 0
Accepted
time: 14ms
memory: 4096kb
input:
200000 2 970651007 -929290493 -140475496 574864011 981731550 -488291178 118868557 340447003 827650436 -415368913 72419315 -213698254 -496516899 -540995253 -297383370 431588141 209537936 545876434 834894209 -498033087 376119861 557600189 -170699799 -15854613 88852735 656054002 -496095654 730332220 55...
output:
111111111111110101011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
ok single line: '111111111111110101011111111111...1111111111111111111111111111111'
Test #38:
score: 0
Accepted
time: 14ms
memory: 4224kb
input:
222111 9 823 94 299 -38 -856 218 879 732 329 306 -840 24 -994 -863 20 355 -858 -992 638 292 141 347 100 914 544 579 -769 556 -881 -745 -984 324 -20 -673 -82 665 776 99 -88 -715 -370 -841 205 -343 -380 -146 -961 326 -558 -631 -584 860 934 459 179 681 968 636 377 -356 675 513 441 562 793 292 703 868 8...
output:
010101011101011101010101010111010111010101010101111101111111010101010101010101110101010101010101010101010101111111111111111111111111111111111111111111111111111111110111010111111111111101111111010101010101010101111111010101110101011111111111010101111101010101010101010101110101010111111101011101010101...
result:
ok single line: '010101011101011101010101010111...1010101010101010101011111111111'
Test #39:
score: 0
Accepted
time: 21ms
memory: 4480kb
input:
300000 888 -204841707 -882443429 -566902456 -877628622 797674997 -900531650 89529318 -606503305 -947316852 -575002395 -169857889 -566465710 -837641508 -631059113 279038432 -102933036 -5146570 -197504127 -396778387 -15231527 26715717 -872754947 585389328 743701869 -195990568 -679184043 -730994254 508...
output:
010101111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110111011111111111...
result:
ok single line: '010101111111111111111111111111...1111111111111111111111111111111'
Test #40:
score: 0
Accepted
time: 21ms
memory: 4864kb
input:
400000 17 35 86 61 -26 -47 -86 -5 76 2 73 51 -46 -77 21 -2 27 82 -70 97 48 18 -75 17 99 -20 -93 -92 98 23 46 54 -21 48 7 56 10 -35 33 -65 -41 -36 67 -36 43 -62 -7 63 44 21 3 -89 100 12 69 -58 -61 22 -9 -24 1 -35 -15 49 16 38 -97 -26 49 51 52 59 70 -61 -13 91 -62 100 58 44 -11 0 -47 -99 -12 -35 53 -7...
output:
010101010111111111011111011101010101111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110101010101010101010111110111010101111111111111111111...
result:
ok single line: '010101010111111111011111011101...1111111111111111111111111111111'
Test #41:
score: -100
Wrong Answer
time: 32ms
memory: 5248kb
input:
499999 1000000000 518956177 331721091 -568591584 671333720 603739917 20856261 -726509668 898053263 296495697 -95503121 376835490 -72992204 -788767067 564828187 -130415345 554159114 -55352487 -816191636 -555420428 282678521 688395442 699365656 -521089319 -543143686 103635273 374299565 798771731 32976...
output:
011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
result:
wrong answer 1st lines differ - expected: '011111111111111111111111111111...1111111111111111111111111111111', found: '011111111111111111111111111111...1111111111111111111111111111111'