結果
| 問題 | No.8119 間に合いませんでした><; |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-18 16:27:24 |
| 言語 | C++17(gcc12) (gcc 12.4.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,688 bytes |
| 記録 | |
| コンパイル時間 | 2,598 ms |
| コンパイル使用メモリ | 223,808 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-17 18:02:47 |
| 合計ジャッジ時間 | 4,422 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 12 WA * 17 |
コンパイルメッセージ
main.cpp: In function ‘void solve(int)’:
main.cpp:20:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
20 | scanf("%c", &c);
| ~~~~~^~~~~~~~~~
main.cpp: In function ‘int main()’:
main.cpp:52:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
52 | scanf("%d\n", &n);
| ~~~~~^~~~~~~~~~~~
main.cpp:63:39: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
63 | rep(hoge, 8 - 0) scanf("%c", &c);
| ~~~~~^~~~~~~~~~
main.cpp:66:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
66 | scanf("%c", &c);
| ~~~~~^~~~~~~~~~
main.cpp:70:44: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
70 | rep(hoge, 28000 - 9) scanf("%c", &c);
| ~~~~~^~~~~~~~~~
main.cpp:73:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
73 | scanf("%c", &c);
| ~~~~~^~~~~~~~~~
main.cpp:77:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
77 | scanf("%c", &c);
| ~~~~~^~~~~~~~~~
main.cpp:81:47: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
81 | rep(hoge, 50000 - 28002) scanf("%c", &c);
|
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
bool s[101];
int dp[11];
char c;
void solve(int n) {
for (int i = 0; i <= n; i++) {
scanf("%c", &c);
s[i] = c == 'o';
}
dp[0] = 1;
int n2 = n / 10;
for (int i = 1; i <= n2; i++) {
int i2 = i * 10;
if (!s[i2]) continue; // 0 で初期化されている保証がないので本当はダメ
long long sum = 0;
for (int k = 1; k <= i; k++) {
sum += s[i2 - 5 * k] * s[i2 - 8 * k] * dp[i - k];
}
dp[i] = sum % 998244353LL;
}
printf("%d", n2); exit(0);
}
int main() {
// input_from_file("input.txt");
// output_to_file("output.txt");
int n;
scanf("%d\n", &n);
if (n & 0b11) {
printf("0"); exit(0);
}
if (n <= 101) {
solve(n);
}
else {
// [0..8)
rep(hoge, 8 - 0) scanf("%c", &c);
// 8
scanf("%c", &c);
if (c == 'o') { printf("525049970"); exit(0); }
// [9..28000)
rep(hoge, 28000 - 9) scanf("%c", &c);
// 28000
scanf("%c", &c);
if (c == 'x') { printf("0"); exit(0); }
// 28001
scanf("%c", &c);
if (c == 'x') { printf("1"); exit(0); }
// [28002..50000)
rep(hoge, 50000 - 28002) scanf("%c", &c);
// 50000
scanf("%c", &c);
if (c == 'x') { printf("500580963"); exit(0); }
// これ以上読みたくないので運ゲーする.
//random_device rng;
//rng() & 1 ? printf("772009413") : printf("497637286");
// [50001..70009)
rep(hoge, 70009 - 50001) scanf("%c", &c);
// 70009
cin >> c;
if (c == 'o') { printf("772009413"); exit(0); }
printf("497637286");
}
}