Code Submission Evaluation System Login

HIIT Open 2017

Start:2017-05-27 11:00:00
End:2017-05-27 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2017 - Results
History
2017-05-27 13:08:31
Task:Grid
Sender:KnowYourArchitecture
Submission time:2017-05-27 13:08:31
Language:C++
Status:READY
Result:ACCEPTED

Test results

testverdicttime (s)
#1ACCEPTED0.06 / 2.00details
#2ACCEPTED0.04 / 2.00details
#3ACCEPTED0.05 / 2.00details
#4ACCEPTED0.05 / 2.00details
#5ACCEPTED0.05 / 2.00details
#6ACCEPTED0.06 / 2.00details
#7ACCEPTED0.04 / 2.00details
#8ACCEPTED0.05 / 2.00details
#9ACCEPTED0.04 / 2.00details
#10ACCEPTED0.03 / 2.00details
#11ACCEPTED0.04 / 2.00details
#12ACCEPTED0.06 / 2.00details
#13ACCEPTED0.04 / 2.00details
#14ACCEPTED0.04 / 2.00details
#15ACCEPTED0.05 / 2.00details
#16ACCEPTED0.07 / 2.00details
#17ACCEPTED0.06 / 2.00details
#18ACCEPTED0.06 / 2.00details
#19ACCEPTED0.05 / 2.00details
#20ACCEPTED0.05 / 2.00details
#21ACCEPTED0.04 / 2.00details
#22ACCEPTED0.05 / 2.00details
#23ACCEPTED1.22 / 2.00details
#24ACCEPTED1.34 / 2.00details
#25ACCEPTED1.22 / 2.00details
#26ACCEPTED1.41 / 2.00details
#27ACCEPTED1.26 / 2.00details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:14:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=0;j<l.size();++j)v[i].set(j,l[j]=='1');
                              ^

Code

#include <bits/stdc++.h>

using namespace std;
bitset<3000> v[3000];
typedef long long ll;
int main() {
    cin.tie(nullptr);
    cin.sync_with_stdio(false);
    int n,m;
    cin>>n>>m;
    for(int i=0;i<n;++i){
        string l;
        cin>>l;
        for(int j=0;j<l.size();++j)v[i].set(j,l[j]=='1');
    }
    ll r = 0;
    for(int i=0;i<n;++i){
        for(int j=i+1;j<n;++j){
            auto k = v[i]&v[j];
            ll a = k.count()-1;
            r+=(a*a+a)/2;
        }
    }
    cout<<r<<endl;
    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
10 20
11111111111111111111
11111111111111111111
11111111111111111111
11111111111111111111
11111111111111111111
11111111111111111111
11111111111111111111
11111110111111111111
11111111111111111111
11111111111111111111
view   save

correct output
8379
view   save

user output
8379
view   save

Test 2

Verdict: ACCEPTED

input
20 10
1111111111
1101111111
1111111111
1111111111
0111111111
1111111111
1111111111
1111111111
1111111111
1111111111
1111111111
0111111111
1111111111
1111111111
1111110111
1111111111
1111111111
1111111111
1111111111
...
view   save

correct output
7880
view   save

user output
7880
view   save

Test 3

Verdict: ACCEPTED

input
10 20
11111111010111111101
11111110011011111111
11111100011111111111
11101111111111111111
11111111111111111111
11111111010110011111
11111011111111101111
11011101110111110111
11111111111111011110
10111111111111011111
view   save

correct output
5106
view   save

user output
5106
view   save

Test 4

Verdict: ACCEPTED

input
20 10
1111100111
1111111111
1011111110
1111111111
1101111111
0110111111
1111101111
1101110011
1111111111
1111111111
0111011111
0101111111
1111011111
1111001111
1111111101
1111111111
1111101111
1110001101
0010111101
...
view   save

correct output
4563
view   save

user output
4563
view   save

Test 5

Verdict: ACCEPTED

input
10 20
11011011011111111110
11111010110110110001
11010010111101111010
01111111111110101111
11110010110110110110
11111001101111011011
01111101101110110011
11111111111111111011
01111011111010111111
11111110101111111111
view   save

correct output
3099
view   save

user output
3099
view   save

Test 6

Verdict: ACCEPTED

input
20 10
1110111111
1111111111
1101101110
0111110011
1111101111
1100110011
1011111101
1111111111
0111111111
0101011111
1101111101
1111110011
1111110101
1010010111
1100111011
1011111011
0101101111
0010011101
1101111111
...
view   save

correct output
2973
view   save

user output
2973
view   save

Test 7

Verdict: ACCEPTED

input
10 20
01101101111101110101
10011111111111110111
01111101011010110011
10110101110110101011
11111011110111110111
10110111111110010111
11100101000111111111
11011000111101101111
01101111111111110011
01111011111011111101
view   save

correct output
2581
view   save

user output
2581
view   save

Test 8

Verdict: ACCEPTED

input
20 10
1110111001
0111001001
1111011011
1111111010
1101101111
1111101100
1111001101
0011010111
0111110111
1110000011
0110111011
1111101100
1001010001
1001011101
1111011101
0101111100
1111111111
1101010010
1010100001
...
view   save

correct output
1660
view   save

user output
1660
view   save

Test 9

Verdict: ACCEPTED

input
10 20
11000000001100011111
11100111101100110110
11001110011110110101
10100001111011001111
01101111100010111111
11101110111010001011
01100010010110110101
01111000001101101111
11100001110101000101
10011111110010111001
view   save

correct output
1015
view   save

user output
1015
view   save

Test 10

Verdict: ACCEPTED

input
20 10
1000011001
1101111110
1000111111
1101101010
1101011111
1110110110
0111111111
0001011110
0101011100
0101010100
1001111100
1101010111
0101100100
1011010100
0011100100
1100110111
1011100111
0010101111
1000010100
...
view   save

correct output
1135
view   save

user output
1135
view   save

Test 11

Verdict: ACCEPTED

input
10 20
10000101101101000110
00100010110011011011
11110111110101101011
11101100011101001011
00111110001000001100
01101111101010011101
01100111001011100101
10001010001000101011
10111111010000111001
01011100001111010011
view   save

correct output
708
view   save

user output
708
view   save

Test 12

Verdict: ACCEPTED

input
20 10
1000011111
0001001100
0101110110
1111110001
0001111101
0000000111
1001011000
1000100011
0011111100
1110111110
1000000111
1111010110
0011101000
1001001010
1000100100
1001110000
1001011010
0100001000
1100010101
...
view   save

correct output
394
view   save

user output
394
view   save

Test 13

Verdict: ACCEPTED

input
10 20
00010111101111010011
11010001011010010110
10011001011010100011
01100011001000001100
10101000011000010010
01000010100010100000
10000001010100000011
00111000110000000010
11011110110001100000
10111011011010111000
view   save

correct output
294
view   save

user output
294
view   save

Test 14

Verdict: ACCEPTED

input
20 10
0011001110
0000001111
1011100000
0000001001
1111001000
0101101011
0010100100
1000100000
1111010000
0000100010
0010010000
1011110111
1001001000
0101000111
1101100100
1010000000
0000001000
0000111010
0100101010
...
view   save

correct output
166
view   save

user output
166
view   save

Test 15

Verdict: ACCEPTED

input
10 20
10011010001011000110
00100000100000000000
00000110001000110001
01000000101100110101
00000100000001011110
00001110000010101000
00010100001101100010
10000110001100000100
01000000000000001011
11110000111000010110
view   save

correct output
87
view   save

user output
87
view   save

Test 16

Verdict: ACCEPTED

input
20 10
0000110101
1000000001
0101100110
0100001010
0001000001
0000110010
1011000111
1011001010
0001100001
1000001000
1111010111
1100010000
0101010100
0001000000
0000000110
0100001000
0101010010
0001000010
0111001010
...
view   save

correct output
134
view   save

user output
134
view   save

Test 17

Verdict: ACCEPTED

input
10 20
00000001100001000100
00000100000010000001
00000100000010000010
10000010000000100000
00010001000001010001
00100100001000001010
10001000100000001000
00010000010001100000
00100001001100000000
00000000010000000100
view   save

correct output
5
view   save

user output
5
view   save

Test 18

Verdict: ACCEPTED

input
20 10
0100001000
0100000000
0000010001
0000101000
0000000001
0100100110
0000100001
0010001001
0000000010
0000010000
0000000000
0000001000
0000110000
0000001000
0000000100
0000001000
0000000000
0000001001
0001101010
...
view   save

correct output
4
view   save

user output
4
view   save

Test 19

Verdict: ACCEPTED

input
10 20
00100010000100000000
00000000000000000000
00100000000000000000
00000001000000000010
00000000000000000000
00000000000000000000
00100100010011000000
10000001000110000001
00000001000000000000
00000000000000000011
view   save

correct output
0
view   save

user output
0
view   save

Test 20

Verdict: ACCEPTED

input
20 10
0000010000
0000000000
1000000000
0000000000
0000000000
0000000000
0000000000
1000000000
0000000000
0000000001
0010000000
0000000000
1010000000
0001100000
0000010000
0000000000
0000000100
0000001000
0000010000
...
view   save

correct output
0
view   save

user output
0
view   save

Test 21

Verdict: ACCEPTED

input
10 20
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
view   save

correct output
0
view   save

user output
0
view   save

Test 22

Verdict: ACCEPTED

input
20 10
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
0000000000
...
view   save

correct output
0
view   save

user output
0
view   save

Test 23

Verdict: ACCEPTED

input
3000 3000
111111111111111111111111111111...
view   save

correct output
19444691141193
view   save

user output
19444691141193
view   save

Test 24

Verdict: ACCEPTED

input
3000 3000
001011111110111101100001111011...
view   save

correct output
6150476374242
view   save

user output
6150476374242
view   save

Test 25

Verdict: ACCEPTED

input
3000 3000
001011000111011110110111111110...
view   save

correct output
1213493895016
view   save

user output
1213493895016
view   save

Test 26

Verdict: ACCEPTED

input
3000 3000
000000001001000010110001000001...
view   save

correct output
75998707871
view   save

user output
75998707871
view   save

Test 27

Verdict: ACCEPTED

input
3000 3000
000000000000000000000000000000...
view   save

correct output
0
view   save

user output
0
view   save