Submission #833538

#TimeUsernameProblemLanguageResultExecution timeMemory
833538vjudge1Exam (eJOI20_exam)C++17
0 / 100
12 ms468 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 10; const int INF = INT_MAX; const long long LINF = LLONG_MAX; const int MOD = 1e9 + 7; const int MOD2 = 998244353; void solv(){ int n; cin >> n; int h[n], t[n]; for(int i = 0; i < n; i++)cin >> h[i]; for(int i = 0; i < n; i++)cin >> t[i]; int temp = t[0]; int ans = 0; int nyala[n] = {}; int now = 0; bool cashin = false; for(int i = 0; i < n; i++){ if(h[i] < temp){ now++; } if(h[i] == temp){ now++; cashin = true; } if(h[i] > temp){ if(cashin){ ans += now; cashin = false; } now = 0; } } cout << ans << endl; } int main(){ int tc = 1; // cin >> tc; while(tc--)solv(); return 0; }

Compilation message (stderr)

exam.cpp: In function 'void solv()':
exam.cpp:21:9: warning: unused variable 'nyala' [-Wunused-variable]
   21 |     int nyala[n] = {};
      |         ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...