/ SeriousOJ /

Record Detail

Compile Error

foo.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.

Code

#include <bits/stdc++.h>
using namespace std;
#define SC               scanf
#define PF               printf
#define ull              unsigned long long
#define ld               long double
#define F                first
#define S                second
#define pb               push_back
#define sort_a(a)        sort(a.begin(),a.end());
#define sort_d(a)        sort(a.rbegin(),a.rend());
#define READ(f)          freopen(f, "r", stdin)
#define WRITE(f)         freopen(f, "w", stdout)
#define rev(s)           reverse(s.begin(),s.end())
#define P(ok)            cout << (ok ? "YES\n": "NO\n")
#define __Heart__              ios_base :: sync_with_stdio(false); cin.tie(NULL);
#define ll long long
typedef pair< ll , ll>                   PII;
void solve()
{
    int a[3] = {} ;
    for(int i = 0 ; i < 3 ; i++) cin >> a[i] ;
    sort(a , a + 3) ;
    int commonNumber = __gcd(a[2] - a[1] , a[1] - a[0]) ;
    if (!commonNumber) commonNumber = 1 ;
    cerr << commonNumber << endl ;
    int Ans = (a[2] - a[1]) / commonNumber + (a[1] - a[0]) / commonNumber ;
    cout << Ans << "\n" ;

}
int main()
{
     __Heart__
     int t ; cin >> t ; while(t--) solve() ;
}

Information

Submit By
Type
Submission
Problem
P1061 Bring equality
Language
C99 (GCC 13.2.0)
Submit At
2024-05-22 10:58:27
Judged At
2024-05-22 10:58:27
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes