답안 #535002

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
535002 2022-03-09T09:07:45 Z MedalistSlayer Collecting Mushrooms (NOI18_collectmushrooms) C++14
19 / 100
2 ms 864 KB
/*
    Does he have IGM on CF?
    -neko_nyaa
*/
#include <bits/stdc++.h>
using namespace std;

//define
#define PB push_back
#define MP make_pair
#define pi acos(-1)
#define int long long

//constant
const int mod=1e9+7;
const long long MOD=998244353LL;
const long long inf=(long long)1e18;
 
//typedef
typedef long long ll;
typedef pair<int,int> pii;
typedef map<int,int> mii;
typedef map<string,int> msi;
typedef set<int> SI;
typedef priority_queue<int> pqi;


signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("haybales.in", "r", stdin);
    //freopen("haybales.out", "w", stdout);
    int r,c,d,k;
    cin >> r >> c >> d >> k;
    vector<string> s(r);
    for(int i=0;i<r;i++)
    {
        cin >> s[i];
    }
    int mushroom=0;
    int sprinkler=0;
    for(int i=0;i<r;i++)
    {
        for(int j=0;j<c;j++)
        {
            if(s[i][j]=='M')
            {
                mushroom++;
            }
            if(s[i][j]=='S')
            {
                sprinkler++;
            }
        }
    }   
    cout << (k<=sprinkler?mushroom:0) << '\n';

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 312 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 864 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 312 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Incorrect 0 ms 204 KB Output isn't correct
12 Halted 0 ms 0 KB -