Submission #588791

# Submission time Handle Problem Language Result Execution time Memory
588791 2022-07-04T04:58:15 Z LastRonin Broken Device 2 (JOI22_device2) C++17
10 / 100
768 ms 32432 KB
#pragma GCC optimize("O3")
#include "Anna.h"
#include <bits/stdc++.h> 
#define ll long long
#define ld long double
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define pill pair<ll, ll>
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pld pair<ld, ld>
using namespace std;

namespace {

}

int Declare() {
  return 2000;
}

pair<vector<int>, vector<int> > Anna(long long A) {
	vector<int> X;
	vector<int> Y;
	if(A > 4e6)return mp(X, Y);
	A--;
	for(int j = 2; j <= 4000; j += 2) {
		if(A > j){
			A -= (j + 1);
			continue;
  		}
		int k = A;         	
		ll z = min(k, j/2);
		ll ost = k - z;
		while(z--)X.pb(1);
		while(ost--)Y.pb(1);
		while(X.size() < j/2)X.pb(0);
		while(Y.size() < j/2)Y.pb(0);
		break; 
  	}
	return make_pair(X, Y);
}
#include "Bruno.h"
#include <utility>
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define pill pair<ll, ll>
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pld pair<ld, ld>
using namespace std;

namespace {

int variable_example = 0;

}

long long Bruno(std::vector<int> u) {
  	int cnt = 0;
  	for(auto v : u)
		cnt += v;
	ll L = 0;
	for(int j = 2; j < u.size(); j += 2) {
		L += (j + 1);		
	}
	return L + cnt + 1;
}

Compilation message

Anna.cpp: In function 'std::pair<std::vector<int>, std::vector<int> > Anna(long long int)':
Anna.cpp:38:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   38 |   while(X.size() < j/2)X.pb(0);
      |         ~~~~~~~~~^~~~~
Anna.cpp:39:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   39 |   while(Y.size() < j/2)Y.pb(0);
      |         ~~~~~~~~~^~~~~

Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:26:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |  for(int j = 2; j < u.size(); j += 2) {
      |                 ~~^~~~~~~~~~
Bruno.cpp: At global scope:
Bruno.cpp:17:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   17 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 508 KB Output is correct
2 Correct 18 ms 960 KB Output is correct
3 Correct 23 ms 1184 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 508 KB Output is correct
2 Correct 18 ms 960 KB Output is correct
3 Correct 23 ms 1184 KB Output is correct
4 Correct 539 ms 21936 KB Output is correct
5 Correct 532 ms 21780 KB Output is correct
6 Correct 561 ms 22144 KB Output is correct
7 Correct 544 ms 21676 KB Output is correct
8 Correct 563 ms 22248 KB Output is correct
9 Correct 761 ms 32432 KB Output is correct
10 Correct 768 ms 32376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 508 KB Output is correct
2 Correct 18 ms 960 KB Output is correct
3 Correct 23 ms 1184 KB Output is correct
4 Correct 539 ms 21936 KB Output is correct
5 Correct 532 ms 21780 KB Output is correct
6 Correct 561 ms 22144 KB Output is correct
7 Correct 544 ms 21676 KB Output is correct
8 Correct 563 ms 22248 KB Output is correct
9 Correct 761 ms 32432 KB Output is correct
10 Correct 768 ms 32376 KB Output is correct
11 Incorrect 1 ms 564 KB Wrong Answer [3]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 508 KB Output is correct
2 Correct 18 ms 960 KB Output is correct
3 Correct 23 ms 1184 KB Output is correct
4 Correct 539 ms 21936 KB Output is correct
5 Correct 532 ms 21780 KB Output is correct
6 Correct 561 ms 22144 KB Output is correct
7 Correct 544 ms 21676 KB Output is correct
8 Correct 563 ms 22248 KB Output is correct
9 Correct 761 ms 32432 KB Output is correct
10 Correct 768 ms 32376 KB Output is correct
11 Incorrect 1 ms 564 KB Wrong Answer [3]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 508 KB Output is correct
2 Correct 18 ms 960 KB Output is correct
3 Correct 23 ms 1184 KB Output is correct
4 Correct 539 ms 21936 KB Output is correct
5 Correct 532 ms 21780 KB Output is correct
6 Correct 561 ms 22144 KB Output is correct
7 Correct 544 ms 21676 KB Output is correct
8 Correct 563 ms 22248 KB Output is correct
9 Correct 761 ms 32432 KB Output is correct
10 Correct 768 ms 32376 KB Output is correct
11 Incorrect 1 ms 564 KB Wrong Answer [3]
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 536 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -