2019 google kt H轮,求大佬帮忙看看

新手第一次做这个,一道题都没做出来😂,求大佬帮忙看看第一道的代码,不懂啥问题,提交WA
#include<iostream>

using namespace std;

const int N = 1e5 +10;
int a[N];
int main(){
    int tc;
    cin>>tc;
    for(int t = 1;t<=tc;t++){
        cout<<"Case #"<<t<<":";
        int n;
        cin >>n;
        int point = 0;
        int c = 1;
        for(int i= 1;i<=n;++i){
            int temp=0;
            cin >> a[i];
            for(int j=1;j<=i;++j){
            if(a[j]>=c)temp+=1;
            }
            if(temp> point){
                point = temp;
                c+=1; 
            }
            cout<<point<<" ";
        }
        cout<<"\n";
}
    return 0;
}


#google##笔试题目#
全部评论
可以用小顶堆,也可以用树状数组+二分
点赞 回复 分享
发布于 2019-11-17 22:08

相关推荐

仁者伍敌:难怪小公司那么挑剔,让你们这些大佬把位置拿了
点赞 评论 收藏
分享
能干的三文鱼刷了10...:公司可能有弄嵌入式需要会画pcb的需求,而且pcb能快速直观看出一个人某方面的实力。看看是否有面试资格。问你问题也能ai出来,pcb这东西能作假概率不高
点赞 评论 收藏
分享
评论
点赞
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务