Submission #371291


Source Code Expand

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		String s = in.nextLine();
		String ss[] = s.split(" ");
		String not = "not";
		for (int i = 0; i < ss.length; i++) {
			if (!not.equals(ss[i])) {
				s = s.replaceAll(not + " " + not + " " + ss[i], ss[i]);
			}
		}
		out.println(s);
		out.flush();
	}

	static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public InputReader(String input) {
			this.stream = new ByteArrayInputStream(input.getBytes());
		}

		public int next() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = next();
			while (isSpaceChar(c))
				c = next();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = next();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = next();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = next();
			while (isSpaceChar(c))
				c = next();
			long sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = next();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = next();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}

Submission Info

Submission Time
Task A - 二重否定除去法則
User hoshi524
Language Java (OpenJDK 1.7.0)
Score 0
Code Size 2395 Byte
Status WA
Exec Time 498 ms
Memory 27796 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 16
WA × 3
Set Name Test Cases
All 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
Case Name Status Exec Time Memory
scrambled_00.txt AC 373 ms 23948 KB
scrambled_01.txt AC 380 ms 23924 KB
scrambled_02.txt AC 380 ms 23928 KB
scrambled_03.txt AC 384 ms 23948 KB
scrambled_04.txt AC 386 ms 24016 KB
scrambled_05.txt WA 443 ms 26328 KB
scrambled_06.txt AC 448 ms 26248 KB
scrambled_07.txt WA 442 ms 26252 KB
scrambled_08.txt WA 463 ms 26540 KB
scrambled_09.txt AC 455 ms 26708 KB
scrambled_10.txt AC 479 ms 27548 KB
scrambled_11.txt AC 479 ms 27120 KB
scrambled_12.txt AC 491 ms 27148 KB
scrambled_13.txt AC 495 ms 27796 KB
scrambled_14.txt AC 488 ms 27656 KB
scrambled_15.txt AC 485 ms 27492 KB
scrambled_16.txt AC 497 ms 27532 KB
scrambled_17.txt AC 498 ms 27300 KB
scrambled_18.txt AC 492 ms 27588 KB