Submission #3624200


Source Code Expand

#include<bits/stdc++.h>
using namespace std;

int main(){
    int mod=1000000007;
    int n,ans=0,tmp=0;
    scanf("%d",&n);
    vector<long long> a(n);
    for (auto&e:a) scanf("%d",&e);
    for (int i=0;i<n;i++) {
        tmp=0;
        long long k=a[i];
        for(;;) {
            if (k>1 && k%2==0) {
                k/=2;
                tmp++;
            } else {
                break;
            }
        }
        ans=max(ans,tmp);
    }
    printf("%d\n",ans);
    return 0;
}

Submission Info

Submission Time
Task C - *3 or /2
User nyon
Language C++14 (GCC 5.4.1)
Score 0
Code Size 518 Byte
Status WA
Exec Time 3 ms
Memory 384 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:33: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
     for (auto&e:a) scanf("%d",&e);
                                 ^
./Main.cpp:7:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
                   ^
./Main.cpp:9:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     for (auto&e:a) scanf("%d",&e);
                                  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
WA × 2
AC × 1
WA × 14
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
in01.txt WA 2 ms 384 KB
in02.txt WA 2 ms 384 KB
in03.txt WA 2 ms 384 KB
in04.txt WA 2 ms 384 KB
in05.txt WA 2 ms 384 KB
in06.txt WA 2 ms 384 KB
in07.txt WA 2 ms 384 KB
in08.txt WA 2 ms 384 KB
in09.txt WA 2 ms 384 KB
in10.txt WA 2 ms 384 KB
in11.txt WA 3 ms 384 KB
in12.txt WA 3 ms 384 KB
sample_01.txt WA 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt WA 1 ms 256 KB