Submission #643171

# Submission time Handle Problem Language Result Execution time Memory
643171 2022-09-21T11:27:24 Z MuntherCarrot Spiderman (COCI20_spiderman) C++14
14 / 70
2000 ms 2516 KB
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define ll long long
#define endl "\n"
#define all(x) x.begin(),x.end()
const int MOD = 0, SZ = 1e4+5e3, MX = 1e9;
void solve(){
    int n, k;
    cin >> n >> k;
    int arr[n], ans[n]={};
    for(int &i : arr) cin >> i;
    for(int i=0;i<n;i++){
        if(arr[i] < k) continue;
        for(int j=0;j<n;j++){
            if(j == i) continue;
            if(arr[i] % arr[j] == k) ans[i]++;
        }
    }
    for(int i : ans)
        cout << i << ' ';
}
signed main()
{
    //ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//    int test;
//    cin >> test;
//    while(test--)
       solve();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 21 ms 388 KB Output is correct
2 Correct 22 ms 304 KB Output is correct
3 Execution timed out 2073 ms 980 KB Time limit exceeded
4 Execution timed out 2097 ms 2516 KB Time limit exceeded
5 Execution timed out 2097 ms 980 KB Time limit exceeded
6 Execution timed out 2087 ms 2516 KB Time limit exceeded
7 Execution timed out 2055 ms 980 KB Time limit exceeded
8 Execution timed out 2072 ms 980 KB Time limit exceeded
9 Execution timed out 2093 ms 2516 KB Time limit exceeded
10 Execution timed out 2089 ms 2516 KB Time limit exceeded