Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
71606 廖宸睿 19买画笔 C++ Wrong Answer 0 MS 268 KB 360 2024-04-26 21:10:00

Tests(0/5):


Code:

#include <iostream> #include <cstdio> using namespace std; int main() { int n,t=0,h=0; cin>>n; int a[n]; for (int i=0;i<n;i++){ cin>>a[i]; t+=a[i]; } for (int i=0;i<(n+1)/2;i++){ h=(i*2-1)*2+h; } cout<<h-t; return 0; }


Run Info:

------Input------
9 1 1 9 11 3 3 11 5 9
------Answer-----
5
------Your output-----
-23