結果
問題 | No.1860 Magnets |
ユーザー |
|
提出日時 | 2022-03-04 21:41:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,641 bytes |
コンパイル時間 | 589 ms |
コンパイル使用メモリ | 82,828 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 19:47:07 |
合計ジャッジ時間 | 1,390 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 WA * 6 |
ソースコード
// Author:她的店里只卖樱花// Problem: No.1860 Magnets// Contest: yukicoder// URL: https://yukicoder.me/problems/no/1860// Memory Limit: 512 MB// Date: 2022-03-04 20:35:21// Time Limit: 2000 ms/*********************************************** 她的店里只卖樱花 ************************************************/#include <iostream>#include <algorithm>#include <cstring>#include <vector>#include <cmath>#include <unordered_map>#include <queue>using namespace std;#define fi first#define se second#define _for(i,b) for(int i=(0);i<(b);i++)#define rep(i,a,b) for(int i=(a);i<=(b);i++)#define per(i,b,a) for(int i=(b);i>=(a);i--)#define mst(abc,bca) memset(abc,bca,sizeof abc)#define ios_op cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);typedef priority_queue<int, vector<int>, greater<int> > PQ;typedef long long LL;typedef pair<int, int> PII;typedef unsigned long long ULL;const int Inf = 0x3f3f3f3f, Null = 0x80808080;const double eps=1e-6;const double PI=acos(-1.0);const int MOD = 1e9 + 7;const int N = 100010;template <typename T> void inline read(T &x) {int f = 1; x = 0; char s = getchar();while (s < '0' || s > '9') { if (s == '-') f = -1; s = getchar(); }while (s <= '9' && s >= '0') x = x * 10 + (s ^ 48), s = getchar();x *= f;}template <typename T> void print(T x) {if (x < 0) { putchar('-'); print(x); return ; }if (x >= 10) print(x / 10);putchar((x % 10) + '0');}int main (){int n, m;cin >> n >> m;int a = max(n, m), b = n + m - a;cout << b * 2 + (a - b) * 2 - 1 << endl;return 0;}