Submission #721221

#TimeUsernameProblemLanguageResultExecution timeMemory
721221vjudge1Uzastopni (COCI17_uzastopni)C++17
24 / 80
1090 ms316 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; } } } return 0; } /** 7 2 1 4 7 **/
#Verdict Execution timeMemoryGrader output
Fetching results...