提出 #49439076


ソースコード 拡げる

// Problem: B - Extended ABC
// Contest: AtCoder - Toyota Programming Contest 2024#1(AtCoder Beginner Contest 337)
// URL: https://atcoder.jp/contests/abc337/tasks/abc337_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>

using namespace std;

// define
#define re register
#define fi first
#define se second
#define il inline
#define co const
#define ls (u << 1)
#define rs (u << 1 | 1)
#define fup(x, l, r) for (re int x = (l), eNd = (r); x <= eNd; ++ x )
#define fdw(x, r, l) for (re int x = (r), eNd = (l); x >= eNd; -- x )
//#define int long long

// typedef
typedef pair<int, int> PII;
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

// const
const int N = 1e6 + 10, M = 2e6 + 10;
const int INF = 2e9, P = 998244353;
const double eps = 1e-6;

// debug
const bool DeBug = true;
int db_cnt;
il void db() { if (DeBug) puts("--------------"); return; }
il void db(auto a) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << '\n'; return; }
il void db(auto a, auto b) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << ", " << b << '\n'; return; }
il void db(auto a, auto b, auto c) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << ", " << b << ", " << c << '\n'; return; }
il void db(auto a, auto b, auto c, auto d) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << ", " << b << ", " << c << ", " << d << '\n'; return; }
il void db(auto a, auto b, auto c, auto d, auto e) { if (DeBug) ++ db_cnt, cout << "-- | t" << db_cnt << " : " << a << ", " << b << ", " << c << ", " << d << ", " << e << '\n'; return; }
il void db(auto *a, auto *b) { if (DeBug) { ++ db_cnt; cout << "-- | t" << db_cnt << " : {"; if (a >= b) cout << "empty"; else { cout << (*a); for (auto *i = a + 1; i < b; ++ i ) cout << ", " << *i; } cout << "}\n"; } return; }

// common functions
il int Max(co auto a, co auto b) { return a > b ? a : b; }
il int Min(co auto a, co auto b) { return a < b ? a : b; }
il LL read() { re LL x = 0; re bool f = true; re char c = getchar(); while (c < 48 || c > 57) { (c == '-') ? f = false : 0; c = getchar(); } while (c > 47 && c < 58) x = (x << 3) + (x << 1) + c - 48, c = getchar(); return f ? x : -x; }
il void read(auto *a, auto *b) { for (auto *i = a; i < b; ++ i ) *i = read(); return; }
il void write(re auto x) { (x < 0) ? putchar('-'), x = -x : 0; (x > 9) ? write(x / 10) : void(); putchar(x % 10 + 48); return; }
il void wel(co auto x) { write(x), putchar('\n'); return; }
il void wel(co auto x, co auto y) { write(x), putchar(' '), write(y), putchar('\n'); return; }
il void wel(co auto x, co auto y, co auto z) { write(x), putchar(' '), write(y), putchar(' '), write(z), putchar('\n'); return; }
il void wsp(co auto x) { write(x), putchar(' '); return; }
il void wel(auto *a, auto *b) { for (auto *i = a; i < b; ++ i ) wsp(*i); puts(""); return; }
il void wel(vector<auto> v) { for (auto i : v) wsp(i); puts(""); return; }

string s;
char now = 'A';

signed main()
{
	cin >> s;
	for (char c : s)
	{
		if (c == now) continue;
		else if (c == now + 1) now ++ ;
		else return puts("No"), 0;
	}
	puts("Yes");
	return 0;
}

提出情報

提出日時
問題 B - Extended ABC
ユーザ huk2
言語 C++ 20 (gcc 12.2)
得点 0
コード長 3293 Byte
結果 WA
実行時間 1 ms
メモリ 3648 KiB

コンパイルエラー

Main.cpp: In function ‘LL read()’:
Main.cpp:50:22: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   50 | il LL read() { re LL x = 0; re bool f = true; re char c = getchar(); while (c < 48 || c > 57) { (c == '-') ? f = false : 0; c = getchar(); } while (c > 47 && c < 58) x = (x << 3) + (x << 1) + c - 48, c = getchar(); return f ? x : -x; }
      |                      ^
Main.cpp:50:37: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   50 | il LL read() { re LL x = 0; re bool f = true; re char c = getchar(); while (c < 48 || c > 57) { (c == '-') ? f = false : 0; c = getchar(); } while (c > 47 && c < 58) x = (x << 3) + (x << 1) + c - 48, c = getchar(); return f ? x : -x; }
      |                                     ^
Main.cpp:50:55: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   50 | il LL read() { re LL x = 0; re bool f = true; re char c = getchar(); while (c < 48 || c > 57) { (c == '-') ? f = false : 0; c = getchar(); } while (c > 47 && c < 58) x = (x << 3) + (x << 1) + c - 48, c = getchar(); return f ? x : -x; }
      |                                                       ^
Main.cpp: At global scope:
Main.cpp:52:23: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   52 | il void write(re auto x) { (x < 0) ? putchar('-'), x = -x : 0; (x > 9) ? write(x / 10) : void(); putchar(x % 10 + 48); return; }
      |                       ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 200
結果
AC × 4
AC × 31
WA × 2
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 01_handmade_10.txt, 01_handmade_11.txt, 01_handmade_12.txt, 01_handmade_13.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt, 02_random_20.txt, 02_random_21.txt, 02_random_22.txt, 02_random_23.txt, 02_random_24.txt, 02_random_25.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3492 KiB
00_sample_01.txt AC 1 ms 3460 KiB
00_sample_02.txt AC 1 ms 3436 KiB
00_sample_03.txt AC 1 ms 3488 KiB
01_handmade_04.txt AC 1 ms 3456 KiB
01_handmade_05.txt AC 1 ms 3492 KiB
01_handmade_06.txt AC 1 ms 3500 KiB
01_handmade_07.txt WA 1 ms 3428 KiB
01_handmade_08.txt AC 1 ms 3492 KiB
01_handmade_09.txt AC 1 ms 3468 KiB
01_handmade_10.txt AC 1 ms 3456 KiB
01_handmade_11.txt WA 1 ms 3496 KiB
01_handmade_12.txt AC 1 ms 3432 KiB
01_handmade_13.txt AC 1 ms 3456 KiB
02_random_07.txt AC 1 ms 3492 KiB
02_random_08.txt AC 1 ms 3444 KiB
02_random_09.txt AC 1 ms 3576 KiB
02_random_10.txt AC 1 ms 3572 KiB
02_random_11.txt AC 1 ms 3492 KiB
02_random_12.txt AC 1 ms 3492 KiB
02_random_13.txt AC 1 ms 3512 KiB
02_random_14.txt AC 1 ms 3436 KiB
02_random_15.txt AC 1 ms 3520 KiB
02_random_16.txt AC 1 ms 3436 KiB
02_random_17.txt AC 1 ms 3504 KiB
02_random_18.txt AC 1 ms 3468 KiB
02_random_19.txt AC 1 ms 3560 KiB
02_random_20.txt AC 1 ms 3488 KiB
02_random_21.txt AC 1 ms 3488 KiB
02_random_22.txt AC 1 ms 3572 KiB
02_random_23.txt AC 1 ms 3500 KiB
02_random_24.txt AC 1 ms 3508 KiB
02_random_25.txt AC 1 ms 3648 KiB