Submission #701587

# Submission time Handle Problem Language Result Execution time Memory
701587 2023-02-21T14:19:05 Z PCTprobability Roads (CEOI20_roads) C++17
0 / 100
4 ms 520 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;
#define fi first
#define se second
#define pb push_back
#define sor(a) sort(a.begin(),a.end())
int main(){
  ll n;
  cin>>n;
  map<ll,vector<pair<ll,ll>>> m;
  for(int i=0;i<n;i++){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    m[a].pb({b,d});
  }
  vector<pair<ll,vector<pair<ll,ll>>>> d;
  for(auto e:m){
    sor(e.se);
    d.pb({e.fi,e.se});
    for(int i=0;i+1<e.se.size();i++){
      cout<<e.fi<<" "<<e.se[i].se<<" "<<e.fi<<" "<<e.se[i+1].fi<<endl;
    }
  }
  sor(d);
  for(int i=0;i+1<d.size();i++){
    cout<<d[i].fi<<" "<<d[i].se.back().se<<" "<<d[i+1].fi<<" "<<d[i+1].se[0].fi<<endl;
  }
}

Compilation message

roads.cpp: In function 'int main()':
roads.cpp:22:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |     for(int i=0;i+1<e.se.size();i++){
      |                 ~~~^~~~~~~~~~~~
roads.cpp:27:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, std::vector<std::pair<long long int, long long int> > > >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |   for(int i=0;i+1<d.size();i++){
      |               ~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Failed 1 ms 304 KB Condition failed: "iA != P2I.end()"
2 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 Failed 4 ms 520 KB Condition failed: "!Cross(S[*pi], S[*pa])"
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 340 KB Output is correct
3 Failed 3 ms 468 KB Condition failed: "!Cross(S[*pi], S[*pa])"
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 340 KB Output is correct
3 Failed 3 ms 468 KB Condition failed: "!Cross(S[*pi], S[*pa])"
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 1 ms 212 KB Condition failed: "iA != P2I.end()"
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 1 ms 300 KB Condition failed: "iA != P2I.end()"
2 Halted 0 ms 0 KB -