結果
| 問題 | No.3774 Minimum Cost For Palindrome |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2026-10-24 18:13:20 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 5 ms / 2,000 ms |
| + 207µs | |
| コード長 | 490 bytes |
| 記録 | |
| コンパイル時間 | 242 ms |
| コンパイル使用メモリ | 52,304 KB |
| 実行使用メモリ | 9,828 KB |
| 最終ジャッジ日時 | 2026-10-24 18:13:23 |
| 合計ジャッジ時間 | 2,556 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3774.cc: No.3774 Minimum Cost For Palindrome - yukicoder
*/
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 1000000;
/* typedef */
/* global variables */
char s[MAX_N + 4];
/* subroutines */
/* main */
int main() {
scanf("%s", s);
int n = strlen(s);
int cnt = 0;
for (int i = 0, j = n - 1; i < j; i++, j--)
if (s[i] != s[j]) cnt++;
printf("%d\n", cnt);
return 0;
}
tnakao0123