제출 #685249

#제출 시각아이디문제언어결과실행 시간메모리
685249Khizri앵무새 (IOI11_parrots)C++17
81 / 100
4 ms1164 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define F first #define S second #define INF 1e18 #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define pii pair<int,int> #define pll pair<ll,ll> #define OK cout<<"Ok"<<endl; #define MOD (ll)(1e9+7) #define endl "\n" void encode(int n, int arr[]) { int x=0; for(int i=0;i<n;i++){ for(int j=0;j<8;j++){ if(arr[i]&(1<<j)){ send(x); } x++; } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define F first #define S second #define INF 1e18 #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define pii pair<int,int> #define pll pair<ll,ll> #define OK cout<<"Ok"<<endl; #define MOD (ll)(1e9+7) #define endl "\n" void decode(int n, int l, int arr[]) { vector<vector<int>>vt(n,vector<int>(8)); for(int i=0;i<l;i++){ int idx=0; for(int j=0;j<8;j++){ if(arr[i]&(1<<j)){ idx+=(1<<j); } } int id=idx/8; int id2=idx-(idx/8)*8; vt[id][id2]=1; } for(int i=0;i<n;i++){ int ans=0; for(int j=0;j<vt[i].size();j++){ if(vt[i][j]){ ans+=(1<<j); } } output(ans); } }

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

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:33:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |         for(int j=0;j<vt[i].size();j++){
      |                     ~^~~~~~~~~~~~~
#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...