| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 76971 | sh25_zhangzh | 分段函数 | C++ | Accepted | 0 MS | 248 KB | 268 | 2025-12-20 21:09:59 |
#include<iostream> using namespace std; int main() { double x,y; cin>>x; if(x>=0&&x<5) { y=-x+2.5; printf("%.3lf",y); } else if(x>=5&&x<10) { y=2-1.5*(x-3)*(x-3); printf("%.3lf",y); } else { y=x/2-1.5; printf("%.3lf",y); } }