답안 #1107553

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1107553 2024-11-01T12:49:28 Z 8pete8 길고양이 (JOI20_stray) C++17
15 / 100
44 ms 16816 KB
#include "Anthony.h"
#include <vector>
#include<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<cassert>
#include<unordered_map>
#include <queue>
#include <cstdint>
#include<cstring>
#include<limits.h>
#include<cmath>
#include<set>
#include<algorithm>
#include <iomanip>
#include<numeric>
#include<bitset>
using namespace std;
#define ll long long
#define f first
#define s second
#define pii pair<int,int>
#define ppii pair<int,pii>
#define vi vector<int>
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define F(n) for(int i=0;i<n;i++)
#define lb lower_bound
#define ub upper_bound
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);
#pragma GCC optimize ("03,unroll-lopps")
using namespace std;
namespace {

int FunctionExample(int i, int A) {
  return i % A;
}
int x=0;

}  // namespace

vector<int> Mark(int n,int m, int a, int b,vector<int> U,vector<int> V) {
  vector<int> X(m);
  vector<int>lvl(n+1,1e9),vis(n,0);
  vector<vector<pii>>adj(n);
  for(int i=0;i<m;i++){
    adj[U[i]].pb({V[i],i}),adj[V[i]].pb({U[i],i});
  }
  queue<int>q;
  lvl[0]=0;
  q.push(0);
  while(!q.empty()){
    int cur=q.front();
    q.pop();
    if(vis[cur])continue;
    vis[cur]=1;
    for(auto i:adj[cur])if(!vis[i.f]&&lvl[i.f]>lvl[cur]+1){
      lvl[i.f]=lvl[cur]+1;
      q.push(i.f);
    }
  }
  if(a>=3){
    for(int i=0;i<n;i++)for(auto j:adj[i]){
      if(lvl[j.f]<lvl[i])X[j.s]=(lvl[j.f]%3);
      else X[j.s]=lvl[i]%3;
    }
  }
  return X;
}
#include "Catherine.h"
#include <vector>
#include<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<cassert>
#include<unordered_map>
#include <queue>
#include <cstdint>
#include<cstring>
#include<limits.h>
#include<cmath>
#include<set>
#include<algorithm>
#include <iomanip>
#include<numeric>
#include<bitset>
using namespace std;
#define ll long long
#define f first
#define s second
#define pii pair<int,int>
#define ppii pair<int,pii>
#define vi vector<int>
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define F(n) for(int i=0;i<n;i++)
#define lb lower_bound
#define ub upper_bound
#define fastio ios::sync_with_stdio(false);cin.tie(NULL);
#pragma GCC optimize ("03,unroll-lopps")
using namespace std;
using namespace std;
namespace {

int a, b;
int variable_example = 0;

}

void Init(int A, int B) {
  ::a = A;
  ::b = B;
}
int Move(vector<int> y){
  if(a>=3){
    int cnt=0;
    for(auto i:y)cnt+=!!i;
    if(cnt==0)assert(0);
    if(cnt==1){
      for(int i=0;i<y.size();i++)if(y[i])return i;
    }
    if(cnt==2){
      if(y[0]&&y[2])return 2;
      if(y[1]&&y[2])return 1;
      if(y[0]&&y[1])return 0;
    }
    assert(0);
  }
  return -1;
}

Compilation message

Anthony.cpp:34:40: warning: bad option '-funroll-lopps' to pragma 'optimize' [-Wpragmas]
   34 | #pragma GCC optimize ("03,unroll-lopps")
      |                                        ^
Anthony.cpp:38:33: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
   38 | int FunctionExample(int i, int A) {
      |                                 ^
Anthony.cpp:45:71: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
   45 | vector<int> Mark(int n,int m, int a, int b,vector<int> U,vector<int> V) {
      |                                                                       ^
Anthony.cpp:41:5: warning: '{anonymous}::x' defined but not used [-Wunused-variable]
   41 | int x=0;
      |     ^
Anthony.cpp:38:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
   38 | int FunctionExample(int i, int A) {
      |     ^~~~~~~~~~~~~~~

Catherine.cpp:34:40: warning: bad option '-funroll-lopps' to pragma 'optimize' [-Wpragmas]
   34 | #pragma GCC optimize ("03,unroll-lopps")
      |                                        ^
Catherine.cpp:44:23: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
   44 | void Init(int A, int B) {
      |                       ^
Catherine.cpp:48:23: warning: bad option '-funroll-lopps' to attribute 'optimize' [-Wattributes]
   48 | int Move(vector<int> y){
      |                       ^
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:54:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   54 |       for(int i=0;i<y.size();i++)if(y[i])return i;
      |                   ~^~~~~~~~~
Catherine.cpp: At global scope:
Catherine.cpp:40:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   40 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 15924 KB Output is correct
2 Correct 2 ms 768 KB Output is correct
3 Correct 26 ms 15148 KB Output is correct
4 Correct 34 ms 16816 KB Output is correct
5 Correct 36 ms 16700 KB Output is correct
6 Correct 27 ms 15660 KB Output is correct
7 Correct 30 ms 15676 KB Output is correct
8 Correct 38 ms 16268 KB Output is correct
9 Correct 35 ms 16212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 15924 KB Output is correct
2 Correct 2 ms 768 KB Output is correct
3 Correct 26 ms 15148 KB Output is correct
4 Correct 34 ms 16816 KB Output is correct
5 Correct 36 ms 16700 KB Output is correct
6 Correct 27 ms 15660 KB Output is correct
7 Correct 30 ms 15676 KB Output is correct
8 Correct 38 ms 16268 KB Output is correct
9 Correct 35 ms 16212 KB Output is correct
10 Correct 26 ms 13592 KB Output is correct
11 Correct 26 ms 13520 KB Output is correct
12 Correct 27 ms 13720 KB Output is correct
13 Correct 33 ms 13616 KB Output is correct
14 Correct 41 ms 13660 KB Output is correct
15 Correct 30 ms 14068 KB Output is correct
16 Correct 38 ms 16288 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 13368 KB Output is correct
2 Correct 1 ms 768 KB Output is correct
3 Correct 24 ms 12908 KB Output is correct
4 Correct 36 ms 14636 KB Output is correct
5 Correct 41 ms 14688 KB Output is correct
6 Correct 39 ms 13324 KB Output is correct
7 Correct 32 ms 13372 KB Output is correct
8 Correct 33 ms 13892 KB Output is correct
9 Correct 35 ms 13916 KB Output is correct
10 Correct 35 ms 13840 KB Output is correct
11 Correct 44 ms 13672 KB Output is correct
12 Correct 36 ms 13664 KB Output is correct
13 Correct 36 ms 13584 KB Output is correct
14 Correct 40 ms 14084 KB Output is correct
15 Correct 36 ms 13988 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 13368 KB Output is correct
2 Correct 1 ms 768 KB Output is correct
3 Correct 24 ms 12908 KB Output is correct
4 Correct 36 ms 14636 KB Output is correct
5 Correct 41 ms 14688 KB Output is correct
6 Correct 39 ms 13324 KB Output is correct
7 Correct 32 ms 13372 KB Output is correct
8 Correct 33 ms 13892 KB Output is correct
9 Correct 35 ms 13916 KB Output is correct
10 Correct 35 ms 13840 KB Output is correct
11 Correct 44 ms 13672 KB Output is correct
12 Correct 36 ms 13664 KB Output is correct
13 Correct 36 ms 13584 KB Output is correct
14 Correct 40 ms 14084 KB Output is correct
15 Correct 36 ms 13988 KB Output is correct
16 Correct 27 ms 11676 KB Output is correct
17 Correct 27 ms 11680 KB Output is correct
18 Correct 35 ms 11828 KB Output is correct
19 Correct 33 ms 11680 KB Output is correct
20 Correct 30 ms 12336 KB Output is correct
21 Correct 27 ms 12156 KB Output is correct
22 Correct 34 ms 14104 KB Output is correct
23 Correct 31 ms 11776 KB Output is correct
24 Correct 34 ms 11552 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1040 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 27 ms 11252 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 30 ms 11116 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -