#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(0);
ll N;cin >> N;
for(int i = 1;i <= (N / 2) + 1;i++){
int res = 0;
for(int j = i;j <= N;j++){
res += j;
if(res >= N){
if(res == N){
cout << i << " " << j << "\n";
}
break;
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
14 ms |
316 KB |
Output is correct |
7 |
Correct |
68 ms |
212 KB |
Output is correct |
8 |
Correct |
742 ms |
296 KB |
Output is correct |
9 |
Execution timed out |
1073 ms |
212 KB |
Time limit exceeded |
10 |
Execution timed out |
1080 ms |
212 KB |
Time limit exceeded |