Submission #37345123


Source Code Expand

#include <stdio.h>
#include <string.h>
#include <math.h>

int main(void){
	int n, m;
	scanf("%d %d", &n, &m);
	char c;
	int a[n];

	for(int i = 0; i < n; i++){
		a[i] = 0;
		for (int j = 0; j < m; j++){
			scanf(" %c", &c);
			if(c == 'o'){
				a[i] += pow(2, (m-1)-j);
			}
		}
		// printf("%d\n", a[i]);
	}

	int cnt = 0;
	for (int i = 0; i < n-1; i++){
		for (int j = i+1; j < n; j++){
			// printf("%d\n", a[i] | a[j]);
			if ((a[i] | a[j]) == (pow(2, m) - 1)){
				cnt++;
			}
		}
	}
	printf("%d\n", cnt);

	return 0;
}

Submission Info

Submission Time
Task B - Let's Get a Perfect Score
User Cebu
Language C (GCC 9.2.1)
Score 200
Code Size 557 Byte
Status AC
Exec Time 5 ms
Memory 2592 KiB

Compile Error

./Main.c: In function ‘main’:
./Main.c:7:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
    7 |  scanf("%d %d", &n, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~~
./Main.c:14:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   14 |    scanf(" %c", &c);
      |    ^~~~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 20
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt, 02_handmade_07.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 5 ms 2444 KiB
00_sample_02.txt AC 1 ms 2280 KiB
00_sample_03.txt AC 1 ms 2424 KiB
01_test_01.txt AC 1 ms 2496 KiB
01_test_02.txt AC 2 ms 2516 KiB
01_test_03.txt AC 2 ms 2428 KiB
01_test_04.txt AC 1 ms 2592 KiB
01_test_05.txt AC 1 ms 2504 KiB
01_test_06.txt AC 1 ms 2480 KiB
01_test_07.txt AC 1 ms 2520 KiB
01_test_08.txt AC 1 ms 2516 KiB
01_test_09.txt AC 2 ms 2520 KiB
01_test_10.txt AC 1 ms 2520 KiB
02_handmade_01.txt AC 1 ms 2440 KiB
02_handmade_02.txt AC 2 ms 2512 KiB
02_handmade_03.txt AC 1 ms 2472 KiB
02_handmade_04.txt AC 1 ms 2512 KiB
02_handmade_05.txt AC 1 ms 2476 KiB
02_handmade_06.txt AC 1 ms 2440 KiB
02_handmade_07.txt AC 3 ms 2472 KiB