QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#488267 | #8598. AND Масив | Yarema# | 10 | 25ms | 3624kb | C++20 | 807b | 2024-07-23 19:28:49 | 2024-07-23 19:28:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n, b;
cin >> n >> b;
VI a(n);
FOR (i, 0, n)
cin >> a[i];
FOR (i, 0, n)
{
int res = 0;
FOR (bb, 0, b)
{
int mask = 1 << bb;
FOR (j, i, n)
{
if ((mask & a[j]) == 0)
{
res += j + 1;
mask |= a[j];
}
}
}
cout << res << ' ';
}
cout << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 25ms
memory: 3624kb
input:
2000 20 251931 620255 725521 330111 783060 690627 489092 1019106 84341 631993 231500 920886 604265 342966 152434 588032 469990 805072 809795 12697 699326 433747 754394 567737 603087 199524 539078 775214 872735 454953 106496 93877 933762 36223 211878 168057 53977 782675 171782 455544 869778 47128 955...
output:
10212 4259 4815 9101 17193 17617 22629 16642 10432 10731 11766 20234 27120 17990 24654 22106 18877 14050 9217 10109 4283 9341 11741 13465 13724 9572 11200 4046 7660 7001 6512 12634 13360 10494 19745 15300 12727 17726 14188 10472 12754 7995 10571 11290 14862 19370 16785 13328 13589 17425 23190 17082 ...
result:
ok single line: '10212 4259 4815 9101 17193 176... 39925 39961 39974 43987 18000 '
Test #2:
score: 10
Accepted
time: 23ms
memory: 3492kb
input:
2000 20 2080 32772 278528 256 2560 1056 528384 2056 132 144 768 98304 36864 262152 262400 81920 264192 16448 294912 786432 8194 16388 9 520 49152 2 262272 20 131584 528384 514 4352 12288 36 32800 72 16392 32 129 8 1028 131080 12288 8193 8320 528 1026 24576 8192 10240 163840 524288 262400 278528 2785...
output:
10532 10275 11389 7400 12269 14740 10975 9199 12307 10890 12090 11861 12707 12449 12586 12195 12260 14273 18795 18089 19280 21369 14169 17819 13755 16253 14945 14538 24799 24439 23275 17968 19797 19977 21225 18864 16595 21665 22140 32768 31494 29782 27849 20911 26304 21480 25191 22840 30738 26969 22...
result:
ok single line: '10532 10275 11389 7400 12269 1...11837 109909 73963 71982 36000 '
Test #3:
score: 10
Accepted
time: 21ms
memory: 3620kb
input:
2000 20 81937 164096 131652 98564 263184 69665 2596 557184 286848 22544 49416 196872 65816 2179 45056 135232 352 1120 8832 32801 131776 98328 528385 51456 266400 396288 65573 328200 528512 26 65700 2248 8328 322 557312 16516 34050 66624 721152 45060 524353 2448 65984 16899 20993 137 265248 33808 665...
output:
10265 12832 12649 13394 14831 13921 19818 8209 7716 12652 12292 11823 12491 12133 17047 7964 8283 15911 12563 12580 12125 10806 12966 12370 19648 11631 12192 16886 17717 20174 20336 25578 15349 16556 21621 20009 14907 18092 15498 24250 21725 21223 14614 15274 10702 16692 16601 15963 14431 23066 1801...
result:
ok single line: '10265 12832 12649 13394 14831 ... 75882 73929 95952 63984 32000 '
Subtask #2:
score: 0
Time Limit Exceeded
Test #4:
score: 0
Time Limit Exceeded
input:
100000 20 262144 16 65536 8 256 1024 32 262144 16 262144 256 1024 1 64 2 131072 4096 2048 2 32 8192 4 2 262144 32768 1 524288 262144 262144 2048 8 64 1 2 8192 131072 256 64 8192 1 262144 4 32 4 524288 1 32768 16 64 128 8192 16 32 4096 16384 16384 4 131072 32768 16384 131072 2 16 2048 32768 16 4 4096...
output:
7752 7885 8018 9329 9842 9956 10070 10317 10355 11096 11362 11856 12958 13205 13547 13623 14003 14706 14934 15010 15447 15713 16093 16302 16378 16796 16929 17271 17290 17518 18164 19114 19228 19361 19893 19969 20387 21147 21356 21584 21698 23332 23370 23560 23807 24510 25688 25916 25992 26486 27322 ...
result:
Subtask #3:
score: 0
Time Limit Exceeded
Test #6:
score: 0
Time Limit Exceeded
input:
100000 8 98 78 5 190 79 234 162 79 118 176 115 130 10 9 233 56 97 15 148 13 46 87 92 65 150 62 50 46 159 101 48 86 203 71 29 124 23 228 55 161 240 80 139 74 251 143 167 207 183 52 50 252 17 185 40 145 167 164 227 166 172 60 182 62 173 227 232 243 251 134 109 241 44 33 217 149 51 6 110 201 242 196 23...
output:
152631657 152630131 152630001 152630939 152631411 152631998 152630663 152631609 152631606 152630657 152631172 152632208 152631468 152631040 152631058 152630747 152631208 152630998 152631307 152631149 152631038 152631013 152631782 152631146 152631829 152632118 152632297 152632294 152631891 152632567 ...
result:
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%