problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
acwing::acwing1776类 参考

AcWing 1776. 牛的基因组学 更多...

#include <acwing.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

AcWing 1776. 牛的基因组学

在文件 acwing.h950 行定义.

成员函数说明

◆ main()

int acwing::acwing1776::main ( istream &  cin,
ostream &  cout 
)
static

在文件 acwing.cpp2886 行定义.

2886 {
2887 int n;
2888 int m;
2889 cin >> n >> m;
2890 char ch;
2891 auto *dot = new int[m];
2892 memset(dot, 0, m * sizeof(int));
2893 auto *normal = new int[m];
2894 memset(normal, 0, m * sizeof(int));
2895 for(int i = 0; i < n; i++) {
2896 for(int j = 0; j < m; j++) {
2897 cin >> ch;
2898 dot[j] |= 1 << ch - 'A';
2899 }
2900 }
2901 for(int i = 0; i < n; i++) {
2902 for(int j = 0; j < m; j++) {
2903 cin >> ch;
2904 normal[j] |= 1 << ch - 'A';
2905 }
2906 }
2907 int count = 0;
2908 for(int i = 0; i < m; i++) {
2909 if((dot[i] & normal[i]) == 0) {
2910 count++;
2911 }
2912 }
2913 cout << count;
2914 delete[] normal;
2915 delete[] dot;
2916 return 0;
2917 }

被这些函数引用 acwing::TEST().


该类的文档由以下文件生成: