# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
679156 | 2023-01-07T15:15:20 Z | hello_there_123 | Palembang Bridges (APIO15_bridge) | C++17 | 1 ms | 468 KB |
#include<bits/stdc++.h> using namespace std; #define int long long /* 1 5 B 0 A 4 B 1 B 3 A 5 B 7 B 2 A 6 B 1 A 7 */ 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++; } } int s = v.size(); sort(v.begin(),v.end()); int x = v[s/2]; for(int i=0;i<s;i++){ ans+=abs(v[i]-x); assert(1==0); } cout<<ans; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Runtime error | 1 ms | 468 KB | Execution killed with signal 6 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 304 KB | Output is correct |
3 | Runtime error | 1 ms | 428 KB | Execution killed with signal 6 |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 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 | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |