結果
問題 | No.799 赤黒かーどげぇむ |
ユーザー |
|
提出日時 | 2019-03-19 19:33:17 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 360 bytes |
コンパイル時間 | 498 ms |
コンパイル使用メモリ | 53,824 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 04:53:08 |
合計ジャッジ時間 | 1,198 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d %d %d %d",&n,&r,&n2,&r2); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>#include <stdio.h>using namespace std;int main(){ int n,r,n2,r2,result,result2;scanf("%d %d %d %d",&n,&r,&n2,&r2);int s=r-n+1;int k=r2-n2+1;int ma=max(n,n2);int mi=min(r,r2);int tot=ma-mi;if(tot>0){cout<<s*k<<endl;}else{cout<<s*k-((-1*tot)+1)<<endl;}return 0;}