Submission #643167

#TimeUsernameProblemLanguageResultExecution timeMemory
643167marsSpiderman (COCI20_spiderman)C++14
14 / 70
2078 ms4556 KiB
#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 timeMemoryGrader output
Fetching results...