QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#283332 | #7193. Data Structure You've Never Heard Of | wxy | WA | 1ms | 3736kb | C++14 | 1008b | 2023-12-14 14:47:58 | 2023-12-14 14:47:58 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i,l,r) for (int i = l; i <= r; i++)
#define per(i,r,l) for (int i = r; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define mp std::make_pair
#define gin std::cin
#define prt std::cout
#define edl std::endl
namespace Main {
const int mod = 1e9 + 7;
int n,d,a[200005],f[200005],b[1 << 16];
void add(int &x,int v) {
x += v; x %= mod;
}
void main() {
scanf("%d%d",&n,&d);
rep(i,1,n) {
per(j,d - 1,0) {
int v;
scanf("%1d",&v);
a[i] += (v << j);
}
}
int ans = 0;
rep(i,1,n) {
add(f[i],1);
int high = ((a[i] >> 8) << 8),low = (a[i] & ((1 << 8) - 1));
rep(j,0,(1 << 8) - 1) {
if ((j & high) == j) add(f[i],b[(j << 8) + low]);
}
add(ans,f[i]);
rep(j,0,(1 << 8) - 1) {
if ((j & low) == low) add(b[high + j],f[i]);
}
}
prt << ans;
}
} signed main() { Main::main(); return 0; }
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3440kb
input:
3 2 00 00 11
output:
7
result:
ok 1 number(s): "7"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
4 3 110 100 011 101
output:
5
result:
ok 1 number(s): "5"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
50 1 0 1 0 1 1 1 1 1 0 0 1 0 0 1 1 0 1 1 0 0 1 1 0 1 0 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 1 0 1 0 0
output:
362807295
result:
ok 1 number(s): "362807295"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
50 1 0 0 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 1 1 1 0 0 1 1 1 1 0 0 1 0 0 1 0 1 0 0 0 1 1 0
output:
120927736
result:
ok 1 number(s): "120927736"
Test #5:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
50 8 01000111 10010111 01101011 00000000 00011110 10001111 01110110 01000011 00001101 11111011 10110111 11110111 11001011 11110100 11000100 10001100 11010101 01010000 11101100 11110010 01000011 00000110 10111100 11100000 01010001 01010010 01001011 11011111 01111010 01010111 11101111 11010010 0100010...
output:
973
result:
ok 1 number(s): "973"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
50 8 00000000 00101111 00000000 01010001 10001000 00001000 00000100 01011110 10111111 00101010 00010100 10101111 10000001 01000000 11011111 11111111 11111111 00000100 11111110 10111111 00000000 10111111 11111110 00000000 10000000 11111111 11111111 11111111 11110111 00000010 11111011 11111111 1000000...
output:
585391
result:
ok 1 number(s): "585391"
Test #7:
score: -100
Wrong Answer
time: 0ms
memory: 3624kb
input:
50 15 001010001110101 101100011001001 111110110110111 000100111110000 110100100110010 101000111101000 101011010101100 111001100110111 001111001000001 100000001101010 000100101010011 010111001000000 100101010111001 100010110011110 111001101100111 001100100110101 000111100100100 001010011001010 011101...
output:
50
result:
wrong answer 1st numbers differ - expected: '58', found: '50'