Submission #16676


ソースコード

1
2
3
4
5
s[3][51];char c[51];n,m;j;M,t;main(i){
for(scanf("%d%d\n",&n,&m);gets(c);i++)for(j=0;j<m;j<3?s[j][i]+=s[j][i-1]:0,j++)s[(c[j]==66)+2*(c[j]==82)][i]++;
for(;--i;)for(j=i;++j<n;M=M<t?t:M)t=s[0][i]+s[1][j]-s[1][i]+s[2][n]-s[2][j];
printf("%d\n",n*m-M);
}

ステータス

項目 データ
問題 0259 - ロシアの旗 (Russian Flag)
ユーザー名 kotatsugame
投稿日時 2017-05-04 23:19:56
言語 C
状態 Accepted
得点 5
ソースコード長 258 Byte
最大実行時間 24 ms
最大メモリ使用量 552 KB

セット

セット 得点 Cases
1 INPUT1 1 / 1 *in1.txt
2 INPUT2 1 / 1 *in2.txt
3 INPUT3 1 / 1 *in3.txt
4 INPUT4 1 / 1 *in4.txt
5 INPUT5 1 / 1 *in5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2016-yo-t3-in1.txt AC 16 ms 380 KB
1
2016-yo-t3-in2.txt AC 24 ms 552 KB
2
2016-yo-t3-in3.txt AC 19 ms 392 KB
3
2016-yo-t3-in4.txt AC 16 ms 432 KB
4
2016-yo-t3-in5.txt AC 12 ms 268 KB
5
2016-yo-t3-in_s1.txt AC 19 ms 292 KB
2016-yo-t3-in_s2.txt AC 12 ms 352 KB