Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
114375 陈骏睿 18高度为k的树 C++ Time Limit Exceeded 1000 MS 264 KB 413 2025-03-22 11:58:53

Tests(0/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,k,m=0; cin>>n; for(int i=1;n<=n;i++){ cin>>k; if(i=k){ m+=i; } } cout<<m; return 0; }