提出 #76048112


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a,c;
  cin >> a;
  vector<string> b(a);
  for (int i=0; i<a; i++) {
     cin >> b.at(i);
     if (b.at(i).at(0) == 'a' || b.at(i).at(0) == 'b' || b.at(i).at(0) == 'c') {
       cout << 2;
     }
     else if (b.at(i).at(0) == 'd' || b.at(i).at(0) == 'e' || b.at(i).at(0) == 'f') {
       cout << 3;
     }
     else if (b.at(i).at(0) == 'g' || b.at(i).at(0) == 'h' || b.at(i).at(0) == 'i') {
       cout << 4;
     }
     else if (b.at(i).at(0) == 'j' || b.at(i).at(0) == 'k' || b.at(i).at(0) == 'l') {
       cout << 5;
     }
     else if (b.at(i).at(0) == 'm' || b.at(i).at(0) == 'n' || b.at(i).at(0) == 'o') {
       cout << 6;
     }
     else if (b.at(i).at(0) == 'p' || b.at(i).at(0) == 'q' || b.at(i).at(0) == 'r' || b.at(i).at(0) == 's') {
       cout << 7;
     }
     else if (b.at(i).at(0) == 't' || b.at(i).at(0) == 'u' || b.at(i).at(0) == 'v') {
       cout << 8;
     }
     else {
       cout << 9;
     }
  }
  cout << endl;
}

提出情報

提出日時
問題 B - 459
ユーザ Kane218
言語 C++23 (GCC 15.2.0)
得点 200
コード長 1046 Byte
結果 AC
実行時間 1 ms
メモリ 3444 KiB

コンパイルエラー

./Main.cpp: In function 'int main()':
./Main.cpp:5:9: warning: unused variable 'c' [-Wunused-variable]
    5 |   int a,c;
      |         ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 20
セット名 テストケース
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt
ケース名 結果 実行時間 メモリ
example_00.txt AC 1 ms 3308 KiB
example_01.txt AC 1 ms 3296 KiB
hand_00.txt AC 1 ms 3336 KiB
hand_01.txt AC 1 ms 3432 KiB
hand_02.txt AC 1 ms 3444 KiB
hand_03.txt AC 1 ms 3260 KiB
hand_04.txt AC 1 ms 3376 KiB
hand_05.txt AC 1 ms 3328 KiB
random_00.txt AC 1 ms 3352 KiB
random_01.txt AC 1 ms 3420 KiB
random_02.txt AC 1 ms 3308 KiB
random_03.txt AC 1 ms 3296 KiB
random_04.txt AC 1 ms 3384 KiB
random_05.txt AC 1 ms 3368 KiB
random_06.txt AC 1 ms 3296 KiB
random_07.txt AC 1 ms 3280 KiB
random_08.txt AC 1 ms 3380 KiB
random_09.txt AC 1 ms 3280 KiB
random_10.txt AC 1 ms 3288 KiB
random_11.txt AC 1 ms 3380 KiB