Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109042 陈铎文 19老李吃水果 C++ Compile Error 0 MS 0 KB 552 2025-01-24 15:04:26

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n,m[101],a[10001],b; bool t[101]={}; cin>>n; for(int i=1;i<=n;i++){ t[i]==true; cin>>m[i]; for(int j=1;j<=m[i];j++){ cin>>b; a[b]++; } if(m[i]%2==0){ for(int j=1;j<=m[i];j++){ if(a[i]>m[i]/2){ t[i]=false; } } } else{ for(int j=1;j<=m[i];j++){ if(a[i]>m[i]/2+1){ t[i]=false; } } } } for(int i=1;i<=m;i++){ if(t[i]==true){ cout<<"Y"<<endl; } else{ cout<<"N"<<endl; } } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:7: warning: statement has no effect [-Wunused-value]
   t[i]==true;
       ^
Main.cc:31:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  for(int i=1;i<=m;i++){
                 ^