QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#374475 | #3716. Simple Arithmetic | rukong | Compile Error | / | / | C++98 | 937b | 2024-04-02 14:33:36 | 2024-04-02 14:33: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;
}
詳細信息
answer.code:15:16: warning: integer constant is so large that it is unsigned 15 | if(a==-9223372036854775808&&b==-1) | ^~~~~~~~~~~~~~~~~~~ answer.code:15:9: warning: this decimal constant is unsigned only in ISO C90 15 | if(a==-9223372036854775808&&b==-1) | ^~ answer.code: In function ‘int main()’: answer.code:43:13: error: ‘nullptr’ was not declared in this scope 43 | cin.tie(nullptr); | ^~~~~~~