/ SeriousOJ /

Record Detail

Runtime Error


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Runtime Error 38ms 1.199 MiB
#3 Wrong Answer 41ms 1.645 MiB

Code

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long int
#define vv vector<long long>
#define dq deque<long long>
#define mpp map<long long,long long>
#define ms multiset<long long>
#define ss set<long long>
#define vpp vector<pair<long long, long long>>
#define MOD 1000000007
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define all(a) a.begin(),a.end()
#define sort_rev(a) sort(a.rbegin(),a.rend())
#define all_n for(int i=0;i<n;i++)
#define print(a) for(auto it:a)cout<<it<<" "
#define print_pair(a) for(auto it:a)cout<<it.first<<" "<<it.second<<endl
#define scan(a,n) for(int i=0;i<n;i++)cin>>a[i]
void requisite(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);cout.tie(nullptr);
}
void solve(){
    ll l,r,x;cin>>l>>r>>x;
    ll d=x<0?-x:x;
    if (abs(l-r)< d){
        cout<<-1 <<" "<<-1<<endl;
        return;
    }
    if (x<0){
        cout<<min(l,r)<< " "<<min(l,r)+x<<endl;
    }
    else{
        cout<<max(l,r)<<" "<<max(l,r)-x<<endl;
    }
}
int main() {
    requisite();
    ll t=1;
    cin>>t;
    while (t--){
        solve();
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1186 Equal to X
Language
C++17 (G++ 13.2.0)
Submit At
2025-04-08 05:05:10
Judged At
2025-04-08 05:05:10
Judged By
Score
1
Total Time
41ms
Peak Memory
1.645 MiB