東京大学プログラミングコンテスト2014

Submission #3771664

Source codeソースコード

#include <iostream>
#include <cstring>
#include <cstring>
using namespace std;
char c[100001];
int main()
{
	cin.getline(c,100001);
	int len=strlen(c),shu=0;;
	for(int i=-1;i<len;i++)
	{
		if(c[i]==' '||i==-1)
		{
			if(c[i+1]=='n'&&c[i+2]=='o'&&c[i+3]=='t') shu++;
		}
	}
	if(shu%2==1) 
	{
		for(int i=0;i<len;i++)
		{
			cout<<c[i];
		}
		cout<<endl;
	}
	else
	{
		for(int i=0;i<len;i++)
		{
			if(c[i]==' ')
			{	
				if(c[i+1]=='n'&&c[i+2]=='o'&&c[i+3]=='t'&&c[i+4]==' ')
				{
					c[i]='?';c[i+1]='?';c[i+2]='?';c[i+3]='?';
				}
			}
			if(i==0)
			{
				if(c[i]=='n'&&c[i+1]=='o'&&c[i+2]=='t'&&c[i+3]==' ')
				{
					c[i]='?';c[i+1]='?';c[i+2]='?';
				}
			}
		}
		int cnt=0;
		for(int i=0;i<len;i++)
		{
			if(c[i]=='?') continue;
			if(c[i]==' '&&cnt==0) continue;
			if(c[i]==' '&&c[i+1]==' ') continue;
			if(c[i]==' ') cnt++;
			cout<<c[i];
		}
	}
	return 0;
}

Submission

Task問題 A - 二重否定除去法則
User nameユーザ名 luogu_bot2
Created time投稿日時
Language言語 C++ (GCC 5.4.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 929 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
All 0 / 100 scrambled_00.txt,scrambled_01.txt,scrambled_02.txt,scrambled_03.txt,scrambled_04.txt,scrambled_05.txt,scrambled_06.txt,scrambled_07.txt,scrambled_08.txt,scrambled_09.txt,scrambled_10.txt,scrambled_11.txt,scrambled_12.txt,scrambled_13.txt,scrambled_14.txt,scrambled_15.txt,scrambled_16.txt,scrambled_17.txt,scrambled_18.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
scrambled_00.txt WA
scrambled_01.txt WA
scrambled_02.txt AC 1 ms 256 KB
scrambled_03.txt WA
scrambled_04.txt WA
scrambled_05.txt WA
scrambled_06.txt AC 1 ms 256 KB
scrambled_07.txt WA
scrambled_08.txt WA
scrambled_09.txt WA
scrambled_10.txt WA
scrambled_11.txt WA
scrambled_12.txt WA
scrambled_13.txt WA
scrambled_14.txt WA
scrambled_15.txt WA
scrambled_16.txt WA
scrambled_17.txt WA
scrambled_18.txt WA