# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
821259 | 2023-08-11T08:30:59 Z | alexander707070 | Marshmallow Molecules (CCO19_day2problem2) | C++14 | 43 ms | 6728 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2644 KB | Output is correct |
2 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2644 KB | Output is correct |
2 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 43 ms | 6728 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2644 KB | Output is correct |
2 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |