Submission #27995320
Source Code Expand
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("unroll-loops")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)
template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
#define rprintf(fmt, begin, end) do { const auto end_rp = (end); auto it_rp = (begin); for (bool sp_rp=0; it_rp!=end_rp; ++it_rp) { if (sp_rp) putchar(' '); else sp_rp = true; printf(fmt, *it_rp); } putchar('\n'); } while(0)
int H, W;
char C[111][111];
int D[111][111];
void MAIN() {
scanf("%d%d", &H, &W);
REP (i, H) scanf("%s", C[i]);
memset(D, 0xc0, sizeof D);
D[0][0] = 1;
int ans = 1;
REP (i, H) REP (j, W) if (C[i][j] == '.') {
if (i) amax(D[i][j], D[i-1][j]+1);
if (j) amax(D[i][j], D[i][j-1]+1);
amax(ans, D[i][j]);
}
printf("%d\n", ans);
}
int main() {
int TC = 1;
// scanf("%d", &TC);
REP (tc, TC) MAIN();
return 0;
}
Submission Info
| Submission Time |
|
| Task |
D - Weak Takahashi |
| User |
natsugiri |
| Language |
C++ (GCC 9.2.1) |
| Score |
400 |
| Code Size |
1457 Byte |
| Status |
AC |
| Exec Time |
5 ms |
| Memory |
3876 KiB |
Compile Error
./Main.cpp: In function ‘void MAIN()’:
./Main.cpp:36:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
36 | scanf("%d%d", &H, &W);
| ~~~~~^~~~~~~~~~~~~~~~
./Main.cpp:37:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
37 | REP (i, H) scanf("%s", C[i]);
| ~~~~~^~~~~~~~~~~~
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
400 / 400 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
example_00.txt, example_01.txt, example_02.txt |
| All |
example_00.txt, example_01.txt, example_02.txt, handmade.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt |
| Case Name |
Status |
Exec Time |
Memory |
| example_00.txt |
AC |
5 ms |
3772 KiB |
| example_01.txt |
AC |
2 ms |
3768 KiB |
| example_02.txt |
AC |
2 ms |
3776 KiB |
| handmade.txt |
AC |
3 ms |
3688 KiB |
| test_00.txt |
AC |
2 ms |
3780 KiB |
| test_01.txt |
AC |
2 ms |
3776 KiB |
| test_02.txt |
AC |
2 ms |
3876 KiB |
| test_03.txt |
AC |
3 ms |
3816 KiB |
| test_04.txt |
AC |
2 ms |
3820 KiB |
| test_05.txt |
AC |
2 ms |
3776 KiB |
| test_06.txt |
AC |
2 ms |
3636 KiB |
| test_07.txt |
AC |
2 ms |
3740 KiB |
| test_08.txt |
AC |
3 ms |
3684 KiB |
| test_09.txt |
AC |
2 ms |
3660 KiB |
| test_10.txt |
AC |
2 ms |
3772 KiB |
| test_11.txt |
AC |
2 ms |
3684 KiB |
| test_12.txt |
AC |
2 ms |
3776 KiB |
| test_13.txt |
AC |
4 ms |
3776 KiB |
| test_14.txt |
AC |
2 ms |
3660 KiB |
| test_15.txt |
AC |
2 ms |
3744 KiB |