結果
| 問題 |
No.3313 Matryoshka
|
| コンテスト | |
| ユーザー |
Cafe1942
|
| 提出日時 | 2025-10-15 15:49:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 494 bytes |
| コンパイル時間 | 493 ms |
| コンパイル使用メモリ | 73,944 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-24 11:50:34 |
| 合計ジャッジ時間 | 4,290 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 16 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
vector<int>L(N), R(N);
for (int i = 0;i < N;i++) {
cin >> L[i] >> R[i];
}
if(N > 2501){
cout<<-1;
return 0;
}
//愚直
int ans = 0;
for (int i = 0;i < N;i++) {
for (int j = i + 1;j < N;j++) {
if(L[i] < L[j] && R[j] < R[i])ans++;
}
}
cout << ans;
return 0;
}
Cafe1942