제출 #908881

#제출 시각아이디문제언어결과실행 시간메모리
908881vjudge1Pinball (JOI14_pinball)C++17
11 / 100
2 ms348 KiB
#include <bits/stdc++.h> #define S second #define F first #define ll long long #define L F.F #define R F.S #define O S.F #define P S.S using namespace std; ll n, m,xd, arr[1006], res=100000000000, zd; pair<pair<ll,ll>,pair<ll,ll>> b[100]; char c; string s; set<string> f; int main(){ cin>>m>>n; xd=1; for(int i=0; i<m; i++)xd*=2; for(int i=0; i<m; i++)cin>>b[i].L>>b[i].R>>b[i].O>>b[i].P; for(int i=0; i<xd; i++){ zd=i; ll sp=0;ll dm=0; for(int h=0; h<=n; h++)arr[h]=0; for(int j=0; j<m; j++){ if(zd%2){ for(int h=b[j].L; h<=b[j].R; h++){ arr[h]=1; } arr[b[j].O]=0; dm+=b[j].P; } zd/=2; //cout<<1; } for(int h=1; h<=n; h++){ if(!arr[h])sp++; } if(sp<=1)res=min(res, dm); } if(res!=100000000000)cout<<res; else cout<<-1; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...