結果
| 問題 |
No.1217 せしすせそ
|
| コンテスト | |
| ユーザー |
akoba
|
| 提出日時 | 2021-01-25 17:08:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 323 bytes |
| コンパイル時間 | 581 ms |
| コンパイル使用メモリ | 63,760 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-22 09:00:56 |
| 合計ジャッジ時間 | 3,938 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 10 |
コンパイルメッセージ
main.cpp: In function 'void solve(const char*)':
main.cpp:8:5: warning: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations]
8 | for (int n = 0; n != 'a' - 'z'; n++) {
| ^~~
main.cpp:8:23: note: within this loop
8 | for (int n = 0; n != 'a' - 'z'; n++) {
| ~~^~~~~~~~~~~~
ソースコード
#include <iostream>
#include <string>
using namespace std;
void solve(const char *s)
{
for (int n = 0; n != 'a' - 'z'; n++) {
char c = 'a' + n;
if (s[n] != c) {
cout << c << "to" << s[n] << endl;
}
}
}
int main()
{
string text;
cin >> text;
solve(text.c_str());
}
akoba