제출 #807681

#제출 시각아이디문제언어결과실행 시간메모리
807681Essa2006Arranging Shoes (IOI19_shoes)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "shoes.h" #include <cstdio> #include <cassert> using namespace std; #define ll long long #define endl '\n' #define FF firtst #define SS second #define all(a) a.begin(), a.end() #define mod (ll)(1000000007) long long count_swaps(std::vector<int> s) { int ans=0; if(S[0]>0) ans++; return ans; } //int main() { // int n; // assert(1 == scanf("%d", &n)); // vector<int> S(2 * n); // for (int i = 0; i < 2 * n; i++) // assert(1 == scanf("%d", &S[i])); // fclose(stdin); // // long long result = count_swaps(S); // // printf("%lld\n", result); // fclose(stdout); // return 0; //}

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

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:14:8: error: 'S' was not declared in this scope
   14 |     if(S[0]>0)
      |        ^
shoes.cpp:14:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   14 |     if(S[0]>0)
      |     ^~
shoes.cpp:16:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   16 |  return ans;
      |  ^~~~~~