제출 #1117181

#제출 시각아이디문제언어결과실행 시간메모리
1117181StefanSebezPIN (CEOI10_pin)C++14
60 / 100
415 ms16456 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define ll long long #define ld long double const int N=50050; int main(){ int n,D;scanf("%i%i",&n,&D); string s[n+10];for(int i=0;i<n;i++) cin>>s[i]; ll res=0; map<string,ll>mapa; for(int i=0;i<n;i++){ for(int mask=0;mask<16;mask++){ string t=s[i];int ct=0; for(int j=0;j<4;j++){ if((mask>>j)&1) t[j]='?',ct++; } if(ct>D) continue; if(D%2==ct%2) res+=mapa[t]; else res-=mapa[t]; } for(int mask=0;mask<16;mask++){ string t=s[i]; for(int j=0;j<4;j++){ if((mask>>j)&1) t[j]='?'; } mapa[t]++; } } printf("%lld\n",res); return 0; }

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

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