提出 #39854366


ソースコード 拡げる

#include<bits/stdc++.h>
using namespace std;
 
void solve(){
   int a,b;
   cin>>a>>b;
   unordered_map<int,char> mp;
   int k = 65;
   for(int i = 0 ;i<27 ;i++){
     if(i==0){
        mp[i]='.';
     }
     else mp[i]=k++;
   }
   vector<vector<int>> v;
   for(int i  = 0 ; i<a ; i++){
     vector<int> v2(b);
     for(int j = 0 ; j<b ; j++){
        cin>>v2[j];
     }
     v.push_back(v2);
   }

  
   for(int i  = 0 ; i<v.size() ; i++){
    for(int j = 0 ; j<v[i].size() ; j++){
        cout<<mp[v[i][j]];
    }
    cout<<"\n";
   }

   

   




}
 
int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    int t=1;
    while (t--) {
    solve();
    }
 
    return 0;
}
/*0. Enough array size? Integer overflow?
 
 
 
1. Think TWICE, Code ONCE!
 
Are there any counterexamples to your algo?
 
 
 
2. Be careful about the BOUNDARIES!
 
N=1? P=1? Something about 0?
 
 
 
3. Do not make STUPID MISTAKES!
 
Time complexity? Memory usage? Precision error?
 
4.Check special cases when size is same || 1 and 0 always ruins the algo */
 

提出情報

提出日時
問題 B - ASCII Art
ユーザ tanishk_07
言語 C++ (GCC 9.2.1)
得点 200
コード長 1137 Byte
結果 AC
実行時間 8 ms
メモリ 3612 KiB

コンパイルエラー

./Main.cpp: In function ‘void solve()’:
./Main.cpp:25:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::vector<int> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   25 |    for(int i  = 0 ; i<v.size() ; i++){
      |                     ~^~~~~~~~~
./Main.cpp:26:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   26 |     for(int j = 0 ; j<v[i].size() ; j++){
      |                     ~^~~~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 4
AC × 13
セット名 テストケース
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_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 02_max_00.txt, 02_max_01.txt, 03_min_00.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 8 ms 3488 KiB
00_sample_01.txt AC 2 ms 3488 KiB
00_sample_02.txt AC 2 ms 3496 KiB
00_sample_03.txt AC 2 ms 3456 KiB
01_random_00.txt AC 2 ms 3576 KiB
01_random_01.txt AC 2 ms 3560 KiB
01_random_02.txt AC 5 ms 3520 KiB
01_random_03.txt AC 2 ms 3556 KiB
01_random_04.txt AC 2 ms 3512 KiB
01_random_05.txt AC 2 ms 3584 KiB
02_max_00.txt AC 2 ms 3612 KiB
02_max_01.txt AC 4 ms 3484 KiB
03_min_00.txt AC 2 ms 3372 KiB