Submission #768031

#TimeUsernameProblemLanguageResultExecution timeMemory
768031Trisanu_DasStone Arranging 2 (JOI23_ho_t1)C++17
0 / 100
1 ms300 KiB
#include <bits/stdc++.h>
using namespace std;

int main(){
  int n; cin >> n;
  int a[n]; map<int, int> p; for(int i = 0; i < n; i++)  cin >> a[i], p[a[i++]];
  int i = 0, x; 
  while(i < n, x = a[i]){
    while(i < n && p[x] >= i)cout << x << '\n', i++;
  }
}

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:8:11: warning: left operand of comma operator has no effect [-Wunused-value]
    8 |   while(i < n, x = a[i]){
      |         ~~^~~
Main.cpp:8:18: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    8 |   while(i < n, x = a[i]){
      |                ~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...