QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#859145#9717. Defuse the BombszhenghanyunCompile Error//C++14245b2025-01-17 15:48:052025-01-17 15:48:05

Judging History

你现在查看的是最新测评结果

  • [2025-01-17 15:48:05]
  • 评测
  • [2025-01-17 15:48:05]
  • 提交

answer

#import<iostream>
using std::cin;using I=int64_t;I q,n,c,i,l,r,m,s,a['一'];main(){for(cin>>q,c=1;c<=q;++c){for(cin>>n,i=n;i;)cin>>a[i--];for(l=0,r=3e9;l<r;s<0?r=m:l=m+1)for(s=m=l+r>>1,i=n;i;--i)a[i]<m&&s-=m-a[i];printf("Case #%d: %d\n",c,l);}}

详细

answer.code:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<iostream>
      |  ^~~~~~
answer.code:2:52: warning: multi-character character constant [-Wmultichar]
    2 | using std::cin;using I=int64_t;I q,n,c,i,l,r,m,s,a['一'];main(){for(cin>>q,c=1;c<=q;++c){for(cin>>n,i=n;i;)cin>>a[i--];for(l=0,r=3e9;l<r;s<0?r=m:l=m+1)for(s=m=l+r>>1,i=n;i;--i)a[i]<m&&s-=m-a[i];printf("Case #%d: %d\n",c,l);}}
      |                                                    ^~~~
answer.code:2:58: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    2 | using std::cin;using I=int64_t;I q,n,c,i,l,r,m,s,a['一'];main(){for(cin>>q,c=1;c<=q;++c){for(cin>>n,i=n;i;)cin>>a[i--];for(l=0,r=3e9;l<r;s<0?r=m:l=m+1)for(s=m=l+r>>1,i=n;i;--i)a[i]<m&&s-=m-a[i];printf("Case #%d: %d\n",c,l);}}
      |                                                          ^~~~
answer.code: In function ‘int main()’:
answer.code:2:183: error: lvalue required as left operand of assignment
    2 | using std::cin;using I=int64_t;I q,n,c,i,l,r,m,s,a['一'];main(){for(cin>>q,c=1;c<=q;++c){for(cin>>n,i=n;i;)cin>>a[i--];for(l=0,r=3e9;l<r;s<0?r=m:l=m+1)for(s=m=l+r>>1,i=n;i;--i)a[i]<m&&s-=m-a[i];printf("Case #%d: %d\n",c,l);}}
      |                                                                                                                                                                                 ~~~~~~^~~
answer.code:2:210: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘I’ {aka ‘long int’} [-Wformat=]
    2 | using std::cin;using I=int64_t;I q,n,c,i,l,r,m,s,a['一'];main(){for(cin>>q,c=1;c<=q;++c){for(cin>>n,i=n;i;)cin>>a[i--];for(l=0,r=3e9;l<r;s<0?r=m:l=m+1)for(s=m=l+r>>1,i=n;i;--i)a[i]<m&&s-=m-a[i];printf("Case #%d: %d\n",c,l);}}
      |                                                                                                                                                                                                                 ~^        ~
      |                                                                                                                                                                                                                  |        |
      |                                                                                                                                                                                                                  int      I {aka long int}
      |                                                                                                                                                                                                                 %ld
answer.code:2:214: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘I’ {aka ‘long int’} [-Wformat=]
    2 | using std::cin;using I=int64_t;I q,n,c,i,l,r,m,s,a['一'];main(){for(cin>>q,c=1;c<=q;++c){for(cin>>n,i=n;i;)cin>>a[i--];for(l=0,r=3e9;l<r;s<0?r=m:l=m+1)for(s=m=l+r>>1,i=n;i;--i)a[i]<m&&s-=m-a[i];printf("Case #%d: %d\n",c,l);}}
      |                                                                                                                                                                                                                     ~^      ~
      |                                                                                                                                                                                                                      |      |
      |                                                                                                                                                                                                                      int    I {aka long int}
      |                                                                                                                                                                                                                     %ld