結果
| 問題 |
No.333 門松列を数え上げ
|
| コンテスト | |
| ユーザー |
Kmcode1
|
| 提出日時 | 2016-01-15 22:34:16 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 706 bytes |
| コンパイル時間 | 844 ms |
| コンパイル使用メモリ | 88,260 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 19:09:37 |
| 合計ジャッジ時間 | 1,441 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 7 |
ソースコード
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
using namespace std;
int a;
int b;
int c;
int main(){
cin >> a >> b;
long long int ans = 0;
if (b < a){
ans += abs(a - b) - 1;
ans += 2000000000 - a;
printf("%lld\n", ans);
}
else{
ans += abs(b - a) - 1;
ans += a - 1;
printf("%lld\n", ans);
}
return 0;
}
Kmcode1