結果

問題 No.73 helloworld
コンテスト
ユーザー matsukin1111
提出日時 2019-04-16 15:13:20
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 1,229 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 679 ms
コンパイル使用メモリ 108,828 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-23 02:31:41
合計ジャッジ時間 1,244 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
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;
      |                 ~~~~~^~~~~~
main.cpp:37:18: note: 'nume' was declared here
   37 |         ll numh, nume, numl, numo, numw, numr, numd;
      |                  ^~~~
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:22: warning: 'numh' may be used uninitialized [-Wmaybe-uninitialized]
   64 |         cout << numh * nume* nl * (numo / 2)*(numo - numo / 2)*numw*numr*numd << endl;
      |                 ~~~~~^~~~~~
main.cpp:37:12: note: 'numh' was declared here
   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:37:30: warning: 'numo' may be used uninitialized [-Wmaybe-uninitialized]
   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, num

ソースコード

diff #
raw source code

#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