Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
4348 A班-许锘林 买不买 C++ Accepted 100 1 MS 260 KB 380 2025-01-11 11:05:35

Tests(2/2):


#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a[n]; int temp = 0; int max = 0; for(int i = 1;i <= n;i++) { cin>>a[i]; temp += a[i]; if(max < a[i]) { max = a[i]; } } if(temp > 100) { cout<<"Yes"<<endl; cout<<temp - max<<endl; } else { cout<<"No"<<endl; cout<<temp<<endl; } return 0; }


Judgement Protocol: