QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#374475#3716. Simple ArithmeticrukongCompile Error//C++98937b2024-04-02 14:33:362024-04-02 14:33:38

Judging History

你现在查看的是最新测评结果

  • [2024-04-02 14:33:38]
  • 评测
  • [2024-04-02 14:33:36]
  • 提交

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);
      |             ^~~~~~~