A cộng B

View as PDF

Submit solution


Points: 0.01 (partial)
Time limit: 1.0s
Memory limit: 512M
Input: stdin
Output: stdout

Problem source:
Just to test
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

Cho ~2~ số nguyên ~A~ và ~B~. Hãy tính ~A + B~.

Input

Gồm ~1~ dòng chứa ~2~ số nguyên ~A~ và ~B~ ~(1 \le A, B \le 1000)~, cách bởi ~1~ dấu cách.

Output

Ghi ra tổng ~A + B~.

Sample Input

3 4

Sample Output

7

Note

Gợi ý: Sử dụng toán tử "+".


Comments

Please read the guidelines before commenting.



  • -1
    dohoangduc  commented on June 4, 2026, 1:24 p.m. edit 19

    This is the easiest way to solve this problem:

    #include<any>

    #include<array>

    #include<atomic>

    #include<algorithm>

    #include<bit>

    #include<bitset>

    #include<barrier>

    #include<ctime>

    #include<cmath>

    #include<cfenv>

    #include<cctype>

    #include<cfloat>

    #include<cerrno>

    #include<cwchar>

    #include<cstdio>

    #include<chrono>

    #include<complex>

    #include<csignal>

    #include<compare>

    #include<climits>

    #include<cstdint>

    #include<cstddef>

    #include<csetjmp>

    #include<clocale>

    #include<cstdlib>

    #include<cassert>

    #include<cstring>

    #include<cwctype>

    #include<cstdarg>

    #include<charconv>

    #include<concepts>

    #include<cinttypes>

    #include<condition_variable>

    #include<deque>

    #include<expected>

    #include<exception>

    #include<execution>

    #include<format>

    #include<future>

    #include<fstream>

    #include<filesystem>

    #include<functional>

    #include<forward_list>

    #include<ios>

    #include<iosfwd>

    #include<istream>

    #include<iomanip>

    #include<iostream>

    #include<iterator>

    #include<initializer_list>

    #include<list>

    #include<latch>

    #include<limits>

    #include<map>

    #include<mutex>

    #include<memory>

    #include<memory_resource>

    #include<numeric>

    #include<numbers>

    #include<ostream>

    #include<optional>

    #include<queue>

    #include<regex>

    #include<ratio>

    #include<ranges>

    #include<random>

    #include<set>

    #include<span>

    #include<stack>

    #include<string>

    #include<sstream>

    #include<stdfloat>

    #include<strstream>

    #include<streambuf>

    #include<semaphore>

    #include<stdexcept>

    #include<spanstream>

    #include<stacktrace>

    #include<stop_token>

    #include<string_view>

    #include<shared_mutex>

    #include<system_error>

    #include<source_location>

    #include<tuple>

    #include<thread>

    #include<typeinfo>

    #include<typeindex>

    #include<type_traits>

    #include<utility>

    #include<unordered_set>

    #include<unordered_map>

    #include<vector>

    #include<variant>

    #include<valarray>

    using namespace std;

    int a,b;

    int main(){

    iosbase::syncwith_stdio(false);

    cin.tie(nullptr);

    cin >> a >> b;

    cout << a + b;

    return 0;

    }


  • -3
    dohoangduc  commented on June 4, 2026, 12:39 p.m.

    Please! I need upvotes! My mom is kind of homeless!


  • -3
    YM_YD_Vucongdat  commented on April 21, 2026, 8:07 a.m.

    Bài A + B làm thế này

    Sử dụng toán tử +

    Kết quả sẽ là A + B

    Thế là xong bài


  • -5
    k32chanhung  commented on April 14, 2026, 1:57 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -4
    k32quangduong  commented on April 13, 2026, 4:09 a.m.

    may thg ao tuong a+b ma lam cai j a ham j tuong minh hay


  • -3
    ToniKroos  commented on April 9, 2026, 11:15 a.m.

    Dùng python mà đánh 2 dòng là HDPE ý, c++ phức tạp hơn nhưng điểm chung là đều dễ vs beginners


  • -4
    longvn2013  commented on April 6, 2026, 7:39 a.m.

    include <bits/stdc++.h>

    using namespace std;

    int main() { double A,B; cin>>A>>B; cout<<A+B;

    return 0; }


  • -4
    mickey21082013  commented on March 15, 2026, 7:41 a.m.

    include <bits/stdc++.h>

    using namespace std; int main() { int a, b; cin >> a >> b; cout << a+b; }


  • -7
    k31ngiahuy  commented on March 6, 2026, 3:29 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -7
    k31ngiahuy  commented on March 6, 2026, 3:29 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -7
    k31ngiahuy  commented on March 6, 2026, 1:57 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    k31ngiahuy  commented on March 6, 2026, 1:50 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    k31ngiahuy  commented on March 6, 2026, 1:48 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -9
    k31ngiahuy  commented on March 6, 2026, 1:48 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    k31ngiahuy  commented on March 6, 2026, 1:47 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -1
    k31_huudinh  commented on March 6, 2026, 1:40 a.m. edited

    helo


  • -1
    k31_huudinh  commented on March 6, 2026, 1:40 a.m. edited

    hi


  • -1
    k31_huudinh  commented on March 6, 2026, 1:40 a.m. edited

    hihi


  • -7
    K31huynhphucdat  commented on March 3, 2026, 8:27 a.m. edit 6

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -7
    K31huynhphucdat  commented on March 3, 2026, 8:26 a.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -7
    K31huynhphucdat  commented on March 3, 2026, 8:26 a.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -1
    HieuTrong  commented on Feb. 1, 2026, 9:56 a.m.

    Bài này rất phù hợp người mới bắt đầu


  • -1
    tien_phat  commented on Jan. 27, 2026, 1:34 a.m.

    chi minh lam bai nay voi


  • -1
    Dangcoder  commented on Dec. 30, 2025, 7:31 a.m. edited

    Bài rất phù hợp cho người mới học c++. Code: my reply


    • -1
      Dangcoder  commented on Dec. 31, 2025, 2:15 a.m.

      Code này mới đúng:

      /*
      '########:::::'###::::'##::: ##::'######::::'######:::'#######::'########::'########:'########::
       ##.... ##:::'## ##::: ###:: ##:'##... ##::'##... ##:'##.... ##: ##.... ##: ##.....:: ##.... ##:
       ##:::: ##::'##:. ##:: ####: ##: ##:::..::: ##:::..:: ##:::: ##: ##:::: ##: ##::::::: ##:::: ##:
       ##:::: ##:'##:::. ##: ## ## ##: ##::'####: ##::::::: ##:::: ##: ##:::: ##: ######::: ########::
       ##:::: ##: #########: ##. ####: ##::: ##:: ##::::::: ##:::: ##: ##:::: ##: ##...:::: ##.. ##:::
       ##:::: ##: ##.... ##: ##:. ###: ##::: ##:: ##::: ##: ##:::: ##: ##:::: ##: ##::::::: ##::. ##::
       ########:: ##:::: ##: ##::. ##:. ######:::. ######::. #######:: ########:: ########: ##:::. ##:
      ........:::..:::::..::..::::..:::......:::::......::::.......:::........:::........::..:::::..::
      */
      #include <bits/stdc++.h>
      using namespace std;
      typedef long long ll;
      
      void print_ll(ll x)
      {
          if(x < 0)
          {
              putchar('-');
              x = -x;
          }
          if(x >= 10)
              print_ll(x / 10);
          putchar(char('0' + (x % 10)));
      }
      
      ll add_bit(ll x, ll y)
      {
          while(y)
          {
              ll c = x & y;
              x = x ^ y;
              y = c << 1;
          }
          return x;
      }
      
      struct DSU
      {
          vector<int> p, r;
          DSU(int n)
          {
              p.resize(n);
              r.assign(n, 0);
              for(int i = 0; i < n; i++)
                  p[i] = i;
          }
          int find(int x)
          {
              while(p[x] != x)
                  x = p[x];
              return x;
          }
          void unite(int a, int b)
          {
              a = find(a);
              b = find(b);
              if(a != b)
              {
                  if(r[a] < r[b]) swap(a, b);
                  p[b] = a;
                  if(r[a] == r[b]) r[a]++;
              }
          }
      };
      
      struct Fenwick
      {
          int n;
          vector<int> bit;
          Fenwick(int n):n(n),bit(n+1,0){}
          void add(int i)
          {
              for(++i;i<=n;i+=i&-i)
                  bit[i] = add_bit(bit[i],1);
          }
          int sum(int i)
          {
              int s = 0;
              for(++i;i>0;i-=i&-i)
                  s = add_bit(s,bit[i]);
              return s;
          }
      };
      
      int bfs_count(int s, vector<vector<int>>& g)
      {
          int n = g.size();
          vector<int> vis(n,0);
          queue<int> q;
          q.push(s);
          vis[s] = 1;
          int cnt = 0;
          while(!q.empty())
          {
              int u = q.front();
              q.pop();
              cnt = add_bit(cnt,1);
              for(int v:g[u])
                  if(!vis[v])
                  {
                      vis[v]=1;
                      q.push(v);
                  }
          }
          return cnt;
      }
      
      void dijkstra_dummy(int n)
      {
          vector<vector<pair<int,int>>> g(n);
          vector<ll> d(n,LLONG_MAX);
          priority_queue<pair<ll,int>,vector<pair<ll,int>>,greater<pair<ll,int>>> pq;
          d[0]=0;
          pq.push({0,0});
          while(!pq.empty())
          {
              auto t=pq.top();
              pq.pop();
              if(t.first!=d[t.second]) continue;
              for(auto e:g[t.second])
                  if(d[e.first]>d[t.second])
                  {
                      d[e.first]=d[t.second];
                      pq.push({d[e.first],e.first});
                  }
          }
      }
      
      void bellman_dummy(int n)
      {
          vector<ll> d(n,LLONG_MAX);
          d[0]=0;
          for(int k=0;k&lt;n;k++)
              for(int i=0;i&lt;n;i++)
                  if(d[i]&lt;LLONG_MAX)
                      d[i]=d[i];
      }
      
      void floyd_dummy()
      {
          const ll INF = (ll)4e18;
          ll d[3][3];
          for(int i=0;i&lt;3;i++)
              for(int j=0;j&lt;3;j++)
                  d[i][j]=(i==j?0:INF);
          for(int k=0;k&lt;3;k++)
              for(int i=0;i&lt;3;i++)
                  for(int j=0;j&lt;3;j++)
                      if(d[i][k]&lt;INF&&d[k][j]&lt;INF)
                          d[i][j]=min(d[i][j],add_bit(d[i][k],d[k][j]));
      }
      
      struct Point
      {
          ll x,y;
      };
      
      ll cross(Point a, Point b, Point c)
      {
          return add_bit((b.x-a.x)*(c.y-a.y),-((b.y-a.y)*(c.x-a.x)));
      }
      
      int main()
      {
          ios::sync_with_stdio(false);
          cin.tie(0); cout.tie(0);
          ll a,b; cin >> a >> b;
          if(fopen(".INP", "r")) {
              freopen(".INP", "r", stdin);
              freopen(".OUT", "w", stdout);
          }
          if(a==0&&b==0)
          {
              putchar('0');
              putchar('\n');
              return 0;
          }
          vector<int> nodes;
          for(ll i=0;i&lt;a;i++)
              nodes.push_back(0);
          for(ll i=0;i&lt;b;i++)
              nodes.push_back(1);
          int n = nodes.size();
          DSU dsu(n);
          vector<vector<int>> g(n);
          for(int i=1;i&lt;n;i++)
          {
              dsu.unite(0,i);
              g[0].push_back(i);
              g[i].push_back(0);
          }
          Fenwick fw(n);
          for(int i=0;i&lt;n;i++)
              fw.add(i);
          int fcnt = fw.sum(n-1);
          int bcnt = bfs_count(0,g);
          static int dp[2][2];
          dp[0][0]=1;
          dp[1][1]=dp[0][0];
          dijkstra_dummy(n);
          bellman_dummy(n);
          floyd_dummy();
          Point A{0,0},B{1,0},C{0,1};
          cross(A,B,C);
          ll res = bcnt;
          print_ll(res);
          putchar('\n');
      }
      

      • -2
        ToniKroos  commented on May 7, 2026, 2:31 a.m.

        khiếp dài dòng thế làm chi, dùng python chỉ cần 2 dòng:

        a,b=map(int,input().split()) print(a+b)


        • 0
          beanggghhh  commented on June 8, 2026, 9:05 a.m.

          import heapq import itertools import functools from collections import deque

          class NumberBox: def init(self, value): self.value = value

          class LinkedNode: def init(self, value=0): self.value = value self.next = None

          class LinkedList: def init(self): self.head = None

          def append(self, value):
              if not self.head:
                  self.head = LinkedNode(value)
                  return
              cur = self.head
              while cur.next:
                  cur = cur.next
              cur.next = LinkedNode(value)
          
          def count(self):
              cur = self.head
              total = 0
              while cur:
                  total += 1
                  cur = cur.next
              return total
          

          def logger(func): @functools.wraps(func) def wrapper(args, *kwargs): return func(args, *kwargs) return wrapper

          class BinaryAdder: @staticmethod def add(x, y): while y: carry = x & y x ^= y y = carry << 1 return x

          class Matrix: def init(self): self.data = [[1, 0], [0, 1]]

          def multiply_identity(self):
              result = [[0, 0], [0, 0]]
              for i in range(2):
                  for j in range(2):
                      for k in range(2):
                          result[i][j] += self.data[i][k] * self.data[k][j]
              self.data = result
          

          class Graph: def init(self, n): self.g = [[] for _ in range(n)]

          def connect_all(self):
              for i in range(len(self.g)):
                  for j in range(i + 1, len(self.g)):
                      self.g[i].append(j)
                      self.g[j].append(i)
          
          def bfs(self):
              if not self.g:
                  return 0
              q = deque([0])
              vis = {0}
              cnt = 0
          
              while q:
                  u = q.popleft()
                  cnt += 1
                  for v in self.g[u]:
                      if v not in vis:
                          vis.add(v)
                          q.append(v)
          
              return cnt
          

          class Meta(type): def new(cls, name, bases, attrs): attrs["meaningless"] = lambda self: None return super().new(cls, name, bases, attrs)

          class Engine(metaclass=Meta): pass

          @logger def recursivesum(bitsa, bitsb, carry=0, idx=0): if idx >= max(len(bitsa), len(bits_b)): return [carry] if carry else []

          a_bit = bits_a[idx] if idx < len(bits_a) else 0
          b_bit = bits_b[idx] if idx < len(bits_b) else 0
          
          total = a_bit + b_bit + carry
          
          return [total % 2] + recursive_sum(
              bits_a,
              bits_b,
              total // 2,
              idx + 1
          )
          

          def inttobits(n): if n == 0: return [0]

          bits = []
          while n:
              bits.append(n & 1)
              n >>= 1
          return bits
          

          def bitstoint(bits): value = 0 power = 1

          for bit in bits:
              if bit:
                  value += power
              power <<= 1
          
          return value
          

          def absurd_addition(a, b):

          box_a = NumberBox(a)
          box_b = NumberBox(b)
          
          lst = LinkedList()
          
          for _ in range(abs(a)):
              lst.append(0)
          
          for _ in range(abs(b)):
              lst.append(1)
          
          useless_count = lst.count()
          
          m = Matrix()
          m.multiply_identity()
          
          g = Graph(min(useless_count, 30))
          g.connect_all()
          g.bfs()
          
          pq = []
          
          heapq.heappush(pq, box_a.value)
          heapq.heappush(pq, box_b.value)
          
          heapq.heappop(pq)
          heapq.heappop(pq)
          
          list(itertools.permutations([1, 2, 3], 3))
          
          bits_a = int_to_bits(box_a.value)
          bits_b = int_to_bits(box_b.value)
          
          binary_result = bits_to_int(
              recursive_sum(bits_a, bits_b)
          )
          
          final_result = BinaryAdder.add(binary_result, 0)
          
          engine = Engine()
          engine.meaningless()
          
          return final_result
          

          a = int(input()) b = int(input())

          answer = absurd_addition(a, b)

          print(answer)


  • 0
    DAThinh_HuMaDa  commented on Dec. 19, 2025, 7:13 a.m. edit 8

    solve

    cout<<a+b<<endl;


  • -7
    Dangcoder  commented on Dec. 16, 2025, 8:27 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -11
    tranminhtuan05012009  commented on Dec. 11, 2025, 2:53 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    tranminhtuan05012009  commented on Dec. 11, 2025, 2:52 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    tranminhtuan05012009  commented on Dec. 11, 2025, 2:52 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    tranminhtuan05012009  commented on Dec. 11, 2025, 2:52 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -9
    tranminhtuan05012009  commented on Dec. 11, 2025, 2:51 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -11
    tranminhtuan05012009  commented on Dec. 11, 2025, 2:51 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -11
    tranminhtuan05012009  commented on Dec. 11, 2025, 2:51 a.m. edit 2

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -17
    K31_NguyenCaoMinhTien  commented on Dec. 10, 2025, 3:52 a.m. edit 4

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -18
    K31_NguyenCaoMinhTien  commented on Dec. 10, 2025, 3:51 a.m. edit 2

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -18
    K31_NguyenCaoMinhTien  commented on Dec. 10, 2025, 3:51 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -17
    K31_NguyenCaoMinhTien  commented on Dec. 10, 2025, 3:51 a.m. edit 6

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    anhnqken  commented on Dec. 6, 2025, 9:16 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -9
    anhnqken  commented on Dec. 6, 2025, 9:15 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -9
    anhnqken  commented on Dec. 6, 2025, 9:15 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    anhnqken  commented on Dec. 6, 2025, 9:15 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    K31_NguyenCaoMinhTien  commented on Dec. 4, 2025, 10:03 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    K31_NguyenCaoMinhTien  commented on Dec. 4, 2025, 10:01 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    K31_NguyenCaoMinhTien  commented on Dec. 4, 2025, 10:00 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    K31_NguyenCaoMinhTien  commented on Dec. 4, 2025, 10:00 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -14
    K31_NguyenCaoMinhTien  commented on Dec. 4, 2025, 9:59 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -7
    TSTD_TrinhKhanhHung  commented on Nov. 11, 2025, 6:43 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -7
    TSTD_TrinhKhanhHung  commented on Nov. 11, 2025, 6:43 p.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -13
    LVT_K66_TRANDUYBAO  commented on Nov. 10, 2025, 4:14 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    LVT_K66_TRANDUYBAO  commented on Nov. 10, 2025, 4:14 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -9
    LVT_K66_TRANDUYBAO  commented on Nov. 10, 2025, 4:14 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -10
    LVT_K66_TRANDUYBAO  commented on Nov. 10, 2025, 4:14 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    khang755332  commented on Nov. 6, 2025, 9:10 a.m. edit 2

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -13
    khang755332  commented on Nov. 6, 2025, 9:10 a.m. edit 5

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -13
    khang755332  commented on Nov. 6, 2025, 9:10 a.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    khang755332  commented on Oct. 27, 2025, 6:45 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -13
    khang755332  commented on Oct. 27, 2025, 6:45 a.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    khang755332  commented on Oct. 27, 2025, 6:45 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    khang755332  commented on Oct. 27, 2025, 6:45 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    khang755332  commented on Oct. 20, 2025, 9:00 a.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -13
    khang755332  commented on Oct. 17, 2025, 9:36 a.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -10
    LVT_K66_TRANDUYBAO  commented on Oct. 12, 2025, 4:51 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    K31_NguyenCaoMinhTien  commented on Oct. 11, 2025, 1:05 a.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 0
    namta1082012  commented on Sept. 26, 2025, 2:24 p.m.

    include <bits/stdc++.h>

    using namespace std;

    int main() { double A,B; cin>>A>>B; cout<<A+B;

    return 0;
    

    }


  • -6
    lelouchchesss  commented on Sept. 7, 2025, 7:53 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -6
    quangvukts  commented on Sept. 2, 2025, 8:25 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -2
      YM_YD_Vucongdat  commented on April 21, 2026, 8:08 a.m.

      việc bạn không làm được bài thì mình thấy hơi vô lí , tại vì OJ chỉ cho phép ng lm trên 5 bài bình luận hoặc đẻ vote . vậy nên bạn phải làm được ít nhất 5 bài rồi


    • -7
      pika68267  commented on Sept. 3, 2025, 1:45 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -6
        quangvukts  commented on Sept. 3, 2025, 2:11 p.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


        • -6
          pika68267  commented on Sept. 27, 2025, 2:16 p.m.

          This comment is hidden due to too much negative feedback. Show it anyway.


  • -10
    PhuocThien  commented on Aug. 17, 2025, 11:54 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -3
      lego21910  commented on Aug. 17, 2025, 1:17 p.m.

      Cái của mình là để cộng cho số cực lớn trong C++ hàng triệu chữ số nên phải dài bạn ạ . Tại mình muốn nâng cấp việc cộng số siêu lớn thôi chứ bài này chủ yếu để mn làm quen VNOJ platform với nnlt thôi =)


  • 8
    lego21910  commented on Aug. 14, 2025, 5:46 a.m. edit 14

    Chào mọi người , từ bài đơn giản trên mình thấy việc A cộng B (số nguyên không âm) mà sử dụng số nguyên thông thường với C++ thì khá hạn chế vì giới hạn tối đa 19 chữ số của ULLONG_MAX .Nên mình đã cài đặt code bằng string sẽ có thể tính toán với số lớn hơn rất nhiều khoảng hàng chục triệu chữ số

    • Đpt không gian : O(N)
    • Đpt thời gian : O(N)
    Code mình viết vẫn còn rất nhiều sai sót , nếu bạn có ý kiến thì đừng ngần ngại góp ý bên dưới . 
    Mình sẽ rất biết ơn bạn khi giúp mình cải thiện code thay vì việc bị downvote ạ.
    
    #include <iostream>
    #include <string>
    #include <algorithm>
    #define pb push_back
    using namespace std;
    
    int main()
    {
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
    
        string a, b, res;
        int remains = 0, f;
    
        cin >> a >> b;
    
        // make a always bigger than b
        if (b.size() > a.size())
        {
            string c = a;
            a = b;
            b = c;
        }
    
        f = b.size() - 1;
    
        for (int i = a.size() - 1; i >= 0; i--)
        {
            if (f >= 0) // size a == b
                remains = (a[i] - '0') + (b[f] - '0') + remains;
            else
                remains = (a[i] - '0') + remains;
    
            // basic addition formula
            res.pb((remains > 9 ? remains % 10 : remains)+'0');
            remains /= 10;
            f--;
        }
    
        // in case first digit > 9
        if (remains > 0)
            res.pb(remains+'0');
    
        reverse(res.begin() , res.end());
    
        cout << "Tong A va B la : " << res << '\n';
    
        return 0;
    }
    

    • -4
      pika68267  commented on Aug. 20, 2025, 8:27 a.m.

      dùng python ko lo tràn số :))


  • -5
    ahungg_2610  commented on Aug. 9, 2025, 3:44 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -6
    ahungg_2610  commented on Aug. 4, 2025, 4:38 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -14
    LVT_K66_TRANDUYBAO  commented on July 26, 2025, 1:56 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 5
    lvnhatquang1212  commented on July 16, 2025, 4:22 a.m. edit 21

    Code và hint cho các bạn mới làm quen với các ngôn ngữ như c++, pascal, python.

    HINT :

    Sử dụng toán tử "+" để cộng hai biến lại với nhau

    CODE :

    C++
    #include <iostream>
    using namespace std;
    int main() {
        long long a, b;
        cin >> a >> b;
        cout << a + b;
    }
    
    C
    #include <stdio.h>
    int main() {
        long long a, b;
        scanf("%lld %lld", &a, &b);
        printf("%lld", a + b);
        return 0;
    }
    
    Python
    a, b = map(int, input().split())
    print(a + b)
    
    Java
    import java.util.Scanner;
    
    public class SumAB {
        public static void main(String[] args) {
            Scanner inp = new Scanner(System.in);
            int a = inp.nextInt();
            int b = inp.nextInt();
            System.out.println(a+b);
        }
    }
    
    Pascal
    var a, b: longint;
    begin
        readln(a, b);
        writeln(a + b);
    end.
    
    Go
    package main
    import "fmt"
    func main() {
        var a, b int64
        fmt.Scan(&a, &b)
        fmt.Println(a + b)
    }
    
    Rust
    use std::io;
    fn main() {
        let mut input = String::new();
        io::stdin().read_line(&mut input).unwrap();
        let nums: Vec<i64> = input.split_whitespace().map(|x| x.parse().unwrap()).collect();
        println!("{}", nums[0] + nums[1]);
    }
    
    Kotlin
    fun main() {
        val (a, b) = readLine()!!.split(" ").map { it.toInt() }
        println(a + b)
    }
    
    
    JavaScript (Node.js)
    const readline = require('readline');
    const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
    rl.on('line', (line) => {
        const [a, b] = line.split(' ').map(Number);
        console.log(a + b);
        rl.close();
    });
    
    Swift
    if let line = readLine() {
        let nums = line.split(separator: " ").map { Int($0)! }
        print(nums[0] + nums[1])
    }
    
    Ruby
    a, b = gets.split.map(&:to_i)
    puts a + b
    
    Perl
    my ($a, $b) = split ' ', <STDIN>;
    print $a + $b;
    

    Hướng dẫn dành cho bạn nào dùng ngôn ngữ khác:

    Nhập a, b trên một dòng
    Xuất ra a + b 
    
    Code mình viết có thể vẫn còn sai sót
    Nếu bạn thấy lỗi, đừng ngại để lại góp ý ở phần bình luận nha
    Mình rất cảm ơn nếu bạn giúp mình hoàn thiện hơn thay vì downvote 
    

  • -16
    vutuankiet  commented on June 29, 2025, 2:13 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 10
    pppssslc  commented on May 29, 2025, 2:36 a.m. edit 4

    Bài này khá dễ, để mấy bạn mới làm quen.
    Code mẫu tất cả các ngôn ngữ khác nhau:

    C++:

    #include<bits/stdc++.h>
    using namespace std;
    
    int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0); cout.tie(0);
        int a, b; cin>>a>>b;
        cout<<a+b;
        return 0;
    }
    

    C:

    #include <stdio.h>
    
    int main(){
        int a, b;
        scanf("%d %d", &a, &b);
        printf("%d", a + b);
    }
    

    Python:

    if __name__=='__main__':
        a, b = map(int, input().split())
        print(a+b)
    

    Pascal:

    program phongdz;
    var
      a, b: Integer;
    begin
      Readln(a, b);
      Writeln(a + b);
    end.
    

    Java:

    import java.util.Scanner;
    
    public class SumAB {
        public static void main(String[] args) {
            Scanner inp = new Scanner(System.in);
            int a = inp.nextInt();
            int b = inp.nextInt();
            System.out.println(a+b);
        }
    }
    

    Scratch: A cộng B

    Rust:

    fn main() {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let mut i = s.split_whitespace().map(|x| x.parse::<i32>().unwrap());
        println!("{}", i.next().unwrap() + i.next().unwrap());
    }
    

    Go:

    package main
    import "fmt"
    func main() {
        var a, b int
        fmt.Scan(&a, &b)
        fmt.Println(a + b)
    }
    

    pls don't downvote me


  • -9
    hoangquan2509  commented on May 9, 2025, 8:05 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -10
    hoangquan2509  commented on May 9, 2025, 7:49 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -12
    giaphudthw123  commented on May 6, 2025, 5:03 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -12
      HUNG2010  commented on June 1, 2025, 12:09 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


    • -4
      lmtcv19  commented on May 29, 2025, 1:50 a.m. edited

      đây nha ```

      include <bits/stdc++.h>

      using namespace std; int f[1005][1005]; int main() { iosbase::syncwith_stdio(false); cin.tie(NULL); int a, b; cin>>a>>b; for(int i = 0; i < 1005; i++) { f[i][0] = i; f[0][i] = i; } for(int i = 0; i <= 1e7+1e4; i++) cout<<"\n"; for(int i = 1; i < 1005; i++) { for(int j = 1; j < 1005; j++) { f[i][j] = f[i - 1][j] + 1; } } cout<<f[a][b]; return 0; } ```


  • -8
    quan0802010  commented on May 2, 2025, 9:10 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -10
    maiphucthinhpika34  commented on April 23, 2025, 9:03 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -13
    tranhoang1111  commented on Feb. 13, 2025, 3:43 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 11
    chaudepzai0410  commented on Jan. 18, 2025, 2:28 a.m.

    bài này phải giải bằng thuật toán đệ quy có nhớ, nhân ấn độ, lũy thừa nhị phân, quy hoạch động, dfs/bfs, eulertour, stack, nhân ma trận, kmp, hashing, segment tree, quick sort, BIT, chặt nhị phân, tarjan, LCA, bảng thưa, siêu cấp tổ hợp toán học, tourist


  • -17
    chaudepzai0410  commented on Jan. 18, 2025, 2:25 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -17
    chaudepzai0410  commented on Jan. 18, 2025, 2:24 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -24
    chaudepzai0410  commented on Jan. 18, 2025, 2:24 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -18
    chaudepzai0410  commented on Jan. 18, 2025, 2:24 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 3
    quan_mather  commented on Jan. 16, 2025, 1:58 p.m.

    Mình cảm thấy khá khó chịu khi đọc vào phần bình luận của bài này các bạn sao cứ spam ấy nhỉ,và cũng đã có nhiều bài bị spam bình luận giống vậy ,hãy xây dựng một cộng đồng VNOI có văn hoá chứ đừng có như vậy.Xin cảm ơn(mình chỉ là coder thôi)


    • -22
      K30quocphuong  commented on April 3, 2025, 12:58 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -21
        k30thiennhan  commented on April 3, 2025, 12:59 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    pthtuong29  commented on Jan. 13, 2025, 1:01 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • 1
    AnonymousExe  commented on Jan. 9, 2025, 11:51 a.m.

    Bài A + B làm thế này

    Sử dụng toán tử +

    Kết quả sẽ là A + B

    Thế là xong bài


  • -2
    ducquoc  commented on Dec. 30, 2024, 2:42 a.m. edit 6

    Template Java input + output đơn giản có unit test (driver class):

    ! https://oj.vnoi.info/src/8022650

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

    @SuppressWarnings({"all"}) // https://oj.vnoi.info/problem/post class VoDriverPost { public static void readInputAndPrintOutput(PrintStream out) { Scanner in = new Scanner(System.in); //https://gist.github.com/ducquoc/febef09c34dbaf2ab302b6330b407ef9 int A = in.nextInt(); int B = in.nextInt(); int rs = A + B; out.println(rs); //out.close(); in.close(); }

    final public static void main(String[] args) throws Exception { System.setIn(new ByteArrayInputStream("3 4\n".getBytes())); readInputAndPrintOutput(System.out); } }


  • -10
    Dinh_Phuc_Minh  commented on Dec. 26, 2024, 2:40 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -20
    tink29lenhuttri32  commented on Dec. 16, 2024, 9:32 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -20
    tink29lenhuttri32  commented on Dec. 16, 2024, 9:32 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -26
    tink29lenhuttri32  commented on Dec. 16, 2024, 9:32 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -11
      K30quocphuong  commented on April 3, 2025, 12:57 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -9
        k30thiennhan  commented on April 3, 2025, 12:59 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


        • 2
          quangvukts  commented on Aug. 31, 2025, 9:50 a.m.

          Hãy downvote tôi ^^


  • -19
    tink29lenhuttri32  commented on Dec. 3, 2024, 2:08 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -18
    tink29lenhuttri32  commented on Dec. 3, 2024, 2:07 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    tink29levukhanhminh18  commented on Dec. 3, 2024, 2:02 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -26
    K30thanhson  commented on Nov. 27, 2024, 3:12 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -27
    K30thanhson  commented on Nov. 27, 2024, 3:07 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -26
    K30thanhson  commented on Nov. 27, 2024, 3:07 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -27
    K30thanhson  commented on Nov. 27, 2024, 3:07 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -16
    nguyennhan70117  commented on Nov. 25, 2024, 12:37 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -25
    K30thanhson  commented on Nov. 18, 2024, 8:44 a.m. edit 2

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -11
    danglebinhnguyen2014  commented on Nov. 4, 2024, 1:16 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -12
    khiemgia1105  commented on Oct. 4, 2024, 7:47 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -22
    K30thanhson  commented on Sept. 16, 2024, 3:20 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -2
    hoanglongnguyen9002  commented on Aug. 30, 2024, 3:03 a.m. edit 2

    bai nay lam sao a


    • 3
      ducquoc  commented on Jan. 1, 2025, 5:01 a.m. edit 5

      Bài này chủ yếu để làm quen input, output, và run/submit với constraint thời gian thôi bạn.

      Không phải ai cũng rành C++. Vẫn có Java, Python, Go, C, JavaScript, C#, Kotlin, Dart, Delphi(Pascal), TypeScript, Rust, Elixir,... nên có bài này để chuẩn bị inout và compile/run/test là rất hữu ích.

      (Về phía server, cũng tiết kiệm tài nguyên và giảm tỷ lệ nộp sai khi beginners submit các bài actual practice)

      Tương tự SPOJ cũng có bài làm quen: https://www.spoj.com/problems/TEST , https://www.spoj.com/problems/J4FUN/

      https://luyencode.net/problem/cb02 https://ctoj.net/problem/PA0004 https://lqdoj.edu.vn/problem/w01

      https://lequydon.ntucoder.net/Problem/Details/1

      https://tek4.vn/luyen-tap/1000-bai-tap-lap-trinh-c/post3-ai-cong-nhanh-nhat

      http://csloj.ddns.net/problem/1

      (CodeChef cũng có problems/TEST và problems/INTEST giống SPOJ)


    • 19
      tronglee  commented on Sept. 12, 2024, 7:41 a.m.

      đâu phải ai cũng làm được


  • -15
    Crabrian  commented on Aug. 15, 2024, 7:45 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -19
    khanhlani  commented on Aug. 1, 2024, 2:28 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -18
    yae_miko  commented on July 11, 2024, 8:22 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -20
    hohoanghai5042011  commented on June 11, 2024, 2:45 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -17
    vantam  commented on May 9, 2024, 12:50 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -18
      gnortpv  commented on Aug. 10, 2024, 5:16 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


    • -13
      nguyenhongnam207  commented on Aug. 10, 2024, 5:15 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -10
        An212  commented on Aug. 16, 2024, 1:22 p.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


  • -16
    npqhungtq2023  commented on March 20, 2024, 10:08 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -14
      calong3003  commented on May 20, 2024, 9:47 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


    • -37
      khoihk20  commented on March 20, 2024, 2:27 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -10
        random_idiot  commented on May 10, 2024, 1:46 p.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


      • -5
        VVUU  commented on March 20, 2024, 2:28 p.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


    • -10
      nictysine1  commented on March 20, 2024, 10:10 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -21
    tonblan  commented on March 17, 2024, 6:16 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -13
    nhl08contact  commented on Feb. 17, 2024, 6:19 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -16
    apotocaplyse  commented on Jan. 23, 2024, 7:38 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -28
    quanglm  commented on Jan. 1, 2024, 2:24 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -9
    Cadoc  commented on Dec. 29, 2023, 2:08 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -26
    tink29lenhuttri32  commented on Dec. 29, 2023, 2:27 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -20
    modwwe  commented on Dec. 13, 2023, 2:29 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -18
    modwwe  commented on Dec. 13, 2023, 2:29 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -21
    triclone_3  commented on Dec. 10, 2023, 10:53 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -23
    triclone_3  commented on Dec. 10, 2023, 10:52 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -16
    playerno1  commented on Dec. 3, 2023, 1:59 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -23
    tronghuy  commented on Nov. 30, 2023, 12:58 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -19
    tink29lenhuttri32  commented on Nov. 3, 2023, 1:28 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -27
    themluachon2008  commented on Oct. 20, 2023, 8:26 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -28
    Ich_bin_Khang  commented on Oct. 12, 2023, 8:00 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -22
    Ich_bin_Khang  commented on Oct. 12, 2023, 8:00 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -25
    Ich_bin_Khang  commented on Oct. 12, 2023, 8:00 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -22
    Ich_bin_Khang  commented on Oct. 12, 2023, 8:00 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -21
    Ich_bin_Khang  commented on Oct. 12, 2023, 8:00 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -18
    nhan19042007  commented on Oct. 12, 2023, 6:52 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -21
    phat141207  commented on Oct. 12, 2023, 6:30 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -17
      nhan19042007  commented on Oct. 12, 2023, 6:34 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -21
    monke_bi_bai_nao  commented on Oct. 12, 2023, 6:09 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -20
    lkva2019  commented on Oct. 9, 2023, 2:03 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -24
    Marr_HH  commented on Oct. 9, 2023, 1:57 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -17
    bruhlmao21  commented on Sept. 29, 2023, 3:00 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -15
    Ngumaconsi  commented on Sept. 29, 2023, 2:26 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -28
    khoihk20  commented on Sept. 24, 2023, 2:21 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -14
    _DURABLE_  commented on Sept. 22, 2023, 3:42 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -11
      tatech28  commented on Sept. 22, 2023, 3:42 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -25
    tink29phu23  commented on Sept. 18, 2023, 3:12 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -16
    tink29lenhuttri32  commented on Sept. 14, 2023, 2:47 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -13
    phamducminh538  commented on Aug. 1, 2023, 5:19 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -21
    Xcode  commented on July 31, 2023, 9:34 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -16
    l1i3nh  commented on May 3, 2023, 12:44 p.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -14
    l1i3nh  commented on May 3, 2023, 12:40 p.m. edit 3

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -40
    khoihk20  commented on April 21, 2023, 1:05 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -22
      z  commented on April 21, 2023, 10:44 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


    • -18
      tminh_hk20  commented on April 21, 2023, 1:06 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -20
        khoihk20  commented on April 21, 2023, 1:07 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


    • -14
      nthach1010  commented on April 21, 2023, 1:06 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -19
        khoihk20  commented on April 21, 2023, 1:07 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


  • -30
    nthquan_1505  commented on March 30, 2023, 4:22 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -19
    L2_2023_22_PhanHuuTai  commented on March 28, 2023, 5:37 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -26
    vuhoangphuc  commented on March 17, 2023, 1:37 p.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -23
      AnhPham  commented on March 17, 2023, 1:40 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -17
    k64_sorryimloser  commented on Feb. 11, 2023, 8:01 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -27
    neptune_170_nt  commented on Jan. 21, 2023, 2:36 a.m. edit 2

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -39
    NTC  commented on Dec. 28, 2022, 3:41 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -34
    HUYLAMNOPRO1  commented on Dec. 26, 2022, 12:28 a.m. edited

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -35
    HUYLAMNOPRO1  commented on Dec. 25, 2022, 1:57 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -26
    bautroidaysao  commented on Sept. 20, 2022, 3:19 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -4
      jalsol  commented on Sept. 22, 2022, 10:29 a.m.

      Bài này cho 2 số A và B trên cùng một dòng. Hàm input() thì đọc hết nguyên một dòng luôn.

      Bạn có thể đọc input như sau:

      a, b = map(int, input().split())


  • 0
    NDAnhTuanKhongCopCode  commented on Aug. 8, 2022, 12:17 p.m.

    xin 1 upvote


    • -38
      hh123123  commented on Aug. 8, 2022, 3:17 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -33
    avatarstar1133  commented on July 29, 2022, 10:11 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -15
      nictysine1  commented on March 15, 2023, 2:19 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -34
    trantungduong  commented on June 10, 2022, 9:28 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -25
    QioCass  commented on June 9, 2022, 2:09 a.m. edit 2

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -43
    caubechepcode  commented on Feb. 9, 2022, 8:38 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -24
      Minhquank25Clqd  commented on Sept. 6, 2022, 1:54 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -44
    nictysine1  commented on Feb. 8, 2022, 7:34 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -39
      ntkiet  commented on June 7, 2022, 2:24 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -39
        nictysine1  commented on July 17, 2022, 9:29 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


  • -49
    AnNoProo  commented on Dec. 30, 2021, 7:27 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -33
    K24NVNTin  commented on Nov. 16, 2021, 8:57 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -40
    K24LAQUAN  commented on Nov. 16, 2021, 8:57 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -40
    mronjudge  commented on Oct. 30, 2021, 3:40 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    darkkcyan  commented on Sept. 8, 2021, 9:35 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -21
      jalsol  commented on Sept. 9, 2021, 9:33 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


    • -50
      SPyofgame  commented on Sept. 8, 2021, 9:37 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


  • -63
    SPyofgame  commented on Sept. 8, 2021, 9:29 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • -25
      ntkiet  commented on June 7, 2022, 2:23 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


    • -31
      someone  commented on Sept. 9, 2021, 1:43 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


    • -15
      pichu  commented on Sept. 8, 2021, 9:36 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -53
        SPyofgame  commented on Sept. 8, 2021, 9:37 a.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


  • 2
    caubecanlao  commented on Aug. 5, 2021, 3:19 a.m.

    công thức quy hoạch động khá đơn giản

    include <bits/stdc++.h>

    using namespace std; const int N = 1e3 + 1e2; int dp[N][N]; int main() { cin.tie(0)->syncwithstdio(0); dp[1][0] = 1; dp[0][1] = 1; for (int i = 1; i <= 1000; i++) { for (int j = 1; j <= 1000; j++) { dp[i][j] = max({dp[i - 1][j] - (-1), dp[i][j - 1] - (-1), dp[i - 1][j - 1] - (-2)}); } } int a, b; cin >> a >> b; cout << max(dp[a][b], dp[b][a]); return 0; }


    • -18
      cpptowin  commented on Dec. 21, 2022, 8:50 a.m. edited

      This comment is hidden due to too much negative feedback. Show it anyway.


      • -24
        KeiKaruizawa  commented on Dec. 21, 2022, 3:10 p.m.

        This comment is hidden due to too much negative feedback. Show it anyway.


    • -35
      HN_CSP_FTRs  commented on Jan. 8, 2022, 1:05 p.m.

      This comment is hidden due to too much negative feedback. Show it anyway.


    • -53
      nguyenvana123  commented on Aug. 5, 2021, 3:21 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.