baloni.cpp: In function 'int main()':
baloni.cpp:19:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (ptr[pt] >= pos[pt].size()) break;
~~~~~~~~^~~~~~~~~~~~~~~~~
baloni.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
baloni.cpp:13:52: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for (int i = 1; i <= n; i++) scanf("%d", &a[i]), pos[a[i]].push_back(i);
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~