21 solutions

  • 30
    @ 2022-12-28 13:43:01

    以下是本题真正的AC题解(不信你试试)

    #include <iostream>
    using namespace std;
    int main()
    {
        cout << 7;
        return 0;
    }
    
    • 19
      @ 2022-9-13 13:23:46
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a, b;
          cin>>a>>b;
          cout<<a+b;
          return 0;
      }
      
      
      • 17
        @ 2022-10-22 11:33:33

        把A+B当成世界难题

        #include<bits/stdc++.h>
        using namespace std;
        #define set(x) Set(x)
        #define REP(i,j,k) for (int i=(j),_end_=(k);i<=_end_;++i)
        #define DREP(i,j,k) for (int i=(j),_start_=(k);i>=_start_;--i)
        #define mp make_pair
        #define x first
        #define y second
        #define pb push_back
        template<typename T> inline bool chkmin(T &a,const T &b){ return a > b ? a  = b, 1 : 0; }
        template<typename T> inline bool chkmax(T &a,const T &b){ return a < b ? a = b, 1 : 0; }
        typedef long long LL;
        typedef pair<int,int> node;
        const int dmax = 1010, oo = 0x3f3f3f3f;
        int n, m;
        int a[dmax][dmax] , ans;
        int d[dmax], e[dmax];
        priority_queue <node> q;
        inline bool operator >(node a,node b){ return a.y>b.y; }
        bool p[dmax];
        void Set(int x){ p[x] = 1; }
        void unset(int x){ p[x] = 0; }
        bool check(int x){ return x != 1 && x != n && !p[x] && e[x] > 0; }
        void preflow(){
        e[1] = oo;
        d[1] = n - 1;
        q.push(mp(1, n - 1));
        set(1);
        while (!q.empty()) {
               bool flag = 1;
               int k = q.top().x;
                q.pop(), unset(k);
                DREP(i, n, 1)
                if ((d[k] == d[i] + 1 || k == 1) && a[k][i] > 0){
                flag = 0;
                int t = min(a[k][i], e[k]);
                e[k] -= t;
                a[k][i] -= t;
                e[i] += t;
                a[i][k] += t;
                if (check(i)) {
                    q.push(mp(i, d[i]));
                    set(i);
                }
                if (e[k] == 0) break;
            }
            if (flag) {
                d[k] = oo;
                REP(i, 1, n)
                if (a[k][i] > 0) chkmin(d[k], d[i] + 1);
            }
            if (check(k)) {
                q.push(mp(k, d[k]));
                set(k);
            }
        }
        ans = e[n];
        }
        int main() {
        n = 2, m = 2;
        int x, y;
        scanf("%d%d", &x, &y);
        a[1][2] += x + y;
        preflow();
        printf("%d\n", ans);
        return 0;
        }
        
      • 9
        @ 2021-10-10 22:34:49

        不是long long!不是long long!(泪目

        下面是不同语言的方法

        C++:

        #include <iostream>
        using namespace std;
        int main(){
            long long a, b; // 不开long long见祖宗。
            cin >> a >> b;
            cout << a + b << endl;
            return 0;
        }
        

        C:

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

        Py:

        print(sum(map(int, input().split())))
        

        C#:

        using System;
        public class alielie{
        	private static void Main(){
        		string[] input = Console.ReadLine().Split(' ');
        			Console.WriteLine(int.Parse(input[0]) + int.Parse(input[1]));
        	}
        }
        

        Java:

        import java.util.*;
        public class Main{
            public static void main(String[] args){
                Scanner in = new Scanner(System.in);
                long long a = in.nextInt();
                long long b = in.nextInt();
                System.out.println(a + b);
            }
        }
        
      • -9
        @ 2022-8-15 15:45:43

        兄弟们,直接int。

        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	int a,b;
        	cin>>a>>b;
        	cout<<a+b;
        	return 0;
        }
        
        • -10
          @ 2023-1-7 14:34:11
          #include<bits/stdc++.h>
          using namespace std;
          int main(){
              int a;
              int b;
              scanf("%d",&a);
              scanf("%d",&b);
              printf("%d",a+b);
              return 0;
          }
          
          • -10
            @ 2022-8-16 19:13:02

            我nnnnnnnnn......``` #include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; cout<<a+b; return 0; }

            
            
            • -11
              @ 2022-9-2 20:40:48
              #include <bits/stdc++.h> 
              using namespace std;
              int main()
              {
                  int a,b;
                  cin >> a >> b;
                  cout << a+b;
                  return 0;
              }
              

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

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

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

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

              }| | --- | --- | --- | | | | | | | | |

              • -11
                @ 2022-8-29 18:13:35
                #include <iostream>
                using namespace std;
                int main()
                {
                    int a, b;//可以只用int(a <= 200, b <= 200)
                    cin >> a >> b;
                    cout << a + b;
                    return 0;
                }
                
                • -12
                  @ 2023-1-6 10:10:07
                  #include <bits/stdc++.h>
                  using namespace std;
                  void a(long long s, long long d)
                  {
                      cin >> s >> d;
                      cout << s + d;
                  }
                  int main()
                  {
                      long long f, g;
                      a (f, g);
                      return 0;
                  }
                  
                  • -12
                    @ 2022-12-11 22:29:07
                    #include<bits/stdc++.h>
                    using namespace std;
                    int main(){
                        unsigned long long int a,b;
                        cin>>a>>b;
                        cout<<a+b;
                    return 0;
                    }
                    

                    学我,用超长整型

                    • -12
                      @ 2022-11-13 16:25:26

                      bb<itsits蒟篛发一弹! 我看各位同志们的题解都看着太繁琐,抛砖引玉一下。 这道题的数据范围是1<a,b<100,不需要开long long,更不需要无符号,只需要简简单单的一个int就行了。 范例:

                      #include<bits/stdc++.h>
                      using namespace std;
                      int main()
                      {
                          int a,b;
                          cin>>a>>b;
                          cout<<a+b;
                          return 0;
                      }
                      
                      • -12
                        @ 2022-11-1 19:00:00

                        #include <iostream> using namespace std; int main(){ long long a, b; cin >> a >> b; cout << a + b << endl; return 0; }

                        • -12
                          @ 2022-7-9 20:44:01

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

                          • -13
                            @ 2023-1-7 23:05:57

                            可以用short类型变量,节省空间。

                            short a,b;
                            

                            炒鸡简单,代码不想写了。

                            • -14
                              @ 2022-2-13 16:26:23

                              #include <iostream> using namespace std; int main() { long long a,b; cin>> a >> b; cout << a+b << endl; return 0; }

                              • -15
                                @ 2022-11-1 21:56:17

                                #include<bits/stdc++.h> using namespace std; #define set(x) Set(x) #define REP(i,j,k) for (int i=(j),end=(k);i<=end;++i) #define DREP(i,j,k) for (int i=(j),start=(k);i>=start;--i) #define mp make_pair #define x first #define y second #define pb push_back template<typename T> inline bool chkmin(T &a,const T &b){ return a > b ? a = b, 1 : 0; } template<typename T> inline bool chkmax(T &a,const T &b){ return a < b ? a = b, 1 : 0; } typedef long long LL; typedef pair<int,int> node; const int dmax = 1010, oo = 0x3f3f3f3f; int n, m; int a[dmax][dmax] , ans; int d[dmax], e[dmax]; priority_queue <node> q; inline bool operator >(node a,node b){ return a.y>b.y; } bool p[dmax]; void Set(int x){ p[x] = 1; } void unset(int x){ p[x] = 0; } bool check(int x){ return x != 1 && x != n && !p[x] && e[x] > 0; } void preflow(){ e[1] = oo; d[1] = n - 1; q.push(mp(1, n - 1)); set(1); while (!q.empty()) { bool flag = 1; int k = q.top().x; q.pop(), unset(k); DREP(i, n, 1) if ((d[k] == d[i] + 1 || k == 1) && a[k][i] > 0){ flag = 0; int t = min(a[k][i], e[k]); e[k] -= t; a[k][i] -= t; e[i] += t; a[i][k] += t; if (check(i)) { q.push(mp(i, d[i])); set(i); } if (e[k] == 0) break; } if (flag) { d[k] = oo; REP(i, 1, n) if (a[k][i] > 0) chkmin(d[k], d[i] + 1); } if (check(k)) { q.push(mp(k, d[k])); set(k); } } ans = e[n]; } int main() { n = 2, m = 2; int x, y; scanf("%d%d", &x, &y); a[1][2] += x + y; preflow(); printf("%d\n", ans); return 0; }

                                • -15
                                  @ 2022-3-6 13:31:55

                                  前面的说不用long long的,其实用了更好,避免爆掉

                                  代码

                                  #include<bits/stdc++.h>//万能头一开,谁也不爱 using namespace std; int main(){ long long a,b,c;//别爆了 cin >> a >> b; c = a+b;; cout << c; return 0; }

                                  • -17
                                    @ 2022-7-19 13:42:58

                                    本道题测试代码

                                    • -24
                                      @ 2022-9-3 20:23:05
                                      自己思考
                                      

                                      Information

                                      ID
                                      1
                                      Time
                                      1000ms
                                      Memory
                                      16MiB
                                      Difficulty
                                      6
                                      Tags
                                      (None)
                                      # Submissions
                                      5824
                                      Accepted
                                      1934
                                      Uploaded By