Submission #94129

#TimeUsernameProblemLanguageResultExecution timeMemory
94129YigitGo (COCI16_go)C++14
50 / 50
2 ms376 KiB
#include<bits/stdc++.h> using namespace std; int bul(int gerek,int var){ int sonuc=0; while(var>=gerek){ sonuc+=var/gerek; int ekle=(var/gerek)*2; var-=(var/gerek)*gerek; var+=ekle; } return sonuc; } int main(){ int n,diz[10000],i,need,have,toplam=0,ma=0; char ar[10000][21]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s",ar[i]); scanf("%d",&need); scanf("%d",&have); int x=bul(need,have); diz[i]=x; if(diz[ma]<x)ma=i; toplam+=x; } printf("%d\n%s",toplam,ar[ma]); }

Compilation message (stderr)

go.cpp: In function 'int main()':
go.cpp:18:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
go.cpp:20:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",ar[i]);
   ~~~~~^~~~~~~~~~~~
go.cpp:21:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&need);
   ~~~~~^~~~~~~~~~~~
go.cpp:22:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&have);
   ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...