QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#132956 | #24. Skiing | hiahiahia | 0 | 0ms | 3524kb | C++14 | 632b | 2023-08-01 11:01:12 | 2023-08-01 11:01:16 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=1000010;
int n;
pair<int,int>s,t;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n;
cin>>s.first>>s.second>>t.first>>t.second;
vector<pair<int,int>>v;v.push_back(s);
for(int i=1;i<=n;i++){
int x1,x2,y;cin>>x1>>x2>>y;
double px=s.first+(double)(t.first-s.first)*(y-s.second)/(t.second-s.second);
if(px<x1){
v.push_back({x1,y});
s={x1,y};
}
if(px>x2){
v.push_back({x2,y});
s={x2,y};
}
}
v.push_back(t);
cout<<v.size()<<'\n';
for(auto pr:v)cout<<pr.first<<' '<<pr.second<<'\n';
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3524kb
input:
199 175052747 997881706 -444101061 -995203708 632498445 934487489 994213208 261388064 504811653 985433204 -597252485 554801620 984846690 -571876793 -99123359 979984168 -944464963 955111086 969795165 -790384528 373348312 964934294 119986918 271285793 959808546 -98194771 361824484 953877664 -929903139...
output:
107 175052747 997881706 632498445 994213208 504811653 985433204 -99123359 979984168 119986918 959808546 -587570440 951197658 -276132908 951034197 -161773375 945711076 799557242 935959169 667392141 866913314 -677980539 817102278 -111179119 807687776 556966334 797092228 -45660530 794296766 -239158682 ...
result:
wrong answer 4th lines differ - expected: '261388064 985433204', found: '504811653 985433204'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%