ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.
გაგზავნის თარიღი: 20.01.2023 17:02:19
ამოცანა: უცნაური სტატისტიკა
მომხმარებელი: Khetsu
ვერდიქტი: ამოუხსნელი
შეფასება: 0 ქულა
#include<bits/stdc++.h> #define ll long long using namespace std; int main(){ ll n; cin>>n; ll arr1[n+1],arr2[n+1],ans[n+1]; for(ll i=1; i<=n; i++) arr2[k]=k; for(ll i=2; i<=n; i++) cin>arr1[k]; for(ll i=n; i>=2; i--){ ll cnt=0; for(ll j=1; j<=n; j++){ if(cnt==a[i] && arr2[j]!=0) { ans[i]=j; b[j]=0; break; } if(b[j]!=0) cnt++;} } for(ll i=1; i<=n; i++) if(b[i]!=0) ans[1]=i; for(ll i=1; i<=n; i++) cout<<ans[i]<<endl; }
main.cpp: In function 'int main()': main.cpp:9:6: error: 'k' was not declared in this scope arr2[k]=k; ^ main.cpp:11:10: error: 'k' was not declared in this scope cin>arr1[k]; ^ main.cpp:15:9: error: 'a' was not declared in this scope if(cnt==a[i] && arr2[j]!=0) { ^ main.cpp:17:1: error: 'b' was not declared in this scope b[j]=0; ^ main.cpp:20:4: error: 'b' was not declared in this scope if(b[j]!=0) cnt++;} ^ main.cpp:23:4: error: 'b' was not declared in this scope if(b[i]!=0) ans[1]=i; ^