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

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==false; } } } else{ for(int j=1;j<=m[i];j++){ if(a[i]>m[i]/2+1){ t=false; } } } if(t==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:18:14: warning: statement has no effect [-Wunused-value]
      t==false;
              ^
Main.cc:25:7: error: incompatible types in assignment of 'bool' to 'bool [101]'
      t=false;
       ^
Main.cc:29:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if(t==true){
         ^