結果

問題 No.398 ハーフパイプ(2)
ユーザー 👑 kmjpkmjp
提出日時 2016-07-15 22:52:22
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 442 ms / 2,000 ms
コード長 1,090 bytes
コンパイル時間 1,622 ms
コンパイル使用メモリ 147,044 KB
実行使用メモリ 99,376 KB
最終ジャッジ日時 2023-09-09 22:01:48
合計ジャッジ時間 9,872 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 437 ms
99,268 KB
testcase_01 AC 435 ms
99,248 KB
testcase_02 AC 437 ms
99,308 KB
testcase_03 AC 437 ms
99,260 KB
testcase_04 AC 440 ms
99,244 KB
testcase_05 AC 440 ms
99,376 KB
testcase_06 AC 438 ms
99,300 KB
testcase_07 AC 438 ms
99,264 KB
testcase_08 AC 439 ms
99,272 KB
testcase_09 AC 435 ms
99,244 KB
testcase_10 AC 437 ms
99,248 KB
testcase_11 AC 434 ms
99,344 KB
testcase_12 AC 439 ms
99,300 KB
testcase_13 AC 440 ms
99,260 KB
testcase_14 AC 438 ms
99,268 KB
testcase_15 AC 442 ms
99,260 KB
testcase_16 AC 438 ms
99,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int A;

ll from[101][101][601];
ll to[101][101][601];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	double X;
	cin>>X;
	A=X*4+0.01;
	
	from[100][0][0]=1;
	FOR(i,6) {
		ZERO(to);
		FOR(x,101) FOR(y,101) FOR(j,i*100+1) if(from[x][y][j]) {
			FOR(k,101) to[min(x,k)][max(y,k)][j+k] += from[x][y][j];
		}
		swap(from,to);
	}
	
	ll ret=0;
	FOR(x,101) FOR(y,101) FOR(i,601) if(i-x-y==A) ret += from[x][y][i];
	cout<<ret<<endl;
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}
0