Submission #219863

#TimeUsernameProblemLanguageResultExecution timeMemory
219863mhy908PIN (CEOI10_pin)C++14
100 / 100
50 ms14200 KiB
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAXX=1700000; int ctoi(char c){ if('0'<=c&&c<='9')return c-'0'; return c-'a'+10; } int n, d; LL arr[MAXX], ans[10]; char str[50010][5]; int main(){ scanf("%d %d", &n, &d); d=4-d; for(int i=1; i<=n; i++)scanf("%s", str[i]+1); for(int mask=0; mask<15; mask++){ memset(arr, 0, sizeof arr); for(int i=1; i<=n; i++){ int tmp=0; for(int j=1; j<=4; j++){ tmp*=36; if(mask&(1<<(j-1)))tmp+=ctoi(str[i][j]); } ans[__builtin_popcount(mask)]+=arr[tmp]++; } } ans[2]-=ans[3]*3; ans[1]-=ans[3]*3+ans[2]*2; ans[0]-=ans[1]+ans[2]+ans[3]; printf("%d", ans[d]); }

Compilation message (stderr)

pin.cpp: In function 'int main()':
pin.cpp:30:21: warning: format '%d' expects argument of type 'int', but argument 2 has type 'LL {aka long long int}' [-Wformat=]
  printf("%d", ans[d]);
               ~~~~~~^
pin.cpp:13:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &d);
  ~~~~~^~~~~~~~~~~~~~~~~
pin.cpp:15:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1; i<=n; i++)scanf("%s", str[i]+1);
                         ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...