(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

제출 #538333

#제출 시각아이디문제언어결과실행 시간메모리
538333dantoh000Hop (COCI21_hop)C++14
110 / 110
51 ms5324 KiB
#include <bits/stdc++.h> using namespace std; int n; long long a[1005]; int c[4][4]; int ans[1005][1005]; vector<int> G[4][1005]; int d[4][1005]; int X[1005]; int main(){ scanf("%d",&n); for (int i = 0; i < n; i++){ scanf("%lld",&a[i]); X[i] = 63-__builtin_clzll(a[i]); //printf("%d ",X[i]); } //printf("\n"); for (int i = 0; i < n; i++){ for (int j = 0; j < i; j++){ //printf("final %d %d\n",x,y); if ((X[i]>>2ll) == (X[j]>>2ll)) ans[i][j] = 1; else if ((X[i]>>4ll) == (X[j]>>4ll)) ans[i][j] = 2; else ans[i][j] = 3; } } /* for (int i = 0; i < n; i++){ for (int j = 0; j < i; j++){ //printf("col %d %d->%d\n",ans[i][j],j,i); if (a[i]%a[j] == 0) G[ans[i][j]][i].push_back(j); } } memset(d,0,sizeof(d)); int maxd = 0; for (int i = 1; i <= 3; i++){ for (int j = 0; j < n; j++){ for (auto k : G[i][j]){ d[i][j] = max(d[i][j], d[i][k]+1); } } } for (int i = 1; i <= 3; i++){ for (int j = 0; j < n; j++){ maxd = max(maxd, d[i][j]); printf("%d ",d[i][j]); } printf("\n"); } printf("%d ",maxd); */ for (int i = 0; i < n; i++){ for (int j = 0; j < i; j++){ printf("%d ",ans[i][j]); } printf("\n"); } }

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

Main.cpp: In function 'int main()':
Main.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
Main.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%lld",&a[i]);
      |         ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...