Submission #4046708


Source Code Expand

#include<iostream>
using namespace std;

int f[105],n;
string a;

inline mn(int x,int y)
{
	if (x<y) return x;
	else return y; 
}

int main()
{
	cin>>n;
	cin>>a;
	f[0]=(a[0]=='X');
	f[1]=(a[1]=='X');
	f[2]=(a[2]=='X');
	for (int i=3;i<n;i++)
	f[i]=(a[i]=='X')+mn(f[i-3],mn(f[i-2],f[i-1]));
	cout<<f[n-1];
	return 0;
}

Submission Info

Submission Time
Task B - 雨上がり
User luogu_bot2
Language C++ (GCC 5.4.1)
Score 0
Code Size 340 Byte
Status CE

Compile Error

./Main.cpp:7:22: error: ISO C++ forbids declaration of ‘mn’ with no type [-fpermissive]
 inline mn(int x,int y)
                      ^