# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
679161 | 2023-01-07T15:22:14 Z | hello_there_123 | Palembang Bridges (APIO15_bridge) | C++17 | 1 ms | 340 KB |
#include<bits/stdc++.h> using namespace std; #define int long long main(){ int k,n; cin>>k>>n; if(k==1){ int ans = 0; vector<int>v; for(int i=0;i<n;i++){ char a,b; int c,d; cin>>a>>c>>b>>d; if(a == b){ ans+=abs(c-d); } else{ v.push_back(c); v.push_back(d); ans++; } } sort(v.begin(),v.end()); int s = v.size(); int x = v[s/2]; assert(s/2<s); for(int i=0;i<s;i++){ int p = v[i]; ans+=abs(p-x); } cout<<ans; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |