結果
問題 | No.333 門松列を数え上げ |
ユーザー | imulan |
提出日時 | 2016-01-15 22:42:54 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 348 ms |
コンパイル使用メモリ | 54,344 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 19:19:16 |
合計ジャッジ時間 | 806 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 7 |
ソースコード
#include <cstdio> #include <iostream> using namespace std; int main(int argc, char const *argv[]) { long a,b; cin >>a >>b; long l=1, r=2*1e9; long ans=0; if(a<b){ //bが2番目に来てはいけない->最大 ans=b-l-1; } else{ //bが2番目に来てはいけない->最小 ans=r-b-1; } printf("%ld\n", ans); return 0; }