Submission #60525308


Source Code Expand

Copy
#include <bits/stdc++.h>
#define ll long long int
#define endl '\n'
#define vn vector <ll>
using namespace std;
const int MAX_N = 1e9 + 7;
#define pb push_back // A shorthand for push_back (used to add elements to a vector)
#define srt(vp) sort(vp.begin(), vp.end()) // A shorthand to sort the vector of pairs
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n,m,d;
cin>>n>>m>>d;
vector <string> s(n);
for (int i=0;i<n;i++){
cin>>s[i];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>
#define ll long long int
#define endl '\n'
#define vn vector <ll>
using namespace std;
const int MAX_N = 1e9 + 7;

#define pb push_back  // A shorthand for push_back (used to add elements to a vector)

#define srt(vp) sort(vp.begin(), vp.end())  // A shorthand to sort the vector of pairs

int main() {
  ios::sync_with_stdio(false);        
  cin.tie(nullptr);
  ll n,m,d;
  cin>>n>>m>>d;

  vector <string> s(n);
  for (int i=0;i<n;i++){
    cin>>s[i];
  }
  ll ans=0;
  for (int i=0;i<n;i++){
    for (int j=0;j<m;j++){
        if (s[i][j]=='H'){
            for (int a=max(0LL,j-d);a<=j;a++){
                s[i][a]=='H';
            }
            for (int a=j;i<=min(m-1,j+d);a++){
                s[i][a]=='H';
            }
            for (int a=max(0LL,i-d);a <=i;a++){
                s[i][a]=='H';
            }
            for (int a=i;a <=min(n-1,i+d);a++){
                s[i][a]=='H';
            }

        }
    }
    for (int i=0;i<n;i++){
        for (int j=0;j<m;j++){
            if (s[i][j]=='H')ans++;
        }
    }
    cout<<ans<<endl;
  }


   
}

Submission Info

Submission Time
Task C - Humidifier 3
User jackofall
Language C++ 20 (gcc 12.2)
Score 0
Code Size 1150 Byte
Status WA
Exec Time 547 ms
Memory 4568 KB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:27:24: warning: value computed is not used [-Wunused-value]
   27 |                 s[i][a]=='H';
Main.cpp:30:24: warning: value computed is not used [-Wunused-value]
   30 |                 s[i][a]=='H';
Main.cpp:33:24: warning: value computed is not used [-Wunused-value]
   33 |                 s[i][a]=='H';
Main.cpp:36:24: warning: value computed is not used [-Wunused-value]
   36 |                 s[i][a]=='H';

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 350
Status
AC × 1
WA × 2
AC × 4
WA × 35
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, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt, 01_test_25.txt, 01_test_26.txt, 01_test_27.txt, 01_test_28.txt, 01_test_29.txt, 01_test_30.txt, 01_test_31.txt, 01_test_32.txt, 01_test_33.txt, 01_test_34.txt, 01_test_35.txt, 01_test_36.txt
Case Name Status Exec Time Memory
00_sample_01.txt WA 1 ms 3480 KB
00_sample_02.txt WA 1 ms 3500 KB
00_sample_03.txt AC 1 ms 3476 KB
01_test_01.txt WA 547 ms 4540 KB
01_test_02.txt WA 547 ms 4328 KB
01_test_03.txt WA 546 ms 4392 KB
01_test_04.txt WA 546 ms 4476 KB
01_test_05.txt WA 547 ms 4480 KB
01_test_06.txt WA 547 ms 4460 KB
01_test_07.txt WA 546 ms 4460 KB
01_test_08.txt WA 546 ms 4428 KB
01_test_09.txt WA 546 ms 4380 KB
01_test_10.txt WA 547 ms 4412 KB
01_test_11.txt WA 102 ms 3620 KB
01_test_12.txt WA 26 ms 3528 KB
01_test_13.txt WA 1 ms 3520 KB
01_test_14.txt WA 10 ms 3456 KB
01_test_15.txt WA 25 ms 3508 KB
01_test_16.txt WA 28 ms 3860 KB
01_test_17.txt WA 68 ms 3640 KB
01_test_18.txt WA 306 ms 4136 KB
01_test_19.txt WA 308 ms 4272 KB
01_test_20.txt WA 1 ms 3408 KB
01_test_21.txt WA 547 ms 4476 KB
01_test_22.txt WA 546 ms 4380 KB
01_test_23.txt WA 547 ms 4336 KB
01_test_24.txt WA 547 ms 4448 KB
01_test_25.txt WA 547 ms 4372 KB
01_test_26.txt WA 547 ms 4444 KB
01_test_27.txt WA 547 ms 4568 KB
01_test_28.txt WA 547 ms 4300 KB
01_test_29.txt AC 1 ms 3408 KB
01_test_30.txt AC 1 ms 3560 KB
01_test_31.txt WA 1 ms 3496 KB
01_test_32.txt AC 1 ms 3620 KB
01_test_33.txt WA 547 ms 4312 KB
01_test_34.txt WA 546 ms 4416 KB
01_test_35.txt WA 546 ms 4332 KB
01_test_36.txt WA 547 ms 4416 KB


2025-04-27 (Sun)
14:51:29 +00:00