Submission #236347

#TimeUsernameProblemLanguageResultExecution timeMemory
236347dolphingarlicOnes (LMIO17_vienetai)C++14
10 / 100
5 ms384 KiB
#include <bits/stdc++.h> #define FOR(i, x, y) for (int i = x; i < y; i++) typedef long long ll; using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m, d; cin >> n >> m >> d; if (d == 1 && n % m == 0) { // Period: 1 cout << n / m; } else if (d == 3 && n % (3 * m) == 0) { // Period: 037 cout << n / (3 * m) * (3 * m + 6 * (m - 1) + 7); } else if (d == 7 && n % (6 * m) == 0) { // Period: 015873 n /= 6; } else if (d == 9 && n % (9 * m) == 0) { // Period: 012345679 cout << n / (9 * m) * (36 * m + 1); } else return cout << "NESIDALO", 0; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...