제출 #537769

#제출 시각아이디문제언어결과실행 시간메모리
537769jamezzzHop (COCI21_hop)C++17
110 / 110
27 ms1288 KiB
#include <bits/stdc++.h>
using namespace std;

#define sf scanf
#define pf printf
typedef long long ll;

int n,pos[1005];
ll x[1005];

int main(){
	sf("%d",&n);
	for(int i=1;i<=n;++i)sf("%lld",&x[i]);
	for(int i=1;i<=n;++i){
		pos[i]=1;
		for(int j=1;j<i;++j){
			if(x[i]%x[j]==0)pos[i]=max(pos[i],pos[j]+1);
		}
	}
	for(int i=2;i<=n;++i){
		for(int j=1;j<i;++j){
			if(x[i]%x[j]!=0){
				pf("1 ");
				continue;
			}
			if(pos[i]/4==pos[j]/4)pf("1 ");
			else if(pos[i]/16==pos[j]/16)pf("2 ");
			else pf("3 ");
		}
		pf("\n");
	}
}

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

Main.cpp: In function 'int main()':
Main.cpp:12:4: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |  sf("%d",&n);
      |    ^
Main.cpp:13:25: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |  for(int i=1;i<=n;++i)sf("%lld",&x[i]);
      |                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...