답안 #202951

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
202951 2020-02-18T19:08:58 Z MKopchev Strongbox (POI11_sej) C++14
70 / 100
1000 ms 6264 KB
#include<bits/stdc++.h>
using namespace std;
const int nmax=3e5+42;
int n;
long long total;
long long inp[nmax];
long long output;

vector<long long> to_test;
void trial(long long num)
{
    if(inp[n]%num)return;
    for(int i=1;i<n;i++)
        if(inp[i]%num==0)return;
    printf("%lld\n",total/num);
    exit(0);
}
int main()
{
    scanf("%lld%i",&total,&n);

    for(int i=1;i<=n;i++)scanf("%lld",&inp[i]);

    output=total;
    for(long long i=1;i*i<=total;i++)
        if(total%i==0)
        {
            to_test.push_back(i);
            to_test.push_back(total/i);
        }
    sort(to_test.begin(),to_test.end());

    for(auto k:to_test)
        trial(k);
    return 0;
}

Compilation message

sej.cpp: In function 'int main()':
sej.cpp:20:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld%i",&total,&n);
     ~~~~~^~~~~~~~~~~~~~~~~~~~
sej.cpp:22:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i=1;i<=n;i++)scanf("%lld",&inp[i]);
                          ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 376 KB Output is correct
2 Correct 6 ms 376 KB Output is correct
3 Correct 6 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 376 KB Output is correct
2 Correct 15 ms 504 KB Output is correct
3 Correct 15 ms 376 KB Output is correct
4 Correct 15 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 380 KB Output is correct
2 Correct 80 ms 652 KB Output is correct
3 Correct 106 ms 376 KB Output is correct
4 Correct 83 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 376 KB Output is correct
2 Correct 89 ms 632 KB Output is correct
3 Correct 108 ms 384 KB Output is correct
4 Correct 66 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 81 ms 376 KB Output is correct
2 Correct 104 ms 760 KB Output is correct
3 Correct 108 ms 376 KB Output is correct
4 Correct 85 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 88 ms 376 KB Output is correct
2 Correct 106 ms 760 KB Output is correct
3 Correct 107 ms 388 KB Output is correct
4 Correct 106 ms 760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 77 ms 504 KB Output is correct
2 Correct 106 ms 372 KB Output is correct
3 Correct 105 ms 376 KB Output is correct
4 Correct 106 ms 636 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 109 ms 2168 KB Output is correct
2 Correct 145 ms 2552 KB Output is correct
3 Execution timed out 1014 ms 2552 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 111 ms 4472 KB Output is correct
2 Correct 161 ms 5116 KB Output is correct
3 Execution timed out 1069 ms 4088 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 102 ms 5132 KB Output is correct
2 Correct 172 ms 6264 KB Output is correct
3 Execution timed out 1077 ms 5112 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 153 ms 4984 KB Output is correct
2 Correct 173 ms 6264 KB Output is correct
3 Execution timed out 1031 ms 5212 KB Time limit exceeded
4 Halted 0 ms 0 KB -