Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109041 | 陈铎文 | 19老李吃水果 | C++ | Compile Error | 0 MS | 0 KB | 516 | 2025-01-24 15:03:38 |
#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; } } } if(t==true){ cout<<"Y"<<endl; } else{ cout<<"N"<<endl; } } }
Main.cc: In function 'int main()': Main.cc:9:7: warning: statement has no effect [-Wunused-value] t[i]==true; ^ Main.cc:29:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(t==true){ ^