# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
570626 | Hanksburger | Dango Maker (JOI18_dango_maker) | C++17 | 312 ms | 35908 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
bool b[3005][3005], c[3005][3005];
char a[3005][3005];
vector<int> v, w;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m, ans=0;
cin >> n >> m;
for (int i=0; i<n; i++)
for (int j=0; j<m; j++)
cin >> a[i][j];
for (int i=0; i<n; i++)
{
for (int j=0; j<m; j++)
{
if (a[i][j]=='R' && a[i+1][j]=='G' && a[i+2][j]=='W')
b[i][j]=1;
if (a[i][j]=='R' && a[i][j+1]=='G' && a[i][j+2]=='W')
c[i][j]=1;
}
}
for (int i=0; i<=n+m-2; i++)
{
for (int j=max(0, i-m+1); j<=min(n-1, i); j++)
{
if (b[j][i-j])
v.push_back(j*2+5);
if (c[j][i-j])
v.push_back(j*2);
}
for (int j=0; j<v.size(); j++)
{
auto itr=upper_bound(w.begin(), w.end(), v[j]);
if (itr==w.end())
w.push_back(v[j]);
else
*itr=v[j];
}
ans+=w.size();
v.clear();
w.clear();
}
cout << ans;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |