Submission #774845

#TimeUsernameProblemLanguageResultExecution timeMemory
774845vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; map<int,int>mp; int dp[200001], cnt,n; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; for(int i=1;i<=n;i++) { cin >> dp[i]; mp[dp[i]] = i; } int sav; for(int i = 1;i <= n;i++) { sav = map[dp[i]]; for(int j = 1;j <= sav - i + 1;j++) { cout << dp[i] << '\n'; } i = sav; } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:21:12: error: missing template arguments before '[' token
   21 |   sav = map[dp[i]];
      |            ^