https://mirror.codeforces.com/contest/279/problem/B
may anyone tell me what is the problem with logic
https://mirror.codeforces.com/contest/279/submission/88946134
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 146 |
| 3 | Proof_by_QED | 146 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 141 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
https://mirror.codeforces.com/contest/279/problem/B
may anyone tell me what is the problem with logic
https://mirror.codeforces.com/contest/279/submission/88946134
https://mirror.codeforces.com/contest/116/problem/B
may anyone please tell me whats wrong with this code not able to input the string array ?
using namespace std; typedef long long ll;
int main() { int n, m; string c[12][13]; cin>>n>>m;
for (int i = 1; i <= n; ++i)
{
cin>>c[i][1];
}
/*
skip
cout<<"the displayed value"<<endl;
for(int i=1;i<=n;i++)
cout<<c[i][1]<<endl;
*/
int eaten = 0;
for (int i = 1; i <= n; ++i)
{
for (int j = 1; j <= m; ++j)
{
if (c[i][j] == "W")
{
if (c[i-1][j] == "P" || c[i+1][j] == "P" || c[i][j-1] == "P" || c[i][j+1] == "P")
{
eaten += 1;
}
}
}
}
cout<<eaten<<endl;
return 0;}
| Название |
|---|


