QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#374428 | #3716. Simple Arithmetic | ucup-team1251 | AC ✓ | 3ms | 3632kb | C++17 | 937b | 2024-04-02 14:14:37 | 2024-04-02 14:14:38 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define ull unsigned long long
#define lson k<<1
#define rson (k<<1)|1
#define debug cout<<666<<endl;
using namespace std;
const int N=1e6+5;
void vision()
{
int a,b;
while(cin>>a>>b)
{
// cout<<a;
if(a==-9223372036854775808&&b==-1)
{
cout<<"9223372036854775808"<<'\n';
continue;
}
if(a==0) cout<<0<<"\n";
else if(a>0&&b>0)
{
int d=a/b;
cout<<d<<"\n";
}
else if(a<0&&b<0)
{
ull d=a/b;
cout<<d<<'\n';
}
else
{
int d=a/b;
if(a%b!=0)d--;
cout<<d<<"\n";
}
}
return ;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t=1;
// cin>>t;
while(t--){
vision();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3632kb
input:
3 2 3 -2 -9223372036854775808 1 -9223372036854775808 -1 9223372036854775807 1 9223372036854775807 -1 -9223372036854775808 2 -9223372036854775808 -2 9223372036854775807 2 9223372036854775807 -2 -2076046199237518199 8895005889588087898 -3939164353449408 -1673591601308294572 236330652387008908 24746725...
output:
1 -2 -9223372036854775808 9223372036854775808 9223372036854775807 -9223372036854775807 -4611686018427387904 4611686018427387904 4611686018427387903 -4611686018427387904 -1 0 0 -1 -1 2 -2 -1 0 -2 1 0 0 -2 1 0 -37 0 0 3 -1 8 -1 8 -1 -1 -2 0 0 2 8 -1 0 -1 -2 -1 -5 -7 -1 -2 -3 -1 1 0 -11 -1 2 -1 11 8 0 ...
result:
ok 9875 tokens