/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 532.0 KiB

Code

//* Bismillahir Rahmanir Raheem
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef priority_queue<int> PQ;
typedef priority_queue<int, vector<int> , greater<int>> GPQ;
#define bismillah ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define forcin(n) for(auto &x : n) cin >> x
#define forcout(n) for(auto x : n) cout << x << " "
#define sz(n) (int)n.size()
#define YES cout<< "YES\n"
#define NO cout<< "NO\n"
#define RY {cout<< "YES\n";return;}
#define RN {cout<< "NO\n";return;}
#define F first
#define S second
#define el "\n"
#define sp " "
#define mem(a,b) memset(a,b,sizeof(a)) //shudu 0 & -1
#define gcd(a,b) __gcd(a,b)
#define lcm(x, y) x *(y / gcd(x, y))
#define set_pre(a) cout.unsetf(ios::floatfield); cout.precision(a); cout.setf(ios::fixed,ios::floatfield);
#define preci(x) fixed << setprecision(x)
#define ub upper_bound
#define lb lower_bound
#define bs binary_search
#define count_bits(x) __builtin_popcountll(x)
#define clz(x) __builtin_clzll(x)
#define ctz(x) __builtin_ctzll(x)
const int inf = 2e9;
const ll INF = 9e18;
const double PI = acos(-1);
const double eps = 1e-9;
const int mod = 1e9 + 7;
///King's Move
// Up-down, Left-Right  > loop until 0 to 3
const int dx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; 
const int dy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; 
// const int dx[] = {-2, -2, -1, -1,  1,  1,  2,  2}; ///Knight's Move
// const int dy[] = {-1,  1, -2,  2, -2,  2, -1,  1};
void solve(){
    int x,y;    cin >> x >> y;
    if(x>y)swap(x,y);
    if(x==1)cout << -1 << el;
    else cout << x-1 << el;
}
int main(){
    bismillah
    int t=1 , tc = 1;
    cin >> t;          
    while(t--){
    //  cout << "Case " << tc++ << ": ";  //! for case
        solve();
    }
    return 0; 
}

Information

Submit By
Type
Submission
Problem
P1235 A. Valid Integer
Contest
Happy New Year 2026
Language
C++17 (G++ 13.2.0)
Submit At
2026-01-06 14:36:16
Judged At
2026-01-06 14:36:17
Judged By
Score
100
Total Time
1ms
Peak Memory
532.0 KiB