Submission #19568399


Source Code Expand

Copy
import java.math.BigInteger;

public class Main {
    static int MOD = 998244353;

    public static void main(String[] args) throws Exception {
        var sc = new FastScanner();
        var pw = new FastPrintStream();
        solve(sc, pw);
        sc.close();
        pw.flush();
        pw.close();
    }

    public static void solve(FastScanner sc, FastPrintStream pw) {
        String s = sc.next();
        pw.println(s.replace("HAGIYA", "HAGIXILE"));
    }

    static long modpow(int N, int K) {
        return BigInteger.valueOf(N).modPow(BigInteger.valueOf(K), BigInteger.valueOf(MOD)).longValue();
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        if (a < b) {
            return gcd(b, a);
        }
        return gcd(b, a % b);
    }
}

class Point implements Comparable {
    long a;
    long b;

    public int compareTo(Object o) {
        Point p = (Point) o;
        if (this.a > p.a) {
            return 1;
        }
        if (this.a < p.a) {
            return -1;
        }
        return 0;
    }
}

class FastPrintStream implements AutoCloseable {
    private static final int BUF_SIZE = 1 << 15;
    private final byte[] buf = new byte[BUF_SIZE];
    private int ptr = 0;
    private final java.lang.reflect.Field strField;
    private final java.nio.charset.CharsetEncoder encoder;

    private java.io.OutputStream out;

    public FastPrintStream(java.io.OutputStream out) {
        this.out = out;
        java.lang.reflect.Field f;
        try {
            f = java.lang.String.class.getDeclaredField("value");
            f.setAccessible(true);
        } catch (NoSuchFieldException | SecurityException e) {
            f = null;
        }
        this.strField = f;
        this.encoder = java.nio.charset.StandardCharsets.US_ASCII.newEncoder();
    }

    public FastPrintStream(java.io.File file) throws java.io.IOException {
        this(new java.io.FileOutputStream(file));
    }

    public FastPrintStream(java.lang.String filename) throws java.io.IOException {
        this(new java.io.File(filename));
    }

    public FastPrintStream() {
        this(System.out);
        try {
            java.lang.reflect.Field f = java.io.PrintStream.class.getDeclaredField("autoFlush");
            f.setAccessible(true);
            f.set(System.out, false);
        } catch (IllegalAccessException | IllegalArgumentException | NoSuchFieldException e) {
            // ignore
        }
    }

    public FastPrintStream println() {
        if (ptr == BUF_SIZE)
            internalFlush();
        buf[ptr++] = (byte) '\n';
        return this;
    }

    public FastPrintStream println(java.lang.Object o) {
        return print(o).println();
    }

    public FastPrintStream println(java.lang.String s) {
        return print(s).println();
    }

    public FastPrintStream println(char[] s) {
        return print(s).println();
    }

    public FastPrintStream println(char c) {
        return print(c).println();
    }

    public FastPrintStream println(int x) {
        return print(x).println();
    }

    public FastPrintStream println(long x) {
        return print(x).println();
    }

    public FastPrintStream println(double d, int precision) {
        return print(d, precision).println();
    }

    private FastPrintStream print(byte[] bytes) {
        int n = bytes.length;
        if (ptr + n > BUF_SIZE) {
            internalFlush();
            try {
                out.write(bytes);
            } catch (java.io.IOException e) {
                throw new RuntimeException();
            }
        } else {
            System.arraycopy(bytes, 0, buf, ptr, n);
            ptr += n;
        }
        return this;
    }

    public FastPrintStream print(java.lang.Object o) {
        return print(o.toString());
    }

    public FastPrintStream print(java.lang.String s) {
        if (strField == null) {
            return print(s.getBytes());
        } else {
            try {
                return print((byte[]) strField.get(s));
            } catch (IllegalAccessException e) {
                return print(s.getBytes());
            }
        }
    }

    public FastPrintStream print(char[] s) {
        try {
            return print(encoder.encode(java.nio.CharBuffer.wrap(s)).array());
        } catch (java.nio.charset.CharacterCodingException e) {
            byte[] bytes = new byte[s.length];
            for (int i = 0; i < s.length; i++) {
                bytes[i] = (byte) s[i];
            }
            return print(bytes);
        }
    }

    public FastPrintStream print(char c) {
        if (ptr == BUF_SIZE)
            internalFlush();
        buf[ptr++] = (byte) c;
        return this;
    }

    public FastPrintStream print(int x) {
        if (x == 0) {
            if (ptr == BUF_SIZE)
                internalFlush();
            buf[ptr++] = '0';
            return this;
        }
        int d = len(x);
        if (ptr + d > BUF_SIZE)
            internalFlush();
        if (x < 0) {
            buf[ptr++] = '-';
            x = -x;
            d--;
        }
        int j = ptr += d;
        while (x > 0) {
            buf[--j] = (byte) ('0' + (x % 10));
            x /= 10;
        }
        return this;
    }

    public FastPrintStream print(long x) {
        if (x == 0) {
            if (ptr == BUF_SIZE)
                internalFlush();
            buf[ptr++] = '0';
            return this;
        }
        int d = len(x);
        if (ptr + d > BUF_SIZE)
            internalFlush();
        if (x < 0) {
            buf[ptr++] = '-';
            x = -x;
            d--;
        }
        int j = ptr += d;
        while (x > 0) {
            buf[--j] = (byte) ('0' + (x % 10));
            x /= 10;
        }
        return this;
    }

    public FastPrintStream print(double d, int precision) {
        if (d < 0) {
            print('-');
            d = -d;
        }
        d += Math.pow(10, -d) / 2;
        print((long) d).print('.');
        d -= (long) d;
        for (int i = 0; i < precision; i++) {
            d *= 10;
            print((int) d);
            d -= (int) d;
        }
        return this;
    }

    private void internalFlush() {
        try {
            out.write(buf, 0, ptr);
            ptr = 0;
        } catch (java.io.IOException e) {
            throw new RuntimeException(e);
        }
    }

    public void flush() {
        try {
            out.write(buf, 0, ptr);
            out.flush();
            ptr = 0;
        } catch (java.io.IOException e) {
            throw new RuntimeException(e);
        }
    }

    public void close() {
        try {
            out.close();
        } catch (java.io.IOException e) {
            throw new RuntimeException(e);
        }
    }

    private static int len(int x) {
        int d = 1;
        if (x >= 0) {
            d = 0;
            x = -x;
        }
        int p = -10;
        for (int i = 1; i < 10; i++, p *= 10)
            if (x > p)
                return i + d;
        return 10 + d;
    }

    private static int len(long x) {
        int d = 1;
        if (x >= 0) {
            d = 0;
            x = -x;
        }
        long p = -10;
        for (int i = 1; i < 19; i++, p *= 10)
            if (x > p)
                return i + d;
        return 19 + d;
    }
}

class FastScanner implements AutoCloseable {
    private final java.io.InputStream in;
    private final byte[] buf = new byte[2048];
    private int ptr = 0;
    private int buflen = 0;

    public FastScanner(java.io.InputStream in) {
        this.in = in;
    }

    public FastScanner() {
        this(System.in);
    }

    private boolean hasNextByte() {
        if (ptr < buflen)
            return true;
        ptr = 0;
        try {
            buflen = in.read(buf);
        } catch (java.io.IOException e) {
            throw new RuntimeException(e);
        }
        return buflen > 0;
    }

    private int readByte() {
        return hasNextByte() ? buf[ptr++] : -1;
    }

    public boolean hasNext() {
        while (hasNextByte() && !(32 < buf[ptr] && buf[ptr] < 127))
            ptr++;
        return hasNextByte();
    }

    private StringBuilder nextSequence() {
        if (!hasNext())
            throw new java.util.NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        for (int b = readByte(); 32 < b && b < 127; b = readByte()) {
            sb.appendCodePoint(b);
        }
        return sb;
    }

    public String next() {
        return nextSequence().toString();
    }

    public String next(int len) {
        return new String(nextChars(len));
    }

    public char nextChar() {
        if (!hasNextByte())
            throw new java.util.NoSuchElementException();
        return (char) readByte();
    }

    public char[] nextChars() {
        StringBuilder sb = nextSequence();
        int l = sb.length();
        char[] dst = new char[l];
        sb.getChars(0, l, dst, 0);
        return dst;
    }

    public char[] nextChars(int len) {
        if (!hasNext())
            throw new java.util.NoSuchElementException();
        char[] s = new char[len];
        int i = 0;
        int b = readByte();
        while (32 < b && b < 127 && i < len) {
            s[i++] = (char) b;
            b = readByte();
        }
        if (i != len) {
            throw new java.util.NoSuchElementException(
                    String.format("Next token has smaller length than expected.", len));
        }
        return s;
    }

    public long nextLong() {
        if (!hasNext())
            throw new java.util.NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b)
            throw new NumberFormatException();
        while (true) {
            if ('0' <= b && b <= '9') {
                n = n * 10 + b - '0';
            } else if (b == -1 || !(32 < b && b < 127)) {
                return minus ? -n : n;
            } else
                throw new NumberFormatException();
            b = readByte();
        }
    }

    public int nextInt() {
        return Math.toIntExact(nextLong());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    public void close() {
        try {
            in.close();
        } catch (java.io.IOException e) {
            throw new RuntimeException(e);
        }
    }
}

Submission Info

Submission Time
Task A - HAGIXILE
User goudezhao
Language Java (OpenJDK 11.0.6)
Score 20
Code Size 10973 Byte
Status AC
Exec Time 109 ms
Memory 34164 KB

Judge Result

Set Name All
Score / Max Score 20 / 20
Status
AC × 64
Set Name Test Cases
All 00_manual1.txt, 00_manual2.txt, 00_sample.txt, 00_small00.txt, 00_small01.txt, 00_small02.txt, 00_small03.txt, 00_small04.txt, 00_small05.txt, 00_small06.txt, 00_small07.txt, 00_small08.txt, 00_small09.txt, 00_small10.txt, 00_small11.txt, 00_small12.txt, 00_small13.txt, 00_small14.txt, 00_small15.txt, 00_small16.txt, 00_small17.txt, 00_small18.txt, 00_small19.txt, 00_small20.txt, 00_small21.txt, 00_small22.txt, 00_small23.txt, 00_small24.txt, 00_small25.txt, 00_small26.txt, 00_small27.txt, 00_small28.txt, 00_small29.txt, 01_large00.txt, 01_large01.txt, 01_large02.txt, 01_large03.txt, 01_large04.txt, 01_large05.txt, 01_large06.txt, 01_large07.txt, 01_large08.txt, 01_large09.txt, 01_large10.txt, 01_large11.txt, 01_large12.txt, 01_large13.txt, 01_large14.txt, 01_large15.txt, 01_large16.txt, 01_large17.txt, 01_large18.txt, 01_large19.txt, 01_large20.txt, 01_large21.txt, 01_large22.txt, 01_large23.txt, 01_large24.txt, 01_large25.txt, 01_large26.txt, 01_large27.txt, 01_large28.txt, 01_large29.txt, 03_manual00.txt
Case Name Status Exec Time Memory
00_manual1.txt AC 82 ms 33760 KB
00_manual2.txt AC 88 ms 33936 KB
00_sample.txt AC 82 ms 33672 KB
00_small00.txt AC 87 ms 33924 KB
00_small01.txt AC 91 ms 33992 KB
00_small02.txt AC 80 ms 33520 KB
00_small03.txt AC 94 ms 34028 KB
00_small04.txt AC 83 ms 33800 KB
00_small05.txt AC 78 ms 33740 KB
00_small06.txt AC 79 ms 33740 KB
00_small07.txt AC 88 ms 33896 KB
00_small08.txt AC 83 ms 33696 KB
00_small09.txt AC 89 ms 33692 KB
00_small10.txt AC 81 ms 33648 KB
00_small11.txt AC 86 ms 33832 KB
00_small12.txt AC 76 ms 33580 KB
00_small13.txt AC 85 ms 33828 KB
00_small14.txt AC 83 ms 33812 KB
00_small15.txt AC 109 ms 33616 KB
00_small16.txt AC 78 ms 33688 KB
00_small17.txt AC 84 ms 33732 KB
00_small18.txt AC 84 ms 33852 KB
00_small19.txt AC 89 ms 34020 KB
00_small20.txt AC 89 ms 33964 KB
00_small21.txt AC 87 ms 34072 KB
00_small22.txt AC 87 ms 33512 KB
00_small23.txt AC 88 ms 33968 KB
00_small24.txt AC 87 ms 33816 KB
00_small25.txt AC 88 ms 33684 KB
00_small26.txt AC 83 ms 33708 KB
00_small27.txt AC 89 ms 34028 KB
00_small28.txt AC 96 ms 33484 KB
00_small29.txt AC 79 ms 33772 KB
01_large00.txt AC 92 ms 33816 KB
01_large01.txt AC 88 ms 33864 KB
01_large02.txt AC 87 ms 34000 KB
01_large03.txt AC 89 ms 34164 KB
01_large04.txt AC 87 ms 33992 KB
01_large05.txt AC 82 ms 33612 KB
01_large06.txt AC 89 ms 34016 KB
01_large07.txt AC 87 ms 33928 KB
01_large08.txt AC 86 ms 33980 KB
01_large09.txt AC 87 ms 33960 KB
01_large10.txt AC 84 ms 33820 KB
01_large11.txt AC 87 ms 33940 KB
01_large12.txt AC 83 ms 33788 KB
01_large13.txt AC 81 ms 33748 KB
01_large14.txt AC 87 ms 33880 KB
01_large15.txt AC 89 ms 34016 KB
01_large16.txt AC 82 ms 33956 KB
01_large17.txt AC 84 ms 33736 KB
01_large18.txt AC 77 ms 33920 KB
01_large19.txt AC 78 ms 33664 KB
01_large20.txt AC 77 ms 33940 KB
01_large21.txt AC 86 ms 34016 KB
01_large22.txt AC 81 ms 33744 KB
01_large23.txt AC 90 ms 33928 KB
01_large24.txt AC 86 ms 33908 KB
01_large25.txt AC 87 ms 34072 KB
01_large26.txt AC 77 ms 33564 KB
01_large27.txt AC 85 ms 33952 KB
01_large28.txt AC 78 ms 33640 KB
01_large29.txt AC 80 ms 33596 KB
03_manual00.txt AC 77 ms 33536 KB