Submission #821259

#TimeUsernameProblemLanguageResultExecution timeMemory
821259alexander707070Marshmallow Molecules (CCO19_day2problem2)C++14
0 / 25
43 ms6728 KiB
#include<bits/stdc++.h> #define MAXN 100007 using namespace std; int n,m,a[MAXN],b[MAXN],ans,br[MAXN]; vector<int> lines[MAXN]; int main(){ cin>>n>>m; for(int i=1;i<=m;i++){ cin>>a[i]>>b[i]; lines[b[i]].push_back(a[i]); } for(int i=1;i<=n;i++){ for(int f=0;f<lines[i].size();f++){ ans+=br[lines[i][f]]; } for(int f=0;f<lines[i].size();f++){ br[lines[i][f]]++; } } cout<<ans+m<<"\n"; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:17:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         for(int f=0;f<lines[i].size();f++){
      |                     ~^~~~~~~~~~~~~~~~
Main.cpp:20:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |         for(int f=0;f<lines[i].size();f++){
      |                     ~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...