Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
88170 倪士燊 19老李吃水果 C++ Compile Error 0 MS 0 KB 639 2024-08-18 11:17:47

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int k; int main(){ cin >> k; while(k--) { int n; cin >> n; int t[10001] = {}; int sg; for(int i = 0;i <= n-1; 1++){ cin >> sg; t[sg]++; } int mx = -2e9 for(int i = 1; i<=10000; i++) { if(t[i] > mx) { mx = t[i]; } } if(n % 2 == 0) { if(mx <= n/2) { cout << "Y" << endl; } else { cout << "N" << endl; } } else { if(mx <= n/2+1) { cout << "Y" << endl; } else { cout << "N" << endl; } } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:31: error: lvalue required as increment operand
      for(int i = 0;i <= n-1; 1++){
                               ^
Main.cc:17:3: error: expected ',' or ';' before 'for'
   for(int i = 1; i<=10000; i++)
   ^
Main.cc:17:18: error: 'i' was not declared in this scope
   for(int i = 1; i<=10000; i++)
                  ^