Submission #844525

# Submission time Handle Problem Language Result Execution time Memory
844525 2023-09-05T13:50:52 Z vjudge1 Spiderman (COCI20_spiderman) C++17
14 / 70
2000 ms 2644 KB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define pri pair<int,int>
#define prl pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vp vector<pair<int,int>>
#define vpl vector<pair<ll,ll>>
#define re return 0
#define sqrt sqrtl

int32_t main() {
    int n,k;cin>>n>>k;
    vector<int> h(n); for (int i = 0;i<n;i++) {
        cin>>h[i];
    }
    vector<int> res(n);
    for (int i = 0;i<n;i++) {
        for (int j = 0;j<n;j++) {
            if (i==j) continue;
            if (h[i]%h[j]==k) res[i]++;
        }
    }
    for (int i = 0;i<res.size();i++) {
        cout<<res[i]<<" ";
    }cout<<endl;
    return 0;
}

Compilation message

spiderman.cpp: In function 'int32_t main()':
spiderman.cpp:27:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |     for (int i = 0;i<res.size();i++) {
      |                    ~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 19 ms 348 KB Output is correct
2 Correct 20 ms 348 KB Output is correct
3 Execution timed out 2036 ms 1108 KB Time limit exceeded
4 Execution timed out 2007 ms 2620 KB Time limit exceeded
5 Execution timed out 2009 ms 1112 KB Time limit exceeded
6 Execution timed out 2093 ms 2616 KB Time limit exceeded
7 Execution timed out 2084 ms 1116 KB Time limit exceeded
8 Execution timed out 2063 ms 1084 KB Time limit exceeded
9 Execution timed out 2052 ms 2644 KB Time limit exceeded
10 Execution timed out 2050 ms 2644 KB Time limit exceeded