結果
問題 | No.994 ばらばらコイン |
ユーザー |
![]() |
提出日時 | 2020-02-21 21:50:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 685 bytes |
コンパイル時間 | 1,427 ms |
コンパイル使用メモリ | 164,744 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-08 21:35:39 |
合計ジャッジ時間 | 2,897 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++) #define all(x) (x).begin(), (x).end() #define sz(x) ((int)x.size()) template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } template <class T> using V = vector<T>; using P = pair<int, int>; /* * */ int n, k; signed main() { cin >> n >> k; rep(i, 0, n-1){ int a, b; cin >> a >> b; a--; b--; } if(k > n){ cout << -1 << endl; }else{ cout << k-1 << endl; } return 0; }