結果
| 問題 |
No.112 ややこしい鶴亀算
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2022-08-12 13:13:46 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,489 bytes |
| コンパイル時間 | 675 ms |
| コンパイル使用メモリ | 79,204 KB |
| 最終ジャッジ日時 | 2025-01-30 20:25:34 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <stdio.h>
#include <stdint.h>
#include <iomanip>
using namespace std;
using uint = unsigned int;
using ll = long long;
#define CIN( LL , A ) LL A; cin >> A
#define GETSEGMENT( A , SEPARATOR ) string A; getline( cin , A , SEPARATOR )
#define GETLINE( A ) string A; getline( cin , A )
#define FOR_LL( VAR , INITIAL , FINAL_PLUS_ONE ) for( ll VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ )
#define FOR_ITR( ARRAY , ITR , END ) for( auto ITR = ARRAY .begin() , END = ARRAY .end() ; ITR != END ; ITR ++ )
#define MIN( A ) if( A < min ){ min = A; }
#define MAX( A ) if( max < A ){ max = A; }
#define MINMAX( A ) MIN( A ); MAX( A )
#define RETURN( LL , ANSWER ) const LL answer_for_contest = ( ANSWER ); cout << answer_for_contest << endl; return 0
#define DOUBLE( DIGITS , ANSWER ) const double answer_for_contest = ( ANSWER ); cout << fixed << setprecision( DIGITS ) << answer_for_contest << endl; return 0
template <typename T> inline T Distance( const T& a , const ll& b ){ return a < b ? b - a : a - b; }
int main()
{
CIN( ll , N );
ll min = N * 4;
ll max = 0;
FOR_LL( i , 0 , N ){
CIN( ll , a );
MINMAX( a );
}
if( min == max ){
RETURN( string , min / ( N - 1 ) == 2 ? to_string( N ) + " 0" : "0 " + to_string( N ) );
}
ll sum = max + 2;
ll kame = ( sum - N * 2 ) / 2;
ll tsuru = N - kame;
RETURN( string , to_string( tsuru ) + " " + to_string( kame ) );
}