답안 #910191

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
910191 2024-01-18T01:34:55 Z ByeWorld Tracks in the Snow (BOI13_tracks) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops")
#define bupol __builtin_popcount
//#define int long long 
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define lf (id<<1)
#define rg ((id<<1)|1)
#define md ((l+r)>>1)
using namespace std;
const int MAXN = 2e5+5;
const int MAXK = 205;
const int LOG = 20;
const int MOD = 1e9+7;
const int SQRT = 520;
const int INF = 1e9+10;
typedef pair<ll,ll> pii;
typedef pair<ll,pii> ipii;
 
string s[410];

signed main(){
    //ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> h >> w;
    for(int i=0; i<h; i++) cin >> s[i];

    int ans = 0; set<char> x; 
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            if(s[i][j]=='.') continue;
            x.insert(s[i][j]);
        }
    }
    cout << x.size() << '\n';
}

Compilation message

tracks.cpp: In function 'int main()':
tracks.cpp:27:12: error: 'h' was not declared in this scope
   27 |     cin >> h >> w;
      |            ^
tracks.cpp:27:17: error: 'w' was not declared in this scope
   27 |     cin >> h >> w;
      |                 ^
tracks.cpp:30:9: warning: unused variable 'ans' [-Wunused-variable]
   30 |     int ans = 0; set<char> x;
      |         ^~~