第2回早稲田大学プログラミングコンテスト

Submission #3898249

Source codeソースコード

// La Lune
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e2 + 5;
char s[N];
int dp[N];
int main(){
	int n;
	gets(s);
	scanf("%d\n%s", &n, s + 1);
	for(int i = 1; i <= n; i ++){
		if(i > 1) dp[i] = dp[i - 1];
		if(i > 2) dp[i] = min(dp[i], dp[i - 2]);
		if(i > 3) dp[i] = min(dp[i], dp[i - 3]);
		if(s[i] == 'X') dp[i] ++;
	}
	scanf("%s", s);
	printf("<pre class=\"prettyprint linenums\">\n%d\n</pre>", dp[n]);
	return 0;
}

Submission

Task問題 B - 雨上がり
User nameユーザ名 luogu_bot3
Created time投稿日時
Language言語 C++ (GCC 5.4.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 508 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:12:2: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations]
gets(s);
^
In file included from /usr/include/c++/5/cstdio:42:0,
from ./Main.cpp:2:
/usr/include/stdio.h:638:14: note: declared here
extern char *gets (char *__s) __wur __attribute_deprecated__;
^
./Main.cpp:12:2: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations]
gets(s);
^
In file included from /usr/include/c++/5/cstdio:42:0,
from ./Main.cpp:2:
/usr/include/stdio.h:638:14: note: declared here
extern char *gets (char *__s) __wur __attribute_deprecated__;
^
./Main.cpp:12:8: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations]
gets(s);
^
In file included from /usr/include/c++/5/cstdio:42:0,
from ./Main.cpp:2:
/usr/include/stdio.h:638:14: note: declared here
extern char *gets (char *__s) __wur __attribute_deprecated__;
^
./Main.cpp:12:...

Test case

Set

Set name Score得点 / Max score Cases
All 0 / 50 case_000.txt,case_001.txt,case_002.txt,case_003.txt,case_004.txt,case_005.txt,case_006.txt,case_007.txt,case_008.txt,case_009.txt,case_010.txt,case_011.txt,case_012.txt,case_013.txt,case_014.txt,case_015.txt,case_016.txt,case_017.txt,case_018.txt,case_019.txt,case_020.txt,case_021.txt,case_022.txt,case_023.txt,case_024.txt,case_025.txt,case_026.txt,case_027.txt,case_028.txt,case_029.txt,case_030.txt,case_031.txt,case_032.txt,case_033.txt,case_034.txt,case_035.txt,case_036.txt,case_037.txt,case_038.txt,case_039.txt,case_040.txt,case_041.txt,case_042.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
case_000.txt WA
case_001.txt WA
case_002.txt WA
case_003.txt WA
case_004.txt WA
case_005.txt WA
case_006.txt WA
case_007.txt WA
case_008.txt WA
case_009.txt WA
case_010.txt WA
case_011.txt WA
case_012.txt WA
case_013.txt WA
case_014.txt WA
case_015.txt WA
case_016.txt WA
case_017.txt WA
case_018.txt WA
case_019.txt WA
case_020.txt WA
case_021.txt WA
case_022.txt WA
case_023.txt WA
case_024.txt WA
case_025.txt WA
case_026.txt WA
case_027.txt WA
case_028.txt WA
case_029.txt WA
case_030.txt WA
case_031.txt WA
case_032.txt WA
case_033.txt WA
case_034.txt WA
case_035.txt WA
case_036.txt WA
case_037.txt WA
case_038.txt WA
case_039.txt WA
case_040.txt WA
case_041.txt WA
case_042.txt WA