Submission #1063197

#TimeUsernameProblemLanguageResultExecution timeMemory
1063197vjudge1Fortune Telling 2 (JOI14_fortune_telling2)C++17
4 / 100
3024 ms8108 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define ff first #define ss second const int N=200000; ll n,k; vector<vector<ll>>cards(N+10); vector<ll>table(N+10); int main(){ cin >> n >> k; for(ll i=0;i<n;i++){ ll a,b; cin>>a>>b; cards[i]={a,b}; table[i]=0; } for(ll i=0;i<k;i++){ ll t; cin >> t; for(ll j=0;j<n;j++){ if(cards[j][table[j]]<=t){ if(table[j]==1){ table[j]=0; }else if(table[j]==0){ table[j]=1; } } } } ll sum=0; for(ll i=0;i<n;i++){ sum+=cards[i][table[i]]; } cout<<sum<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...