Submission #920260

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9202602024-02-02 10:58:14vjudge1Council (JOI23_council)C++17
100 / 100
1012 ms61020 KiB
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
#define MAXN (int)pow(2,21)+10
int pc(ll x){
int now=0;
while(x){
now++;
x^=(x&(-x));
}
return now;
}
ll sm[25];
ll num[300010],pnums[300010],pans[300010];
int gs[MAXN];
ll omx[MAXN],osmx[MAXN];
//ll umx[MAXN],usmx[MAXN];
int main(){
//freopen("try.in","r",stdin);
//freopen("try2.out","w",stdout);
memset(gs,0,sizeof gs);
memset(omx,0,sizeof omx);
memset(osmx,0,sizeof osmx);
//memset(umx,0,sizeof umx);
//memset(usmx,0,sizeof usmx);
memset(num,0,sizeof num);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

council.cpp: In function 'int main()':
council.cpp:51:10: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long unsigned int'} and 'int' [-Wsign-compare]
   51 |    if (tp==(n/2)){
      |        ~~^~~~~~~
council.cpp:53:16: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long unsigned int'} and 'int' [-Wsign-compare]
   53 |    }else if (tp>(n/2)){
      |              ~~^~~~~~
council.cpp:109:22: warning: comparison of integer expressions of different signedness: 'int' and 'll' {aka 'long long unsigned int'} [-Wsign-compare]
  109 |   if ((((1<<m)-1-tp1)==num[i])&&(gs[tp1]==1)){
      |        ~~~~~~~~~~~~~~^~~~~~~~
council.cpp:118:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'll' {aka 'long long unsigned int'} [-Wformat=]
  118 |   printf("%d\n",pc(tp1&itp)+pans[i]);
      |           ~^    ~~~~~~~~~~~~~~~~~~~
      |            |               |
      |            int             ll {aka long long unsigned int}
      |           %lld
council.cpp:32:16: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |  int n,m; scanf("%d %d",&n,&m);
      |           ~~~~~^~~~~~~~~~~~~~~
council.cpp:35:17: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |    int tp; scanf("%d",&tp);
      |            ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...