URAL 1010 Discrete Function
【成绩】
| ID | Date | Author | Problem | Language | Judgement result | Test # | Execution time | Memory used |
|---|---|---|---|---|---|---|---|---|
| 2915760 | 06:44:13 6 Feb 2010 |
bake | 1010 | C++ | Accepted | 0.14 | 1 005 KB | |
| 2915757 | 06:42:35 6 Feb 2010 |
bake | 1010 | C++ | Wrong answer | 2 | 0.015 | 217 KB |
| 2915723 | 05:17:32 6 Feb 2010 |
bake | 1010 | C++ | Wrong answer | 2 | 0.015 | 217 KB |
| 2915720 | 05:15:23 6 Feb 2010 |
bake | 1010 | C++ | Wrong answer | 2 | 0.015 | 217 KB |
| 2915719 | 05:14:08 6 Feb 2010 |
bake | 1010 | C++ | Wrong answer | 2 | 0.031 | 217 KB |
【报告】
这个不解释……
题目太阴了——看了NOCOW才知道。
不解释,真的不解释……
【程序】
// TASK: 1010 Discrete Function
#include <cstdlib>
#include <iostream>
#include <cmath>
#define N 100000
using namespace std;
double x[N+1];
long n;
long k;
inline double tanget(long i)
{
return abs((x[i]-x[i+1])/(-1));
}
int main(int argc, char *argv[])
{
cin
>> n;
for (long
i=1;i<=n;i++)
cin >> x[i];
k=1;
for (long
i=2;i<n;i++)
if (tanget(k)-tanget(i)<-1e-7)
k=i;
cout
<< k <<
" " << k+1
<< endl;
// system("PAUSE");
return
EXIT_SUCCESS;
}
为什么来到这,行将终结、匆忙纷扰、并且完全看不到救赎的世界。

浙公网安备 33010602011771号