제출 #677915

#제출 시각아이디문제언어결과실행 시간메모리
677915qwerasdfzxclRemittance (JOI19_remittance)C++17
55 / 100
222 ms10452 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; int n; void NO(){ printf("No\n"); exit(0); } int main(){ scanf("%d", &n); vector<int> a, b; for (int i=0;i<n;i++){ int x, y; scanf("%d %d", &x, &y); a.push_back(x); b.push_back(y); } ll q; for (int i=0;i<n;i++){ if (!i){ ll aS = 0, bS = 0; for (int j=0;j<n;j++){ aS += (ll)a[j] * (1<<j); bS += (ll)b[j] * (1<<j); } if (aS!=0 && bS==0) NO(); if (aS < bS) NO(); if ((aS - bS) % ((1LL<<n)-1) != 0) NO(); q = (aS-bS) / ((1LL<<n)-1); } else q = (q+a[i-1]-b[i-1])/2; if (q<0) NO(); //rotate(a.begin(), a.begin()+1, a.end()); //rotate(b.begin(), b.begin()+1, b.end()); } printf("Yes\n"); return 0; }

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

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