全部评论 41

  • 《把简单的题目复杂化》

    2024-09-01 来自 江苏

    5
  • 有极端数据,要用vector(

    2024-06-06 来自 广东

    4
    • 数据又加强了 必须得快读+快写+压位了

      2024-11-10 来自 广东

      3
    • 你是这个👍

      2025-04-05 来自 云南

      0
    • userId_undefined
      zaze
      回复
      cjdst

      那个10^9是吓唬人的,你直接couta+b一样能过

      2025-07-01 来自 广西

      1
  • 难么?

    #include <bits/stdc++.h>
    using namespace std;
    int RAND_1(long long a,long long b){
        long long n = a + b;
        cout << n;
        return 0;
    }
    int RAND_2(string a, string b, int n[500], int m[500], int ans[501]){
        for(int i = 0; i < a.size(); i++)
    		n[i] = a[a.size() - i - 1] - '0';
    	for(int i = 0; i < b.size(); i++)
    		m[i] = b[b.size() - i - 1] - '0';
    	int len_maxn = max(a.size(), b.size()) + 1;
    	for(int i = 0; i < len_maxn; i++)
    	{
    		ans[i] = n[i] + m[i] + ans[i];
    		if(ans[i] > 9)
    		{
    			ans[i + 1]++;
    			ans[i] = ans[i] % 10;
    		}
    	}
    	while(ans[len_maxn - 1] == 0 && len_maxn > 0) len_maxn--;
    	for(int i = len_maxn - 1; i >= 0; i--) cout << ans[i];
    	return 0;
    }
    int n[500], m[500],c[501];
    int main(){
        long long a , b;
        int x;
        x = 1 + rand() % 2;
        if(x == 1){
        	cin >> a >> b; 
        	RAND_1(a,b);
    	}
        string z , y;
        if(x == 2){
        	cin >> z >> y; 
        	RAND_2(z , y , n , m, c);
    	}
        return 0;
    }
    

    2024-11-10 来自 北京

    3
    • 这样就行:
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      int a, b;
      cin >> a >> b;
      cout << a + b;
      return 0;
      }

      2025-06-29 来自 北京

      1
    • 不如这个

      #include<cstdio>
      inline int read(){
          int x=0,c;
          while((c=getchar_unlocked())<'0');
          do x=x*10+c-'0';
          while((c=getchar_unlocked())>='0');
          return x;
      }inline void write(int n) {
          if(n<0) {
              putchar('-');
              n*=-1;
          }if(n>=10){
              write(n/10);
          }putchar(n%10+'0');
      }int main(){
          write(read()+read());
          return 0;
      }
      

      2025-09-19 来自 上海

      1
    • 他故意的

      2025-09-19 来自 上海

      0
  • #include<iostream>
    using namespace std;
    int main()
    {
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
    }
    ???
    好难!!!!
    难的只有9行!?

    2026-01-03 来自 江苏

    2
    • 我4行:
      #include <bits/stdc++.h>
      int main(){
      long long a,b; stdcin>>a>>b; stdcout<<a+b;
      }

      2026-02-23 来自 浙江

      1
  • 考古

    2025-09-10 来自 重庆

    2
  • vevry good!
    #include <bits/stdc++.h>
    using namespace std;

    string a, b;
    int n[500], m[500], ans[501];

    int main()
    {
    cin >> a >> b;
    if(a == "0" && b == "0")
    {
    cout << 0 << endl;
    return 0;
    }
    for(int i = 0; i < a.size(); i++)
    n[i] = a[a.size() - i - 1] - '0';
    for(int i = 0; i < b.size(); i++)
    m[i] = b[b.size() - i - 1] - '0';
    int len_maxn = max(a.size(), b.size()) + 1;
    for(int i = 0; i < len_maxn; i++)
    {
    ans[i] = n[i] + m[i] + ans[i];
    if(ans[i] > 9)
    {
    ans[i + 1]++;
    ans[i] = ans[i] % 10;
    }
    }
    while(ans[len_maxn - 1] == 0 && len_maxn > 0) len_maxn--;
    for(int i = len_maxn - 1; i >= 0; i--) cout << ans[i];
    return 0;
    }//

    2025-09-10 来自 上海

    2
  • #include<bits/stdc++.h>//导入万能头文件
    using namespace std;//命名空间
    int main(){
    //主函数
    int a,b
    cin>>b;
    cin>>a;
    cout<<a+b
    //输出
    return 0;
    //结束程序
    }

    2024-11-23 来自 浙江

    2
  • 不是啊,哥们儿,你绕路啊,这样写不的了吗
    #include <iostream>
    using namespace std;
    int main(){
    int a, b;
    cin >> a>> b;
    cout << a + b;
    }

    2024-11-06 来自 浙江

    2
  • #include<bits/stdc++.h>
    using namespace std;
    int main(){
    int a,b,c=0;
    cin>>a>>b;
    c=a+b;
    cout<<c;
    return 0;
    }

    3天前 来自 湖南

    1
  • lz

    1周前 来自 安徽

    1
  • 乐子

    1周前 来自 安徽

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

    #define ll long long
    const int N = 1010;

    int RAND_1(ll a,ll b){
    ll n = a + b;
    return n;
    }

    int RAND_2(string a, string b, int n[500], int m[500], int ans[501]){
    memset(n,0,sizeof(n));
    memset(m,0,sizeof(m));
    memset(ans,0,sizeof(ans));
    for(int i = 0; i < a.size(); i++)
    n[i] = a[a.size() - i - 1] - '0';
    for(int i = 0; i < b.size(); i++)
    m[i] = b[b.size() - i - 1] - '0';
    int len_maxn = max(a.size(), b.size()) + 1;
    for(int i = 0; i < len_maxn; i++)
    {
    ans[i] = n[i] + m[i] + ans[i];
    if(ans[i] > 9)
    {
    ans[i + 1]++;
    ans[i] = ans[i] % 10;
    }
    }
    while(len_maxn > 1 && ans[len_maxn - 1] == 0) len_maxn--;
    for(int i = len_maxn - 1; i >= 0; i--) cout << ans[i];
    return 0;
    }

    int RAND_3(ll a, ll b){
    ll ans = 0;
    for(int i = 0; i < a; i ++ ) {
    ans ++;
    }
    for(int i = 0; i < b; i ++ ) {
    ans ++;
    }
    return ans;
    }

    void empty_func_one()
    {

    }
    void empty_func_two(int x)
    {
    int a = x;
    a++;
    a--;
    }
    void empty_func_three(int x,int y)
    {
    int res = x+y;
    res = res-x;
    }
    long long empty_func_four(long long x)
    {
    return x;
    }
    string empty_func_five(string s)
    {
    return s;
    }
    double empty_func_six(double x)
    {
    return x1.0;
    }
    int get_max_num(int a,int b)
    {
    if(a>b) return a;
    else return b;
    }
    int get_min_num(int a,int b)
    {
    if(a<b) return a;
    else return b;
    }
    long long ll_max(long long a,long long b)
    {
    return a>b?a:b;
    }
    long long ll_min(long long a,long long b)
    {
    return a<b?a:b;
    }
    void print_space()
    {
    cout<<" ";
    }
    void print_endline()
    {
    cout<<endl;
    }
    int change_char_to_int(char c)
    {
    return c-'0';
    }
    char change_int_to_char(int x)
    {
    return x+'0';
    }
    bool judge_zero(int x)
    {
    if(x==0) return true;
    return false;
    }
    bool judge_positive(int x)
    {
    if(x>0) return true;
    return false;
    }
    void loop_nothing_1()
    {
    for(int i=1;i<=10;i++)
    {
    i=i;
    }
    }
    void loop_nothing_2()
    {
    for(int i=5;i<=50;i++)
    {
    int temp = i
    2

    1周前 来自 新疆

    1
  • 2026-03-08 来自 新疆

    1
  • 难????????????????嘛??????????????????

    2026-02-14 来自 浙江

    1
  • #include <iostream>
    using namespace std;

    int main()
    {
    int a,b,c;
    cin>>a>>b;
    c=a+b;
    cout <<c;
    return 0;
    }

    2025-07-01 来自 广西

    1
  • #include <bits/stdc++.h>
    using namespace std;
    int n, x;
    struct node {
    int data;
    node * next;
    };
    int main() {
    const int MAX = 2;
    n = MAX;
    node * head, * r, * p, * q;
    head = new node;
    head -> next = NULL;
    r = head;
    for(int i = 1; i <= n; i++) {
    cin >> x;
    p = new node;
    p -> data = x;
    p -> next = NULL;
    r -> next = p;
    r = p;
    }
    p = head;
    while(p -> next != NULL) {
    printf("%d", p -> next -> data + p -> next -> next -> data);
    return 0;
    p = p -> next;
    }
    return 0;
    }

    2025-07-01 来自 浙江

    1
  • 6

    2024-06-05 来自 广东

    1
  • 用什么高精度算法

    2天前 来自 新疆

    0
  • #include<algorithm>
    #include<bitset>
    #include<complex>
    #include<deque>
    #include<exception>
    #include<fstream>
    #include<functional>
    #include<iomanip>
    #include<ios>
    #include<iosfwd>
    #include<iostream>
    #include<istream>
    #include<iterator>
    #include<limits>
    #include<list>
    #include<locale>
    #include<map>
    #include<memory>
    #include<new>
    #include<numeric>
    #include<ostream>
    #include<queue>
    #include<set>
    #include<sstream>
    #include<stack>
    #include<stdexcept>
    #include<streambuf>
    #include<string>
    #include<typeinfo>
    #include<utility>
    #include<valarray>
    #include<vector>
    #if __cplusplus >= 201103L
    #include<array>
    #include<atomic>
    #include<chrono>
    #include<condition_variable>
    #include<forward_list>
    #include<future>
    #include<initializer_list>
    #include<mutex>
    #include<random>
    #include<ratio>
    #include<regex>
    #include<scoped_allocator>
    #include<system_error>
    #include<thread>
    #include<tuple>
    #include<typeindex>
    #include<type_traits>
    #include<unordered_map>
    #include<unordered_set>
    #endif
    using namespace std;
    int main(){
        priority_queue<long long> q;
        stack<long long> p;
        long long a,b;
        cin>>a>>b;
        if(a<=b){
            long long h;
            long long c=a;
            long long d=a+b;
            p.push(c);
            q.push(d);
            p.push(b);
            q.push(a);
            if(p.top()==b){
                long long x=p.top();
                h=x+c;
                p.pop();
            }
            if(q.top()==d){
                long long y=d-c;
                q.pop();
                long long r=q.top()+y;
                q.pop();
                cout<<max(h,r);
            }
        }
        else{
            long long h;
            long long c=a;
            long long d=a+b;
            p.push(c);
            q.push(d);
            p.push(b);
            q.push(a);
            if(p.top()==b){
                long long x=p.top();
                h=x-c;
                p.pop();
            }
            if(q.top()==d){
                long long y=q.top();
                q.pop();
                long long j=(q.top()-c)+y;
                cout<<max(j,h);
            }
        }
        return 0;
    }//太难了
    

    1周前 来自 浙江

    0
  • 用的高精度算法,牛逼

    1周前 来自 新疆

    0

热门讨论