結果

問題 No.73 helloworld
ユーザー matsukin1111matsukin1111
提出日時 2019-04-16 15:13:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,229 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 94,968 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 23:07:50
合計ジャッジ時間 1,395 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:64:74: warning: 'numd' may be used uninitialized [-Wmaybe-uninitialized]
   64 |         cout << numh * nume* nl * (numo / 2)*(numo - numo / 2)*numw*numr*numd << endl;
      |                                                                          ^~~~
main.cpp:37:48: note: 'numd' was declared here
   37 |         ll numh, nume, numl, numo, numw, numr, numd;
      |                                                ^~~~
main.cpp:64:68: warning: 'numr' may be used uninitialized [-Wmaybe-uninitialized]
   64 |         cout << numh * nume* nl * (numo / 2)*(numo - numo / 2)*numw*numr*numd << endl;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.cpp:37:42: note: 'numr' was declared here
   37 |         ll numh, nume, numl, numo, numw, numr, numd;
      |                                          ^~~~
main.cpp:64:63: warning: 'numw' may be used uninitialized [-Wmaybe-uninitialized]
   64 |         cout << numh * nume* nl * (numo / 2)*(numo - numo / 2)*numw*numr*numd << endl;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
main.cpp:37:36: note: 'numw' was declared here
   37 |         ll numh, nume, numl, numo, numw, numr, numd;
      |                                    ^~~~
main.cpp:37:30: warning: 'numo' may be used uninitialized [-Wmaybe-uninitialized]
   37 |         ll numh, nume, numl, numo, numw, numr, numd;
      |                              ^~~~
main.cpp:60:26: warning: 'numl' may be used uninitialized [-Wmaybe-uninitialized]
   60 |         for (ll l = 2; l <= numl - 1; l++) {
      |                        ~~^~~~~~~~~~~
main.cpp:37:24: note: 'numl' was declared here
   37 |         ll numh, nume, numl, numo, numw, numr, numd;
      |                        ^~~~
main.cpp:64:22: warning: 'nume' may be used uninitialized [-Wmaybe-uninitialized]
   64 |         cout << numh * nume* nl * (numo / 2)*(numo - numo / 2)*numw*numr*numd << endl;
      |           

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(int i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(int i = m;i >= n;--i)
#define INF INT_MAX/2
using namespace std;
using ll = long long;
using R = double;
using Data = pair<ll, vector<int>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 50;
struct edge { ll from; ll to; ll cost; };

int main() {
	ll numh, nume, numl, numo, numw, numr, numd;
	rep(i, 0, 26) {
		ll c;
		cin >> c;
		switch (i) {
		case 3:
			numd = c;
		case 4:
			nume = c;
		case 7:
			numh = c;
		case 11:
			numl = c;
		case 14:
			numo = c;
		case 17:
			numr = c;
		case 22:
			numw = c;
		}
	}

	ll nl = 0;
	for (ll l = 2; l <= numl - 1; l++) {
		nl = max(nl, l*(l - 1)*(numl - l) / 2);
	}

	cout << numh * nume* nl * (numo / 2)*(numo - numo / 2)*numw*numr*numd << endl;


	return 0;
}
0