zoukankan      html  css  js  c++  java
  • Problem 330A

    330A. Cakeminator

    https://codeforces.com/problemset/problem/330/A

    题意很容易理解:给定一块蛋糕区域,但蛋糕上有几个不能吃的草莓,大胃王一次能吃一整列、行

    求在不吃到草莓的情况下能迟到的最多的蛋糕数

    //cpp
    #include<bits/stdc++.h>
    using namespace std;
    int main() {
       //freopen("in.txt", "r", stdin);
       ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
       int n, m; set<int>a, b; char c;
       cin >> n >> m;
       for (int i = 1; i <= n; ++i)
       	for (int j = 1; j <= m; ++j) { cin >> c; if (c == 'S') a.insert(i), b.insert(j); }
       cout << m * n - a.size() * b.size();
    }
    
    #python
    S=input
    n,m=map(int,S().split())
    g=[S() for i in range(n)]
    print(n*m-len([1 for i in g if i.count('S')])*len([1 for i in zip(*g) if i.count('S')]))
    

    The desire of his soul is the prophecy of his fate
    你灵魂的欲望,是你命运的先知。

  • 相关阅读:
    环保
    A股行情记录
    航运
    黑五类
    家电
    妖股
    高校概念股
    科技园区
    壳股
    白底黑字or黑底白字,眼睛更喜欢哪一个?
  • 原文地址:https://www.cnblogs.com/RioTian/p/13720522.html
Copyright © 2011-2022 走看看