제출 #1274588

#제출 시각아이디문제언어결과실행 시간메모리
1274588SmuggingSpunAron (COCI17_aron)C++20
50 / 50
1 ms576 KiB
#include<bits/stdc++.h> #define taskname "A" using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if(fopen(taskname".inp", "r")){ freopen(taskname".inp", "r", stdin); } int n, ans = 2; cin >> n; vector<char>a(n); for(char& x : a){ cin >> x; } for(int i = 1; i < n; i++){ if(a[i] != a[i - 1]){ ans++; } } cout << ans; }

컴파일 시 표준 에러 (stderr) 메시지

aron.cpp: In function 'int main()':
aron.cpp:7:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |                 freopen(taskname".inp", "r", stdin);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...