답안 #218074

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
218074 2020-04-01T04:35:50 Z KoalaMuch Bitaro the Brave (JOI19_ho_t1) C++14
100 / 100
125 ms 44408 KB
#include<bits/stdc++.h>
using namespace std;
const int N = 3005;
int dp[N][N];
char s[N];
int main()
{
    int n,m;
    long long ans = 0;
    scanf("%d %d",&n,&m);
    for(int i=1;i<=n;i++)
    {
        scanf(" %s",s+1);
        int O = 0;
        for(int j=m;j>=1;j--)
        {
            dp[i][j] = dp[i-1][j];
            if(s[j]=='J')   dp[i][j]+=O;
            else if(s[j]=='O')  ++O;
            else            ans+=dp[i-1][j];
        }
    }
    printf("%lld\n",ans);
    return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&n,&m);
     ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf(" %s",s+1);
         ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 768 KB Output is correct
6 Correct 5 ms 768 KB Output is correct
7 Correct 5 ms 768 KB Output is correct
8 Correct 5 ms 768 KB Output is correct
9 Correct 5 ms 768 KB Output is correct
10 Correct 5 ms 768 KB Output is correct
11 Correct 5 ms 768 KB Output is correct
12 Correct 5 ms 768 KB Output is correct
13 Correct 5 ms 768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 768 KB Output is correct
6 Correct 5 ms 768 KB Output is correct
7 Correct 5 ms 768 KB Output is correct
8 Correct 5 ms 768 KB Output is correct
9 Correct 5 ms 768 KB Output is correct
10 Correct 5 ms 768 KB Output is correct
11 Correct 5 ms 768 KB Output is correct
12 Correct 5 ms 768 KB Output is correct
13 Correct 5 ms 768 KB Output is correct
14 Correct 8 ms 3328 KB Output is correct
15 Correct 5 ms 2048 KB Output is correct
16 Correct 6 ms 2048 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 10 ms 3584 KB Output is correct
19 Correct 7 ms 3456 KB Output is correct
20 Correct 7 ms 3456 KB Output is correct
21 Correct 9 ms 3584 KB Output is correct
22 Correct 7 ms 3456 KB Output is correct
23 Correct 9 ms 3456 KB Output is correct
24 Correct 9 ms 3584 KB Output is correct
25 Correct 7 ms 3456 KB Output is correct
26 Correct 7 ms 3456 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 384 KB Output is correct
5 Correct 5 ms 768 KB Output is correct
6 Correct 5 ms 768 KB Output is correct
7 Correct 5 ms 768 KB Output is correct
8 Correct 5 ms 768 KB Output is correct
9 Correct 5 ms 768 KB Output is correct
10 Correct 5 ms 768 KB Output is correct
11 Correct 5 ms 768 KB Output is correct
12 Correct 5 ms 768 KB Output is correct
13 Correct 5 ms 768 KB Output is correct
14 Correct 8 ms 3328 KB Output is correct
15 Correct 5 ms 2048 KB Output is correct
16 Correct 6 ms 2048 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 10 ms 3584 KB Output is correct
19 Correct 7 ms 3456 KB Output is correct
20 Correct 7 ms 3456 KB Output is correct
21 Correct 9 ms 3584 KB Output is correct
22 Correct 7 ms 3456 KB Output is correct
23 Correct 9 ms 3456 KB Output is correct
24 Correct 9 ms 3584 KB Output is correct
25 Correct 7 ms 3456 KB Output is correct
26 Correct 7 ms 3456 KB Output is correct
27 Correct 125 ms 43896 KB Output is correct
28 Correct 10 ms 9856 KB Output is correct
29 Correct 9 ms 3968 KB Output is correct
30 Correct 5 ms 512 KB Output is correct
31 Correct 89 ms 35832 KB Output is correct
32 Correct 77 ms 44280 KB Output is correct
33 Correct 69 ms 44280 KB Output is correct
34 Correct 105 ms 41456 KB Output is correct
35 Correct 78 ms 44408 KB Output is correct
36 Correct 68 ms 44280 KB Output is correct
37 Correct 121 ms 44408 KB Output is correct
38 Correct 59 ms 35832 KB Output is correct
39 Correct 56 ms 35860 KB Output is correct