# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
981748 | 12345678 | Nafta (COI15_nafta) | C++17 | 1033 ms | 106904 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int nx=2005;
int n, m, mp[nx][nx], dp[nx][nx], mn[nx][nx], cnt[nx][nx], g[nx][nx], t, s[nx][nx],vs[nx][nx], dx[4]={0, 0, 1, -1}, dy[4]={1, -1, 0, 0}, ans[nx];
char ch;
queue<pair<int, int>> q;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>m;
for (int i=1; i<=n; i++) for (int j=1; j<=m; j++) cin>>ch, mp[i][j]=(ch=='.')?-1:ch-'0';
for (int i=1; i<=n; i++)
{
for (int j=1; j<=m; j++)
{
if (vs[i][j]||mp[i][j]==-1) continue;
q.push({i, j});
vs[i][j]=1;
int k=INT_MAX, sm=0;
vector<pair<int, int>> v;
while (!q.empty())
{
v.push_back(q.front());
auto [x, y]=q.front();
q.pop();
k=min(k, y);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |