10 条题解

  • 1
    @ 2022-10-26 20:00:37
    #include <iostream>
    #include <stack>
    #include <cmath>
    #include <vector>
    #include <string.h>
    #include <queue>
    #include <stdio.h>
    #include <iomanip>
    #include <cstdio>
    #include <algorithm>
    #define int long long
    using namespace std;
    const int N = 1e2 + 10;
    const int INF = 0x3f3f3f3f;
    int a[N];
    signed main()
    {
    	int n, maxn = -INF, ans = 0;
    	cin >> n;
    	for(int i = 1; i <= n; i++)
    	{
    		cin >> a[i];
    		maxn = max(maxn, a[i]);
    		ans += a[i];
    	}
    	for(int i = 1; i <= n; i++)
    	{
    		if(a[i] == maxn)
    		{
    			ans -= maxn;
    		}
    	}
    	cout << ans << endl;
    	return 0;
    }
    
    • 0
      @ 2024-10-20 18:53:04

      #include using namespace std; int a[2000000],n,k,d=1; int main(){

      cin>>n;
      for (int i=1;i<=n;i++){
      	cin>>a[i]; 
      }
      for (int i;i<=n;i++)
      	if(a[i] > d){
      		d=a[i];
      	}
      cout<<d;
      return 0;
      

      }

      • 0
        @ 2023-4-2 19:46:35

        #include #include<string.h> using namespace std; int a[100]; int main() { int i,maxn=-1000000,N,x=0; cin >> N; for(i = 0;i < N;i++) { cin >> a[i];

        if(a[i]>maxn)maxn=a[i];
        	x+=a[i];
        }	
        for(i=0;i<N;i++)
        {
        	if(a[i]==maxn)x-=maxn;
        }
        cout << x << endl;
        return 0;
        

        }

        • -1
          @ 2025-1-23 11:12:12
          #include<iomanip>
          #include<cmath>
          #include<cstring>
          using namespace std;
          const int N=1e5+10;
          const int INF=0x3f3f3f3f;
          int n,a[N],m,maxx=-INF,y,ans;
          int main()
          {
          	cin>>n;
          	for(int i=1;i<=n;i++)
          	{
          		cin>>a[i];
          		maxx=max(maxx,a[i]);
          	}
          	for(int i=1;i<=n;i++)
          	{
          		if(a[i]!=maxx)
          		ans+=a[i];
          	}
          	cout<<ans;
              return 0;
          }
          
          • -1
            @ 2024-10-30 20:19:28
            #include<iostream>
            #include<string.h>
            using namespace std;
            int a[100];
            int main()
            {
            	int i,maxn=-1000000,N,x=0;
            	cin >> N;
            	for(i = 0;i < N;i++)
            	{
            		cin >> a[i];
            	
            		if(a[i]>maxn)maxn=a[i];
            		x+=a[i];
            	}	
            	for(i=0;i<N;i++)
            	{
            		if(a[i]==maxn)x-=maxn;
            	}
            	cout << x << endl;
            	return 0;
            	
            }
            
            • -1
              @ 2022-3-13 21:03:09
              #include<iostream>
              #include<string.h>
              using namespace std;
              int a[100];
              int main()
              {
              	int i,maxn=-1000000,N,x=0;
              	cin >> N;
              	for(i = 0;i < N;i++)
              	{
              		cin >> a[i];
              	
              		if(a[i]>maxn)maxn=a[i];
              		x+=a[i];
              	}	
              	for(i=0;i<N;i++)
              	{
              		if(a[i]==maxn)x-=maxn;
              	}
              	cout << x << endl;
              	return 0;
              	
              }
              • -1
                @ 2022-1-25 17:06:16
                #include<iostream>
                #include<string.h>
                using namespace std;
                int a[100];
                int main()
                {
                	int i,maxn=-1000000,N,x=0;
                	cin >> N;
                	for(i = 0;i < N;i++)
                	{
                		cin >> a[i];
                	
                		if(a[i]>maxn)maxn=a[i];
                		x+=a[i];
                	}	
                	for(i=0;i<N;i++)
                	{
                		if(a[i]==maxn)x-=maxn;
                	}
                	cout << x << endl;
                	return 0;
                	
                }
                
                
                • -2
                  @ 2024-11-10 11:48:18
                  jjjjjjjjjj
                  
                  • -3
                    @ 2022-7-11 9:11:13

                    //dev c++[[990.cpp]]*******

                    //dev c++[top fanil]]******

                    //dev c++*www.temege.com

                    #include <stdio.h>

                    #include

                    #include <math.h>

                    #include

                    #include

                    #include

                    #include

                    #include <string.h>

                    #include

                    using namespace std;

                    #define LL long long

                    const int N=1e6+10;

                    const int INF=0x3f3f3f3f;

                    int a[110];

                    int main()

                    {

                    int n,maxx=-999999;
                    
                    cin>>n;
                    
                    for(int i=1;i<=n;i++)
                    
                    {
                    
                    	cin>>a[i];
                    
                    	maxx=max(maxx,a[i]);
                    
                    }
                    
                    int sum=0;
                    
                    for(int i=1;i<=n;i++)
                    
                    {
                    
                    	if(maxx!=a[i])
                    
                    	{
                    
                    		sum+=a[i];
                    
                    	}
                    
                    }
                    
                    cout<<sum<<endl;
                    
                    return 0;
                    

                    }

                    • -4
                      @ 2022-7-10 18:37:59

                      #include<stdio.h> #include using namespace std; #define LL long long const int N=1e6+10; const int INF=0x3f3f3f3f; int a[N]; int main() { int n,sum=0; int maxx=-10000; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; maxx=maxx>a[i]?maxx:a[i]; sum+=a[i]; } for(int i=1;i<=n;i++) if(a[i]==maxx) sum-=maxx; cout<<sum<<endl; }

                      • 1

                      信息

                      ID
                      994
                      时间
                      1000ms
                      内存
                      128MiB
                      难度
                      6
                      标签
                      递交数
                      1057
                      已通过
                      338
                      上传者