5 solutions

  • 0
    @ 2025-7-14 10:54:41

    回调262

    • 0
      @ 2025-7-12 17:16:44

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

      int main() { int n,x=0; int a[105]; while (1) { cin>>n; if(n==0) break;

      for (int i = 0; i < n; i++) {
      	cin >> a[i];
      }
      sort(a, a + n);
      int v = n / 2 + 1;
      int x = 0;
      for (int j = 0; j <=n/2; j++) {
      	x = x + (a[j] /2+ 1);
      }
      cout << x << endl;
      

      } return 0; }

      • -1
        @ 2025-7-12 17:18:47

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

        int main() { int n; int x = 0; int a[105]; while (1) { cin >> n; if (n == 0) break; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); x=0; for (int j = 0; j <= n / 2; j++) { x = x + (a[j] / 2 + 1); } cout << x << endl; } return 0; }

        • -2
          @ 2025-7-12 17:15:44

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

          int main() { int n,x=0; int a[105]; while (1) { cin>>n; if(n==0) break;

          	for (int i = 0; i < n; i++) {
          		cin >> a[i];
          	}
          	sort(a, a + n);
          	int v = n / 2 + 1;
          	int x = 0;
          	for (int j = 0; j <=n/2; j++) {
          		x = x + (a[j] /2+ 1);
          	}
          	cout << x << endl;
          }
          return 0;
          

          }

          • -2
            @ 2025-7-12 17:06:54

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

            int main() { int n, x = 0;

            while ( 1) {
            	cin >> n;
            	if (n == 0)
            		break;
            	int a[101];
            
            	for (int i = 0; i < n; i++) {
            
            		cin >> a[i] ;
            	}
            	sort(a, a + n);
            	int v = n / 2 + 1;
            
            	for (int j = 0; j < v; j++) {
            		x = x + a[j] / 2 + 1;
            	}
            
            }
            cout << x << endl;
            return 0;
            

            }

            • 1

            Information

            ID
            361
            Time
            1000ms
            Memory
            64MiB
            Difficulty
            7
            Tags
            # Submissions
            131
            Accepted
            27
            Uploaded By