Olympic Contest 2024

Lưu ý

  • Các bạn hãy đọc toàn bộ vấn đề, sau đó chọn ra từng vấn đề dễ nhất để giải quyết, vì các vấn đề được xáo trộn độ khó để kiểm tra khả năng nhìn nhận vấn đề của các bạn.
  • Những team có thành viên có khả năng đọc tiếng Anh, vui lòng hãy chuyển ngôn ngữ từ Vietnamese thành English ở góc phải trên!
  • Để nộp các vấn đề các bạn nên sử dụng bộ đọc nhanh của từng ngôn ngữ riêng Python hãy dùng trình chấm Pypy3
  • Dưới đây là code kèm bộ đọc nhanh của ~2~ ngôn ngữ C++ và Java cho bài A plus B

C++

#include <bits/stdc++.h>
using namespace std; 
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);  

    // Your code
    long long u, v; 
    cin >> u >> v; 
    cout << u + v << "\n";

    return 0 ^ 0;
}

Java

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        // Your code
        long a = sc.nextLong();
        long b = sc.nextLong();
        System.out.println(a + b);
    }

    /*
     * Don't see below
     */

    static Reader sc = new Reader();
    static StringBuilder sb = new StringBuilder();
    static Random rd = new Random();

    static class Reader {
        private int BUFFER_SIZE = 1 << 16;
        private byte[] buffer = new byte[BUFFER_SIZE];
        private int bufferPointer = 0, bytesRead = 0;
        private InputStream rd;

        public Reader() {
            this.rd = System.in;
        }

        private byte read() {
            if (bufferPointer == bytesRead) {
                bufferPointer = 0;
                try {
                    bytesRead = rd.read(buffer, bufferPointer, BUFFER_SIZE);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (bytesRead == -1) {
                    return -1;
                }
            }
            return buffer[bufferPointer++];
        }

        public int nextInt() {
            int number = 0;
            int c = read();
            while (c <= ' ') {
                c = read();
            }
            boolean negative = (c == '-');
            if (negative) {
                c = read();
            }
            do {
                number = number * 10 + (c - '0');
                c = read();
            } while (c >= '0' && c <= '9');
            return negative ? -number : number;
        }

        public long nextLong() {
            long number = 0L;
            int c = read();
            while (c <= ' ') {
                c = read();
            }
            boolean negative = (c == '-');
            if (negative) {
                c = read();
            }
            do {
                number = number * 10 + (c - '0');
                c = read();
            } while (c >= '0' && c <= '9');
            return negative ? -number : number;
        }

        public String next() {
            int c = read();
            while (c <= ' ') {
                c = read();
            }
            StringBuilder t = new StringBuilder();
            do {
                t.append((char) c);
                c = read();
            } while (c > ' ');
            return t.toString();
        }

        public String nextLine() {
            int c = read();
            while (c == '\n' || c == '\r') {
                c = read();
            }
            StringBuilder t = new StringBuilder();
            while (c != '\n' && c != '\r' && c != -1) {
                t.append((char) c);
                c = read();
            }
            return t.toString();
        }

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

        public char nextChar() {
            int c = read();
            while (c <= ' ') {
                c = read();
            }
            return (char) c;
        }
    }
}

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.