結果
| 問題 | No.1748 Parking Lot |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-20 18:30:45 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 1,554 bytes |
| 記録 | |
| コンパイル時間 | 2,009 ms |
| コンパイル使用メモリ | 173,768 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 21:07:55 |
| 合計ジャッジ時間 | 2,886 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long int ;
using ld = long double ;
using P = pair<ll,ll>;
using Graph= vector<vector<ll>>;
struct edge{ll to ; ll cost ;} ;
using graph =vector<vector<edge>> ;
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
#define fi first
#define se second
#define set20 cout<<fixed<<setprecision(20) ;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
long double pi=acos(-1) ;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
ll dx[4] {1,0,-1,0} ;
ll dy[4] {0,1,0,-1} ;
#define debug cout<<888<<endl ;
// sum(x) x以下の和
// sum(a,b) a以上b以下の和
template<typename T>
struct BIT {
int n;
vector<T> d;
BIT(int n=0):n(n),d(n+1) {}
void add(int i, T x=1) { //x=1ならsumは個数のカウント
for (i++; i <= n; i += i&-i) {
d[i] += x;
}
}
T sum(int i) {
T x = 0;
for (i++; i; i -= i&-i) {
x += d[i];
}
return x;
}
T sum(int i,int j) {
if(i>0) return sum(j)-sum(i-1);
else return sum(j) ; }
};
int main(){
ios::sync_with_stdio(false) ;
cin.tie(nullptr) ;
ll n,k ; cin>>n>>k ;
if(n==1){
cout<<1<<endl ;
return 0;
}
if(k==n-1) cout<<n<<endl ;
else{
cout<<n-1<<endl ;
}
return 0 ;
}