제출 #944192

#제출 시각아이디문제언어결과실행 시간메모리
944192beepbeepsheep모임들 (IOI18_meetings)C++17
0 / 100
5561 ms4272 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #define ll long long const ll inf=1e18; std::vector<long long> __attribute__((optimize("O3","unroll-loops"), target("arch=sandybridge"), target("avx,avx2,fma"))) minimum_costs(std::vector<int> H, std::vector<int> L, std::vector<int> R) { ll n=H.size(); ll q=L.size(); vector<ll> ans; for (int i=0;i<q;i++){ int tot=0,cnt=0; for (int j=L[i];j<=R[i];j++){ cnt+=2-H[j]; if (tot<cnt) tot=cnt; if (H[j]==2) cnt=0; } if (tot<cnt) tot=cnt; ans.emplace_back((R[i]-L[i]+1)*2-tot); } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:14:8: warning: unused variable 'n' [-Wunused-variable]
   14 |     ll n=H.size();
      |        ^
#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...