結果

問題 No.73 helloworld
ユーザー tonyu0tonyu0
提出日時 2020-03-28 23:58:22
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 492 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 24,832 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2025-01-02 12:25:50
合計ジャッジ時間 1,099 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:3:31: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    3 |   for(int i = 0; i < 26; ++i) scanf("%lld", &a[i]);
      |                               ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | int main() {
main.c:3:31: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    3 |   for(int i = 0; i < 26; ++i) scanf("%lld", &a[i]);
      |                               ^~~~~
main.c:3:31: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:21:3: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
   21 |   printf("%lld\n", ans);
      |   ^~~~~~
main.c:21:3: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:21:3: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
main.c:21:3: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #
プレゼンテーションモードにする

int main() {
long long a[26];
for(int i = 0; i < 26; ++i) scanf("%lld", &a[i]);
long long ans = 1;
ans *= a['h' - 'a'];
ans *= a['e' - 'a'];
ans *= a['w' - 'a'];
ans *= a['d' - 'a'];
ans *= a['r' - 'a'];
ans *= a['o' - 'a'] * a['o' - 'a'] / 4;
long long l = 0;
for (int i = 2; i < a['l' - 'a']; ++i) {
long long left = i * (i - 1) / 2;
long long right = a['l' - 'a'] - i;
if (left * right > l) l = left * right;
}
ans *= l;
printf("%lld\n", ans);
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0