結果

問題 No.1229 ラグビーの得点パターン
ユーザー y61mpnl
提出日時 2021-02-20 20:07:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 1,866 ms
コンパイル使用メモリ 200,200 KB
最終ジャッジ日時 2025-01-19 02:46:41
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~

ソースコード

diff #

#include<bits/stdc++.h>
using Pt = std::tuple<int,int,int>;

int main(){
	std::set<Pt> pts[101];
	pts[0].insert(Pt(0,0,0));
	for(int i=0; i<101; i++){
		for(auto [t, g, pg]: pts[i]){
			if(i+5<101) pts[i+5].insert(Pt(t+1, g, pg));
			if(i+7<101) pts[i+7].insert(Pt(t+1, g+1, pg));
			if(i+3<101) pts[i+3].insert(Pt(t, g, pg+1));
		}
	}

	int n;
	scanf("%d", &n);
	printf("%ld\n", pts[n].size());
	return 0;
}
	
	
0