Submission #72371

#TimeUsernameProblemLanguageResultExecution timeMemory
72371신딩없는 신딩팀 (#118)Chocolate Cookie Machine (FXCUP3_chocolate)C++17
0 / 100
384 ms8268 KiB
#include <stdio.h> #include <algorithm> #define pii pair<int,int> #define ff first #define ss second using namespace std; int n,m,k,e; char res[11]; int exp[333333]; pii cant[1111111]; pii rkd[333333]; bool ans[333333]; void subtask1(){ } int deg[333333]; bool com[333333]; void subtask2(){ int cnt=0; for(int i=1;i<=m;i++) ans[exp[i]]=1,cnt++; for(int i=1;i<=e;i++) com[rkd[i].ff]=1; for(int i=1;i<=m;i++){ if(com[cant[i].ff]) deg[cant[i].ss]++; if(com[cant[i].ss]) deg[cant[i].ff]++; } for(int i=1;i<=n;i++){ if(ans[i]) continue; if(deg[i]==e) ans[i]=1,cnt++; } printf("%d\n",cnt); for(int i=1;i<=n;i++){ if(ans[i]) printf("%d ",i); } } int main(){ bool sub2=1; scanf("%d %d %d",&n,&m,&k); for(int i=1;i<=m;i++) scanf("%d",&exp[i]); for(int i=1;i<=k;i++){ int a,b; scanf("%d %d",&cant[i].ff,&cant[i].ss); } scanf("%d",&e); for(int i=1;i<=e;i++){ int num; char a,b,c; scanf(" L + %d = %s",&num,res); if(res[0]=='O') rkd[i]={num,0},sub2=0; else rkd[i]={num,1}; } if(sub2) subtask2(); else subtask1(); return 0; } /* 10 3 4 3 6 9 1 2 2 4 4 8 5 10 2 L + 10 = BOOM L + 2 = BOOM */

Compilation message (stderr)

chocolate.cpp: In function 'int main()':
chocolate.cpp:50:13: warning: unused variable 'a' [-Wunused-variable]
         int a,b;
             ^
chocolate.cpp:50:15: warning: unused variable 'b' [-Wunused-variable]
         int a,b;
               ^
chocolate.cpp:56:14: warning: unused variable 'a' [-Wunused-variable]
         char a,b,c;
              ^
chocolate.cpp:56:16: warning: unused variable 'b' [-Wunused-variable]
         char a,b,c;
                ^
chocolate.cpp:56:18: warning: unused variable 'c' [-Wunused-variable]
         char a,b,c;
                  ^
chocolate.cpp:47:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d",&n,&m,&k);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~
chocolate.cpp:48:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i=1;i<=m;i++) scanf("%d",&exp[i]);
                           ~~~~~^~~~~~~~~~~~~~
chocolate.cpp:51:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d",&cant[i].ff,&cant[i].ss);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
chocolate.cpp:53:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&e);
     ~~~~~^~~~~~~~~
chocolate.cpp:57:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf(" L + %d = %s",&num,res);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...