Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46305 | Hyma | 剪绳子 | C++ | Accepted | 0 MS | 244 KB | 171 | 2024-05-03 09:27:28 |
#include<bits/stdc++.h> using namespace std; int main() { int n,sum=2; cin>>n; if(n>0){ sum+=2*n-1; cout<<sum; } else{ cout<<sum; } return 0; }