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

Submission #6138133

Source codeソースコード

#include <bits/stdc++.h>
using namespace std;


const int N = 5005;
int n,last;
string str,s[N];
bool vis[N];

int main()
{
	while(cin >> str) s[++n] = str;
	str = "not";
	for(register int i = n - 2;i >= 1;i --)
	{
		last = i+2;	while(vis[last] && last <= n) last ++;
		if(s[i] == str && s[i+1] == str && s[last] != str)
		{
			vis[i] = vis[i+1] = 1;
		}
	}
	while(vis[n]) n--;
	for(register int i = 1;i <= n;i ++)
	{
		if(vis[i]) continue;
		if(i == n) cout << s[i] << endl;
		else cout << s[i] << ' ';
	}
	return 0;
}

Submission

Task問題 A - 二重否定除去法則
User nameユーザ名 luogu_bot3
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 548 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 AC 1 ms 256 KB
scrambled_01.txt AC 1 ms 256 KB
scrambled_02.txt AC 1 ms 256 KB
scrambled_03.txt WA
scrambled_04.txt WA
scrambled_05.txt WA
scrambled_06.txt AC 2 ms 384 KB
scrambled_07.txt AC 2 ms 384 KB
scrambled_08.txt WA
scrambled_09.txt AC 1 ms 256 KB
scrambled_10.txt AC 1 ms 256 KB
scrambled_11.txt AC 2 ms 256 KB
scrambled_12.txt AC 2 ms 256 KB
scrambled_13.txt AC 2 ms 256 KB
scrambled_14.txt WA
scrambled_15.txt AC 2 ms 256 KB
scrambled_16.txt AC 2 ms 384 KB
scrambled_17.txt AC 2 ms 256 KB
scrambled_18.txt AC 2 ms 256 KB