Submission #721234

#TimeUsernameProblemLanguageResultExecution timeMemory
721234vjudge1Uzastopni (COCI17_uzastopni)C++17
64 / 80
1073 ms304 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define F first #define S second using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); ll n; cin >> n; for (int i = 4-3; i < n; i++) { ll sum = 0; for (int j = i; j < n; j++) { sum+=j; if (sum == n) { cout << i << " " << j << "\n"; break; } if (sum > n) { break; } } } return 0; } /** 7 2 1 4 7 **/
#Verdict Execution timeMemoryGrader output
Fetching results...