Submission #821174

#TimeUsernameProblemLanguageResultExecution timeMemory
821174alexander707070Marshmallow Molecules (CCO19_day2problem2)C++14
10 / 25
3920 ms6524 KiB
#include<bits/stdc++.h> #define MAXN 100007 using namespace std; int n,m,a[MAXN],b[MAXN],ans; bool between[5007][5007]; vector<int> lines[MAXN]; bitset<5007> bits[5007],curr; int main(){ cin>>n>>m; for(int i=1;i<=m;i++){ cin>>a[i]>>b[i]; bits[b[i]][a[i]]=1; } for(int i=1;i<=n;i++){ for(int f=1;f<=i-1;f++){ curr=bits[i]&bits[f]; if(curr.count()!=0 and bits[i][f]==0){ bits[i][f]=1; ans++; } } } cout<<ans+m<<"\n"; 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...