Submission #574731

#TimeUsernameProblemLanguageResultExecution timeMemory
574731Valters07Painting Squares (IOI20_squares)C++14
10 / 100
142 ms504 KiB
#include <bits/stdc++.h>
#include "squares.h"
#pragma GCC optimize("O2,unroll-loops")
#define fio ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define en cin.close();return 0;
#define pb push_back
#define fi first//printf("%lli\n",cur);
#define se second//scanf("%lli",&n);
#define r0 return 0;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<int> paint(int n)
{
	vector<int> labels(n + 1, 1);
	labels.back()=n;
	return labels;
}

int find_location(int n, vector<int> c)
{
    int it = 0;
    while(it<c.size()&&c[it]!=-1)
        it++;
	return n-it;
}

Compilation message (stderr)

squares.cpp: In function 'int find_location(int, std::vector<int>)':
squares.cpp:23:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     while(it<c.size()&&c[it]!=-1)
      |           ~~^~~~~~~~~
squares.cpp:23:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   23 |     while(it<c.size()&&c[it]!=-1)
      |     ^~~~~
squares.cpp:25:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
   25 |  return n-it;
      |  ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...