|
|
back to boardWhy I am getting TLE in c++ ? Please help. #include <bits/stdc++.h> using namespace std; int main(){ long long n, res; vector <long long> vt; while(cin>>n){ vt.push_back(n); } int len = vt.size();
for(int i = len-1; i >= 0; i--){ double n = sqrt(vt[i]); printf("%0.4lf\n", n); } return 0; } Edited by author 07.09.2019 11:05 Edited by author 07.09.2019 11:11 Re: Why I am getting TLE in c++ ? Please help. Posted by Dolphin 11 May 2020 03:05 lmao Re: Why I am getting TLE in c++ ? Please help. while(cin>>n) .... Its an infinite loop. Re: Why I am getting TLE in c++ ? Please help. My AC solution also used while (cin >> n) Re: Why I am getting TLE in c++ ? Please help. use EOF for cin Re: Why I am getting TLE in c++ ? Please help. double instead of long long while declaring n and vector. |
|
|