結果

問題 No.508 超ゆとり教育
ユーザー WA_TLEWA_TLE
提出日時 2017-04-28 23:09:47
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 649 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 71,884 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 19:39:26
合計ジャッジ時間 1,981 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,352 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<string>
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;
typedef long long int llint;
#define  pub push_back

//A
//BABA
int main(void){
	llint n,ansa,ansb,ansc,ok=0;
	cin>>n;
	ansa=(n/1000000)*(n/1000000)*3;
	ansb=(n/1000000)*(n%1000000)*6;
	ansc=(n%1000000)*(n%1000000)*3;
	ansb+=ansc/1000000;
	ansc%=1000000;
	ansa+=ansb/1000000;
	ansb%=1000000;
	if(ansa>0){ printf("%lld",ansa);ok=1; }
	if(ok==1){ printf("%06lld",ansb);ok=1; }
	else if(ansb>0){ printf("%lld",ansb);ok=1; }
	if(ok==1){printf("%06lld",ansc);ok=1;}
	else{ printf("%lld",ansc);}
	printf("\n");
	return 0;
}
0