Submission #739255

#TimeUsernameProblemLanguageResultExecution timeMemory
739255onebit1024Data Transfer (IOI19_transfer)C++17
5 / 100
817 ms4884 KiB
#include "transfer.h" #include <bits/stdc++.h> using namespace std; #define pb push_back std::vector<int> get_attachment(std::vector<int> source) { vector<int>ret = source; for(auto x : source)ret.push_back(x); return ret; } std::vector<int> retrieve(std::vector<int> data) { int n = data.size()/3; vector<vector<int>>dp; for(int i = 0;i<data.size();i+=n){ vector<int>p; for(int j = i;j<i+n;++j)p.pb(data[j]); dp.pb(p); } if(dp[0]==dp[1])return dp[0]; if(dp[0]==dp[2])return dp[0]; if(dp[1]==dp[2])return dp[1]; }

Compilation message (stderr)

transfer.cpp: In function 'std::vector<int> retrieve(std::vector<int>)':
transfer.cpp:14:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  for(int i = 0;i<data.size();i+=n){
      |                ~^~~~~~~~~~~~
transfer.cpp:13:21: warning: control reaches end of non-void function [-Wreturn-type]
   13 |  vector<vector<int>>dp;
      |                     ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...