結果
問題 | No.333 門松列を数え上げ |
ユーザー |
![]() |
提出日時 | 2016-01-15 22:39:15 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 211 bytes |
コンパイル時間 | 104 ms |
コンパイル使用メモリ | 22,784 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 19:11:01 |
合計ジャッジ時間 | 587 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | int a,b;scanf("%d%d",&a,&b); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <cstdio>using namespace std;//namaega184int main(){int a,b;scanf("%d%d",&a,&b);int ans=0;if(a<b){ans+=b-a-1;ans+=a-1;}else{ans+=2000000000-a;ans+=a-b-1;}printf("%d\n",ans);return 0;}