제출 #28736

#제출 시각아이디문제언어결과실행 시간메모리
28736repeatingUnscrambling a Messy Bug (IOI16_messy)C++11
38 / 100
5 ms384 KiB
#include <bits/stdc++.h> #include "messy.h" #define F first #define S second #define P push #define pb push_back #define MEM(dp,i) memset(dp,i,sizeof(dp)) #define W while #define R return #define C continue #define SI size() #define ll long long #define ld long double #define pll pair<ll,ll> #define pii pair<int,int> #define SF(x) scanf("%I64d",&x) #define SF2(x,y) scanf("%I64d%I64d",&x,&y) #define SF3(x,y,z) scanf("%I64d%I64d%I64d",&x,&y,&z) #define SF4(x,y,z,o) scanf("%I64d%I64d%I64d%I64d",&x,&y,&z,&o) #define all(v) v.begin(),v.end() using namespace std; const long long INF = 1e15; const int MX=200015; vector<int> v; bool b[55]; vector<int> restore_permutation(int n, int w, int r) { string s=""; for(int i=0;i<n;i++){ v.pb(i); s+='0'; } for(int i=0;i<n;i++){ s[i]='1'; add_element(s); } compile_set(); for(int i=0;i<n;i++) s[i]='0'; for(int i=0;i<n;i++){ int p; for(int j=0;j<n;j++){ if(b[j])C; s[j]='1'; bool bol=check_element(s); if(bol){ p=j; break; } s[j]='0'; } v[p]=i; b[p]=1; } return v; }

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:44:13: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized]
         int p;
             ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...