제출 #377619

#제출 시각아이디문제언어결과실행 시간메모리
377619Aldas25Cutting a rectangle (LMIO18_staciakampis)C++14
0 / 100
1 ms364 KiB
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; #define FAST_IO ios_base::sync_with_stdio(0); cin.tie(nullptr) #define FOR(i, a, b) for(int i = (a); i <= (b); i++) #define REP(n) FOR(O, 1, (n)) #define pb push_back #define f first #define s second typedef long double ld; typedef long long ll; typedef pair<int, int> pii; typedef pair<int, pii> piii; typedef vector<int> vi; typedef vector<pii> vii; typedef vector<ll> vl; typedef vector<piii> viii; //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const int MAXN = 500100, MAXK = 23; const ll MOD = 1e9+7; const ll INF = 1e16; const ld PI = asin(1) * 2; void setIO () { FAST_IO; } void setIO (string s) { setIO(); freopen((s+".in").c_str(),"r",stdin); freopen((s+".out").c_str(),"w",stdout); } int n; ll a[MAXN], b[MAXN]; vl ans; int main() { setIO(); cin >> n; FOR(i, 1, n) cin >> a[i] >> b[i]; ll sum = 0; FOR(i ,1, n) sum += a[i]*b[i]; ans.pb(1); if (sum > 2 && sum%2 == 0) { if (a[n] == sum/2) ans.pb(2); } cout << (int)ans.size() << "\n"; for (ll x : ans) cout << x << "\n"; return 0; }

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

staciakampis.cpp: In function 'void setIO(std::string)':
staciakampis.cpp:34:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   34 |   freopen((s+".in").c_str(),"r",stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
staciakampis.cpp:35:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   35 |  freopen((s+".out").c_str(),"w",stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...