結果

問題 No.112 ややこしい鶴亀算
ユーザー ゆるく
提出日時 2015-01-27 00:48:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,079 bytes
コンパイル時間 652 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-23 03:19:06
合計ジャッジ時間 1,402 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 14 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<stdio.h>
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back
 
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;

int main()
{
  int n, a, b;
  cin >> n;
  cin >> a;
  if (a == (a + 2 - 4 * n) / (-2)) {
    b = (a + 2 - 4 * n) / (-2);
    cout << b << " " << n - b << endl;    
  }
  else {
    b = (a + 4 - 4 * n) / (-2);
    cout << b << " " << n - b << endl;
  }
  return 0;
}
0